summaryrefslogtreecommitdiff
path: root/devel
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
commit95fd1f6ec9ce583a46e4351179d93b744a17d1ad (patch)
tree614ebca62dbe176d9c75cab1cfeef7c554a336c9 /devel
parent6469e231c2dabc4fdb3edae536776b2c90cf5616 (diff)
downloadpkgsrc-95fd1f6ec9ce583a46e4351179d93b744a17d1ad.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 'devel')
-rw-r--r--devel/GConf/Makefile4
-rw-r--r--devel/Gorm/Makefile3
-rw-r--r--devel/ProjectCenter/Makefile3
-rw-r--r--devel/Renaissance/Makefile3
-rw-r--r--devel/SDL/Makefile.common3
-rw-r--r--devel/SDL/buildlink3.mk3
-rw-r--r--devel/SDL_gfx/Makefile3
-rw-r--r--devel/SDL_ttf/Makefile3
-rw-r--r--devel/allegro/Makefile4
-rw-r--r--devel/anjuta/Makefile3
-rw-r--r--devel/at-spi/Makefile3
-rw-r--r--devel/binutils/builtin.mk76
-rw-r--r--devel/cdk/builtin.mk67
-rw-r--r--devel/coconut/Makefile3
-rw-r--r--devel/cvsup-gui/Makefile5
-rw-r--r--devel/devIL/Makefile3
-rw-r--r--devel/devhelp/Makefile3
-rw-r--r--devel/dlcompat/builtin.mk93
-rw-r--r--devel/edcommon/Makefile3
-rw-r--r--devel/eel/Makefile3
-rw-r--r--devel/eel2/Makefile3
-rw-r--r--devel/gail/Makefile3
-rw-r--r--devel/gal2/Makefile3
-rw-r--r--devel/gal20/Makefile3
-rw-r--r--devel/gcvs/Makefile3
-rw-r--r--devel/gettext-lib/buildlink3.mk5
-rw-r--r--devel/gettext-lib/builtin.mk220
-rw-r--r--devel/giblib/Makefile4
-rw-r--r--devel/glade2/Makefile.common3
-rw-r--r--devel/gnome2-libole2/Makefile4
-rw-r--r--devel/gnustep-base/Makefile4
-rw-r--r--devel/gnustep-examples/Makefile3
-rw-r--r--devel/gnustep-make/Makefile4
-rw-r--r--devel/gscope/Makefile3
-rw-r--r--devel/guile-gtk/Makefile3
-rw-r--r--devel/guile14-gtk/Makefile3
-rw-r--r--devel/jgrasp/Makefile4
-rw-r--r--devel/libast/Makefile4
-rw-r--r--devel/libbonoboui/Makefile3
-rw-r--r--devel/libdockapp/Makefile3
-rw-r--r--devel/libevent/builtin.mk43
-rw-r--r--devel/libgetopt/builtin.mk65
-rw-r--r--devel/libglade2/Makefile3
-rw-r--r--devel/libgnomeui/Makefile3
-rw-r--r--devel/libmatchbox/Makefile3
-rw-r--r--devel/libstroke/Makefile4
-rw-r--r--devel/maketool/Makefile3
-rw-r--r--devel/ncurses/builtin.mk194
-rw-r--r--devel/netbeans-ide/Makefile4
-rw-r--r--devel/ode/Makefile5
-rw-r--r--devel/ogre/Makefile3
-rw-r--r--devel/pango/Makefile3
-rw-r--r--devel/py-idle/Makefile4
-rw-r--r--devel/readline/builtin.mk165
-rw-r--r--devel/tcl-tclcl/Makefile3
-rw-r--r--devel/zlib/builtin.mk113
56 files changed, 675 insertions, 519 deletions
diff --git a/devel/GConf/Makefile b/devel/GConf/Makefile
index eed3a5c4397..c2c549ae224 100644
--- a/devel/GConf/Makefile
+++ b/devel/GConf/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.48 2005/04/11 21:45:17 tv Exp $
+# $NetBSD: Makefile,v 1.49 2005/06/01 18:02:42 jlam Exp $
#
DISTNAME= GConf-1.0.9
@@ -15,7 +15,6 @@ BUILD_DEPENDS= gtk-doc-[0-9]*:../../textproc/gtk-doc
BUILD_USES_MSGFMT= yes
USE_PKGLOCALEDIR= YES
-USE_X11= YES
GNU_CONFIGURE= YES
MAKE_FLAGS+= AM_MAKEFLAGS="BDBBACKEND="
@@ -39,5 +38,6 @@ post-install:
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/oaf/buildlink3.mk"
.include "../../devel/popt/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/Gorm/Makefile b/devel/Gorm/Makefile
index ac6f2a53223..c629c2d350d 100644
--- a/devel/Gorm/Makefile
+++ b/devel/Gorm/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2005/04/11 21:45:17 tv Exp $
+# $NetBSD: Makefile,v 1.25 2005/06/01 18:02:42 jlam Exp $
DISTNAME= Gorm-0.9.2
CATEGORIES= devel gnustep
@@ -8,7 +8,6 @@ MAINTAINER= rh@NetBSD.org
HOMEPAGE= http://www.gnustep.org/
COMMENT= Graphical user interface builder for GNUstep
-USE_X11= yes
NO_CONFIGURE= yes
.include "../../x11/gnustep-back/buildlink3.mk"
diff --git a/devel/ProjectCenter/Makefile b/devel/ProjectCenter/Makefile
index 13f337a91e7..afddc85e2fa 100644
--- a/devel/ProjectCenter/Makefile
+++ b/devel/ProjectCenter/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.18 2005/04/11 21:45:17 tv Exp $
+# $NetBSD: Makefile,v 1.19 2005/06/01 18:02:42 jlam Exp $
DISTNAME= ProjectCenter-0.4.2
CATEGORIES= devel gnustep
@@ -8,7 +8,6 @@ MAINTAINER= rh@NetBSD.org
HOMEPAGE= http://www.gnustep.org/experience/ProjectCenter.html
COMMENT= GNUstep Integrated Development Environment
-USE_X11= yes
NO_CONFIGURE= yes
.include "../../x11/gnustep-back/buildlink3.mk"
diff --git a/devel/Renaissance/Makefile b/devel/Renaissance/Makefile
index 57b1bdc8f8a..5237afc979f 100644
--- a/devel/Renaissance/Makefile
+++ b/devel/Renaissance/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2005/04/11 21:45:17 tv Exp $
+# $NetBSD: Makefile,v 1.6 2005/06/01 18:02:42 jlam Exp $
#
DISTNAME= Renaissance-0.8.0
@@ -10,7 +10,6 @@ MAINTAINER= rh@NetBSD.org
HOMEPAGE= http://www.gnustep.it/Renaissance/
COMMENT= Structured GNUstep user interface development framework
-USE_X11= yes
NO_CONFIGURE= yes
.include "../../x11/gnustep-back/buildlink3.mk"
diff --git a/devel/SDL/Makefile.common b/devel/SDL/Makefile.common
index f5477f518fe..60cbe448aaa 100644
--- a/devel/SDL/Makefile.common
+++ b/devel/SDL/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.21 2005/05/22 20:07:47 jlam Exp $
+# $NetBSD: Makefile.common,v 1.22 2005/06/01 18:02:42 jlam Exp $
DISTNAME= SDL-1.2.8
CATEGORIES= devel games
@@ -11,7 +11,6 @@ COMMENT= Simple DirectMedia Layer, a cross-platform multimedia library
DISTINFO_FILE= ${.CURDIR}/../../devel/SDL/distinfo
PATCHDIR= ${.CURDIR}/../../devel/SDL/patches
-USE_X11= YES
GNU_CONFIGURE= YES
USE_TOOLS+= gmake
USE_LANGUAGES= c c++
diff --git a/devel/SDL/buildlink3.mk b/devel/SDL/buildlink3.mk
index ea466ada835..3505b3c3291 100644
--- a/devel/SDL/buildlink3.mk
+++ b/devel/SDL/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.10 2005/03/27 14:43:47 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.11 2005/06/01 18:02:42 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
SDL_BUILDLINK3_MK:= ${SDL_BUILDLINK3_MK}+
@@ -16,7 +16,6 @@ BUILDLINK_RECOMMENDED.SDL+= SDL>=1.2.7nb4
BUILDLINK_PKGSRCDIR.SDL?= ../../devel/SDL
.endif # SDL_BUILDLINK3_MK
-USE_X11= yes
PTHREAD_OPTS+= require
.include "../../mk/bsd.prefs.mk"
diff --git a/devel/SDL_gfx/Makefile b/devel/SDL_gfx/Makefile
index 49170b2dabe..c82fe69fcae 100644
--- a/devel/SDL_gfx/Makefile
+++ b/devel/SDL_gfx/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2005/05/22 20:07:47 jlam Exp $
+# $NetBSD: Makefile,v 1.23 2005/06/01 18:02:42 jlam Exp $
DISTNAME= SDL_gfx-2.0.13
PKGREVISION= 1
@@ -11,7 +11,6 @@ COMMENT= Basic drawing routines for SDL
USE_TOOLS+= gmake
USE_LIBTOOL= YES
-USE_X11= YES
GNU_CONFIGURE= YES
.if (${MACHINE_ARCH} != "i386")
diff --git a/devel/SDL_ttf/Makefile b/devel/SDL_ttf/Makefile
index 0d2aa0f536a..788728d37ea 100644
--- a/devel/SDL_ttf/Makefile
+++ b/devel/SDL_ttf/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2005/04/11 21:45:17 tv Exp $
+# $NetBSD: Makefile,v 1.20 2005/06/01 18:02:42 jlam Exp $
DISTNAME= SDL_ttf-2.0.7
PKGREVISION= 1
@@ -10,7 +10,6 @@ HOMEPAGE= http://www.libsdl.org/projects/SDL_ttf/
COMMENT= Use TrueType fonts in your SDL applications
USE_LIBTOOL= YES
-USE_X11= YES
GNU_CONFIGURE= YES
.include "../../devel/SDL/buildlink3.mk"
diff --git a/devel/allegro/Makefile b/devel/allegro/Makefile
index b8aa8213972..1d70c121fd4 100644
--- a/devel/allegro/Makefile
+++ b/devel/allegro/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2005/06/01 14:29:58 wiz Exp $
+# $NetBSD: Makefile,v 1.11 2005/06/01 18:02:42 jlam Exp $
DISTNAME= allegro-4.1.18
CATEGORIES= devel
@@ -9,7 +9,6 @@ HOMEPAGE= http://alleg.sourceforge.net/
COMMENT= Allegro game programming library
USE_TOOLS+= gmake
-USE_X11= yes
GNU_CONFIGURE= yes
MAKEFILE= makefile
@@ -33,4 +32,5 @@ SUBST_MESSAGE.oss= "Fixing harcoded audio device."
.include "../../mk/ossaudio.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/anjuta/Makefile b/devel/anjuta/Makefile
index 4d0fcefe08d..d35d07c1c97 100644
--- a/devel/anjuta/Makefile
+++ b/devel/anjuta/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.28 2005/05/22 20:07:47 jlam Exp $
+# $NetBSD: Makefile,v 1.29 2005/06/01 18:02:42 jlam Exp $
#
DISTNAME= anjuta-1.2.2
@@ -23,7 +23,6 @@ DEPENDS+= yelp>=2.4.2:../../misc/yelp
GNU_CONFIGURE= YES
USE_DIRS+= gnome2-1.5
USE_PKGLOCALEDIR= YES
-USE_X11= YES
USE_TOOLS+= gmake
USE_LIBTOOL= YES
diff --git a/devel/at-spi/Makefile b/devel/at-spi/Makefile
index 09329069023..831f96c03c1 100644
--- a/devel/at-spi/Makefile
+++ b/devel/at-spi/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2005/05/22 20:07:47 jlam Exp $
+# $NetBSD: Makefile,v 1.23 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= at-spi-1.6.3
@@ -14,7 +14,6 @@ USE_TOOLS+= gmake
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
-USE_X11= yes
CONFIGURE_ARGS+= --disable-gtk-doc
CONFIGURE_ARGS+= --with-html-dir=${PREFIX}/share/doc
diff --git a/devel/binutils/builtin.mk b/devel/binutils/builtin.mk
index 54ea70ea6a3..d5c9cbded2c 100644
--- a/devel/binutils/builtin.mk
+++ b/devel/binutils/builtin.mk
@@ -1,44 +1,74 @@
-# $NetBSD: builtin.mk,v 1.2 2004/03/29 05:43:29 jlam Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/06/01 18:02:43 jlam Exp $
-# XXX Assume that the base OS provides a built-in binutils.
+BUILTIN_PKG:= binutils
+.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").
+###
+# XXX Assume that the base OS always provides a built-in binutils.
IS_BUILTIN.binutils?= yes
+###
+### 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.binutils)
-USE_BUILTIN.binutils?= ${IS_BUILTIN.binutils}
-PREFER.binutils?= pkgsrc
-
-. if defined(USE_BINUTILS)
-. if !empty(IS_BUILTIN.binutils:M[nN][oO]) || \
- (${PREFER.binutils} == "pkgsrc")
+. if ${PREFER.binutils} == "pkgsrc"
USE_BUILTIN.binutils= no
+. else
+USE_BUILTIN.binutils= ${IS_BUILTIN.binutils}
+. if defined(BUILTIN_PKG.binutils) && \
+ !empty(IS_BUILTIN.binutils:M[yY][eE][sS])
+USE_BUILTIN.binutils= yes
+. for _dep_ in ${BUILDLINK_DEPENDS.binutils}
+. if !empty(USE_BUILTIN.binutils:M[yY][eE][sS])
+USE_BUILTIN.binutils!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.binutils:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
. endif
-. endif
-
-# These versions of NetBSD didn't have a toolchain that was capable of
-# replacing binutils.
#
-_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-*
-_INCOMPAT_BINUTILS+= NetBSD-1.5.*-* NetBSD-1.5[A-X]-*
+# Some platforms don't have a toolchain that can replace pkgsrc binutils.
#
-# XXX _INCOMPAT_BINUTILS settings for other operating systems possibly
-# XXX needed here
+_INCOMPAT_BINUTILS= NetBSD-0.*-* NetBSD-1.[01234]*-* \
+ NetBSD-1.5.*-* NetBSD-1.5[A-X]-*
+. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+USE_BUILTIN.binutils= no
+. endif
+. endfor
+. endif # PREFER.binutils
+.endif
+MAKEVARS+= USE_BUILTIN.binutils
+
+# if USE_BINUTILS is defined, then force the use of a true binutils
+# implementation.
#
-. for _pattern_ in ${_INCOMPAT_BINUTILS} ${INCOMPAT_BINUTILS}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+.if defined(USE_BINUTILS)
+. if !empty(IS_BUILTIN.binutils:M[nN][oO])
USE_BUILTIN.binutils= no
-. endif
-. endfor
-.endif # USE_BUILTIN.binutils
+. 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.binutils?= no
.if !empty(CHECK_BUILTIN.binutils:M[nN][oO])
-.if !empty(USE_BUILTIN.binutils:M[nN][oO])
+. if !empty(USE_BUILTIN.binutils:M[nN][oO])
AR= ${BUILDLINK_PREFIX.binutils}/bin/ar
AS= ${BUILDLINK_PREFIX.binutils}/bin/as
LD= ${BUILDLINK_PREFIX.binutils}/bin/ld
NM= ${BUILDLINK_PREFIX.binutils}/bin/nm
RANLIB= ${BUILDLINK_PREFIX.binutils}/bin/ranlib
-.endif
+. endif
.endif # CHECK_BUILTIN.binutils
diff --git a/devel/cdk/builtin.mk b/devel/cdk/builtin.mk
index 043b9360296..11110f5f13e 100644
--- a/devel/cdk/builtin.mk
+++ b/devel/cdk/builtin.mk
@@ -1,42 +1,47 @@
-# $NetBSD: builtin.mk,v 1.1 2004/04/26 05:09:29 jlam Exp $
+# $NetBSD: builtin.mk,v 1.2 2005/06/01 18:02:43 jlam Exp $
-_CDK_CDK_H= /usr/include/cdk/cdk.h
+BUILTIN_PKG:= cdk
+BUILTIN_FIND_FILES_VAR:= H_CDK
+BUILTIN_FIND_FILES.H_CDK= /usr/include/cdk/cdk.h
+
+.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.cdk)
IS_BUILTIN.cdk= no
-. if exists(${_CDK_CDK_H})
+. if empty(H_CDK:M${LOCALBASE}/*) && exists(${H_CDK})
IS_BUILTIN.cdk= yes
-# XXX
-# XXX Consider the native CDK to be cdk-4.9.9nb1.
-# XXX
-BUILTIN_PKG.cdk= cdk-4.9.9nb1
-BUILDLINK_VARS+= BUILTIN_PKG.cdk
. endif
-BUILDLINK_VARS+= IS_BUILTIN.cdk
-.endif # IS_BUILTIN.cdk
+.endif
+MAKEVARS+= IS_BUILTIN.cdk
+###
+### 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.cdk)
-USE_BUILTIN.cdk?= ${IS_BUILTIN.cdk}
-PREFER.cdk?= pkgsrc
-
-. if defined(BUILTIN_PKG.cdk)
+. if ${PREFER.cdk} == "pkgsrc"
+USE_BUILTIN.cdk= no
+. else
+USE_BUILTIN.cdk= ${IS_BUILTIN.cdk}
+. if defined(BUILTIN_PKG.cdk) && \
+ !empty(IS_BUILTIN.cdk:M[yY][eE][sS])
USE_BUILTIN.cdk= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.cdk}
-. if !empty(USE_BUILTIN.cdk:M[yY][eE][sS])
-USE_BUILTIN.cdk!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.cdk}; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
+. for _dep_ in ${BUILDLINK_DEPENDS.cdk}
+. if !empty(USE_BUILTIN.cdk:M[yY][eE][sS])
+USE_BUILTIN.cdk!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.cdk:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
fi
-. endif
-. endfor
-. endif
-
-. if defined(USE_CDK)
-. if !empty(IS_BUILTIN.cdk:M[nN][oO]) && \
- (${PREFER.cdk} == "pkgsrc")
-USE_BUILTIN.cdk= no
+. endif
+. endfor
. endif
-. endif
-.endif # USE_BUILTIN.cdk
+. endif # PREFER.cdk
+.endif
+MAKEVARS+= USE_BUILTIN.cdk
diff --git a/devel/coconut/Makefile b/devel/coconut/Makefile
index 84e4ca63211..457e0041ad4 100644
--- a/devel/coconut/Makefile
+++ b/devel/coconut/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2005/04/11 21:45:19 tv Exp $
+# $NetBSD: Makefile,v 1.25 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= coconut-0.3.0
@@ -14,7 +14,6 @@ COMMENT= Objective-C library for Unix-like systems
BUILD_DEPENDS+= papaya>=0.1.7:../../devel/papaya
USE_LIBTOOL= YES
-USE_X11= YES
GNU_CONFIGURE= YES
CPPFLAGS+= -I${PREFIX}/include/libxml2/libxml -DGL_GLEXT_LEGACY
MAKE_ENV+= AM_MAKEFLAGS="am__depfiles_maybe="
diff --git a/devel/cvsup-gui/Makefile b/devel/cvsup-gui/Makefile
index 07adaabeb7d..47f086e9f59 100644
--- a/devel/cvsup-gui/Makefile
+++ b/devel/cvsup-gui/Makefile
@@ -1,11 +1,10 @@
-# $NetBSD: Makefile,v 1.10 2004/01/06 00:11:02 xtraeme Exp $
+# $NetBSD: Makefile,v 1.11 2005/06/01 18:02:43 jlam Exp $
.include "${.CURDIR}/../../devel/cvsup/Makefile.common"
PKGNAME= cvsup-gui-16.1.h
-USE_X11= YES
-
CONFLICTS= cvsup-[0-9]*
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/devIL/Makefile b/devel/devIL/Makefile
index 54940a921cf..ef92b25f397 100644
--- a/devel/devIL/Makefile
+++ b/devel/devIL/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2005/04/11 21:45:19 tv Exp $
+# $NetBSD: Makefile,v 1.11 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= DevIL-1.6.6
@@ -14,7 +14,6 @@ COMMENT= Developer's Image Library
WRKSRC= ${WRKDIR}/DevIL
GNU_CONFIGURE= yes
USE_LIBTOOL= yes
-USE_X11= yes
CONFIGURE_ARGS+= --disable-lcms
diff --git a/devel/devhelp/Makefile b/devel/devhelp/Makefile
index e4a214f2a5a..3b487d35b1e 100644
--- a/devel/devhelp/Makefile
+++ b/devel/devhelp/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2005/05/22 20:07:50 jlam Exp $
+# $NetBSD: Makefile,v 1.24 2005/06/01 18:02:43 jlam Exp $
DISTNAME= devhelp-0.7
PKGREVISION= 11
@@ -15,7 +15,6 @@ USE_TOOLS+= gmake
USE_LIBTOOL= yes
USE_PERL5= build
USE_PKGLOCALEDIR= yes
-USE_X11= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --with-html-widget=gtkhtml2
diff --git a/devel/dlcompat/builtin.mk b/devel/dlcompat/builtin.mk
index f8596d87a55..ce3f5b8c518 100644
--- a/devel/dlcompat/builtin.mk
+++ b/devel/dlcompat/builtin.mk
@@ -1,57 +1,62 @@
-# $NetBSD: builtin.mk,v 1.5 2004/12/05 07:01:19 jlam Exp $
+# $NetBSD: builtin.mk,v 1.6 2005/06/01 18:02:43 jlam Exp $
-.for _lib_ in dl
-. if !defined(_BLNK_LIB_FOUND.${_lib_})
-_BLNK_LIB_FOUND.${_lib_}!= \
- if ${TEST} "`${ECHO} /usr/lib/lib${_lib_}.*`" != "/usr/lib/lib${_lib_}.*"; then \
- ${ECHO} "yes"; \
- elif ${TEST} "`${ECHO} /lib/lib${_lib_}.*`" != "/lib/lib${_lib_}.*"; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
-BUILDLINK_VARS+= _BLNK_LIB_FOUND.${_lib_}
-. endif
-.endfor
-.undef _lib_
+BUILTIN_PKG:= dlcompat
+
+BUILTIN_FIND_LIBS:= dl
+BUILTIN_FIND_FILES_VAR:= H_DLFCN
+BUILTIN_FIND_FILES.H_DLFCN= /usr/include/dlfcn.h
-_DLFCN_H= /usr/include/dlfcn.h
+.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.dlcompat)
IS_BUILTIN.dlcompat= no
-. if !empty(_BLNK_LIB_FOUND.dl:M[yY][eE][sS]) && exists(${_DLFCN_H})
+. if empty(H_DLFCN:M${LOCALBASE}/*) && exists(${H_DLFCN}) && \
+ !empty(BUILTIN_LIB_FOUND.dl:M[yY][eE][sS])
IS_BUILTIN.dlcompat= yes
-_DLCOMPAT_VERSION= 20030629
-BUILTIN_PKG.dlcompat= dlcompat-${_DLCOMPAT_VERSION}
-BUILDLINK_VARS+= BUILTIN_PKG.dlcompat
. endif
-BUILDLINK_VARS+= IS_BUILTIN.dlcompat
-.endif # IS_BUILTIN.dlcompat
+.endif
+MAKEVARS+= IS_BUILTIN.dlcompat
-.if !defined(USE_BUILTIN.dlcompat)
-USE_BUILTIN.dlcompat?= ${IS_BUILTIN.dlcompat}
-PREFER.dlcompat?= pkgsrc
+###
+### 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.dlcompat) && \
+ !empty(IS_BUILTIN.dlcompat:M[yY][eE][sS])
+# XXX
+# XXX Consider any built-in dlcompat to be from version 20030629.
+# XXX
+BUILTIN_PKG.dlcompat= dlcompat-20030629
+.endif
+MAKEVARS+= BUILTIN_PKG.dlcompat
-. if defined(BUILTIN_PKG.dlcompat)
+###
+### 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.dlcompat)
+. if ${PREFER.dlcompat} == "pkgsrc"
+USE_BUILTIN.dlcompat= no
+. else
+USE_BUILTIN.dlcompat= ${IS_BUILTIN.dlcompat}
+. if defined(BUILTIN_PKG.dlcompat) && \
+ !empty(IS_BUILTIN.dlcompat:M[yY][eE][sS])
USE_BUILTIN.dlcompat= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.dlcompat}
-. if !empty(USE_BUILTIN.dlcompat:M[yY][eE][sS])
+. for _dep_ in ${BUILDLINK_DEPENDS.dlcompat}
+. if !empty(USE_BUILTIN.dlcompat:M[yY][eE][sS])
USE_BUILTIN.dlcompat!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.dlcompat}; then \
- ${ECHO} "yes"; \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q}' ${BUILTIN_PKG.dlcompat:Q}; then \
+ ${ECHO} yes; \
else \
- ${ECHO} "no"; \
+ ${ECHO} no; \
fi
-. endif
-. endfor
-. endif
-
-. if ${PREFER.dlcompat} == "native"
-USE_BUILTIN.dlcompat= yes
-. endif
-
-. if !empty(IS_BUILTIN.dlcompat:M[nN][oO]) || \
- (${PREFER.dlcompat} == "pkgsrc")
-USE_BUILTIN.dlcompat= no
-. endif
-.endif # USE_BUILTIN.dlcompat
+. endif
+. endfor
+. endif
+. endif # PREFER.dlcompat
+.endif
+MAKEVARS+= USE_BUILTIN.dlcompat
diff --git a/devel/edcommon/Makefile b/devel/edcommon/Makefile
index c1829926a11..3cd7ad2c5c0 100644
--- a/devel/edcommon/Makefile
+++ b/devel/edcommon/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2005/04/11 21:45:20 tv Exp $
+# $NetBSD: Makefile,v 1.3 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= ${PKGNAME}-s
@@ -11,7 +11,6 @@ HOMEPAGE= http://www.mulle-kybernetik.com/software/EDFrameworks/Downloads/
COMMENT= Foundation and AppKit extensions
WRKSRC= ${WRKDIR}/ed/EDCommon
-USE_X11= yes
MAKE_ENV+= ADDITIONAL_OBJCFLAGS="-Wno-import -I${WRKSRC}/.."
diff --git a/devel/eel/Makefile b/devel/eel/Makefile
index 279fe19b851..937565789b8 100644
--- a/devel/eel/Makefile
+++ b/devel/eel/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.24 2005/05/22 20:07:50 jlam Exp $
+# $NetBSD: Makefile,v 1.25 2005/06/01 18:02:43 jlam Exp $
DISTNAME= eel-1.0.2
CATEGORIES= devel gnome
@@ -15,7 +15,6 @@ USE_TOOLS+= gmake
USE_LIBTOOL= yes
USE_PERL5= build
USE_PKGLOCALEDIR= yes
-USE_X11= yes
GNU_CONFIGURE= yes
LTCONFIG_OVERRIDE= ${WRKSRC}/ltconfig
diff --git a/devel/eel2/Makefile b/devel/eel2/Makefile
index b5e6b4475b6..1c5bbfd9380 100644
--- a/devel/eel2/Makefile
+++ b/devel/eel2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.40 2005/05/22 20:07:50 jlam Exp $
+# $NetBSD: Makefile,v 1.41 2005/06/01 18:02:43 jlam Exp $
DISTNAME= eel-2.10.1
PKGNAME= ${DISTNAME:S/-/2-/}
@@ -16,7 +16,6 @@ USE_DIRS+= gnome2-1.5
USE_TOOLS+= gmake
USE_LIBTOOL= YES
USE_PKGLOCALEDIR= YES
-USE_X11= YES
GNU_CONFIGURE= YES
PKGCONFIG_OVERRIDE= eel-2.0.pc.in
diff --git a/devel/gail/Makefile b/devel/gail/Makefile
index 38b478dafb2..5f79405ebe5 100644
--- a/devel/gail/Makefile
+++ b/devel/gail/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2005/05/22 20:07:51 jlam Exp $
+# $NetBSD: Makefile,v 1.33 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= gail-1.8.4
@@ -12,7 +12,6 @@ COMMENT= GNOME Accessibility Implementation Library
GNU_CONFIGURE= yes
USE_TOOLS+= gmake
-USE_X11= yes
USE_LIBTOOL= yes
USE_PKGLOCALEDIR= yes
diff --git a/devel/gal2/Makefile b/devel/gal2/Makefile
index c44cbf5fc98..4244d2d35b4 100644
--- a/devel/gal2/Makefile
+++ b/devel/gal2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2005/05/22 20:07:51 jlam Exp $
+# $NetBSD: Makefile,v 1.37 2005/06/01 18:02:43 jlam Exp $
#
# Check the API before updating this package! gal-2.5 and above should
# get their own gal26 package!
@@ -14,7 +14,6 @@ MAINTAINER= recht@NetBSD.org
HOMEPAGE= http://www.gnome.org/
COMMENT= Library functions that came from Gnumeric and Evolution (gal-2.4 API)
-USE_X11= yes
USE_TOOLS+= gmake
USE_PKGLOCALEDIR= yes
USE_LIBTOOL= yes
diff --git a/devel/gal20/Makefile b/devel/gal20/Makefile
index c19fea99ee0..7c7dd93dfdc 100644
--- a/devel/gal20/Makefile
+++ b/devel/gal20/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.5 2005/05/22 20:07:51 jlam Exp $
+# $NetBSD: Makefile,v 1.6 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= gal-1.99.11
@@ -12,7 +12,6 @@ MAINTAINER= rh@NetBSD.org
HOMEPAGE= http://www.gnome.org/
COMMENT= Library functions that came from Gnumeric and Evolution
-USE_X11= yes
USE_TOOLS+= gmake
USE_PKGLOCALEDIR= yes
BUILD_USES_MSGFMT= yes
diff --git a/devel/gcvs/Makefile b/devel/gcvs/Makefile
index 6c900e88c6e..49af8b8ab7d 100644
--- a/devel/gcvs/Makefile
+++ b/devel/gcvs/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2005/05/22 20:07:51 jlam Exp $
+# $NetBSD: Makefile,v 1.20 2005/06/01 18:02:43 jlam Exp $
DISTNAME= gcvs-1.0
PKGREVISION= 1
@@ -13,7 +13,6 @@ COMMENT= GTK interface for CVS
CONFLICTS= cvs-[0-9]*
-USE_X11= yes
USE_TOOLS+= gmake
GNU_CONFIGURE= yes
USE_MAKEINFO= yes
diff --git a/devel/gettext-lib/buildlink3.mk b/devel/gettext-lib/buildlink3.mk
index 4c5a7058a19..a2a5df03042 100644
--- a/devel/gettext-lib/buildlink3.mk
+++ b/devel/gettext-lib/buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.22 2005/04/19 14:55:30 epg Exp $
+# $NetBSD: buildlink3.mk,v 1.23 2005/06/01 18:02:43 jlam Exp $
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
GETTEXT_BUILDLINK3_MK:= ${GETTEXT_BUILDLINK3_MK}+
@@ -16,6 +16,7 @@ BUILDLINK_RECOMMENDED.gettext+= gettext-lib>=0.11.5nb4
BUILDLINK_PKGSRCDIR.gettext?= ../../devel/gettext-lib
.endif # GETTEXT_BUILDLINK3_MK
-.include "../../converters/libiconv/buildlink3.mk"
+# Let the gettext-lib/builtin.mk pull in libiconv if it's needed.
+#.include "../../converters/libiconv/buildlink3.mk"
BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/devel/gettext-lib/builtin.mk b/devel/gettext-lib/builtin.mk
index c65092c06a5..d7b3922122b 100644
--- a/devel/gettext-lib/builtin.mk
+++ b/devel/gettext-lib/builtin.mk
@@ -1,121 +1,170 @@
-# $NetBSD: builtin.mk,v 1.22 2005/05/24 05:43:37 jlam Exp $
+# $NetBSD: builtin.mk,v 1.23 2005/06/01 18:02:43 jlam Exp $
-BUILDLINK_FIND_LIBS:= intl
-.include "../../mk/buildlink3/find-libs.mk"
+BUILTIN_PKG:= gettext
-_BLNK_LIBINTL_H= /usr/include/libintl.h
+BUILTIN_FIND_LIBS:= intl
+BUILTIN_FIND_FILES_VAR:= H_GETTEXT
+BUILTIN_FIND_FILES.H_GETTEXT= /usr/include/libintl.h
+BUILTIN_FIND_GREP.H_GETTEXT= \#define[ ]*__USE_GNU_GETTEXT
+.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.gettext)
IS_BUILTIN.gettext= no
-. if exists(${_BLNK_LIBINTL_H}) && \
- !empty(BUILDLINK_LIB_FOUND.intl:M[yY][eE][sS])
-IS_BUILTIN.gettext!= \
- if ${GREP} -q "\#define[ ]*__USE_GNU_GETTEXT" ${_BLNK_LIBINTL_H}; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
-. endif
-. if !empty(IS_BUILTIN.gettext:M[yY][eE][sS])
-# XXX
-# XXX Consider the native libintl to be gettext-lib-0.10.35nb1 until we
-# XXX find a way to more accurately determine the version.
-# XXX
-BUILTIN_PKG.gettext= gettext-lib-0.10.35nb1
-BUILDLINK_VARS+= BUILTIN_PKG.gettext
+. if empty(H_GETTEXT:M${LOCALBASE}/*) && exists(${H_GETTEXT}) && \
+ !empty(BUILTIN_LIB_FOUND.intl:M[yY][eE][sS])
+IS_BUILTIN.gettext= yes
. endif
-.endif # IS_BUILTIN.gettext
+.endif
+MAKEVARS+= IS_BUILTIN.gettext
-.if !defined(USE_BUILTIN.gettext)
-USE_BUILTIN.gettext?= ${IS_BUILTIN.gettext}
-PREFER.gettext?= pkgsrc
+_BLTNH_GETTEXT= /usr/include/libintl.h
+.if !defined(BUILTIN_GETTEXT_NGETTEXT) && exists(${_BLTNH_GETTEXT})
+BUILTIN_GETTEXT_NGETTEXT!= \
+ if ${GREP} -q "char.*ngettext" ${_BLTNH_GETTEXT:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+.endif
+MAKEVARS+= BUILTIN_GETTEXT_NGETTEXT
-. if defined(BUILTIN_PKG.gettext)
+###
+### Determine whether we should use the built-in implementation if it
+### exists, and uset USE_BUILTIN.<pkg> appropriate ("yes" or "no").
+###
+.if !defined(USE_BUILTIN.gettext)
+. if ${PREFER.gettext} == "pkgsrc"
+USE_BUILTIN.gettext= no
+. else
+USE_BUILTIN.gettext= ${IS_BUILTIN.gettext}
+. if defined(BUILTIN_PKG.gettext) && \
+ !empty(IS_BUILTIN.gettext:M[yY][eE][sS])
USE_BUILTIN.gettext= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.gettext}
-. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
-USE_BUILTIN.gettext!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.gettext}; then \
- ${ECHO} "yes"; \
+. for _dep_ in ${BUILDLINK_DEPENDS.gettext}
+. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
+USE_BUILTIN.gettext!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.gettext:Q}; then \
+ ${ECHO} yes; \
else \
- ${ECHO} "no"; \
+ ${ECHO} no; \
fi
-. endif
-. endfor
-. endif
-
-. if ${PREFER.gettext} == "native"
+. endif
+. endfor
+. endif
+. if !defined(_BLNK_REPLACE.gettext)
+_BLNK_REPLACE.gettext= no
# XXX
# XXX By default, assume that the native gettext implementation is good
-# XXX enough if it has a prototype for ngettext().
+# XXX enough to replace GNU gettext if it is part of glibc (the GNU C
+# XXX Library).
# XXX
-. if !defined(_GETTEXT_NGETTEXT) && exists(${_BLNK_LIBINTL_H})
-_GETTEXT_NGETTEXT!= \
- if ${GREP} -q "char.*ngettext" ${_BLNK_LIBINTL_H}; then \
- ${ECHO} "yes"; \
+. if exists(${_BLTNH_GETTEXT})
+_BLNK_REPLACE.gettext!= \
+ if ${GREP} -q "This file is part of the GNU C Library" ${_BLTNH_GETTEXT:Q}; then \
+ ${ECHO} yes; \
else \
- ${ECHO} "no"; \
+ ${ECHO} no; \
fi
-BUILDLINK_VARS+= _GETTEXT_NGETTEXT
-. if !empty(_GETTEXT_NGETTEXT:M[yY][eE][sS])
-USE_BUILTIN.gettext= yes
-. else
-USE_BUILTIN.gettext= no
. endif
. endif
+MAKEVARS+= _BLNK_REPLACE.gettext
+. if !empty(_BLNK_REPLACE.gettext:M[yY][eE][sS])
+USE_BUILTIN.gettext= yes
+. endif
# XXX
-# XXX By default, assume the native gettext on Linux systems using GLIBC
-# XXX supports the GNU gettext API, and use it.
+# XXX By default, assume that the native gettext implementation is good
+# XXX enough to replace GNU gettext if it supplies ngettext().
# XXX
-. if (${OPSYS} == "Linux")
-USE_BUILTIN.gettext!= \
- if ${GREP} -q "This file is part of the GNU C Library" ${_BLNK_LIBINTL_H}; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
+. if !empty(BUILTIN_GETTEXT_NGETTEXT:M[yY][eE][sS])
+USE_BUILTIN.gettext= yes
. endif
#
-# The listed platforms have an implementation of gettext that isn't
-# GNUish enough.
+# Some platforms don't have a gettext implementation that can replace
+# GNU gettext.
#
-_INCOMPAT_GETTEXT= SunOS-*-*
+_INCOMPAT_GETTEXT?= SunOS-*-* # XXX move to mk/platforms/SunOS.mk
. for _pattern_ in ${_INCOMPAT_GETTEXT} ${INCOMPAT_GETTEXT}
. if !empty(MACHINE_PLATFORM:M${_pattern_})
-USE_BUILTIN.gettext= no
+USE_BUILTIN.gettext= no
. endif
. endfor
-. endif # PREFER.gettext == "native"
+. endif # PREFER.gettext
+.endif
+MAKEVARS+= USE_BUILTIN.gettext
-. if defined(USE_GNU_GETTEXT)
-. if !empty(IS_BUILTIN.gettext:M[nN][oO]) || \
- (${PREFER.gettext} == "pkgsrc")
+# If USE_GNU_GETTEXT is defined, then force the use of a GNU gettext
+# implementation.
+#
+.if defined(USE_GNU_GETTEXT)
+. if !empty(IS_BUILTIN.gettext:M[nN][oO])
USE_BUILTIN.gettext= no
-. endif
. endif
-.endif # USE_BUILTIN.gettext
+.endif
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
CHECK_BUILTIN.gettext?= no
.if !empty(CHECK_BUILTIN.gettext:M[nN][oO])
######################################################################
# If we are using the builtin gettext implementation...
######################################################################
-.if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
-. if ${BUILDLINK_LIB_FOUND.intl} == "yes"
+. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
+. if ${BUILTIN_LIB_FOUND.intl} == "yes"
_BLNK_LIBINTL= -lintl
-. else
+. else
_BLNK_LIBINTL= # empty
BUILDLINK_TRANSFORM+= rm:-lintl
+. endif
. endif
-.endif
######################################################################
# If we are using pkgsrc gettext implementation...
######################################################################
-.if !empty(USE_BUILTIN.gettext:M[nN][oO])
+. if !empty(USE_BUILTIN.gettext:M[nN][oO])
_BLNK_LIBINTL= -lintl
-.endif
+#
+# Determine if we need to include the libiconv buildlink3.mk file.
+# Since we're using the pkgsrc gettext, the only time we don't need
+# iconv is if an already-installed gettext-lib package satisfied all
+# of the gettext dependencies but is <0.11.5nb1.
+#
+_BLNK_GETTEXT_ICONV_DEPENDS= gettext-lib>=0.11.5nb1
+. if !defined(_BLNK_GETTEXT_NEEDS_ICONV)
+_BLNK_GETTEXT_NEEDS_ICONV?= no
+. for _dep_ in ${BUILDLINK_DEPENDS.gettext}
+. if !empty(_BLNK_GETTEXT_NEEDS_ICONV:M[nN][oO])
+_BLNK_GETTEXT_NEEDS_ICONV!= \
+ pkg=`${PKG_BEST_EXISTS} ${_dep_:Q}`; \
+ if ${TEST} -z "$$pkg"; then \
+ ${ECHO} yes; \
+ elif ${PKG_ADMIN} pmatch ${_BLNK_GETTEXT_ICONV_DEPENDS:Q} "$$pkg"; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+MAKEVARS+= _BLNK_GETTEXT_NEEDS_ICONV
+
+. if !empty(_BLNK_GETTEXT_NEEDS_ICONV:M[yY][eE][sS])
+. for _mkfile_ in buildlink3.mk builtin.mk
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+. sinclude "../../converters/libiconv/${_mkfile_}"
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
+. endfor
+BUILDLINK_DEPENDS.gettext+= ${_BLNK_GETTEXT_ICONV_DEPENDS}
+_BLNK_LIBINTL+= ${BUILDLINK_LDADD.iconv}
+. endif
+. endif
BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL}
@@ -131,34 +180,33 @@ BUILDLINK_LDADD.gettext?= ${_BLNK_LIBINTL}
# XXX as "yes" until we can do a full bulk build test.
#
BROKEN_GETTEXT_DETECTION?= yes
-.if !empty(BROKEN_GETTEXT_DETECTION:M[yY][eE][sS])
+. if !empty(BROKEN_GETTEXT_DETECTION:M[yY][eE][sS])
BUILDLINK_LIBS.gettext+= ${BUILDLINK_LDADD.gettext}
CONFIGURE_ENV+= INTLLIBS="${BUILDLINK_LDADD.gettext}"
-.endif # BROKEN_GETTEXT_DETECTION
+. endif
# If using a built-in libintl that isn't from GNU gettext, then set up
# some GNU configure variables that are checked by modern gettext.m4
# so that it will detect "GNU gettext" in the existing libintl.
#
-.if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
-. if !empty(BUILDLINK_LIB_FOUND.intl:M[yY][eE][sS])
+. if defined(GNU_CONFIGURE)
+. if !empty(USE_BUILTIN.gettext:M[yY][eE][sS])
+. if !empty(BUILTIN_LIB_FOUND.intl:M[yY][eE][sS])
CONFIGURE_ENV+= gt_cv_func_gnugettext_libintl="yes"
CONFIGURE_ENV+= gt_cv_func_gnugettext1_libintl="yes"
-. if defined(_GETTEXT_NGETTEXT) && !empty(_GETTEXT_NGETTEXT:M[yY][eE][sS])
+. if !empty(BUILTIN_GETTEXT_NGETTEXT:M[yY][eE][sS])
CONFIGURE_ENV+= gt_cv_func_gnugettext2_libintl="yes"
+. endif
+. endif
. endif
-. endif
-.endif
-
-.if defined(GNU_CONFIGURE)
-. if !empty(USE_BUILTIN.gettext:M[nN][oO])
+. if !empty(USE_BUILTIN.gettext:M[nN][oO])
CONFIGURE_ARGS+= --with-libintl-prefix="${BUILDLINK_PREFIX.gettext}"
-. else
+. else
CONFIGURE_ARGS+= --without-libintl-prefix
+. endif
. endif
-.endif
-.if defined(USE_MSGFMT_PLURALS) && !empty(USE_MSGFMT_PLURALS:M[Yy][Ee][Ss])
+. if defined(USE_MSGFMT_PLURALS) && !empty(USE_MSGFMT_PLURALS:M[Yy][Ee][Ss])
USE_PERL5?= build
CONFIGURE_ENV+= MSGFMT=${BUILDLINK_DIR}/bin/msgfmt
@@ -177,6 +225,6 @@ ${BUILDLINK_DIR}/bin/msgfmt: ${.CURDIR}/../../devel/gettext/files/msgfmt.pl
-e "s|@MSGFMT@|"${BUILDLINK_PREFIX.gettext:Q}/bin/msgfmt"|g" \
> ${.TARGET}
@${CHMOD} +x ${.TARGET}
-.endif
+. endif
.endif # CHECK_BUILTIN.gettext
diff --git a/devel/giblib/Makefile b/devel/giblib/Makefile
index 399e0844221..525b3942cd8 100644
--- a/devel/giblib/Makefile
+++ b/devel/giblib/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2005/04/11 21:45:23 tv Exp $
+# $NetBSD: Makefile,v 1.17 2005/06/01 18:02:43 jlam Exp $
DISTNAME= giblib-1.2.4
PKGREVISION= 2
@@ -12,8 +12,8 @@ COMMENT= Programming utility library
GNU_CONFIGURE= YES
PKGCONFIG_OVERRIDE= giblib.pc.in
USE_LIBTOOL= YES
-USE_X11= YES
.include "../../graphics/imlib2/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/glade2/Makefile.common b/devel/glade2/Makefile.common
index e3bc7e2f55d..ef44ea52f45 100644
--- a/devel/glade2/Makefile.common
+++ b/devel/glade2/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.4 2005/05/22 20:07:51 jlam Exp $
+# $NetBSD: Makefile.common,v 1.5 2005/06/01 18:02:43 jlam Exp $
DISTNAME= glade-2.10.0
PKGNAME= ${DISTNAME:S/-/2-/}
@@ -19,7 +19,6 @@ USE_DIRS+= gnome2-1.5
USE_TOOLS+= gmake
USE_LIBTOOL= YES
USE_PKGLOCALEDIR= YES
-USE_X11= YES
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/pkgconfig/buildlink3.mk"
diff --git a/devel/gnome2-libole2/Makefile b/devel/gnome2-libole2/Makefile
index 374475ec858..292357f3681 100644
--- a/devel/gnome2-libole2/Makefile
+++ b/devel/gnome2-libole2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2005/04/11 21:45:24 tv Exp $
+# $NetBSD: Makefile,v 1.12 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= libole2-2.2.8
@@ -15,10 +15,10 @@ COMMENT= OLE2 streams parsing library for GNOME2
BUILD_USES_MSGFMT= YES
GNU_CONFIGURE= YES
-USE_X11= YES
USE_LIBTOOL= YES
.include "../../devel/gettext-lib/buildlink3.mk"
.include "../../devel/glib2/buildlink3.mk"
.include "../../devel/pkgconfig/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/gnustep-base/Makefile b/devel/gnustep-base/Makefile
index 0b2b178c288..3d68947fa47 100644
--- a/devel/gnustep-base/Makefile
+++ b/devel/gnustep-base/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2005/04/15 04:54:11 rh Exp $
+# $NetBSD: Makefile,v 1.24 2005/06/01 18:02:43 jlam Exp $
DISTNAME= gnustep-base-1.10.3
CATEGORIES= devel gnustep
@@ -10,7 +10,6 @@ COMMENT= GNUstep foundation classes
PTHREAD_LIBS= -lpthread
-USE_X11= yes
CONFIGURE_ARGS+= --exec-prefix=${PREFIX}/libexec/GNUstep
CONFIGURE_ENV+= INSTALL_PROGRAM="${INSTALL_SCRIPT}"
@@ -43,5 +42,6 @@ post-install:
PTHREAD_LIBS+= -lpth
.endif
+.include "../../mk/x11.buildlink3.mk"
.include "../../devel/gnustep-make/gnustep.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/gnustep-examples/Makefile b/devel/gnustep-examples/Makefile
index aea5fa7e308..a71a4d022e0 100644
--- a/devel/gnustep-examples/Makefile
+++ b/devel/gnustep-examples/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2005/04/11 21:45:24 tv Exp $
+# $NetBSD: Makefile,v 1.16 2005/06/01 18:02:43 jlam Exp $
#
DISTNAME= gnustep-examples-1.0.0
@@ -10,7 +10,6 @@ MAINTAINER= rh@NetBSD.org
HOMEPAGE= http://www.gnustep.org/
COMMENT= Some GUI programming examples for GNUstep
-USE_X11= yes
NO_CONFIGURE= yes
.include "../../x11/gnustep-back/buildlink3.mk"
diff --git a/devel/gnustep-make/Makefile b/devel/gnustep-make/Makefile
index 24d3fc8e646..2aef47cc511 100644
--- a/devel/gnustep-make/Makefile
+++ b/devel/gnustep-make/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2005/05/24 17:20:00 rillig Exp $
+# $NetBSD: Makefile,v 1.20 2005/06/01 18:02:43 jlam Exp $
DISTNAME= gnustep-make-1.10.0
PKGREVISION= 1
@@ -11,9 +11,9 @@ COMMENT= GNUstep makefile package
PKG_INSTALLATION_TYPES= overwrite pkgviews
-USE_X11= yes
CONFIGURE_ENV+= INSTALL_PROGRAM="${INSTALL_SCRIPT}"
+.include "../../mk/x11.buildlink3.mk"
.include "gnustep.mk"
post-patch:
diff --git a/devel/gscope/Makefile b/devel/gscope/Makefile
index 74e7c90cf98..d4df5a045b8 100644
--- a/devel/gscope/Makefile
+++ b/devel/gscope/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2005/04/11 21:45:24 tv Exp $
+# $NetBSD: Makefile,v 1.15 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= gscope-0.4.1
@@ -12,7 +12,6 @@ COMMENT= Software oscilloscope library
BUILD_DEPENDS+= gtk-doc-[0-9]*:../../textproc/gtk-doc
-USE_X11= # defined
GNU_CONFIGURE= # defined
USE_LIBTOOL= # defined
diff --git a/devel/guile-gtk/Makefile b/devel/guile-gtk/Makefile
index 71b971486bc..51280b0600a 100644
--- a/devel/guile-gtk/Makefile
+++ b/devel/guile-gtk/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.22 2005/04/11 21:45:25 tv Exp $
+# $NetBSD: Makefile,v 1.23 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= guile-gtk-0.40.91
@@ -9,7 +9,6 @@ MAINTAINER= gdt@ir.bbn.com
HOMEPAGE= http://www.gnu.org/software/guile-gtk/
COMMENT= Library to make GTK 1.2 accessible from guile
-USE_X11= # defined
USE_LIBTOOL= # defined
GNU_CONFIGURE= # defined
diff --git a/devel/guile14-gtk/Makefile b/devel/guile14-gtk/Makefile
index e3ba6ff87c5..6f3f20fc9f4 100644
--- a/devel/guile14-gtk/Makefile
+++ b/devel/guile14-gtk/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2005/04/11 21:45:25 tv Exp $
+# $NetBSD: Makefile,v 1.4 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= guile-gtk-0.19
@@ -13,7 +13,6 @@ MAINTAINER= rh@NetBSD.org
HOMEPAGE= http://www.ping.de/sites/zagadka/guile-gtk/
COMMENT= Library to make GTK accessible from guile 1.4
-USE_X11= # defined
USE_LIBTOOL= # defined
GNU_CONFIGURE= # defined
diff --git a/devel/jgrasp/Makefile b/devel/jgrasp/Makefile
index d8226f4c6ac..f234683a0a2 100644
--- a/devel/jgrasp/Makefile
+++ b/devel/jgrasp/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2005/04/04 13:58:32 jschauma Exp $
+# $NetBSD: Makefile,v 1.8 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= jgrasp170
@@ -13,7 +13,6 @@ COMMENT= IDE with support for Software Visualizations
WRKSRC= ${WRKDIR}/jgrasp
PKG_JVMS_ACCEPTED= sun-jdk13 sun-jdk14 jdk13 jdk14
-USE_X11= yes
do-configure:
${MKDIR} ${WRKSRC}/bin/${LOWER_OPSYS}
@@ -42,5 +41,6 @@ do-install:
${LN} -s ${PREFIX}/${PKGNAME}/bin/${LOWER_OPSYS}/jgrasp \
${PREFIX}/bin/jgrasp
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/java-vm.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/libast/Makefile b/devel/libast/Makefile
index 11077ec94f2..ae60c60f91b 100644
--- a/devel/libast/Makefile
+++ b/devel/libast/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2005/05/31 21:35:13 wiz Exp $
+# $NetBSD: Makefile,v 1.18 2005/06/01 18:02:44 jlam Exp $
DISTNAME= libast-0.6.1
CATEGORIES= devel
@@ -9,7 +9,6 @@ HOMEPAGE= http://freshmeat.net/projects/libast/?topic_id=809%2C861
COMMENT= The Library of Assorted Spiffy Things
USE_LIBTOOL= YES
-USE_X11= YES
GNU_CONFIGURE= YES
TEST_TARGET= test
@@ -22,4 +21,5 @@ LDFLAGS+=-lresolv
.include "../../devel/pcre/buildlink3.mk"
.include "../../graphics/imlib2/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/libbonoboui/Makefile b/devel/libbonoboui/Makefile
index 2733c0ceb8e..0063a9dc396 100644
--- a/devel/libbonoboui/Makefile
+++ b/devel/libbonoboui/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.39 2005/05/22 20:07:52 jlam Exp $
+# $NetBSD: Makefile,v 1.40 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= libbonoboui-2.8.1
@@ -16,7 +16,6 @@ GNU_CONFIGURE= yes
USE_DIRS+= gnome2-1.5
USE_PKGLOCALEDIR= yes
USE_TOOLS+= gmake
-USE_X11= yes
USE_LIBTOOL= yes
PKGCONFIG_OVERRIDE= bonobo/libbonoboui-2.0.pc.in
diff --git a/devel/libdockapp/Makefile b/devel/libdockapp/Makefile
index ce7f2115a7d..a5922378719 100644
--- a/devel/libdockapp/Makefile
+++ b/devel/libdockapp/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2005/04/11 21:45:26 tv Exp $
+# $NetBSD: Makefile,v 1.14 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= libdockapp-0.4.0
@@ -13,7 +13,6 @@ COMMENT= Simple library to create dockapps for WindowMaker
GNU_CONFIGURE= YES
USE_LIBTOOL= YES
LTCONFIG_OVERRIDE= ${WRKSRC}/ltconfig
-USE_X11= YES
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/libdockapp
diff --git a/devel/libevent/builtin.mk b/devel/libevent/builtin.mk
index 2feb23bb0f0..14c77ca8ca5 100644
--- a/devel/libevent/builtin.mk
+++ b/devel/libevent/builtin.mk
@@ -1,10 +1,47 @@
-# $NetBSD: builtin.mk,v 1.2 2004/04/20 08:43:33 xtraeme Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/06/01 18:02:44 jlam Exp $
+BUILTIN_PKG:= libevent
+
+BUILTIN_FIND_FILES_VAR:= H_LIBEVENT
+BUILTIN_FIND_FILES.H_LIBEVENT= /usr/include/event.h
+
+.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.libevent)
IS_BUILTIN.libevent= no
-. if exists(/usr/include/event.h)
+. if empty(H_LIBEVENT:M${LOCALBASE}/*) && exists(${H_LIBEVENT})
IS_BUILTIN.libevent= yes
. endif
.endif # IS_BUILTIN.libevent
+MAKEVARS+= IS_BUILTIN.libevent
-USE_BUILTIN.libevent?= ${IS_BUILTIN.libevent}
+###
+### 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.libevent)
+. if ${PREFER.libevent} == "pkgsrc"
+USE_BUILTIN.libevent= no
+. else
+USE_BUILTIN.libevent= ${IS_BUILTIN.libevent}
+. if defined(BUILTIN_PKG.libevent) && \
+ !empty(IS_BUILTIN.libevent:M[yY][eE][sS])
+USE_BUILTIN.libevent= yes
+. for _dep_ in ${BUILDLINK_DEPENDS.libevent}
+. if !empty(USE_BUILTIN.libevent:M[yY][eE][sS])
+USE_BUILTIN.libevent!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.libevent:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.libevent
+.endif
+MAKEVARS+= USE_BUILTIN.libevent
diff --git a/devel/libgetopt/builtin.mk b/devel/libgetopt/builtin.mk
index 7c43be9e1c5..7f533d245c3 100644
--- a/devel/libgetopt/builtin.mk
+++ b/devel/libgetopt/builtin.mk
@@ -1,26 +1,67 @@
-# $NetBSD: builtin.mk,v 1.2 2004/03/29 05:43:30 jlam Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/06/01 18:02:44 jlam Exp $
+BUILTIN_PKG:= getopt
+
+BUILTIN_FIND_FILES_VAR:= H_GETOPT
+BUILTIN_FIND_FILES.H_GETOPT= /usr/include/getopt.h
+BUILTIN_FIND_GREP.H_GETOPT= int.*getopt_long
+
+.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.getopt)
IS_BUILTIN.getopt= no
-. if exists(/usr/include/getopt.h)
+. if empty(H_GETOPT:M${LOCALBASE}/*) && exists(${H_GETOPT})
IS_BUILTIN.getopt= yes
. endif
.endif # IS_BUILTIN.getopt
+MAKEVARS+= IS_BUILTIN.getopt
-USE_BUILTIN.getopt?= ${IS_BUILTIN.getopt}
+###
+### 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.getopt)
+. if ${PREFER.getopt} == "pkgsrc"
+USE_BUILTIN.getopt= no
+. else
+USE_BUILTIN.getopt= ${IS_BUILTIN.getopt}
+. if defined(BUILTIN_PKG.getopt) && \
+ !empty(IS_BUILTIN.getopt:M[yY][eE][sS])
+USE_BUILTIN.getopt= yes
+. for _dep_ in ${BUILDLINK_DEPENDS.getopt}
+. if !empty(USE_BUILTIN.getopt:M[yY][eE][sS])
+USE_BUILTIN.getopt!= \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.getopt:Q}; then \
+ ${ECHO} yes; \
+ else \
+ ${ECHO} no; \
+ fi
+. endif
+. endfor
+. endif
+. endif # PREFER.getopt
+.endif
+MAKEVARS+= USE_BUILTIN.getopt
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
CHECK_BUILTIN.getopt?= no
.if !empty(CHECK_BUILTIN.getopt:M[nN][oO])
-.if !empty(USE_BUILTIN.getopt:M[nN][oO])
-LIBGETOPT= -lgetopt
-.else
-LIBGETOPT= # empty
-.endif
-
-BUILDLINK_LDADD.getopt?= ${LIBGETOPT}
+. if !empty(USE_BUILTIN.getopt:M[nN][oO])
+_BLNK_LIBGETOPT= -lgetopt
+. else
+_BLNK_LIBGETOPT= # empty
+. endif
+BUILDLINK_LDADD.getopt?= ${_BLNK_LIBGETOPT}
-CONFIGURE_ENV+= LIBGETOPT="${LIBGETOPT}"
-MAKE_ENV+= LIBGETOPT="${LIBGETOPT}"
+CONFIGURE_ENV+= LIBGETOPT=${BUILDLINK_LDADD.getopt:Q}
+MAKE_ENV+= LIBGETOPT=${BUILDLINK_LDADD.getopt:Q}
.endif # CHECK_BUILTIN.getopt
diff --git a/devel/libglade2/Makefile b/devel/libglade2/Makefile
index d6c544b8cf1..266136d4750 100644
--- a/devel/libglade2/Makefile
+++ b/devel/libglade2/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.36 2005/05/22 20:07:52 jlam Exp $
+# $NetBSD: Makefile,v 1.37 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= libglade-2.5.1
@@ -14,7 +14,6 @@ COMMENT= Runtime interpreter for GLADE GUI files (v2)
BUILD_USES_MSGFMT= YES
USE_TOOLS+= gmake
-USE_X11= YES
GNU_CONFIGURE= YES
USE_LIBTOOL= YES
PKGCONFIG_OVERRIDE= libglade-2.0.pc.in
diff --git a/devel/libgnomeui/Makefile b/devel/libgnomeui/Makefile
index c283df8b137..d2240b0792d 100644
--- a/devel/libgnomeui/Makefile
+++ b/devel/libgnomeui/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.42 2005/05/22 20:07:52 jlam Exp $
+# $NetBSD: Makefile,v 1.43 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= libgnomeui-2.10.0
@@ -19,7 +19,6 @@ USE_DIRS+= xdg-1.1
USE_PKGLOCALEDIR= yes
USE_TOOLS+= gmake
USE_PERL5= build
-USE_X11= yes
USE_LIBTOOL= yes
CONFIGURE_ARGS+= --disable-gtk-doc
diff --git a/devel/libmatchbox/Makefile b/devel/libmatchbox/Makefile
index cf7f98c5b07..428738eaf01 100644
--- a/devel/libmatchbox/Makefile
+++ b/devel/libmatchbox/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2005/06/01 04:06:53 reed Exp $
+# $NetBSD: Makefile,v 1.8 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= libmatchbox-1.6
@@ -10,7 +10,6 @@ MAINTAINER= tech-pkg@NetBSD.org
HOMEPAGE= http://projects.o-hand.com/matchbox/
COMMENT= Library for matchbox window manager for computers with small displays
-USE_X11= yes
USE_LIBTOOL= yes
GNU_CONFIGURE= yes
diff --git a/devel/libstroke/Makefile b/devel/libstroke/Makefile
index b253d9c0850..a9035df98b4 100644
--- a/devel/libstroke/Makefile
+++ b/devel/libstroke/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.16 2005/05/22 20:07:53 jlam Exp $
+# $NetBSD: Makefile,v 1.17 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= libstroke-0.5.1
@@ -14,7 +14,6 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews
GNU_CONFIGURE= YES
USE_LIBTOOL= YES
-USE_X11= YES
USE_TOOLS= gmake
LTCONFIG_OVERRIDE= ${WRKSRC}/ltconfig
@@ -22,4 +21,5 @@ LTCONFIG_OVERRIDE= ${WRKSRC}/ltconfig
CONFIGURE_ENV+= ac_cv_path_GTK_CONFIG=no
.include "../../lang/tcl/buildlink3.mk"
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/maketool/Makefile b/devel/maketool/Makefile
index c3f98322561..e3819eb1d78 100644
--- a/devel/maketool/Makefile
+++ b/devel/maketool/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.31 2005/05/22 20:07:53 jlam Exp $
+# $NetBSD: Makefile,v 1.32 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= maketool-0.7
@@ -14,7 +14,6 @@ COMMENT= Graphical front end to GNU make
BUILD_USES_MSGFMT= # defined
USE_PKGLOCALEDIR= # defined
-USE_X11= # defined
USE_TOOLS+= gmake
GNU_CONFIGURE= # defined
USE_PKGLOCALEDIR= # defined
diff --git a/devel/ncurses/builtin.mk b/devel/ncurses/builtin.mk
index f42eca9e9fe..952ece0d01a 100644
--- a/devel/ncurses/builtin.mk
+++ b/devel/ncurses/builtin.mk
@@ -1,145 +1,151 @@
-# $NetBSD: builtin.mk,v 1.7 2004/12/11 00:32:16 jlam Exp $
+# $NetBSD: builtin.mk,v 1.8 2005/06/01 18:02:44 jlam Exp $
-.for _lib_ in ncurses
-. if !defined(_BLNK_LIB_FOUND.${_lib_})
-_BLNK_LIB_FOUND.${_lib_}!= \
- if ${TEST} "`${ECHO} /usr/lib/lib${_lib_}.*`" != "/usr/lib/lib${_lib_}.*"; then \
- ${ECHO} "yes"; \
- elif ${TEST} "`${ECHO} /lib/lib${_lib_}.*`" != "/lib/lib${_lib_}.*"; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
-BUILDLINK_VARS+= _BLNK_LIB_FOUND.${_lib_}
-. endif
-.endfor
-.undef _lib_
+BUILTIN_PKG:= ncurses
-_NCURSES_H= /usr/include/curses.h
+BUILTIN_FIND_LIBS:= ncurses
+BUILTIN_FIND_FILES_VAR:= H_NCURSES
+BUILTIN_FIND_FILES.H_NCURSES= /usr/include/curses.h
+BUILTIN_FIND_GREP.H_NCURSES= \#define[ ]*NCURSES_VERSION
+.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.ncurses)
IS_BUILTIN.ncurses= no
-. if !empty(_BLNK_LIB_FOUND.ncurses:M[yY][eE][sS])
+. if empty(H_NCURSES:M${LOCALBASE}/*) && exists(${H_NCURSES}) && \
+ !empty(BUILTIN_LIB_FOUND.ncurses:M[yY][eE][sS])
IS_BUILTIN.ncurses= yes
-. elif exists(${_NCURSES_H})
-IS_BUILTIN.ncurses!= \
- if ${GREP} -q "\#define[ ]*NCURSES_VERSION" ${_NCURSES_H}; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
-. if !empty(IS_BUILTIN.ncurses:M[yY][eE][sS])
-#
-# Create an appropriate name for the built-in package distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
-# version or if the built-in one is sufficient.
-#
-_NCURSES_VERSION!= \
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.ncurses
+
+###
+### 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.ncurses) && \
+ !empty(IS_BUILTIN.ncurses:M[yY][eE][sS]) && \
+ exists(${H_NCURSES})
+BUILTIN_VERSION.ncurses!= \
${AWK} '/\#define[ ]*NCURSES_VERSION[ ]/ { \
vers = $$3; \
gsub("\"", "", vers); \
print vers; \
} \
- ' ${_NCURSES_H}
-BUILTIN_PKG.ncurses= ncurses-${_NCURSES_VERSION}
-BUILDLINK_VARS+= BUILTIN_PKG.ncurses
-. endif
-. endif
-BUILDLINK_VARS+= IS_BUILTIN.ncurses
-.endif # IS_BUILTIN.ncurses
+ ' ${H_NCURSES:Q}
+BUILTIN_PKG.ncurses= ncurses-${BUILTIN_VERSION.ncurses}
+.endif
+MAKEVARS+= BUILTIN_PKG.ncurses
+###
+### 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.ncurses)
-USE_BUILTIN.ncurses?= ${IS_BUILTIN.ncurses}
-PREFER.ncurses?= pkgsrc
-
-. if defined(BUILTIN_PKG.ncurses)
+. if ${PREFER.ncurses} == "pkgsrc"
+USE_BUILTIN.ncurses= no
+. else
+USE_BUILTIN.ncurses= ${IS_BUILTIN.ncurses}
+. if defined(BUILTIN_PKG.ncurses) && \
+ !empty(IS_BUILTIN.ncurses:M[yY][eE][sS])
USE_BUILTIN.ncurses= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.ncurses}
-. if !empty(IS_BUILTIN.ncurses:M[yY][eE][sS])
+. for _dep_ in ${BUILDLINK_DEPENDS.ncurses}
+. if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS])
USE_BUILTIN.ncurses!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.ncurses}; then \
- ${ECHO} "yes"; \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.ncurses:Q}; then \
+ ${ECHO} yes; \
else \
- ${ECHO} "no"; \
+ ${ECHO} no; \
fi
-. endif
-. endfor
-. endif
-
-. if ${PREFER.ncurses} == "native"
+. endif
+. endfor
+. endif
# XXX
-# XXX By default, assume that the native curses on NetBSD systems
-# XXX supports ncurses.
+# XXX By default, assume that the native curses on NetBSD systems is
+# XXX good enough to replace ncurses. In reality, no version of NetBSD
+# XXX has a curses library that can completely replace ncurses; however,
+# XXX some versions implement enough of ncurses that some packages are
+# XXX happy.
# XXX
. if ${OPSYS} == "NetBSD"
USE_BUILTIN.ncurses= yes
+. endif
#
-# These versions of NetBSD didn't have a curses library that was
-# capable of replacing ncurses.
-#
-# XXX In reality, no version of NetBSD has a curses library that can
-# XXX completely replace ncurses; however, some versions implement
-# XXX enough of ncurses that some packages are happy.
+# Some platforms don't have a curses implementation that can replace
+# ncurses.
#
-_INCOMPAT_CURSES= NetBSD-0.*-* NetBSD-1.[0123]*-*
-_INCOMPAT_CURSES+= NetBSD-1.4.*-* NetBSD-1.4[A-X]-*
-. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+_INCOMPAT_CURSES?= NetBSD-0.*-* NetBSD-1.[0123]*-* \
+ NetBSD-1.4.*-* NetBSD-1.4[A-X]-*
+. for _pattern_ in ${_INCOMPAT_CURSES} ${INCOMPAT_CURSES}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
USE_BUILTIN.ncurses= no
-. endif
-. endfor
-. endif
-. endif
+. endif
+. endfor
+. endif # PREFER.ncurses
+.endif
+MAKEVARS+= USE_BUILTIN.ncurses
-. if defined(USE_NCURSES)
-. if !empty(IS_BUILTIN.ncurses:M[nN][oO]) || \
- (${PREFER.ncurses} == "pkgsrc")
+# If USE_NCURSES is defined, then force the use of an ncurses
+# implementation.
+#
+.if defined(USE_NCURSES)
+. if !empty(IS_BUILTIN.ncurses:M[nN][oO])
USE_BUILTIN.ncurses= no
-. endif
. endif
-.endif # USE_BUILTIN.ncurses
+.endif
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
CHECK_BUILTIN.ncurses?= no
.if !empty(CHECK_BUILTIN.ncurses:M[nN][oO])
-.if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS])
-. include "../../mk/bsd.prefs.mk"
-. if !empty(_BLNK_LIB_FOUND.ncurses:M[nN][oO]) || ${OPSYS} == "Interix"
+. if !empty(USE_BUILTIN.ncurses:M[yY][eE][sS])
+. if !empty(BUILTIN_LIB_FOUND.ncurses:M[nN][oO]) || (${OPSYS} == "Interix")
BUILDLINK_TRANSFORM.ncurses+= -e "s|/curses\.h|/ncurses.h|g"
BUILDLINK_TRANSFORM+= l:ncurses:curses
-. endif
+. endif
BUILDLINK_FILES.ncurses+= include/curses.h
BUILDLINK_TARGETS+= buildlink-ncurses-extra-includes
-.endif
-
+. endif
BUILDLINK_TARGETS+= buildlink-ncurses-curses-h
-.if !target(buildlink-ncurses-extra-includes)
+# A full ncurses implementation provides more headers than some curses
+# implementations. Touch empty replacements for those headers so that
+# packages can continue to use the familiar ncurses header names.
+#
+. if !target(buildlink-ncurses-extra-includes)
.PHONY: buildlink-ncurses-extra-includes
buildlink-ncurses-extra-includes:
${_PKG_SILENT}${_PKG_DEBUG} \
extra_includes="include/term.h"; \
- for f in $${extra_includes}; do \
- if [ ! -f ${BUILDLINK_PREFIX.ncurses}/$$f ]; then \
- ${ECHO_BUILDLINK_MSG} "Touching extra ncurses header ($$f) in ${BUILDLINK_DIR}."; \
- ${MKDIR} -p `${DIRNAME} ${BUILDLINK_DIR}/$$f`; \
- ${TOUCH} ${TOUCH_FLAGS} ${BUILDLINK_DIR}/$$f; \
+ for f in $$extra_includes; do \
+ src=${BUILDLINK_PREFIX.ncurses:Q}"/$$f"; \
+ dest=${BUILDLINK_DIR:Q}"/$$f"; \
+ if ${TEST} ! -f "$$src"; then \
+ ${ECHO_BUILDLINK_MSG} "Touching extra ncurses header ($$f)"; \
+ ${MKDIR} `${DIRNAME} "$$dest"`; \
+ ${TOUCH} ${TOUCH_FLAGS} "$$dest"; \
fi; \
done
-.endif
+. endif
-.if !target(buildlink-ncurses-curses-h)
+# Some packages expect <curses.h> to provide declarations for ncurses.
+. if !target(buildlink-ncurses-curses-h)
.PHONY: buildlink-ncurses-curses-h
buildlink-ncurses-curses-h:
${_PKG_SILENT}${_PKG_DEBUG} \
- if [ ! -f ${BUILDLINK_DIR}/include/curses.h -a \
- -f ${BUILDLINK_PREFIX.ncurses}/include/ncurses.h ]; then \
+ src=${BUILDLINK_PREFIX.ncurses:Q}"/include/ncurses.h"; \
+ dest=${BUILDLINK_DIR:Q}"/include/curses.h"; \
+ if ${TEST} ! -f "$$dest" -a -f "$$src"; then \
${ECHO_BUILDLINK_MSG} "Linking curses.h -> ncurses.h."; \
- ${MKDIR} -p ${BUILDLINK_DIR}/include; \
- ${LN} -s ${BUILDLINK_PREFIX.ncurses}/include/ncurses.h \
- ${BUILDLINK_DIR}/include/curses.h; \
+ ${MKDIR} `${DIRNAME} "$$dest"`; \
+ ${LN} -s "$$src" "$$dest"; \
fi
-.endif
+. endif
.endif # CHECK_BUILTIN.ncurses
diff --git a/devel/netbeans-ide/Makefile b/devel/netbeans-ide/Makefile
index 127ee44f463..44b54ac9c4b 100644
--- a/devel/netbeans-ide/Makefile
+++ b/devel/netbeans-ide/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.4 2005/04/11 21:45:28 tv Exp $
+# $NetBSD: Makefile,v 1.5 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= NetBeansIDE-release351
@@ -13,7 +13,6 @@ COMMENT= NetBeans Java IDE
USE_JAVA= run
PKG_JVMS_ACCEPTED= sun-jdk13 sun-jdk14 jdk13 jdk14
-USE_X11= yes
NO_CONFIGURE= yes
NO_BUILD= yes
WRKSRC= ${WRKDIR}/netbeans
@@ -37,5 +36,6 @@ do-install:
tomcat406 update_tracking ${SHAREDIR}
${LN} -sf ${SHAREDIR}/bin/runide.sh ${PREFIX}/bin/netbeans
+.include "../../mk/x11.buildlink3.mk"
.include "../../mk/java-vm.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/devel/ode/Makefile b/devel/ode/Makefile
index 0ff0adc277b..76eb039c0d8 100644
--- a/devel/ode/Makefile
+++ b/devel/ode/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.6 2005/05/22 20:07:54 jlam Exp $
+# $NetBSD: Makefile,v 1.7 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= ode-0.039
@@ -11,7 +11,8 @@ HOMEPAGE= http://opende.sourceforge.net/
COMMENT= Library for the simulation of Rigid Body Dynamics
USE_TOOLS+= gmake
-USE_X11= yes
+
+.include "../../mk/x11.buildlink3.mk"
do-configure:
cd ${WRKSRC} && ${GMAKE} configure
diff --git a/devel/ogre/Makefile b/devel/ogre/Makefile
index 12f4d4e536e..6aa3261f082 100644
--- a/devel/ogre/Makefile
+++ b/devel/ogre/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2005/05/22 20:07:54 jlam Exp $
+# $NetBSD: Makefile,v 1.15 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= ogre-v0-12-1
@@ -16,7 +16,6 @@ WRKSRC= ${WRKDIR}/ogrenew
GNU_CONFIGURE= yes
USE_TOOLS+= gmake
USE_LIBTOOL= yes
-USE_X11= yes
CONFIGURE_ARGS+= --with-platform=SDL
diff --git a/devel/pango/Makefile b/devel/pango/Makefile
index c516b0ee4e0..6f64e21fa08 100644
--- a/devel/pango/Makefile
+++ b/devel/pango/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.55 2005/05/22 20:07:54 jlam Exp $
+# $NetBSD: Makefile,v 1.56 2005/06/01 18:02:44 jlam Exp $
#
DISTNAME= pango-1.8.1
@@ -16,7 +16,6 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_PKGINSTALL= yes
USE_TOOLS+= gmake
-USE_X11= yes
GNU_CONFIGURE= yes
TEST_TARGET= check
USE_LIBTOOL= yes
diff --git a/devel/py-idle/Makefile b/devel/py-idle/Makefile
index 604ead5c51a..c0638685884 100644
--- a/devel/py-idle/Makefile
+++ b/devel/py-idle/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2005/04/11 21:45:37 tv Exp $
+# $NetBSD: Makefile,v 1.20 2005/06/01 18:02:45 jlam Exp $
#
PKGNAME= ${PYPKGPREFIX}-idle-0
@@ -9,8 +9,6 @@ MAINTAINER= tech-pkg@NetBSD.org
HOMEPAGE= http://www.python.org/idle/
COMMENT= IDLE - The Integrated DeveLopment Environment for Python
-USE_X11= yes
-
PLIST_SRC= ${WRKDIR}/.PLIST_SRC
PY_PATCHPLIST= yes
PLIST_SUBST+= PYVERSSUFFIX=${PYVERSSUFFIX}
diff --git a/devel/readline/builtin.mk b/devel/readline/builtin.mk
index c15e7f4d84a..aa21f842ec6 100644
--- a/devel/readline/builtin.mk
+++ b/devel/readline/builtin.mk
@@ -1,109 +1,114 @@
-# $NetBSD: builtin.mk,v 1.9 2005/01/26 16:17:16 jlam Exp $
+# $NetBSD: builtin.mk,v 1.10 2005/06/01 18:02:45 jlam Exp $
-_READLINE_H= /usr/include/readline.h
-_READLINE_READLINE_H= /usr/include/readline/readline.h
+BUILTIN_PKG:= readline
-.for _lib_ in readline edit
-. if !defined(_BLNK_LIB_FOUND.${_lib_})
-_BLNK_LIB_FOUND.${_lib_}!= \
- if ${TEST} "`${ECHO} /usr/lib/lib${_lib_}.*`" != "/usr/lib/lib${_lib_}.*"; then \
- ${ECHO} "yes"; \
- elif ${TEST} "`${ECHO} /lib/lib${_lib_}.*`" != "/lib/lib${_lib_}.*"; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
-BUILDLINK_VARS+= _BLNK_LIB_FOUND.${_lib_}
-. endif
-.endfor
-.undef _lib_
+BUILTIN_FIND_LIBS:= edit readline
+BUILTIN_FIND_FILES_VAR:= H_READLINE
+BUILTIN_FIND_FILES.H_READLINE= /usr/include/readline/readline.h \
+ /usr/include/readline.h
+BUILTIN_FIND_GREP.H_READLINE= \#define[ ]*RL_VERSION_MAJOR
+.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.readline)
IS_BUILTIN.readline= no
-. if exists(${_READLINE_H}) || exists(${_READLINE_READLINE_H})
-. if exists(${_READLINE_H})
-_READLINE_HEADER= ${_READLINE_H}
-. else
-_READLINE_HEADER= ${_READLINE_READLINE_H}
-. endif
-IS_BUILTIN.readline!= \
- if ${GREP} -q "\#define[ ]*RL_VERSION_MAJOR" ${_READLINE_HEADER}; then \
- ${ECHO} "yes"; \
- else \
- ${ECHO} "no"; \
- fi
-. if !empty(IS_BUILTIN.readline:M[yY][eE][sS])
-#
-# Create an appropriate name for the built-in package distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
-# version or if the built-in one is sufficient.
-#
-_READLINE_MAJOR!= \
- ${AWK} '/\#define[ ]*RL_VERSION_MAJOR/ { print $$3 }' \
- ${_READLINE_HEADER}
-_READLINE_MINOR!= \
- ${AWK} '/\#define[ ]*RL_VERSION_MINOR/ { print $$3 }' \
- ${_READLINE_HEADER}
-_READLINE_VERSION= ${_READLINE_MAJOR}.${_READLINE_MINOR}
-BUILTIN_PKG.readline= readline-${_READLINE_VERSION}
-BUILDLINK_VARS+= BUILTIN_PKG.readline
-. endif
+. if empty(H_READLINE:M${LOCALBASE}/*) && exists(${H_READLINE}) && \
+ !empty(BUILTIN_LIB_FOUND.readline:M[yY][eE][sS])
+IS_BUILTIN.readline= yes
. endif
-BUILDLINK_VARS+= IS_BUILTIN.readline
-.endif # IS_BUILTIN.readline
+.endif
+MAKEVARS+= IS_BUILTIN.readline
-.if !defined(USE_BUILTIN.readline)
-USE_BUILTIN.readline?= ${IS_BUILTIN.readline}
-PREFER.readline?= pkgsrc
+###
+### 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.readline) && \
+ !empty(IS_BUILTIN.readline:M[yY][eE][sS]) && \
+ exists(${H_READLINE})
+BUILTIN_VERSION.readline!= \
+ ${AWK} '/\#define[ ]*RL_VERSION_MAJOR/ { M = $$3 } \
+ /\#define[ ]*RL_VERSION_MINOR/ { m = "."$$3 } \
+ END { printf "%s%s\n", M, m } \
+ ' ${H_READLINE:Q}
+BUILTIN_PKG.readline= readline-${BUILTIN_VERSION.readline}
+.endif
+MAKEVARS+= BUILTIN_PKG.readline
-. if defined(BUILTIN_PKG.readline)
+###
+### 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.readline)
+. if ${PREFER.readline} == "pkgsrc"
+USE_BUILTIN.readline= no
+. else
+USE_BUILTIN.readline= ${IS_BUILTIN.readline}
+. if defined(BUILTIN_PKG.readline) && \
+ !empty(IS_BUILTIN.readline:M[yY][eE][sS])
USE_BUILTIN.readline= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.readline}
-. if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
+. for _dep_ in ${BUILDLINK_DEPENDS.readline}
+. if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
USE_BUILTIN.readline!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.readline}; then \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.readline:Q}; then \
${ECHO} "yes"; \
else \
${ECHO} "no"; \
fi
-. endif
-. endfor
-. endif
-
-. if ${PREFER.readline} == "native"
+. endif
+. endfor
+. endif
# XXX
-# XXX By default, assume that the native editline library supports readline.
+# XXX By default, assume that the native editline library is good enough
+# XXX to replace GNU readline if it provides the readline-compatibility
+# XXX headers.
# XXX
-. if !empty(_BLNK_LIB_FOUND.readline:M[nN][oO]) && \
- !empty(_BLNK_LIB_FOUND.edit:M[yY][eE][sS])
+. if !empty(BUILTIN_LIB_FOUND.readline:M[nN][oO]) && \
+ !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS]) && \
+ (exists(/usr/include/readline/readline.h) || \
+ exists(/usr/include/readline.h))
USE_BUILTIN.readline= yes
+. endif
+#
+# Some platforms don't have a readline/editline implementation that can
+# replace GNU readline.
+#
_INCOMPAT_READLINE?= SunOS-*-* Darwin-*-* Interix-*-*
-. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
+. for _pattern_ in ${_INCOMPAT_READLINE} ${INCOMPAT_READLINE}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
USE_BUILTIN.readline= no
-. endif
-. endfor
-. endif
-. endif
+. endif
+. endfor
+. endif # PREFER.readline
+.endif
+MAKEVARS+= USE_BUILTIN.readline
-. if defined(USE_GNU_READLINE)
-. if !empty(IS_BUILTIN.readline:M[nN][oO]) || \
- (${PREFER.readline} == "pkgsrc")
+# If USE_GNU_READLINE is defined, then force the use of a GNU readline
+# implementation.
+#
+.if defined(USE_GNU_READLINE)
+. if !empty(IS_BUILTIN.readline:M[nN][oO])
USE_BUILTIN.readline= no
-. endif
. endif
-.endif # USE_BUILTIN.readline
+.endif
+###
+### The section below only applies if we are not including this file
+### solely to determine whether a built-in implementation exists.
+###
CHECK_BUILTIN.readline?= no
.if !empty(CHECK_BUILTIN.readline:M[nN][oO])
-.if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
-. if !empty(_BLNK_LIB_FOUND.readline:M[nN][oO]) && \
- !empty(_BLNK_LIB_FOUND.edit:M[yY][eE][sS])
-BUILDLINK_TRANSFORM+= l:history:edit:termcap
-BUILDLINK_TRANSFORM+= l:readline:edit:termcap
+. if !empty(USE_BUILTIN.readline:M[yY][eE][sS])
+. if !empty(BUILTIN_LIB_FOUND.readline:M[nN][oO]) && \
+ !empty(BUILTIN_LIB_FOUND.edit:M[yY][eE][sS])
+BUILDLINK_TRANSFORM+= l:history:edit:termcap
+BUILDLINK_TRANSFORM+= l:readline:edit:termcap
+. endif
. endif
-.endif
.endif # CHECK_BUILTIN.readline
diff --git a/devel/tcl-tclcl/Makefile b/devel/tcl-tclcl/Makefile
index dac5a71c0cd..88c7e940988 100644
--- a/devel/tcl-tclcl/Makefile
+++ b/devel/tcl-tclcl/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.11 2005/04/11 21:45:39 tv Exp $
+# $NetBSD: Makefile,v 1.12 2005/06/01 18:02:45 jlam Exp $
DISTNAME= tclcl-src-1.16
PKGNAME= tcl-${DISTNAME:S/-src//}
@@ -15,7 +15,6 @@ WRKSRC= ${WRKDIR}/${DISTNAME:S/-src//}
USE_LANGUAGES= c c++
GNU_CONFIGURE= yes
USE_LIBTOOL= yes
-USE_X11= yes
CONFIGURE_ARGS+= --with-tcl=${BUILDLINK_PREFIX.tcl}
CONFIGURE_ARGS+= --with-tk=${BUILDLINK_PREFIX.tk}
diff --git a/devel/zlib/builtin.mk b/devel/zlib/builtin.mk
index ca90ebdcd28..cfc48374a44 100644
--- a/devel/zlib/builtin.mk
+++ b/devel/zlib/builtin.mk
@@ -1,81 +1,94 @@
-# $NetBSD: builtin.mk,v 1.2 2004/03/29 05:43:30 jlam Exp $
+# $NetBSD: builtin.mk,v 1.3 2005/06/01 18:02:45 jlam Exp $
-_ZLIB_H= /usr/include/zlib.h
+BUILTIN_PKG:= zlib
+BUILTIN_FIND_FILES_VAR:= H_ZLIB
+BUILTIN_FIND_FILES.H_ZLIB= /usr/include/zlib.h
+
+.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.zlib)
IS_BUILTIN.zlib= no
-. if exists(${_ZLIB_H})
+. if empty(H_ZLIB:M${LOCALBASE}/*) && exists(${H_ZLIB})
IS_BUILTIN.zlib= yes
-#
-# Create an appropriate name for the built-in package distributed
-# with the system. This package name can be used to check against
-# BUILDLINK_DEPENDS.<pkg> to see if we need to install the pkgsrc
-# version or if the built-in one is sufficient.
-#
-_ZLIB_VERSION!= \
+. endif
+.endif
+MAKEVARS+= IS_BUILTIN.zlib
+
+###
+### 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.zlib) && \
+ !empty(IS_BUILTIN.zlib:M[yY][eE][sS]) && \
+ exists(${H_ZLIB})
+BUILTIN_VERSION.zlib!= \
${AWK} '/\#define[ ]*ZLIB_VERSION/ { \
vers = $$3; \
gsub("\"", "", vers); \
print vers; \
} \
- ' ${_ZLIB_H}
-BUILTIN_PKG.zlib= zlib-${_ZLIB_VERSION}
+ ' ${H_ZLIB:Q}
#
# If the built-in zlib is 1.1.4, then check whether it has the security
# fix for CAN-2003-0107, which was a buffer overflow in the gzprintf
# function. If it does, then treat it as the equivalent of zlib-1.1.4nb1.
#
-_HAVE_CAN_2003_0107_FIX= NetBSD-1.3[I-Z]*-* NetBSD-1.[456]*-*
-_HAVE_CAN_2003_0107_FIX+= NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
+BUILTIN_CAN_2003_0107_FIX= NetBSD-1.3[I-Z]*-* NetBSD-1.[456]*-* \
+ NetBSD-[2-9]*-* NetBSD-1[0-9]*-*
#
# XXX These patterns for {Free,Open}BSD are too permissive, but I'm not
# XXX sure which versions of those OSes provide secure versions of
# XXX zlib-1.1.4.
#
-_HAVE_CAN_2003_0107_FIX+= FreeBSD-*-* OpenBSD-*-*
-. if ${_ZLIB_VERSION} == "1.1.4"
-. for _pattern_ in ${_HAVE_CAN_2003_0107_FIX}
-. if !empty(MACHINE_PLATFORM:M${_pattern_})
-BUILTIN_PKG.zlib= zlib-1.1.4nb1
-. endif
-. endfor
-. endif
-BUILDLINK_VARS+= BUILTIN_PKG.zlib
+BUILTIN_CAN_2003_0107_FIX+= FreeBSD-*-* OpenBSD-*-*
+. if ${BUILTIN_VERSION.zlib} == "1.1.4"
+. for _pattern_ in ${BUILTIN_CAN_2003_0107_FIX}
+. if !empty(MACHINE_PLATFORM:M${_pattern_})
+BUILTIN_VERSION.zlib= 1.1.4nb1
+. endif
+. endfor
. endif
-BUILDLINK_VARS+= IS_BUILTIN.zlib
-.endif # IS_BUILTIN.zlib
+BUILTIN_PKG.zlib= zlib-${BUILTIN_VERSION.zlib}
+.endif
+MAKEVARS+= BUILTIN_PKG.zlib
+###
+### 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.zlib)
-USE_BUILTIN.zlib?= ${IS_BUILTIN.zlib}
-PREFER.zlib?= pkgsrc
-
-. if defined(BUILTIN_PKG.zlib)
+. if ${PREFER.zlib} == "pkgsrc"
+USE_BUILTIN.zlib= no
+. else
+USE_BUILTIN.zlib= ${IS_BUILTIN.zlib}
+. if defined(BUILTIN_PKG.zlib) && \
+ !empty(IS_BUILTIN.zlib:M[yY][eE][sS])
USE_BUILTIN.zlib= yes
-. for _depend_ in ${BUILDLINK_DEPENDS.zlib}
-. if !empty(USE_BUILTIN.zlib:M[yY][eE][sS])
+. for _dep_ in ${BUILDLINK_DEPENDS.zlib}
+. if !empty(USE_BUILTIN.zlib:M[yY][eE][sS])
USE_BUILTIN.zlib!= \
- if ${PKG_ADMIN} pmatch '${_depend_}' ${BUILTIN_PKG.zlib}; then \
- ${ECHO} "yes"; \
+ if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.zlib:Q}; then \
+ ${ECHO} yes; \
else \
- ${ECHO} "no"; \
+ ${ECHO} no; \
fi
-. endif
-. endfor
-. endif
+. endif
+. endfor
+. endif
+. endif # PREFER.zlib
+.endif
+MAKEVARS+= USE_BUILTIN.zlib
-. if defined(USE_ZLIB)
-. if !empty(IS_BUILTIN.zlib:M[nN][oO]) && \
- (${PREFER.zlib} == "pkgsrc")
+# If USE_ZLIB is defined, then force the use of a true zlib
+# implementation.
+#
+.if defined(USE_ZLIB)
+. if !empty(IS_BUILTIN.zlib:M[nN][oO])
USE_BUILTIN.zlib= no
-. endif
. endif
-.endif # USE_BUILTIN.zlib
-
-CHECK_BUILTIN.zlib?= no
-.if !empty(CHECK_BUILTIN.zlib:M[nN][oO])
-
-.if !empty(USE_BUILTIN.zlib:M[nN][oO])
-BUILDLINK_DEPENDS.zlib+= zlib>=1.2.1
.endif
-
-.endif # CHECK_BUILTIN.zlib