summaryrefslogtreecommitdiff
path: root/devel/libgetopt
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-05-24 09:13:19 +0000
committerjlam <jlam@pkgsrc.org>2001-05-24 09:13:19 +0000
commite0d1a579c880df94ad1daa9fbd314c825160155a (patch)
tree19929b20e1c64d2642f5966d55bcd59c9ab5814c /devel/libgetopt
parentd1c6bb07b53c67659a36cb8ac5c28862d8c5054c (diff)
downloadpkgsrc-e0d1a579c880df94ad1daa9fbd314c825160155a.tar.gz
Add a link-getopt-libs target to link libgetopt* into ${BUILDLINK_LIBDIR},
and add link-getopt-libs to BUILDLINK_TARGETS.
Diffstat (limited to 'devel/libgetopt')
-rw-r--r--devel/libgetopt/buildlink.mk24
1 files changed, 22 insertions, 2 deletions
diff --git a/devel/libgetopt/buildlink.mk b/devel/libgetopt/buildlink.mk
index 216465b0aa6..9be12744ad3 100644
--- a/devel/libgetopt/buildlink.mk
+++ b/devel/libgetopt/buildlink.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink.mk,v 1.2 2001/05/24 08:58:24 jlam Exp $
+# $NetBSD: buildlink.mk,v 1.3 2001/05/24 09:13:19 jlam Exp $
#
# This Makefile fragment is included by packages that use getopt_long().
#
@@ -9,15 +9,20 @@
# To use this Makefile fragment, simply:
#
# (1) Include this Makefile fragment in the package Makefile,
-# (2) Optionally define BUILDLINK_INCDIR,
+# (2) Optionally define BUILDLINK_INCDIR and BUILDLINK_LIBDIR,
# (3) Add ${BUILDLINK_TARGETS} to the prerequisite targets for pre-configure,
# (4) Add ${BUILDLINK_INCDIR} to the front of the C preprocessor's header
# search path.
+# (5) Add ${BUILDLINK_LIBDIR} to the front of the linker's library search
+# path.
.if exists(/usr/include/getopt.h)
GETOPT_H= /usr/include/getopt.h
.else
GETOPT_H= ${LOCALBASE}/include/getopt.h
+LIBGETOPT= ${LOCALBASE}/lib/libgetopt.a
+LIBGETOPT+= ${LOCALBASE}/lib/libgetopt_pic.a
+LIBGETOPT+= ${LOCALBASE}/lib/libgetopt.so*
DEPENDS+= libgetopt>=1.3:../../devel/libgetopt
.if defined(GNU_CONFIGURE)
CONFIGURE_ENV+= LIBS="${LIBS}"
@@ -26,8 +31,10 @@ LIBS+= -lgetopt
.endif
BUILDLINK_INCDIR?= ${WRKDIR}/include
+BUILDLINK_LIBDIR?= ${WRKDIR}/lib
BUILDLINK_TARGETS+= link-getopt-headers
+BUILDLINK_TARGETS+= link-getopt-libs
# This target links the getopt header into ${BUILDLINK_INCDIR}, which should
# be searched first by the C preprocessor.
@@ -37,3 +44,16 @@ link-getopt-headers:
@${MKDIR} ${BUILDLINK_INCDIR}
@${RM} -f ${BUILDLINK_INCDIR}/getopt.h
@${LN} -sf ${GETOPT_H} ${BUILDLINK_INCDIR}
+
+# This target links the getopt libraries into ${BUILDLINK_LIBDIR}, which
+# should be searched first by the linker.
+#
+link-getopt-libs:
+ @${ECHO} "Linking getopt libraries into ${BUILDLINK_LIBDIR}."
+ @${MKDIR} -p ${BUILDLINK_LIBDIR}
+.if defined(LIBGETOPT)
+ @for lib in ${LIBGETOPT}; do \
+ dest=`${BASENAME} $${lib}`; \
+ ${LN} -sf $${lib} ${BUILDLINK_LIBDIR}/$${dest}; \
+ done
+.endif