diff --git a/src/node.pc.in b/src/node.pc.in new file mode 100644 index 0000000000..cdb84e83ec --- /dev/null +++ b/src/node.pc.in @@ -0,0 +1,9 @@ +prefix=@PREFIX@ +libdir=${prefix}/lib +includedir=${prefix}/include/node + +Name: node@DEBUG_EXT@ +Description: v8 powered non-browser javascript +Version: @VERSION@ +Libs: @LIBFLAGS@ -L${libdir} -lnode@DEBUG_EXT@ +Cflags: @CCFLAGS@ @CPPFLAGS@ -I${includedir} diff --git a/wscript b/wscript index 096652fc8c..3ec24501a1 100644 --- a/wscript +++ b/wscript @@ -4,6 +4,9 @@ import sys, os, shutil from os.path import join, dirname, abspath from logging import fatal +VERSION="0.1.6" +APPNAME="node.js" + import js2c srcdir = '.' @@ -14,6 +17,7 @@ def set_options(opt): # the gcc module provides a --debug-level option opt.tool_options('compiler_cxx') opt.tool_options('compiler_cc') + opt.tool_options('misc') opt.add_option( '--debug' , action='store_true' , default=False @@ -267,6 +271,29 @@ def build(bld): node.install_path = '${PREFIX}/bin' node.chmod = 0755 + + def subflags(program): + debug_ext = "" + if bld.env["USE_DEBUG"]: + debug_ext = "_g" + x = { 'CCFLAGS': " ".join(program.env["CCFLAGS"]) + , 'CPPFLAGS': " ".join(program.env["CPPFLAGS"]) + , 'LIBFLAGS': " ".join(program.env["LIBFLAGS"]) + , 'VERSION': VERSION + , 'PREFIX': program.env["PREFIX"] + , 'DEBUG_EXT': debug_ext + } + return x; + + + # process file.pc.in -> file.pc + pkgconfig = bld.new_task_gen('subst', before="cxx") + pkgconfig.source = 'src/node.pc.in' + pkgconfig.target = 'node.pc' + pkgconfig.install_path = '${PREFIX}/lib/pkgconfig' + pkgconfig.dict = subflags(node) + + if bld.env["USE_DEBUG"]: node_g = node.clone("debug") node_g.target = "node_g" @@ -274,3 +301,8 @@ def build(bld): libnode_g = libnode.clone("debug") libnode_g.target = "node_g" + pkgconfig_g = pkgconfig.clone("debug") + pkgconfig_g.dict = subflags(node_g) + pkgconfig_g.target = 'node_g.pc' + +