From 2ab1bc3a293c6b7c9cd641ca710f2b628c0e1cb3 Mon Sep 17 00:00:00 2001 From: pkr Date: Thu, 5 Dec 2024 19:11:21 +0100 Subject: [PATCH] Build qt6 with -O3 -pipe -march=native and added window and display manager build --- libs/func_general.sh | 55 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/libs/func_general.sh b/libs/func_general.sh index 9608130..79b5221 100644 --- a/libs/func_general.sh +++ b/libs/func_general.sh @@ -256,8 +256,8 @@ BUILD_SUBDIRS=y # Optimization JOBS=0 -CFG_CFLAGS=" -O2 -pipe " -CFG_CXXFLAGS=" -O2 -pipe " +CFG_CFLAGS=" -O3 -pipe -march=native " +CFG_CXXFLAGS=" -O3 -pipe -march=native " CFG_LDFLAGS="EMPTY" EOF } @@ -317,6 +317,51 @@ EOF } +# Creates the blfs configuration file to build window and display managers. +# For now we use openbox as window manager and sddm as display manager. +# The only parameter should be the new LFS system's root folder. +_create_blfs_config_dm() +{ + # Check parameter + local dir_lfs="$(realpath "$1")" + if [ ! -d "$dir_lfs" ] ; then + echo "Invalid folder: $dir_lfs" + return 1 + fi + + # Create new blfs config + local dir_blfscfg="$dir_lfs/home/pkr/blfs_root/configuration" + if [ -f "$dir_blfscfg" ] ; then + sudo rm -fv "$dir_blfscfg" || return 1 + fi + + cat > "$dir_blfscfg" << EOF +CONFIG_openbox=y +CONFIG_sddm=y + +# Build settings +MS_sendmail=y +MAIL_SERVER="sendmail" +DEPLVL_2=y +optDependency=2 +LANGUAGE="hu_HU.UTF-8" +SUDO=y +DEL_LA_FILES=y + +# Build Layout +SRC_ARCHIVE="/sources" +BUILD_ROOT="/sources" +BUILD_SUBDIRS=y + +# Optimization +JOBS=0 +CFG_CFLAGS=" -O3 -pipe -march=native " +CFG_CXXFLAGS=" -O3 -pipe -march=native " +CFG_LDFLAGS="EMPTY" +EOF +} + + # Creates script that auto builds the blfs system after successfull lfs build _create_blfs_builder_script() { @@ -366,6 +411,12 @@ _build_blfs() make <<< yes && cd "$dir_blfs_work" && ../gen-makefile.sh && + make && + cd "$dir_blfs_root" && + sed -i -E "s/_create_blfs_config_lxqt/_create_blfs_config_dm/g" "$dir_blfs_root/Makefile" && + make <<< yes && + cd "$dir_blfs_work" && + ../gen-makefile.sh && make sudo shutdown --poweroff +1 )}