summaryrefslogtreecommitdiff
path: root/databases/postgresql/Makefile.getopt
diff options
context:
space:
mode:
Diffstat (limited to 'databases/postgresql/Makefile.getopt')
-rw-r--r--databases/postgresql/Makefile.getopt21
1 files changed, 21 insertions, 0 deletions
diff --git a/databases/postgresql/Makefile.getopt b/databases/postgresql/Makefile.getopt
new file mode 100644
index 00000000000..1c45b7edda0
--- /dev/null
+++ b/databases/postgresql/Makefile.getopt
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile.getopt,v 1.1 2001/05/14 14:52:36 jlam Exp $
+#
+# This Makefile fragment is included by PostgreSQL packages built from the
+# main sources of the PostgreSQL distribution that use getopt_long()
+# functionality.
+
+.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
+
+# 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}