Skip to content

Commit fe6c79a

Browse files
committed
Improve build configuration options
1 parent 2474bee commit fe6c79a

File tree

2 files changed

+58
-35
lines changed

2 files changed

+58
-35
lines changed

snippet/cross-build

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ZLIB_BUILD() {
1414
./configure \
1515
--prefix=$PREFIX \
1616
--static
17-
make install -j$(nproc)
17+
make -j$(nproc)
18+
make install
1819
}
1920

2021
EXPAT_BUILD() {
@@ -24,9 +25,13 @@ EXPAT_BUILD() {
2425
--host=$HOST \
2526
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
2627
--prefix=$PREFIX \
27-
--enable-static=yes \
28-
--enable-shared=no
29-
make install -j$(nproc)
28+
--enable-static \
29+
--disable-shared \
30+
--without-examples \
31+
--without-tests \
32+
--without-docbook
33+
make -j$(nproc)
34+
make install
3035
}
3136

3237
C_ARES_BUILD() {
@@ -37,19 +42,20 @@ C_ARES_BUILD() {
3742
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
3843
--prefix=$PREFIX \
3944
--enable-static \
40-
--disable-shared
41-
make install -j$(nproc)
45+
--disable-shared \
46+
--disable-tests
47+
make -j$(nproc)
48+
make install
4249
}
4350

4451
OPENSSL_BUILD() {
4552
mkdir -p $BUILD_DIR/openssl && cd $BUILD_DIR/openssl
4653
curl -Ls -o - "$OPENSSL" | tar zxvf - --strip-components=1
4754
./Configure \
4855
--prefix=$PREFIX \
49-
--openssldir=ssl \
5056
$OPENSSL_ARCH \
51-
no-asm \
52-
shared
57+
no-tests
58+
make -j$(nproc)
5359
make install_sw
5460
}
5561

@@ -61,22 +67,23 @@ SQLITE3_BUILD() {
6167
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
6268
--prefix=$PREFIX \
6369
--enable-static \
64-
--enable-shared
65-
make install -j$(nproc)
70+
--disable-shared \
71+
--disable-dynamic-extensions
72+
make -j$(nproc)
73+
make install
6674
}
6775

6876
LIBSSH2_BUILD() {
6977
mkdir -p $BUILD_DIR/libssh2 && cd $BUILD_DIR/libssh2
7078
curl -Ls -o - "$LIBSSH2" | tar zxvf - --strip-components=1
71-
rm -rf $PREFIX/lib/pkgconfig/libssh2.pc
7279
./configure \
7380
--host=$HOST \
7481
--prefix=$PREFIX \
7582
--enable-static \
7683
--disable-shared \
77-
CPPFLAGS="-I$PREFIX/include" \
78-
LDFLAGS="-L$PREFIX/lib"
79-
make install -j$(nproc)
84+
--disable-examples-build
85+
make -j$(nproc)
86+
make install
8087
}
8188

8289
JEMALLOC_BUILD() {
@@ -87,17 +94,22 @@ JEMALLOC_BUILD() {
8794
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
8895
--prefix=$PREFIX \
8996
--enable-static \
90-
--enable-shared=no \
97+
--disable-shared \
9198
--disable-stats \
9299
--enable-prof
93-
make install -j$(nproc)
100+
make -j$(nproc)
101+
make install
94102
}
95103

96104
ARIA2_BUILD() {
97105
ARIA2_CODE_GET
98106
./configure \
99107
--host=$HOST \
108+
--build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) \
100109
--prefix=${ARIA2_PREFIX:-'/usr/loacl'} \
110+
--with-libz \
111+
--with-libcares \
112+
--with-libexpat \
101113
--without-libxml2 \
102114
--without-libgcrypt \
103115
--with-openssl \
@@ -109,6 +121,6 @@ ARIA2_BUILD() {
109121
--with-jemalloc \
110122
--with-ca-bundle='/etc/ssl/certs/ca-certificates.crt' \
111123
ARIA2_STATIC=yes \
112-
--enable-shared=no
124+
--disable-shared
113125
make -j$(nproc)
114126
}

snippet/target-build

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ ZLIB_BUILD() {
1414
./configure \
1515
--prefix=$PREFIX \
1616
--static
17-
make install -j$(nproc)
17+
make -j$(nproc)
18+
make install
1819
}
1920

2021
EXPAT_BUILD() {
@@ -23,8 +24,12 @@ EXPAT_BUILD() {
2324
./configure \
2425
--prefix=$PREFIX \
2526
--enable-static \
26-
--enable-shared
27-
make install -j$(nproc)
27+
--disable-shared \
28+
--without-examples \
29+
--without-tests \
30+
--without-docbook
31+
make -j$(nproc)
32+
make install
2833
}
2934

3035
C_ARES_BUILD() {
@@ -33,19 +38,20 @@ C_ARES_BUILD() {
3338
./configure \
3439
--prefix=$PREFIX \
3540
--enable-static \
36-
--disable-shared
37-
make install -j$(nproc)
41+
--disable-shared \
42+
--disable-tests
43+
make -j$(nproc)
44+
make install
3845
}
3946

4047
OPENSSL_BUILD() {
4148
mkdir -p $BUILD_DIR/openssl && cd $BUILD_DIR/openssl
4249
curl -Ls -o - "$OPENSSL" | tar zxvf - --strip-components=1
4350
./Configure \
4451
--prefix=$PREFIX \
45-
--openssldir=ssl \
4652
$OPENSSL_ARCH \
47-
no-asm \
48-
shared
53+
no-tests
54+
make -j$(nproc)
4955
make install_sw
5056
}
5157

@@ -55,21 +61,22 @@ SQLITE3_BUILD() {
5561
./configure \
5662
--prefix=$PREFIX \
5763
--enable-static \
58-
--enable-shared
59-
make install -j$(nproc)
64+
--disable-shared \
65+
--disable-dynamic-extensions
66+
make -j$(nproc)
67+
make install
6068
}
6169

6270
LIBSSH2_BUILD() {
6371
mkdir -p $BUILD_DIR/libssh2 && cd $BUILD_DIR/libssh2
6472
curl -Ls -o - "$LIBSSH2" | tar zxvf - --strip-components=1
65-
rm -rf $PREFIX/lib/pkgconfig/libssh2.pc
6673
./configure \
6774
--prefix=$PREFIX \
6875
--enable-static \
6976
--disable-shared \
70-
CPPFLAGS="-I$PREFIX/include" \
71-
LDFLAGS="-L$PREFIX/lib"
72-
make install -j$(nproc)
77+
--disable-examples-build
78+
make -j$(nproc)
79+
make install
7380
}
7481

7582
JEMALLOC_BUILD() {
@@ -78,16 +85,20 @@ JEMALLOC_BUILD() {
7885
./configure \
7986
--prefix=$PREFIX \
8087
--enable-static \
81-
--enable-shared=no \
88+
--disable-shared \
8289
--disable-stats \
8390
--enable-prof
84-
make install -j$(nproc)
91+
make -j$(nproc)
92+
make install
8593
}
8694

8795
ARIA2_BUILD() {
8896
ARIA2_CODE_GET
8997
./configure \
9098
--prefix=${ARIA2_PREFIX:-'/usr/loacl'} \
99+
--with-libz \
100+
--with-libcares \
101+
--with-libexpat \
91102
--without-libxml2 \
92103
--without-libgcrypt \
93104
--with-openssl \
@@ -99,6 +110,6 @@ ARIA2_BUILD() {
99110
--with-jemalloc \
100111
--with-ca-bundle='/etc/ssl/certs/ca-certificates.crt' \
101112
ARIA2_STATIC=yes \
102-
--enable-shared=no
113+
--disable-shared
103114
make -j$(nproc)
104115
}

0 commit comments

Comments
 (0)