Skip to content

Commit 723bc6c

Browse files
committed
Refactor cibw_before_all_windows.sh
1 parent ce08495 commit 723bc6c

3 files changed

Lines changed: 58 additions & 57 deletions

File tree

bin/cibw_before_all_windows.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
5+
if [ $# -lt 2 ]; then
6+
echo "usage: $0 <llvm-machine> <build-dependencies-args>..."
7+
exit 1
8+
fi
9+
10+
llvm_machine="$1"
11+
shift
12+
13+
bin/build_dependencies_unix.sh "$@"
14+
15+
mkdir -p .local/lib
16+
cd .local/bin
17+
for dll_file in libgmp-*.dll libmpfr-*.dll libflint*.dll
18+
do
19+
lib_name=$(basename -s .dll "${dll_file}")
20+
def_file=${lib_name}.def
21+
name=$(echo "${lib_name}" | sed 's/^lib//;s/[-.][0-9].*$//')
22+
23+
gendef "${dll_file}"
24+
llvm-lib /def:"${def_file}" /out:"../lib/${name}.lib" /machine:${llvm_machine} /nologo
25+
rm "${def_file}"
26+
done
27+
cd ../..

bin/cibw_before_all_windows_amd64.sh

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,20 @@
33
set -o errexit
44

55
pacman -S --noconfirm \
6-
mingw-w64-ucrt-x86_64-gcc\
7-
mingw-w64-ucrt-x86_64-llvm-tools\
8-
mingw-w64-ucrt-x86_64-tools-git\
9-
m4\
10-
make\
11-
base-devel\
12-
autoconf-wrapper\
13-
automake-wrapper\
14-
libtool\
15-
git\
6+
mingw-w64-ucrt-x86_64-gcc \
7+
mingw-w64-ucrt-x86_64-llvm-tools \
8+
mingw-w64-ucrt-x86_64-tools-git \
9+
m4 \
10+
make \
11+
base-devel \
12+
autoconf-wrapper \
13+
automake-wrapper \
14+
libtool \
15+
git \
1616
#
1717

18-
bin/build_dependencies_unix.sh \
19-
--use-gmp-github-mirror\
20-
--patch-C23\
18+
bin/cibw_before_all_windows.sh \
19+
x64 \
20+
--use-gmp-github-mirror \
21+
--patch-C23 \
2122
#
22-
23-
mkdir -p .local/lib
24-
cd .local/bin
25-
for dll_file in libgmp-*.dll libmpfr-*.dll libflint*.dll
26-
do
27-
lib_name=$(basename -s .dll "${dll_file}")
28-
def_file=${lib_name}.def
29-
name=$(echo "${lib_name}" | sed 's/^lib//;s/[-.][0-9].*$//')
30-
31-
gendef "${dll_file}"
32-
llvm-lib /def:"${def_file}" /out:"../lib/${name}.lib" /machine:x64 /nologo
33-
rm "${def_file}"
34-
done
35-
cd ../..

bin/cibw_before_all_windows_arm64.sh

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,23 @@
33
set -o errexit
44

55
pacman -S --noconfirm \
6-
mingw-w64-clang-aarch64-toolchain\
7-
mingw-w64-clang-aarch64-llvm-tools\
8-
mingw-w64-clang-aarch64-tools-git\
9-
m4\
10-
make\
11-
base-devel\
12-
autoconf-wrapper\
13-
automake-wrapper\
14-
libtool\
15-
git\
6+
mingw-w64-clang-aarch64-toolchain \
7+
mingw-w64-clang-aarch64-llvm-tools \
8+
mingw-w64-clang-aarch64-tools-git \
9+
m4 \
10+
make \
11+
base-devel \
12+
autoconf-wrapper \
13+
automake-wrapper \
14+
libtool \
15+
git \
1616
#
1717

18-
bin/build_dependencies_unix.sh \
19-
--use-gmp-github-mirror\
20-
--host aarch64-w64-mingw32\
21-
--patch-C23\
22-
--patch-ldd\
23-
--patch-immintrin\
18+
bin/cibw_before_all_windows.sh \
19+
arm64 \
20+
--use-gmp-github-mirror \
21+
--host aarch64-w64-mingw32 \
22+
--patch-C23 \
23+
--patch-ldd \
24+
--patch-immintrin \
2425
#
25-
26-
mkdir -p .local/lib
27-
cd .local/bin
28-
for dll_file in libgmp-*.dll libmpfr-*.dll libflint*.dll
29-
do
30-
lib_name=$(basename -s .dll "${dll_file}")
31-
def_file=${lib_name}.def
32-
name=$(echo "${lib_name}" | sed 's/^lib//;s/[-.][0-9].*$//')
33-
34-
gendef "${dll_file}"
35-
llvm-lib /def:"${def_file}" /out:"../lib/${name}.lib" /machine:arm64 /nologo
36-
rm "${def_file}"
37-
done
38-
cd ../..

0 commit comments

Comments
 (0)