summaryrefslogtreecommitdiff
path: root/devel/libgetopt/buildlink.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2001-08-20 03:54:48 +0000
committerjlam <jlam@pkgsrc.org>2001-08-20 03:54:48 +0000
commitd390185ffdbcd7e5ca1f9b65aca7034247cebee9 (patch)
treea66f99f708a9c4b42a075f38f98b0d47328f0d79 /devel/libgetopt/buildlink.mk
parent9f84fdeadaa9c5f2ad5815ffde71a8faf3ad5496 (diff)
downloadpkgsrc-d390185ffdbcd7e5ca1f9b65aca7034247cebee9.tar.gz
Don't automatically add -lgetopt to LIBS, as we usually only want -lgetopt
to be linked into just the programs, not everything being linked including libraries. Also some changes to set _NEED_GETOPT instead of a direct check for /usr/include/getopt.h.
Diffstat (limited to 'devel/libgetopt/buildlink.mk')
-rw-r--r--devel/libgetopt/buildlink.mk17
1 files changed, 12 insertions, 5 deletions
diff --git a/devel/libgetopt/buildlink.mk b/devel/libgetopt/buildlink.mk
index 8f133b3c4bc..6b00ab1699e 100644
--- a/devel/libgetopt/buildlink.mk
+++ b/devel/libgetopt/buildlink.mk
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink.mk,v 1.12 2001/07/27 13:33:23 jlam Exp $
+# $NetBSD: buildlink.mk,v 1.13 2001/08/20 03:54:48 jlam Exp $
#
# This Makefile fragment is included by packages that use getopt_long().
#
@@ -19,8 +19,15 @@ GETOPT_BUILDLINK_MK= # defined
BUILDLINK_DEPENDS.getopt?= libgetopt>=1.3
.if exists(/usr/include/getopt.h)
+_NEED_GETOPT= NO
+.else
+_NEED_GETOPT= YES
+.endif
+
+.if ${_NEED_GETOPT} == "NO"
BUILDLINK_PREFIX.getopt= /usr
BUILDLINK_FILES.getopt= include/getopt.h
+LIBGETOPT= # empty
.else
DEPENDS+= ${BUILDLINK_DEPENDS.getopt}:../../devel/libgetopt
EVAL_PREFIX+= BUILDLINK_PREFIX.getopt=libgetopt
@@ -28,12 +35,12 @@ BUILDLINK_PREFIX.getopt_DEFAULT= ${LOCALBASE}
BUILDLINK_FILES.getopt= include/getopt.h
BUILDLINK_FILES.getopt+= lib/libgetopt.*
BUILDLINK_FILES.getopt+= lib/libgetopt_pic.a
-
-.if defined(GNU_CONFIGURE)
-LIBS+= -lgetopt
-.endif
+LIBGETOPT= -lgetopt
.endif
+CONFIGURE_ENV+= LIBGETOPT="${LIBGETOPT}"
+MAKE_ENV+= LIBGETOPT="${LIBGETOPT}"
+
BUILDLINK_TARGETS.getopt= getopt-buildlink
BUILDLINK_TARGETS+= ${BUILDLINK_TARGETS.getopt}