diff options
author | jlam <jlam@pkgsrc.org> | 2001-05-25 04:49:15 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2001-05-25 04:49:15 +0000 |
commit | e1fc187824b9d8efec57bf8f027c38299471f5aa (patch) | |
tree | b69a4e11f01faa6a41fd804845b6f4a1ac624768 | |
parent | e584a873d462d98f44217f7992cdf773c01e7f7e (diff) | |
download | pkgsrc-e1fc187824b9d8efec57bf8f027c38299471f5aa.tar.gz |
No functional changes, only slight recoding to make it easier to cut-and-
paste into new buildlink.mk files.
-rw-r--r-- | devel/libgetopt/buildlink.mk | 19 | ||||
-rw-r--r-- | devel/readline/buildlink.mk | 55 |
2 files changed, 48 insertions, 26 deletions
diff --git a/devel/libgetopt/buildlink.mk b/devel/libgetopt/buildlink.mk index 9be12744ad3..fa63007bf76 100644 --- a/devel/libgetopt/buildlink.mk +++ b/devel/libgetopt/buildlink.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink.mk,v 1.3 2001/05/24 09:13:19 jlam Exp $ +# $NetBSD: buildlink.mk,v 1.4 2001/05/25 04:49:15 jlam Exp $ # # This Makefile fragment is included by packages that use getopt_long(). # @@ -36,24 +36,27 @@ 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 +# This target links the headers into ${BUILDLINK_INCDIR}, which should # be searched first by the C preprocessor. # link-getopt-headers: @${ECHO} "Linking getopt headers into ${BUILDLINK_INCDIR}." @${MKDIR} ${BUILDLINK_INCDIR} @${RM} -f ${BUILDLINK_INCDIR}/getopt.h - @${LN} -sf ${GETOPT_H} ${BUILDLINK_INCDIR} + @${LN} -sf ${GETOPT_H} ${BUILDLINK_INCDIR}/getopt.h -# This target links the getopt libraries into ${BUILDLINK_LIBDIR}, which -# should be searched first by the linker. +# This target links the 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} + @${MKDIR} ${BUILDLINK_LIBDIR} .if defined(LIBGETOPT) @for lib in ${LIBGETOPT}; do \ - dest=`${BASENAME} $${lib}`; \ - ${LN} -sf $${lib} ${BUILDLINK_LIBDIR}/$${dest}; \ + dest=${BUILDLINK_LIBDIR}/`${BASENAME} $${lib}`; \ + if [ -f $${lib} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${lib} $${dest}; \ + fi; \ done .endif diff --git a/devel/readline/buildlink.mk b/devel/readline/buildlink.mk index 485990d15d6..5f1460506bc 100644 --- a/devel/readline/buildlink.mk +++ b/devel/readline/buildlink.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink.mk,v 1.2 2001/05/24 08:58:25 jlam Exp $ +# $NetBSD: buildlink.mk,v 1.3 2001/05/25 04:49:16 jlam Exp $ # # This Makefile fragment is included by packages that use readline(). # @@ -25,6 +25,15 @@ READLINE_REQD?= 2.2 .if defined(USE_GNU_READLINE) +_NEED_GNU_READLINE= YES +.elif exists(/usr/include/readline.h) || \ + exists(/usr/include/readline/readline.h) +_NEED_GNU_READLINE= NO +.else +_NEED_GNU_READLINE= YES +.endif + +.if ${_NEED_GNU_READLINE} == "YES" READLINE_INCDIR= ${LOCALBASE}/include/readline LIBREADLINE= ${LOCALBASE}/lib/libreadline.a LIBREADLINE+= ${LOCALBASE}/lib/libreadline.so* @@ -40,20 +49,13 @@ LIBREADLINE+= /usr/lib/libedit.so* LIBHISTORY= /usr/lib/libedit.a LIBHISTORY+= /usr/lib/libedit.so* HAVE_LIBEDIT_READLINE= # defined -.elif exists(/usr/include/readline/readline.h) +.else # exists(/usr/include/readline/readline.h) READLINE_INCDIR= /usr/include/readline LIBREADLINE= /usr/lib/libedit.a LIBREADLINE+= /usr/lib/libedit.so* LIBHISTORY= /usr/lib/libedit.a LIBHISTORY+= /usr/lib/libedit.so* HAVE_LIBEDIT_READLINE= # defined -.else -READLINE_INCDIR= ${LOCALBASE}/include/readline -LIBREADLINE= ${LOCALBASE}/lib/libreadline.a -LIBREADLINE+= ${LOCALBASE}/lib/libreadline.so* -LIBHISTORY= ${LOCALBASE}/lib/libhistory.a -LIBHISTORY+= ${LOCALBASE}/lib/libhistory.so* -DEPENDS+= readline>=${READLINE_REQD}:../../devel/readline .endif .endif @@ -68,15 +70,24 @@ BUILDLINK_TARGETS+= link-readline-libs # link-readline-headers: @${ECHO} "Linking readline headers into ${BUILDLINK_INCDIR}." - @${MKDIR} -p ${BUILDLINK_INCDIR}/readline + @${MKDIR} ${BUILDLINK_INCDIR}/readline @${RM} -f ${BUILDLINK_INCDIR}/readline/* .if defined(READLINE_INCDIR) @for inc in ${READLINE_INCDIR}/*; do \ - ${LN} -sf $${inc} ${BUILDLINK_INCDIR}/readline; \ + dest=${BUILDLINK_INCDIR}/readline/`${BASENAME} $${inc}`; \ + if [ -f $${inc} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${inc} $${dest}; \ + fi; \ done .else - @${LN} -sf ${READLINE_H} ${BUILDLINK_INCDIR}/readline - @${LN} -sf ${HISTORY_H} ${BUILDLINK_INCDIR}/readline + @for inc in ${READLINE_H} ${HISTORY_H}; do \ + dest=${BUILDLINK_INCDIR}/readline/`${BASENAME} $${inc}`; \ + if [ -f $${inc} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${inc} $${dest}; \ + fi; \ + done .endif # This target links the readline and history libraries into @@ -84,12 +95,20 @@ link-readline-headers: # link-readline-libs: @${ECHO} "Linking readline libraries into ${BUILDLINK_LIBDIR}." - @${MKDIR} -p ${BUILDLINK_LIBDIR} + @${MKDIR} ${BUILDLINK_LIBDIR} @for lib in ${LIBREADLINE}; do \ - dest=`${BASENAME} $${lib} | ${SED} "s|libedit|libreadline|"`; \ - ${LN} -sf $${lib} ${BUILDLINK_LIBDIR}/$${dest}; \ + name=`${BASENAME} $${lib} | ${SED} "s|libedit|libreadline|"`; \ + dest=${BUILDLINK_LIBDIR}/$${name}; \ + if [ -f $${lib} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${lib} $${dest}; \ + fi; \ done @for lib in ${LIBHISTORY}; do \ - dest=`${BASENAME} $${lib} | ${SED} "s|libedit|libhistory|"`; \ - ${LN} -sf $${lib} ${BUILDLINK_LIBDIR}/$${dest}; \ + name=`${BASENAME} $${lib} | ${SED} "s|libedit|libhistory|"`; \ + dest=${BUILDLINK_LIBDIR}/$${name}; \ + if [ -f $${lib} ]; then \ + ${RM} -f $${dest}; \ + ${LN} -sf $${lib} $${dest}; \ + fi; \ done |