Commit 4ead0d71 authored by Bernhard Landauer's avatar Bernhard Landauer
Browse files

add multilib support

parent 452403d9
......@@ -8,7 +8,7 @@ trap 'abort "Aborted."' INT
get_pkg_dir
get_default_branch
while getopts "b:cdghi:k:l:np:r:sux" arg; do
while getopts "b:cdghi:k:l:mnp:r:sux" arg; do
case "${arg}" in
b) BRANCH="${OPTARG}" ;;
c) CLEAN=true ;;
......@@ -17,6 +17,7 @@ while getopts "b:cdghi:k:l:np:r:sux" arg; do
i) install_pkgs+=("${OPTARG}") ;;
k) custom_repo="${OPTARG}" ;;
l) lists+=("${OPTARG}"); INSTALL=true ;;
m) MULTILIB=true ;;
n) INSTALL=true ;;
p) pkgs+=("${OPTARG}") ;;
r) CHROOT_DIR="${OPTARG}" ;;
......
......@@ -81,6 +81,7 @@ create_chroot() {
msg "Install build environment"
conf_pacman
pacman -r $1 --config ${PAC_CONF} -Syy base-devel --noconfirm || abort "Failed to install chroot filesystem."
[[ ${MULTILIB} = true ]] && pacman -r $1 --config ${PAC_CONF} -Syy multilib-devel --noconfirm
msg "Copy keyring"
cp -a /etc/pacman.d/gnupg "$1/etc/pacman.d/"
msg "Create locale"
......@@ -122,6 +123,19 @@ EOF
echo "$x" >>"$1/${MP_CONF_GLOB}"
done
if [[ ${MULTILIB} = true ]]; then
CARCH="i686"
CHOST="i686-unknown-linux-gnu"
CFLAGS="-m32 -march=i686 -mtune=generic -O2 -pipe"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-m32 -Wl,-O1,--sort-common,--as-needed,-z,relro"
for x in CARCH=${CARCH} CHOST=${CHOST} CFLAGS=${CFLAGS} CXXFLAGS=${CXXFLAGS} LDFLAGS=${LDFLAGS}
do
grep -q "^$x" "$1/${MP_CONF_GLOB}" && continue
echo "$x" >>"$1/${MP_CONF_GLOB}"
done
fi
# install buildscript
install -m755 /etc/chrootbuild/build.sh "$1/usr/bin/chrootbuild"
......
......@@ -15,6 +15,7 @@ PUSH_GIT=false
INSTALL=false
UPDATE=false
SIGN=false
MULTILIB=false
MIRROR='https://repo.manjaro.org/repo'
MIRROR_CONF=etc/pacman-mirrors.conf
COLORS=true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment