libk  Diff

Differences From Artifact [e3ee508d22]:

To Artifact [bca498cfb3]:


     1      1   #!/usr/bin/env bash
     2      2   source global/common.sh
     3      3   
     4      4   # TODO: provide "modular" install option to avoid the traditional
     5      5   # linux directory hierarchy on systems where this doesn't make sense.
     6      6   
     7         -check "prefix" "a directory to install to"
            7  +check prefix 'a directory to install to'
     8      8   build="${build:-out}"
     9      9   
    10     10   bindir="${bindir:-$prefix/bin}"
    11     11   libdir="${libdir:-$prefix/lib}"
    12         -
    13         -if test "$prefix" = "/" -o "$fakeroot" = yes; then
    14         -	say "installing docs and headers into usr instad of /"
    15         -	sharedir="${sharedir:-$prefix/usr/share}"
    16         -	incdir="${incdir:-$prefix/usr/include}"
    17         -else
    18         -	incdir="${incdir:-$prefix/include}"
    19         -	sharedir="${sharedir:-$prefix/share}"
    20         -fi
           12  +incdir="${incdir:-$prefix/include}"
           13  +sharedir="${sharedir:-$prefix/share}"
    21     14   
    22     15   say "commencing install"
    23     16   say " - prefix: $prefix"
    24     17   say " - destinations:"
    25         -say "   * binaries: $bindir"
    26         -say "   * libraries: $libdir"
    27         -say "   * headers: $incdir"
    28         -say "   * shared files: $sharedir"
           18  +say "   - binaries → $bindir"
           19  +say "   - libraries → $libdir"
           20  +say "   - headers → $incdir"
           21  +say "   - shared files → $sharedir"
    29     22   
    30     23   mkdir -p "$bindir" "$libdir" "$incdir" "$sharedir"
    31     24   
    32     25   # Libraries
    33     26   # These may or may not exist, depending on what library build is done, so check
    34     27   say "installing libraries"
    35     28   test -e "$build/libk.a"  && install -Dm644 -t "$libdir" "$build/libk.a"