Browse Source

Add pkgconfig files to help with dll builds.

v0.7.4-release
Ryan 16 years ago
parent
commit
4d92199d18
  1. 9
      src/node.pc.in
  2. 32
      wscript

9
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}

32
wscript

@ -4,6 +4,9 @@ import sys, os, shutil
from os.path import join, dirname, abspath from os.path import join, dirname, abspath
from logging import fatal from logging import fatal
VERSION="0.1.6"
APPNAME="node.js"
import js2c import js2c
srcdir = '.' srcdir = '.'
@ -14,6 +17,7 @@ def set_options(opt):
# the gcc module provides a --debug-level option # the gcc module provides a --debug-level option
opt.tool_options('compiler_cxx') opt.tool_options('compiler_cxx')
opt.tool_options('compiler_cc') opt.tool_options('compiler_cc')
opt.tool_options('misc')
opt.add_option( '--debug' opt.add_option( '--debug'
, action='store_true' , action='store_true'
, default=False , default=False
@ -267,6 +271,29 @@ def build(bld):
node.install_path = '${PREFIX}/bin' node.install_path = '${PREFIX}/bin'
node.chmod = 0755 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"]: if bld.env["USE_DEBUG"]:
node_g = node.clone("debug") node_g = node.clone("debug")
node_g.target = "node_g" node_g.target = "node_g"
@ -274,3 +301,8 @@ def build(bld):
libnode_g = libnode.clone("debug") libnode_g = libnode.clone("debug")
libnode_g.target = "node_g" libnode_g.target = "node_g"
pkgconfig_g = pkgconfig.clone("debug")
pkgconfig_g.dict = subflags(node_g)
pkgconfig_g.target = 'node_g.pc'

Loading…
Cancel
Save