@@ -637,95 +637,13 @@ def _create_batch_scripts(self):
637
637
path = conv (self .prepath ) + ";%PATH%;" + conv (self .postpath )
638
638
639
639
640
- # Prepare a live patch on python (shame we need it) to have mingw64ok
641
- patch_distutils = r"""
642
-
643
- set WINPYXX=%WINPYVER:~0,1%%WINPYVER:~2,1%
644
-
645
- set WINPYARCH="WIN32"
646
- if "%WiNPYDIR:~-5%"=="amd64" set WINPYARCH="WIN-AMD64"
647
-
648
- if %WINPYARCH%=="WIN32" set BASEMINGW=i686-w64-mingw32
649
- if %WINPYARCH%=="WIN-AMD64" set BASEMINGW=x86_64-w64-mingw32
650
-
651
- set WINMINGW=lib\gcc\%BASEMINGW%
652
-
653
- if not %WINPYARCH%=="WIN-AMD64" goto no_distutil_patch
654
- %~dp0Find_And_replace.vbs "%WINPYDIR%\Lib\distutils\cygwinccompiler.py" "-O -W" "-O -DMS_WIN64 -W"
655
- :no_distutil_patch
656
-
657
-
658
- rem Python 3.3+ case
659
- set WINPYMSVCR=libmsvcr100.a
660
- set WINPYSPEC=specs100
661
-
662
- rem Python2.7 case
663
- IF "%WINPYXX%"=="27" set WINPYMSVCR=libmsvcr90.a
664
- IF "%WINPYXX%"=="27" set WINPYSPEC=specs90
665
-
666
- cd %WINPYDIR%
667
-
668
- if not exist ..\tools\mingw32 echo no_mingw_in_tools
669
- if not exist ..\tools\mingw32 goto no_mingw_in_tools
670
-
671
- copy /Y ..\tools\mingw32\%BASEMINGW%\lib\%WINPYMSVCR% libs\%WINPYMSVCR%
672
-
673
- REM copy the right version of gcc
674
- set dir482=..\tools\mingw32\%WINMINGW%\4.8.2\%WINPYSPEC%
675
- if exist %dir482% copy /Y %dir482% ..\tools\mingw32\%WINMINGW%\4.8.2\specs
676
-
677
- set dir492=..\tools\mingw32\%WINMINGW%\4.9.2\%WINPYSPEC%
678
- if exist %dir492% copy /Y %dir492% ..\tools\mingw32\%WINMINGW%\4.9.2\specs
679
-
680
- REM generate python.34 import file
681
-
682
- ..\tools\mingw32\bin\gendef.exe python%WINPYXX%.dll
683
- ..\tools\mingw32\bin\dlltool -D python%WINPYXX%.dll -d python%WINPYXX%.def -l libpython%WINPYXX%.dll.a
684
- move /Y libpython%WINPYXX%.dll.a libs
685
- del python%WINPYXX%.def
686
-
687
- :no_mingw_in_tools
688
-
689
- """
690
-
691
- self .create_batch_script ('Find_And_replace.vbs' , r"""
692
- ' from http://stackoverflow.com/questions/15291341/
693
- ' a-batch-file-to-read-a-file-and-replace-a-string-with-a-new-one
694
-
695
- If WScript.Arguments.Count <> 3 then
696
- WScript.Echo "usage: Find_And_replace.vbs filename word_to_find replace_with "
697
- WScript.Quit
698
- end If
699
-
700
- FindAndReplace WScript.Arguments.Item(0), WScript.Arguments.Item(1), WScript.Arguments.Item(2)
701
- 'WScript.Echo "Operation Complete"
702
-
703
- function FindAndReplace(strFilename, strFind, strReplace)
704
- Set inputFile = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFilename, 1)
705
- strInputFile = inputFile.ReadAll
706
- inputFile.Close
707
- Set inputFile = Nothing
708
- result_text = Replace(strInputFile, strFind, strReplace)
709
- if result <> strInputFile then
710
- Set outputFile = CreateObject("Scripting.FileSystemObject").OpenTextFile(strFilename,2,true)
711
- outputFile.Write result_text
712
- outputFile.Close
713
- Set outputFile = Nothing
714
- end if
715
- end function
716
- """ )
717
-
718
640
self .create_batch_script ('make_cython_use_mingw.bat' , r"""@echo off
719
641
call %~dp0env.bat
720
642
721
643
rem ******************
722
- rem mingw part (supposing you install it in \tools\mingw32)
644
+ rem mingw part
723
645
rem ******************
724
- set tmp_mingwdirectory=mingw32
725
- if not exist "%WINPYDIR%\..\tools\%tmp_mingwdirectory%\bin" goto mingw_end
726
646
727
- """ + patch_distutils +
728
- r"""
729
647
set pydistutils_cfg=%WINPYDIR%\..\settings\pydistutils.cfg
730
648
731
649
set tmp_blank=
@@ -741,12 +659,6 @@ def _create_batch_scripts(self):
741
659
echo cython has been set to use mingw32
742
660
echo to remove this, remove file "%pydistutils_cfg%"
743
661
744
- goto mingw_success
745
-
746
- :mingw_end
747
- echo "%WINPYDIR%\..\tools\%tmp_mingwdirectory%\bin" not found
748
-
749
- :mingw_success
750
662
rem pause
751
663
752
664
""" )
@@ -1024,6 +936,4 @@ def make_all(build_number, release_level, pyver,
1024
936
#make_all(1, '', pyver='2.7', rootdir=r'D:\Winpython',
1025
937
# verbose=False, archis=(64, ))
1026
938
#make_all(4, '', pyver='3.4', rootdir=r'D:\Winpython',
1027
- # verbose=False, archis=(64, ), flavor='FlavorRfull')
1028
- #make_all(4, '', pyver='3.4', rootdir=r'D:\Winpython',
1029
939
# verbose=False, archis=(64, ), flavor='FlavorJulia')
0 commit comments