 			execGruntTask 'archIa32', (err) ->
 				return done(err) if err
 
-				configGypi = fs.readFileSync __dirname + '/support/build/config.gypi', 'utf8'
+				configGypi = fs.readFileSync supportDir + '/build/config.gypi', 'utf8'
 				if configGypi.indexOf('"target_arch": "ia32"') < 0
 					return done(new Error 'expected config.gypi to be configured for 32-bit build')
 

fs = require 'fs'
exec = require('child_process').exec

execOptions =
	cwd: __dirname + '/support'

execGruntTask = (task, callback) ->
	exec "grunt gyp:#{task}", execOptions, (error) ->

				execGruntTask 'build', (err) ->
					return done(err) if err

					if !fs.existsSync supportDir + '/build/Release/hello_world.node'
						return done(new Error 'expected Release/hello_world.node to exist')

					done()
