diff options
author | jlam <jlam@pkgsrc.org> | 2001-05-24 08:53:54 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-05-24 08:53:54 +0000 |
commit | 54718a4db7a73e26f6c276f352e0682c36b5c527 (patch) | |
tree | 5f91b7729fd1bdb67af0af17bb78b53ca29f8bd6 /devel | |
parent | a7c8e855cba1fc8efee19d3a05c929de3572328e (diff) | |
download | pkgsrc-54718a4db7a73e26f6c276f352e0682c36b5c527.tar.gz |
Standardize name of file to include for build-links to be "buildlink.mk".
Use BUILDLINK_INCDIR, BUILDLINK_LIBDIR for locations of linked headers
and libraries. Create a variable BUILDLINK_TARGETS whose value is the
list of build-link targets to execute.
Diffstat (limited to 'devel')
-rw-r--r-- | devel/cdecl/Makefile | 10 | ||||
-rw-r--r-- | devel/cmdline/Makefile | 10 | ||||
-rw-r--r-- | devel/libgetopt/Makefile.getopt | 34 | ||||
-rw-r--r-- | devel/libgetopt/buildlink.mk | 36 | ||||
-rw-r--r-- | devel/readline/buildlink.mk (renamed from devel/readline/Makefile.readline) | 51 |
5 files changed, 73 insertions, 68 deletions
diff --git a/devel/cdecl/Makefile b/devel/cdecl/Makefile index 173649ccd8f..4af91257d34 100644 --- a/devel/cdecl/Makefile +++ b/devel/cdecl/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.6 2001/05/22 05:50:51 jlam Exp $ +# $NetBSD: Makefile,v 1.7 2001/05/24 08:53:55 jlam Exp $ # DISTNAME= cdecl-2.5 @@ -14,14 +14,14 @@ COMMENT= utility to explain and compose C and C++ declarations ALL_TARGET= cdecl -.include "../../devel/readline/Makefile.readline" +.include "../../devel/readline/buildlink.mk" -CFLAGS+= -I${WRKINCDIR} -LDFLAGS+= -L${WRKLIBDIR} +CFLAGS+= -I${BUILDLINK_INCDIR} +LDFLAGS+= -L${BUILDLINK_LIBDIR} EGDIR= ${PREFIX}/share/examples/cdecl -pre-configure: link-readline-headers link-readline-libs +pre-configure: ${BUILDLINK_TARGETS} post-install: ${INSTALL_DATA_DIR} ${EGDIR} diff --git a/devel/cmdline/Makefile b/devel/cmdline/Makefile index 9387411973a..80d1bc511e8 100644 --- a/devel/cmdline/Makefile +++ b/devel/cmdline/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2001/05/17 20:28:18 jlam Exp $ +# $NetBSD: Makefile,v 1.5 2001/05/24 08:53:55 jlam Exp $ DISTNAME= CmdLine PKGNAME= cmdline-${PKG_VERS} @@ -16,15 +16,15 @@ DIST_SUBDIR= cmdline-${DIST_VERS} USE_LIBTOOL= # defined NO_CONFIGURE= # defined -.include "../../devel/readline/Makefile.readline" +.include "../../devel/readline/buildlink.mk" -MOREUSRDEFS= -I${WRKINCDIR}/readline -MOREUSRLIBS= -L${WRKLIBDIR} -lreadline -ltermcap +MOREUSRDEFS= -I${BUILDLINK_INCDIR}/readline +MOREUSRLIBS= -L${BUILDLINK_LIBDIR} -lreadline -ltermcap MAKE_ENV+= OPT="${CXXFLAGS}" MAKE_ENV+= MOREUSRDEFS="${MOREUSRDEFS}" MAKE_ENV+= MOREUSRLIBS="${MOREUSRLIBS}" -pre-build: link-readline-headers link-readline-libs +pre-build: ${BUILDLINK_TARGETS} .include "../../mk/bsd.pkg.mk" diff --git a/devel/libgetopt/Makefile.getopt b/devel/libgetopt/Makefile.getopt deleted file mode 100644 index 928f131037f..00000000000 --- a/devel/libgetopt/Makefile.getopt +++ /dev/null @@ -1,34 +0,0 @@ -# $NetBSD: Makefile.getopt,v 1.3 2001/05/22 16:45:38 jlam Exp $ -# -# This Makefile fragment is included by packages that use getopt_long(). -# -# If getopt_long() is not present in the base system, then a dependency -# on devel/libgetopt is added, and the appropriate headers are linked -# into ${WRKINCDIR} (${WRKSRC}/include). -# -# To use this Makefile, simply include this Makefile fragment in the -# package Makefile, optionally define WRKINCDIR, add -# link-getopt-headers to the prerequisite targets for pre-configure, -# and add ${WRKINCDIR} to the compiler's header search path. - -.if exists(/usr/include/getopt.h) -GETOPT_H= /usr/include/getopt.h -.else -GETOPT_H= ${LOCALBASE}/include/getopt.h -DEPENDS+= libgetopt>=1.3:../../devel/libgetopt -.if defined(GNU_CONFIGURE) -CONFIGURE_ENV+= LIBS="${LIBS}" -LIBS+= -lgetopt -.endif -.endif - -WRKINCDIR?= ${WRKDIR}/include - -# This target links the getopt header into ${WRKINCDIR}, which should be -# searched first by the C preprocessor. -# -link-getopt-headers: - @${ECHO} "Linking getopt headers into ${WRKINCDIR}." - @${MKDIR} -p ${WRKINCDIR} - @${RM} -f ${WRKINCDIR}/getopt.h - @${LN} -sf ${GETOPT_H} ${WRKINCDIR} diff --git a/devel/libgetopt/buildlink.mk b/devel/libgetopt/buildlink.mk new file mode 100644 index 00000000000..eaef5fb7424 --- /dev/null +++ b/devel/libgetopt/buildlink.mk @@ -0,0 +1,36 @@ +# $NetBSD: buildlink.mk,v 1.1 2001/05/24 08:53:56 jlam Exp $ +# +# This Makefile fragment is included by packages that use getopt_long(). +# +# If getopt_long() is not present in the base system, then a dependency +# on devel/libgetopt is added, and the appropriate headers are linked +# into ${BUILDLINK_INCDIR} (${WRKSRC}/include). +# +# To use this Makefile, simply include this Makefile fragment in the +# package Makefile, optionally define BUILDLINK_INCDIR, add +# ${BUILDLINK_TARGETS} to the prerequisite targets for pre-configure, +# and add ${BUILDLINK_INCDIR} to the compiler's header search path. + +.if exists(/usr/include/getopt.h) +GETOPT_H= /usr/include/getopt.h +.else +GETOPT_H= ${LOCALBASE}/include/getopt.h +DEPENDS+= libgetopt>=1.3:../../devel/libgetopt +.if defined(GNU_CONFIGURE) +CONFIGURE_ENV+= LIBS="${LIBS}" +LIBS+= -lgetopt +.endif +.endif + +BUILDLINK_INCDIR?= ${WRKDIR}/include + +BUILDLINK_TARGETS+= link-getopt-headers + +# This target links the getopt header into ${BUILDLINK_INCDIR}, which should +# be searched first by the C preprocessor. +# +link-getopt-headers: + @${ECHO} "Linking getopt headers into ${BUILDLINK_INCDIR}." + @${MKDIR} ${BUILDLINK_INCDIR} + @${RM} -f ${BUILDLINK_INCDIR}/getopt.h + @${LN} -sf ${GETOPT_H} ${BUILDLINK_INCDIR} diff --git a/devel/readline/Makefile.readline b/devel/readline/buildlink.mk index fd0a9952187..f15d8e31f20 100644 --- a/devel/readline/Makefile.readline +++ b/devel/readline/buildlink.mk @@ -1,23 +1,23 @@ -# $NetBSD: Makefile.readline,v 1.4 2001/05/22 16:46:37 jlam Exp $ +# $NetBSD: buildlink.mk,v 1.1 2001/05/24 08:53:56 jlam Exp $ # # This Makefile fragment is included by packages that use readline(). # # If readline() is not present in the base system through libedit, then a # dependency on devel/readline is added, the appropriate headers are linked -# into ${WRKINCDIR} (${WRKSRC}/include), and the appropriate libraries are -# linked into ${WRKLIBDIR} (${WRKSRC}/lib). +# into ${BUILDLINK_INCDIR} (${WRKSRC}/include), and the appropriate libraries +# are linked into ${BUILDLINK_LIBDIR} (${WRKSRC}/lib). # # To use this Makefile fragment, simply: # # (1) Optionally define USE_GNU_READLINE to force use of GNU readline. # (2) Optionally define READLINE_REQD to the version of GNU readline desired. # (3) Include this Makefile fragment in the package Makefile, -# (4) Optionally define WRKINCDIR and WRKLIBDIR, -# (5) Add link-readline-headers and link-readline-libs to the prerequisite -# targets for pre-configure, -# (6) Add ${WRKINCDIR} to the front of the C preprocessor's header search -# path, and -# (7) Add ${WRKLIBDIR} to the front of the linker's library search path. +# (4) Optionally define BUILDLINK_INCDIR and BUILDLINK_LIBDIR, +# (5) Add ${BUILDLINK_TARGETS} to the prerequisite targets for pre-configure, +# (6) Add ${BUILDLINK_INCDIR} to the front of the C preprocessor's header +# search path, and +# (7) Add ${BUILDLINK_LIBDIR} to the front of the linker's library search +# path. # # NOTE: You may need to do some more work to get libedit recognized over # libreadline, especially by GNU configure scripts. @@ -57,36 +57,39 @@ DEPENDS+= readline>=${READLINE_REQD}:../../devel/readline .endif .endif -WRKINCDIR?= ${WRKDIR}/include -WRKLIBDIR?= ${WRKDIR}/lib +BUILDLINK_INCDIR?= ${WRKDIR}/include +BUILDLINK_LIBDIR?= ${WRKDIR}/lib -# This target links the readline and history headers into ${WRKINCDIR}, +BUILDLINK_TARGETS+= link-readline-headers +BUILDLINK_TARGETS+= link-readline-libs + +# This target links the readline and history headers into ${BUILDLINK_INCDIR}, # which should be searched first by the C preprocessor. # link-readline-headers: - @${ECHO} "Linking readline headers into ${WRKINCDIR}." - @${MKDIR} -p ${WRKINCDIR}/readline - @${RM} -f ${WRKINCDIR}/readline/* + @${ECHO} "Linking readline headers into ${BUILDLINK_INCDIR}." + @${MKDIR} -p ${BUILDLINK_INCDIR}/readline + @${RM} -f ${BUILDLINK_INCDIR}/readline/* .if defined(READLINE_INCDIR) @for inc in ${READLINE_INCDIR}/*; do \ - ${LN} -sf $${inc} ${WRKINCDIR}/readline; \ + ${LN} -sf $${inc} ${BUILDLINK_INCDIR}/readline; \ done .else - @${LN} -sf ${READLINE_H} ${WRKINCDIR}/readline - @${LN} -sf ${HISTORY_H} ${WRKINCDIR}/readline + @${LN} -sf ${READLINE_H} ${BUILDLINK_INCDIR}/readline + @${LN} -sf ${HISTORY_H} ${BUILDLINK_INCDIR}/readline .endif -# This target links the readline and history libraries into ${WRKLIBDIR}, -# which should be searched first by the linker. +# This target links the readline and history libraries into +# ${BUILDLINK_LIBDIR}, which should be searched first by the linker. # link-readline-libs: - @${ECHO} "Linking readline libraries into ${WRKLIBDIR}." - @${MKDIR} -p ${WRKLIBDIR} + @${ECHO} "Linking readline libraries into ${BUILDLINK_LIBDIR}." + @${MKDIR} -p ${BUILDLINK_LIBDIR} @for lib in ${LIBREADLINE}; do \ dest=`${BASENAME} $${lib} | ${SED} "s|libedit|libreadline|"`; \ - ${LN} -sf $${lib} ${WRKLIBDIR}/$${dest}; \ + ${LN} -sf $${lib} ${BUILDLINK_LIBDIR}/$${dest}; \ done @for lib in ${LIBHISTORY}; do \ dest=`${BASENAME} $${lib} | ${SED} "s|libedit|libhistory|"`; \ - ${LN} -sf $${lib} ${WRKLIBDIR}/$${dest}; \ + ${LN} -sf $${lib} ${BUILDLINK_LIBDIR}/$${dest}; \ done |