Skip to content

Instantly share code, notes, and snippets.

@Leandros
Created February 24, 2018 17:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Leandros/252e051ef30e8799e686d8cf8b4b6348 to your computer and use it in GitHub Desktop.
Save Leandros/252e051ef30e8799e686d8cf8b4b6348 to your computer and use it in GitHub Desktop.
Compile NASM
#!/bin/bash
export PATH=$PATH:$HOME/x86_64-linux-musl/bin
export CC=x86_64-linux-musl-gcc
export CXX=x86_64-linux-musl-g++
# If needed
export CC="$CC -static --static"
export CXX="$CXX -static --static"
function get {
local url=$1
local suffix=$2
local filename=$(basename $url)
local dirname=$(basename $filename $suffix)
wget -nc $url
rm -rf $dirname
tar xf $filename
pushd $dirname
}
get "http://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.xz" ".tar.xz"
./configure \
--prefix="$(realpath output)"
make -j$(nproc)
make install
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment