refactor binding.gyp.

This commit is contained in:
Christopher Jeffrey 2014-09-12 14:29:59 -07:00
parent e2acef83c5
commit 3aeed05215

View File

@ -4,19 +4,30 @@
'include_dirs' : [ 'include_dirs' : [
# standard include: # standard include:
# '/usr/include', # '/usr/include',
'<!(node -e "require(\'nan\')")',
# boost:
# '/usr/include/boost', # '/usr/include/boost',
# leveldb:
'<!(test -n "$BITCOIN_DIR" && echo "$BITCOIN_DIR" || echo "${HOME}/bitcoin")/src/leveldb/include', '<!(test -n "$BITCOIN_DIR" && echo "$BITCOIN_DIR" || echo "${HOME}/bitcoin")/src/leveldb/include',
# bitcoind:
'<!(test -n "$BITCOIN_DIR" && echo "$BITCOIN_DIR" || echo "${HOME}/bitcoin")/src', '<!(test -n "$BITCOIN_DIR" && echo "$BITCOIN_DIR" || echo "${HOME}/bitcoin")/src',
# nan:
'<!(node -e "require(\'nan\')")',
], ],
'sources': [ 'sources': [
'./src/bitcoindjs.cc', './src/bitcoindjs.cc',
], ],
'defines': [ 'defines': [
# boost sleep:
'<!(test $(grep "#define BOOST_VERSION " /usr/include/boost/version.hpp'\ '<!(test $(grep "#define BOOST_VERSION " /usr/include/boost/version.hpp'\
' | awk "{ print \$3 }") -gt 105200'\ ' | awk "{ print \$3 }") -gt 105200'\
' && echo HAVE_WORKING_BOOST_SLEEP_FOR'\ ' && echo HAVE_WORKING_BOOST_SLEEP_FOR'\
' || echo HAVE_WORKING_BOOST_SLEEP)', ' || echo HAVE_WORKING_BOOST_SLEEP)',
# wallet:
# Assume libbitcoind.so is always # Assume libbitcoind.so is always
# compiled with wallet support. # compiled with wallet support.
'ENABLE_WALLET', 'ENABLE_WALLET',
@ -29,12 +40,14 @@
# standard libs: # standard libs:
# '-L/usr/lib', # '-L/usr/lib',
# '-L/usr/local/lib', # '-L/usr/local/lib',
# boost: # boost:
'-lboost_system', '-lboost_system',
'-lboost_filesystem', '-lboost_filesystem',
'-lboost_program_options', '-lboost_program_options',
'-lboost_thread', '-lboost_thread',
'-lboost_chrono', '-lboost_chrono',
# bitcoind: # bitcoind:
'<!(test -n "$BITCOIN_DIR" && echo "$BITCOIN_DIR" || echo "${HOME}/bitcoin")/src/libbitcoind.so', '<!(test -n "$BITCOIN_DIR" && echo "$BITCOIN_DIR" || echo "${HOME}/bitcoin")/src/libbitcoind.so',
] ]