From: Brian Gladman Date: Thu, 25 Feb 2010 10:57:07 +0000 (-0000) Subject: Yet one more attempt to find Python in Windows X-Git-Tag: v1.0.0~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e062b3c45682b59b25440f2afa311773b0562028;p=yasm Yet one more attempt to find Python in Windows svn path=/trunk/yasm/; revision=2295 --- diff --git a/Mkfiles/vc10/genperf/run.bat b/Mkfiles/vc10/genperf/run.bat index b2aed9ed..1811dd6e 100644 --- a/Mkfiles/vc10/genperf/run.bat +++ b/Mkfiles/vc10/genperf/run.bat @@ -1,18 +1,21 @@ cd ..\..\.. @echo off -del run_py.bat -for /f "usebackq tokens=2*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g >run_py.bat) -@echo on -if exist run_py.bat goto pyfound -echo ... building without Python ... -goto end +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 Building without Python ... +goto therest -:pyfound -echo ... building with Python ... -call run_py.bat modules\arch\x86\gen_x86_insn.py -del run_py.bat +:next0 +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%res:%_end_%=%% +call %_python_% modules\arch\x86\gen_x86_insn.py -:end +:therest +@echo on %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c diff --git a/Mkfiles/vc9/genperf/run.bat b/Mkfiles/vc9/genperf/run.bat index b2aed9ed..1811dd6e 100644 --- a/Mkfiles/vc9/genperf/run.bat +++ b/Mkfiles/vc9/genperf/run.bat @@ -1,18 +1,21 @@ cd ..\..\.. @echo off -del run_py.bat -for /f "usebackq tokens=2*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (if %%f==REG_SZ echo %%g >run_py.bat) -@echo on -if exist run_py.bat goto pyfound -echo ... building without Python ... -goto end +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 Building without Python ... +goto therest -:pyfound -echo ... building with Python ... -call run_py.bat modules\arch\x86\gen_x86_insn.py -del run_py.bat +:next0 +echo Building with Python ... +set _res_=%_my_:*REG_SZ=% +set _end_=%_res_:*exe"=% +call set _python_=%%res:%_end_%=%% +call %_python_% modules\arch\x86\gen_x86_insn.py -:end +:therest +@echo on %1 x86insn_nasm.gperf x86insn_nasm.c %1 x86insn_gas.gperf x86insn_gas.c %1 modules\arch\x86\x86cpu.gperf x86cpu.c