Build: Difference between revisions

From Braindump
Jump to navigation Jump to search
Line 169: Line 169:
=== SCCACHE ===
=== SCCACHE ===


git clone https://github.com/mozilla/sccache.git
  cargo build --release --features="dist-client dist-server"
  cargo build --release --features="dist-client dist-server"
cargo install sccache
  sudo cp target/release/sccache-dist /usr/bin/
  sudo cp target/release/sccache-dist /usr/bin/
  sccache-dist --version
  sccache-dist --version
Line 175: Line 177:


  sudo sccache-dist server --config /etc/sccache/server.conf
  sudo sccache-dist server --config /etc/sccache/server.conf
sccache -s

Revision as of 08:11, 15 February 2025

Makefile

./configure --prefix=/usr
make
sudo make install

autotools

apt install pkg-config m4 libtool automake autoconf

libtoolize --force
aclocal
autoheader
automake --force-missing --add-missing
autoconf
./configure --prefix=/opt

cmake

cmake PREFIX=/opt
sudo make install

ninja

mkdir build
cd build
cmake ..
install -H.. -B. -G Ninja

cmake -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../build//
install -H. -B../build -G Ninja
ninja -C ../build install

install -H. -B../build
make -C ../build install

LFS

https://www.linuxfromscratch.org/lfs/view/development/chapter08/introduction.html

OpenWRT

TP-Link Deco

tplink deco m9

ipq4019 arm v7

Buildroot

apt install libncurses-dev python3-matplotlib python3-numpy
su - buildroot
cd /opt
git clone https://gitlab.com/buildroot.org/buildroot.git
cd buildroot
make imx6ullevk_defconfig
make menuconfig
make
ls -la /opt/buildroot/output/images/sdcard.img
dd if=/opt/buildroot/output/images/sdcard.img of=/dev/sdd
make clean
export MPLCONFIGDIR=/tmp
make graph-build
make graph-size
make legal-info

https://buildroot.org/downloads/manual/manual.html

Yocto

https://docs.yoctoproject.org/brief-yoctoprojectqs/index.html

https://wiki.yoctoproject.org/wiki/Main_Page

https://www.youtube.com/watch?v=yuE7my3KOpo

apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool
pip list --outdated --format=json | jq -r '.[] | "\(.name)==\(.latest_version)"' | xargs -n1 pip install -U
cd /usr/src
git clone git://git.yoctoproject.org/poky
git checkout -t origin/kirkstone -b kirkstone
cd /usr/src/poky
source oe-init-build-env /opt/poky
vi config/local.conf
bitbake core-image-minimal
BB_SIGNATURE_HANDLER = "OEEquivHash"
BB_HASHSERVE = "auto"
BB_HASHSERVE_UPSTREAM = "hashserv.yocto.io:8687"
SSTATE_MIRRORS ?= "file://.* https://sstate.yoctoproject.org/all/PATH;downloadfilename=PATH"

https://github.com/mozilla/sccache/blob/main/docs/DistributedQuickstart.md

runqemu qemux86-64


apk add bash coreutils lz4 g++ make automake autoconf diffutils patch rpcgen gawk sed wget findutils git unzip texinfo gcc python3 py3-pip py3-pexpect py3-jinja2 py3-subunit file chrpath socat cpio iputils-ping zstd
wget https://invisible-island.net/datafiles/release/diffstat.tar.gz
./configure --prefix=/usr
make
make install
mkdir -p /opt/src
cd /opt/src
git clone git://git.yoctoproject.org/poky
cd poky/build
bitbake-layers add-layer ../meta-altera
su build
bash
cd /opt/src/poky
source oe-init-build-env
bitbake core-image-minimal
NOTE: Executing ACLOCAL="aclocal --system-acdir=/opt/src/poky/build/tmp/work/x86_64-linux/libtool-native/2.4.7-r0/recipe-sysroot-native/usr/share/aclocal/ --automake-acdir=/opt/src/poky/build/tmp/work/x86_64-linux/libtool-native/2.4.7-r0/recipe-sysroot-native/usr/share/aclocal-1.16" autoreconf -Wcross --verbose --install --force --exclude=libtoolize -I /opt/src/poky/build/tmp/work/x86_64-linux/libtool-native/2.4.7-r0/libtool-2.4.7/m4/ -I /opt/src/poky/build/tmp/work/x86_64-linux/libtool-native/2.4.7-r0/libtool-2.4.7/tests/
autoreconf: error: unrecognized option '--exclude=libtoolize'.

Repo

Google Android AOSP tool to manage multiple git repositories at the same time. Files are kept in a .repo directory

https://gerrit.googlesource.com/git-repo/

sudo su - yocto
mkdir -p ~/.repo/repo/
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/.repo/repo/repo
ln -s ~/.repo/repo/repo /usr/bin/repo
https://github.com/nxp-imx/imx-manifest/tree/imx-linux-scarthgap
git config --global user.email "name@company.com"
git config --global user.name "name"
git config --global url.https://github.com/.insteadOf git://github.com/
git config --global url."https://".insteadOf git://
repo init -u git://github.com/nxp-imx/imx-manifest.git -b imx-linux-scarthgap -m imx-6.6.52-2.2.0.xml
vi .repo/manifests/imx-6.6.52-2.2.0.xml
 (remove the revisions or set revision="master")
repo sync
cd /opt/nxp-imx/.repo/projects/sources/poky.git
repo --show-toplevel
repo meta-freescale -vc "git clean -f -x -d"
repo forall -vc "git clean -f -x -d"
repo forall -vc "git reset --hard"
repo abandon --all
repo forall -vc "git log --pretty=format:'%h%x09%an%x09%ad%x09%s'"
repo forall -vc "git log --pretty=format:'%h%x09%an%x09%ad%x09%s' HEAD^..HEAD"
repo --help
repo info
repo list
repo status
repo branches
repo sync
repo smartsync

NXP Yocto

https://github.com/nxp-imx/meta-imx/tree/scarthgap-6.6.52-2.2.0

repo init -u https://github.com/nxp-imx/imx-manifest.git -b imx-linux-scarthgap -m imx-6.6.52-2.2.0.xml
repo sync
repo forall -c 'git reset --hard; git clean -fdx'

SCCACHE

git clone https://github.com/mozilla/sccache.git
cargo build --release --features="dist-client dist-server"
cargo install sccache
sudo cp target/release/sccache-dist /usr/bin/
sccache-dist --version
sccache-dist scheduler --config /etc/sccache/scheduler.conf
sudo sccache-dist server --config /etc/sccache/server.conf
sccache -s