From a4903916a2d8b012b7205ae4ab0572368d4d332b Mon Sep 17 00:00:00 2001 From: gladman Date: Fri, 28 Sep 2012 18:11:47 +0000 Subject: [PATCH] add build of cfg.h files to the Windows command line build (requires Python) --- build.vc10/mpir_config.py | 12 ++++++------ win/make.bat | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/build.vc10/mpir_config.py b/build.vc10/mpir_config.py index 7af037e4..317e0952 100644 --- a/build.vc10/mpir_config.py +++ b/build.vc10/mpir_config.py @@ -33,7 +33,7 @@ from copy import deepcopy from sys import argv, exit from filecmp import cmp from shutil import copy -from re import compile, search, ASCII +from re import compile, search from collections import defaultdict from uuid import uuid1 @@ -190,11 +190,11 @@ def find_src(dir_list): # scan the files in the input set and find the symbols # defined in the files -fr_sym = compile(r'LEAF_PROC\s+(\w+)', ASCII) -lf_sym = compile(r'FRAME_PROC\s+(\w+)', ASCII) -wf_sym = compile(r'WIN64_GCC_PROC\s+(\w+)', ASCII) -g3_sym = compile(r'global\s+___g(\w+)', ASCII) -g2_sym = compile(r'global\s+__g(\w+)', ASCII) +fr_sym = compile(r'LEAF_PROC\s+(\w+)') +lf_sym = compile(r'FRAME_PROC\s+(\w+)') +wf_sym = compile(r'WIN64_GCC_PROC\s+(\w+)') +g3_sym = compile(r'global\s+___g(\w+)') +g2_sym = compile(r'global\s+__g(\w+)') def get_symbols(setf, sym_dir): for f in setf: diff --git a/win/make.bat b/win/make.bat index 16ff9c33..924693a3 100644 --- a/win/make.bat +++ b/win/make.bat @@ -41,6 +41,20 @@ copy ..\build.vc10\out_copy_rename.bat . copy ..\build.vc10\gen_config_h.bat . copy ..\build.vc10\cfg.h . +@echo off +for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g) +goto next%errorlevel% + +:next1 +echo Cannot build without Python ...exiting +exit /b 1 + +:next0 +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%_res_:%_end_%=%% +call %_python_% ..\build.vc10\mpir_config.py 1 + if %ABI% == 64 (set LOCALABI=x64) if %ABI% == 32 (set LOCALABI=win32) set YASMFLAG=