3
3
true # Dummy command required to prevent first ShellCheck directive from having global scope.
4
4
5
5
# shellcheck disable=SC2153 # Fix false positive of ShellCheck rule SC2153.
6
- export PREFIX=/opt/lib/${CROSS_COMPILE}
6
+
7
+ LIB_PATH=${LIB_PATH:-/ opt/ lib}
8
+ NPROC=${NPROC:- " $( nproc) " }
9
+ export PREFIX=${PREFIX:-/ opt/ lib/ ${CROSS_COMPILE} }
7
10
8
11
if [ " $CROSS_COMPILER " == " " ]; then
9
12
CROSS_COMPILER=${CROSS_COMPILE} -gcc
15
18
CROSS_COMPILER=$CC
16
19
# CROSS_COMPILER_CXX=$CXX
17
20
fi
18
- cd /opt/lib /libusb-1.0.28
21
+ cd ${LIB_PATH} /libusb-1.0.28
19
22
LIBUSB_DIR=$( pwd)
20
23
export LIBUSB_DIR
21
24
./configure --prefix=" ${PREFIX} " --with-pic --disable-udev --enable-static --disable-shared --host=" ${CROSS_COMPILE} "
22
25
make distclean
23
26
./configure --prefix=" ${PREFIX} " --with-pic --disable-udev --enable-static --disable-shared --host=" ${CROSS_COMPILE} "
24
- make -j" $( nproc ) "
27
+ make -j${NPROC}
25
28
make install
26
29
27
30
export PKG_CONFIG_PATH=$PREFIX /lib/pkgconfig
@@ -30,16 +33,16 @@ if [[ $CROSS_COMPILE == "x86_64-apple-darwin13" ]]; then
30
33
export LIBUSB_1_0_CFLAGS=-I${PREFIX} /include/libusb-1.0
31
34
export LIBUSB_1_0_LIBS=" -L${PREFIX} /lib -lusb-1.0"
32
35
fi
33
- cd /opt/lib /libusb-compat-0.1.8
36
+ cd ${LIB_PATH} /libusb-compat-0.1.8
34
37
LIBUSB0_DIR=$( pwd)
35
38
export LIBUSB0_DIR
36
39
PKG_CONFIG_PATH=" $PREFIX /lib/pkgconfig" ./configure --prefix=" ${PREFIX} " --enable-static --disable-shared --host=" ${CROSS_COMPILE} "
37
40
make distclean
38
41
PKG_CONFIG_PATH=" $PREFIX /lib/pkgconfig" ./configure --prefix=" ${PREFIX} " --enable-static --disable-shared --host=" ${CROSS_COMPILE} "
39
- make -j" $( nproc ) "
42
+ make -j${NPROC}
40
43
make install
41
44
42
- cd /opt/lib /libftdi1-1.4
45
+ cd ${LIB_PATH} /libftdi1-1.4
43
46
rm -rf build && mkdir build && cd build
44
47
45
48
CMAKE_EXTRA_FLAG=" -DSHAREDLIBS=OFF -DBUILD_TESTS=OFF -DPYTHON_BINDINGS=OFF -DEXAMPLES=OFF -DFTDI_EEPROM=OFF"
57
60
# make -j"$(nproc)"
58
61
# make install
59
62
60
- cd /opt/lib /libelf-0.8.13
63
+ cd ${LIB_PATH} /libelf-0.8.13
61
64
LIBELF_DIR=$( pwd)
62
65
export LIBELF_DIR
63
66
./configure --disable-shared --host=" $CROSS_COMPILE " --prefix=" ${PREFIX} "
64
67
make distclean
65
68
./configure --disable-shared --host=" $CROSS_COMPILE " --prefix=" ${PREFIX} "
66
- make -j" $( nproc ) "
69
+ make -j${NPROC}
67
70
make install
68
71
69
72
echo " *****************"
@@ -72,47 +75,48 @@ echo "*****************"
72
75
73
76
export CPPFLAGS=" -P"
74
77
75
- cd /opt/lib /ncurses-6.3
78
+ cd ${LIB_PATH} /ncurses-6.3
76
79
NCURSES_DIR=$( pwd)
77
80
export NCURSES_DIR
78
81
79
82
./configure " $EXTRAFLAGS " --target=" $CROSS_COMPILE " --without-pthread --enable-database --enable-sp-funcs --enable-term-driver --without-shared --without-debug --without-ada --enable-termcap --without-manpages --without-progs --without-tests --host=" $CROSS_COMPILE " --prefix=" ${PREFIX} "
80
83
make distclean
81
84
./configure " $EXTRAFLAGS " --target=" $CROSS_COMPILE " --without-pthread --enable-database --enable-sp-funcs --enable-term-driver --without-shared --without-debug --without-ada --enable-termcap --without-manpages --without-progs --without-tests --host=" $CROSS_COMPILE " --prefix=" ${PREFIX} "
82
- make -j" $( nproc ) "
85
+ make -j${NPROC}
83
86
make install.libs
84
87
85
- cd /opt/lib /readline-8.0
88
+ cd ${LIB_PATH} /readline-8.0
86
89
READLINE_DIR=$( pwd)
87
90
export READLINE_DIR
88
91
./configure --prefix=" $PREFIX " --disable-shared --host=" $CROSS_COMPILE "
89
92
make distclean
90
93
./configure --prefix=" $PREFIX " --disable-shared --host=" $CROSS_COMPILE "
91
- make -j" $( nproc ) "
94
+ make -j${NPROC}
92
95
make install-static
93
96
94
- if [[ $CROSS_COMPILE != " i686-w64-mingw32" && $CROSS_COMPILE != " x86_64-apple-darwin13" ]]; then
95
- cd /opt/lib /eudev-3.2.10
97
+ if [[ $CROSS_COMPILE != " i686-w64-mingw32" && $CROSS_COMPILE != " x86_64-apple-darwin13" && $CROSS_COMPILE != " aarch64-apple-darwin " ]]; then
98
+ cd ${LIB_PATH} /eudev-3.2.10
96
99
./autogen.sh
97
100
./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=" $PREFIX " --host=" ${CROSS_COMPILE} "
98
101
make distclean
99
102
./autogen.sh
100
103
./configure --enable-static --disable-gudev --disable-introspection --disable-shared --disable-blkid --disable-kmod --disable-manpages --prefix=" $PREFIX " --host=" ${CROSS_COMPILE} "
101
- make -j" $( nproc ) "
104
+ make -j${NPROC}
102
105
make install
103
106
fi
104
107
105
- cd /opt/lib /hidapi-0.12.0
108
+ cd ${LIB_PATH} /hidapi-0.12.0
106
109
export PKG_CONFIG_PATH=$PREFIX /lib/pkgconfig
110
+ libtoolize
107
111
./bootstrap
108
112
./configure --prefix=" $PREFIX " --enable-static --disable-shared --host=" $CROSS_COMPILE "
109
113
make distclean
110
114
./bootstrap
111
115
./configure --prefix=" $PREFIX " --enable-static --disable-shared --host=" $CROSS_COMPILE "
112
- make -j" $( nproc ) "
116
+ make -j${NPROC}
113
117
make install
114
118
115
- tar -xzf /opt/lib /libxml2-2.14.3.tar.gz -C /tmp && cd /tmp/libxml2-2.14.3
119
+ tar -xzf ${LIB_PATH} /libxml2-2.14.3.tar.gz -C /tmp && cd /tmp/libxml2-2.14.3
116
120
./autogen.sh --prefix=" $PREFIX " --disable-shared --enable-static --without-python --without-iconv --host=" $CROSS_COMPILE "
117
- make -j" $( nproc ) "
121
+ make -j${NPROC}
118
122
make install
0 commit comments