cpt

[ARCHIVED] Carbs Packaging Tools
git clone git://git.ckyln.com/~cem/cpt.git
Log | Files | Refs | README | LICENSE

commit c9c41e4b3ccddb23214ecfd43debe60118ee7efd
parent 19af4eecbfcf54b8c9ee170c6c27e4677cb574af
Author: Cem Keylan <cem@ckyln.com>
Date:   Fri, 29 May 2020 19:56:13 +0300

kiss-chroot: set CFLAGS based on architecture

Diffstat:
Mcontrib/kiss-chroot | 12++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/contrib/kiss-chroot b/contrib/kiss-chroot @@ -29,6 +29,14 @@ main() { [ -d "$1" ] || die Given path does not exist [ "$(id -u)" = 0 ] || die Script needs to be run as root + [ "$2" ] || { + march=$(uname -m 2>/dev/null) ||: + case "$march" in + '') march=native ;; + i*86) march=i686 ;; + esac + } + trap 'clean "$1"' EXIT INT log Mounting /dev, /proc and /sys from host; { @@ -49,8 +57,8 @@ main() { SHELL=/bin/sh \ USER=root \ KISS_ASROOT=1 \ - CFLAGS="${2:--march=x86-64 -mtune=generic -pipe -Os}" \ - CXXFLAGS="${2:--march=x86-64 -mtune=generic -pipe -Os}" \ + CFLAGS="${2:--march=$march -mtune=generic -pipe -Os}" \ + CXXFLAGS="${2:--march=$march -mtune=generic -pipe -Os}" \ MAKEFLAGS="-j$(nproc 2>/dev/null || echo 1)" \ /bin/sh -l }