summaryrefslogtreecommitdiffstats
path: root/web/input/doc/faq/gnulib.md
blob: 964940c2979f4f51521dcb4deac6b8adf4585787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
title: Gnulib
parent: FAQ
---

# How do I use and update Gnulib?

[Gnulib][gnulib] provides replacement implementations of functions that are
not available on all (Unix-like) operating systems.  In order to sync with the
latest Gnulib code, do something like:

    $ git clone git://git.savannah.gnu.org/gnulib.git
    $ cd gnulib
    $ GNULIB_HEAD=$(git rev-parse --short HEAD)
    $ cd ..
    $ git clone git@github.com:monitoring-plugins/monitoring-plugins.git
    $ cd monitoring-plugins
    $ ../gnulib/gnulib-tool --update
    $ find gl -name '*~' -o -name '.gitignore' | xargs rm
    $ git status
    $ git add gl
    $ git commit -m "Sync with latest Gnulib code ($GNULIB_HEAD)"

In order to make a given function available via Gnulib (on systems which don't
provide that function), the [corresponding module][modules] must be imported
using `gnulib-tool`, e.g. (in order to add the `strcase` module):

    $ ../gnulib/gnulib-tool --no-vc-files --import strcase
    $ find gl -name '*~' | xargs rm
    $ git status
    $ git add gl
    $ git commit -m 'Add Gnulib module "strcase"'

[gnulib]: http://www.gnu.org/software/gnulib/ "Gnulib"
[modules]: http://www.gnu.org/software/gnulib/MODULES.html "Gnulib Modules"

<!--% # vim:set filetype=markdown textwidth=78 joinspaces: # %-->