From e493b295987df5608ad2580631b9fd6e9fc7fd3c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 17 Jan 2012 23:02:15 +0100 Subject: [PATCH] build: respect --debug configure switch --- .gitignore | 1 + Makefile | 2 ++ configure | 17 ++++++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 3bc7efb5e62..ebbd0838c4e 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,7 @@ ipch/ *.sdf *.opensdf +/config.mk /config.gypi *-nodegyp* /gyp-mac-tool diff --git a/Makefile b/Makefile index 856b5a66a54..33c9e184664 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +-include config.mk + BUILDTYPE ?= Release PYTHON ?= python diff --git a/configure b/configure index 5b13b5a36b0..6a709c92443 100755 --- a/configure +++ b/configure @@ -266,13 +266,16 @@ output = { } pprint.pprint(output, indent=2) -fn = os.path.join(root_dir, 'config.gypi') -print "creating ", fn +def write(filename, data): + filename = os.path.join(root_dir, filename) + print "creating ", filename + with open(filename, 'w+') as f: + f.write(data) -f = open(fn, 'w+') -f.write("# Do not edit. Generated by the configure script.\n") -pprint.pprint(output, stream=f, indent=2) -f.write("\n") -f.close() +write('config.gypi', "# Do not edit. Generated by the configure script.\n" + + pprint.pformat(output, indent=2)) + +write('config.mk', "# Do not edit. Generated by the configure script.\n" + + ("BUILDTYPE=%s\n" % ('Debug' if options.debug else 'Release'))) subprocess.call(['tools/gyp_node','-f', 'make'])