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

(-)book.sgml (-37 / +156 lines)
Lines 3029-3035 Link Here
3029
	<title><makevar>USE_<replaceable>*</replaceable></makevar></title>
3029
	<title><makevar>USE_<replaceable>*</replaceable></makevar></title>
3030
3030
3031
	<para>A number of variables exist in order to encapsulate common
3031
	<para>A number of variables exist in order to encapsulate common
3032
	  dependencies that many ports have.</para>
3032
	  dependencies that many ports have.  Although their use is
3033
	  optional, they can help to reduce the verbosity of the port
3034
	  <filename>Makefile</filename>s.  Each of them is styled
3035
	  as <makevar>USE_<replaceable>*</replaceable></makevar>.  The
3036
	  usage of these variables is restricted to the port
3037
	  <filename>Makefile</filename>s and
3038
	  <filename>ports/Mk/bsd.*.mk</filename> and is not designed
3039
	  to encapsulate user-settable options &mdash; use
3040
	  <makevar>WITH_<replaceable>*</replaceable></makevar> and
3041
	  <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
3042
	  for that purpose.</para>
3043
3044
	<note>
3045
	  <para>It is <emphasis>always</emphasis> incorrect to set
3046
	    any <makevar>USE_<replaceable>*</replaceable></makevar>
3047
	    in <filename>/etc/make.conf</filename>.  For instance,
3048
	    setting <programlisting>USE_GCC=3.2</programlisting>
3049
	    would adds a dependency on gcc32 for every port,
3050
	    including gcc32 itself!</para>
3051
	</note>
3033
3052
3034
	<table frame="none">
3053
	<table frame="none">
3035
	  <title>The <makevar>USE_<replaceable>*</replaceable></makevar>
3054
	  <title>The <makevar>USE_<replaceable>*</replaceable></makevar>
Lines 3198-3239 Link Here
3198
	    intention will be clear.</para>
3217
	    intention will be clear.</para>
3199
	</sect2>
3218
	</sect2>
3200
3219
3201
     <sect2>
3202
      <title>Optional dependencies</title>
3203
3204
      <para>Some large applications can be built in a number of
3205
	configurations, adding functionality if one of a number of
3206
	libraries or applications is available. Since not all users
3207
	want those libraries or applications, the ports system
3208
	provides hooks that the port author can use to decide which
3209
	configuration should be built. Supporting these properly will
3210
	make users happy, and effectively provide 2 or more ports for the
3211
	price of one.</para>
3212
3213
      <para>The easiest of these to use is
3214
	<makevar>WITHOUT_X11</makevar>. If the port can be built both
3215
	with and without X support, then it should normally be built
3216
	with X support. If <makevar>WITHOUT_X11</makevar> is defined,
3217
	then the version that does not have X support should be
3218
	built.</para>
3219
3220
      <para>Various parts of GNOME have such knobs, though they are
3221
	slightly more difficult to use. The variables to use in the
3222
	<filename>Makefile</filename> are <makevar>WANT_*</makevar>
3223
	and <makevar>HAVE_*</makevar>. If the application can be
3224
	built both with or without one of the dependencies listed
3225
	below, then the <filename>Makefile</filename> should set
3226
	<makevar>WANT_PKG</makevar>, and should build the version that
3227
	uses <makevar>PKG</makevar> if <makevar>HAVE_PKG</makevar>
3228
	is defined.</para>
3229
3230
      <para>The <makevar>WANT_*</makevar> variables currently
3231
	supported this way are <makevar>WANT_GLIB</makevar>,
3232
	<makevar>WANT_GTK</makevar>, <makevar>WANT_ESOUND</makevar>,
3233
	<makevar>WANT_IMLIB</makevar>, and
3234
	<makevar>WANT_GNOME</makevar>.</para>
3235
      </sect2>
3236
3237
      <sect2>
3220
      <sect2>
3238
	<title>Circular dependencies are fatal</title>
3221
	<title>Circular dependencies are fatal</title>
3239
3222
Lines 3252-3257 Link Here
3252
	  can be quite slow on older machines, but you may be able to
3235
	  can be quite slow on older machines, but you may be able to
3253
	  save a large number of people&mdash;including yourself&mdash;
3236
	  save a large number of people&mdash;including yourself&mdash;
3254
	  a lot of grief in the process.</para>
3237
	  a lot of grief in the process.</para>
3238
      </sect2>
3239
3240
      </sect1>
3241
3242
      <sect1 id="makefile-options">
3243
      <title>Makefile Options</title>
3244
3245
      <para>Some large applications can be built in a number of
3246
	configurations, adding functionality if one of a number of
3247
	libraries or applications is available.  Examples include
3248
	choice of natural (human) language, GUI versus command-line,
3249
	or type of database to support.  Since not all users
3250
	want those libraries or applications, the ports system
3251
	provides hooks that the port author can use to control which
3252
	configuration should be built. Supporting these properly will
