diff options
author | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2004-03-10 17:57:14 +0000 |
commit | d0b4c54eb698e718080690cf98ab5b8bbb4001e0 (patch) | |
tree | 1226d07b8f66083168895189decc88848b70903f /devel/libgetopt | |
parent | 9d61fef8537aed11013bf556e319b2d8e398a11b (diff) | |
download | pkgsrc-d0b4c54eb698e718080690cf98ab5b8bbb4001e0.tar.gz |
Split out the code that deals with checking whether the software is
built-in or not into a separate builtin.mk file. The code to deal
checking for built-in software is much simpler to deal with in pkgsrc.
The buildlink3.mk file for a package will be of the usual format
regardless of the package, which makes it simpler for packagers to
update a package.
The builtin.mk file for a package must define a single yes/no variable
USE_BUILTIN.<pkg> that is used by bsd.buildlink3.mk to decide whether
to use the built-in software or to use the pkgsrc software.
Diffstat (limited to 'devel/libgetopt')
-rw-r--r-- | devel/libgetopt/buildlink3.mk | 56 | ||||
-rw-r--r-- | devel/libgetopt/builtin.mk | 26 |
2 files changed, 37 insertions, 45 deletions
diff --git a/devel/libgetopt/buildlink3.mk b/devel/libgetopt/buildlink3.mk index 3049327ab69..1d2ceb33792 100644 --- a/devel/libgetopt/buildlink3.mk +++ b/devel/libgetopt/buildlink3.mk @@ -1,52 +1,18 @@ -# $NetBSD: buildlink3.mk,v 1.5 2004/01/24 03:12:32 jlam Exp $ +# $NetBSD: buildlink3.mk,v 1.6 2004/03/10 17:57:14 jlam Exp $ -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ -GETOPT_BUILDLINK3_MK:= ${GETOPT_BUILDLINK3_MK}+ +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ +LIBGETOPT_BUILDLINK3_MK:= ${LIBGETOPT_BUILDLINK3_MK}+ -.if !empty(GETOPT_BUILDLINK3_MK:M+) -BUILDLINK_PACKAGES+= getopt -BUILDLINK_DEPENDS.getopt+= libgetopt>=1.3 -BUILDLINK_PKGSRCDIR.getopt?= ../../devel/libgetopt -.endif # GETOPT_BUILDLINK3_MK - -BUILDLINK_CHECK_BUILTIN.getopt?= NO - -.if !defined(BUILDLINK_IS_BUILTIN.getopt) -BUILDLINK_IS_BUILTIN.getopt= NO -. if exists(/usr/include/getopt.h) -BUILDLINK_IS_BUILTIN.getopt= YES -. endif -.endif - -.if !empty(BUILDLINK_CHECK_BUILTIN.getopt:M[yY][eE][sS]) -BUILDLINK_USE_BUILTIN.getopt= YES -.endif - -.if !defined(BUILDLINK_USE_BUILTIN.getopt) -. if !empty(BUILDLINK_IS_BUILTIN.getopt:M[nN][oO]) -BUILDLINK_USE_BUILTIN.getopt= NO -. else -BUILDLINK_USE_BUILTIN.getopt= YES -. endif -.endif - -.if !empty(BUILDLINK_USE_BUILTIN.getopt:M[nN][oO]) -. if !empty(BUILDLINK_DEPTH:M+) +.if !empty(BUILDLINK_DEPTH:M+) BUILDLINK_DEPENDS+= getopt -. endif .endif -.if !empty(GETOPT_BUILDLINK3_MK:M+) -. if !empty(BUILDLINK_USE_BUILTIN.getopt:M[nN][oO]) -LIBGETOPT= -lgetopt -. else -LIBGETOPT= # empty -. endif +BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Ngetopt} +BUILDLINK_PACKAGES+= getopt -BUILDLINK_LDADD.getopt?= ${LIBGETOPT} - -CONFIGURE_ENV+= LIBGETOPT="${LIBGETOPT}" -MAKE_ENV+= LIBGETOPT="${LIBGETOPT}" -.endif # GETOPT_BUILDLINK3_MK +.if !empty(LIBGETOPT_BUILDLINK3_MK:M+) +BUILDLINK_DEPENDS.getopt+= libgetopt>=1.3 +BUILDLINK_PKGSRCDIR.getopt?= ../../devel/libgetopt +.endif # LIBGETOPT_BUILDLINK3_MK -BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} +BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//} diff --git a/devel/libgetopt/builtin.mk b/devel/libgetopt/builtin.mk new file mode 100644 index 00000000000..74615cdb8be --- /dev/null +++ b/devel/libgetopt/builtin.mk @@ -0,0 +1,26 @@ +# $NetBSD: builtin.mk,v 1.1 2004/03/10 17:57:14 jlam Exp $ + +.if !defined(IS_BUILTIN.getopt) +IS_BUILTIN.getopt= no +. if exists(/usr/include/getopt.h) +IS_BUILTIN.getopt= yes +. endif +.endif + +CHECK_BUILTIN.getopt?= no +.if !empty(CHECK_BUILTIN.getopt:M[yY][eE][sS]) +USE_BUILTIN.getopt= yes +.endif + +USE_BUILTIN.getopt?= ${IS_BUILTIN.getopt} + +.if !empty(USE_BUILTIN.getopt:M[nN][oO]) +LIBGETOPT= -lgetopt +.else +LIBGETOPT= # empty +.endif + +BUILDLINK_LDADD.getopt?= ${LIBGETOPT} + +CONFIGURE_ENV+= LIBGETOPT="${LIBGETOPT}" +MAKE_ENV+= LIBGETOPT="${LIBGETOPT}" |