naturalatlas/node-gdal — pull request #2 by springmeyer (2014-05-15 03:09:42+00:00)
Title: add --runtime_link option

This adds a `runtime_link` variable to `binding.gyp`. This makes it possible to do `npm install gdal --runtime_link=static` which triggers not only `-lgdal` to be linked but also all libs that libgdal depends upon.

This is obscure but needed on my end because I usually use a `libgdal.a` with all dependent libraries statically linked. In this case without also linking the libs gdal depends you'll see this type of error on startup:

```
$ node examples/rasterinfo.js

module.js:356
Module._extensions[extension](this, filename);
^
Error: dlopen(/Users/dane/projects/node-gdal/build/Release/gdal.node, 1): Symbol not found: _jpeg_resync_to_restart
Referenced from: /Users/dane/projects/node-gdal/build/Release/gdal.node
Expected in: flat namespace
in /Users/dane/projects/node-gdal/build/Release/gdal.node
```

This is the same approach taken in `node-srs`: https://github.com/mapbox/node-srs/blob/fad86bd06f1bcd49492a057de71b28d5c9042c98/binding.gyp#L4