tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Is OS-specific logic in buildlink3.mk allowed?



Benny Siegert <bsiegert%gmail.com@localhost> writes:

> I am looking at devel/libtirpc, which is marked
> ONLY_FOR_PLATFORM=Linux-*-*. This is because BSD systems include the
> tirpc code as part of base.

So probably NOT_FOR those would be better, but that's off point.

> Thus, any dependency on this library is probably of the form
>
> +.if ${OPSYS} == "Linux"
> +.include "../../devel/libtirpc/buildlink3.mk"
> +.endif
>
> So I was thinking of simplifying this by doing the following patch:
>
> --- a/devel/libtirpc/buildlink3.mk
> +++ b/devel/libtirpc/buildlink3.mk
> @@ -2,6 +2,8 @@
>
>  BUILDLINK_TREE+=               libtirpc
>
> +.if ${OSTYPE} == "Linux"
> +
>  .if !defined(LIBTIRPC_BUILDLINK3_MK)
>  LIBTIRPC_BUILDLINK3_MK:=
>
> @@ -15,4 +17,6 @@ BUILDLINK_LIBS.libtirpc=
> ${BUILDLINK_LIBNAME.libtirpc:S/^/-l/:S/^-l$//}
>
>  .endif # LIBTIRPC_BUILDLINK3_MK
>
> +.endif # Linux
> +
>  BUILDLINK_TREE+=       -libtirpc
>
> Is that allowed? :)

We have stuff in mk/foo.mk that does things like this.

But, our usual idiom is a builtin.mk that skips if the base OS provides
the package.    Would that work?


Home | Main Index | Thread Index | Old Index