Skip to content

Commit c355a87

Browse files
committed
abstract a bit the compile of libusb. Make the HOST customizable
1 parent 87a4b92 commit c355a87

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

DistTasks.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ tasks:
3939
4040
vars:
4141
PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_386"
42+
HOST: "i686-w64-mingw32"
4243
BUILD_LIBUSB: >
4344
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
4445
cd libusb-1.0.26/ &&
45-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=i686-w64-mingw32 &&
46+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
4647
make -j"$(nproc)" &&
4748
make install &&
4849
make distclean &&
@@ -70,10 +71,11 @@ tasks:
7071
7172
vars:
7273
PLATFORM_DIR: "{{.PROJECT_NAME}}_windows_amd64"
74+
HOST: "x86_64-w64-mingw32"
7375
BUILD_LIBUSB: >
7476
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
7577
cd libusb-1.0.26/ &&
76-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=x86_64-w64-mingw32 &&
78+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
7779
make -j"$(nproc)" &&
7880
make install &&
7981
make distclean &&
@@ -101,10 +103,11 @@ tasks:
101103
102104
vars:
103105
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd32"
106+
HOST: "i386-linux-gnu"
104107
BUILD_LIBUSB: >
105108
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
106109
cd libusb-1.0.26/ &&
107-
CFLAGS=-m32 CXXFLAGS=-m32 ./configure --with-pic --disable-udev --enable-static --disable-shared --host=i386-linux-gnu &&
110+
CFLAGS=-m32 CXXFLAGS=-m32 ./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
108111
make -j"$(nproc)" &&
109112
make install &&
110113
make distclean &&
@@ -132,10 +135,11 @@ tasks:
132135
133136
vars:
134137
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_amd64"
138+
HOST: ""
135139
BUILD_LIBUSB: >
136140
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
137141
cd libusb-1.0.26/ &&
138-
./configure --with-pic --disable-udev --enable-static --disable-shared &&
142+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
139143
make -j"$(nproc)" &&
140144
make install &&
141145
make distclean &&
@@ -163,10 +167,11 @@ tasks:
163167
164168
vars:
165169
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_7"
170+
HOST: "arm-linux-gnueabihf"
166171
BUILD_LIBUSB: >
167172
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
168173
cd libusb-1.0.26/ &&
169-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=arm-linux-gnueabihf &&
174+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
170175
make -j"$(nproc)" &&
171176
make install &&
172177
make distclean &&
@@ -194,10 +199,11 @@ tasks:
194199
195200
vars:
196201
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_6"
202+
HOST: "arm-linux-gnueabi"
197203
BUILD_LIBUSB: >
198204
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
199205
cd libusb-1.0.26/ &&
200-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=arm-linux-gnueabi &&
206+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
201207
make -j"$(nproc)" &&
202208
make install &&
203209
make distclean &&
@@ -225,10 +231,11 @@ tasks:
225231
226232
vars:
227233
PLATFORM_DIR: "{{.PROJECT_NAME}}_linux_arm_64"
234+
HOST: "aarch64-linux-gnu"
228235
BUILD_LIBUSB: >
229236
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
230237
cd libusb-1.0.26/ &&
231-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=aarch64-linux-gnu &&
238+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
232239
make -j"$(nproc)" &&
233240
make install &&
234241
make distclean &&
@@ -257,10 +264,11 @@ tasks:
257264
258265
vars:
259266
PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_amd64"
267+
HOST: "x86_64-apple-darwin20.4"
260268
BUILD_LIBUSB: >
261269
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
262270
cd libusb-1.0.26/ &&
263-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=x86_64-apple-darwin20.4 &&
271+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
264272
make -j"$(nproc)" &&
265273
make install &&
266274
make distclean &&
@@ -302,10 +310,11 @@ tasks:
302310
303311
vars:
304312
PLATFORM_DIR: "{{.PROJECT_NAME}}_osx_darwin_arm64"
313+
HOST: "aarch64-apple-darwin20.4"
305314
BUILD_LIBUSB: >
306315
curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj &&
307316
cd libusb-1.0.26/ &&
308-
./configure --with-pic --disable-udev --enable-static --disable-shared --host=aarch64-apple-darwin20.4 &&
317+
./configure --with-pic --disable-udev --enable-static --disable-shared --host={{.HOST}} &&
309318
make -j"$(nproc)" &&
310319
make install &&
311320
make distclean &&

0 commit comments

Comments
 (0)