Files
BMLFS/build-scripts/nasm.build
2023-10-31 19:10:11 -05:00

65 lines
2.1 KiB
Bash

#! /bin/bash
# NASM
# Source: https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/nasm-2.16.01.tar.xz
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built packages
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: NONE
# If optimizing, use these flags with GCC
export CFLAGS="-march=native -pipe "
export CFLAGS+="-O3 -ffat-lto-objects -flto=4 "
export CFLAGS="-fstack-protector-strong -fzero-call-used-regs=used "
export LDFLAGS="-flto=4 -Wl,-O2 -Wl,--as-needed "
./configure --prefix=/usr $BUILDTRUPLE &&
read -p "Compile?" && make -j2 &&
sudo -S make DESTDIR=$BUILD install &&
sudo -S mkdir -pv /BMAN/install
sudo -S mkdir -pv /BMAN/usr
sudo -S mv $BUILD/usr/share /BMAN/usr/
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
cat > /tmp/slack-desc << "EOF"
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
nasm: nasm (NASM assembler)
nasm:
nasm: NASM is the Netwide Assembler, a free portable assembler for the Intel
nasm: 80x86 microprocessor series, using primarily the traditional Intel
nasm: instruction mnemonics and syntax.
nasm:
nasm: NASM was written by Simon Tatham and Julian Hall.
nasm:
nasm:
nasm:
nasm:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/nasm-2.16.01-$PSUFFIX &&
cd /BMAN
cat > /tmp/slack-desc << "EOF"
nasm: Manuals for nasm (NASM assembler)
nasm:
nasm: NASM is the Netwide Assembler, a free portable assembler for the Intel
nasm: 80x86 microprocessor series, using primarily the traditional Intel
nasm: instruction mnemonics and syntax.
nasm:
EOF
sudo -S mv -v /tmp/slack-desc install/ &&
sudo -S makepkg -l y -c n $PKGS/nasm-doc-2.16.01-$NOPSUFFIX
sudo -S rm -rf /BMAN/*
sudo -S rm -rf ${BUILD}/*