title: How do I compile the time.c on Alpine?
body: <p>I don't like the built-in <code>time</code> utility in Alpine Linux and would like to improve it for my needs -- I want to edit the <code>time.c</code> and compile it to a binary. I have done the <code>apk add build-base</code> to install the gcc and have copypasted the <code>time.c</code> from Github, but when I do the <code>gcc /tmp/time.c -o /tmp/time</code> I get the:</p>
  
  <pre><code>/tmp/time.c:34:10: fatal error: libbb.h: No such file or directory
   #include "libbb.h"
            ^~~~~~~~~
  </code></pre>
  
  <p>So I copypasted it too but it relies on dozens more header files. I saw somewhere that I might need the <code>apk add alpine-sdk</code> and maybe it would also garantee version compatibility so I did it but gcc still does not see header files. Should I provide some <code>-I</code> flag?<br>
  What do I really have to do to finally compile my custom <code>time.c</code>?</p>
  
  <p>P.S.: there is probably a SO tag for <code>time</code> but I can't find it.</p>
  
  <p>UPD: I've copied the whole <code>include</code> folder but it says:</p>
  
  <pre><code>In file included from /tmp/time.c:34:
  include/libbb.h:406:42: error: 'ENABLE_FEATURE_VERBOSE' undeclared here (not in a function)
    FILEUTILS_VERBOSE         = (1 &lt;&lt; 12) * ENABLE_FEATURE_VERBOSE, /* -v */
                                            ^~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>but I can't find where it's defined even in the whole <a href="https://github.com/mirror/busybox" rel="nofollow noreferrer">https://github.com/mirror/busybox</a></p>
  
  <p>UPD: oh no, it's more complex.</p>
  
  <pre><code>/ # ls -l `which time`
  lrwxrwxrwx    1 root     root            12 Jan 30  2019 /usr/bin/time -&gt; /bin/busybox
  </code></pre>
  
  <p>Seems like there is no such thing as <code>time</code> binary.</p>