tbonelaforge/jinac — pull request #3 by andrewaustin (2014-10-06 15:38:53+00:00)
Title: Fix issue with node-gyp linking to wrong c++ std lib on OS X >= 10.9

By default node-gyp links against libstdc++ instead of libc++. OS X >= 10.9 builds against libc++ by default. This causes CLN and jinacs not not be linked against the same standard C++ library and things explode.

The upstream issue is discussed here: https://github.com/TooTallNate/node-gyp/issues/469

The attached patch will correctly select the right C++ standard library (taken from the above github issue):

Before patch (OS X 10.9.5):

```
otool -L build/Release/rationalnumber.node
build/Release/rationalnumber.node:
/usr/local/lib/libcln.6.dylib (compatibility version 7.0.0, current version 7.3.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 60.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 2577.0.0)
```

After patch (OS X 10.9.5):

```
otool -L build/Release/rationalnumber.node
build/Release/rationalnumber.node:
/usr/local/lib/libcln.6.dylib (compatibility version 7.0.0, current version 7.3.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
```