[Pkg-javascript-commits] [node-expat] 112/371: Added windows building tools in wintools folder

Jonas Smedegaard dr at jones.dk
Sun Feb 28 09:59:51 UTC 2016


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository node-expat.

commit 3c4fe34a35dc568335526ad2c207ca4ef0a139fa
Author: Andreas Botsikas <abot at epu.ntua.gr>
Date:   Fri Dec 16 08:49:28 2011 +0200

    Added windows building tools in wintools folder
---
 wintools/module.gyp   | 75 +++++++++++++++++++++++++++++++++++++++++++++
 wintools/node-gyp.bat | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 160 insertions(+)

diff --git a/wintools/module.gyp b/wintools/module.gyp
new file mode 100644
index 0000000..0189e4e
--- /dev/null
+++ b/wintools/module.gyp
@@ -0,0 +1,75 @@
+{
+  'variables': {
+    'module_name': 'node_expat',#Specify the module name here
+	'library': 'shared_library', #This gypi file is about modules so everything is shared_library
+	'target_arch': 'ia32', #The architecture is hardcoded because of a i386 harcoded element in the gyp make.py file 
+	'output_directory': '../build/Release', #The output dir resembles the old node-waf output in order to keep the olde references
+  },
+  'targets': [
+    {
+		#Needed declarations for the target
+		'target_name': '<(module_name)',
+		'type': '<(library)',
+		'product_name':'<(module_name)',
+		'product_extension':'node',
+		'product_dir':'<(output_directory)',
+		'product_prefix':'',#remove the default lib prefix on each library
+		
+		'sources': [ 
+			'../node-expat.cc',
+		],
+		
+		'include_dirs': [
+			'<(NODE_ROOT)/src',
+			'<(NODE_ROOT)/deps/v8/include',
+			'<(NODE_ROOT)/deps/uv/include',
+			'<(expat_root)/Source/lib',
+		 ],
+		 
+		'defines': [
+			'ARCH="<(target_arch)"',
+			'PLATFORM="<(OS)"',
+			'_LARGEFILE_SOURCE',
+			'_FILE_OFFSET_BITS=64',
+		],
+		
+		'conditions': [
+        [ 'OS=="win"', {
+          'defines': [
+			'uint=unsigned int', #Windows doesn't have uint defined
+			# we need to use node's preferred "win32" rather than gyp's preferred "win"
+			'PLATFORM="win32"',
+          ],
+		  #we need to link to the node.lib file
+          'libraries': [ '-l<(NODE_ROOT)/<(node_lib_folder)/node.lib','-l<(expat_root)/bin/libexpat.lib'  ],
+		  'msvs_configuration_attributes': {
+			'OutputDirectory': '<(output_directory)',
+			'IntermediateDirectory': '<(output_directory)/obj',
+		  },
+		  'msvs-settings': {
+			'VCLinkerTool': {
+				'SubSystem': 3, # /subsystem:dll
+			},
+		  },
+        }],
+        [ 'OS=="mac"', {
+		  'defines': [
+			'uint=unsigned int', #Mac doesn't have uint either
+          ],
+		  #MAC x64 users don't forget to comment out all line in 
+		  #gyp\pylib\gyp\generator\make.py that contain append('-arch i386') (2 instances)
+		  'libraries': [ #this is a hack to specify this linker option in make              
+			'-undefined dynamic_lookup',
+			'-lexpat',
+		  ],
+        }],
+        [ 'OS=="linux"', {
+          'libraries': [         
+			'-lexpat',
+		  ],
+        }]
+      ],
+    },
+  ] # end targets
+}
+
diff --git a/wintools/node-gyp.bat b/wintools/node-gyp.bat
new file mode 100644
index 0000000..f3f0899
--- /dev/null
+++ b/wintools/node-gyp.bat
@@ -0,0 +1,85 @@
+ at echo off
+ at rem Check for nodejs build location variable
+if not defined NODE_ROOT goto nodebuild-not-found
+if not exist "%NODE_ROOT%\src\node.h" goto nodebuild-not-found
+if not exist "%NODE_ROOT%\deps\v8\include\v8.h" goto nodebuild-not-found
+if not exist "%NODE_ROOT%\deps\uv\include\uv.h" goto nodebuild-not-found
+if not exist "%NODE_ROOT%\tools\gyp\gyp" goto gyp-not-found
+
+ at rem detect the location of the node.lib file
+set node_lib_folder=
+if exist "%NODE_ROOT%\Release\node.lib" set node_lib_folder=Release
+if not defined node_lib_folder if exist "%NODE_ROOT%\Debug\node.lib" set node_lib_folder=Debug
+if not defined node_lib_folder goto nodebuild-not-found
+
+ at rem Check for expat location
+if not defined EXPAT_ROOT goto expat-not-found
+if not exist "%EXPAT_ROOT%\Source\lib\expat.h" goto expat-not-found
+echo NOTE: Make sure that "%EXPAT_ROOT%\BIN\" is in your path or that libexpat.dll otherwise you won't be able to load the module!
+ at rem Check if user has specified the build command
+set requestedBuild= 0
+ at rem Check if the first argument is make
+if "%1" == "make" set requestedBuild= 1
+if %requestedBuild% == 0 echo Run "node-gyp make" if you want to generate the project and build it at once.
+ at rem Try to locate the gyp file
+set gypfile=
+if exist "module.gyp" set gypfile=module.gyp
+if not defined gypfile goto gyp-file-missing
+ at rem Generate visual studio solution
+python %NODE_ROOT%\tools\gyp\gyp -f msvs -G msvs_version=2010 %gypfile% --depth=. -DNODE_ROOT=%NODE_ROOT% -Dnode_lib_folder=%node_lib_folder% -Dexpat_root=%EXPAT_ROOT%
+if errorlevel 1 goto exit-error
+if %requestedBuild% == 0 goto Finished
+ at rem Build the solution
+ at rem Check for visual studio tools if not already loaded
+if defined VCINSTALLDIR goto BuildSolution
+ at rem Ensure that visual studio is available
+if not defined VS100COMNTOOLS goto msbuild-not-found
+if not exist "%VS100COMNTOOLS%..\..\vc\vcvarsall.bat" goto msbuild-not-found
+call "%VS100COMNTOOLS%..\..\vc\vcvarsall.bat"
+ at rem Check that vs is properly loaded
+if not defined VCINSTALLDIR goto msbuild-not-found
+:BuildSolution
+call :BuildSolutionBasedOnGypFilename %gypfile%
+:Finished
+echo Finished
+goto exit
+:msbuild-not-found
+echo Visual studio tools were not found! Please check the VS100COMNTOOLS path variable
+goto exit
+:gyp-not-found
+echo GYP was not found. Please check that gyp is located in %NODE_ROOT%/tools/gyp/ 
+goto exit
+:nodebuild-not-found
+echo Node build path not found! Please check the NODE_ROOT environment variable exists and that it points to the root of the git repo where you have build 
+goto exit
+:gyp-file-missing
+echo Could not locate a gyp file. module.gyp file was not found.
+goto exit
+:msbuild-not-found
+echo Visual studio tools were not found! Please check the VS100COMNTOOLS path variable
+goto exit
+:solutions-file-not-found
+echo Generated solution file %generatedslnfile% was not found!
+goto exit
+:expat-not-found
+echo Expat root path not found! Please check the EXPAT_ROOT environment variable exists and that it points to the installation folder or expat 
+goto exit
+:expat-not-in-path
+echo Expat library is not in your path environment variable. Even if it builds, the module will not load!
+goto exit
+:exit-error
+echo An error occured. Please check the above output
+:exit
+ at rem clear local variables
+set node_lib_folder=
+set requestedBuild=
+set gypfile=
+goto :EOF
+ at rem Internal procedures
+:BuildSolutionBasedOnGypFilename
+set generatedslnfile=%~n1.sln
+if not exist %generatedslnfile% goto solutions-file-not-found
+ at rem call msbuild to build the sln file
+msbuild.exe %generatedslnfile%
+if errorlevel 1 goto exit-error
+goto :EOF
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-expat.git



More information about the Pkg-javascript-commits mailing list