Files
BMLFS/build-scripts/pcre2.build
2021-08-25 12:13:55 -05:00

70 lines
2.3 KiB
Bash

#! /bin/bash
# PCRE2
# Source: https://ftp.pcre.org/pub/pcre/pcre2-10.37.tar.bz2
#
# $BUILD = Directory to temporarily install
# $PKGS = Directory to store built package
#
# DEPS
# Required: NONE
# Recommended: NONE
# Optional: libedit, valgrind
# LTO: Tested with GCC=Binutils
# If coptimizing:
export CFLAGS="-march=native -mtune=native -pipe "
export CFLAGS+="-O3 -Ofast -falign-functions=32 "
export CFLAGS+="-ffat-lto-objects -flto=auto "
export CFLAGS+="-fno-semantic-interposition -mprefer-vector-width=256 "
export LDFLAGS="-flto=auto -Wl,-O2 -Wl,--as-needed "
./configure --prefix=/usr \
--docdir=/usr/share/doc/pcre2-10.37 \
--enable-unicode \
--enable-jit \
--enable-pcre2-16 \
--enable-pcre2-32 \
--enable-pcre2grep-libz \
--enable-pcre2grep-libbz2 \
--enable-pcre2test-libreadline \
--disable-static $BUILDTRUPLE &&
read -p "Compile? " && make -j2 &&
read -p "Press Enter to install" &&
# if not using a package manager:
# make install
# if using pkgtools from Slackware, then:
sudo -S make DESTDIR=$BUILD install &&
read -p "Press Enter to create package description." &&
cd $BUILD && sudo mkdir -v 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 ':'.
|-----handy-ruler------------------------------------------------------|
pcre2: pcre2 (Perl Compatible Regular Expression Libraries)
pcre2:
pcre2: The PCRE2 package contains a new generation of the Perl Compatible
pcre2: Regular Expression libraries. These are useful for implementing
pcre2: regular expression pattern matching using the same syntax and
pcre2: semantics as Perl.
pcre2:
pcre2:
pcre2:
pcre2:
pcre2:
EOF
sudo mv /tmp/slack-desc install/ &&
read -p "Enter to build package" &&
sudo makepkg -l y -c n $PKGS/pcre2-10.37-$(uname -m)-mlfs.txz &&
sudo rm -rf $BUILD/*