|
|
@@ -8,8 +8,13 @@ CFLAGS="-static -Oz -ffunction-sections -fdata-sections -fvisibility=hidden -fom
|
|
|
LDFLAGS="-static -Oz -ffunction-sections -fdata-sections -fvisibility=hidden -fomit-frame-pointer -Wl,--gc-sections -Wl,-O2 -Wl,-s"
|
|
|
ROOTFS=/tmp/initramfs
|
|
|
|
|
|
+# Computing load values
|
|
|
+
|
|
|
+LOAD=$(nproc)
|
|
|
+JOBS=$((LOAD * 2))
|
|
|
+
|
|
|
# Step 0: Cleanup
|
|
|
-rm -rf ${ROOTFS}/*
|
|
|
+rm -rf ${ROOTFS:?}/*
|
|
|
|
|
|
# Step 1: Build musl
|
|
|
pushd musl
|
|
|
@@ -17,7 +22,7 @@ make distclean
|
|
|
CC=${CC} LD=${LD} CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
|
|
|
./configure --enable-static --disable-shared --prefix=/usr
|
|
|
CC=${CC} LD=${LD} CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
|
|
|
- make -j 24 VERBOSE=1
|
|
|
+ make -j "${JOBS}" -l "${LOAD}"
|
|
|
|
|
|
make install DESTDIR=${ROOTFS}
|
|
|
popd
|
|
|
@@ -38,24 +43,27 @@ CC="${CC}" \
|
|
|
C_INCLUDE_PATH="${ROOTFS}/usr/include" \
|
|
|
LIBRARY_PATH="${ROOTFS}/usr/lib" \
|
|
|
CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
|
|
|
- make -j 24 VERBOSE=1
|
|
|
+ make -j "${JOBS}" -l "${LOAD}"
|
|
|
|
|
|
make install DESTDIR=${ROOTFS}
|
|
|
popd
|
|
|
|
|
|
# Step 3: Build qemacs
|
|
|
pushd qemacs
|
|
|
+touch config.mak
|
|
|
make distclean
|
|
|
chmod 755 configure
|
|
|
+# shellcheck disable=SC2097,SC2098
|
|
|
CFLAGS="${CFLAGS} -I${ROOTFS}/usr/include -flto" \
|
|
|
LDFLAGS="${LDFLAGS} -L${ROOTFS}/usr/lib -flto" \
|
|
|
CC="${CC}" LD="${CC}" \
|
|
|
./configure --prefix=/usr/ --disable-x11 --disable-xv \
|
|
|
- --disable-xrender --disable-html --disable-png
|
|
|
+ --disable-xrender --disable-html --disable-png
|
|
|
+# shellcheck disable=SC2097,SC2098
|
|
|
CFLAGS="${CFLAGS} -I${ROOTFS}/usr/include -flto" \
|
|
|
LDFLAGS="${LDFLAGS} -L${ROOTFS}/usr/lib -flto" \
|
|
|
CC="${CC}" LD="${CC}" \
|
|
|
- make -j 24 VERBOSE=1
|
|
|
+ make -j "${JOBS}" -l "${LOAD}"
|
|
|
make install DESTDIR=${ROOTFS}
|
|
|
popd
|
|
|
|
|
|
@@ -66,11 +74,12 @@ cp ../bbconfig .config
|
|
|
sed -e "/CONFIG_PREFIX/s|=.*$|=\"${ROOTFS}\"|" -i .config
|
|
|
sed -e "/CONFIG_EXTRA_CFLAGS/s|=.*$|=\"${CFLAGS}\"|" -i .config
|
|
|
sed -e "/CONFIG_EXTRA_LDFLAGS/s|=.*$|=\"${LDFLAGS}\"|" -i .config
|
|
|
+# shellcheck disable=SC2097,SC2098
|
|
|
CFLAGS="${CFLAGS} -I${ROOTFS}/usr/include -flto" \
|
|
|
LDFLAGS="${LDFLAGS} -L${ROOTFS}/usr/lib -flto" \
|
|
|
CC="${CC}" LD="${CC}" \
|
|
|
- make -j 24 VERBOSE=1
|
|
|
-make -j 24 install VERBOSE=1
|
|
|
+ make -j "${JOBS}" -l "${LOAD}"
|
|
|
+make install
|
|
|
popd
|
|
|
|
|
|
# Step 5: Cleanup the resulting env
|