morpheus

suckless linux distro
git clone git://git.2f30.org/morpheus
Log | Files | Refs | Submodules | README | LICENSE

commit 6cf0949e99a7b1387afa9104b344ff2bc58404c1
parent 0239116cb981aa66cc3952525d429f3b09fa1ce2
Author: sin <sin@2f30.org>
Date:   Tue,  4 Mar 2014 15:18:34 +0000

Use a case statement instead of if/else

Makes it easy to port packages to other architectures.

Diffstat:
Mpkgs/kernel | 9++++++---
Mpkgs/mpg123 | 9++++++---
Mpkgs/tinyxserver | 11+++++++----
3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/pkgs/kernel b/pkgs/kernel @@ -4,11 +4,14 @@ url="$mirror/kernel.tar.gz" build: crossmusl cd src/linux-$v cp "$top/stuff/kernel-config-$arch" .config - if test "$arch" = "x86_64"; then + case "$arch" in + x86_64) A=x86_64 - else + ;; + i486) A=x86 - fi + ;; + esac make ARCH="$A" bzImage -j$nprocs cp arch/x86/boot/bzImage "$root/boot" cp .config "$root/boot/bzImage.config" diff --git a/pkgs/mpg123 b/pkgs/mpg123 @@ -3,11 +3,14 @@ url="$mirror/mpg123-$v.tar.bz2" build: tinyalsa cd src/mpg123-$v - if test "$arch" = "x86_64"; then + case "$arch" in + x86_64) A=x86-64 - else + ;; + i486) A=x86 - fi + ;; + esac CC=$CC ./configure --prefix="$root" --with-default-audio=tinyalsa \ --enable-static=yes --enable-shared=no --with-cpu="$A" make -j$nprocs diff --git a/pkgs/tinyxserver b/pkgs/tinyxserver @@ -2,12 +2,15 @@ url="$mirror/tinyxserver.tar.gz" build: tinyxlib zlib cd src/tinyxserver - make clean - if test "$arch" = "x86_64"; then + case "$arch" in + x86_64) EXTRA_CFLAGS="-D_XSERVER64=1 $CFLAGS" - else + ;; + i486) EXTRA_CFLAGS="$CFLAGS" - fi + ;; + esac + make clean make -j$nprocs CC=$CC EXTRA_CFLAGS="$EXTRA_CFLAGS" \ FONTDIR="/usr/share/fonts" make DESTDIR="$root" BINDIR="/bin" install