@@ -520,27 +520,28 @@ def write_prep(self):
520
520
if self .config .subdir :
521
521
self ._write_strip ("popd" )
522
522
523
- if self .config .default_pattern != 'cmake' :
524
- if self .config .config_opts ['32bit' ]:
525
- self ._write_strip ("pushd .." )
526
- self ._write_strip ("cp -a {} build32" .format (self .content .tarball_prefix ))
527
- self ._write_strip ("popd" )
528
- if self .config .config_opts ['use_avx2' ]:
529
- self ._write_strip ("pushd .." )
530
- self ._write_strip ("cp -a {} buildavx2" .format (self .content .tarball_prefix ))
531
- self ._write_strip ("popd" )
532
- if self .config .config_opts ['use_avx512' ]:
533
- self ._write_strip ("pushd .." )
534
- self ._write_strip ("cp -a {} buildavx512" .format (self .content .tarball_prefix ))
535
- self ._write_strip ("popd" )
536
- if self .config .config_opts ['use_apx' ]:
537
- self ._write_strip ("pushd .." )
538
- self ._write_strip ("cp -a {} buildapx" .format (self .content .tarball_prefix ))
539
- self ._write_strip ("popd" )
540
- if self .config .config_opts ['openmpi' ]:
541
- self ._write_strip ("pushd .." )
542
- self ._write_strip ("cp -a {} build-openmpi" .format (self .content .tarball_prefix ))
543
- self ._write_strip ("popd" )
523
+ self .write_copy_prepend ()
524
+
525
+ if self .config .config_opts ['32bit' ]:
526
+ self ._write_strip ("pushd .." )
527
+ self ._write_strip ("cp -a {} build32" .format (self .content .tarball_prefix ))
528
+ self ._write_strip ("popd" )
529
+ if self .config .config_opts ['use_avx2' ]:
530
+ self ._write_strip ("pushd .." )
531
+ self ._write_strip ("cp -a {} buildavx2" .format (self .content .tarball_prefix ))
532
+ self ._write_strip ("popd" )
533
+ if self .config .config_opts ['use_avx512' ]:
534
+ self ._write_strip ("pushd .." )
535
+ self ._write_strip ("cp -a {} buildavx512" .format (self .content .tarball_prefix ))
536
+ self ._write_strip ("popd" )
537
+ if self .config .config_opts ['use_apx' ]:
538
+ self ._write_strip ("pushd .." )
539
+ self ._write_strip ("cp -a {} buildapx" .format (self .content .tarball_prefix ))
540
+ self ._write_strip ("popd" )
541
+ if self .config .config_opts ['openmpi' ]:
542
+ self ._write_strip ("pushd .." )
543
+ self ._write_strip ("cp -a {} build-openmpi" .format (self .content .tarball_prefix ))
544
+ self ._write_strip ("popd" )
544
545
self ._write_strip ("\n " )
545
546
546
547
def write_32bit_exports (self ):
@@ -800,6 +801,14 @@ def write_prep_prepend(self):
800
801
self ._write_strip ("{}\n " .format (line ))
801
802
self ._write_strip ("## prep_prepend end" )
802
803
804
+ def write_copy_prepend (self ):
805
+ """Write out any custom supplied commands prior to creating source copies for avx, etc builds."""
806
+ if self .config .copy_prepend :
807
+ self ._write_strip ("## copy_prepend content" )
808
+ for line in self .config .copy_prepend :
809
+ self ._write_strip ("{}\n " .format (line ))
810
+ self ._write_strip ("## copy_prepend end" )
811
+
803
812
def write_build_prepend (self ):
804
813
"""Write out any custom supplied commands at the start of the %build section and every build type."""
805
814
if self .config .build_prepend :
@@ -915,13 +924,11 @@ def write_cmake_install(self):
915
924
916
925
self ._write_strip ("export GOAMD64=v2" )
917
926
918
- if self .config .subdir :
919
- self ._write_strip ("pushd " + self .config .subdir )
920
-
921
927
if self .config .config_opts ['use_ninja' ] and self .config .install_macro == '%make_install' :
922
928
self .config .install_macro = '%ninja_install'
923
929
924
930
if self .config .config_opts ['32bit' ]:
931
+ self ._write_strip ("pushd ../build32/" + self .config .subdir )
925
932
self ._write_strip ("pushd clr-build32" )
926
933
self ._write_strip ("{}32 {} {}" .format (self .config .install_macro ,
927
934
self .config .extra_make_install ,
@@ -939,30 +946,42 @@ def write_cmake_install(self):
939
946
self ._write_strip (" popd" )
940
947
self ._write_strip ("fi" )
941
948
self ._write_strip ("popd" )
949
+ self ._write_strip ("popd" )
942
950
943
951
if self .config .config_opts ['use_avx2' ]:
952
+ self ._write_strip ("pushd ../buildavx2/" + self .config .subdir )
944
953
self ._write_strip ("GOAMD64=v3" )
945
954
self ._write_strip ("pushd clr-build-avx2" )
946
955
self ._write_strip ("%s_v3 %s || :\n " % (self .config .install_macro , self .config .extra_make_install ))
947
956
self ._write_strip ("popd" )
957
+ self ._write_strip ("popd" )
948
958
949
959
if self .config .config_opts ['use_avx512' ]:
960
+ self ._write_strip ("pushd ../buildavx512/" + self .config .subdir )
950
961
self ._write_strip ("GOAMD64=v4" )
951
962
self ._write_strip ("pushd clr-build-avx512" )
952
963
self ._write_strip ("%s_v4 %s || :\n " % (self .config .install_macro , self .config .extra_make_install ))
953
964
self ._write_strip ("popd" )
965
+ self ._write_strip ("popd" )
954
966
955
967
if self .config .config_opts ['use_apx' ]:
968
+ self ._write_strip ("pushd ../buildapx/" + self .config .subdir )
956
969
self ._write_strip ("GOAMD64=v3" )
957
970
self ._write_strip ("pushd clr-build-apx" )
958
971
self ._write_strip ("%s_va %s || :\n " % (self .config .install_macro , self .config .extra_make_install ))
959
972
self ._write_strip ("popd" )
973
+ self ._write_strip ("popd" )
960
974
961
975
if self .config .config_opts ['openmpi' ]:
976
+ self ._write_strip ("pushd ../build-openmpi/" + self .config .subdir )
962
977
self ._write_strip ("GOAMD64=v3" )
963
978
self ._write_strip ("pushd clr-build-openmpi" )
964
979
self .write_install_openmpi ()
965
980
self ._write_strip ("popd" )
981
+ self ._write_strip ("popd" )
982
+
983
+ if self .config .subdir :
984
+ self ._write_strip ("pushd " + self .config .subdir )
966
985
967
986
self ._write_strip ("GOAMD64=v2" )
968
987
self ._write_strip ("pushd clr-build" )
@@ -1656,7 +1675,11 @@ def write_cmake_pattern(self):
1656
1675
self .write_make_line ()
1657
1676
self ._write_strip ("popd" )
1658
1677
1678
+ if self .config .subdir :
1679
+ self ._write_strip ("popd" )
1680
+
1659
1681
if self .config .config_opts ['use_avx2' ]:
1682
+ self ._write_strip ("pushd ../buildavx2/" + self .config .subdir )
1660
1683
self ._write_strip ("mkdir -p clr-build-avx2" )
1661
1684
self ._write_strip ("pushd clr-build-avx2" )
1662
1685
self .write_build_prepend ()
@@ -1669,8 +1692,10 @@ def write_cmake_pattern(self):
1669
1692
self ._write_strip (f"%cmake { self .config .cmake_srcdir } { self .extra_cmake } { cmake_type } " )
1670
1693
self .write_make_line ()
1671
1694
self ._write_strip ("popd" )
1695
+ self ._write_strip ("popd" )
1672
1696
1673
1697
if self .config .config_opts ['use_avx512' ]:
1698
+ self ._write_strip ("pushd ../buildavx512/" + self .config .subdir )
1674
1699
self ._write_strip ("mkdir -p clr-build-avx512" )
1675
1700
self ._write_strip ("pushd clr-build-avx512" )
1676
1701
self .write_build_prepend ()
@@ -1683,8 +1708,10 @@ def write_cmake_pattern(self):
1683
1708
self ._write_strip (f"%cmake { self .config .cmake_srcdir } { self .extra_cmake } { cmake_type } " )
1684
1709
self .write_make_line ()
1685
1710
self ._write_strip ("popd" )
1711
+ self ._write_strip ("popd" )
1686
1712
1687
1713
if self .config .config_opts ['use_apx' ] and not self .config .config_opts ['use_clang' ]:
1714
+ self ._write_strip ("pushd ../buildapx/" + self .config .subdir )
1688
1715
self ._write_strip ("mkdir -p clr-build-apx" )
1689
1716
self ._write_strip ("pushd clr-build-apx" )
1690
1717
self .write_build_prepend ()
@@ -1697,8 +1724,10 @@ def write_cmake_pattern(self):
1697
1724
self ._write_strip (f"%cmake { self .config .cmake_srcdir } { self .extra_cmake } { cmake_type } " )
1698
1725
self .write_make_line ()
1699
1726
self ._write_strip ("popd" )
1727
+ self ._write_strip ("popd" )
1700
1728
1701
1729
if self .config .config_opts ['32bit' ]:
1730
+ self ._write_strip ("pushd ../build32/" + self .config .subdir )
1702
1731
self ._write_strip ("mkdir -p clr-build32" )
1703
1732
self ._write_strip ("pushd clr-build32" )
1704
1733
self .write_build_prepend ()
@@ -1711,8 +1740,10 @@ def write_cmake_pattern(self):
1711
1740
self .write_make_line ()
1712
1741
self ._write_strip ("unset PKG_CONFIG_PATH" )
1713
1742
self ._write_strip ("popd" )
1743
+ self ._write_strip ("popd" )
1714
1744
1715
1745
if self .config .config_opts ['openmpi' ]:
1746
+ self ._write_strip ("pushd ../build-openmpi/" + self .config .subdir )
1716
1747
self ._write_strip ("mkdir -p clr-build-openmpi" )
1717
1748
self ._write_strip ("pushd clr-build-openmpi" )
1718
1749
self ._write_strip (". /usr/share/defaults/etc/profile.d/modules.sh" )
@@ -1728,8 +1759,6 @@ def write_cmake_pattern(self):
1728
1759
self .write_make_line ()
1729
1760
self ._write_strip ("module unload openmpi" )
1730
1761
self ._write_strip ("popd" )
1731
-
1732
- if self .config .subdir :
1733
1762
self ._write_strip ("popd" )
1734
1763
1735
1764
self ._write_strip ("\n " )
0 commit comments