Created
January 10, 2014 16:15
-
-
Save johncant/8357226 to your computer and use it in GitHub Desktop.
Use GNU autotools to call node-gyp to build a native node module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If | |
# (1) Your project is built using the GNU autotools. | |
# (2) Your project depends on a native node.js module which it ships with | |
# (3) You find autotools hard | |
# | |
# Then you might find this gist useful for building your node module alongside your main project during ./configure and make | |
# | |
# Simpler than it sounds. :) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check for node and node-gyp | |
AC_CHECK_PROG(HAVE_NODE, [node], [node]) | |
AC_CHECK_PROG(HAVE_NODE_GYP, [node-gyp], [node-gyp]) | |
test -z "$HAVE_NODE" && AC_MSG_ERROR([Could not find node.js. Please make sure you have it installed]) | |
test -z "$HAVE_NODE_GYP" && AC_MSG_ERROR([Could not find node_gyp. Please make sure you have it installed]) | |
# Run node-gyp configure during ./configure | |
(cd $(NODE_MODULE_DIR) && node-gyp configure) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bin_PROGRAMS = some_node_module | |
some_node_module$(EXEEXT): | |
-cd $(NODE_MODULE_DIR) && node-gyp build | |
clean-local: | |
-cd $(NODE_MODULE_DIR) && node-gyp clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment