diff options
author | jlam <jlam> | 2001-05-15 19:18:14 +0000 |
---|---|---|
committer | jlam <jlam> | 2001-05-15 19:18:14 +0000 |
commit | a1be9a1f2152a204bf7f5452001c492ba526043b (patch) | |
tree | b5c2f7dde6540de9f9928414dae023a8f47e3096 /devel/libgetopt | |
parent | 76b05b3465c72629b5e3f06e3bbc50890fad74a4 (diff) | |
download | pkgsrc-a1be9a1f2152a204bf7f5452001c492ba526043b.tar.gz |
Move this file from databases/postgresql/Makefile.getopt to be usable by
more packages.
Diffstat (limited to 'devel/libgetopt')
-rw-r--r-- | devel/libgetopt/Makefile.getopt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/devel/libgetopt/Makefile.getopt b/devel/libgetopt/Makefile.getopt new file mode 100644 index 00000000000..21c7cbbcad5 --- /dev/null +++ b/devel/libgetopt/Makefile.getopt @@ -0,0 +1,30 @@ +# $NetBSD: Makefile.getopt,v 1.1 2001/05/15 19:18:14 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 +LIBS+= -lgetopt +.endif + +WRKINCDIR?= ${WRKDIR}/include + +# This target links the getopt header into ${WRKINCDIR}/include, which is +# searched first by the C preprocessor. +# +link-getopt-headers: + ${MKDIR} -p ${WRKINCDIR} + ${RM} -f ${WRKINCDIR}/getopt.h + ${LN} -sf ${GETOPT_H} ${WRKINCDIR} |