]> granicus.if.org Git - yasm/commitdiff
Yet one more attempt to find Python in Windows
authorBrian Gladman <brg@gladman.plus.com>
Thu, 25 Feb 2010 10:57:07 +0000 (10:57 -0000)
committerBrian Gladman <brg@gladman.plus.com>
Thu, 25 Feb 2010 10:57:07 +0000 (10:57 -0000)
svn path=/trunk/yasm/; revision=2295

Mkfiles/vc10/genperf/run.bat
Mkfiles/vc9/genperf/run.bat

index b2aed9ededfb79960ed05b1aa546bb02a390ce6f..1811dd6e87a4ebf8cbe69222cb86094e30c7d1e0 100644 (file)
@@ -1,18 +1,21 @@
 cd ..\..\..\r
 @echo off\r
-del run_py.bat\r
-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) \r
-@echo on\r
-if exist run_py.bat goto pyfound\r
-echo ... building without Python ...\r
-goto end\r
+for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g)\r
+goto next%errorlevel%\r
+\r
+:next1\r
+echo Building without Python ...\r
+goto therest\r
 \r
-:pyfound\r
-echo ... building with Python ...\r
-call run_py.bat modules\arch\x86\gen_x86_insn.py\r
-del run_py.bat\r
+:next0\r
+echo Building with Python ...\r
+set _res_=%_my_:*REG_SZ=%\r
+set _end_=%_res_:*exe"=%\r
+call set _python_=%%res:%_end_%=%%\r
+call %_python_% modules\arch\x86\gen_x86_insn.py\r
 \r
-:end\r
+:therest\r
+@echo on\r
 %1 x86insn_nasm.gperf x86insn_nasm.c\r
 %1 x86insn_gas.gperf x86insn_gas.c\r
 %1 modules\arch\x86\x86cpu.gperf x86cpu.c\r
index b2aed9ededfb79960ed05b1aa546bb02a390ce6f..1811dd6e87a4ebf8cbe69222cb86094e30c7d1e0 100644 (file)
@@ -1,18 +1,21 @@
 cd ..\..\..\r
 @echo off\r
-del run_py.bat\r
-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) \r
-@echo on\r
-if exist run_py.bat goto pyfound\r
-echo ... building without Python ...\r
-goto end\r
+for /f "usebackq tokens=1*" %%f in (`reg query HKCR\Python.File\shell\open\command`) do (set _my_=%%f %%g)\r
+goto next%errorlevel%\r
+\r
+:next1\r
+echo Building without Python ...\r
+goto therest\r
 \r
-:pyfound\r
-echo ... building with Python ...\r
-call run_py.bat modules\arch\x86\gen_x86_insn.py\r
-del run_py.bat\r
+:next0\r
+echo Building with Python ...\r
+set _res_=%_my_:*REG_SZ=%\r
+set _end_=%_res_:*exe"=%\r
+call set _python_=%%res:%_end_%=%%\r
+call %_python_% modules\arch\x86\gen_x86_insn.py\r
 \r
-:end\r
+:therest\r
+@echo on\r
 %1 x86insn_nasm.gperf x86insn_nasm.c\r
 %1 x86insn_gas.gperf x86insn_gas.c\r
 %1 modules\arch\x86\x86cpu.gperf x86cpu.c\r