skalibs

Mirror/fork of https://skarnet.org/software/skalibs/
git clone https://ccx.te2000.cz/git/skalibs
Log | Files | Refs | README | LICENSE

flags.html (8483B)


      1 <html>
      2   <head>
      3     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
      4     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      5     <meta http-equiv="Content-Language" content="en" />
      6     <title>skalibs: configuration flags</title>
      7     <meta name="Description" content="skalibs: configuration flags" />
      8     <meta name="Keywords" content="skalibs build compilation configuration flags options" />
      9     <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
     10   </head>
     11 <body>
     12 
     13 <p>
     14 <a href="index.html">skalibs</a><br />
     15 <a href="//skarnet.org/software/">Software</a><br />
     16 <a href="//skarnet.org/">skarnet.org</a>
     17 </p>
     18 
     19 <h1> skalibs configuration flags </h1>
     20 
     21 <p>
     22  The skalibs <tt>./configure</tt> script comes with a few
     23 uncommon options; this page explains what they are for.
     24 </p>
     25 
     26 <a name="slashpackage"><h3> --enable-slashpackage[=<em>sproot</em>] </h3></a>
     27 
     28 <p>
     29  This flag tells configure that you want to install skalibs according to
     30 the <a href="https://cr.yp.to/slashpackage.html">slashpackage convention</a>.
     31 If you enable it, and $v is the version of skalibs you're compiling,
     32 <tt>make install</tt> will install the skalibs header files in
     33 <tt>/package/prog/skalibs-$v/include</tt>, the static libraries in
     34 <tt>/package/prog/skalibs-$v/library</tt>, the dynamic libraries in
     35 <tt>/package/prog/skalibs-$v/library.so</tt> and the data files in
     36 <tt>/package/prog/skalibs-$v/etc</tt>, all prefixed by <em>sproot</em>
     37 if present.
     38 </p>
     39 
     40 <p>
     41   It will also prepend the default path with <tt>/command</tt>, unless an
     42 explicit default path has been given via the
     43 <a href="#defaultpath"><tt>--with-default-path</tt></a> option.
     44 </p>
     45 
     46 <p>
     47  Additionally, it will add two more "make" targets:
     48 </p>
     49 
     50 <ul>
     51  <li> <tt>make update</tt> will update the <tt>/package/prog/skalibs</tt>
     52 symbolic link to point to <tt>skalibs-$v</tt> </li>
     53  <li> <tt>make -L global-links </tt> will make links from <tt>/library.so</tt>
     54 to the installed skalibs shared libraries. </li>
     55 </ul>
     56 
     57 <p>
     58  If this option is not given, no slashpackage support will be provided.
     59 </p>
     60 
     61 <a name="clockistai"><h3> --enable-tai-clock </h3></a>
     62 
     63 <p>
     64  To understand what this flag is about - and the next two flags too - you
     65 should start by reading
     66 <a href="http://www.madore.org/~david/computers/unix-leap-seconds.html">this
     67 page about Unix time</a>,
     68 which <a href="http://www.madore.org/~david/">David Madore</a> wrote after
     69 a long and fairly complete discussion we had on the subject. You can also
     70 read <a href="https://cr.yp.to/proto/utctai.html">what DJB says about Unix time</a>.
     71 Unfortunately, when he says "the POSIX rules are so outrageously dumb (...)
     72 that no self-respecting engineer would obey them", DJB is wrong: a lot of
     73 people follow the POSIX rules. Or maybe he's right... and there are very,
     74 very few self-respecting engineers.
     75 </p>
     76 
     77 <p>
     78  Basically, when you configure a Unix system, there are essentially two
     79 ways to deal with your system clock.
     80 </p>
     81 
     82 <ol>
     83  <li> You can set your system clock to TAI-10, which is the "right", but
     84 uncommon, thing to do:
     85   <ul>
     86    <li> &uarr; The main advantage of this setup is that it makes your system clock
     87 <em>linear</em>. In other words,
     88 <a href="https://pubs.opengroup.org/onlinepubs/9699919799/functions/gettimeofday.html">gettimeofday()</a>
     89 becomes suitable for both timestamping (which needs absolute time) and timeout
     90 computations (which need reliable interval measurements); if your clock is
     91 accurate enough, it can function as both a wall clock and a stopwatch.
     92 This simplifies keeping track of the current time <strong>considerably</strong>,
     93 and makes event loop handling (with functions such as
     94 <a href="libstddjb/iopause.html">iopause()</a>) trivial. </li>
     95    <li> &uarr; skalibs uses TAI internally; setting your system clock to TAI-10
     96 saves a lot of conversions and makes time computations with skalibs more
     97 efficient. </li>
     98    <li> &rarr; skalibs-aware software will display GMT or local time properly in
     99 every case, but you have to
    100 use the <tt>right/</tt> timezones, from Arthur David Olson's timezone
    101 library, to prevent your other software from being confused by a TAI-10 system clock.
    102 If you do not use <tt>right/</tt> timezones, utilities such as <tt>date</tt>
    103 will not compute the proper time - they will have an offset of 24 seconds
    104 or so. </li>
    105    <li> &darr; This setup is arguably not SUSv4 conformant (a strict
    106 interpretation of Single Unix requires the system clock to be set to UTC). </li>
    107    <li> &darr; This setup is <em>not</em> compatible with
    108 <a href="https://en.wikipedia.org/wiki/Ntpd">ntpd</a>. <tt>ntpd</tt>'s design
    109 is flawed: it makes the mistake of setting the system clock itself - instead
    110 of simply making the computed time available to other programs, one of which
    111 could set the system clock - and it always sets it to UTC. (The
    112 <a href="//skarnet.org/software/s6-networking/">s6-networking</a>
    113 package provides alternate ways to synchronize your clock, though.) </li>
    114   </ul>
    115  </li>
    116  <li> You can set your system clock to UTC, which is the common, strictly
    117 POSIX setup:
    118   <ul>
    119    <li> &uarr; This is strictly SUSv4-compliant. Most Unix machines all over
    120 the world are set up like this. </li>
    121    <li> &uarr; This is compatible with ntpd. </li>
    122    <li> &rarr; You should use <tt>posix/</tt> time zones in that case,
    123 not <tt>right/</tt> time zones. </li>
    124    <li> &darr; skalibs time computations will take a bit more processing power. </li>
    125    <li> &darr; Most importantly, you forsake all linearity - and even monotonicity
    126 - on your system clock, which can now only be used as a wall clock,
    127 <em>not</em> as a stopwatch. skalibs will try its best to do accurate time
    128 computations, but there's no way <tt>gettimeofday()</tt> can be relied on
    129 when a leap second is nearby; you have to use CLOCK_MONOTONIC as a stopwatch
    130 for accurate interval measurement. </li>
    131   </ul>
    132  </li>
    133 </ol>
    134 
    135 <p>
    136  Use <tt>--enable-tai-clock</tt> if your system clock is set to TAI-10.
    137 I generally recommend this setup
    138 for computers you have full control on, on which you install and tweak
    139 the software your way, like manually administered servers or embedded
    140 boxes. If you do not run ntpd and do not mind breaking POSIX, it is the
    141 sensible choice.
    142 </p>
    143 
    144 <p>
    145  Do not use this option if your system clock is set to UTC, i.e. if
    146 you're in none of the above cases: you are a
    147 POSIX freak, or your Unix distribution is running ntpd for you, or
    148 other software is assuming you're on UTC. This is the default.
    149 </p>
    150 
    151 <a name="noipv6"><h3> --disable-ipv6 </h3></a>
    152 
    153 <p>
    154  If you set this option, then skalibs will be compiled without IPv6 support,
    155 even if your target architecture supports it. This can significantly
    156 reduce the size of your networking applications if they don't need IPv6
    157 support.
    158 </p>
    159 
    160 <p>
    161  If you don't set this option, then skalibs will include IPv6 support in the
    162 relevant networking functions if and only if the target architecture supports it.
    163 This is the default, and it is safe.
    164 </p>
    165 
    166 <a name="defaultpath"><h3> --with-default-path=<em>path</em> </h3></a>
    167 
    168 <p>
    169  The <a href="libstddjb/djbunix.html">execvep()</a> function uses
    170 the value of the PATH environment variable as its executable search path.
    171 Specifying this option to configure tells execvep() what executable
    172 search path to use when PATH is undefined (which should not happen
    173 often anyway).
    174  The default is <tt>/usr/bin:/bin</tt>, which is usually safe.
    175 </p>
    176 
    177 <a name="sysdep"><h3> --with-sysdep-devurandom=yes </h3></a>
    178 
    179 <p>
    180  When compiling natively, skalibs probes the build system for <em>sysdeps</em>,
    181 i.e. system-specific behaviours that influence the way skalibs must
    182 implement certain interfaces. This autodetection can be overriden on the
    183 configure command line: for a sysdep named <em>K</em>, if you want to
    184 enforce the value <em>V</em>, you can use <tt>--with-sysdep-<em>K</em>=<em>V</em></tt>
    185 as a configure option.
    186 </p>
    187 
    188 <p>
    189 (This is similar to the <tt>ac_cv_foobar_<em>K</em>=<em>V</em></tt> environment
    190 variable mechanism in autotools.)
    191 </p>
    192 
    193 <p>
    194  When <a href="crosscompile.html">cross-compiling</a>, there are a few sysdeps
    195 that <em>cannot</em> be autodetected and have to be provided manually on the
    196 command line. The <tt>devurandom</tt> sysdep, which encodes the existence of
    197 a functional <tt>/dev/urandom</tt> device on the target, is one of those.
    198 <tt>--with-sysdep-devurandom=yes</tt> tells skalibs to assume that there is
    199 such a device it can rely on for random number generation.
    200 </p>
    201 
    202 </body>
    203 </html>