Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Jun 2017 15:04:58 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org
Subject:   svn commit: r50347 - head/en_US.ISO8859-1/books/porters-handbook/makefiles
Message-ID:  <201706091504.v59F4wmP031917@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Fri Jun  9 15:04:57 2017
New Revision: 50347
URL: https://svnweb.freebsd.org/changeset/doc/50347

Log:
  Add a section about the opt_MESON_* helpers.
  
  Sponsored by:	Absolight

Modified:
  head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml

Modified: head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Fri Jun  9 15:04:55 2017	(r50346)
+++ head/en_US.ISO8859-1/books/porters-handbook/makefiles/chapter.xml	Fri Jun  9 15:04:57 2017	(r50347)
@@ -5907,6 +5907,126 @@ CMAKE_ARGS+=	-DTEST:BOOL=false -DDEBUG:BOOL=false \
 	</sect4>
       </sect3>
 
+      <sect3 xml:id="options-meson-helpers">
+	<title><varname>MESON_ARGS</varname> Helpers</title>
+
+	<sect4 xml:id="options-meson_on">
+	  <title><varname><replaceable>OPT</replaceable>_MESON_ON</varname>
+	    and
+	    <varname><replaceable>OPT</replaceable>_MESON_OFF</varname></title>
+
+	  <para>When option <replaceable>OPT</replaceable> is selected,
+	    the value of
+	    <varname><replaceable>OPT</replaceable>_MESON_ON</varname>,
+	    if defined, is appended to <varname>MESON_ARGS</varname>.
+	    <varname><replaceable>OPT</replaceable>_MESON_OFF</varname>
+	    works the same way, but when <literal>OPT</literal> is
+	    <emphasis>not</emphasis> selected.  For example:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_MESON_ON=	-Dopt=1
+OPT1_MESON_OFF=	-Dopt=2</programlisting>
+
+	  <para>is equivalent to:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+
+.include &lt;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+MESON_ARGS+=	-Dopt=1
+.else
+MESON_ARGS+=	-Dopt=2
+.endif</programlisting>
+	</sect4>
+
+	<sect4 xml:id="options-meson_true">
+	  <title><varname><replaceable>OPT</replaceable>_MESON_TRUE</varname>
+	    and
+	    <varname><replaceable>OPT</replaceable>_MESON_FALSE</varname></title>
+
+	  <para>When option <replaceable>OPT</replaceable> is selected,
+	    for each <replaceable>entry</replaceable> in
+	    <varname><replaceable>OPT</replaceable>_MESON_TRUE</varname>
+	    then
+	    <literal>-D<replaceable>entry</replaceable>=true</literal>
+	    is appended to <varname>CMAKE_ARGS</varname>.  When option
+	    <replaceable>OPT</replaceable> is <emphasis>not</emphasis>
+	    selected,
+	    <literal>-D<replaceable>entry</replaceable>=false</literal>
+	    is appended to <varname>CONFIGURE_ARGS</varname>.
+	    <varname><replaceable>OPT</replaceable>_MESON_FALSE</varname>
+	    is the oposite,
+	    <literal>-D<replaceable>entry</replaceable>=false</literal>
+	    is appended to <varname>CMAKE_ARGS</varname> when the option
+	    is selected, and
+	    <literal>-D<replaceable>entry</replaceable>=true</literal>
+	    when the option is <emphasis>not</emphasis> selected.  For
+	    example:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_MESON_TRUE=	test debug
+OPT1_MESON_FALSE=	optimize</programlisting>
+
+	  <para>is equivalent to:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+
+.include &lt;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+CMAKE_ARGS+=	-Dtest=true -Ddebug=true \
+		-Doptimize=false
+.else
+CMAKE_ARGS+=	-Dtest=false -Ddebug=false \
+		-Doptimize=true
+.endif</programlisting>
+	</sect4>
+
+	<sect4 xml:id="options-meson_yes">
+	  <title><varname><replaceable>OPT</replaceable>_MESON_YES</varname>
+	    and
+	    <varname><replaceable>OPT</replaceable>_MESON_NO</varname></title>
+
+	  <para>When option <replaceable>OPT</replaceable> is selected,
+	    for each <replaceable>entry</replaceable> in
+	    <varname><replaceable>OPT</replaceable>_MESON_YES</varname>
+	    then
+	    <literal>-D<replaceable>entry</replaceable>=yes</literal>
+	    is appended to <varname>CMAKE_ARGS</varname>.  When option
+	    <replaceable>OPT</replaceable> is <emphasis>not</emphasis>
+	    selected,
+	    <literal>-D<replaceable>entry</replaceable>=no</literal>
+	    is appended to <varname>CONFIGURE_ARGS</varname>.
+	    <varname><replaceable>OPT</replaceable>_MESON_NO</varname>
+	    is the oposite,
+	    <literal>-D<replaceable>entry</replaceable>=no</literal>
+	    is appended to <varname>CMAKE_ARGS</varname> when the option
+	    is selected, and
+	    <literal>-D<replaceable>entry</replaceable>=yes</literal>
+	    when the option is <emphasis>not</emphasis> selected.  For
+	    example:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+OPT1_MESON_YES=	test debug
+OPT1_MESON_NO=	optimize</programlisting>
+
+	  <para>is equivalent to:</para>
+
+	  <programlisting>OPTIONS_DEFINE=	OPT1
+
+.include &lt;bsd.port.options.mk&gt;
+
+.if ${PORT_OPTIONS:MOPT1}
+CMAKE_ARGS+=	-Dtest=yes -Ddebug=yes \
+		-Doptimize=no
+.else
+CMAKE_ARGS+=	-Dtest=no -Ddebug=no \
+		-Doptimize=yes
+.endif</programlisting>
+	</sect4>
+      </sect3>
+
       <sect3 xml:id="options-qmake_on">
 	<title><varname><replaceable>OPT</replaceable>_QMAKE_ON</varname>
 	  and



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201706091504.v59F4wmP031917>