View | Details | Raw Unified | Return to bug 106065
Collapse All | Expand All

(-)en_US.ISO8859-1/books/porters-handbook/book.sgml (+72 lines)
Lines 8784-8789 Link Here
8784
	  them.</para>
8784
	  them.</para>
8785
      </sect1>
8785
      </sect1>
8786
8786
8787
      <sect1 id="porting-configure">
8788
	<title>Configure script and feature auto-activation</title>
8789
8790
      <sect2 id="configure-control">
8791
	<title>Control your port</title>
8792
8793
	<para>When using a configure script, keep control on what feature is activated 
8794
      or not. Avoid using auto-detection of libraries that would silently activate
8795
      something you wouldn't be aware of. Say, explicitly disable options when you
8796
      do not want them activated (do not just activate them when you want them).</para>
8797
      </sect2>
8798
      
8799
      <sect2 id="configure-example">
8800
	<title>Example</title>
8801
8802
      <para>Silently-activated features can bring you in trouble, let's give an example :</para>
8803
8804
      <itemizedlist>
8805
        <listitem>
8806
          <para>I have libxxx installed on my system (not used by any program)</para>
8807
        </listitem>
8808
8809
        <listitem>
8810
          <para>I don't want the application yyy to be built with xxx support so I disable the xxx option in the port's 'make config' or by defining the WITHOUT_XXX option</para>
8811
        </listitem>
8812
8813
        <listitem>
8814
          <para>Unfortunately, the port manages the option by *only* adding a --with-xxx (or --enable-xxx) option to <makevar>CONFIGURE_ARGS</makevar> when <makevar>WITH_XXX</makevar> is defined (so nothing happens here)</para>
8815
        </listitem>
8816
8817
        <listitem>
8818
          <para>The configure script is run and detects the library. It silently activates the option since our machine *can* run the xxx option</para>
8819
        </listitem>
8820
8821
        <listitem>
8822
          <para>The application is built with the xxx option</para>
8823
        </listitem>
8824
      </itemizedlist>
8825
8826
      </sect2>
8827
8828
      <sect2 id="configure-bad">
8829
	<title>The bad things</title>
8830
8831
      <para>Why is it so bad ?</para>
8832
     
8833
      <itemizedlist>
8834
        <listitem>
8835
          <para>I have a feature I didn't want (that I have explicitly disabled)</para>
8836
        </listitem>
8837
8838
        <listitem>
8839
          <para>I can uninstall libxxx and break my application yyy, since no dependency is recorded in the database</para>
8840
        </listitem>
8841
      </itemizedlist>
8842
8843
      </sect2>
8844
8845
      <sect2 id="configure-solution">
8846
	<title>A solution</title>
8847
8848
      <para>So, what can I do ?</para>
8849
8850
      <para>When possible, add (force) the corresponding --disable- or --without- option
8851
      for *each* --enable- or --with one you are using in the port's Makefile (if 
8852
      supported by the configure script). This will ensure that each dependency is
8853
      recorded and that the port installs *exactly* the features users want.</para>
8854
8855
      </sect2>
8856
8857
      </sect1>
8858
8787
      <sect1 id="porting-wrkdir">
8859
      <sect1 id="porting-wrkdir">
8788
	<title><makevar>WRKDIR</makevar></title>
8860
	<title><makevar>WRKDIR</makevar></title>

Return to bug 106065