3253
	make users happy, and effectively provide 2 or more ports for the
3254
	price of one.</para>
3255
3256
        <sect2>
3257
	  <title><makevar>WITH_<replaceable>*</replaceable></makevar> and
3258
	    <makevar>WITHOUT_<replaceable>*</replaceable></makevar></title>
3259
3260
	  <para>These variables are designed to be set by the system
3261
	    administrator.  There are many that are standardized in
3262
	    <filename>ports/Mk/bsd.*.mk</filename>; others are not,
3263
	    which can be confusing.  If you need to add such a
3264
	    configuration variable, please consider using one of the
3265
	    ones from the following list.</para>
3266
3267
	  <note>
3268
	    <para>You should not assume that a
3269
	      <makevar>WITH_<replaceable>*</replaceable></makevar>
3270
	      necessarily has a corresponding
3271
	      <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
3272
	      variable and vice versa.  In general, the default is
3273
	      simply assumed.</para>
3274
	  </note>
3275
3276
	  <note>
3277
	    <para>Unless otherwise specified, these variables are only
3278
	      tested for being set or not set, rather than being set to
3279
	      some kind of variable such as <literal>YES</literal> or
3280
	      <literal>NO</literal>.</para>
3281
	  </note>
3282
3283
	  <table frame="none">
3284
	    <title>The <makevar>WITH_<replaceable>*</replaceable></makevar>
3285
	      and <makevar>WITHOUT_<replaceable>*</replaceable></makevar>
3286
	      variables</title>
3287
3288
	    <tgroup cols="2">
3289
	      <thead>
3290
	        <row>
3291
		  <entry>Variable</entry>
3292
3293
		  <entry>Means</entry>
3294
	        </row>
3295
	      </thead>
3296
3297
	      <tbody>
3298
	        <row>
3299
		  <entry><makevar>WITH_APACHE2</makevar></entry>
3300
3301
		  <entry>If set, use
3302
		    <filename role="package">www/apache2</filename>
3303
		    instead of the default of
3304
		    <filename role="package">www/apache</filename>.</entry>
3305
	        </row>
3306
3307
	        <row>
3308
		  <entry><makevar>WITH_BERKELEY_DB</makevar></entry>
3309
3310
		  <entry>Define this variable to specify the ability to
3311
		    use a variant of the Berkeley database package such as
3312
		    <filename role="package">databases/db41</filename>.
3313
		    An associated variable, 
3314
		    <entry><makevar>WITH_BDB_VER</makevar>, may be
3315
		    set to values such as 2, 3, 4, 41 or 42.</entry>
3316
	        </row>
3317
3318
	        <row>
3319
		  <entry><makevar>WITHOUT_GETTEXT</makevar></entry>
3320
3321
		  <entry>If set, says that internationalization is not
3322
		    needed, which can save compile time.  By default,
3323
		    internalization is used.</entry>
3324
	        </row>
3325
3326
	        <row>
3327
		  <entry><makevar>WITH_MYSQL</makevar></entry>
3328
3329
		  <entry>Define this variable to specify the ability to
3330
		    use a variant of the MySQL database package such as
3331
		    <filename role="package">databases/mysql40-server</filename>.
3332
		    An associated variable, 
3333
		    <entry><makevar>WANT_MYSQL_VER</makevar>, may be
3334
		    set to values such as 323, 40, 41, or 50.</entry>
3335
	        </row>
3336
3337
	        <row>
3338
		  <entry><makevar>WITH_OPENSSL_BASE</makevar></entry>
3339
3340
		  <entry>Use the version of OpenSSL in the base system.</entry>
3341
	        </row>
3342
3343
	        <row>
3344
		  <entry><makevar>WITH_OPENSSL_PORT</makevar></entry>
3345
3346
		  <entry>Use the version of OpenSSL from
3347
		    <filename role="package">security/openssh</filename>,
3348
		    overwriting the version that was originally installed
3349
		    in the base system.</entry>
3350
	        </row>
3351
3352
	        <row>
3353
		  <entry><makevar>WITH_POSTGRESQL</makevar></entry>
3354
3355
		  <entry>Define this variable to specify the ability to
3356
		    use a variant of the PostGreSQL database package such as
3357
		    <filename role="package">databases/postgresql72</filename>.
3358
		    </entry>
3359
	        </row>
3360
3361
	        <row>
3362
		  <entry><makevar>WITHOUT_X11</makevar></entry>
3363
3364
		  <entry>If the port can be built both with and without
3365
		    X support, then it should normally be built with
3366
		    with X support. If this variable is defined, then
3367
		    then the version that does not have X support should
3368
		    be built instead.</entry>
3369
	        </row>
3370
	      </tbody>
3371
	    </tgroup>
3372
	  </table>
3373
3255
      </sect2>
3374
      </sect2>
3256
    </sect1>
3375
    </sect1>

Return to bug 67707