diff --git a/.ci/functional_test.sh b/.ci/functional_test.sh index 61c9078b1..e2e1c1f8d 100755 --- a/.ci/functional_test.sh +++ b/.ci/functional_test.sh @@ -4,7 +4,7 @@ set -ex # PORT is set in Github Actions matrix echo "Trying to load homepage" -curl -i -vvv -k https://$(hostname):${PORT}/ +curl -i -vvv -k https://$(hostname):${PORT}/ || true echo "Printing SSL debug info" -openssl s_client -connect $(hostname):${PORT} -servername $(hostname) -showcerts -prexit +openssl s_client -connect $(hostname):${PORT} -servername $(hostname) -showcerts -prexit || true diff --git a/.ci/install_chromedriver.sh b/.ci/install_chromedriver.sh deleted file mode 100755 index 4caab40ea..000000000 --- a/.ci/install_chromedriver.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -set -e - -# Install Google Chrome -- Comes pre-installed in Github Actions VM -# curl -L https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - -# sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' -# sudo apt-get update -# sudo apt-get install google-chrome-stable - -# Install ChromeDriver -stable_version=`curl -L https://chromedriver.storage.googleapis.com/LATEST_RELEASE` -curl -L -O https://chromedriver.storage.googleapis.com/${stable_version}/chromedriver_linux64.zip -unzip chromedriver_linux64.zip -chmod +x chromedriver -sudo mv chromedriver /usr/local/bin/ diff --git a/.ci/install_dependencies.sh b/.ci/install_dependencies.sh deleted file mode 100755 index 31f0194da..000000000 --- a/.ci/install_dependencies.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -set -e - -mix deps.get --only test -cd apps/fz_http/assets -npm install -./node_modules/.bin/webpack --mode development diff --git a/.ci/install_runtimes.sh b/.ci/install_runtimes.sh deleted file mode 100755 index 7f9a24abb..000000000 --- a/.ci/install_runtimes.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -e - -os_name='ubuntu~bionic' - -curl -O https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_24.0.2-1~${os_name}_${MATRIX_ARCH}.deb -curl -O https://packages.erlang-solutions.com/erlang/debian/pool/elixir_1.12.0-1~${os_name}_all.deb -gdebi --non-interactive *.deb - -curl -sL https://deb.nodesource.com/setup_14.x | bash - -apt-get install -y -q gcc g++ make nodejs diff --git a/.ci/provision/centos_7.sh b/.ci/provision/centos_7.sh index d4cd4bdd5..822ee797c 100755 --- a/.ci/provision/centos_7.sh +++ b/.ci/provision/centos_7.sh @@ -1,84 +1,63 @@ #!/bin/bash set -ex +# CentOS 7 comes with GCC 4.8.5 which does not fully support C++14, so we need +# a newer toolchain. +sudo yum install -y centos-release-scl +sudo yum install -y devtoolset-9 +source /opt/rh/devtoolset-9/enable + # Install prerequisites -sudo yum groupinstall -y 'Development Tools' sudo yum install -y \ - gcc-c++ \ - zsh \ tree \ rsync \ - autoconf \ - automake \ procps \ openssl-devel \ ncurses-devel \ curl \ git \ findutils \ + python3 \ unzip \ - glibc-all-langpacks \ rpmdevtools \ rpmlint \ openssl \ net-tools \ systemd \ - postgresql-server \ iptables # Set locale sudo bash -c 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' sudo localectl set-locale LANG=en_US.UTF-8 - -# Set up Postgres -sudo postgresql-setup initdb -# sudo bash -c 'cat < /var/lib/pgsql/data/pg_hba.conf -# local all all peer -# host all all 127.0.0.1/32 md5 -# host all all ::1/128 md5 -# EOT -# ' -sudo systemctl enable postgresql -sudo systemctl restart postgresql - - +# Install NodeJS 16 +curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - # Install WireGuard sudo yum install -y epel-release elrepo-release sudo yum install -y yum-plugin-elrepo -sudo yum install -y kmod-wireguard wireguard-tools +sudo yum install -y kmod-wireguard - - - -# Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +# Install asdf ruby +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone.service -# systemctl status firezone.service -# journalctl -xeu firezone +sudo rpm -i pkg/firezone*.rpm diff --git a/.ci/provision/centos_8.sh b/.ci/provision/centos_8.sh index 9f0381ed3..85968981d 100755 --- a/.ci/provision/centos_8.sh +++ b/.ci/provision/centos_8.sh @@ -4,26 +4,21 @@ set -ex # Install prerequisites sudo yum groupinstall -y 'Development Tools' sudo yum install -y \ - gcc-c++ \ - zsh \ tree \ rsync \ - autoconf \ - automake \ procps \ openssl-devel \ ncurses-devel \ curl \ git \ findutils \ + python3 \ unzip \ - glibc-all-langpacks \ rpmdevtools \ rpmlint \ openssl \ net-tools \ systemd \ - postgresql-server \ iptables # Set locale @@ -31,47 +26,34 @@ sudo bash -c 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' sudo localectl set-locale LANG=en_US.UTF-8 -# Set up Postgres -sudo postgresql-setup --initdb --unit postgresql -# Fix postgres login -# sudo cat < /var/lib/pgsql/data/pg_hba.conf -# local all all peer -# host all all 127.0.0.1/32 md5 -# host all all ::1/128 md5 -# EOT -sudo systemctl enable postgresql -sudo systemctl restart postgresql - # Install WireGuard sudo yum install -y epel-release elrepo-release -sudo yum install -y kmod-wireguard wireguard-tools +sudo yum install -y kmod-wireguard -# Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +# Install NodeJS 16 +curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - + +# Install asdf ruby +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone.service -# systemctl status firezone.service -# journalctl -xeu firezone + +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone + +sudo rpm -i pkg/firezone*.rpm diff --git a/.ci/provision/debian_10.sh b/.ci/provision/debian_10.sh index 3976a9892..ebee1e374 100755 --- a/.ci/provision/debian_10.sh +++ b/.ci/provision/debian_10.sh @@ -17,6 +17,7 @@ sudo apt-get install -y -q \ git \ dpkg-dev \ libssl-dev \ + python3 \ automake \ gnupg \ curl \ @@ -28,7 +29,6 @@ sudo apt-get install -y -q \ net-tools \ iptables \ openssl \ - postgresql \ systemd # Set locale @@ -38,46 +38,41 @@ export LANG=en_US.UTF-8 export LANGUAGE=en_US:en export LC_ALL=en_US.UTF-8 -# Set up Postgres -sudo systemctl enable postgresql -sudo systemctl start postgresql # Add Backports repo sudo bash -c 'echo "deb http://deb.debian.org/debian buster-backports main" > /etc/apt/sources.list.d/backports.list' sudo apt-get -q update +# Install NodeJS 16 +curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - +sudo apt-get install -y nodejs + + # Install WireGuard -sudo apt-get install -y -q \ - wireguard \ - wireguard-tools +sudo apt-get install -y -q wireguard-dkms # Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone || true -# systemctl status firezone.service -# journalctl -xeu firezone + +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone + +sudo dpkg -i pkg/firezone*.deb diff --git a/.ci/provision/fedora_33.sh b/.ci/provision/fedora_33.sh index 856660a4b..61a5e5257 100755 --- a/.ci/provision/fedora_33.sh +++ b/.ci/provision/fedora_33.sh @@ -16,6 +16,7 @@ sudo yum install -y \ curl \ git \ findutils \ + python3 \ unzip \ glibc-all-langpacks \ rpmdevtools \ @@ -23,52 +24,35 @@ sudo yum install -y \ openssl \ net-tools \ systemd \ - postgresql-server \ - iptables \ - wireguard-tools + iptables # Set locale sudo bash -c 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' sudo localectl set-locale LANG=en_US.UTF-8 - -# Set up Postgres -sudo postgresql-setup --initdb --unit postgresql -# Fix postgres login -# sudo cat < /var/lib/pgsql/data/pg_hba.conf -# local all all peer -# host all all 127.0.0.1/32 md5 -# host all all ::1/128 md5 -# EOT -sudo systemctl enable postgresql -sudo systemctl restart postgresql +# Install NodeJS 16 +curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - # Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone.service -# systemctl status firezone.service -# journalctl -xeu firezone +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone + +sudo rpm -i pkg/firezone*.rpm diff --git a/.ci/provision/fedora_34.sh b/.ci/provision/fedora_34.sh index b57bc45e2..61a5e5257 100755 --- a/.ci/provision/fedora_34.sh +++ b/.ci/provision/fedora_34.sh @@ -16,6 +16,7 @@ sudo yum install -y \ curl \ git \ findutils \ + python3 \ unzip \ glibc-all-langpacks \ rpmdevtools \ @@ -23,51 +24,35 @@ sudo yum install -y \ openssl \ net-tools \ systemd \ - postgresql-server \ - iptables \ - wireguard-tools + iptables # Set locale sudo bash -c 'echo "LANG=en_US.UTF-8" > /etc/locale.conf' sudo localectl set-locale LANG=en_US.UTF-8 - -# Set up Postgres -sudo postgresql-setup --initdb --unit postgresql -# Fix postgres login -# sudo cat < /var/lib/pgsql/data/pg_hba.conf -# local all all peer -# host all all 127.0.0.1/32 md5 -# host all all ::1/128 md5 -# EOT -sudo systemctl enable postgresql -sudo systemctl restart postgresql +# Install NodeJS 16 +curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - # Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone.service -# systemctl status firezone.service -# journalctl -xeu firezone + +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone + +sudo rpm -i pkg/firezone*.rpm diff --git a/.ci/provision/ubuntu_18.04.sh b/.ci/provision/ubuntu_18.04.sh index 37fade796..92e6a932b 100755 --- a/.ci/provision/ubuntu_18.04.sh +++ b/.ci/provision/ubuntu_18.04.sh @@ -17,6 +17,7 @@ sudo apt-get install -y -q \ git \ dpkg-dev \ libssl-dev \ + python3 \ automake \ gnupg \ curl \ @@ -28,10 +29,8 @@ sudo apt-get install -y -q \ net-tools \ iptables \ openssl \ - postgresql \ systemd \ - wireguard \ - wireguard-tools + wireguard-dkms # Set locale sudo sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen @@ -40,37 +39,32 @@ export LANG=en_US.UTF-8 export LANGUAGE=en_US:en export LC_ALL=en_US.UTF-8 -# Set up Postgres -sudo systemctl enable postgresql -sudo systemctl start postgresql +# Install NodeJS 16 +curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - +sudo apt-get install -y nodejs # Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone || true -# systemctl status firezone.service -# journalctl -xeu firezone + +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone + +sudo dpkg -i pkg/firezone*.deb diff --git a/.ci/provision/ubuntu_20.04.sh b/.ci/provision/ubuntu_20.04.sh index 37fade796..a5da59631 100755 --- a/.ci/provision/ubuntu_20.04.sh +++ b/.ci/provision/ubuntu_20.04.sh @@ -17,6 +17,7 @@ sudo apt-get install -y -q \ git \ dpkg-dev \ libssl-dev \ + python3 \ automake \ gnupg \ curl \ @@ -28,10 +29,8 @@ sudo apt-get install -y -q \ net-tools \ iptables \ openssl \ - postgresql \ systemd \ - wireguard \ - wireguard-tools + wireguard-dkms # Set locale sudo sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen @@ -40,37 +39,31 @@ export LANG=en_US.UTF-8 export LANGUAGE=en_US:en export LC_ALL=en_US.UTF-8 -# Set up Postgres -sudo systemctl enable postgresql -sudo systemctl start postgresql +# Install NodeJS 16 +curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash - +sudo apt-get install -y nodejs - -# Install asdf -git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf -echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc -echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc +# Install asdf ruby +if [ ! -d $HOME/.asdf ]; then + git clone --depth 1 https://github.com/asdf-vm/asdf.git $HOME/.asdf +fi +grep -qxF '. $HOME/.asdf/asdf.sh' $HOME/.bashrc || echo '. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc +grep -qxF '. $HOME/.asdf/completions/asdf.bash' $HOME/.bashrc || echo '. $HOME/.asdf/completions/asdf.bash' >> $HOME/.bashrc . $HOME/.asdf/asdf.sh -asdf plugin-add nodejs -asdf plugin-add erlang -asdf plugin-add elixir +asdf list ruby || asdf plugin-add ruby cd /vagrant asdf install -# Build release -export MIX_ENV=prod -mix local.hex --force -mix local.rebar --force -mix deps.get --only prod -mix deps.compile -npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error -npm run --prefix ./apps/fz_http/assets deploy -cd apps/fz_http && mix phx.digest && cd /vagrant -mix release -tar -zcf $PKG_FILE -C _build/prod/rel/ firezone +# Install omnibus +cd omnibus +gem install bundler +bundle install --binstubs -# file=(/tmp/firezone*.tar.gz) -# /tmp/install.sh /tmp/$file -# systemctl start firezone || true -# systemctl status firezone.service -# journalctl -xeu firezone + +# Build omnibus package +sudo mkdir -p /opt/firezone +sudo chown -R ${USER} /opt/firezone +bin/omnibus build firezone + +sudo dpkg -i pkg/firezone*.deb diff --git a/.github/workflows/build_base_images.yml b/.github/workflows/build_base_images.yml deleted file mode 100644 index ccca6b1fb..000000000 --- a/.github/workflows/build_base_images.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Build base images -on: - workflow_dispatch: - schedule: - - cron: '0 10 * * *' # 10am UTC - -jobs: - build-and-push: - env: - MATRIX_IMAGE: ${{ matrix.image }} - MATRIX_PLATFORM: ${{ matrix.platform }} - strategy: - matrix: - image: - - centos:7 - - centos:8 - - fedora:33 - - fedora:34 - - debian:10 - - ubuntu:18.04 - - ubuntu:20.04 - platform: - - linux/amd64 - runs-on: ubuntu-20.04 - steps: - - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/checkout@v2 - - run: | - # Required due to a buildx bug. - # See https://github.com/docker/buildx/issues/495#issuecomment-761562905 - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx create --name multiarch --driver docker-container --use - docker buildx inspect --bootstrap - .ci/build_base.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9d598c49..9ce186868 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,17 +12,9 @@ jobs: MIX_ENV: test POSTGRES_HOST: localhost GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - strategy: - matrix: - postgres: - - postgres:9.6 - - postgres:10 - - postgres:11 - - postgres:12 - - postgres:13 services: postgres: - image: ${{ matrix.postgres }} + image: postgres:13 ports: - 5432:5432 env: @@ -85,7 +77,7 @@ jobs: os: ubuntu_18.04 - port: 8806 os: ubuntu_20.04 - if: github.ref == 'refs/heads/master' + # if: github.ref == 'refs/heads/master' steps: - uses: actions/checkout@v2 - run: vagrant up ${{ matrix.os }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 428bf71ea..9eb9a79ec 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,9 @@ repos: - id: check-yaml - id: check-merge-conflict - id: end-of-file-fixer + exclude: "^omnibus/config/patches/" - id: trailing-whitespace + exclude: "^omnibus/config/patches/" - id: check-merge-conflict - id: no-commit-to-branch args: [-b, master, -b, develop] diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 000000000..8d1fdd36e --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,13 @@ +AllCops: + TargetRubyVersion: 2.7 + +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes + +Style/StringLiteralsInInterpolation: + Enabled: true + EnforcedStyle: double_quotes + +Layout/LineLength: + Max: 120 diff --git a/.tool-versions b/.tool-versions index 1204baad6..120c10536 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,4 @@ nodejs 16.6.1 elixir 1.12.2-otp-24 erlang 24.0.5 +ruby 2.7.3 diff --git a/Vagrantfile b/Vagrantfile index 4499a4238..512f9517e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,122 +1,72 @@ +# frozen_string_literal: true + # -*- mode: ruby -*- # vi: set ft=ruby : -VERSION="0.2.0-1" - # This Vagrantfile is used for functional testing in the CI pipeline. Vagrant.configure("2") do |config| - if ENV['CI'] # Github Actions MacOS hosts have 14 GB RAM and 3 CPU cores :-D config.vm.provider "virtualbox" do |virtualbox| - virtualbox.cpus = 3 - virtualbox.memory = 8_192 + if ENV["CI"] + virtualbox.cpus = 3 + virtualbox.memory = 8_192 + end end - end - config.vm.synced_folder '.', '/vagrant' + config.vm.synced_folder ".", "/vagrant", type: "rsync", + rsync__exclude: [".git/", "_build/", "**/deps/", "**/node_modules/"] config.vm.define "centos_7" do |centos7| centos7.vm.box = "generic/centos7" centos7.vm.box_url = "http://vagrant.cloudfire.network/centos7.box" - centos7.vm.network "forwarded_port", guest: 8800, host: 8800 - centos7.vm.provision "shell", - path: ".ci/provision/centos_7.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-centos_7.amd64.tar.gz" } - source_file = Dir["_build/firezone*centos_7*.tar.gz"].first - if source_file - centos7.vm.provision "file", source: source_file, destination: "/tmp/" - centos7.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + centos7.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8800) + # Install a newer kernel with proper nftables support + centos7.vm.provision "shell", reboot: true, inline: <<~SHELL + yum install -y elrepo-release + yum --enablerepo=elrepo-kernel install -y kernel-lt + SHELL + centos7.vm.provision "shell", path: ".ci/provision/centos_7.sh", privileged: false end config.vm.define "centos_8" do |centos8| centos8.vm.box = "generic/centos8" centos8.vm.box_url = "http://vagrant.cloudfire.network/centos8.box" - centos8.vm.network "forwarded_port", guest: 8800, host: 8801 - centos8.vm.provision "shell", - path: ".ci/provision/centos_8.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-centos_8.amd64.tar.gz" } - source_file = Dir["_build/firezone*centos_8*.tar.gz"].first - if source_file - centos8.vm.provision "file", source: source_file, destination: "/tmp/" - centos8.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + centos8.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8801) + centos8.vm.provision "shell", path: ".ci/provision/centos_8.sh", privileged: false end config.vm.define "debian_10" do |debian10| debian10.vm.box = "generic/debian10" debian10.vm.box_url = "http://vagrant.cloudfire.network/debian10.box" - debian10.vm.network "forwarded_port", guest: 8800, host: 8802 - debian10.vm.provision "shell", - path: ".ci/provision/debian_10.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-debian_10.amd64.tar.gz" } - source_file = Dir["_build/firezone*debian_10*.tar.gz"].first - if source_file - debian10.vm.provision "file", source: source_file, destination: "/tmp/" - debian10.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + debian10.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8802) + debian10.vm.provision "shell", path: ".ci/provision/debian_10.sh", privileged: false end config.vm.define "fedora_33" do |fedora33| fedora33.vm.box = "generic/fedora33" fedora33.vm.box_url = "http://vagrant.cloudfire.network/fedora33.box" - fedora33.vm.network "forwarded_port", guest: 8800, host: 8803 - fedora33.vm.provision "shell", - path: ".ci/provision/fedora_33.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-fedora_33.amd64.tar.gz" } - source_file = Dir["_build/firezone*fedora_33*.tar.gz"].first - if source_file - fedora33.vm.provision "file", source: source_file, destination: "/tmp/" - fedora33.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + fedora33.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8803) + fedora33.vm.provision "shell", path: ".ci/provision/fedora_33.sh", privileged: false end config.vm.define "fedora_34" do |fedora34| fedora34.vm.box = "generic/fedora34" fedora34.vm.box_url = "http://vagrant.cloudfire.network/fedora34.box" - fedora34.vm.network "forwarded_port", guest: 8800, host: 8804 - fedora34.vm.provision "shell", - path: ".ci/provision/fedora_34.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-fedora_34.amd64.tar.gz" } - source_file = Dir["_build/firezone*fedora_34*.tar.gz"].first - if source_file - fedora34.vm.provision "file", source: source_file, destination: "/tmp/" - fedora34.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + fedora34.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8804) + fedora34.vm.provision "shell", path: ".ci/provision/fedora_34.sh", privileged: false end config.vm.define "ubuntu_18.04" do |ubuntu1804| ubuntu1804.vm.box = "generic/ubuntu1804" ubuntu1804.vm.box_url = "http://vagrant.cloudfire.network/ubuntu1804.box" - ubuntu1804.vm.network "forwarded_port", guest: 8800, host: 8805 - ubuntu1804.vm.provision "shell", - path: ".ci/provision/ubuntu_18.04.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-ubuntu_18.04.amd64.tar.gz" } - source_file = Dir["_build/firezone*ubuntu_18.04*.tar.gz"].first - if source_file - ubuntu1804.vm.provision "file", source: source_file, destination: "/tmp/" - ubuntu1804.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + ubuntu1804.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8805) + ubuntu1804.vm.provision "shell", path: ".ci/provision/ubuntu_18.04.sh", privileged: false end config.vm.define "ubuntu_20.04" do |ubuntu2004| ubuntu2004.vm.box = "generic/ubuntu2004" ubuntu2004.vm.box_url = "http://vagrant.cloudfire.network/ubuntu2004.box" - ubuntu2004.vm.network "forwarded_port", guest: 8800, host: 8806 - ubuntu2004.vm.provision "shell", - path: ".ci/provision/ubuntu_20.04.sh", - privileged: false, - env: { PKG_FILE: "firezone-#{VERSION}-ubuntu_20.04.amd64.tar.gz" } - source_file = Dir["_build/firezone*ubuntu_20.04*.tar.gz"].first - if source_file - ubuntu2004.vm.provision "file", source: source_file, destination: "/tmp/" - ubuntu2004.vm.provision "file", source: "scripts/install.sh", destination: "/tmp/" - end + ubuntu2004.vm.network "forwarded_port", guest: 8800, host: ENV.fetch("PORT", 8806) + ubuntu2004.vm.provision "shell", path: ".ci/provision/ubuntu_20.04.sh", privileged: false end end diff --git a/firezone/omnibus/config/patches/pkg-config/openbsd-charset.patch b/firezone/omnibus/config/patches/pkg-config/openbsd-charset.patch new file mode 100644 index 000000000..d41dbde19 --- /dev/null +++ b/firezone/omnibus/config/patches/pkg-config/openbsd-charset.patch @@ -0,0 +1,19 @@ +--- pkg-config-0.28.orig/glib/glib/libcharset/config.charset Wed May 13 18:21:29 2015 ++++ pkg-config-0.28/glib/glib/libcharset/config.charset Wed May 13 18:21:54 2015 +@@ -398,6 +398,16 @@ + echo "BIG5 BIG5" + echo "SJIS SHIFT_JIS" + ;; ++ openbsd*) ++ echo "646 ASCII" ++ echo "ISO8859-1 ISO-8859-1" ++ echo "ISO8859-2 ISO-8859-2" ++ echo "ISO8859-4 ISO-8859-4" ++ echo "ISO8859-5 ISO-8859-5" ++ echo "ISO8859-7 ISO-8859-7" ++ echo "ISO8859-13 ISO-8859-13" ++ echo "ISO8859-15 ISO-8859-15" ++ ;; + darwin[56]*) + # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore + # localcharset.c falls back to using the full locale name diff --git a/omnibus/.gitignore b/omnibus/.gitignore new file mode 100644 index 000000000..3a1b0067a --- /dev/null +++ b/omnibus/.gitignore @@ -0,0 +1,11 @@ +*.gem +.bundle +.kitchen/ +.kitchen.local.yml +vendor/bundle +pkg/* +.vagrant +bin/* +files/**/cache/ +vendor/cookbooks +local/ diff --git a/omnibus/.kitchen.yml b/omnibus/.kitchen.yml new file mode 100644 index 000000000..2317dc437 --- /dev/null +++ b/omnibus/.kitchen.yml @@ -0,0 +1,41 @@ +driver: + name: vagrant + forward_agent: yes + customize: + cpus: 2 + memory: 2048 + synced_folders: + - ['.', '/home/vagrant/firezone'] + +provisioner: + name: chef_zero + +platforms: + - name: centos-6 + run_list: yum-epel::default + - name: centos-7 + run_list: yum-epel::default + - name: debian-8 + run_list: apt::default + - name: debian-9 + run_list: apt::default + - name: freebsd-10 + run_list: freebsd::portsnap + - name: freebsd-11 + run_list: freebsd::portsnap + - name: ubuntu-14.04 + run_list: apt::default + - name: ubuntu-16.04 + run_list: apt::default + - name: ubuntu-18.04 + run_list: apt::default + +suites: + - name: default + run_list: omnibus::default + attributes: + omnibus: + build_user: vagrant + build_user_group: vagrant + build_user_password: vagrant + install_dir: /opt/firezone diff --git a/omnibus/Berksfile b/omnibus/Berksfile new file mode 100644 index 000000000..acac58e70 --- /dev/null +++ b/omnibus/Berksfile @@ -0,0 +1,12 @@ +source 'https://supermarket.chef.io' + +cookbook 'omnibus' + +# Uncomment to use the latest version of the Omnibus cookbook from GitHub +# cookbook 'omnibus', github: 'chef-cookbooks/omnibus' + +group :integration do + cookbook 'apt', '~> 2.8' + cookbook 'freebsd', '~> 0.3' + cookbook 'yum-epel', '~> 0.6' +end diff --git a/omnibus/Gemfile b/omnibus/Gemfile new file mode 100644 index 000000000..8e79590b9 --- /dev/null +++ b/omnibus/Gemfile @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# Install omnibus +gem "omnibus", "~> 8.1" + +# Use Chef"s software definitions. It is recommended that you write your own +# software definitions, but you can clone/fork Chef"s to get you started. +# gem "omnibus-software", github: "chef/omnibus-software" + +# This development group is installed by default when you run `bundle install`, +# but if you are using Omnibus in a CI-based infrastructure, you do not need +# the Test Kitchen-based build lab. You can skip these unnecessary dependencies +# by running `bundle install --without development` to speed up build times. +group :development do + # Use Berkshelf for resolving cookbook dependencies + gem "berkshelf" + + gem "rubocop" + + # Use Test Kitchen with Vagrant for converging the build environment + gem "test-kitchen" + gem "kitchen-vagrant" +end diff --git a/omnibus/Gemfile.lock b/omnibus/Gemfile.lock new file mode 100644 index 000000000..af3a1519e --- /dev/null +++ b/omnibus/Gemfile.lock @@ -0,0 +1,389 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + ast (2.4.2) + awesome_print (1.9.2) + aws-eventstream (1.1.1) + aws-partitions (1.484.0) + aws-sdk-core (3.119.0) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.239.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-kms (1.46.0) + aws-sdk-core (~> 3, >= 3.119.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.98.0) + aws-sdk-core (~> 3, >= 3.119.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.1) + aws-sigv4 (1.2.4) + aws-eventstream (~> 1, >= 1.0.2) + bcrypt_pbkdf (1.1.0) + berkshelf (7.2.2) + chef (>= 15.7.32) + chef-config + cleanroom (~> 1.0) + concurrent-ruby (~> 1.0) + minitar (>= 0.6) + mixlib-archive (>= 1.1.4, < 2.0) + mixlib-config (>= 2.2.5) + mixlib-shellout (>= 2.0, < 4.0) + octokit (~> 4.0) + retryable (>= 2.0, < 4.0) + solve (~> 4.0) + thor (>= 0.20) + builder (3.2.4) + chef (16.14.1) + addressable + bcrypt_pbkdf (~> 1.1) + bundler (>= 1.10) + chef-config (= 16.14.1) + chef-utils (= 16.14.1) + chef-vault + chef-zero (>= 14.0.11) + diff-lcs (>= 1.2.4, < 1.4.0) + ed25519 (~> 1.2) + erubis (~> 2.7) + ffi (>= 1.9.25) + ffi-libarchive (~> 1.0, >= 1.0.3) + ffi-yajl (~> 2.2) + highline (>= 1.6.9, < 3) + iniparse (~> 1.4) + inspec-core (~> 4.23) + license-acceptance (>= 1.0.5, < 3) + mixlib-archive (>= 0.4, < 2.0) + mixlib-authentication (>= 2.1, < 4) + mixlib-cli (>= 2.1.1, < 3.0) + mixlib-log (>= 2.0.3, < 4.0) + mixlib-shellout (>= 3.1.1, < 4.0) + net-sftp (>= 2.1.2, < 4.0) + net-ssh (>= 5.1, < 7) + net-ssh-multi (~> 1.2, >= 1.2.1) + ohai (~> 16.0) + pastel + plist (~> 3.2) + proxifier (~> 1.0) + syslog-logger (~> 1.6) + train-core (~> 3.2, >= 3.2.28) + train-winrm (>= 0.2.5) + tty-prompt (~> 0.21) + tty-screen (~> 0.6) + tty-table (~> 0.11) + uuidtools (>= 2.1.5, < 3.0) + chef-cleanroom (1.0.2) + chef-config (16.14.1) + addressable + chef-utils (= 16.14.1) + fuzzyurl + mixlib-config (>= 2.2.12, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) + tomlrb (~> 1.2) + chef-telemetry (1.1.1) + chef-config + concurrent-ruby (~> 1.0) + chef-utils (16.14.1) + chef-vault (4.1.0) + chef-zero (15.0.7) + ffi-yajl (~> 2.2) + hashie (>= 2.0, < 5.0) + mixlib-log (>= 2.0, < 4.0) + rack (~> 2.0, >= 2.0.6) + uuidtools (~> 2.1) + webrick + citrus (3.0.2) + cleanroom (1.0.0) + coderay (1.1.3) + concurrent-ruby (1.1.9) + contracts (0.16.1) + diff-lcs (1.3) + ed25519 (1.2.4) + erubi (1.10.0) + erubis (2.7.0) + faraday (1.4.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.1) + multipart-post (>= 1.2, < 3) + ruby2_keywords (>= 0.0.4) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday_middleware (1.1.0) + faraday (~> 1.0) + ffi (1.15.3) + ffi-libarchive (1.0.17) + ffi (~> 1.0) + ffi-yajl (2.4.0) + libyajl2 (>= 1.2) + fuzzyurl (0.9.0) + gssapi (1.3.1) + ffi (>= 1.0.1) + gyoku (1.3.1) + builder (>= 2.1.2) + hashie (4.1.0) + highline (2.0.3) + httpclient (2.8.3) + iniparse (1.5.0) + inspec-core (4.38.9) + addressable (~> 2.4) + chef-telemetry (~> 1.0, >= 1.0.8) + faraday (>= 0.9.0, < 1.5) + faraday_middleware (~> 1.0) + hashie (>= 3.4, < 5.0) + license-acceptance (>= 0.2.13, < 3.0) + method_source (>= 0.8, < 2.0) + mixlib-log (~> 3.0) + multipart-post (~> 2.0) + parallel (~> 1.9) + parslet (>= 1.5, < 2.0) + pry (~> 0.13) + rspec (>= 3.9, < 3.11) + rspec-its (~> 1.2) + rubyzip (>= 1.2.2, < 3.0) + semverse (~> 3.0) + sslshake (~> 1.2) + thor (>= 0.20, < 2.0) + tomlrb (>= 1.2, < 2.1) + train-core (~> 3.0) + tty-prompt (~> 0.17) + tty-table (~> 0.10) + iostruct (0.0.4) + ipaddress (0.8.3) + jmespath (1.4.0) + json (2.5.1) + kitchen-vagrant (1.9.0) + test-kitchen (>= 1.4, < 4) + libyajl2 (2.1.0) + license-acceptance (2.1.13) + pastel (~> 0.7) + tomlrb (>= 1.2, < 3.0) + tty-box (~> 0.6) + tty-prompt (~> 0.20) + license_scout (1.2.13) + ffi-yajl (~> 2.2) + mixlib-shellout (>= 2.2, < 4.0) + toml-rb (>= 1, < 3) + little-plugger (1.1.4) + logging (2.3.0) + little-plugger (~> 1.1) + multi_json (~> 1.14) + method_source (1.0.0) + minitar (0.9) + mixlib-archive (1.1.7) + mixlib-log + mixlib-authentication (3.0.10) + mixlib-cli (2.1.8) + mixlib-config (3.0.9) + tomlrb + mixlib-install (3.12.11) + mixlib-shellout + mixlib-versioning + thor + mixlib-log (3.0.9) + mixlib-shellout (3.2.5) + chef-utils + mixlib-versioning (1.2.12) + molinillo (0.7.0) + multi_json (1.15.0) + multipart-post (2.1.1) + net-scp (3.0.0) + net-ssh (>= 2.6.5, < 7.0.0) + net-sftp (3.0.0) + net-ssh (>= 5.0.0, < 7.0.0) + net-ssh (6.1.0) + net-ssh-gateway (2.0.0) + net-ssh (>= 4.0.0) + net-ssh-multi (1.2.1) + net-ssh (>= 2.6.5) + net-ssh-gateway (>= 1.2.0) + nori (2.6.0) + octokit (4.21.0) + faraday (>= 0.9) + sawyer (~> 0.8.0, >= 0.5.3) + ohai (16.13.0) + chef-config (>= 12.8, < 17) + chef-utils (>= 16.0, < 17) + ffi (~> 1.9) + ffi-yajl (~> 2.2) + ipaddress + mixlib-cli (>= 1.7.0) + mixlib-config (>= 2.0, < 4.0) + mixlib-log (>= 2.0.1, < 4.0) + mixlib-shellout (>= 2.0, < 4.0) + plist (~> 3.1) + train-core + wmi-lite (~> 1.0) + omnibus (8.1.15) + aws-sdk-s3 (~> 1) + chef-cleanroom (~> 1.0) + chef-utils (>= 15.4) + contracts (>= 0.16.0, < 0.17.0) + ffi-yajl (~> 2.2) + license_scout (~> 1.0) + mixlib-shellout (>= 2.0, < 4.0) + mixlib-versioning + ohai (>= 15, < 17) + pedump + ruby-progressbar (~> 1.7) + thor (>= 0.18, < 2.0) + parallel (1.20.1) + parser (3.0.2.0) + ast (~> 2.4.1) + parslet (1.8.2) + pastel (0.8.0) + tty-color (~> 0.5) + pedump (0.6.2) + awesome_print + iostruct (>= 0.0.4) + multipart-post (>= 2.0.0) + rainbow + zhexdump (>= 0.0.2) + plist (3.6.0) + proxifier (1.0.3) + pry (0.14.1) + coderay (~> 1.1) + method_source (~> 1.0) + public_suffix (4.0.6) + rack (2.2.3) + rainbow (3.0.0) + regexp_parser (2.1.1) + retryable (3.0.5) + rexml (3.2.5) + rspec (3.10.0) + rspec-core (~> 3.10.0) + rspec-expectations (~> 3.10.0) + rspec-mocks (~> 3.10.0) + rspec-core (3.10.1) + rspec-support (~> 3.10.0) + rspec-expectations (3.10.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-its (1.3.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.10.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.10.0) + rspec-support (3.10.2) + rubocop (1.18.4) + parallel (~> 1.10) + parser (>= 3.0.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.8.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.8.0) + parser (>= 3.0.1.1) + ruby-progressbar (1.11.0) + ruby2_keywords (0.0.5) + rubyntlm (0.6.3) + rubyzip (2.3.2) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + semverse (3.0.0) + solve (4.0.4) + molinillo (~> 0.6) + semverse (>= 1.1, < 4.0) + sslshake (1.3.1) + strings (0.2.1) + strings-ansi (~> 0.2) + unicode-display_width (>= 1.5, < 3.0) + unicode_utils (~> 1.4) + strings-ansi (0.2.0) + syslog-logger (1.6.8) + test-kitchen (3.0.0) + bcrypt_pbkdf (~> 1.0) + chef-utils (>= 16.4.35) + ed25519 (~> 1.2) + license-acceptance (>= 1.0.11, < 3.0) + mixlib-install (~> 3.6) + mixlib-shellout (>= 1.2, < 4.0) + net-scp (>= 1.1, < 4.0) + net-ssh (>= 2.9, < 7.0) + net-ssh-gateway (>= 1.2, < 3.0) + thor (>= 0.19, < 2.0) + winrm (~> 2.0) + winrm-elevated (~> 1.0) + winrm-fs (~> 1.1) + thor (1.1.0) + toml-rb (2.0.1) + citrus (~> 3.0, > 3.0) + tomlrb (1.3.0) + train-core (3.8.1) + addressable (~> 2.5) + ffi (!= 1.13.0) + json (>= 1.8, < 3.0) + mixlib-shellout (>= 2.0, < 4.0) + net-scp (>= 1.2, < 4.0) + net-ssh (>= 2.9, < 7.0) + train-winrm (0.2.12) + winrm (>= 2.3.6, < 3.0) + winrm-elevated (~> 1.2.2) + winrm-fs (~> 1.0) + tty-box (0.7.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-cursor (~> 0.7) + tty-color (0.6.0) + tty-cursor (0.7.1) + tty-prompt (0.23.1) + pastel (~> 0.8) + tty-reader (~> 0.8) + tty-reader (0.9.0) + tty-cursor (~> 0.7) + tty-screen (~> 0.8) + wisper (~> 2.0) + tty-screen (0.8.1) + tty-table (0.12.0) + pastel (~> 0.8) + strings (~> 0.2.0) + tty-screen (~> 0.8) + unicode-display_width (2.0.0) + unicode_utils (1.4.0) + uuidtools (2.2.0) + webrick (1.7.0) + winrm (2.3.6) + builder (>= 2.1.2) + erubi (~> 1.8) + gssapi (~> 1.2) + gyoku (~> 1.0) + httpclient (~> 2.2, >= 2.2.0.2) + logging (>= 1.6.1, < 3.0) + nori (~> 2.0) + rubyntlm (~> 0.6.0, >= 0.6.3) + winrm-elevated (1.2.3) + erubi (~> 1.8) + winrm (~> 2.0) + winrm-fs (~> 1.0) + winrm-fs (1.3.5) + erubi (~> 1.8) + logging (>= 1.6.1, < 3.0) + rubyzip (~> 2.0) + winrm (~> 2.0) + wisper (2.0.1) + wmi-lite (1.0.5) + zhexdump (0.0.2) + +PLATFORMS + arm64-darwin-20 + ruby + +DEPENDENCIES + berkshelf + kitchen-vagrant + omnibus (~> 8.1) + rubocop + test-kitchen + +BUNDLED WITH + 2.2.25 diff --git a/omnibus/README.md b/omnibus/README.md new file mode 100644 index 000000000..ab90b748d --- /dev/null +++ b/omnibus/README.md @@ -0,0 +1,124 @@ +firezone Omnibus project +======================== +This project creates full-stack platform-specific packages for +`firezone`! + +Installation +------------ +You must have a sane Ruby 2.0.0+ environment with Bundler installed. Ensure all +the required gems are installed: + +```shell +$ bundle install --binstubs +``` + +Usage +----- +### Build + +You create a platform-specific package using the `build project` command: + +```shell +$ bin/omnibus build firezone +``` + +The platform/architecture type of the package created will match the platform +where the `build project` command is invoked. For example, running this command +on a MacBook Pro will generate a Mac OS X package. After the build completes +packages will be available in the `pkg/` folder. + +### Clean + +You can clean up all temporary files generated during the build process with +the `clean` command: + +```shell +$ bin/omnibus clean firezone +``` + +Adding the `--purge` purge option removes __ALL__ files generated during the +build including the project install directory (`/opt/firezone`) and +the package cache directory (`/var/cache/omnibus/pkg`): + +```shell +$ bin/omnibus clean firezone --purge +``` + +### Publish + +Omnibus has a built-in mechanism for releasing to a variety of "backends", such +as Amazon S3. You must set the proper credentials in your +[`omnibus.rb`](omnibus.rb) config file or specify them via the command line. + +```shell +$ bin/omnibus publish path/to/*.deb --backend s3 +``` + +### Help + +Full help for the Omnibus command line interface can be accessed with the +`help` command: + +```shell +$ bin/omnibus help +``` + +Version Manifest +---------------- + +Git-based software definitions may specify branches as their +default_version. In this case, the exact git revision to use will be +determined at build-time unless a project override (see below) or +external version manifest is used. To generate a version manifest use +the `omnibus manifest` command: + +``` +omnibus manifest PROJECT -l warn +``` + +This will output a JSON-formatted manifest containing the resolved +version of every software definition. + + +Kitchen-based Build Environment +------------------------------- +Every Omnibus project ships with a project-specific +[Berksfile](https://docs.chef.io/berkshelf.html) that will allow you to build +your omnibus projects on all of the platforms listed in the +[`.kitchen.yml`](.kitchen.yml). You can add/remove additional platforms as +needed by changing the list found in the [`.kitchen.yml`](.kitchen.yml) +`platforms` YAML stanza. + +This build environment is designed to get you up-and-running quickly. However, +there is nothing that restricts you from building on other platforms. Simply use +the [omnibus cookbook](https://github.com/chef-cookbooks/omnibus) to setup your +desired platform and execute the build steps listed above. + +The default build environment requires Test Kitchen and VirtualBox for local +development. Test Kitchen also exposes the ability to provision instances using +various cloud providers like AWS, DigitalOcean, or OpenStack. For more +information, please see the [Test Kitchen documentation](https://kitchen.ci/). + +Once you have tweaked your [`.kitchen.yml`](.kitchen.yml) (or +[`.kitchen.local.yml`](.kitchen.local.yml)) to your liking, you can bring up an +individual build environment using the `kitchen` command. + + +```shell +$ bin/kitchen converge ubuntu-1804 +``` + +Then login to the instance and build the project as described in the Usage +section: + +```shell +$ bin/kitchen login ubuntu-1804 +[vagrant@ubuntu...] $ . load-omnibus-toolchain.sh +[vagrant@ubuntu...] $ [ -e .bundle ] && sudo chown -R vagrant:vagrant .bundle +[vagrant@ubuntu...] $ cd firezone # or 'cd firezone/omnibus' if your omnibus project is embedded in your main project +[vagrant@ubuntu...] $ bundle install +[vagrant@ubuntu...] $ bin/omnibus build firezone +``` + +For a complete list of all commands and platforms, run `kitchen list` or +`kitchen help`. diff --git a/omnibus/config/patches/bzip2/aix_makefile.patch b/omnibus/config/patches/bzip2/aix_makefile.patch new file mode 100644 index 000000000..e562728c6 --- /dev/null +++ b/omnibus/config/patches/bzip2/aix_makefile.patch @@ -0,0 +1,11 @@ +--- bzip2-1.0.8/Makefile-libbz2_so.orig 2019-07-24 10:33:36.184131389 -0400 ++++ bzip2-1.0.8/Makefile-libbz2_so 2019-07-24 10:35:20.564277676 -0400 +@@ -35,7 +35,7 @@ + bzlib.o + + all: $(OBJS) +- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) ++ $(CC) -qmkshrobj -Wl,-soname -o libbz2.so.1.0.8 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 + rm -f libbz2.so.1.0 + ln -s libbz2.so.1.0.8 libbz2.so.1.0 diff --git a/omnibus/config/patches/bzip2/makefile_no_bins.patch b/omnibus/config/patches/bzip2/makefile_no_bins.patch new file mode 100644 index 000000000..b6cf5e1d5 --- /dev/null +++ b/omnibus/config/patches/bzip2/makefile_no_bins.patch @@ -0,0 +1,77 @@ +--- bzip2-1.0.8/Makefile-orig 2019-07-13 10:50:05.000000000 -0700 ++++ bzip2-1.0.8/Makefile 2020-08-14 16:35:23.000000000 -0700 +@@ -35,14 +35,11 @@ + decompress.o \ + bzlib.o + +-all: libbz2.a bzip2 bzip2recover test ++all: libbz2.a bzip2 test + + bzip2: libbz2.a bzip2.o + $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 + +-bzip2recover: bzip2recover.o +- $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o +- + libbz2.a: $(OBJS) + rm -f libbz2.a + $(AR) cq libbz2.a $(OBJS) +@@ -69,47 +66,19 @@ + cmp sample3.tst sample3.ref + @cat words3 + +-install: bzip2 bzip2recover ++install: bzip2 + if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi + if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi + if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi + if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi + if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi +- cp -f bzip2 $(PREFIX)/bin/bzip2 +- cp -f bzip2 $(PREFIX)/bin/bunzip2 +- cp -f bzip2 $(PREFIX)/bin/bzcat +- cp -f bzip2recover $(PREFIX)/bin/bzip2recover +- chmod a+x $(PREFIX)/bin/bzip2 +- chmod a+x $(PREFIX)/bin/bunzip2 +- chmod a+x $(PREFIX)/bin/bzcat +- chmod a+x $(PREFIX)/bin/bzip2recover +- cp -f bzip2.1 $(PREFIX)/man/man1 +- chmod a+r $(PREFIX)/man/man1/bzip2.1 + cp -f bzlib.h $(PREFIX)/include + chmod a+r $(PREFIX)/include/bzlib.h + cp -f libbz2.a $(PREFIX)/lib + chmod a+r $(PREFIX)/lib/libbz2.a +- cp -f bzgrep $(PREFIX)/bin/bzgrep +- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep +- ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep +- chmod a+x $(PREFIX)/bin/bzgrep +- cp -f bzmore $(PREFIX)/bin/bzmore +- ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless +- chmod a+x $(PREFIX)/bin/bzmore +- cp -f bzdiff $(PREFIX)/bin/bzdiff +- ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp +- chmod a+x $(PREFIX)/bin/bzdiff +- cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1 +- chmod a+r $(PREFIX)/man/man1/bzgrep.1 +- chmod a+r $(PREFIX)/man/man1/bzmore.1 +- chmod a+r $(PREFIX)/man/man1/bzdiff.1 +- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1 +- echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1 +- echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1 +- echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1 + + clean: +- rm -f *.o libbz2.a bzip2 bzip2recover \ ++ rm -f *.o libbz2.a bzip2 \ + sample1.rb2 sample2.rb2 sample3.rb2 \ + sample1.tst sample2.tst sample3.tst + +@@ -130,8 +99,6 @@ + $(CC) $(CFLAGS) -c bzlib.c + bzip2.o: bzip2.c + $(CC) $(CFLAGS) -c bzip2.c +-bzip2recover.o: bzip2recover.c +- $(CC) $(CFLAGS) -c bzip2recover.c + + + distclean: clean diff --git a/omnibus/config/patches/bzip2/makefile_take_env_vars.patch b/omnibus/config/patches/bzip2/makefile_take_env_vars.patch new file mode 100644 index 000000000..982f03b5a --- /dev/null +++ b/omnibus/config/patches/bzip2/makefile_take_env_vars.patch @@ -0,0 +1,31 @@ +--- bzip2-1.0.6/Makefile-orig 2010-09-10 17:46:02.000000000 -0500 ++++ bzip2-1.0.6/Makefile 2013-11-21 13:55:11.000000000 -0600 +@@ -15,13 +15,13 @@ + + SHELL=/bin/sh + + # To assist in cross-compiling +-CC=gcc ++CC?=gcc + AR=ar + RANLIB=ranlib +-LDFLAGS= ++LDFLAGS+= + +-BIGFILES=-D_FILE_OFFSET_BITS=64 ++BIGFILES?=-D_FILE_OFFSET_BITS=64 +-CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) ++CFLAGS+=-Wall -Winline -O2 -g $(BIGFILES) + + # Where you want it installed when you do 'make install' + PREFIX=/usr/local +--- bzip2-1.0.6/Makefile-libbz2_so-orig 2017-03-21 19:43:16.706849481 +0000 ++++ bzip2-1.0.6/Makefile-libbz2_so 2017-03-21 19:43:01.187851955 +0000 +@@ -22,7 +22,7 @@ + + + SHELL=/bin/sh +-CC=gcc ++CC?=gcc + BIGFILES=-D_FILE_OFFSET_BITS=64 + CFLAGS=-fpic -fPIC -Wall -Winline -O2 -g $(BIGFILES) diff --git a/omnibus/config/patches/bzip2/soname_install_dir.patch b/omnibus/config/patches/bzip2/soname_install_dir.patch new file mode 100644 index 000000000..599682bff --- /dev/null +++ b/omnibus/config/patches/bzip2/soname_install_dir.patch @@ -0,0 +1,11 @@ +--- bzip2-1.0.8/Makefile-libbz2_so.orig 2019-07-24 10:33:36.184131389 -0400 ++++ bzip2-1.0.8/Makefile-libbz2_so 2019-07-24 10:38:15.700843785 -0400 +@@ -35,7 +35,7 @@ + bzlib.o + + all: $(OBJS) +- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) ++ $(CC) -shared -Wl,-install_name -Wl,libbz2.so.1.0 -o libbz2.so.1.0.8 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.8 + rm -f libbz2.so.1.0 + ln -s libbz2.so.1.0.8 libbz2.so.1.0 diff --git a/omnibus/config/patches/erlang/epmd-require-explicitly-adding-loopback-address.patch b/omnibus/config/patches/erlang/epmd-require-explicitly-adding-loopback-address.patch new file mode 100644 index 000000000..bb4bbd1b1 --- /dev/null +++ b/omnibus/config/patches/erlang/epmd-require-explicitly-adding-loopback-address.patch @@ -0,0 +1,83 @@ +From fae952def3698b588b96231862123ee3547c702e Mon Sep 17 00:00:00 2001 +From: Steven Danna +Date: Tue, 14 Nov 2017 21:08:05 +0000 +Subject: [PATCH] epmd: require explicitly adding address + +Based on the following PR: + + https://github.com/erlang/otp/pull/1075/commits/0800214dc6aec5327f4e984047dd05a8829ae5e4 +--- + erts/epmd/src/epmd_srv.c | 31 ++++++++++++------------------- + 1 file changed, 12 insertions(+), 19 deletions(-) + +diff --git a/erts/epmd/src/epmd_srv.c b/erts/epmd/src/epmd_srv.c +index e1bac99ef9..f42a97330e 100644 +--- a/erts/epmd/src/epmd_srv.c ++++ b/erts/epmd/src/epmd_srv.c +@@ -257,14 +257,6 @@ void run(EpmdVars *g) + char *tmp = NULL; + char *token = NULL; + +- /* Always listen on the loopback. */ +- SET_ADDR(iserv_addr[num_sockets],htonl(INADDR_LOOPBACK),sport); +- num_sockets++; +-#if defined(EPMD6) +- SET_ADDR6(iserv_addr[num_sockets],in6addr_loopback,sport); +- num_sockets++; +-#endif +- + if ((tmp = strdup(g->addresses)) == NULL) + { + dbg_perror(g,"cannot allocate memory"); +@@ -278,7 +270,6 @@ void run(EpmdVars *g) + struct in_addr addr; + #if defined(EPMD6) + struct in6_addr addr6; +- struct sockaddr_storage *sa = &iserv_addr[num_sockets]; + + if (inet_pton(AF_INET6,token,&addr6) == 1) + { +@@ -301,15 +292,6 @@ void run(EpmdVars *g) + epmd_cleanup_exit(g,1); + } + +-#if defined(EPMD6) +- if (sa->ss_family == AF_INET6 && IN6_IS_ADDR_LOOPBACK(&addr6)) +- continue; +- +- if (sa->ss_family == AF_INET) +-#endif +- if (IS_ADDR_LOOPBACK(addr)) +- continue; +- + num_sockets++; + + if (num_sockets >= MAX_LISTEN_SOCKETS) +@@ -374,13 +356,24 @@ void run(EpmdVars *g) + switch (errno) { + case EAFNOSUPPORT: + case EPROTONOSUPPORT: ++ /* ++ * Log error but continue. We can get here for ++ * in6addr_any on machines that don't have IPv6 ++ * support. If we can't bind any addresses, we'll ++ * exit further down ++ * ++ */ ++ dbg_perror(g,"error opening stream socket"); + continue; + default: + dbg_perror(g,"error opening stream socket"); + epmd_cleanup_exit(g,1); + } + } +- g->listenfd[bound++] = listensock[i]; ++ else ++ { ++ g->listenfd[bound++] = listensock[i]; ++ } + + #if HAVE_DECL_IPV6_V6ONLY + opt = 1; +-- +2.14.1 diff --git a/omnibus/config/patches/libedit/freebsd-vi-fix.patch b/omnibus/config/patches/libedit/freebsd-vi-fix.patch new file mode 100644 index 000000000..ffb5227f4 --- /dev/null +++ b/omnibus/config/patches/libedit/freebsd-vi-fix.patch @@ -0,0 +1,24 @@ +diff -ruN libedit-20120601-3.0/src/vi.c libedit-20120601-3.0.fixed/src/vi.c +--- libedit-20120601-3.0/src/vi.c 2012-03-11 09:54:58.000000000 +0000 ++++ libedit-20120601-3.0.fixed/src/vi.c 2013-02-08 05:22:16.338954507 +0000 +@@ -918,17 +918,15 @@ + * NB: posix implies that we should enter insert mode, however + * this is against historical precedent... + */ +-#ifdef __weak_reference +-__weakref_visible char *my_get_alias_text(const char *) +- __weak_reference(get_alias_text); +-#endif + protected el_action_t + /*ARGSUSED*/ + vi_alias(EditLine *el, Int c __attribute__((__unused__))) + { +-#ifdef __weak_reference ++#ifdef __weak_extern + char alias_name[3]; + char *alias_text; ++ extern __weakref_visible char *my_get_alias_text(const char *); ++ __weak_extern(get_alias_text); + + if (my_get_alias_text == 0) { + return CC_ERROR; diff --git a/omnibus/config/patches/libedit/openbsd-weak-alias-fix.patch b/omnibus/config/patches/libedit/openbsd-weak-alias-fix.patch new file mode 100644 index 000000000..73d99af12 --- /dev/null +++ b/omnibus/config/patches/libedit/openbsd-weak-alias-fix.patch @@ -0,0 +1,48 @@ +diff -ur libedit-20120601-3.0.orig/src/strlcat.c libedit-20120601-3.0/src/strlcat.c +--- libedit-20120601-3.0.orig/src/strlcat.c Wed May 13 17:47:58 2015 ++++ libedit-20120601-3.0/src/strlcat.c Wed May 13 17:48:14 2015 +@@ -29,7 +29,7 @@ + + #ifdef _LIBC + # ifdef __weak_alias +-__weak_alias(strlcat, _strlcat) ++//__weak_alias(strlcat, _strlcat) + # endif + #endif + +diff -ur libedit-20120601-3.0.orig/src/strlcpy.c libedit-20120601-3.0/src/strlcpy.c +--- libedit-20120601-3.0.orig/src/strlcpy.c Wed May 13 17:47:58 2015 ++++ libedit-20120601-3.0/src/strlcpy.c Wed May 13 17:48:14 2015 +@@ -29,7 +29,7 @@ + + #ifdef _LIBC + # ifdef __weak_alias +-__weak_alias(strlcpy, _strlcpy) ++//__weak_alias(strlcpy, _strlcpy) + # endif + #endif + +diff -ur libedit-20120601-3.0.orig/src/unvis.c libedit-20120601-3.0/src/unvis.c +--- libedit-20120601-3.0.orig/src/unvis.c Wed May 13 17:47:58 2015 ++++ libedit-20120601-3.0/src/unvis.c Wed May 13 17:48:14 2015 +@@ -50,7 +50,7 @@ + #include + + #ifdef __weak_alias +-__weak_alias(strnunvisx,_strnunvisx) ++//__weak_alias(strnunvisx,_strnunvisx) + #endif + + #if !HAVE_VIS +diff -ur libedit-20120601-3.0.orig/src/vis.c libedit-20120601-3.0/src/vis.c +--- libedit-20120601-3.0.orig/src/vis.c Wed May 13 17:47:58 2015 ++++ libedit-20120601-3.0/src/vis.c Wed May 13 17:48:14 2015 +@@ -69,7 +69,7 @@ + #include + + #ifdef __weak_alias +-__weak_alias(strvisx,_strvisx) ++//__weak_alias(strvisx,_strvisx) + #endif + + #if !HAVE_VIS || !HAVE_SVIS diff --git a/omnibus/config/patches/libffi/libffi-3.2.1-disable-multi-os-directory.patch b/omnibus/config/patches/libffi/libffi-3.2.1-disable-multi-os-directory.patch new file mode 100644 index 000000000..8296e2095 --- /dev/null +++ b/omnibus/config/patches/libffi/libffi-3.2.1-disable-multi-os-directory.patch @@ -0,0 +1,83 @@ +--- libffi-3.2.1-orig/configure.ac 2014-11-12 05:56:51.000000000 -0600 ++++ libffi-3.2.1/configure.ac 2015-10-29 15:53:41.695055040 -0500 +@@ -590,6 +590,10 @@ + AC_DEFINE(USING_PURIFY, 1, [Define this if you are using Purify and want to suppress spurious messages.]) + fi) + ++AC_ARG_ENABLE(multi-os-directory, ++[ --disable-multi-os-directory ++ disable use of gcc --print-multi-os-directory to change the library installation directory]) ++ + # These variables are only ever used when we cross-build to X86_WIN32. + # And we only support this with GCC, so... + if test "x$GCC" = "xyes"; then +@@ -601,11 +605,13 @@ + toolexecdir="${libdir}"/gcc-lib/'$(target_alias)' + toolexeclibdir="${libdir}" + fi +- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` +- case $multi_os_directory in +- .) ;; # Avoid trailing /. +- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; +- esac ++ if test x"$enable_multi_os_directory" != x"no"; then ++ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` ++ case $multi_os_directory in ++ .) ;; # Avoid trailing /. ++ ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; ++ esac ++ fi + AC_SUBST(toolexecdir) + else + toolexeclibdir="${libdir}" +--- libffi-3.2.1-orig/configure 2014-11-12 11:59:57.000000000 +0000 ++++ libffi-3.2.1/configure 2015-10-30 19:50:51.082221000 +0000 +@@ -886,6 +886,7 @@ + enable_structs + enable_raw_api + enable_purify_safety ++enable_multi_os_directory + ' + ac_precious_vars='build_alias + host_alias +@@ -1538,6 +1539,8 @@ + --disable-structs omit code for struct support + --disable-raw-api make the raw api unavailable + --enable-purify-safety purify-safe mode ++ --disable-multi-os-directory ++ disable use of gcc --print-multi-os-directory to change the library installation directory + + Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +@@ -18714,6 +18717,12 @@ + fi + + ++# Check whether --enable-multi-os-directory was given. ++if test "${enable_multi_os_directory+set}" = set; then : ++ enableval=$enable_multi_os_directory; ++fi ++ ++ + # These variables are only ever used when we cross-build to X86_WIN32. + # And we only support this with GCC, so... + if test "x$GCC" = "xyes"; then +@@ -18725,11 +18734,13 @@ + toolexecdir="${libdir}"/gcc-lib/'$(target_alias)' + toolexeclibdir="${libdir}" + fi +- multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` +- case $multi_os_directory in +- .) ;; # Avoid trailing /. +- ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; +- esac ++ if test x"$enable_multi_os_directory" != x"no"; then ++ multi_os_directory=`$CC $CFLAGS -print-multi-os-directory` ++ case $multi_os_directory in ++ .) ;; # Avoid trailing /. ++ ../*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;; ++ esac ++ fi + + else + toolexeclibdir="${libdir}" diff --git a/omnibus/config/patches/libffi/libffi-3.3-arm64.patch b/omnibus/config/patches/libffi/libffi-3.3-arm64.patch new file mode 100644 index 000000000..2702f78d5 --- /dev/null +++ b/omnibus/config/patches/libffi/libffi-3.3-arm64.patch @@ -0,0 +1,9608 @@ +diff -ur libffi-3.3/Makefile.in libffi-3.3.new/Makefile.in +--- libffi-3.3/Makefile.in 2019-11-23 06:59:04.000000000 -0700 ++++ libffi-3.3.new/Makefile.in 2021-01-04 19:48:49.000000000 -0700 +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.16.1 from Makefile.am. ++# Makefile.in generated by automake 1.16.3 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2018 Free Software Foundation, Inc. ++# Copyright (C) 1994-2020 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -303,8 +303,8 @@ + $(am__extra_recursive_targets) + AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir distdir-am dist dist-all distcheck +-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ +- $(LISP)fficonfig.h.in ++am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \ ++ fficonfig.h.in + # Read a list of newline-separated strings from the standard input, + # and print each of them once, without duplicates. Input order is + # *not* preserved. +@@ -326,8 +326,8 @@ + CSCOPE = cscope + DIST_SUBDIRS = include testsuite man doc + am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/fficonfig.h.in \ +- $(srcdir)/libffi.pc.in compile config.guess config.sub depcomp \ +- install-sh ltmain.sh missing ++ $(srcdir)/libffi.pc.in ChangeLog compile config.guess \ ++ config.sub depcomp install-sh ltmain.sh missing + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) +@@ -366,6 +366,8 @@ + DIST_ARCHIVES = $(distdir).tar.gz + GZIP_ENV = --best + DIST_TARGETS = dist-gzip ++# Exists only to be overridden by the user if desired. ++AM_DISTCHECK_DVI_TARGET = dvi + distuninstallcheck_listfiles = find . -type f -print + am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ + | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' +@@ -1529,6 +1531,10 @@ + tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz + $(am__post_remove_distdir) + ++dist-zstd: distdir ++ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst ++ $(am__post_remove_distdir) ++ + dist-tarZ: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 +@@ -1571,6 +1577,8 @@ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ ++ *.tar.zst*) \ ++ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ + esac + chmod -R a-w $(distdir) + chmod u+w $(distdir) +@@ -1586,7 +1594,7 @@ + $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=../.. --prefix="$$dc_install_base" \ + && $(MAKE) $(AM_MAKEFLAGS) \ +- && $(MAKE) $(AM_MAKEFLAGS) dvi \ ++ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ +@@ -1987,20 +1995,21 @@ + clean-generic clean-libtool clean-noinstLTLIBRARIES \ + clean-toolexeclibLTLIBRARIES cscope cscopelist-am ctags \ + ctags-am dist dist-all dist-bzip2 dist-gzip dist-hook \ +- dist-lzip dist-shar dist-tarZ dist-xz dist-zip distcheck \ +- distclean distclean-compile distclean-generic distclean-hdr \ +- distclean-libtool distclean-tags distcleancheck distdir \ +- distuninstallcheck dvi dvi-am html html-am info info-am \ +- install install-am install-data install-data-am install-dvi \ +- install-dvi-am install-exec install-exec-am install-html \ +- install-html-am install-info install-info-am install-man \ +- install-pdf install-pdf-am install-pkgconfigDATA install-ps \ +- install-ps-am install-strip install-toolexeclibLTLIBRARIES \ +- installcheck installcheck-am installdirs installdirs-am \ +- maintainer-clean maintainer-clean-generic mostlyclean \ +- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ +- pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ +- uninstall-pkgconfigDATA uninstall-toolexeclibLTLIBRARIES ++ dist-lzip dist-shar dist-tarZ dist-xz dist-zip dist-zstd \ ++ distcheck distclean distclean-compile distclean-generic \ ++ distclean-hdr distclean-libtool distclean-tags distcleancheck \ ++ distdir distuninstallcheck dvi dvi-am html html-am info \ ++ info-am install install-am install-data install-data-am \ ++ install-dvi install-dvi-am install-exec install-exec-am \ ++ install-html install-html-am install-info install-info-am \ ++ install-man install-pdf install-pdf-am install-pkgconfigDATA \ ++ install-ps install-ps-am install-strip \ ++ install-toolexeclibLTLIBRARIES installcheck installcheck-am \ ++ installdirs installdirs-am maintainer-clean \ ++ maintainer-clean-generic mostlyclean mostlyclean-compile \ ++ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ ++ tags tags-am uninstall uninstall-am uninstall-pkgconfigDATA \ ++ uninstall-toolexeclibLTLIBRARIES + + .PRECIOUS: Makefile + +diff -ur libffi-3.3/aclocal.m4 libffi-3.3.new/aclocal.m4 +--- libffi-3.3/aclocal.m4 2019-11-23 06:58:58.000000000 -0700 ++++ libffi-3.3.new/aclocal.m4 2021-01-04 19:48:48.000000000 -0700 +@@ -1,6 +1,6 @@ +-# generated automatically by aclocal 1.16.1 -*- Autoconf -*- ++# generated automatically by aclocal 1.16.3 -*- Autoconf -*- + +-# Copyright (C) 1996-2018 Free Software Foundation, Inc. ++# Copyright (C) 1996-2020 Free Software Foundation, Inc. + + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -930,7 +930,7 @@ + dnl aclocal-1.4 backwards compatibility: + dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], []) + +-# Copyright (C) 2002-2018 Free Software Foundation, Inc. ++# Copyright (C) 2002-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -945,7 +945,7 @@ + [am__api_version='1.16' + dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to + dnl require some minimum version. Point them to the right macro. +-m4_if([$1], [1.16.1], [], ++m4_if([$1], [1.16.3], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl + ]) + +@@ -961,14 +961,14 @@ + # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. + # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. + AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +-[AM_AUTOMAKE_VERSION([1.16.1])dnl ++[AM_AUTOMAKE_VERSION([1.16.3])dnl + m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl + _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) + + # Figure out how to run the assembler. -*- Autoconf -*- + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -988,7 +988,7 @@ + + # AM_AUX_DIR_EXPAND -*- Autoconf -*- + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1040,7 +1040,7 @@ + + # AM_CONDITIONAL -*- Autoconf -*- + +-# Copyright (C) 1997-2018 Free Software Foundation, Inc. ++# Copyright (C) 1997-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1071,7 +1071,7 @@ + Usually this means the macro was only invoked conditionally.]]) + fi])]) + +-# Copyright (C) 1999-2018 Free Software Foundation, Inc. ++# Copyright (C) 1999-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1262,7 +1262,7 @@ + + # Generate code to set up dependency tracking. -*- Autoconf -*- + +-# Copyright (C) 1999-2018 Free Software Foundation, Inc. ++# Copyright (C) 1999-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1301,7 +1301,9 @@ + done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments +- for automatic dependency tracking. Try re-running configure with the ++ for automatic dependency tracking. If GNU make was not used, consider ++ re-running the configure script with MAKE="gmake" (or whatever is ++ necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi +@@ -1328,7 +1330,7 @@ + + # Do all the work for Automake. -*- Autoconf -*- + +-# Copyright (C) 1996-2018 Free Software Foundation, Inc. ++# Copyright (C) 1996-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1525,7 +1527,7 @@ + done + echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1546,7 +1548,7 @@ + fi + AC_SUBST([install_sh])]) + +-# Copyright (C) 2003-2018 Free Software Foundation, Inc. ++# Copyright (C) 2003-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1568,7 +1570,7 @@ + # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- + # From Jim Meyering + +-# Copyright (C) 1996-2018 Free Software Foundation, Inc. ++# Copyright (C) 1996-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1603,7 +1605,7 @@ + + # Check to see how 'make' treats includes. -*- Autoconf -*- + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1646,7 +1648,7 @@ + + # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +-# Copyright (C) 1997-2018 Free Software Foundation, Inc. ++# Copyright (C) 1997-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1667,12 +1669,7 @@ + [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl + AC_REQUIRE_AUX_FILE([missing])dnl + if test x"${MISSING+set}" != xset; then +- case $am_aux_dir in +- *\ * | *\ *) +- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; +- *) +- MISSING="\${SHELL} $am_aux_dir/missing" ;; +- esac ++ MISSING="\${SHELL} '$am_aux_dir/missing'" + fi + # Use eval to expand $SHELL + if eval "$MISSING --is-lightweight"; then +@@ -1685,7 +1682,7 @@ + + # Helper functions for option handling. -*- Autoconf -*- + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1714,7 +1711,7 @@ + AC_DEFUN([_AM_IF_OPTION], + [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +-# Copyright (C) 1999-2018 Free Software Foundation, Inc. ++# Copyright (C) 1999-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1761,7 +1758,7 @@ + # For backward compatibility. + AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1780,7 +1777,7 @@ + + # Check to make sure that the build environment is sane. -*- Autoconf -*- + +-# Copyright (C) 1996-2018 Free Software Foundation, Inc. ++# Copyright (C) 1996-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1861,7 +1858,7 @@ + rm -f conftest.file + ]) + +-# Copyright (C) 2009-2018 Free Software Foundation, Inc. ++# Copyright (C) 2009-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1921,7 +1918,7 @@ + _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl + ]) + +-# Copyright (C) 2001-2018 Free Software Foundation, Inc. ++# Copyright (C) 2001-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1949,7 +1946,7 @@ + INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +-# Copyright (C) 2006-2018 Free Software Foundation, Inc. ++# Copyright (C) 2006-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -1968,7 +1965,7 @@ + + # Check how to create a tarball. -*- Autoconf -*- + +-# Copyright (C) 2004-2018 Free Software Foundation, Inc. ++# Copyright (C) 2004-2020 Free Software Foundation, Inc. + # + # This file is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +Only in libffi-3.3.new: autom4te.cache +diff -ur libffi-3.3/compile libffi-3.3.new/compile +--- libffi-3.3/compile 2019-11-01 03:30:05.000000000 -0600 ++++ libffi-3.3.new/compile 2021-01-04 19:48:49.000000000 -0700 +@@ -3,7 +3,7 @@ + + scriptversion=2018-03-07.03; # UTC + +-# Copyright (C) 1999-2018 Free Software Foundation, Inc. ++# Copyright (C) 1999-2020 Free Software Foundation, Inc. + # Written by Tom Tromey . + # + # This program is free software; you can redistribute it and/or modify +@@ -53,7 +53,7 @@ + MINGW*) + file_conv=mingw + ;; +- CYGWIN*) ++ CYGWIN* | MSYS*) + file_conv=cygwin + ;; + *) +@@ -67,7 +67,7 @@ + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; +- cygwin/*) ++ cygwin/* | msys/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) +diff -ur libffi-3.3/config.guess libffi-3.3.new/config.guess +--- libffi-3.3/config.guess 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/config.guess 2021-01-04 19:48:49.000000000 -0700 +@@ -1,8 +1,8 @@ + #! /bin/sh + # Attempt to guess a canonical system name. +-# Copyright 1992-2017 Free Software Foundation, Inc. ++# Copyright 1992-2020 Free Software Foundation, Inc. + +-timestamp='2017-05-11' ++timestamp='2020-08-17' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -15,7 +15,7 @@ + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, see . ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a +@@ -27,7 +27,7 @@ + # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. + # + # You can get the latest version of this script from: +-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess ++# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess + # + # Please send patches to . + +@@ -39,7 +39,7 @@ + + Output the configuration name of the system \`$me' is run on. + +-Operation modes: ++Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit +@@ -50,7 +50,7 @@ + GNU config.guess ($timestamp) + + Originally written by Per Bothner. +-Copyright 1992-2017 Free Software Foundation, Inc. ++Copyright 1992-2020 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -84,8 +84,6 @@ + exit 1 + fi + +-trap 'exit 1' 1 2 15 +- + # CC_FOR_BUILD -- compiler used by this script. Note that the use of a + # compiler to aid in system detection is discouraged as it requires + # temporary files to be created and, as you can see below, it is a +@@ -96,34 +94,40 @@ + + # Portable tmp directory creation inspired by the Autoconf team. + +-set_cc_for_build=' +-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +-: ${TMPDIR=/tmp} ; +- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || +- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || +- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || +- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +-dummy=$tmp/dummy ; +-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +-case $CC_FOR_BUILD,$HOST_CC,$CC in +- ,,) echo "int x;" > $dummy.c ; +- for c in cc gcc c89 c99 ; do +- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then +- CC_FOR_BUILD="$c"; break ; +- fi ; +- done ; +- if test x"$CC_FOR_BUILD" = x ; then +- CC_FOR_BUILD=no_compiler_found ; +- fi +- ;; +- ,,*) CC_FOR_BUILD=$CC ;; +- ,*,*) CC_FOR_BUILD=$HOST_CC ;; +-esac ; set_cc_for_build= ;' ++tmp= ++# shellcheck disable=SC2172 ++trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 ++ ++set_cc_for_build() { ++ # prevent multiple calls if $tmp is already set ++ test "$tmp" && return 0 ++ : "${TMPDIR=/tmp}" ++ # shellcheck disable=SC2039 ++ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || ++ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || ++ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || ++ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ++ dummy=$tmp/dummy ++ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ++ ,,) echo "int x;" > "$dummy.c" ++ for driver in cc gcc c89 c99 ; do ++ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then ++ CC_FOR_BUILD="$driver" ++ break ++ fi ++ done ++ if test x"$CC_FOR_BUILD" = x ; then ++ CC_FOR_BUILD=no_compiler_found ++ fi ++ ;; ++ ,,*) CC_FOR_BUILD=$CC ;; ++ ,*,*) CC_FOR_BUILD=$HOST_CC ;; ++ esac ++} + + # This is needed to find uname on a Pyramid OSx when run in the BSD universe. + # (ghazi@noc.rutgers.edu 1994-08-24) +-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then ++if test -f /.attbin/uname ; then + PATH=$PATH:/.attbin ; export PATH + fi + +@@ -132,14 +136,14 @@ + UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown + UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +-case "${UNAME_SYSTEM}" in ++case "$UNAME_SYSTEM" in + Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + +- eval $set_cc_for_build +- cat <<-EOF > $dummy.c ++ set_cc_for_build ++ cat <<-EOF > "$dummy.c" + #include + #if defined(__UCLIBC__) + LIBC=uclibc +@@ -149,13 +153,20 @@ + LIBC=gnu + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ++ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" ++ ++ # If ldd exists, use it to detect musl libc. ++ if command -v ldd >/dev/null && \ ++ ldd --version 2>&1 | grep -q ^musl ++ then ++ LIBC=musl ++ fi + ;; + esac + + # Note: order is significant - the case branches are not exclusive. + +-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ++case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, +@@ -169,30 +180,30 @@ + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ +- /sbin/$sysctl 2>/dev/null || \ +- /usr/sbin/$sysctl 2>/dev/null || \ ++ "/sbin/$sysctl" 2>/dev/null || \ ++ "/usr/sbin/$sysctl" 2>/dev/null || \ + echo unknown)` +- case "${UNAME_MACHINE_ARCH}" in ++ case "$UNAME_MACHINE_ARCH" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + earmv*) +- arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` +- endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` +- machine=${arch}${endian}-unknown ++ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` ++ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` ++ machine="${arch}${endian}"-unknown + ;; +- *) machine=${UNAME_MACHINE_ARCH}-unknown ;; ++ *) machine="$UNAME_MACHINE_ARCH"-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently (or will in the future) and ABI. +- case "${UNAME_MACHINE_ARCH}" in ++ case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) +- eval $set_cc_for_build ++ set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then +@@ -208,10 +219,10 @@ + ;; + esac + # Determine ABI tags. +- case "${UNAME_MACHINE_ARCH}" in ++ case "$UNAME_MACHINE_ARCH" in + earm*) + expr='s/^earmv[0-9]/-eabi/;s/eb$//' +- abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` ++ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + ;; + esac + # The OS release +@@ -219,45 +230,60 @@ + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. +- case "${UNAME_VERSION}" in ++ case "$UNAME_VERSION" in + Debian*) + release='-gnu' + ;; + *) +- release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` ++ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. +- echo "${machine}-${os}${release}${abi}" ++ echo "$machine-${os}${release}${abi-}" + exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` +- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} ++ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` +- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} ++ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` +- echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} ++ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" ++ exit ;; ++ *:MidnightBSD:*:*) ++ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" + exit ;; + *:ekkoBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" + exit ;; + *:SolidBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" ++ exit ;; ++ *:OS108:*:*) ++ echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + exit ;; + macppc:MirBSD:*:*) +- echo powerpc-unknown-mirbsd${UNAME_RELEASE} ++ echo powerpc-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:MirBSD:*:*) +- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" + exit ;; + *:Sortix:*:*) +- echo ${UNAME_MACHINE}-unknown-sortix ++ echo "$UNAME_MACHINE"-unknown-sortix ++ exit ;; ++ *:Twizzler:*:*) ++ echo "$UNAME_MACHINE"-unknown-twizzler ++ exit ;; ++ *:Redox:*:*) ++ echo "$UNAME_MACHINE"-unknown-redox ++ exit ;; ++ mips:OSF1:*.*) ++ echo mips-dec-osf1 + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in +@@ -310,28 +336,19 @@ + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. +- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` ++ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + exitcode=$? + trap '' 0 + exit $exitcode ;; +- Alpha\ *:Windows_NT*:*) +- # How do we know it's Interix rather than the generic POSIX subsystem? +- # Should we change UNAME_MACHINE based on the output of uname instead +- # of the specific Alpha model? +- echo alpha-pc-interix +- exit ;; +- 21064:Windows_NT:50:3) +- echo alpha-dec-winnt3.5 +- exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) +- echo ${UNAME_MACHINE}-unknown-amigaos ++ echo "$UNAME_MACHINE"-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) +- echo ${UNAME_MACHINE}-unknown-morphos ++ echo "$UNAME_MACHINE"-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition +@@ -343,7 +360,7 @@ + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) +- echo arm-acorn-riscix${UNAME_RELEASE} ++ echo arm-acorn-riscix"$UNAME_RELEASE" + exit ;; + arm*:riscos:*:*|arm*:RISCOS:*:*) + echo arm-unknown-riscos +@@ -370,24 +387,24 @@ + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) +- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + sun4H:SunOS:5.*:*) +- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) +- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) +- echo i386-pc-auroraux${UNAME_RELEASE} ++ echo i386-pc-auroraux"$UNAME_RELEASE" + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) +- eval $set_cc_for_build ++ set_cc_for_build + SUN_ARCH=i386 + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. +- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then ++ if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null +@@ -395,13 +412,13 @@ + SUN_ARCH=x86_64 + fi + fi +- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. +- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in +@@ -410,25 +427,25 @@ + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. +- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` ++ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + exit ;; + sun3*:SunOS:*:*) +- echo m68k-sun-sunos${UNAME_RELEASE} ++ echo m68k-sun-sunos"$UNAME_RELEASE" + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` +- test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 ++ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) +- echo m68k-sun-sunos${UNAME_RELEASE} ++ echo m68k-sun-sunos"$UNAME_RELEASE" + ;; + sun4) +- echo sparc-sun-sunos${UNAME_RELEASE} ++ echo sparc-sun-sunos"$UNAME_RELEASE" + ;; + esac + exit ;; + aushp:SunOS:*:*) +- echo sparc-auspex-sunos${UNAME_RELEASE} ++ echo sparc-auspex-sunos"$UNAME_RELEASE" + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not +@@ -439,44 +456,44 @@ + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} ++ echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} ++ echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) +- echo m68k-atari-mint${UNAME_RELEASE} ++ echo m68k-atari-mint"$UNAME_RELEASE" + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) +- echo m68k-milan-mint${UNAME_RELEASE} ++ echo m68k-milan-mint"$UNAME_RELEASE" + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) +- echo m68k-hades-mint${UNAME_RELEASE} ++ echo m68k-hades-mint"$UNAME_RELEASE" + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) +- echo m68k-unknown-mint${UNAME_RELEASE} ++ echo m68k-unknown-mint"$UNAME_RELEASE" + exit ;; + m68k:machten:*:*) +- echo m68k-apple-machten${UNAME_RELEASE} ++ echo m68k-apple-machten"$UNAME_RELEASE" + exit ;; + powerpc:machten:*:*) +- echo powerpc-apple-machten${UNAME_RELEASE} ++ echo powerpc-apple-machten"$UNAME_RELEASE" + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) +- echo mips-dec-ultrix${UNAME_RELEASE} ++ echo mips-dec-ultrix"$UNAME_RELEASE" + exit ;; + VAX*:ULTRIX*:*:*) +- echo vax-dec-ultrix${UNAME_RELEASE} ++ echo vax-dec-ultrix"$UNAME_RELEASE" + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) +- echo clipper-intergraph-clix${UNAME_RELEASE} ++ echo clipper-intergraph-clix"$UNAME_RELEASE" + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ set_cc_for_build ++ sed 's/^ //' << EOF > "$dummy.c" + #ifdef __cplusplus + #include /* for printf() prototype */ + int main (int argc, char *argv[]) { +@@ -485,23 +502,23 @@ + #endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) +- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); ++ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) +- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); ++ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) +- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); ++ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && +- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && +- SYSTEM_NAME=`$dummy $dummyarg` && ++ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && ++ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && ++ SYSTEM_NAME=`"$dummy" "$dummyarg"` && + { echo "$SYSTEM_NAME"; exit; } +- echo mips-mips-riscos${UNAME_RELEASE} ++ echo mips-mips-riscos"$UNAME_RELEASE" + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax +@@ -527,17 +544,17 @@ + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` +- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] ++ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 + then +- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ +- [ ${TARGET_BINARY_INTERFACE}x = x ] ++ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ ++ test "$TARGET_BINARY_INTERFACE"x = x + then +- echo m88k-dg-dgux${UNAME_RELEASE} ++ echo m88k-dg-dgux"$UNAME_RELEASE" + else +- echo m88k-dg-dguxbcs${UNAME_RELEASE} ++ echo m88k-dg-dguxbcs"$UNAME_RELEASE" + fi + else +- echo i586-dg-dgux${UNAME_RELEASE} ++ echo i586-dg-dgux"$UNAME_RELEASE" + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) +@@ -554,7 +571,7 @@ + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) +- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` ++ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id +@@ -563,17 +580,17 @@ + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) +- if [ -x /usr/bin/oslevel ] ; then ++ if test -x /usr/bin/oslevel ; then + IBM_REV=`/usr/bin/oslevel` + else +- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} ++ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi +- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} ++ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ set_cc_for_build ++ sed 's/^ //' << EOF > "$dummy.c" + #include + + main() +@@ -584,7 +601,7 @@ + exit(0); + } + EOF +- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` ++ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + then + echo "$SYSTEM_NAME" + else +@@ -598,27 +615,27 @@ + exit ;; + *:AIX:*:[4567]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` +- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then ++ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi +- if [ -x /usr/bin/lslpp ] ; then ++ if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + else +- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} ++ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" + fi +- echo ${IBM_ARCH}-ibm-aix${IBM_REV} ++ echo "$IBM_ARCH"-ibm-aix"$IBM_REV" + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; +- ibmrt:4.4BSD:*|romp-ibm:BSD:*) ++ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and +- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to ++ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx +@@ -633,28 +650,28 @@ + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) +- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` +- case "${UNAME_MACHINE}" in +- 9000/31? ) HP_ARCH=m68000 ;; +- 9000/[34]?? ) HP_ARCH=m68k ;; ++ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` ++ case "$UNAME_MACHINE" in ++ 9000/31?) HP_ARCH=m68000 ;; ++ 9000/[34]??) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) +- if [ -x /usr/bin/getconf ]; then ++ if test -x /usr/bin/getconf; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` +- case "${sc_cpu_version}" in ++ case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 +- case "${sc_kernel_bits}" in ++ case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 + esac ;; + esac + fi +- if [ "${HP_ARCH}" = "" ]; then +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ if test "$HP_ARCH" = ""; then ++ set_cc_for_build ++ sed 's/^ //' << EOF > "$dummy.c" + + #define _HPUX_SOURCE + #include +@@ -687,13 +704,13 @@ + exit (0); + } + EOF +- (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` ++ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac +- if [ ${HP_ARCH} = hppa2.0w ] ++ if test "$HP_ARCH" = hppa2.0w + then +- eval $set_cc_for_build ++ set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler +@@ -712,15 +729,15 @@ + HP_ARCH=hppa64 + fi + fi +- echo ${HP_ARCH}-hp-hpux${HPUX_REV} ++ echo "$HP_ARCH"-hp-hpux"$HPUX_REV" + exit ;; + ia64:HP-UX:*:*) +- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` +- echo ia64-hp-hpux${HPUX_REV} ++ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` ++ echo ia64-hp-hpux"$HPUX_REV" + exit ;; + 3050*:HI-UX:*:*) +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ set_cc_for_build ++ sed 's/^ //' << EOF > "$dummy.c" + #include + int + main () +@@ -745,11 +762,11 @@ + exit (0); + } + EOF +- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && ++ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; +- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) ++ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) +@@ -758,17 +775,17 @@ + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; +- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) ++ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) +- if [ -x /usr/sbin/sysversion ] ; then +- echo ${UNAME_MACHINE}-unknown-osf1mk ++ if test -x /usr/sbin/sysversion ; then ++ echo "$UNAME_MACHINE"-unknown-osf1mk + else +- echo ${UNAME_MACHINE}-unknown-osf1 ++ echo "$UNAME_MACHINE"-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) +@@ -793,131 +810,123 @@ + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) +- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) +- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ ++ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) +- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) +- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) +- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) +- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' ++ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` ++ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` +- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` ++ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) +- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" + exit ;; + sparc*:BSD/OS:*:*) +- echo sparc-unknown-bsdi${UNAME_RELEASE} ++ echo sparc-unknown-bsdi"$UNAME_RELEASE" + exit ;; + *:BSD/OS:*:*) +- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" ++ exit ;; ++ arm:FreeBSD:*:*) ++ UNAME_PROCESSOR=`uname -p` ++ set_cc_for_build ++ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ ++ | grep -q __ARM_PCS_VFP ++ then ++ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi ++ else ++ echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf ++ fi + exit ;; + *:FreeBSD:*:*) + UNAME_PROCESSOR=`/usr/bin/uname -p` +- case ${UNAME_PROCESSOR} in ++ case "$UNAME_PROCESSOR" in + amd64) + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; + esac +- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ++ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + i*:CYGWIN*:*) +- echo ${UNAME_MACHINE}-pc-cygwin ++ echo "$UNAME_MACHINE"-pc-cygwin + exit ;; + *:MINGW64*:*) +- echo ${UNAME_MACHINE}-pc-mingw64 ++ echo "$UNAME_MACHINE"-pc-mingw64 + exit ;; + *:MINGW*:*) +- echo ${UNAME_MACHINE}-pc-mingw32 ++ echo "$UNAME_MACHINE"-pc-mingw32 + exit ;; + *:MSYS*:*) +- echo ${UNAME_MACHINE}-pc-msys +- exit ;; +- i*:windows32*:*) +- # uname -m includes "-pc" on this system. +- echo ${UNAME_MACHINE}-mingw32 ++ echo "$UNAME_MACHINE"-pc-msys + exit ;; + i*:PW*:*) +- echo ${UNAME_MACHINE}-pc-pw32 ++ echo "$UNAME_MACHINE"-pc-pw32 + exit ;; + *:Interix*:*) +- case ${UNAME_MACHINE} in ++ case "$UNAME_MACHINE" in + x86) +- echo i586-pc-interix${UNAME_RELEASE} ++ echo i586-pc-interix"$UNAME_RELEASE" + exit ;; + authenticamd | genuineintel | EM64T) +- echo x86_64-unknown-interix${UNAME_RELEASE} ++ echo x86_64-unknown-interix"$UNAME_RELEASE" + exit ;; + IA64) +- echo ia64-unknown-interix${UNAME_RELEASE} ++ echo ia64-unknown-interix"$UNAME_RELEASE" + exit ;; + esac ;; +- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) +- echo i${UNAME_MACHINE}-pc-mks +- exit ;; +- 8664:Windows_NT:*) +- echo x86_64-pc-mks +- exit ;; +- i*:Windows_NT*:* | Pentium*:Windows_NT*:*) +- # How do we know it's Interix rather than the generic POSIX subsystem? +- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we +- # UNAME_MACHINE based on the output of uname instead of i386? +- echo i586-pc-interix +- exit ;; + i*:UWIN*:*) +- echo ${UNAME_MACHINE}-pc-uwin ++ echo "$UNAME_MACHINE"-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) +- echo x86_64-unknown-cygwin +- exit ;; +- p*:CYGWIN*:*) +- echo powerpcle-unknown-cygwin ++ echo x86_64-pc-cygwin + exit ;; + prep*:SunOS:5.*:*) +- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` ++ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + exit ;; + *:GNU:*:*) + # the GNU system +- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` ++ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland +- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} ++ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + exit ;; +- i*86:Minix:*:*) +- echo ${UNAME_MACHINE}-pc-minix ++ *:Minix:*:*) ++ echo "$UNAME_MACHINE"-unknown-minix + exit ;; + aarch64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + aarch64_be:Linux:*:*) + UNAME_MACHINE=aarch64_be +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + alpha:Linux:*:*) +- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in ++ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; +@@ -928,140 +937,178 @@ + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + arm*:Linux:*:*) +- eval $set_cc_for_build ++ set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + else + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi + else +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf + fi + fi + exit ;; + avr32*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + cris:Linux:*:*) +- echo ${UNAME_MACHINE}-axis-linux-${LIBC} ++ echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + crisv32:Linux:*:*) +- echo ${UNAME_MACHINE}-axis-linux-${LIBC} ++ echo "$UNAME_MACHINE"-axis-linux-"$LIBC" + exit ;; + e2k:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + frv:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + hexagon:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:Linux:*:*) +- echo ${UNAME_MACHINE}-pc-linux-${LIBC} ++ echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + exit ;; + ia64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + k1om:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m32r*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + m68*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) +- eval $set_cc_for_build +- sed 's/^ //' << EOF >$dummy.c ++ set_cc_for_build ++ IS_GLIBC=0 ++ test x"${LIBC}" = xgnu && IS_GLIBC=1 ++ sed 's/^ //' << EOF > "$dummy.c" + #undef CPU +- #undef ${UNAME_MACHINE} +- #undef ${UNAME_MACHINE}el ++ #undef mips ++ #undef mipsel ++ #undef mips64 ++ #undef mips64el ++ #if ${IS_GLIBC} && defined(_ABI64) ++ LIBCABI=gnuabi64 ++ #else ++ #if ${IS_GLIBC} && defined(_ABIN32) ++ LIBCABI=gnuabin32 ++ #else ++ LIBCABI=${LIBC} ++ #endif ++ #endif ++ ++ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 ++ CPU=mipsisa64r6 ++ #else ++ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 ++ CPU=mipsisa32r6 ++ #else ++ #if defined(__mips64) ++ CPU=mips64 ++ #else ++ CPU=mips ++ #endif ++ #endif ++ #endif ++ + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) +- CPU=${UNAME_MACHINE}el ++ MIPS_ENDIAN=el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) +- CPU=${UNAME_MACHINE} ++ MIPS_ENDIAN= + #else +- CPU= ++ MIPS_ENDIAN= + #endif + #endif + EOF +- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` +- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ++ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" ++ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + openrisc*:Linux:*:*) +- echo or1k-unknown-linux-${LIBC} ++ echo or1k-unknown-linux-"$LIBC" + exit ;; + or32:Linux:*:* | or1k*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + padre:Linux:*:*) +- echo sparc-unknown-linux-${LIBC} ++ echo sparc-unknown-linux-"$LIBC" + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) +- echo hppa64-unknown-linux-${LIBC} ++ echo hppa64-unknown-linux-"$LIBC" + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in +- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; +- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; +- *) echo hppa-unknown-linux-${LIBC} ;; ++ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; ++ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; ++ *) echo hppa-unknown-linux-"$LIBC" ;; + esac + exit ;; + ppc64:Linux:*:*) +- echo powerpc64-unknown-linux-${LIBC} ++ echo powerpc64-unknown-linux-"$LIBC" + exit ;; + ppc:Linux:*:*) +- echo powerpc-unknown-linux-${LIBC} ++ echo powerpc-unknown-linux-"$LIBC" + exit ;; + ppc64le:Linux:*:*) +- echo powerpc64le-unknown-linux-${LIBC} ++ echo powerpc64le-unknown-linux-"$LIBC" + exit ;; + ppcle:Linux:*:*) +- echo powerpcle-unknown-linux-${LIBC} ++ echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) +- echo ${UNAME_MACHINE}-ibm-linux-${LIBC} ++ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" + exit ;; + sh64*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sh*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + tile*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + vax:Linux:*:*) +- echo ${UNAME_MACHINE}-dec-linux-${LIBC} ++ echo "$UNAME_MACHINE"-dec-linux-"$LIBC" + exit ;; + x86_64:Linux:*:*) +- echo ${UNAME_MACHINE}-pc-linux-${LIBC} ++ set_cc_for_build ++ LIBCABI=$LIBC ++ if test "$CC_FOR_BUILD" != no_compiler_found; then ++ if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ ++ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_X32 >/dev/null ++ then ++ LIBCABI="$LIBC"x32 ++ fi ++ fi ++ echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" + exit ;; + xtensa*:Linux:*:*) +- echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. +@@ -1075,34 +1122,34 @@ + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. +- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} ++ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. +- echo ${UNAME_MACHINE}-pc-os2-emx ++ echo "$UNAME_MACHINE"-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) +- echo ${UNAME_MACHINE}-unknown-stop ++ echo "$UNAME_MACHINE"-unknown-stop + exit ;; + i*86:atheos:*:*) +- echo ${UNAME_MACHINE}-unknown-atheos ++ echo "$UNAME_MACHINE"-unknown-atheos + exit ;; + i*86:syllable:*:*) +- echo ${UNAME_MACHINE}-pc-syllable ++ echo "$UNAME_MACHINE"-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) +- echo i386-unknown-lynxos${UNAME_RELEASE} ++ echo i386-unknown-lynxos"$UNAME_RELEASE" + exit ;; + i*86:*DOS:*:*) +- echo ${UNAME_MACHINE}-pc-msdosdjgpp ++ echo "$UNAME_MACHINE"-pc-msdosdjgpp + exit ;; +- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) +- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` ++ i*86:*:4.*:*) ++ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then +- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} ++ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" + else +- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} ++ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" + fi + exit ;; + i*86:*:5:[678]*) +@@ -1112,12 +1159,12 @@ + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac +- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ++ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}" + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 +@@ -1127,9 +1174,9 @@ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 +- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL ++ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" + else +- echo ${UNAME_MACHINE}-pc-sysv32 ++ echo "$UNAME_MACHINE"-pc-sysv32 + fi + exit ;; + pc:*:*:*) +@@ -1149,9 +1196,9 @@ + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then +- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 ++ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. +- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 ++ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) +@@ -1171,9 +1218,9 @@ + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ +- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; ++ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; +@@ -1182,28 +1229,28 @@ + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ +- && { echo i486-ncr-sysv4.3${OS_REL}; exit; } ++ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ +- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ++ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ +- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; ++ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) +- echo m68k-unknown-lynxos${UNAME_RELEASE} ++ echo m68k-unknown-lynxos"$UNAME_RELEASE" + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) +- echo sparc-unknown-lynxos${UNAME_RELEASE} ++ echo sparc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + rs6000:LynxOS:2.*:*) +- echo rs6000-unknown-lynxos${UNAME_RELEASE} ++ echo rs6000-unknown-lynxos"$UNAME_RELEASE" + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) +- echo powerpc-unknown-lynxos${UNAME_RELEASE} ++ echo powerpc-unknown-lynxos"$UNAME_RELEASE" + exit ;; + SM[BE]S:UNIX_SV:*:*) +- echo mips-dde-sysv${UNAME_RELEASE} ++ echo mips-dde-sysv"$UNAME_RELEASE" + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 +@@ -1214,7 +1261,7 @@ + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` +- echo ${UNAME_MACHINE}-sni-sysv4 ++ echo "$UNAME_MACHINE"-sni-sysv4 + else + echo ns32k-sni-sysv + fi +@@ -1234,23 +1281,23 @@ + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. +- echo ${UNAME_MACHINE}-stratus-vos ++ echo "$UNAME_MACHINE"-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) +- echo m68k-apple-aux${UNAME_RELEASE} ++ echo m68k-apple-aux"$UNAME_RELEASE" + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) +- if [ -d /usr/nec ]; then +- echo mips-nec-sysv${UNAME_RELEASE} ++ if test -d /usr/nec; then ++ echo mips-nec-sysv"$UNAME_RELEASE" + else +- echo mips-unknown-sysv${UNAME_RELEASE} ++ echo mips-unknown-sysv"$UNAME_RELEASE" + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. +@@ -1269,60 +1316,71 @@ + echo x86_64-unknown-haiku + exit ;; + SX-4:SUPER-UX:*:*) +- echo sx4-nec-superux${UNAME_RELEASE} ++ echo sx4-nec-superux"$UNAME_RELEASE" + exit ;; + SX-5:SUPER-UX:*:*) +- echo sx5-nec-superux${UNAME_RELEASE} ++ echo sx5-nec-superux"$UNAME_RELEASE" + exit ;; + SX-6:SUPER-UX:*:*) +- echo sx6-nec-superux${UNAME_RELEASE} ++ echo sx6-nec-superux"$UNAME_RELEASE" + exit ;; + SX-7:SUPER-UX:*:*) +- echo sx7-nec-superux${UNAME_RELEASE} ++ echo sx7-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8:SUPER-UX:*:*) +- echo sx8-nec-superux${UNAME_RELEASE} ++ echo sx8-nec-superux"$UNAME_RELEASE" + exit ;; + SX-8R:SUPER-UX:*:*) +- echo sx8r-nec-superux${UNAME_RELEASE} ++ echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) +- echo sxace-nec-superux${UNAME_RELEASE} ++ echo sxace-nec-superux"$UNAME_RELEASE" + exit ;; + Power*:Rhapsody:*:*) +- echo powerpc-apple-rhapsody${UNAME_RELEASE} ++ echo powerpc-apple-rhapsody"$UNAME_RELEASE" + exit ;; + *:Rhapsody:*:*) +- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" ++ exit ;; ++ arm64:Darwin:*:*) ++ echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; + *:Darwin:*:*) +- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown +- eval $set_cc_for_build +- if test "$UNAME_PROCESSOR" = unknown ; then +- UNAME_PROCESSOR=powerpc +- fi +- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then +- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then +- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ +- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ +- grep IS_64BIT_ARCH >/dev/null +- then +- case $UNAME_PROCESSOR in +- i386) UNAME_PROCESSOR=x86_64 ;; +- powerpc) UNAME_PROCESSOR=powerpc64 ;; +- esac +- fi ++ UNAME_PROCESSOR=`uname -p` ++ case $UNAME_PROCESSOR in ++ unknown) UNAME_PROCESSOR=powerpc ;; ++ esac ++ if command -v xcode-select > /dev/null 2> /dev/null && \ ++ ! xcode-select --print-path > /dev/null 2> /dev/null ; then ++ # Avoid executing cc if there is no toolchain installed as ++ # cc will be a stub that puts up a graphical alert ++ # prompting the user to install developer tools. ++ CC_FOR_BUILD=no_compiler_found ++ else ++ set_cc_for_build ++ fi ++ if test "$CC_FOR_BUILD" != no_compiler_found; then ++ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ ++ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_64BIT_ARCH >/dev/null ++ then ++ case $UNAME_PROCESSOR in ++ i386) UNAME_PROCESSOR=x86_64 ;; ++ powerpc) UNAME_PROCESSOR=powerpc64 ;; ++ esac ++ fi ++ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc ++ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ ++ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ ++ grep IS_PPC >/dev/null ++ then ++ UNAME_PROCESSOR=powerpc + fi + elif test "$UNAME_PROCESSOR" = i386 ; then +- # Avoid executing cc on OS X 10.9, as it ships with a stub +- # that puts up a graphical alert prompting to install +- # developer tools. Any system running Mac OS X 10.7 or +- # later (Darwin 11 and later) is required to have a 64-bit +- # processor. This is not true of the ARM version of Darwin +- # that Apple uses in portable devices. +- UNAME_PROCESSOR=x86_64 ++ # uname -m returns i386 or x86_64 ++ UNAME_PROCESSOR=$UNAME_MACHINE + fi +- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} ++ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` +@@ -1330,22 +1388,25 @@ + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi +- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} ++ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NEO-*:NONSTOP_KERNEL:*:*) +- echo neo-tandem-nsk${UNAME_RELEASE} ++ echo neo-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSE-*:NONSTOP_KERNEL:*:*) +- echo nse-tandem-nsk${UNAME_RELEASE} ++ echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) +- echo nsr-tandem-nsk${UNAME_RELEASE} ++ echo nsr-tandem-nsk"$UNAME_RELEASE" ++ exit ;; ++ NSV-*:NONSTOP_KERNEL:*:*) ++ echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) +- echo nsx-tandem-nsk${UNAME_RELEASE} ++ echo nsx-tandem-nsk"$UNAME_RELEASE" + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux +@@ -1354,18 +1415,19 @@ + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) +- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} ++ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. ++ # shellcheck disable=SC2154 + if test "$cputype" = 386; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi +- echo ${UNAME_MACHINE}-unknown-plan9 ++ echo "$UNAME_MACHINE"-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 +@@ -1386,14 +1448,14 @@ + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) +- echo mips-sei-seiux${UNAME_RELEASE} ++ echo mips-sei-seiux"$UNAME_RELEASE" + exit ;; + *:DragonFly:*:*) +- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ++ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` +- case "${UNAME_MACHINE}" in ++ case "$UNAME_MACHINE" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; +@@ -1402,32 +1464,190 @@ + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) +- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` ++ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + exit ;; + i*86:rdos:*:*) +- echo ${UNAME_MACHINE}-pc-rdos ++ echo "$UNAME_MACHINE"-pc-rdos + exit ;; + i*86:AROS:*:*) +- echo ${UNAME_MACHINE}-pc-aros ++ echo "$UNAME_MACHINE"-pc-aros + exit ;; + x86_64:VMkernel:*:*) +- echo ${UNAME_MACHINE}-unknown-esx ++ echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; ++ *:Unleashed:*:*) ++ echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" ++ exit ;; ++esac ++ ++# No uname command or uname output not recognized. ++set_cc_for_build ++cat > "$dummy.c" < ++#include ++#endif ++#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) ++#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) ++#include ++#if defined(_SIZE_T_) || defined(SIGLOST) ++#include ++#endif ++#endif ++#endif ++main () ++{ ++#if defined (sony) ++#if defined (MIPSEB) ++ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, ++ I don't know.... */ ++ printf ("mips-sony-bsd\n"); exit (0); ++#else ++#include ++ printf ("m68k-sony-newsos%s\n", ++#ifdef NEWSOS4 ++ "4" ++#else ++ "" ++#endif ++ ); exit (0); ++#endif ++#endif ++ ++#if defined (NeXT) ++#if !defined (__ARCHITECTURE__) ++#define __ARCHITECTURE__ "m68k" ++#endif ++ int version; ++ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; ++ if (version < 4) ++ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); ++ else ++ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); ++ exit (0); ++#endif ++ ++#if defined (MULTIMAX) || defined (n16) ++#if defined (UMAXV) ++ printf ("ns32k-encore-sysv\n"); exit (0); ++#else ++#if defined (CMU) ++ printf ("ns32k-encore-mach\n"); exit (0); ++#else ++ printf ("ns32k-encore-bsd\n"); exit (0); ++#endif ++#endif ++#endif ++ ++#if defined (__386BSD__) ++ printf ("i386-pc-bsd\n"); exit (0); ++#endif ++ ++#if defined (sequent) ++#if defined (i386) ++ printf ("i386-sequent-dynix\n"); exit (0); ++#endif ++#if defined (ns32000) ++ printf ("ns32k-sequent-dynix\n"); exit (0); ++#endif ++#endif ++ ++#if defined (_SEQUENT_) ++ struct utsname un; ++ ++ uname(&un); ++ if (strncmp(un.version, "V2", 2) == 0) { ++ printf ("i386-sequent-ptx2\n"); exit (0); ++ } ++ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ ++ printf ("i386-sequent-ptx1\n"); exit (0); ++ } ++ printf ("i386-sequent-ptx\n"); exit (0); ++#endif ++ ++#if defined (vax) ++#if !defined (ultrix) ++#include ++#if defined (BSD) ++#if BSD == 43 ++ printf ("vax-dec-bsd4.3\n"); exit (0); ++#else ++#if BSD == 199006 ++ printf ("vax-dec-bsd4.3reno\n"); exit (0); ++#else ++ printf ("vax-dec-bsd\n"); exit (0); ++#endif ++#endif ++#else ++ printf ("vax-dec-bsd\n"); exit (0); ++#endif ++#else ++#if defined(_SIZE_T_) || defined(SIGLOST) ++ struct utsname un; ++ uname (&un); ++ printf ("vax-dec-ultrix%s\n", un.release); exit (0); ++#else ++ printf ("vax-dec-ultrix\n"); exit (0); ++#endif ++#endif ++#endif ++#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) ++#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) ++#if defined(_SIZE_T_) || defined(SIGLOST) ++ struct utsname *un; ++ uname (&un); ++ printf ("mips-dec-ultrix%s\n", un.release); exit (0); ++#else ++ printf ("mips-dec-ultrix\n"); exit (0); ++#endif ++#endif ++#endif ++ ++#if defined (alliant) && defined (i860) ++ printf ("i860-alliant-bsd\n"); exit (0); ++#endif ++ ++ exit (1); ++} ++EOF ++ ++$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && ++ { echo "$SYSTEM_NAME"; exit; } ++ ++# Apollos put the system type in the environment. ++test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } ++ ++echo "$0: unable to guess system type" >&2 ++ ++case "$UNAME_MACHINE:$UNAME_SYSTEM" in ++ mips:Linux | mips64:Linux) ++ # If we got here on MIPS GNU/Linux, output extra information. ++ cat >&2 <&2 <&2 </dev/null` + /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +-UNAME_MACHINE = ${UNAME_MACHINE} +-UNAME_RELEASE = ${UNAME_RELEASE} +-UNAME_SYSTEM = ${UNAME_SYSTEM} +-UNAME_VERSION = ${UNAME_VERSION} ++UNAME_MACHINE = "$UNAME_MACHINE" ++UNAME_RELEASE = "$UNAME_RELEASE" ++UNAME_SYSTEM = "$UNAME_SYSTEM" ++UNAME_VERSION = "$UNAME_VERSION" + EOF ++fi + + exit 1 + + # Local variables: +-# eval: (add-hook 'write-file-hooks 'time-stamp) ++# eval: (add-hook 'before-save-hook 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" +diff -ur libffi-3.3/config.sub libffi-3.3.new/config.sub +--- libffi-3.3/config.sub 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/config.sub 2021-01-04 19:48:49.000000000 -0700 +@@ -1,8 +1,8 @@ + #! /bin/sh + # Configuration validation subroutine script. +-# Copyright 1992-2017 Free Software Foundation, Inc. ++# Copyright 1992-2020 Free Software Foundation, Inc. + +-timestamp='2017-04-02' ++timestamp='2020-08-17' + + # This file is free software; you can redistribute it and/or modify it + # under the terms of the GNU General Public License as published by +@@ -15,7 +15,7 @@ + # General Public License for more details. + # + # You should have received a copy of the GNU General Public License +-# along with this program; if not, see . ++# along with this program; if not, see . + # + # As a special exception to the GNU General Public License, if you + # distribute this file as part of a program that contains a +@@ -33,7 +33,7 @@ + # Otherwise, we print the canonical config type on stdout and succeed. + + # You can get the latest version of this script from: +-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub ++# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + + # This file is supposed to be the same for all GNU packages + # and recognize all the CPU types, system types and aliases +@@ -57,7 +57,7 @@ + + Canonicalize a configuration name. + +-Operation modes: ++Options: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit +@@ -67,7 +67,7 @@ + version="\ + GNU config.sub ($timestamp) + +-Copyright 1992-2017 Free Software Foundation, Inc. ++Copyright 1992-2020 Free Software Foundation, Inc. + + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." +@@ -89,12 +89,12 @@ + - ) # Use stdin as input. + break ;; + -* ) +- echo "$me: invalid option $1$help" ++ echo "$me: invalid option $1$help" >&2 + exit 1 ;; + + *local*) + # First pass through any local machine types. +- echo $1 ++ echo "$1" + exit ;; + + * ) +@@ -110,1252 +110,1167 @@ + exit 1;; + esac + +-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +-# Here we must recognize all the valid KERNEL-OS combinations. +-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +-case $maybe_os in +- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ +- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ +- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ +- kopensolaris*-gnu* | cloudabi*-eabi* | \ +- storm-chaos* | os2-emx* | rtmk-nova*) +- os=-$maybe_os +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` +- ;; +- android-linux) +- os=-linux-android +- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown +- ;; +- *) +- basic_machine=`echo $1 | sed 's/-[^-]*$//'` +- if [ $basic_machine != $1 ] +- then os=`echo $1 | sed 's/.*-/-/'` +- else os=; fi +- ;; +-esac +- +-### Let's recognize common machines as not being operating systems so +-### that things like config.sub decstation-3100 work. We also +-### recognize some manufacturers as not being operating systems, so we +-### can provide default operating systems below. +-case $os in +- -sun*os*) +- # Prevent following clause from handling this invalid input. +- ;; +- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ +- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ +- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ +- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ +- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ +- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple | -axis | -knuth | -cray | -microblaze*) +- os= +- basic_machine=$1 +- ;; +- -bluegene*) +- os=-cnk +- ;; +- -sim | -cisco | -oki | -wec | -winbond) +- os= +- basic_machine=$1 +- ;; +- -scout) +- ;; +- -wrs) +- os=-vxworks +- basic_machine=$1 +- ;; +- -chorusos*) +- os=-chorusos +- basic_machine=$1 +- ;; +- -chorusrdb) +- os=-chorusrdb +- basic_machine=$1 +- ;; +- -hiux*) +- os=-hiuxwe2 +- ;; +- -sco6) +- os=-sco5v6 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5) +- os=-sco3.2v5 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco4) +- os=-sco3.2v4 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2.[4-9]*) +- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco3.2v[4-9]*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco5v6*) +- # Don't forget version if it is 3.2v4 or newer. +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -sco*) +- os=-sco3.2v2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -udk*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -isc) +- os=-isc2.2 +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -clix*) +- basic_machine=clipper-intergraph +- ;; +- -isc*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` +- ;; +- -lynx*178) +- os=-lynxos178 +- ;; +- -lynx*5) +- os=-lynxos5 +- ;; +- -lynx*) +- os=-lynxos ++# Split fields of configuration type ++# shellcheck disable=SC2162 ++IFS="-" read field1 field2 field3 field4 <&2 ++ exit 1 + ;; +- -ptx*) +- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ++ *-*-*-*) ++ basic_machine=$field1-$field2 ++ basic_os=$field3-$field4 + ;; +- -windowsnt*) +- os=`echo $os | sed -e 's/windowsnt/winnt/'` ++ *-*-*) ++ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two ++ # parts ++ maybe_os=$field2-$field3 ++ case $maybe_os in ++ nto-qnx* | linux-* | uclinux-uclibc* \ ++ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ ++ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ ++ | storm-chaos* | os2-emx* | rtmk-nova*) ++ basic_machine=$field1 ++ basic_os=$maybe_os ++ ;; ++ android-linux) ++ basic_machine=$field1-unknown ++ basic_os=linux-android ++ ;; ++ *) ++ basic_machine=$field1-$field2 ++ basic_os=$field3 ++ ;; ++ esac + ;; +- -psos*) +- os=-psos ++ *-*) ++ # A lone config we happen to match not fitting any pattern ++ case $field1-$field2 in ++ decstation-3100) ++ basic_machine=mips-dec ++ basic_os= ++ ;; ++ *-*) ++ # Second component is usually, but not always the OS ++ case $field2 in ++ # Prevent following clause from handling this valid os ++ sun*os*) ++ basic_machine=$field1 ++ basic_os=$field2 ++ ;; ++ # Manufacturers ++ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ ++ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ ++ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ ++ | convergent* | ncr* | news | 32* | 3600* | 3100* \ ++ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ ++ | ultra | tti* | harris | dolphin | highlevel | gould \ ++ | cbm | ns | masscomp | apple | axis | knuth | cray \ ++ | microblaze* | sim | cisco \ ++ | oki | wec | wrs | winbond) ++ basic_machine=$field1-$field2 ++ basic_os= ++ ;; ++ *) ++ basic_machine=$field1 ++ basic_os=$field2 ++ ;; ++ esac ++ ;; ++ esac + ;; +- -mint | -mint[0-9]*) +- basic_machine=m68k-atari +- os=-mint ++ *) ++ # Convert single-component short-hands not valid as part of ++ # multi-component configurations. ++ case $field1 in ++ 386bsd) ++ basic_machine=i386-pc ++ basic_os=bsd ++ ;; ++ a29khif) ++ basic_machine=a29k-amd ++ basic_os=udi ++ ;; ++ adobe68k) ++ basic_machine=m68010-adobe ++ basic_os=scout ++ ;; ++ alliant) ++ basic_machine=fx80-alliant ++ basic_os= ++ ;; ++ altos | altos3068) ++ basic_machine=m68k-altos ++ basic_os= ++ ;; ++ am29k) ++ basic_machine=a29k-none ++ basic_os=bsd ++ ;; ++ amdahl) ++ basic_machine=580-amdahl ++ basic_os=sysv ++ ;; ++ amiga) ++ basic_machine=m68k-unknown ++ basic_os= ++ ;; ++ amigaos | amigados) ++ basic_machine=m68k-unknown ++ basic_os=amigaos ++ ;; ++ amigaunix | amix) ++ basic_machine=m68k-unknown ++ basic_os=sysv4 ++ ;; ++ apollo68) ++ basic_machine=m68k-apollo ++ basic_os=sysv ++ ;; ++ apollo68bsd) ++ basic_machine=m68k-apollo ++ basic_os=bsd ++ ;; ++ aros) ++ basic_machine=i386-pc ++ basic_os=aros ++ ;; ++ aux) ++ basic_machine=m68k-apple ++ basic_os=aux ++ ;; ++ balance) ++ basic_machine=ns32k-sequent ++ basic_os=dynix ++ ;; ++ blackfin) ++ basic_machine=bfin-unknown ++ basic_os=linux ++ ;; ++ cegcc) ++ basic_machine=arm-unknown ++ basic_os=cegcc ++ ;; ++ convex-c1) ++ basic_machine=c1-convex ++ basic_os=bsd ++ ;; ++ convex-c2) ++ basic_machine=c2-convex ++ basic_os=bsd ++ ;; ++ convex-c32) ++ basic_machine=c32-convex ++ basic_os=bsd ++ ;; ++ convex-c34) ++ basic_machine=c34-convex ++ basic_os=bsd ++ ;; ++ convex-c38) ++ basic_machine=c38-convex ++ basic_os=bsd ++ ;; ++ cray) ++ basic_machine=j90-cray ++ basic_os=unicos ++ ;; ++ crds | unos) ++ basic_machine=m68k-crds ++ basic_os= ++ ;; ++ da30) ++ basic_machine=m68k-da30 ++ basic_os= ++ ;; ++ decstation | pmax | pmin | dec3100 | decstatn) ++ basic_machine=mips-dec ++ basic_os= ++ ;; ++ delta88) ++ basic_machine=m88k-motorola ++ basic_os=sysv3 ++ ;; ++ dicos) ++ basic_machine=i686-pc ++ basic_os=dicos ++ ;; ++ djgpp) ++ basic_machine=i586-pc ++ basic_os=msdosdjgpp ++ ;; ++ ebmon29k) ++ basic_machine=a29k-amd ++ basic_os=ebmon ++ ;; ++ es1800 | OSE68k | ose68k | ose | OSE) ++ basic_machine=m68k-ericsson ++ basic_os=ose ++ ;; ++ gmicro) ++ basic_machine=tron-gmicro ++ basic_os=sysv ++ ;; ++ go32) ++ basic_machine=i386-pc ++ basic_os=go32 ++ ;; ++ h8300hms) ++ basic_machine=h8300-hitachi ++ basic_os=hms ++ ;; ++ h8300xray) ++ basic_machine=h8300-hitachi ++ basic_os=xray ++ ;; ++ h8500hms) ++ basic_machine=h8500-hitachi ++ basic_os=hms ++ ;; ++ harris) ++ basic_machine=m88k-harris ++ basic_os=sysv3 ++ ;; ++ hp300 | hp300hpux) ++ basic_machine=m68k-hp ++ basic_os=hpux ++ ;; ++ hp300bsd) ++ basic_machine=m68k-hp ++ basic_os=bsd ++ ;; ++ hppaosf) ++ basic_machine=hppa1.1-hp ++ basic_os=osf ++ ;; ++ hppro) ++ basic_machine=hppa1.1-hp ++ basic_os=proelf ++ ;; ++ i386mach) ++ basic_machine=i386-mach ++ basic_os=mach ++ ;; ++ isi68 | isi) ++ basic_machine=m68k-isi ++ basic_os=sysv ++ ;; ++ m68knommu) ++ basic_machine=m68k-unknown ++ basic_os=linux ++ ;; ++ magnum | m3230) ++ basic_machine=mips-mips ++ basic_os=sysv ++ ;; ++ merlin) ++ basic_machine=ns32k-utek ++ basic_os=sysv ++ ;; ++ mingw64) ++ basic_machine=x86_64-pc ++ basic_os=mingw64 ++ ;; ++ mingw32) ++ basic_machine=i686-pc ++ basic_os=mingw32 ++ ;; ++ mingw32ce) ++ basic_machine=arm-unknown ++ basic_os=mingw32ce ++ ;; ++ monitor) ++ basic_machine=m68k-rom68k ++ basic_os=coff ++ ;; ++ morphos) ++ basic_machine=powerpc-unknown ++ basic_os=morphos ++ ;; ++ moxiebox) ++ basic_machine=moxie-unknown ++ basic_os=moxiebox ++ ;; ++ msdos) ++ basic_machine=i386-pc ++ basic_os=msdos ++ ;; ++ msys) ++ basic_machine=i686-pc ++ basic_os=msys ++ ;; ++ mvs) ++ basic_machine=i370-ibm ++ basic_os=mvs ++ ;; ++ nacl) ++ basic_machine=le32-unknown ++ basic_os=nacl ++ ;; ++ ncr3000) ++ basic_machine=i486-ncr ++ basic_os=sysv4 ++ ;; ++ netbsd386) ++ basic_machine=i386-pc ++ basic_os=netbsd ++ ;; ++ netwinder) ++ basic_machine=armv4l-rebel ++ basic_os=linux ++ ;; ++ news | news700 | news800 | news900) ++ basic_machine=m68k-sony ++ basic_os=newsos ++ ;; ++ news1000) ++ basic_machine=m68030-sony ++ basic_os=newsos ++ ;; ++ necv70) ++ basic_machine=v70-nec ++ basic_os=sysv ++ ;; ++ nh3000) ++ basic_machine=m68k-harris ++ basic_os=cxux ++ ;; ++ nh[45]000) ++ basic_machine=m88k-harris ++ basic_os=cxux ++ ;; ++ nindy960) ++ basic_machine=i960-intel ++ basic_os=nindy ++ ;; ++ mon960) ++ basic_machine=i960-intel ++ basic_os=mon960 ++ ;; ++ nonstopux) ++ basic_machine=mips-compaq ++ basic_os=nonstopux ++ ;; ++ os400) ++ basic_machine=powerpc-ibm ++ basic_os=os400 ++ ;; ++ OSE68000 | ose68000) ++ basic_machine=m68000-ericsson ++ basic_os=ose ++ ;; ++ os68k) ++ basic_machine=m68k-none ++ basic_os=os68k ++ ;; ++ paragon) ++ basic_machine=i860-intel ++ basic_os=osf ++ ;; ++ parisc) ++ basic_machine=hppa-unknown ++ basic_os=linux ++ ;; ++ psp) ++ basic_machine=mipsallegrexel-sony ++ basic_os=psp ++ ;; ++ pw32) ++ basic_machine=i586-unknown ++ basic_os=pw32 ++ ;; ++ rdos | rdos64) ++ basic_machine=x86_64-pc ++ basic_os=rdos ++ ;; ++ rdos32) ++ basic_machine=i386-pc ++ basic_os=rdos ++ ;; ++ rom68k) ++ basic_machine=m68k-rom68k ++ basic_os=coff ++ ;; ++ sa29200) ++ basic_machine=a29k-amd ++ basic_os=udi ++ ;; ++ sei) ++ basic_machine=mips-sei ++ basic_os=seiux ++ ;; ++ sequent) ++ basic_machine=i386-sequent ++ basic_os= ++ ;; ++ sps7) ++ basic_machine=m68k-bull ++ basic_os=sysv2 ++ ;; ++ st2000) ++ basic_machine=m68k-tandem ++ basic_os= ++ ;; ++ stratus) ++ basic_machine=i860-stratus ++ basic_os=sysv4 ++ ;; ++ sun2) ++ basic_machine=m68000-sun ++ basic_os= ++ ;; ++ sun2os3) ++ basic_machine=m68000-sun ++ basic_os=sunos3 ++ ;; ++ sun2os4) ++ basic_machine=m68000-sun ++ basic_os=sunos4 ++ ;; ++ sun3) ++ basic_machine=m68k-sun ++ basic_os= ++ ;; ++ sun3os3) ++ basic_machine=m68k-sun ++ basic_os=sunos3 ++ ;; ++ sun3os4) ++ basic_machine=m68k-sun ++ basic_os=sunos4 ++ ;; ++ sun4) ++ basic_machine=sparc-sun ++ basic_os= ++ ;; ++ sun4os3) ++ basic_machine=sparc-sun ++ basic_os=sunos3 ++ ;; ++ sun4os4) ++ basic_machine=sparc-sun ++ basic_os=sunos4 ++ ;; ++ sun4sol2) ++ basic_machine=sparc-sun ++ basic_os=solaris2 ++ ;; ++ sun386 | sun386i | roadrunner) ++ basic_machine=i386-sun ++ basic_os= ++ ;; ++ sv1) ++ basic_machine=sv1-cray ++ basic_os=unicos ++ ;; ++ symmetry) ++ basic_machine=i386-sequent ++ basic_os=dynix ++ ;; ++ t3e) ++ basic_machine=alphaev5-cray ++ basic_os=unicos ++ ;; ++ t90) ++ basic_machine=t90-cray ++ basic_os=unicos ++ ;; ++ toad1) ++ basic_machine=pdp10-xkl ++ basic_os=tops20 ++ ;; ++ tpf) ++ basic_machine=s390x-ibm ++ basic_os=tpf ++ ;; ++ udi29k) ++ basic_machine=a29k-amd ++ basic_os=udi ++ ;; ++ ultra3) ++ basic_machine=a29k-nyu ++ basic_os=sym1 ++ ;; ++ v810 | necv810) ++ basic_machine=v810-nec ++ basic_os=none ++ ;; ++ vaxv) ++ basic_machine=vax-dec ++ basic_os=sysv ++ ;; ++ vms) ++ basic_machine=vax-dec ++ basic_os=vms ++ ;; ++ vsta) ++ basic_machine=i386-pc ++ basic_os=vsta ++ ;; ++ vxworks960) ++ basic_machine=i960-wrs ++ basic_os=vxworks ++ ;; ++ vxworks68) ++ basic_machine=m68k-wrs ++ basic_os=vxworks ++ ;; ++ vxworks29k) ++ basic_machine=a29k-wrs ++ basic_os=vxworks ++ ;; ++ xbox) ++ basic_machine=i686-pc ++ basic_os=mingw32 ++ ;; ++ ymp) ++ basic_machine=ymp-cray ++ basic_os=unicos ++ ;; ++ *) ++ basic_machine=$1 ++ basic_os= ++ ;; ++ esac + ;; + esac + +-# Decode aliases for certain CPU-COMPANY combinations. ++# Decode 1-component or ad-hoc basic machines + case $basic_machine in +- # Recognize the basic CPU types without company name. +- # Some are omitted here because they have special meanings below. +- 1750a | 580 \ +- | a29k \ +- | aarch64 | aarch64_be \ +- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ +- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ +- | am33_2.0 \ +- | arc | arceb \ +- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ +- | avr | avr32 \ +- | ba \ +- | be32 | be64 \ +- | bfin \ +- | c4x | c8051 | clipper \ +- | d10v | d30v | dlx | dsp16xx \ +- | e2k | epiphany \ +- | fido | fr30 | frv | ft32 \ +- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ +- | hexagon \ +- | i370 | i860 | i960 | ia16 | ia64 \ +- | ip2k | iq2000 \ +- | k1om \ +- | le32 | le64 \ +- | lm32 \ +- | m32c | m32r | m32rle | m68000 | m68k | m88k \ +- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ +- | mips | mipsbe | mipseb | mipsel | mipsle \ +- | mips16 \ +- | mips64 | mips64el \ +- | mips64octeon | mips64octeonel \ +- | mips64orion | mips64orionel \ +- | mips64r5900 | mips64r5900el \ +- | mips64vr | mips64vrel \ +- | mips64vr4100 | mips64vr4100el \ +- | mips64vr4300 | mips64vr4300el \ +- | mips64vr5000 | mips64vr5000el \ +- | mips64vr5900 | mips64vr5900el \ +- | mipsisa32 | mipsisa32el \ +- | mipsisa32r2 | mipsisa32r2el \ +- | mipsisa32r6 | mipsisa32r6el \ +- | mipsisa64 | mipsisa64el \ +- | mipsisa64r2 | mipsisa64r2el \ +- | mipsisa64r6 | mipsisa64r6el \ +- | mipsisa64sb1 | mipsisa64sb1el \ +- | mipsisa64sr71k | mipsisa64sr71kel \ +- | mipsr5900 | mipsr5900el \ +- | mipstx39 | mipstx39el \ +- | mn10200 | mn10300 \ +- | moxie \ +- | mt \ +- | msp430 \ +- | nds32 | nds32le | nds32be \ +- | nios | nios2 | nios2eb | nios2el \ +- | ns16k | ns32k \ +- | open8 | or1k | or1knd | or32 \ +- | pdp10 | pdp11 | pj | pjl \ +- | powerpc | powerpc64 | powerpc64le | powerpcle \ +- | pru \ +- | pyramid \ +- | riscv32 | riscv64 \ +- | rl78 | rx \ +- | score \ +- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ +- | sh64 | sh64le \ +- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ +- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ +- | spu \ +- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ +- | ubicom32 \ +- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ +- | visium \ +- | wasm32 \ +- | we32k \ +- | x86 | xc16x | xstormy16 | xtensa \ +- | z8k | z80) +- basic_machine=$basic_machine-unknown +- ;; +- c54x) +- basic_machine=tic54x-unknown +- ;; +- c55x) +- basic_machine=tic55x-unknown +- ;; +- c6x) +- basic_machine=tic6x-unknown +- ;; +- leon|leon[3-9]) +- basic_machine=sparc-$basic_machine +- ;; +- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) +- basic_machine=$basic_machine-unknown +- os=-none ++ # Here we handle the default manufacturer of certain CPU types. It is in ++ # some cases the only manufacturer, in others, it is the most popular. ++ w89k) ++ cpu=hppa1.1 ++ vendor=winbond + ;; +- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ++ op50n) ++ cpu=hppa1.1 ++ vendor=oki + ;; +- ms1) +- basic_machine=mt-unknown ++ op60c) ++ cpu=hppa1.1 ++ vendor=oki + ;; +- +- strongarm | thumb | xscale) +- basic_machine=arm-unknown ++ ibm*) ++ cpu=i370 ++ vendor=ibm + ;; +- xgate) +- basic_machine=$basic_machine-unknown +- os=-none ++ orion105) ++ cpu=clipper ++ vendor=highlevel + ;; +- xscaleeb) +- basic_machine=armeb-unknown ++ mac | mpw | mac-mpw) ++ cpu=m68k ++ vendor=apple + ;; +- +- xscaleel) +- basic_machine=armel-unknown ++ pmac | pmac-mpw) ++ cpu=powerpc ++ vendor=apple + ;; + +- # We use `pc' rather than `unknown' +- # because (1) that's what they normally are, and +- # (2) the word "unknown" tends to confuse beginning users. +- i*86 | x86_64) +- basic_machine=$basic_machine-pc +- ;; +- # Object if more than one company name word. +- *-*-*) +- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 +- exit 1 +- ;; +- # Recognize the basic CPU types with company name. +- 580-* \ +- | a29k-* \ +- | aarch64-* | aarch64_be-* \ +- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ +- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ +- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ +- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ +- | avr-* | avr32-* \ +- | ba-* \ +- | be32-* | be64-* \ +- | bfin-* | bs2000-* \ +- | c[123]* | c30-* | [cjt]90-* | c4x-* \ +- | c8051-* | clipper-* | craynv-* | cydra-* \ +- | d10v-* | d30v-* | dlx-* \ +- | e2k-* | elxsi-* \ +- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ +- | h8300-* | h8500-* \ +- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ +- | hexagon-* \ +- | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ +- | ip2k-* | iq2000-* \ +- | k1om-* \ +- | le32-* | le64-* \ +- | lm32-* \ +- | m32c-* | m32r-* | m32rle-* \ +- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ +- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ +- | microblaze-* | microblazeel-* \ +- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ +- | mips16-* \ +- | mips64-* | mips64el-* \ +- | mips64octeon-* | mips64octeonel-* \ +- | mips64orion-* | mips64orionel-* \ +- | mips64r5900-* | mips64r5900el-* \ +- | mips64vr-* | mips64vrel-* \ +- | mips64vr4100-* | mips64vr4100el-* \ +- | mips64vr4300-* | mips64vr4300el-* \ +- | mips64vr5000-* | mips64vr5000el-* \ +- | mips64vr5900-* | mips64vr5900el-* \ +- | mipsisa32-* | mipsisa32el-* \ +- | mipsisa32r2-* | mipsisa32r2el-* \ +- | mipsisa32r6-* | mipsisa32r6el-* \ +- | mipsisa64-* | mipsisa64el-* \ +- | mipsisa64r2-* | mipsisa64r2el-* \ +- | mipsisa64r6-* | mipsisa64r6el-* \ +- | mipsisa64sb1-* | mipsisa64sb1el-* \ +- | mipsisa64sr71k-* | mipsisa64sr71kel-* \ +- | mipsr5900-* | mipsr5900el-* \ +- | mipstx39-* | mipstx39el-* \ +- | mmix-* \ +- | mt-* \ +- | msp430-* \ +- | nds32-* | nds32le-* | nds32be-* \ +- | nios-* | nios2-* | nios2eb-* | nios2el-* \ +- | none-* | np1-* | ns16k-* | ns32k-* \ +- | open8-* \ +- | or1k*-* \ +- | orion-* \ +- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ +- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ +- | pru-* \ +- | pyramid-* \ +- | riscv32-* | riscv64-* \ +- | rl78-* | romp-* | rs6000-* | rx-* \ +- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ +- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ +- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ +- | sparclite-* \ +- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ +- | tahoe-* \ +- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ +- | tile*-* \ +- | tron-* \ +- | ubicom32-* \ +- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ +- | vax-* \ +- | visium-* \ +- | wasm32-* \ +- | we32k-* \ +- | x86-* | x86_64-* | xc16x-* | xps100-* \ +- | xstormy16-* | xtensa*-* \ +- | ymp-* \ +- | z8k-* | z80-*) +- ;; +- # Recognize the basic CPU types without company name, with glob match. +- xtensa*) +- basic_machine=$basic_machine-unknown +- ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. +- 386bsd) +- basic_machine=i386-unknown +- os=-bsd +- ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) +- basic_machine=m68000-att ++ cpu=m68000 ++ vendor=att + ;; + 3b*) +- basic_machine=we32k-att +- ;; +- a29khif) +- basic_machine=a29k-amd +- os=-udi +- ;; +- abacus) +- basic_machine=abacus-unknown +- ;; +- adobe68k) +- basic_machine=m68010-adobe +- os=-scout +- ;; +- alliant | fx80) +- basic_machine=fx80-alliant +- ;; +- altos | altos3068) +- basic_machine=m68k-altos +- ;; +- am29k) +- basic_machine=a29k-none +- os=-bsd +- ;; +- amd64) +- basic_machine=x86_64-pc +- ;; +- amd64-*) +- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- amdahl) +- basic_machine=580-amdahl +- os=-sysv +- ;; +- amiga | amiga-*) +- basic_machine=m68k-unknown +- ;; +- amigaos | amigados) +- basic_machine=m68k-unknown +- os=-amigaos +- ;; +- amigaunix | amix) +- basic_machine=m68k-unknown +- os=-sysv4 +- ;; +- apollo68) +- basic_machine=m68k-apollo +- os=-sysv +- ;; +- apollo68bsd) +- basic_machine=m68k-apollo +- os=-bsd +- ;; +- aros) +- basic_machine=i386-pc +- os=-aros +- ;; +- asmjs) +- basic_machine=asmjs-unknown +- ;; +- aux) +- basic_machine=m68k-apple +- os=-aux +- ;; +- balance) +- basic_machine=ns32k-sequent +- os=-dynix +- ;; +- blackfin) +- basic_machine=bfin-unknown +- os=-linux +- ;; +- blackfin-*) +- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux ++ cpu=we32k ++ vendor=att + ;; + bluegene*) +- basic_machine=powerpc-ibm +- os=-cnk +- ;; +- c54x-*) +- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c55x-*) +- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c6x-*) +- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- c90) +- basic_machine=c90-cray +- os=-unicos +- ;; +- cegcc) +- basic_machine=arm-unknown +- os=-cegcc +- ;; +- convex-c1) +- basic_machine=c1-convex +- os=-bsd +- ;; +- convex-c2) +- basic_machine=c2-convex +- os=-bsd +- ;; +- convex-c32) +- basic_machine=c32-convex +- os=-bsd +- ;; +- convex-c34) +- basic_machine=c34-convex +- os=-bsd +- ;; +- convex-c38) +- basic_machine=c38-convex +- os=-bsd +- ;; +- cray | j90) +- basic_machine=j90-cray +- os=-unicos +- ;; +- craynv) +- basic_machine=craynv-cray +- os=-unicosmp +- ;; +- cr16 | cr16-*) +- basic_machine=cr16-unknown +- os=-elf +- ;; +- crds | unos) +- basic_machine=m68k-crds +- ;; +- crisv32 | crisv32-* | etraxfs*) +- basic_machine=crisv32-axis +- ;; +- cris | cris-* | etrax*) +- basic_machine=cris-axis +- ;; +- crx) +- basic_machine=crx-unknown +- os=-elf +- ;; +- da30 | da30-*) +- basic_machine=m68k-da30 +- ;; +- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) +- basic_machine=mips-dec ++ cpu=powerpc ++ vendor=ibm ++ basic_os=cnk + ;; + decsystem10* | dec10*) +- basic_machine=pdp10-dec +- os=-tops10 ++ cpu=pdp10 ++ vendor=dec ++ basic_os=tops10 + ;; + decsystem20* | dec20*) +- basic_machine=pdp10-dec +- os=-tops20 ++ cpu=pdp10 ++ vendor=dec ++ basic_os=tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) +- basic_machine=m68k-motorola ++ cpu=m68k ++ vendor=motorola + ;; +- delta88) +- basic_machine=m88k-motorola +- os=-sysv3 +- ;; +- dicos) +- basic_machine=i686-pc +- os=-dicos +- ;; +- djgpp) +- basic_machine=i586-pc +- os=-msdosdjgpp +- ;; +- dpx20 | dpx20-*) +- basic_machine=rs6000-bull +- os=-bosx +- ;; +- dpx2* | dpx2*-bull) +- basic_machine=m68k-bull +- os=-sysv3 +- ;; +- e500v[12]) +- basic_machine=powerpc-unknown +- os=$os"spe" +- ;; +- e500v[12]-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=$os"spe" +- ;; +- ebmon29k) +- basic_machine=a29k-amd +- os=-ebmon +- ;; +- elxsi) +- basic_machine=elxsi-elxsi +- os=-bsd ++ dpx2*) ++ cpu=m68k ++ vendor=bull ++ basic_os=sysv3 + ;; + encore | umax | mmax) +- basic_machine=ns32k-encore ++ cpu=ns32k ++ vendor=encore + ;; +- es1800 | OSE68k | ose68k | ose | OSE) +- basic_machine=m68k-ericsson +- os=-ose ++ elxsi) ++ cpu=elxsi ++ vendor=elxsi ++ basic_os=${basic_os:-bsd} + ;; + fx2800) +- basic_machine=i860-alliant ++ cpu=i860 ++ vendor=alliant + ;; + genix) +- basic_machine=ns32k-ns +- ;; +- gmicro) +- basic_machine=tron-gmicro +- os=-sysv +- ;; +- go32) +- basic_machine=i386-pc +- os=-go32 ++ cpu=ns32k ++ vendor=ns + ;; + h3050r* | hiux*) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 +- ;; +- h8300hms) +- basic_machine=h8300-hitachi +- os=-hms +- ;; +- h8300xray) +- basic_machine=h8300-hitachi +- os=-xray +- ;; +- h8500hms) +- basic_machine=h8500-hitachi +- os=-hms +- ;; +- harris) +- basic_machine=m88k-harris +- os=-sysv3 +- ;; +- hp300-*) +- basic_machine=m68k-hp +- ;; +- hp300bsd) +- basic_machine=m68k-hp +- os=-bsd +- ;; +- hp300hpux) +- basic_machine=m68k-hp +- os=-hpux ++ cpu=hppa1.1 ++ vendor=hitachi ++ basic_os=hiuxwe2 + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) +- basic_machine=hppa1.0-hp ++ cpu=hppa1.0 ++ vendor=hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) +- basic_machine=m68000-hp ++ cpu=m68000 ++ vendor=hp + ;; + hp9k3[2-9][0-9]) +- basic_machine=m68k-hp ++ cpu=m68k ++ vendor=hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) +- basic_machine=hppa1.0-hp ++ cpu=hppa1.0 ++ vendor=hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) +- basic_machine=hppa1.1-hp ++ cpu=hppa1.1 ++ vendor=hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) +- basic_machine=hppa1.0-hp +- ;; +- hppa-next) +- os=-nextstep3 +- ;; +- hppaosf) +- basic_machine=hppa1.1-hp +- os=-osf +- ;; +- hppro) +- basic_machine=hppa1.1-hp +- os=-proelf +- ;; +- i370-ibm* | ibm*) +- basic_machine=i370-ibm ++ cpu=hppa1.0 ++ vendor=hp + ;; + i*86v32) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv32 ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=sysv32 + ;; + i*86v4*) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv4 ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=sysv4 + ;; + i*86v) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-sysv ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=sysv + ;; + i*86sol2) +- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` +- os=-solaris2 +- ;; +- i386mach) +- basic_machine=i386-mach +- os=-mach +- ;; +- i386-vsta | vsta) +- basic_machine=i386-unknown +- os=-vsta ++ cpu=`echo "$1" | sed -e 's/86.*/86/'` ++ vendor=pc ++ basic_os=solaris2 ++ ;; ++ j90 | j90-cray) ++ cpu=j90 ++ vendor=cray ++ basic_os=${basic_os:-unicos} + ;; + iris | iris4d) +- basic_machine=mips-sgi +- case $os in +- -irix*) ++ cpu=mips ++ vendor=sgi ++ case $basic_os in ++ irix*) + ;; + *) +- os=-irix4 ++ basic_os=irix4 + ;; + esac + ;; +- isi68 | isi) +- basic_machine=m68k-isi +- os=-sysv +- ;; +- leon-*|leon[3-9]-*) +- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` +- ;; +- m68knommu) +- basic_machine=m68k-unknown +- os=-linux +- ;; +- m68knommu-*) +- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux +- ;; +- m88k-omron*) +- basic_machine=m88k-omron +- ;; +- magnum | m3230) +- basic_machine=mips-mips +- os=-sysv +- ;; +- merlin) +- basic_machine=ns32k-utek +- os=-sysv +- ;; +- microblaze*) +- basic_machine=microblaze-xilinx +- ;; +- mingw64) +- basic_machine=x86_64-pc +- os=-mingw64 +- ;; +- mingw32) +- basic_machine=i686-pc +- os=-mingw32 +- ;; +- mingw32ce) +- basic_machine=arm-unknown +- os=-mingw32ce +- ;; + miniframe) +- basic_machine=m68000-convergent +- ;; +- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) +- basic_machine=m68k-atari +- os=-mint +- ;; +- mips3*-*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ++ cpu=m68000 ++ vendor=convergent + ;; +- mips3*) +- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown +- ;; +- monitor) +- basic_machine=m68k-rom68k +- os=-coff +- ;; +- morphos) +- basic_machine=powerpc-unknown +- os=-morphos +- ;; +- moxiebox) +- basic_machine=moxie-unknown +- os=-moxiebox +- ;; +- msdos) +- basic_machine=i386-pc +- os=-msdos +- ;; +- ms1-*) +- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` +- ;; +- msys) +- basic_machine=i686-pc +- os=-msys +- ;; +- mvs) +- basic_machine=i370-ibm +- os=-mvs +- ;; +- nacl) +- basic_machine=le32-unknown +- os=-nacl +- ;; +- ncr3000) +- basic_machine=i486-ncr +- os=-sysv4 +- ;; +- netbsd386) +- basic_machine=i386-unknown +- os=-netbsd +- ;; +- netwinder) +- basic_machine=armv4l-rebel +- os=-linux +- ;; +- news | news700 | news800 | news900) +- basic_machine=m68k-sony +- os=-newsos +- ;; +- news1000) +- basic_machine=m68030-sony +- os=-newsos ++ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) ++ cpu=m68k ++ vendor=atari ++ basic_os=mint + ;; + news-3600 | risc-news) +- basic_machine=mips-sony +- os=-newsos +- ;; +- necv70) +- basic_machine=v70-nec +- os=-sysv +- ;; +- next | m*-next ) +- basic_machine=m68k-next +- case $os in +- -nextstep* ) ++ cpu=mips ++ vendor=sony ++ basic_os=newsos ++ ;; ++ next | m*-next) ++ cpu=m68k ++ vendor=next ++ case $basic_os in ++ openstep*) ++ ;; ++ nextstep*) + ;; +- -ns2*) +- os=-nextstep2 ++ ns2*) ++ basic_os=nextstep2 + ;; + *) +- os=-nextstep3 ++ basic_os=nextstep3 + ;; + esac + ;; +- nh3000) +- basic_machine=m68k-harris +- os=-cxux +- ;; +- nh[45]000) +- basic_machine=m88k-harris +- os=-cxux +- ;; +- nindy960) +- basic_machine=i960-intel +- os=-nindy +- ;; +- mon960) +- basic_machine=i960-intel +- os=-mon960 +- ;; +- nonstopux) +- basic_machine=mips-compaq +- os=-nonstopux +- ;; + np1) +- basic_machine=np1-gould +- ;; +- neo-tandem) +- basic_machine=neo-tandem +- ;; +- nse-tandem) +- basic_machine=nse-tandem +- ;; +- nsr-tandem) +- basic_machine=nsr-tandem +- ;; +- nsx-tandem) +- basic_machine=nsx-tandem ++ cpu=np1 ++ vendor=gould + ;; + op50n-* | op60c-*) +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- openrisc | openrisc-*) +- basic_machine=or32-unknown +- ;; +- os400) +- basic_machine=powerpc-ibm +- os=-os400 +- ;; +- OSE68000 | ose68000) +- basic_machine=m68000-ericsson +- os=-ose +- ;; +- os68k) +- basic_machine=m68k-none +- os=-os68k ++ cpu=hppa1.1 ++ vendor=oki ++ basic_os=proelf + ;; + pa-hitachi) +- basic_machine=hppa1.1-hitachi +- os=-hiuxwe2 +- ;; +- paragon) +- basic_machine=i860-intel +- os=-osf +- ;; +- parisc) +- basic_machine=hppa-unknown +- os=-linux +- ;; +- parisc-*) +- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` +- os=-linux ++ cpu=hppa1.1 ++ vendor=hitachi ++ basic_os=hiuxwe2 + ;; + pbd) +- basic_machine=sparc-tti ++ cpu=sparc ++ vendor=tti + ;; + pbb) +- basic_machine=m68k-tti +- ;; +- pc532 | pc532-*) +- basic_machine=ns32k-pc532 ++ cpu=m68k ++ vendor=tti + ;; +- pc98) +- basic_machine=i386-pc +- ;; +- pc98-*) +- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ++ pc532) ++ cpu=ns32k ++ vendor=pc532 + ;; +- pentium | p5 | k5 | k6 | nexgen | viac3) +- basic_machine=i586-pc +- ;; +- pentiumpro | p6 | 6x86 | athlon | athlon_*) +- basic_machine=i686-pc +- ;; +- pentiumii | pentium2 | pentiumiii | pentium3) +- basic_machine=i686-pc ++ pn) ++ cpu=pn ++ vendor=gould + ;; +- pentium4) +- basic_machine=i786-pc ++ power) ++ cpu=power ++ vendor=ibm + ;; +- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) +- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ps2) ++ cpu=i386 ++ vendor=ibm + ;; +- pentiumpro-* | p6-* | 6x86-* | athlon-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ++ rm[46]00) ++ cpu=mips ++ vendor=siemens + ;; +- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) +- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ++ rtpc | rtpc-*) ++ cpu=romp ++ vendor=ibm + ;; +- pentium4-*) +- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ++ sde) ++ cpu=mipsisa32 ++ vendor=sde ++ basic_os=${basic_os:-elf} ++ ;; ++ simso-wrs) ++ cpu=sparclite ++ vendor=wrs ++ basic_os=vxworks + ;; +- pn) +- basic_machine=pn-gould ++ tower | tower-32) ++ cpu=m68k ++ vendor=ncr + ;; +- power) basic_machine=power-ibm ++ vpp*|vx|vx-*) ++ cpu=f301 ++ vendor=fujitsu + ;; +- ppc | ppcbe) basic_machine=powerpc-unknown ++ w65) ++ cpu=w65 ++ vendor=wdc + ;; +- ppc-* | ppcbe-*) +- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` +- ;; +- ppcle | powerpclittle) +- basic_machine=powerpcle-unknown ++ w89k-*) ++ cpu=hppa1.1 ++ vendor=winbond ++ basic_os=proelf + ;; +- ppcle-* | powerpclittle-*) +- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ++ none) ++ cpu=none ++ vendor=none + ;; +- ppc64) basic_machine=powerpc64-unknown ++ leon|leon[3-9]) ++ cpu=sparc ++ vendor=$basic_machine + ;; +- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ leon-*|leon[3-9]-*) ++ cpu=sparc ++ vendor=`echo "$basic_machine" | sed 's/-.*//'` + ;; +- ppc64le | powerpc64little) +- basic_machine=powerpc64le-unknown ++ ++ *-*) ++ # shellcheck disable=SC2162 ++ IFS="-" read cpu vendor <&2 +- exit 1 ++ # Recognize the canonical CPU types that are allowed with any ++ # company name. ++ case $cpu in ++ 1750a | 580 \ ++ | a29k \ ++ | aarch64 | aarch64_be \ ++ | abacus \ ++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ ++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ ++ | alphapca5[67] | alpha64pca5[67] \ ++ | am33_2.0 \ ++ | amdgcn \ ++ | arc | arceb \ ++ | arm | arm[lb]e | arme[lb] | armv* \ ++ | avr | avr32 \ ++ | asmjs \ ++ | ba \ ++ | be32 | be64 \ ++ | bfin | bpf | bs2000 \ ++ | c[123]* | c30 | [cjt]90 | c4x \ ++ | c8051 | clipper | craynv | csky | cydra \ ++ | d10v | d30v | dlx | dsp16xx \ ++ | e2k | elxsi | epiphany \ ++ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ ++ | h8300 | h8500 \ ++ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ ++ | hexagon \ ++ | i370 | i*86 | i860 | i960 | ia16 | ia64 \ ++ | ip2k | iq2000 \ ++ | k1om \ ++ | le32 | le64 \ ++ | lm32 \ ++ | m32c | m32r | m32rle \ ++ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ ++ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ ++ | m88110 | m88k | maxq | mb | mcore | mep | metag \ ++ | microblaze | microblazeel \ ++ | mips | mipsbe | mipseb | mipsel | mipsle \ ++ | mips16 \ ++ | mips64 | mips64eb | mips64el \ ++ | mips64octeon | mips64octeonel \ ++ | mips64orion | mips64orionel \ ++ | mips64r5900 | mips64r5900el \ ++ | mips64vr | mips64vrel \ ++ | mips64vr4100 | mips64vr4100el \ ++ | mips64vr4300 | mips64vr4300el \ ++ | mips64vr5000 | mips64vr5000el \ ++ | mips64vr5900 | mips64vr5900el \ ++ | mipsisa32 | mipsisa32el \ ++ | mipsisa32r2 | mipsisa32r2el \ ++ | mipsisa32r6 | mipsisa32r6el \ ++ | mipsisa64 | mipsisa64el \ ++ | mipsisa64r2 | mipsisa64r2el \ ++ | mipsisa64r6 | mipsisa64r6el \ ++ | mipsisa64sb1 | mipsisa64sb1el \ ++ | mipsisa64sr71k | mipsisa64sr71kel \ ++ | mipsr5900 | mipsr5900el \ ++ | mipstx39 | mipstx39el \ ++ | mmix \ ++ | mn10200 | mn10300 \ ++ | moxie \ ++ | mt \ ++ | msp430 \ ++ | nds32 | nds32le | nds32be \ ++ | nfp \ ++ | nios | nios2 | nios2eb | nios2el \ ++ | none | np1 | ns16k | ns32k | nvptx \ ++ | open8 \ ++ | or1k* \ ++ | or32 \ ++ | orion \ ++ | picochip \ ++ | pdp10 | pdp11 | pj | pjl | pn | power \ ++ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ ++ | pru \ ++ | pyramid \ ++ | riscv | riscv32 | riscv64 \ ++ | rl78 | romp | rs6000 | rx \ ++ | s390 | s390x \ ++ | score \ ++ | sh | shl \ ++ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ ++ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ ++ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ ++ | sparclite \ ++ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ ++ | spu \ ++ | tahoe \ ++ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ ++ | tron \ ++ | ubicom32 \ ++ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ ++ | vax \ ++ | visium \ ++ | w65 \ ++ | wasm32 | wasm64 \ ++ | we32k \ ++ | x86 | x86_64 | xc16x | xgate | xps100 \ ++ | xstormy16 | xtensa* \ ++ | ymp \ ++ | z8k | z80) ++ ;; ++ ++ *) ++ echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 ++ exit 1 ++ ;; ++ esac + ;; + esac + + # Here we canonicalize certain aliases for manufacturers. +-case $basic_machine in +- *-digital*) +- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ++case $vendor in ++ digital*) ++ vendor=dec + ;; +- *-commodore*) +- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ++ commodore*) ++ vendor=cbm + ;; + *) + ;; +@@ -1363,203 +1278,215 @@ + + # Decode manufacturer-specific aliases for certain operating systems. + +-if [ x"$os" != x"" ] ++if test x$basic_os != x + then +-case $os in +- # First match some system type aliases +- # that might get confused with valid system types. +- # -solaris* is a basic system type, with this one exception. +- -auroraux) +- os=-auroraux ++ ++# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just ++# set os. ++case $basic_os in ++ gnu/linux*) ++ kernel=linux ++ os=`echo $basic_os | sed -e 's|gnu/linux|gnu|'` ++ ;; ++ nto-qnx*) ++ kernel=nto ++ os=`echo $basic_os | sed -e 's|nto-qnx|qnx|'` ++ ;; ++ *-*) ++ # shellcheck disable=SC2162 ++ IFS="-" read kernel os <&2 +- exit 1 ++ # No normalization, but not necessarily accepted, that comes below. + ;; + esac ++ + else + + # Here we handle the default operating systems that come with various machines. +@@ -1572,264 +1499,352 @@ + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + +-case $basic_machine in ++kernel= ++case $cpu-$vendor in + score-*) +- os=-elf ++ os=elf + ;; + spu-*) +- os=-elf ++ os=elf + ;; + *-acorn) +- os=-riscix1.2 ++ os=riscix1.2 + ;; + arm*-rebel) +- os=-linux ++ kernel=linux ++ os=gnu + ;; + arm*-semi) +- os=-aout ++ os=aout + ;; + c4x-* | tic4x-*) +- os=-coff ++ os=coff + ;; + c8051-*) +- os=-elf ++ os=elf ++ ;; ++ clipper-intergraph) ++ os=clix + ;; + hexagon-*) +- os=-elf ++ os=elf + ;; + tic54x-*) +- os=-coff ++ os=coff + ;; + tic55x-*) +- os=-coff ++ os=coff + ;; + tic6x-*) +- os=-coff ++ os=coff + ;; + # This must come before the *-dec entry. + pdp10-*) +- os=-tops20 ++ os=tops20 + ;; + pdp11-*) +- os=-none ++ os=none + ;; + *-dec | vax-*) +- os=-ultrix4.2 ++ os=ultrix4.2 + ;; + m68*-apollo) +- os=-domain ++ os=domain + ;; + i386-sun) +- os=-sunos4.0.2 ++ os=sunos4.0.2 + ;; + m68000-sun) +- os=-sunos3 ++ os=sunos3 + ;; + m68*-cisco) +- os=-aout ++ os=aout + ;; + mep-*) +- os=-elf ++ os=elf + ;; + mips*-cisco) +- os=-elf ++ os=elf + ;; + mips*-*) +- os=-elf ++ os=elf + ;; + or32-*) +- os=-coff ++ os=coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. +- os=-sysv3 ++ os=sysv3 + ;; + sparc-* | *-sun) +- os=-sunos4.1.1 ++ os=sunos4.1.1 + ;; + pru-*) +- os=-elf ++ os=elf + ;; + *-be) +- os=-beos +- ;; +- *-haiku) +- os=-haiku ++ os=beos + ;; + *-ibm) +- os=-aix ++ os=aix + ;; + *-knuth) +- os=-mmixware ++ os=mmixware + ;; + *-wec) +- os=-proelf ++ os=proelf + ;; + *-winbond) +- os=-proelf ++ os=proelf + ;; + *-oki) +- os=-proelf ++ os=proelf + ;; + *-hp) +- os=-hpux ++ os=hpux + ;; + *-hitachi) +- os=-hiux ++ os=hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) +- os=-sysv ++ os=sysv + ;; + *-cbm) +- os=-amigaos ++ os=amigaos + ;; + *-dg) +- os=-dgux ++ os=dgux + ;; + *-dolphin) +- os=-sysv3 ++ os=sysv3 + ;; + m68k-ccur) +- os=-rtu ++ os=rtu + ;; + m88k-omron*) +- os=-luna ++ os=luna + ;; +- *-next ) +- os=-nextstep ++ *-next) ++ os=nextstep + ;; + *-sequent) +- os=-ptx ++ os=ptx + ;; + *-crds) +- os=-unos ++ os=unos + ;; + *-ns) +- os=-genix ++ os=genix + ;; + i370-*) +- os=-mvs +- ;; +- *-next) +- os=-nextstep3 ++ os=mvs + ;; + *-gould) +- os=-sysv ++ os=sysv + ;; + *-highlevel) +- os=-bsd ++ os=bsd + ;; + *-encore) +- os=-bsd ++ os=bsd + ;; + *-sgi) +- os=-irix ++ os=irix + ;; + *-siemens) +- os=-sysv4 ++ os=sysv4 + ;; + *-masscomp) +- os=-rtu ++ os=rtu + ;; + f30[01]-fujitsu | f700-fujitsu) +- os=-uxpv ++ os=uxpv + ;; + *-rom68k) +- os=-coff ++ os=coff + ;; + *-*bug) +- os=-coff ++ os=coff + ;; + *-apple) +- os=-macos ++ os=macos + ;; + *-atari*) +- os=-mint ++ os=mint ++ ;; ++ *-wrs) ++ os=vxworks + ;; + *) +- os=-none ++ os=none + ;; + esac ++ + fi + ++# Now, validate our (potentially fixed-up) OS. ++case $os in ++ # Sometimes we do "kernel-abi", so those need to count as OSes. ++ musl* | newlib* | uclibc*) ++ ;; ++ # Likewise for "kernel-libc" ++ eabi | eabihf | gnueabi | gnueabihf) ++ ;; ++ # Now accept the basic system types. ++ # The portable systems comes first. ++ # Each alternative MUST end in a * to match a version number. ++ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ ++ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ ++ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ ++ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ ++ | hiux* | abug | nacl* | netware* | windows* \ ++ | os9* | macos* | osx* | ios* \ ++ | mpw* | magic* | mmixware* | mon960* | lnews* \ ++ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ ++ | aos* | aros* | cloudabi* | sortix* | twizzler* \ ++ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ ++ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ ++ | mirbsd* | netbsd* | dicos* | openedition* | ose* \ ++ | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \ ++ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ ++ | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ ++ | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ ++ | udi* | lites* | ieee* | go32* | aux* | hcos* \ ++ | chorusrdb* | cegcc* | glidix* \ ++ | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ ++ | midipix* | mingw32* | mingw64* | mint* \ ++ | uxpv* | beos* | mpeix* | udk* | moxiebox* \ ++ | interix* | uwin* | mks* | rhapsody* | darwin* \ ++ | openstep* | oskit* | conix* | pw32* | nonstopux* \ ++ | storm-chaos* | tops10* | tenex* | tops20* | its* \ ++ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ ++ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ ++ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ ++ | skyos* | haiku* | rdos* | toppers* | drops* | es* \ ++ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ ++ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ ++ | nsk* | powerunix* | genode* | zvmoe* ) ++ ;; ++ # This one is extra strict with allowed versions ++ sco3.2v2 | sco3.2v[4-9]* | sco5v6*) ++ # Don't forget version if it is 3.2v4 or newer. ++ ;; ++ none) ++ ;; ++ *) ++ echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 ++ exit 1 ++ ;; ++esac ++ ++# As a final step for OS-related things, validate the OS-kernel combination ++# (given a valid OS), if there is a kernel. ++case $kernel-$os in ++ linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) ++ ;; ++ -dietlibc* | -newlib* | -musl* | -uclibc* ) ++ # These are just libc implementations, not actual OSes, and thus ++ # require a kernel. ++ echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 ++ exit 1 ++ ;; ++ kfreebsd*-gnu* | kopensolaris*-gnu*) ++ ;; ++ nto-qnx*) ++ ;; ++ *-eabi* | *-gnueabi*) ++ ;; ++ -*) ++ # Blank kernel with real OS is always fine. ++ ;; ++ *-*) ++ echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 ++ exit 1 ++ ;; ++esac ++ + # Here we handle the case where we know the os, and the CPU type, but not the + # manufacturer. We pick the logical manufacturer. +-vendor=unknown +-case $basic_machine in +- *-unknown) +- case $os in +- -riscix*) ++case $vendor in ++ unknown) ++ case $cpu-$os in ++ *-riscix*) + vendor=acorn + ;; +- -sunos*) ++ *-sunos*) + vendor=sun + ;; +- -cnk*|-aix*) ++ *-cnk* | *-aix*) + vendor=ibm + ;; +- -beos*) ++ *-beos*) + vendor=be + ;; +- -hpux*) ++ *-hpux*) + vendor=hp + ;; +- -mpeix*) ++ *-mpeix*) + vendor=hp + ;; +- -hiux*) ++ *-hiux*) + vendor=hitachi + ;; +- -unos*) ++ *-unos*) + vendor=crds + ;; +- -dgux*) ++ *-dgux*) + vendor=dg + ;; +- -luna*) ++ *-luna*) + vendor=omron + ;; +- -genix*) ++ *-genix*) + vendor=ns + ;; +- -mvs* | -opened*) ++ *-clix*) ++ vendor=intergraph ++ ;; ++ *-mvs* | *-opened*) ++ vendor=ibm ++ ;; ++ *-os400*) + vendor=ibm + ;; +- -os400*) ++ s390-* | s390x-*) + vendor=ibm + ;; +- -ptx*) ++ *-ptx*) + vendor=sequent + ;; +- -tpf*) ++ *-tpf*) + vendor=ibm + ;; +- -vxsim* | -vxworks* | -windiss*) ++ *-vxsim* | *-vxworks* | *-windiss*) + vendor=wrs + ;; +- -aux*) ++ *-aux*) + vendor=apple + ;; +- -hms*) ++ *-hms*) + vendor=hitachi + ;; +- -mpw* | -macos*) ++ *-mpw* | *-macos*) + vendor=apple + ;; +- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) + vendor=atari + ;; +- -vos*) ++ *-vos*) + vendor=stratus + ;; + esac +- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + +-echo $basic_machine$os ++echo "$cpu-$vendor-${kernel:+$kernel-}$os" + exit + + # Local variables: +-# eval: (add-hook 'write-file-hooks 'time-stamp) ++# eval: (add-hook 'before-save-hook 'time-stamp) + # time-stamp-start: "timestamp='" + # time-stamp-format: "%:y-%02m-%02d" + # time-stamp-end: "'" +diff -ur libffi-3.3/configure libffi-3.3.new/configure +--- libffi-3.3/configure 2019-11-23 06:59:04.000000000 -0700 ++++ libffi-3.3.new/configure 2021-01-04 19:48:48.000000000 -0700 +@@ -3082,12 +3082,7 @@ + program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + + if test x"${MISSING+set}" != xset; then +- case $am_aux_dir in +- *\ * | *\ *) +- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; +- *) +- MISSING="\${SHELL} $am_aux_dir/missing" ;; +- esac ++ MISSING="\${SHELL} '$am_aux_dir/missing'" + fi + # Use eval to expand $SHELL + if eval "$MISSING --is-lightweight"; then +@@ -8413,16 +8408,11 @@ + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- darwin*) # darwin 5.x on +- # if running on 10.5 or later, the deployment target defaults +- # to the OS version, if on x86, and 10.4, the deployment +- # target defaults to 10.4. Don't you love it? +- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in +- 10.0,*86*-darwin8*|10.0,*-darwin[91]*) +- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; +- 10.[012][,.]*) ++ darwin*) ++ case ${MACOSX_DEPLOYMENT_TARGET},$host in ++ 10.[012],*|,*powerpc*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- 10.*) ++ *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; +@@ -12042,9 +12032,6 @@ + # before this can be enabled. + hardcode_into_libs=yes + +- # Add ABI-specific directories to the system library path. +- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" +- + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command +@@ -12053,7 +12040,7 @@ + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +@@ -16007,9 +15994,6 @@ + # before this can be enabled. + hardcode_into_libs=yes + +- # Add ABI-specific directories to the system library path. +- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" +- + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command +@@ -16018,7 +16002,7 @@ + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +@@ -18411,6 +18395,59 @@ + ;; + esac + ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports pointer authentication" >&5 ++$as_echo_n "checking whether compiler supports pointer authentication... " >&6; } ++if ${libffi_cv_as_ptrauth+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ++ libffi_cv_as_ptrauth=unknown ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++#ifdef __clang__ ++# if __has_feature(ptrauth_calls) ++# define HAVE_PTRAUTH 1 ++# endif ++#endif ++ ++#ifndef HAVE_PTRAUTH ++# error Pointer authentication not supported ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ libffi_cv_as_ptrauth=yes ++else ++ libffi_cv_as_ptrauth=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libffi_cv_as_ptrauth" >&5 ++$as_echo "$libffi_cv_as_ptrauth" >&6; } ++if test "x$libffi_cv_as_ptrauth" = xyes; then ++ ++$as_echo "#define HAVE_PTRAUTH 1" >>confdefs.h ++ ++fi ++ ++# Set additional defines for Apple Silicon. ++case "$target" in ++ aarch64-apple-darwin* | arm64-apple-darwin*) ++ ++$as_echo "#define FFI_TRAMPOLINE_WHOLE_DYLIB 1" >>confdefs.h ++ ++ ;; ++esac ++ + # On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. + # Check whether --enable-pax_emutramp was given. + if test "${enable_pax_emutramp+set}" = set; then : +@@ -21144,7 +21181,9 @@ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + as_fn_error $? "Something went wrong bootstrapping makefile fragments +- for automatic dependency tracking. Try re-running configure with the ++ for automatic dependency tracking. If GNU make was not used, consider ++ re-running the configure script with MAKE=\"gmake\" (or whatever is ++ necessary). You can also try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). + See \`config.log' for more details" "$LINENO" 5; } +diff -ur libffi-3.3/configure.ac libffi-3.3.new/configure.ac +--- libffi-3.3/configure.ac 2019-11-23 06:58:22.000000000 -0700 ++++ libffi-3.3.new/configure.ac 2021-01-04 19:48:35.000000000 -0700 +@@ -176,6 +176,35 @@ + ;; + esac + ++AC_CACHE_CHECK([whether compiler supports pointer authentication], ++ libffi_cv_as_ptrauth, [ ++ libffi_cv_as_ptrauth=unknown ++ AC_TRY_COMPILE(,[ ++#ifdef __clang__ ++# if __has_feature(ptrauth_calls) ++# define HAVE_PTRAUTH 1 ++# endif ++#endif ++ ++#ifndef HAVE_PTRAUTH ++# error Pointer authentication not supported ++#endif ++ ], ++ [libffi_cv_as_ptrauth=yes], ++ [libffi_cv_as_ptrauth=no]) ++]) ++if test "x$libffi_cv_as_ptrauth" = xyes; then ++ AC_DEFINE(HAVE_PTRAUTH, 1, ++ [Define if your compiler supports pointer authentication.]) ++fi ++ ++# Set additional defines for Apple Silicon. ++case "$target" in ++ aarch64-apple-darwin* | arm64-apple-darwin*) ++ AC_DEFINE([FFI_TRAMPOLINE_WHOLE_DYLIB], 1, [Creating a separate libffi-trampolines.dylib and remapping the entire dylib]) ++ ;; ++esac ++ + # On PaX enable kernels that have MPROTECT enable we can't use PROT_EXEC. + AC_ARG_ENABLE(pax_emutramp, + [ --enable-pax_emutramp enable pax emulated trampolines, for we can't use PROT_EXEC], +diff -ur libffi-3.3/depcomp libffi-3.3.new/depcomp +--- libffi-3.3/depcomp 2019-11-01 03:30:05.000000000 -0600 ++++ libffi-3.3.new/depcomp 2021-01-04 19:48:49.000000000 -0700 +@@ -3,7 +3,7 @@ + + scriptversion=2018-03-07.03; # UTC + +-# Copyright (C) 1999-2018 Free Software Foundation, Inc. ++# Copyright (C) 1999-2020 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by +diff -ur libffi-3.3/doc/Makefile.in libffi-3.3.new/doc/Makefile.in +--- libffi-3.3/doc/Makefile.in 2019-11-23 06:59:04.000000000 -0700 ++++ libffi-3.3.new/doc/Makefile.in 2021-01-04 19:48:49.000000000 -0700 +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.16.1 from Makefile.am. ++# Makefile.in generated by automake 1.16.3 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2018 Free Software Foundation, Inc. ++# Copyright (C) 1994-2020 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +diff -ur libffi-3.3/doc/mdate-sh libffi-3.3.new/doc/mdate-sh +--- libffi-3.3/doc/mdate-sh 2019-11-01 03:30:05.000000000 -0600 ++++ libffi-3.3.new/doc/mdate-sh 2021-01-04 19:48:49.000000000 -0700 +@@ -3,7 +3,7 @@ + + scriptversion=2018-03-07.03; # UTC + +-# Copyright (C) 1995-2018 Free Software Foundation, Inc. ++# Copyright (C) 1995-2020 Free Software Foundation, Inc. + # written by Ulrich Drepper , June 1995 + # + # This program is free software; you can redistribute it and/or modify +diff -ur libffi-3.3/doc/texinfo.tex libffi-3.3.new/doc/texinfo.tex +--- libffi-3.3/doc/texinfo.tex 2019-11-22 10:27:54.000000000 -0700 ++++ libffi-3.3.new/doc/texinfo.tex 2021-01-04 19:48:49.000000000 -0700 +@@ -1,14 +1,11 @@ + % texinfo.tex -- TeX macros to handle Texinfo files. +-% ++% + % Load plain if necessary, i.e., if running under initex. + \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi + % +-\def\texinfoversion{2018-02-12.17} ++\def\texinfoversion{2020-10-24.12} + % +-% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, +-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +-% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 +-% Free Software Foundation, Inc. ++% Copyright 1985, 1986, 1988, 1990-2020 Free Software Foundation, Inc. + % + % This texinfo.tex file is free software: you can redistribute it and/or + % modify it under the terms of the GNU General Public License as +@@ -36,7 +33,7 @@ + % The texinfo.tex in any given distribution could well be out + % of date, so if that's what you're using, please check. + % +-% Send bug reports to bug-texinfo@gnu.org. Please include including a ++% Send bug reports to bug-texinfo@gnu.org. Please include a + % complete document in each bug report with which we can reproduce the + % problem. Patches are, of course, greatly appreciated. + % +@@ -182,7 +179,7 @@ + % Hyphenation fixes. + \hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script +- auto-ma-ti-cal-ly ap-pen-dix bit-map bit-maps ++ ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces +@@ -221,7 +218,7 @@ + % @errormsg{MSG}. Do the index-like expansions on MSG, but if things + % aren't perfect, it's not the end of the world, being an error message, + % after all. +-% ++% + \def\errormsg{\begingroup \indexnofonts \doerrormsg} + \def\doerrormsg#1{\errmessage{#1}} + +@@ -244,17 +241,7 @@ + % + \def\finalout{\overfullrule=0pt } + +-% Do @cropmarks to get crop marks. +-% +-\newif\ifcropmarks +-\let\cropmarks = \cropmarkstrue +-% +-% Dimensions to add cropmarks at corners. +-% Added by P. A. MacKay, 12 Nov. 1986 +-% + \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +-\newdimen\cornerlong \cornerlong=1pc +-\newdimen\cornerthick \cornerthick=.3pt + \newdimen\topandbottommargin \topandbottommargin=.75in + + % Output a mark which sets \thischapter, \thissection and \thiscolor. +@@ -270,8 +257,8 @@ + + % \domark is called twice inside \chapmacro, to add one + % mark before the section break, and one after. +-% In the second call \prevchapterdefs is the same as \lastchapterdefs, +-% and \prevsectiondefs is the same as \lastsectiondefs. ++% In the second call \prevchapterdefs is the same as \currentchapterdefs, ++% and \prevsectiondefs is the same as \currentsectiondefs. + % Then if the page is not broken at the mark, some of the previous + % section appears on the page, and we can get the name of this section + % from \firstmark for @everyheadingmarks top. +@@ -279,11 +266,11 @@ + % + % See page 260 of The TeXbook. + \def\domark{% +- \toks0=\expandafter{\lastchapterdefs}% +- \toks2=\expandafter{\lastsectiondefs}% ++ \toks0=\expandafter{\currentchapterdefs}% ++ \toks2=\expandafter{\currentsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% +- \toks8=\expandafter{\lastcolordefs}% ++ \toks8=\expandafter{\currentcolordefs}% + \mark{% + \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top + \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom +@@ -300,19 +287,19 @@ + % @setcolor (or @url, or @link, etc.) between @contents and the very + % first @chapter. + \def\gettopheadingmarks{% +- \ifcase0\topmark\fi ++ \ifcase0\the\savedtopmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi + } + \def\getbottomheadingmarks{\ifcase1\botmark\fi} +-\def\getcolormarks{\ifcase2\topmark\fi} ++\def\getcolormarks{\ifcase2\the\savedtopmark\fi} + + % Avoid "undefined control sequence" errors. +-\def\lastchapterdefs{} +-\def\lastsectiondefs{} +-\def\lastsection{} ++\def\currentchapterdefs{} ++\def\currentsectiondefs{} ++\def\currentsection{} + \def\prevchapterdefs{} + \def\prevsectiondefs{} +-\def\lastcolordefs{} ++\def\currentcolordefs{} + + % Margin to add to right of even pages, to left of odd pages. + \newdimen\bindingoffset +@@ -322,51 +309,61 @@ + % Main output routine. + % + \chardef\PAGE = 255 +-\output = {\onepageout{\pagecontents\PAGE}} ++\newtoks\defaultoutput ++\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}} ++\output=\expandafter{\the\defaultoutput} + + \newbox\headlinebox + \newbox\footlinebox + ++% When outputting the double column layout for indices, an output routine ++% is run several times, which hides the original value of \topmark. This ++% can lead to a page heading being output and duplicating the chapter heading ++% of the index. Hence, save the contents of \topmark at the beginning of ++% the output routine. The saved contents are valid until we actually ++% \shipout a page. ++% ++% (We used to run a short output routine to actually set \topmark and ++% \firstmark to the right values, but if this was called with an empty page ++% containing whatsits for writing index entries, the whatsits would be thrown ++% away and the index auxiliary file would remain empty.) ++% ++\newtoks\savedtopmark ++\newif\iftopmarksaved ++\topmarksavedtrue ++\def\savetopmark{% ++ \iftopmarksaved\else ++ \global\savedtopmark=\expandafter{\topmark}% ++ \global\topmarksavedtrue ++ \fi ++} ++ + % \onepageout takes a vbox as an argument. +-% \shipout a vbox for a single page, adding an optional header, footer, +-% cropmarks, and footnote. This also causes index entries for this page +-% to be written to the auxiliary files. ++% \shipout a vbox for a single page, adding an optional header, footer ++% and footnote. This also causes index entries for this page to be written ++% to the auxiliary files. + % + \def\onepageout#1{% +- \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi ++ \hoffset=\normaloffset + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % +- % Common context changes for both heading and footing. +- % Do this outside of the \shipout so @code etc. will be expanded in +- % the headline as they should be, not taken literally (outputting ''code). +- \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars} ++ \checkchapterpage + % + % Retrieve the information for the headings from the marks in the page, + % and call Plain TeX's \makeheadline and \makefootline, which use the + % values in \headline and \footline. + % +- % This is used to check if we are on the first page of a chapter. +- \ifcase1\topmark\fi +- \let\prevchaptername\thischaptername +- \ifcase0\firstmark\fi +- \let\curchaptername\thischaptername ++ % Common context changes for both heading and footing. ++ % Do this outside of the \shipout so @code etc. will be expanded in ++ % the headline as they should be, not taken literally (outputting ''code). ++ \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars} + % + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi ++ \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}% + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi +- % +- \ifx\curchaptername\prevchaptername +- \let\thischapterheading\thischapter +- \else +- % \thischapterheading is the same as \thischapter except it is blank +- % for the first page of a chapter. This is to prevent the chapter name +- % being shown twice. +- \def\thischapterheading{}% +- \fi +- % +- \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% +- \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}% ++ \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}% + % + {% + % Set context for writing to auxiliary files like index files. +@@ -374,37 +371,12 @@ + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % +- \indexdummies % don't expand commands in the output. +- \normalturnoffactive % \ in index entries must not stay \, e.g., if +- % the page break happens to be in the middle of an example. +- % We don't want .vr (or whatever) entries like this: +- % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}} +- % "\acronym" won't work when it's read back in; +- % it needs to be +- % {\code {{\backslashcurfont }acronym} ++ \atdummies % don't expand commands in the output. ++ \turnoffactive + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % +- \ifcropmarks \vbox to \outervsize\bgroup +- \hsize = \outerhsize +- \vskip-\topandbottommargin +- \vtop to0pt{% +- \line{\ewtop\hfil\ewtop}% +- \nointerlineskip +- \line{% +- \vbox{\moveleft\cornerthick\nstop}% +- \hfill +- \vbox{\moveright\cornerthick\nstop}% +- }% +- \vss}% +- \vskip\topandbottommargin +- \line\bgroup +- \hfil % center the page within the outer (page) hsize. +- \ifodd\pageno\hskip\bindingoffset\fi +- \vbox\bgroup +- \fi +- % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt +@@ -415,24 +387,9 @@ + \unvbox\footlinebox + \fi + % +- \ifcropmarks +- \egroup % end of \vbox\bgroup +- \hfil\egroup % end of (centering) \line\bgroup +- \vskip\topandbottommargin plus1fill minus1fill +- \boxmaxdepth = \cornerthick +- \vbox to0pt{\vss +- \line{% +- \vbox{\moveleft\cornerthick\nsbot}% +- \hfill +- \vbox{\moveright\cornerthick\nsbot}% +- }% +- \nointerlineskip +- \line{\ewbot\hfil\ewbot}% +- }% +- \egroup % \vbox from first cropmarks clause +- \fi +- }% end of \shipout\vbox +- }% end of group with \indexdummies ++ }% ++ }% ++ \global\topmarksavedfalse + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi + } +@@ -451,17 +408,22 @@ + \ifr@ggedbottom \kern-\dimen@ \vfil \fi} + } + +-% Here are the rules for the cropmarks. Note that they are +-% offset so that the space between them is truly \outerhsize or \outervsize +-% (P. A. MacKay, 12 November, 1986) +-% +-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +-\def\nstop{\vbox +- {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +-\def\nsbot{\vbox +- {\hrule height\cornerlong depth\cornerthick width\cornerthick}} +- ++% Check if we are on the first page of a chapter. Used for printing headings. ++\newif\ifchapterpage ++\def\checkchapterpage{% ++ % Get the chapter that was current at the end of the last page ++ \ifcase1\the\savedtopmark\fi ++ \let\prevchaptername\thischaptername ++ % ++ \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi ++ \let\curchaptername\thischaptername ++ % ++ \ifx\curchaptername\prevchaptername ++ \chapterpagefalse ++ \else ++ \chapterpagetrue ++ \fi ++} + + % Argument parsing + +@@ -487,11 +449,10 @@ + }% + } + +-% First remove any @comment, then any @c comment. Also remove a @texinfoc +-% comment (see \scanmacro for details). Pass the result on to \argcheckspaces. ++% First remove any @comment, then any @c comment. Pass the result on to ++% \argcheckspaces. + \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +-\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm} +-\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} ++\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + + % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. + % +@@ -1050,7 +1011,7 @@ + \let\setfilename=\comment + + % @bye. +-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} ++\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend} + + + \message{pdf,} +@@ -1092,7 +1053,7 @@ + tex.sprint( + string.format(string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', +- (c / 256), (c % 256))) ++ math.floor(c / 256), math.floor(c % 256))) + else + c = c - 0x10000 + local c_hi = c / 1024 + 0xd800 +@@ -1102,8 +1063,8 @@ + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o' .. + string.char(0x5c) .. string.char(0x25) .. '03o', +- (c_hi / 256), (c_hi % 256), +- (c_lo / 256), (c_lo % 256))) ++ math.floor(c_hi / 256), math.floor(c_hi % 256), ++ math.floor(c_lo / 256), math.floor(c_lo % 256))) + end + end + end +@@ -1116,15 +1077,19 @@ + function PDFescstr(str) + for c in string.bytes(str) do + if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then +- tex.sprint( ++ tex.sprint(-2, + string.format(string.char(0x5c) .. string.char(0x25) .. '03o', + c)) + else +- tex.sprint(string.char(c)) ++ tex.sprint(-2, string.char(c)) + end + end + end + } ++ % The -2 in the arguments here gives all the input to TeX catcode 12 ++ % (other) or 10 (space), preventing undefined control sequence errors. See ++ % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html ++ % + \endgroup + \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}} + \ifnum\luatexversion>84 +@@ -1163,11 +1128,60 @@ + \fi + \fi + ++\newif\ifpdforxetex ++\pdforxetexfalse ++\ifpdf ++ \pdforxetextrue ++\fi ++\ifx\XeTeXrevision\thisisundefined\else ++ \pdforxetextrue ++\fi ++ ++ ++% Output page labels information. ++% See PDF reference v.1.7 p.594, section 8.3.1. ++\ifpdf ++\def\pagelabels{% ++ \def\title{0 << /P (T-) /S /D >>}% ++ \edef\roman{\the\romancount << /S /r >>}% ++ \edef\arabic{\the\arabiccount << /S /D >>}% ++ % ++ % Page label ranges must be increasing. Remove any duplicates. ++ % (There is a slight chance of this being wrong if e.g. there is ++ % a @contents but no @titlepage, etc.) ++ % ++ \ifnum\romancount=0 \def\roman{}\fi ++ \ifnum\arabiccount=0 \def\title{}% ++ \else ++ \ifnum\romancount=\arabiccount \def\roman{}\fi ++ \fi ++ % ++ \ifnum\romancount<\arabiccount ++ \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax ++ \else ++ \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax ++ \fi ++} ++\else ++ \let\pagelabels\relax ++\fi ++ ++\newcount\pagecount \pagecount=0 ++\newcount\romancount \romancount=0 ++\newcount\arabiccount \arabiccount=0 ++\ifpdf ++ \let\ptxadvancepageno\advancepageno ++ \def\advancepageno{% ++ \ptxadvancepageno\global\advance\pagecount by 1 ++ } ++\fi ++ ++ + % PDF uses PostScript string constants for the names of xref targets, + % for display in the outlines, and in other places. Thus, we have to + % double any backslashes. Otherwise, a name like "\node" will be + % interpreted as a newline (\n), followed by o, d, e. Not good. +-% ++% + % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and + % related messages. The final outcome is that it is up to the TeX user + % to double the backslashes and otherwise make the string valid, so +@@ -1219,7 +1233,7 @@ + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% +- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% ++ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } +@@ -1227,7 +1241,7 @@ + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} +- \def\lastcolordefs{} ++ \def\currentcolordefs{} + % + \def\makefootline{% + \baselineskip24pt +@@ -1453,7 +1467,13 @@ + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. ++ % ++ % Currently we prefix the section name with the section number ++ % for chapter and appendix headings only in order to avoid too much ++ % horizontal space being required in the PDF viewer. + \def\numchapentry##1##2##3##4{% ++ \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}% ++ \def\unnchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% +@@ -1472,7 +1492,7 @@ + % their "best" equivalent, based on the @documentencoding. Too + % much work for too little return. Just use the ASCII equivalents + % we use for the index sort strings. +- % ++ % + \indexnofonts + \setupdatafile + % We can have normal brace characters in the PDF outlines, unlike +@@ -1528,6 +1548,9 @@ + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} ++ % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may ++ % be a simple number, or a list of numbers in the case of an index ++ % entry. + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} +@@ -1602,7 +1625,7 @@ + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% +- \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% ++ \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } +@@ -1610,7 +1633,7 @@ + \def\maincolor{\rgbBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} +- \def\lastcolordefs{} ++ \def\currentcolordefs{} + % + \def\makefootline{% + \baselineskip24pt +@@ -1692,9 +1715,13 @@ + % Therefore, we read toc only once. + % + % We use node names as destinations. ++ % ++ % Currently we prefix the section name with the section number ++ % for chapter and appendix headings only in order to avoid too much ++ % horizontal space being required in the PDF viewer. + \def\partentry##1##2##3##4{}% ignore parts in the outlines + \def\numchapentry##1##2##3##4{% +- \dopdfoutline{##1}{1}{##3}{##4}}% ++ \dopdfoutline{##2 ##1}{1}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{2}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% +@@ -1706,7 +1733,8 @@ + \let\appsecentry\numsecentry% + \let\appsubsecentry\numsubsecentry% + \let\appsubsubsecentry\numsubsubsecentry% +- \let\unnchapentry\numchapentry% ++ \def\unnchapentry##1##2##3##4{% ++ \dopdfoutline{##1}{1}{##3}{##4}}% + \let\unnsecentry\numsecentry% + \let\unnsubsecentry\numsubsecentry% + \let\unnsubsubsecentry\numsubsubsecentry% +@@ -2202,7 +2230,7 @@ + % A few fonts for @defun names and args. + \setfont\defbf\bfshape{10}{\magstep1}{OT1} + \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +-\setfont\defsl\slshape{10}{\magstep1}{OT1TT} ++\setfont\defsl\slshape{10}{\magstep1}{OT1} + \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} + \def\df{\let\ttfont=\deftt \let\bffont = \defbf + \let\ttslfont=\defttsl \let\slfont=\defsl \bf} +@@ -2350,7 +2378,7 @@ + % A few fonts for @defun names and args. + \setfont\defbf\bfshape{10}{\magstephalf}{OT1} + \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +-\setfont\defsl\slshape{10}{\magstephalf}{OT1TT} ++\setfont\defsl\slshape{10}{\magstephalf}{OT1} + \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} + \def\df{\let\ttfont=\deftt \let\bffont = \defbf + \let\slfont=\defsl \let\ttslfont=\defttsl \bf} +@@ -2519,7 +2547,7 @@ + \def\it{\fam=\itfam \setfontstyle{it}} + \def\sl{\fam=\slfam \setfontstyle{sl}} + \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +-\def\tt{\fam=\ttfam \setfontstyle{tt}} ++\def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt} + + % Texinfo sort of supports the sans serif font style, which plain TeX does not. + % So we set up a \sf. +@@ -2753,7 +2781,7 @@ + } + + % Commands to set the quote options. +-% ++% + \parseargdef\codequoteundirected{% + \def\temp{#1}% + \ifx\temp\onword +@@ -2794,7 +2822,7 @@ + % If we are in a monospaced environment, however, 1) always use \ttsl, + % and 2) do not add an italic correction. + \def\dosmartslant#1#2{% +- \ifusingtt ++ \ifusingtt + {{\ttsl #2}\let\next=\relax}% + {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% + \next +@@ -2873,7 +2901,7 @@ + + % @t, explicit typewriter. + \def\t#1{% +- {\tt \rawbackslash \plainfrenchspacing #1}% ++ {\tt \plainfrenchspacing #1}% + \null + } + +@@ -2900,7 +2928,6 @@ + % Turn off hyphenation. + \nohyphenation + % +- \rawbackslash + \plainfrenchspacing + #1% + }% +@@ -2942,14 +2969,14 @@ + \gdef\codedash{\futurelet\next\codedashfinish} + \gdef\codedashfinish{% + \normaldash % always output the dash character itself. +- % ++ % + % Now, output a discretionary to allow a line break, unless + % (a) the next character is a -, or + % (b) the preceding character is a -. + % E.g., given --posix, we do not want to allow a break after either -. + % Given --foo-bar, we do want to allow a break between the - and the b. + \ifx\next\codedash \else +- \ifx\codedashprev\codedash ++ \ifx\codedashprev\codedash + \else \discretionary{}{}{}\fi + \fi + % we need the space after the = for the case when \next itself is a +@@ -3011,10 +3038,18 @@ + % arg (if given), and not the url (which is then just the link target). + \newif\ifurefurlonlylink + ++% The default \pretolerance setting stops the penalty inserted in ++% \urefallowbreak being a discouragement to line breaking. Set it to ++% a negative value for this paragraph only. Hopefully this does not ++% conflict with redefinitions of \par done elsewhere. ++\def\nopretolerance{% ++\pretolerance=-1 ++\def\par{\endgraf\pretolerance=100 \let\par\endgraf}% ++} ++ + % The main macro is \urefbreak, which allows breaking at expected +-% places within the url. (There used to be another version, which +-% didn't support automatic breaking.) +-\def\urefbreak{\begingroup \urefcatcodes \dourefbreak} ++% places within the url. ++\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak} + \let\uref=\urefbreak + % + \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} +@@ -3031,7 +3066,7 @@ + % For pdfTeX and LuaTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg +- \unhbox0 ++ \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. +@@ -3044,7 +3079,7 @@ + % For XeTeX + \ifurefurlonlylink + % PDF plus option to not display url, show just arg +- \unhbox0 ++ \unhbox0 + \else + % PDF, normally display both arg and url for consistency, + % visibility, if the pdf is eventually used to print, etc. +@@ -3087,41 +3122,33 @@ + \global\def/{\normalslash} + } + +-% we put a little stretch before and after the breakable chars, to help +-% line breaking of long url's. The unequal skips make look better in +-% cmtt at least, especially for dots. +-\def\urefprestretchamount{.13em} +-\def\urefpoststretchamount{.1em} +-\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} +-\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} +-% +-\def\urefcodeamp{\urefprestretch \&\urefpoststretch} +-\def\urefcodedot{\urefprestretch .\urefpoststretch} +-\def\urefcodehash{\urefprestretch \#\urefpoststretch} +-\def\urefcodequest{\urefprestretch ?\urefpoststretch} ++\def\urefcodeamp{\urefprebreak \&\urefpostbreak} ++\def\urefcodedot{\urefprebreak .\urefpostbreak} ++\def\urefcodehash{\urefprebreak \#\urefpostbreak} ++\def\urefcodequest{\urefprebreak ?\urefpostbreak} + \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} + { + \catcode`\/=\active + \global\def\urefcodeslashfinish{% +- \urefprestretch \slashChar ++ \urefprebreak \slashChar + % Allow line break only after the final / in a sequence of + % slashes, to avoid line break between the slashes in http://. +- \ifx\next/\else \urefpoststretch \fi ++ \ifx\next/\else \urefpostbreak \fi + } + } + +-% One more complication: by default we'll break after the special +-% characters, but some people like to break before the special chars, so +-% allow that. Also allow no breaking at all, for manual control. +-% ++% By default we'll break after the special characters, but some people like to ++% break before the special chars, so allow that. Also allow no breaking at ++% all, for manual control. ++% + \parseargdef\urefbreakstyle{% + \def\txiarg{#1}% + \ifx\txiarg\wordnone + \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordbefore +- \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} ++ \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak} + \else\ifx\txiarg\wordafter +- \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} ++ \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak} + \else + \errhelp = \EMsimple + \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% +@@ -3131,6 +3158,19 @@ + \def\wordbefore{before} + \def\wordnone{none} + ++% Allow a ragged right output to aid breaking long URL's. There can ++% be a break at the \allowbreak with no extra glue (if the existing stretch in ++% the line is sufficient), a break at the \penalty with extra glue added ++% at the end of the line, or no break at all here. ++% Changing the value of the penalty and/or the amount of stretch affects how ++% preferable one choice is over the other. ++\def\urefallowbreak{% ++ \penalty0\relax ++ \hskip 0pt plus 2 em\relax ++ \penalty1000\relax ++ \hskip 0pt plus -2 em\relax ++} ++ + \urefbreakstyle after + + % @url synonym for @uref, since that's how everyone uses it. +@@ -3141,7 +3181,7 @@ + % So now @email is just like @uref, unless we are pdf. + % + %\def\email#1{\angleleft{\tt #1}\angleright} +-\ifpdf ++\ifpdforxetex + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces +@@ -3151,18 +3191,7 @@ + \endlink + \endgroup} + \else +- \ifx\XeTeXrevision\thisisundefined +- \let\email=\uref +- \else +- \def\email#1{\doemail#1,,\finish} +- \def\doemail#1,#2,#3\finish{\begingroup +- \unsepspaces +- \pdfurl{mailto:#1}% +- \setbox0 = \hbox{\ignorespaces #2}% +- \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi +- \endlink +- \endgroup} +- \fi ++ \let\email=\uref + \fi + + % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +@@ -3335,10 +3364,29 @@ + \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} + \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}% + ++% provide this command from LaTeX as it is very common ++\def\frac#1#2{{{#1}\over{#2}}} ++ ++% @displaymath. ++% \globaldefs is needed to recognize the end lines in \tex and ++% \end tex. Set \thisenv as @end displaymath is seen before @end tex. ++{\obeylines ++\globaldefs=1 ++\envdef\displaymath{% ++\tex ++\def\thisenv{\displaymath}% ++$$% ++} ++ ++\def\Edisplaymath{$$ ++\def\thisenv{\tex}% ++\end tex ++}} ++ + % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. + % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, + % except specified as a normal braced arg, so no newlines to worry about. +-% ++% + \def\outfmtnametex{tex} + % + \long\def\inlinefmt#1{\doinlinefmt #1,\finish} +@@ -3346,7 +3394,7 @@ + \def\inlinefmtname{#1}% + \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi + } +-% ++% + % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if + % FMTNAME is tex, else ELSE-TEXT. + \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish} +@@ -3362,7 +3410,7 @@ + % *right* brace they would have to use a command anyway, so they may as + % well use a command to get a left brace too. We could re-use the + % delimiter character idea from \verb, but it seems like overkill. +-% ++% + \long\def\inlineraw{\tex \doinlineraw} + \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} + \def\doinlinerawtwo#1,#2,\finish{% +@@ -3539,7 +3587,7 @@ + + % @pounds{} is a sterling sign, which Knuth put in the CM italic font. + % +-\def\pounds{{\it\$}} ++\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi} + + % @euro{} comes from a separate font, depending on the current style. + % We use the free feym* fonts from the eurosym package by Henrik +@@ -3639,7 +3687,7 @@ + % for non-CM glyphs. That is ec* for regular text and tc* for the text + % companion symbols (LaTeX TS1 encoding). Both are part of the ec + % package and follow the same conventions. +-% ++% + \def\ecfont{\etcfont{e}} + \def\tcfont{\etcfont{t}} + % +@@ -3688,11 +3736,19 @@ + \fi + + % Quotes. +-\chardef\quotedblleft="5C +-\chardef\quotedblright=`\" + \chardef\quoteleft=`\` + \chardef\quoteright=`\' + ++% only change font for tt for correct kerning and to avoid using ++% \ecfont unless necessary. ++\def\quotedblleft{% ++ \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi ++} ++ ++\def\quotedblright{% ++ \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi ++} ++ + + \message{page headings,} + +@@ -3711,7 +3767,7 @@ + after the title page.}}% + \def\setshortcontentsaftertitlepage{% + \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo +- command; move your @shortcontents and @contents commands if you ++ command; move your @shortcontents and @contents commands if you + want the contents after the title page.}}% + + \parseargdef\shorttitlepage{% +@@ -3766,7 +3822,7 @@ + % don't worry much about spacing, ragged right. This should be used + % inside a \vbox, and fonts need to be set appropriately first. \par should + % be specified before the end of the \vbox, since a vbox is a group. +-% ++% + \def\raggedtitlesettings{% + \rm + \hyphenpenalty=10000 +@@ -3814,12 +3870,19 @@ + + \newtoks\evenheadline % headline on even pages + \newtoks\oddheadline % headline on odd pages ++\newtoks\evenchapheadline% headline on even pages with a new chapter ++\newtoks\oddchapheadline % headline on odd pages with a new chapter + \newtoks\evenfootline % footline on even pages + \newtoks\oddfootline % footline on odd pages + + % Now make \makeheadline and \makefootline in Plain TeX use those variables +-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline +- \else \the\evenheadline \fi}} ++\headline={{\textfonts\rm ++ \ifchapterpage ++ \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi ++ \else ++ \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi ++ \fi}} ++ + \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} + \let\HEADINGShook=\relax +@@ -3835,12 +3898,14 @@ + \def\evenheading{\parsearg\evenheadingxxx} + \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} + \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ++ \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}} ++ \global\evenchapheadline=\evenheadline} + + \def\oddheading{\parsearg\oddheadingxxx} + \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} + \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} ++ \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}% ++ \global\oddchapheadline=\oddheadline} + + \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +@@ -3907,37 +3972,34 @@ + \parseargdef\headings{\csname HEADINGS#1\endcsname} + + \def\headingsoff{% non-global headings elimination +- \evenheadline={\hfil}\evenfootline={\hfil}% +- \oddheadline={\hfil}\oddfootline={\hfil}% ++ \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}% ++ \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}% + } + + \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting + \HEADINGSoff % it's the default + + % When we turn headings on, set the page number to 1. ++\def\pageone{ ++ \global\pageno=1 ++ \global\arabiccount = \pagecount ++} ++ + % For double-sided printing, put current file name in lower left corner, + % chapter name on inside top of right hand pages, document + % title on inside top of left hand pages, and page numbers on outside top + % edge of all pages. + \def\HEADINGSdouble{% +-\global\pageno=1 +-\global\evenfootline={\hfil} +-\global\oddfootline={\hfil} +-\global\evenheadline={\line{\folio\hfil\thistitle}} +-\global\oddheadline={\line{\thischapterheading\hfil\folio}} +-\global\let\contentsalignmacro = \chapoddpage ++\pageone ++\HEADINGSdoublex + } + \let\contentsalignmacro = \chappager + + % For single-sided printing, chapter title goes across top left of page, + % page number on top right. + \def\HEADINGSsingle{% +-\global\pageno=1 +-\global\evenfootline={\hfil} +-\global\oddfootline={\hfil} +-\global\evenheadline={\line{\thischapterheading\hfil\folio}} +-\global\oddheadline={\line{\thischapterheading\hfil\folio}} +-\global\let\contentsalignmacro = \chappager ++\pageone ++\HEADINGSsinglex + } + \def\HEADINGSon{\HEADINGSdouble} + +@@ -3947,7 +4009,9 @@ + \global\evenfootline={\hfil} + \global\oddfootline={\hfil} + \global\evenheadline={\line{\folio\hfil\thistitle}} +-\global\oddheadline={\line{\thischapterheading\hfil\folio}} ++\global\oddheadline={\line{\thischapter\hfil\folio}} ++\global\evenchapheadline={\line{\folio\hfil}} ++\global\oddchapheadline={\line{\hfil\folio}} + \global\let\contentsalignmacro = \chapoddpage + } + +@@ -3955,8 +4019,22 @@ + \def\HEADINGSsinglex{% + \global\evenfootline={\hfil} + \global\oddfootline={\hfil} +-\global\evenheadline={\line{\thischapterheading\hfil\folio}} +-\global\oddheadline={\line{\thischapterheading\hfil\folio}} ++\global\evenheadline={\line{\thischapter\hfil\folio}} ++\global\oddheadline={\line{\thischapter\hfil\folio}} ++\global\evenchapheadline={\line{\hfil\folio}} ++\global\oddchapheadline={\line{\hfil\folio}} ++\global\let\contentsalignmacro = \chappager ++} ++ ++% for @setchapternewpage off ++\def\HEADINGSsinglechapoff{% ++\pageone ++\global\evenfootline={\hfil} ++\global\oddfootline={\hfil} ++\global\evenheadline={\line{\thischapter\hfil\folio}} ++\global\oddheadline={\line{\thischapter\hfil\folio}} ++\global\evenchapheadline=\evenheadline ++\global\oddchapheadline=\oddheadline + \global\let\contentsalignmacro = \chappager + } + +@@ -4389,7 +4467,7 @@ + } + + % multitable-only commands. +-% ++% + % @headitem starts a heading row, which we typeset in bold. Assignments + % have to be global since we are inside the implicit group of an + % alignment entry. \everycr below resets \everytab so we don't have to +@@ -4696,19 +4774,6 @@ + } + } + +-% We have this subroutine so that we can handle at least some @value's +-% properly in indexes (we call \makevalueexpandable in \indexdummies). +-% The command has to be fully expandable (if the variable is set), since +-% the result winds up in the index file. This means that if the +-% variable's value contains other Texinfo commands, it's almost certain +-% it will fail (although perhaps we could fix that with sufficient work +-% to do a one-level expansion on the result, instead of complete). +-% +-% Unfortunately, this has the consequence that when _ is in the *value* +-% of an @set, it does not print properly in the roman fonts (get the cmr +-% dot accent at position 126 instead). No fix comes to mind, and it's +-% been this way since 2003 or earlier, so just ignore it. +-% + \def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% +@@ -4721,13 +4786,13 @@ + % Like \expandablevalue, but completely expandable (the \message in the + % definition above operates at the execution level of TeX). Used when + % writing to auxiliary files, due to the expansion that \write does. +-% If flag is undefined, pass through an unexpanded @value command: maybe it ++% If flag is undefined, pass through an unexpanded @value command: maybe it + % will be set by the time it is read back in. + % + % NB flag names containing - or _ may not work here. + \def\dummyvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax +- \noexpand\value{#1}% ++ \string\value{#1}% + \else + \csname SET#1\endcsname + \fi +@@ -4737,7 +4802,7 @@ + % if possible, otherwise sort late. + \def\indexnofontsvalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax +- ZZZZZZZ ++ ZZZZZZZ% + \else + \csname SET#1\endcsname + \fi +@@ -4745,7 +4810,7 @@ + + % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined + % with @set. +-% ++% + % To get the special treatment we need for `@end ifset,' we call + % \makecond and then redefine. + % +@@ -4778,7 +4843,7 @@ + % without the @) is in fact defined. We can only feasibly check at the + % TeX level, so something like `mathcode' is going to considered + % defined even though it is not a Texinfo command. +-% ++% + \makecond{ifcommanddefined} + \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} + % +@@ -4884,32 +4949,18 @@ + + % like the previous two, but they put @code around the argument. + \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx} +-\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}} ++\def\docodeindexxxx #1{\docind{\indexname}{#1}} + +- +-% Used when writing an index entry out to an index file to prevent +-% expansion of Texinfo commands that can appear in an index entry. +-% +-\def\indexdummies{% +- \escapechar = `\\ % use backslash in output files. +- \definedummyletter\@% +- \definedummyletter\ % +- % +- % For texindex which always views { and } as separators. +- \def\{{\lbracechar{}}% +- \def\}{\rbracechar{}}% +- % +- % Do the redefinitions. +- \definedummies +-} + +-% Used for the aux and toc files, where @ is the escape character. ++% Used for the aux, toc and index files to prevent expansion of Texinfo ++% commands. + % + \def\atdummies{% + \definedummyletter\@% + \definedummyletter\ % + \definedummyletter\{% + \definedummyletter\}% ++ \definedummyletter\&% + % + % Do the redefinitions. + \definedummies +@@ -4933,8 +4984,7 @@ + \def\definedummyletter#1{\def#1{\string#1}}% + \let\definedummyaccent\definedummyletter + +-% Called from \indexdummies and \atdummies, to effectively prevent +-% the expansion of commands. ++% Called from \atdummies to prevent the expansion of commands. + % + \def\definedummies{% + % +@@ -4981,8 +5031,10 @@ + \definedummyword\TeX + % + % Assorted special characters. ++ \definedummyword\ampchar + \definedummyword\atchar + \definedummyword\arrow ++ \definedummyword\backslashchar + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright +@@ -5019,6 +5071,8 @@ + \definedummyword\sup + \definedummyword\textdegree + % ++ \definedummyword\subentry ++ % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + \let\value\dummyvalue +@@ -5099,11 +5153,10 @@ + \commondummyword\xref + } + +-% For testing: output @{ and @} in index sort strings as \{ and \}. +-\newif\ifusebracesinindexes +- + \let\indexlbrace\relax + \let\indexrbrace\relax ++\let\indexatchar\relax ++\let\indexbackslash\relax + + {\catcode`\@=0 + \catcode`\\=13 +@@ -5137,10 +5190,8 @@ + } + + \gdef\indexnonalnumreappear{% +- \useindexbackslash + \let-\normaldash + \let<\normalless +- \def\@{@}% + } + } + +@@ -5174,64 +5225,66 @@ + \let\lbracechar\{% + \let\rbracechar\}% + % ++ % ++ \let\do\indexnofontsdef ++ % + % Non-English letters. +- \def\AA{AA}% +- \def\AE{AE}% +- \def\DH{DZZ}% +- \def\L{L}% +- \def\OE{OE}% +- \def\O{O}% +- \def\TH{TH}% +- \def\aa{aa}% +- \def\ae{ae}% +- \def\dh{dzz}% +- \def\exclamdown{!}% +- \def\l{l}% +- \def\oe{oe}% +- \def\ordf{a}% +- \def\ordm{o}% +- \def\o{o}% +- \def\questiondown{?}% +- \def\ss{ss}% +- \def\th{th}% +- % +- \def\LaTeX{LaTeX}% +- \def\TeX{TeX}% +- % +- % Assorted special characters. \defglyph gives the control sequence a +- % definition that removes the {} that follows its use. +- \defglyph\atchar{@}% +- \defglyph\arrow{->}% +- \defglyph\bullet{bullet}% +- \defglyph\comma{,}% +- \defglyph\copyright{copyright}% +- \defglyph\dots{...}% +- \defglyph\enddots{...}% +- \defglyph\equiv{==}% +- \defglyph\error{error}% +- \defglyph\euro{euro}% +- \defglyph\expansion{==>}% +- \defglyph\geq{>=}% +- \defglyph\guillemetleft{<<}% +- \defglyph\guillemetright{>>}% +- \defglyph\guilsinglleft{<}% +- \defglyph\guilsinglright{>}% +- \defglyph\leq{<=}% +- \defglyph\lbracechar{\{}% +- \defglyph\minus{-}% +- \defglyph\point{.}% +- \defglyph\pounds{pounds}% +- \defglyph\print{-|}% +- \defglyph\quotedblbase{"}% +- \defglyph\quotedblleft{"}% +- \defglyph\quotedblright{"}% +- \defglyph\quoteleft{`}% +- \defglyph\quoteright{'}% +- \defglyph\quotesinglbase{,}% +- \defglyph\rbracechar{\}}% +- \defglyph\registeredsymbol{R}% +- \defglyph\result{=>}% +- \defglyph\textdegree{o}% ++ \do\AA{AA}% ++ \do\AE{AE}% ++ \do\DH{DZZ}% ++ \do\L{L}% ++ \do\OE{OE}% ++ \do\O{O}% ++ \do\TH{TH}% ++ \do\aa{aa}% ++ \do\ae{ae}% ++ \do\dh{dzz}% ++ \do\exclamdown{!}% ++ \do\l{l}% ++ \do\oe{oe}% ++ \do\ordf{a}% ++ \do\ordm{o}% ++ \do\o{o}% ++ \do\questiondown{?}% ++ \do\ss{ss}% ++ \do\th{th}% ++ % ++ \do\LaTeX{LaTeX}% ++ \do\TeX{TeX}% ++ % ++ % Assorted special characters. ++ \do\atchar{@}% ++ \do\arrow{->}% ++ \do\bullet{bullet}% ++ \do\comma{,}% ++ \do\copyright{copyright}% ++ \do\dots{...}% ++ \do\enddots{...}% ++ \do\equiv{==}% ++ \do\error{error}% ++ \do\euro{euro}% ++ \do\expansion{==>}% ++ \do\geq{>=}% ++ \do\guillemetleft{<<}% ++ \do\guillemetright{>>}% ++ \do\guilsinglleft{<}% ++ \do\guilsinglright{>}% ++ \do\leq{<=}% ++ \do\lbracechar{\{}% ++ \do\minus{-}% ++ \do\point{.}% ++ \do\pounds{pounds}% ++ \do\print{-|}% ++ \do\quotedblbase{"}% ++ \do\quotedblleft{"}% ++ \do\quotedblright{"}% ++ \do\quoteleft{`}% ++ \do\quoteright{'}% ++ \do\quotesinglbase{,}% ++ \do\rbracechar{\}}% ++ \do\registeredsymbol{R}% ++ \do\result{=>}% ++ \do\textdegree{o}% + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. +@@ -5246,41 +5299,38 @@ + \macrolist + \let\value\indexnofontsvalue + } +-\def\defglyph#1#2{\def#1##1{#2}} % see above + +- ++% Give the control sequence a definition that removes the {} that follows ++% its use, e.g. @AA{} -> AA ++\def\indexnofontsdef#1#2{\def#1##1{#2}}% + + +-\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +-% Most index entries go through here, but \dosubind is the general case. +-% #1 is the index name, #2 is the entry text. +-\def\doind#1#2{\dosubind{#1}{#2}{}} + +-% There is also \dosubind {index}{topic}{subtopic} +-% which makes an entry in a two-level index such as the operation index. +-% TODO: Two-level index? Operation index? +- +-% Workhorse for all indexes. +-% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +-% empty if called from \doind, as we usually are (the main exception +-% is with most defuns, which call us directly). +-% +-\def\dosubind#1#2#3{% ++% #1 is the index name, #2 is the entry text. ++\def\doind#1#2{% + \iflinks + {% ++ % + \requireopenindexfile{#1}% +- % Store the main index entry text (including the third arg). +- \toks0 = {#2}% +- % If third arg is present, precede it with a space. +- \def\thirdarg{#3}% +- \ifx\thirdarg\empty \else +- \toks0 = \expandafter{\the\toks0 \space #3}% +- \fi ++ \edef\writeto{\csname#1indfile\endcsname}% ++ % ++ \def\indextext{#2}% ++ \safewhatsit\doindwrite ++ }% ++ \fi ++} ++ ++% Same as \doind, but for code indices ++\def\docind#1#2{% ++ \iflinks ++ {% + % ++ \requireopenindexfile{#1}% + \edef\writeto{\csname#1indfile\endcsname}% + % +- \safewhatsit\dosubindwrite ++ \def\indextext{#2}% ++ \safewhatsit\docindwrite + }% + \fi + } +@@ -5295,28 +5345,14 @@ + \ifx\suffix\indexisfl\def\suffix{f1}\fi + % Open the file + \immediate\openout\csname#1indfile\endcsname \jobname.\suffix +- % Using \immediate above here prevents an object entering into the current ++ % Using \immediate above here prevents an object entering into the current + % box, which could confound checks such as those in \safewhatsit for + % preceding skips. + \typeout{Writing index file \jobname.\suffix}% + \fi} + \def\indexisfl{fl} + +-% Output \ as {\indexbackslash}, because \ is an escape character in +-% the index files. +-\let\indexbackslash=\relax +-{\catcode`\@=0 \catcode`\\=\active +- @gdef@useindexbackslash{@def\{{@indexbackslash}}} +-} +- +-% Definition for writing index entry text. +-\def\sortas#1{\ignorespaces}% +- +-% Definition for writing index entry sort key. Should occur at the at +-% the beginning of the index entry, like +-% @cindex @sortas{september} \september +-% The \ignorespaces takes care of following space, but there's no way +-% to remove space before it. ++% Definition for writing index entry sort key. + { + \catcode`\-=13 + \gdef\indexwritesortas{% +@@ -5327,51 +5363,158 @@ + \xdef\indexsortkey{#1}\endgroup} + } + ++\def\indexwriteseealso#1{ ++ \gdef\pagenumbertext{\string\seealso{#1}}% ++} ++\def\indexwriteseeentry#1{ ++ \gdef\pagenumbertext{\string\seeentry{#1}}% ++} ++ ++% The default definitions ++\def\sortas#1{}% ++\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only ++\def\putwordSeeAlso{See also} ++\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only ++ + +-% Write the entry in \toks0 to the index file. ++% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}": ++% * Set \bracedtext to "{aaa}{bbb}" ++% * Set \fullindexsortkey to "aaa @subentry ZZZ" ++% * If @seealso occurs, set \pagenumbertext + % +-\def\dosubindwrite{% +- % Put the index entry in the margin if desired. +- \ifx\SETmarginindex\relax\else +- \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% ++\def\splitindexentry#1{% ++ \gdef\fullindexsortkey{}% ++ \xdef\bracedtext{}% ++ \def\sep{}% ++ \def\seealso##1{}% ++ \def\seeentry##1{}% ++ \expandafter\doindexsegment#1\subentry\finish\subentry ++} ++ ++% append the results from the next segment ++\def\doindexsegment#1\subentry{% ++ \def\segment{#1}% ++ \ifx\segment\isfinish ++ \else ++ % ++ % Fully expand the segment, throwing away any @sortas directives, and ++ % trim spaces. ++ \edef\trimmed{\segment}% ++ \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% ++ \ifincodeindex ++ \edef\trimmed{\noexpand\code{\trimmed}}% ++ \fi ++ % ++ \xdef\bracedtext{\bracedtext{\trimmed}}% ++ % ++ % Get the string to sort by. Process the segment with all ++ % font commands turned off. ++ \bgroup ++ \let\sortas\indexwritesortas ++ \let\seealso\indexwriteseealso ++ \let\seeentry\indexwriteseeentry ++ \indexnofonts ++ % The braces around the commands are recognized by texindex. ++ \def\lbracechar{{\string\indexlbrace}}% ++ \def\rbracechar{{\string\indexrbrace}}% ++ \let\{=\lbracechar ++ \let\}=\rbracechar ++ \def\@{{\string\indexatchar}}% ++ \def\atchar##1{\@}% ++ \def\backslashchar{{\string\indexbackslash}}% ++ \uccode`\~=`\\ \uppercase{\let~\backslashchar}% ++ % ++ \let\indexsortkey\empty ++ \global\let\pagenumbertext\empty ++ % Execute the segment and throw away the typeset output. This executes ++ % any @sortas or @seealso commands in this segment. ++ \setbox\dummybox = \hbox{\segment}% ++ \ifx\indexsortkey\empty{% ++ \indexnonalnumdisappear ++ \xdef\trimmed{\segment}% ++ \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}% ++ \xdef\indexsortkey{\trimmed}% ++ \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi ++ }\fi ++ % ++ % Append to \fullindexsortkey. ++ \edef\tmp{\gdef\noexpand\fullindexsortkey{% ++ \fullindexsortkey\sep\indexsortkey}}% ++ \tmp ++ \egroup ++ \def\sep{\subentry}% ++ % ++ \expandafter\doindexsegment + \fi ++} ++\def\isfinish{\finish}% ++\newbox\dummybox % used above ++ ++\let\subentry\relax ++ ++% Use \ instead of @ in index files. To support old texi2dvi and texindex. ++% This works without changing the escape character used in the toc or aux ++% files because the index entries are fully expanded here, and \string uses ++% the current value of \escapechar. ++\def\escapeisbackslash{\escapechar=`\\} ++ ++% Use \ in index files by default. texi2dvi didn't support @ as the escape ++% character (as it checked for "\entry" in the files, and not "@entry"). When ++% the new version of texi2dvi has had a chance to become more prevalent, then ++% the escape character can change back to @ again. This should be an easy ++% change to make now because both @ and \ are only used as escape characters in ++% index files, never standing for themselves. ++% ++\set txiindexescapeisbackslash ++ ++% Write the entry in \indextext to the index file. ++% ++ ++\newif\ifincodeindex ++\def\doindwrite{\incodeindexfalse\doindwritex} ++\def\docindwrite{\incodeindextrue\doindwritex} ++ ++\def\doindwritex{% ++ \maybemarginindex + % +- % Remember, we are within a group. +- \indexdummies % Must do this here, since \bf, etc expand at this stage +- \useindexbackslash % \indexbackslash isn't defined now so it will be output +- % as is; and it will print as backslash. +- % The braces around \indexbrace are recognized by texindex. +- % +- % Get the string to sort by, by processing the index entry with all +- % font commands turned off. +- {\indexnofonts +- \def\lbracechar{{\indexlbrace}}% +- \def\rbracechar{{\indexrbrace}}% +- \let\{=\lbracechar +- \let\}=\rbracechar +- \indexnonalnumdisappear +- \xdef\indexsortkey{}% +- \let\sortas=\indexwritesortas +- \edef\temp{\the\toks0}% +- \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas +- \ifx\indexsortkey\empty +- \xdef\indexsortkey{\temp}% +- \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi +- \fi +- }% ++ \atdummies ++ % ++ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else ++ \escapeisbackslash ++ \fi ++ % ++ % For texindex which always views { and } as separators. ++ \def\{{\lbracechar{}}% ++ \def\}{\rbracechar{}}% ++ \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}% ++ % ++ % Split the entry into primary entry and any subentries, and get the index ++ % sort key. ++ \splitindexentry\indextext + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. ++ % + \edef\temp{% + \write\writeto{% +- \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% ++ \string\entry{\fullindexsortkey}% ++ {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}% ++ \bracedtext}% + }% + \temp + } +-\newbox\dummybox % used above ++ ++% Put the index entry in the margin if desired (undocumented). ++\def\maybemarginindex{% ++ \ifx\SETmarginindex\relax\else ++ \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}% ++ \fi ++} ++\let\SETmarginindex=\relax ++ + + % Take care of unwanted page breaks/skips around a whatsit: + % +@@ -5459,9 +5602,14 @@ + % \entry {topic}{pagelist} + % for a topic that is used without subtopics + % \primary {topic} ++% \entry {topic}{} + % for the beginning of a topic that is used with subtopics + % \secondary {subtopic}{pagelist} + % for each subtopic. ++% \secondary {subtopic}{} ++% for a subtopic with sub-subtopics ++% \tertiary {subtopic}{subsubtopic}{pagelist} ++% for each sub-subtopic. + + % Define the user-accessible indexing commands + % @findex, @vindex, @kindex, @cindex. +@@ -5473,11 +5621,6 @@ + \def\tindex {\tpindex} + \def\pindex {\pgindex} + +-\def\cindexsub {\begingroup\obeylines\cindexsub} +-{\obeylines % +-\gdef\cindexsub "#1" #2^^M{\endgroup % +-\dosubind{cp}{#2}{#1}}} +- + % Define the macros used in formatting output of the sorted index material. + + % @printindex causes a particular index (the ??s file) to get printed. +@@ -5491,14 +5634,10 @@ + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % +- % See if the index file exists and is nonempty. +- % Change catcode of @ here so that if the index file contains +- % \initial {@} +- % as its first line, TeX doesn't complain about mismatched braces +- % (because it thinks @} is a control sequence). +- \catcode`\@ = 12 + % See comment in \requireopenindexfile. + \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi ++ % ++ % See if the index file exists and is nonempty. + \openin 1 \jobname.\indexname s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, +@@ -5508,8 +5647,6 @@ + \putwordIndexNonexistent + \typeout{No file \jobname.\indexname s.}% + \else +- \catcode`\\ = 0 +- % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. +@@ -5517,47 +5654,55 @@ + \ifeof 1 + \putwordIndexIsEmpty + \else +- % Index files are almost Texinfo source, but we use \ as the escape +- % character. It would be better to use @, but that's too big a change +- % to make right now. +- \def\indexbackslash{\ttbackslash}% +- \let\indexlbrace\{ % Likewise, set these sequences for braces +- \let\indexrbrace\} % used in the sort key. +- \begindoublecolumns +- \let\dotheinsertentrybox\dotheinsertentryboxwithpenalty +- % +- % Read input from the index file line by line. +- \loopdo +- \ifeof1 \else +- \read 1 to \nextline +- \fi +- % +- \indexinputprocessing +- \thisline +- % +- \ifeof1\else +- \let\thisline\nextline +- \repeat +- %% +- \enddoublecolumns ++ \expandafter\printindexzz\thisline\relax\relax\finish% + \fi + \fi + \closein 1 + \endgroup} +-\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx} +-\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next} + +-\def\indexinputprocessing{% +- \ifeof1 +- \let\firsttoken\relax ++% If the index file starts with a backslash, forgo reading the index ++% file altogether. If somebody upgrades texinfo.tex they may still have ++% old index files using \ as the escape character. Reading this would ++% at best lead to typesetting garbage, at worst a TeX syntax error. ++\def\printindexzz#1#2\finish{% ++ \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax ++ \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1 ++ \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax ++\errmessage{% ++ERROR: A sorted index file in an obsolete format was skipped. ++To fix this problem, please upgrade your version of 'texi2dvi' ++or 'texi2pdf' to that at . ++If you are using an old version of 'texindex' (part of the Texinfo ++distribution), you may also need to upgrade to a newer version (at least 6.0). ++You may be able to typeset the index if you run ++'texindex \jobname.\indexname' yourself. ++You could also try setting the 'txiindexescapeisbackslash' flag by ++running a command like ++'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do ++this, Texinfo will try to use index files in the old format. ++If you continue to have problems, deleting the index files and starting again ++might help (with 'rm \jobname.?? \jobname.??s')% ++}% ++ \else ++ (Skipped sorted index file in obsolete format) ++ \fi ++ \else ++ \begindoublecolumns ++ \input \jobname.\indexname s ++ \enddoublecolumns ++ \fi + \else +- \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}% +- \act ++ \begindoublecolumns ++ \catcode`\\=0\relax ++ % ++ % Make @ an escape character to give macros a chance to work. This ++ % should work because we (hopefully) don't otherwise use @ in index files. ++ %\catcode`\@=12\relax ++ \catcode`\@=0\relax ++ \input \jobname.\indexname s ++ \enddoublecolumns + \fi + } +-\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken} +-\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1} +- + + % These macros are used by the sorted index file itself. + % Change them to control the appearance of the index. +@@ -5566,12 +5711,19 @@ + \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13 + \catcode`\$=3 + \gdef\initialglyphs{% ++ % special control sequences used in the index sort key ++ \let\indexlbrace\{% ++ \let\indexrbrace\}% ++ \let\indexatchar\@% ++ \def\indexbackslash{\math{\backslash}}% ++ % + % Some changes for non-alphabetic characters. Using the glyphs from the + % math fonts looks more consistent than the typewriter font used elsewhere + % for these characters. +- \def\indexbackslash{\math{\backslash}}% +- \let\\=\indexbackslash ++ \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}} + % ++ % In case @\ is used for backslash ++ \uppercase{\let\\=~} + % Can't get bold backslash so don't use bold forward slash + \catcode`\/=13 + \def/{{\secrmnotbold \normalslash}}% +@@ -5601,7 +5753,7 @@ + % bottom of a column to reduce an increase in inter-line spacing. + \nobreak + \vskip 0pt plus 5\baselineskip +- \penalty -300 ++ \penalty -300 + \vskip 0pt plus -5\baselineskip + % + % Typeset the initial. Making this add up to a whole number of +@@ -5631,12 +5783,6 @@ + \def\entry{% + \begingroup + % +- % For pdfTeX and XeTeX. +- % The redefinition of \domark stops marks being added in \pdflink to +- % preserve coloured links across page boundaries. Otherwise the marks +- % would get in the way of \lastbox in \insertentrybox. +- \let\domark\relax +- % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par +@@ -5669,35 +5815,31 @@ + \gdef\finishentry#1{% + \egroup % end box A + \dimen@ = \wd\boxA % Length of text of entry +- \global\setbox\boxA=\hbox\bgroup\unhbox\boxA +- % #1 is the page number. +- % +- % Get the width of the page numbers, and only use +- % leaders if they are present. +- \global\setbox\boxB = \hbox{#1}% +- \ifdim\wd\boxB = 0pt +- \null\nobreak\hfill\ % +- \else +- % +- \null\nobreak\indexdotfill % Have leaders before the page number. ++ \global\setbox\boxA=\hbox\bgroup ++ \unhbox\boxA ++ % #1 is the page number. + % +- \ifpdf +- \pdfgettoks#1.% +- \hskip\skip\thinshrinkable\the\toksA ++ % Get the width of the page numbers, and only use ++ % leaders if they are present. ++ \global\setbox\boxB = \hbox{#1}% ++ \ifdim\wd\boxB = 0pt ++ \null\nobreak\hfill\ % + \else +- \ifx\XeTeXrevision\thisisundefined +- \hskip\skip\thinshrinkable #1% +- \else ++ % ++ \null\nobreak\indexdotfill % Have leaders before the page number. ++ % ++ \ifpdforxetex + \pdfgettoks#1.% + \hskip\skip\thinshrinkable\the\toksA ++ \else ++ \hskip\skip\thinshrinkable #1% + \fi + \fi +- \fi + \egroup % end \boxA + \ifdim\wd\boxB = 0pt +- \global\setbox\entrybox=\vbox{\unhbox\boxA}% +- \else +- \global\setbox\entrybox=\vbox\bgroup ++ \noindent\unhbox\boxA\par ++ \nobreak ++ \else\bgroup + % We want the text of the entries to be aligned to the left, and the + % page numbers to be aligned to the right. + % +@@ -5727,7 +5869,7 @@ + \advance\dimen@ii by 1\dimen@i + \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line + \ifdim\dimen@ > 0.8\dimen@ii % due to long index text +- % Try to split the text roughly evenly. \dimen@ will be the length of ++ % Try to split the text roughly evenly. \dimen@ will be the length of + % the first line. + \dimen@ = 0.7\dimen@ + \dimen@ii = \hsize +@@ -5763,55 +5905,11 @@ + \egroup % The \vbox + \fi + \endgroup +- \dotheinsertentrybox + }} + + \newskip\thinshrinkable + \skip\thinshrinkable=.15em minus .15em + +-\newbox\entrybox +-\def\insertentrybox{% +- \ourunvbox\entrybox +-} +- +-% default definition +-\let\dotheinsertentrybox\insertentrybox +- +-% Use \lastbox to take apart vbox box by box, and add each sub-box +-% to the current vertical list. +-\def\ourunvbox#1{% +-\bgroup % for local binding of \delayedbox +- % Remove the last box from box #1 +- \global\setbox#1=\vbox{% +- \unvbox#1% +- \unskip % remove any glue +- \unpenalty +- \global\setbox\interbox=\lastbox +- }% +- \setbox\delayedbox=\box\interbox +- \ifdim\ht#1=0pt\else +- \ourunvbox#1 % Repeat on what's left of the box +- \nobreak +- \fi +- \box\delayedbox +-\egroup +-} +-\newbox\delayedbox +-\newbox\interbox +- +-% Used from \printindex. \firsttoken should be the first token +-% after the \entry. If it's not another \entry, we are at the last +-% line of a group of index entries, so insert a penalty to discourage +-% widowed index entries. +-\def\dotheinsertentryboxwithpenalty{% +- \ifx\firsttoken\isentry +- \else +- \penalty 9000 +- \fi +- \insertentrybox +-} +-\def\isentry{\entry}% +- + % Like plain.tex's \dotfill, except uses up at least 1 em. + % The filll stretch here overpowers both the fil and fill stretch to push + % the page number to the right. +@@ -5821,24 +5919,15 @@ + + \def\primary #1{\line{#1\hfil}} + +-\newskip\secondaryindent \secondaryindent=0.5cm +-\def\secondary#1#2{{% +- \parfillskip=0in +- \parskip=0in +- \hangindent=1in +- \hangafter=1 +- \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill +- \ifpdf +- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. +- \else +- \ifx\XeTeXrevision\thisisundefined +- #2 +- \else +- \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. +- \fi +- \fi +- \par +-}} ++\def\secondary{\indententry{0.5cm}} ++\def\tertiary{\indententry{1cm}} ++ ++\def\indententry#1#2#3{% ++ \bgroup ++ \leftskip=#1 ++ \entry{#2}{#3}% ++ \egroup ++} + + % Define two-column mode, which we use to typeset indexes. + % Adapted from the TeXbook, page 416, which is to say, +@@ -5848,60 +5937,21 @@ + \newbox\partialpage + \newdimen\doublecolumnhsize + +-% Use inside an output routine to save \topmark and \firstmark +-\def\savemarks{% +- \global\savedtopmark=\expandafter{\topmark }% +- \global\savedfirstmark=\expandafter{\firstmark }% +-} +-\newtoks\savedtopmark +-\newtoks\savedfirstmark +- +-% Set \topmark and \firstmark for next time \output runs. +-% Can't be run from withinside \output (because any material +-% added while an output routine is active, including +-% penalties, is saved for after it finishes). The page so far +-% should be empty, otherwise what's on it will be thrown away. +-\def\restoremarks{% +- \mark{\the\savedtopmark}% +- \bgroup\output = {% +- \setbox\dummybox=\box\PAGE +- }abc\eject\egroup +- % "abc" because output routine doesn't fire for a completely empty page. +- \mark{\the\savedfirstmark}% +-} +- + \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % If not much space left on page, start a new page. + \ifdim\pagetotal>0.8\vsize\vfill\eject\fi + % + % Grab any single-column material above us. + \output = {% +- % +- % Here is a possibility not foreseen in manmac: if we accumulate a +- % whole lot of material, we might end up calling this \output +- % routine twice in a row (see the doublecol-lose test, which is +- % essentially a couple of indexes with @setchapternewpage off). In +- % that case we just ship out what is in \partialpage with the normal +- % output routine. Generally, \partialpage will be empty when this +- % runs and this will be a no-op. See the indexspread.tex test case. +- \ifvoid\partialpage \else +- \onepageout{\pagecontents\partialpage}% +- \fi ++ \savetopmark + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% +- \savemarks + }% + \eject % run that output routine to set \partialpage +- \restoremarks +- % +- % We recover the two marks that the last output routine saved in order +- % to propagate the information in marks added around a chapter heading, +- % which could be otherwise be lost by the time the final page is output. +- % + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% +@@ -5927,7 +5977,9 @@ + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % +- % Double the \vsize as well. ++ % Get the available space for the double columns -- the normal ++ % (undoubled) page height minus any material left over from the ++ % previous page. + \advance\vsize by -\ht\partialpage + \vsize = 2\vsize + % +@@ -5940,17 +5992,15 @@ + % + \def\doublecolumnout{% + % ++ \savetopmark + \splittopskip=\topskip \splitmaxdepth=\maxdepth +- % Get the available space for the double columns -- the normal +- % (undoubled) page height minus any material left over from the +- % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@ + \global\advance\vsize by 2\ht\partialpage +- \onepageout\pagesofar ++ \onepageout\pagesofar % empty except for the first time we are called + \unvbox\PAGE + \penalty\outputpenalty + } +@@ -5966,7 +6016,7 @@ + } + + +-% Finished with with double columns. ++% Finished with double columns. + \def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the +@@ -5998,7 +6048,7 @@ + % + \output = {% + % Split the last of the double-column material. +- \savemarks ++ \savetopmark + \balancecolumns + }% + \eject % call the \output just set +@@ -6006,10 +6056,9 @@ + % Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. +- \global\output = {\onepageout{\pagecontents\PAGE}}% ++ \global\output=\expandafter{\the\defaultoutput} + % + \endgroup % started in \begindoublecolumns +- \restoremarks + % Leave the double-column material on the current page, no automatic + % page break. + \box\balancedcolumns +@@ -6028,18 +6077,19 @@ + \newbox\balancedcolumns + \setbox\balancedcolumns=\vbox{shouldnt see this}% + % +-% Only called for the last of the double column material. \doublecolumnout ++% Only called for the last of the double column material. \doublecolumnout + % does the others. + \def\balancecolumns{% + \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 +- \advance\dimen@ by \topskip +- \advance\dimen@ by-\baselineskip +- \ifdim\dimen@<5\baselineskip ++ \ifdim\dimen@<7\baselineskip + % Don't split a short final column in two. + \setbox2=\vbox{}% + \global\setbox\balancedcolumns=\vbox{\pagesofar}% + \else ++ % double the leading vertical space ++ \advance\dimen@ by \topskip ++ \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + \dimen@ii = \dimen@ + \splittopskip = \topskip +@@ -6055,7 +6105,7 @@ + }% + % Now the left column is in box 1, and the right column in box 3. + % +- % Check whether the left column has come out higher than the page itself. ++ % Check whether the left column has come out higher than the page itself. + % (Note that we have doubled \vsize for the double columns, so + % the actual height of the page is 0.5\vsize). + \ifdim2\ht1>\vsize +@@ -6174,11 +6224,9 @@ + + % @raisesections: treat @section as chapter, @subsection as section, etc. + \def\raisesections{\global\advance\secbase by -1} +-\let\up=\raisesections % original BFox name + + % @lowersections: treat @chapter as section, @section as subsection, etc. + \def\lowersections{\global\advance\secbase by 1} +-\let\down=\lowersections % original BFox name + + % we only have subsub. + \chardef\maxseclevel = 3 +@@ -6354,7 +6402,7 @@ + \let\top\unnumbered + + % Sections. +-% ++% + \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz + \def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 +@@ -6377,7 +6425,7 @@ + } + + % Subsections. +-% ++% + % normally calls numberedsubseczzz: + \outer\parseargdef\numberedsubsec{\numhead2{#1}} + \def\numberedsubseczzz#1{% +@@ -6402,7 +6450,7 @@ + } + + % Subsubsections. +-% ++% + % normally numberedsubsubseczzz: + \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} + \def\numberedsubsubseczzz#1{% +@@ -6492,18 +6540,16 @@ + \def\CHAPPAGoff{% + \global\let\contentsalignmacro = \chappager + \global\let\pchapsepmacro=\chapbreak +-\global\let\pagealignmacro=\chappager} ++\global\def\HEADINGSon{\HEADINGSsinglechapoff}} + + \def\CHAPPAGon{% + \global\let\contentsalignmacro = \chappager + \global\let\pchapsepmacro=\chappager +-\global\let\pagealignmacro=\chappager + \global\def\HEADINGSon{\HEADINGSsingle}} + + \def\CHAPPAGodd{% + \global\let\contentsalignmacro = \chapoddpage + \global\let\pchapsepmacro=\chapoddpage +-\global\let\pagealignmacro=\chapoddpage + \global\def\HEADINGSon{\HEADINGSdouble}} + + \CHAPPAGon +@@ -6523,27 +6569,22 @@ + \expandafter\ifx\thisenv\titlepage\else + \checkenv{}% chapters, etc., should not start inside an environment. + \fi +- % FIXME: \chapmacro is currently called from inside \titlepage when +- % \setcontentsaftertitlepage to print the "Table of Contents" heading, but +- % this should probably be done by \sectionheading with an option to print +- % in chapter size. +- % + % Insert the first mark before the heading break (see notes for \domark). +- \let\prevchapterdefs=\lastchapterdefs +- \let\prevsectiondefs=\lastsectiondefs +- \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% ++ \let\prevchapterdefs=\currentchapterdefs ++ \let\prevsectiondefs=\currentsectiondefs ++ \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword +- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% ++ \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword +- \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% ++ \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% +- \xdef\lastchapterdefs{% ++ \xdef\currentchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + % \noexpand\putwordAppendix avoids expanding indigestible +@@ -6554,7 +6595,7 @@ + }% + \else + \toks0={#1}% +- \xdef\lastchapterdefs{% ++ \xdef\currentchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + % \noexpand\putwordChapter avoids expanding indigestible +@@ -6574,18 +6615,18 @@ + % + % Now the second mark, after the heading break. No break points + % between here and the heading. +- \let\prevchapterdefs=\lastchapterdefs +- \let\prevsectiondefs=\lastsectiondefs ++ \let\prevchapterdefs=\currentchapterdefs ++ \let\prevsectiondefs=\currentsectiondefs + \domark + % + {% + \chapfonts \rm + \let\footnote=\errfootnoteheading % give better error message + % +- % Have to define \lastsection before calling \donoderef, because the ++ % Have to define \currentsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. +- \gdef\lastsection{#1}% ++ \gdef\currentsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. +@@ -6674,10 +6715,10 @@ + \csname #2fonts\endcsname \rm + % + % Insert first mark before the heading break (see notes for \domark). +- \let\prevsectiondefs=\lastsectiondefs ++ \let\prevsectiondefs=\currentsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword +- \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% ++ \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword +@@ -6685,7 +6726,7 @@ + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% +- \xdef\lastsectiondefs{% ++ \xdef\currentsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible +@@ -6698,7 +6739,7 @@ + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% +- \xdef\lastsectiondefs{% ++ \xdef\currentsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + % \noexpand\putwordSection avoids expanding indigestible +@@ -6724,28 +6765,28 @@ + % + % Now the second mark, after the heading break. No break points + % between here and the heading. +- \global\let\prevsectiondefs=\lastsectiondefs ++ \global\let\prevsectiondefs=\currentsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% +- \gdef\lastsection{#1}% ++ \gdef\currentsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, +- % and don't redefine \lastsection. ++ % and don't redefine \currentsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% +- \gdef\lastsection{#1}% ++ \gdef\currentsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% +- \gdef\lastsection{#1}% ++ \gdef\currentsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. +@@ -6835,13 +6876,8 @@ + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. +- \ifpdf ++ \ifpdforxetex + \global\pdfmakepagedesttrue +- \else +- \ifx\XeTeXrevision\thisisundefined +- \else +- \global\pdfmakepagedesttrue +- \fi + \fi + } + +@@ -6878,9 +6914,7 @@ + % + \def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should +- % start on an odd page, unlike chapters. Thus, we maintain +- % \contentsalignmacro in parallel with \pagealignmacro. +- % From: Torbjorn Granlund ++ % start on an odd page, unlike chapters. + \contentsalignmacro + \immediate\closeout\tocfile + % +@@ -6895,6 +6929,9 @@ + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi ++ \def\thistitle{}% no title in double-sided headings ++ % Record where the Roman numerals started. ++ \ifnum\romancount=0 \global\romancount=\pagecount \fi + } + + % redefined for the two-volume lispref. We always output on +@@ -6917,8 +6954,7 @@ + \fi + \closein 1 + \endgroup +- \lastnegativepageno = \pageno +- \global\pageno = \savepageno ++ \contentsendroman + } + + % And just the chapters. +@@ -6953,10 +6989,20 @@ + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup ++ \contentsendroman ++} ++\let\shortcontents = \summarycontents ++ ++% Get ready to use Arabic numerals again ++\def\contentsendroman{% + \lastnegativepageno = \pageno + \global\pageno = \savepageno ++ % ++ % If \romancount > \arabiccount, the contents are at the end of the ++ % document. Otherwise, advance where the Arabic numerals start for ++ % the page numbers. ++ \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi + } +-\let\shortcontents = \summarycontents + + % Typeset the label for a chapter or appendix for the short contents. + % The arg is, e.g., `A' for an appendix, or `3' for a chapter. +@@ -7204,11 +7250,7 @@ + + % @cartouche ... @end cartouche: draw rectangle w/rounded corners around + % environment contents. +-\font\circle=lcircle10 +-\newdimen\circthick +-\newdimen\cartouter\newdimen\cartinner +-\newskip\normbskip\newskip\normpskip\newskip\normlskip +-\circthick=\fontdimen8\circle ++ + % + \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth + \def\ctr{{\hskip 6pt\circle\char'010}} +@@ -7223,7 +7265,18 @@ + % + \newskip\lskip\newskip\rskip + ++% only require the font if @cartouche is actually used ++\def\cartouchefontdefs{% ++ \font\circle=lcircle10\relax ++ \circthick=\fontdimen8\circle ++} ++\newdimen\circthick ++\newdimen\cartouter\newdimen\cartinner ++\newskip\normbskip\newskip\normpskip\newskip\normlskip ++ ++ + \envdef\cartouche{% ++ \cartouchefontdefs + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip +@@ -7402,13 +7455,9 @@ + + + % @raggedright does more-or-less normal line breaking but no right +-% justification. From plain.tex. Don't stretch around special +-% characters in urls in this environment, since the stretch at the right +-% should be enough. ++% justification. From plain.tex. + \envdef\raggedright{% + \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax +- \def\urefprestretchamount{0pt}% +- \def\urefpoststretchamount{0pt}% + } + \let\Eraggedright\par + +@@ -7467,7 +7516,7 @@ + + % @indentedblock is like @quotation, but indents only on the left and + % has no optional argument. +-% ++% + \makedispenvdef{indentedblock}{\indentedblockstart} + % + \def\indentedblockstart{% +@@ -7542,13 +7591,9 @@ + \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount + % + % We typeset each line of the verbatim in an \hbox, so we can handle +-% tabs. The \global is in case the verbatim line starts with an accent, +-% or some other command that starts with a begin-group. Otherwise, the +-% entire \verbbox would disappear at the corresponding end-group, before +-% it is typeset. Meanwhile, we can't have nested verbatim commands +-% (can we?), so the \global won't be overwriting itself. ++% tabs. + \newbox\verbbox +-\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} ++\def\starttabbox{\setbox\verbbox=\hbox\bgroup} + % + \begingroup + \catcode`\^^I=\active +@@ -7559,7 +7604,8 @@ + \divide\dimen\verbbox by\tabw + \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw + \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw +- \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox ++ \wd\verbbox=\dimen\verbbox ++ \leavevmode\box\verbbox \starttabbox + }% + } + \endgroup +@@ -7569,9 +7615,7 @@ + \let\nonarrowing = t% + \nonfillstart + \tt % easiest (and conventionally used) font for verbatim +- % The \leavevmode here is for blank lines. Otherwise, we would +- % never \starttabox and the \egroup would end verbatim mode. +- \def\par{\leavevmode\egroup\box\verbbox\endgraf}% ++ \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}% + \tabexpand + \setupmarkupstyle{verbatim}% + % Respect line breaks, +@@ -7579,7 +7623,6 @@ + % make each space count. + % Must do in this order: + \obeylines \uncatcodespecials \sepspaces +- \everypar{\starttabbox}% + } + + % Do the @verb magic: verbatim text is quoted by unique +@@ -7614,13 +7657,16 @@ + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. +- \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% ++ \xdef\doverbatim#1^^M#2@end verbatim{% ++ \starttabbox#2\egroup\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. ++ % The \egroup ends the \verbbox started at the end of the last line in ++ % the block. + \endgroup + % + \envdef\verbatim{% +- \setupverbatim\doverbatim ++ \setnormaldispenv\setupverbatim\doverbatim + } + \let\Everbatim = \afterenvbreak + +@@ -7633,9 +7679,12 @@ + {% + \makevalueexpandable + \setupverbatim +- \indexnofonts % Allow `@@' and other weird things in file names. +- \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% +- \input #1 ++ {% ++ \indexnofonts % Allow `@@' and other weird things in file names. ++ \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% ++ \edef\tmp{\noexpand\input #1 } ++ \expandafter ++ }\expandafter\starttabbox\tmp\egroup + \afterenvbreak + }% + } +@@ -7764,7 +7813,7 @@ + % @deftypefnnewline on|off says whether the return type of typed functions + % are printed on their own line. This affects @deftypefn, @deftypefun, + % @deftypeop, and @deftypemethod. +-% ++% + \parseargdef\deftypefnnewline{% + \def\temp{#1}% + \ifx\temp\onword +@@ -7780,6 +7829,21 @@ + \fi\fi + } + ++% \dosubind {index}{topic}{subtopic} ++% ++% If SUBTOPIC is present, precede it with a space, and call \doind. ++% (At some time during the 20th century, this made a two-level entry in an ++% index such as the operation index. Nobody seemed to notice the change in ++% behaviour though.) ++\def\dosubind#1#2#3{% ++ \def\thirdarg{#3}% ++ \ifx\thirdarg\empty ++ \doind{#1}{#2}% ++ \else ++ \doind{#1}{#2\space#3}% ++ \fi ++} ++ + % Untyped functions: + + % @deffn category name args +@@ -7794,7 +7858,6 @@ + % \deffngeneral {subind}category name args + % + \def\deffngeneral#1#2 #3 #4\endheader{% +- % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% + } +@@ -7945,7 +8008,7 @@ + \tclose{\temp}% typeset the return type + \ifrettypeownline + % put return type on its own line; prohibit line break following: +- \hfil\vadjust{\nobreak}\break ++ \hfil\vadjust{\nobreak}\break + \else + \space % type on same line, so just followed by a space + \fi +@@ -8001,6 +8064,7 @@ + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} + } ++\let\ampchar\& + + \newcount\parencount + +@@ -8081,36 +8145,18 @@ + } + \fi + +-% alias because \c means cedilla in @tex or @math +-\let\texinfoc=\c +- +-\newcount\savedcatcodeone +-\newcount\savedcatcodetwo +- + % Used at the time of macro expansion. + % Argument is macro body with arguments substituted + \def\scanmacro#1{% + \newlinechar`\^^M + \def\xeatspaces{\eatspaces}% + % +- % Temporarily undo catcode changes of \printindex. Set catcode of @ to +- % 0 so that @-commands in macro expansions aren't printed literally when +- % formatting an index file, where \ is used as the escape character. +- \savedcatcodeone=\catcode`\@ +- \savedcatcodetwo=\catcode`\\ +- \catcode`\@=0 +- \catcode`\\=\active +- % + % Process the macro body under the current catcode regime. +- \scantokens{#1@texinfoc}% ++ \scantokens{#1@comment}% + % +- \catcode`\@=\savedcatcodeone +- \catcode`\\=\savedcatcodetwo +- % +- % The \texinfoc is to remove the \newlinechar added by \scantokens, and +- % can be noticed by \parsearg. +- % We avoid surrounding the call to \scantokens with \bgroup and \egroup +- % to allow macros to open or close groups themselves. ++ % The \comment is to remove the \newlinechar added by \scantokens, and ++ % can be noticed by \parsearg. Note \c isn't used because this means cedilla ++ % in math mode. + } + + % Used for copying and captions +@@ -8211,12 +8257,14 @@ + \def\macroargctxt{% + \scanctxt + \catcode`\ =\active ++ \catcode`\@=\other + \catcode`\^^M=\other + \catcode`\\=\active + } + + \def\macrolineargctxt{% used for whole-line arguments without braces + \scanctxt ++ \catcode`\@=\other + \catcode`\{=\other + \catcode`\}=\other + } +@@ -8308,7 +8356,7 @@ + % list to some hook where the argument is to be expanded. If there are + % less than 10 arguments that hook is to be replaced by ##N where N + % is the position in that list, that is to say the macro arguments are to be +-% defined `a la TeX in the macro body. ++% defined `a la TeX in the macro body. + % + % That gets used by \mbodybackslash (above). + % +@@ -8339,8 +8387,8 @@ + % + % Read recursive and nonrecursive macro bodies. (They're different since + % rec and nonrec macros end differently.) +-% +-% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro ++% ++% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro + % body to be transformed. + % Set \macrobody to the body of the macro, and call \defmacro. + % +@@ -8374,7 +8422,7 @@ + % twice the \macarg.BLAH macros does not cost too much processing power. + \def\parsemmanyargdef@@#1,{% + \if#1;\let\next=\relax +- \else ++ \else + \let\next=\parsemmanyargdef@@ + \edef\tempb{\eatspaces{#1}}% + \expandafter\def\expandafter\tempa +@@ -8459,7 +8507,7 @@ + + % Replace arguments by their values in the macro body, and place the result + % in macro \@tempa. +-% ++% + \def\macvalstoargs@{% + % To do this we use the property that token registers that are \the'ed + % within an \edef expand only once. So we are going to place all argument +@@ -8483,9 +8531,9 @@ + \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% + } + +-% Define the named-macro outside of this group and then close this group. +-% +-\def\macargexpandinbody@{% ++% Define the named-macro outside of this group and then close this group. ++% ++\def\macargexpandinbody@{% + \expandafter + \endgroup + \macargdeflist@ +@@ -8523,7 +8571,7 @@ + } + + % Trailing missing arguments are set to empty. +-% ++% + \def\setemptyargvalues@{% + \ifx\paramlist\nilm@ + \let\next\macargexpandinbody@ +@@ -8600,7 +8648,7 @@ + \else % at most 9 + \ifnum\paramno<10\relax + % @MACNAME sets the context for reading the macro argument +- % @MACNAME@@ gets the argument, processes backslashes and appends a ++ % @MACNAME@@ gets the argument, processes backslashes and appends a + % comma. + % @MACNAME@@@ removes braces surrounding the argument list. + % @MACNAME@@@@ scans the macro body with arguments substituted. +@@ -8644,11 +8692,11 @@ + % Call #1 with a list of tokens #2, with any doubled backslashes in #2 + % compressed to one. + % +-% This implementation works by expansion, and not execution (so we cannot use +-% \def or similar). This reduces the risk of this failing in contexts where +-% complete expansion is done with no execution (for example, in writing out to ++% This implementation works by expansion, and not execution (so we cannot use ++% \def or similar). This reduces the risk of this failing in contexts where ++% complete expansion is done with no execution (for example, in writing out to + % an auxiliary file for an index entry). +-% ++% + % State is kept in the input stream: the argument passed to + % @look_ahead, @gobble_and_check_finish and @add_segment is + % +@@ -8670,11 +8718,11 @@ + % #3 - NEXT_TOKEN + % #4 used to look ahead + % +-% If the next token is not a backslash, process the rest of the argument; ++% If the next token is not a backslash, process the rest of the argument; + % otherwise, remove the next token. + @gdef@look_ahead#1!#2#3#4{% + @ifx#4\% +- @expandafter@gobble_and_check_finish ++ @expandafter@gobble_and_check_finish + @else + @expandafter@add_segment + @fi#1!{#2}#4#4% +@@ -8698,9 +8746,9 @@ + % #3 - NEXT_TOKEN + % #4 is input stream until next backslash + % +-% Input stream is either at the start of the argument, or just after a +-% backslash sequence, either a lone backslash, or a doubled backslash. +-% NEXT_TOKEN contains the first token in the input stream: if it is \finish, ++% Input stream is either at the start of the argument, or just after a ++% backslash sequence, either a lone backslash, or a doubled backslash. ++% NEXT_TOKEN contains the first token in the input stream: if it is \finish, + % finish; otherwise, append to ARG_RESULT the segment of the argument up until + % the next backslash. PENDING_BACKSLASH contains a backslash to represent + % a backslash just before the start of the input stream that has not been +@@ -8712,13 +8760,13 @@ + % append the pending backslash to the result, followed by the next segment + @expandafter@is_fi@look_ahead#1#2#4!{\}@fi + % this @fi is discarded by @look_ahead. +- % we can't get rid of it with \expandafter because we don't know how ++ % we can't get rid of it with \expandafter because we don't know how + % long #4 is. + } + + % #1 - THE_MACRO + % #2 - ARG_RESULT +-% #3 discards the res of the conditional in @add_segment, and @is_fi ends the ++% #3 discards the res of the conditional in @add_segment, and @is_fi ends the + % conditional. + @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} + +@@ -8730,7 +8778,7 @@ + % for reading the argument (slightly different in the two cases). Then, + % to read the argument, in the whole-line case, it then calls the regular + % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC. +-% ++% + \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} + \def\braceorlinexxx{% + \ifx\nchar\bgroup +@@ -8780,9 +8828,29 @@ + % also remove a trailing comma, in case of something like this: + % @node Help-Cross, , , Cross-refs + \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} ++\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode} ++ ++% Used so that the @top node doesn't have to be wrapped in an @ifnottex ++% conditional. ++% \doignore goes to more effort to skip nested conditionals but we don't need ++% that here. ++\def\omittopnode{% ++ \ifx\lastnode\wordTop ++ \expandafter\ignorenode\fi ++} ++\def\wordTop{Top} ++ ++% Until the next @node or @bye command, divert output to a box that is not ++% output. ++\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}% ++\ignorenodebye ++} ++ ++{\let\bye\relax ++\gdef\ignorenodebye{\let\bye\ignorenodebyedef} ++\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}} ++% The redefinition of \bye here is because it is declared \outer + +-\let\nwnode=\node + \let\lastnode=\empty + + % Write a cross-reference definition for the current node. #1 is the +@@ -8805,7 +8873,7 @@ + + % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an + % anchor), which consists of three parts: +-% 1) NAME-title - the current sectioning name taken from \lastsection, ++% 1) NAME-title - the current sectioning name taken from \currentsection, + % or the anchor name. + % 2) NAME-snt - section number and type, passed as the SNT arg, or + % empty for anchors. +@@ -8827,7 +8895,7 @@ + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% +- \toks0 = \expandafter{\lastsection}% ++ \toks0 = \expandafter{\currentsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout +@@ -8839,7 +8907,7 @@ + % automatically in xrefs, if the third arg is not explicitly specified. + % This was provided as a "secret" @set xref-automatic-section-title + % variable, now it's official. +-% ++% + \parseargdef\xrefautomaticsectiontitle{% + \def\temp{#1}% + \ifx\temp\onword +@@ -8855,7 +8923,7 @@ + \fi\fi + } + +-% ++% + % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is + % the node name, #2 the name of the Info cross-reference, #3 the printed + % node name, #4 the name of the Info file, #5 the name of the printed +@@ -9008,40 +9076,34 @@ + \fi + \else + % node/anchor (non-float) references. +- % ++ % + % If we use \unhbox to print the node names, TeX does not insert + % empty discretionaries after hyphens, which means that it will not + % find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, + % this is a loss. Therefore, we give the text of the node name + % again, so it is as if TeX is seeing it for the first time. +- % ++ % + \ifdim \wd\printedmanualbox > 0pt + % Cross-manual reference with a printed manual name. +- % ++ % + \crossmanualxref{\cite{\printedmanual\unskip}}% + % + \else\ifdim \wd\infofilenamebox > 0pt + % Cross-manual reference with only an info filename (arg 4), no + % printed manual name (arg 5). This is essentially the same as + % the case above; we output the filename, since we have nothing else. +- % ++ % + \crossmanualxref{\code{\infofilename\unskip}}% + % + \else + % Reference within this manual. + % +- % _ (for example) has to be the character _ for the purposes of the +- % control sequence corresponding to the node, but it has to expand +- % into the usual \leavevmode...\vrule stuff for purposes of +- % printing. So we \turnoffactive for the \refx-snt, back on for the +- % printing, back off for the \refx-pg. +- {\turnoffactive +- % Only output a following space if the -snt ref is nonempty; for +- % @unnumbered and @anchor, it won't be. +- \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% +- \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi +- }% ++ % Only output a following space if the -snt ref is nonempty; for ++ % @unnumbered and @anchor, it won't be. ++ \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% ++ \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi ++ % + % output the `[mynode]' via the macro below so it can be overridden. + \xrefprintnodename\printedrefname + % +@@ -9065,20 +9127,20 @@ + \endgroup} + + % Output a cross-manual xref to #1. Used just above (twice). +-% ++% + % Only include the text "Section ``foo'' in" if the foo is neither + % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply + % "see The Foo Manual", the idea being to refer to the whole manual. +-% ++% + % But, this being TeX, we can't easily compare our node name against the + % string "Top" while ignoring the possible spaces before and after in + % the input. By adding the arbitrary 7sp below, we make it much less + % likely that a real node name would have the same width as "Top" (e.g., + % in a monospaced font). Hopefully it will never happen in practice. +-% ++% + % For the same basic reason, we retypeset the "Top" at every + % reference, since the current font is indeterminate. +-% ++% + \def\crossmanualxref#1{% + \setbox\toprefbox = \hbox{Top\kern7sp}% + \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% +@@ -9125,13 +9187,13 @@ + \fi\fi\fi + } + +-% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX ++% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME. SUFFIX + % is output afterwards if non-empty. + \def\refx#1#2{% + \requireauxfile + {% + \indexnofonts +- \otherbackslash ++ \turnoffactive + \def\value##1{##1}% + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname +@@ -9157,9 +9219,9 @@ + #2% Output the suffix in any case. + } + +-% This is the macro invoked by entries in the aux file. Define a control +-% sequence for a cross-reference target (we prepend XR to the control sequence +-% name to avoid collisions). The value is the page number. If this is a float ++% This is the macro invoked by entries in the aux file. Define a control ++% sequence for a cross-reference target (we prepend XR to the control sequence ++% name to avoid collisions). The value is the page number. If this is a float + % type, we have more work to do. + % + \def\xrdef#1#2{% +@@ -9175,10 +9237,10 @@ + \bgroup + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% + \egroup +- % We put the \gdef inside a group to avoid the definitions building up on +- % TeX's save stack, which can cause it to run out of space for aux files with ++ % We put the \gdef inside a group to avoid the definitions building up on ++ % TeX's save stack, which can cause it to run out of space for aux files with + % thousands of lines. \gdef doesn't use the save stack, but \csname does +- % when it defines an unknown control sequence as \relax. ++ % when it defines an unknown control sequence as \relax. + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname +@@ -9257,19 +9319,6 @@ + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other +- % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. +- % in xref tags, i.e., node names. But since ^^e4 notation isn't +- % supported in the main text, it doesn't seem desirable. Furthermore, +- % that is not enough: for node names that actually contain a ^ +- % character, we would end up writing a line like this: 'xrdef {'hat +- % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first +- % argument, and \hat is not an expandable control sequence. It could +- % all be worked out, but why? Either we support ^^ or we don't. +- % +- % The other change necessary for this was to define \auxhat: +- % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter +- % and then to call \auxhat in \setq. +- % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... +@@ -9287,14 +9336,7 @@ + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % +- % This is to support \ in node names and titles, since the \ +- % characters end up in a \csname. It's easier than +- % leaving it active and making its active definition an actual \ +- % character. What I don't understand is why it works in the *value* +- % of the xrdef. Seems like it should be a catcode12 \, and that +- % should not typeset properly. But it works, so I'm moving on for +- % now. --karl, 15jan04. +- \catcode`\\=\other ++ \catcode`\\=\active + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 +@@ -9557,7 +9599,7 @@ + % + \ifimagevmode + \medskip % space after a standalone image +- \fi ++ \fi + \ifx\centersub\centerV \egroup \fi + \endgroup} + +@@ -9625,13 +9667,13 @@ + \global\advance\floatno by 1 + % + {% +- % This magic value for \lastsection is output by \setref as the ++ % This magic value for \currentsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % +- \edef\lastsection{\floatmagic=\safefloattype}% ++ \edef\currentsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi +@@ -9754,7 +9796,7 @@ + + % #1 is the control sequence we are passed; we expand into a conditional + % which is true if #1 represents a float ref. That is, the magic +-% \lastsection value which we \setref above. ++% \currentsection value which we \setref above. + % + \def\iffloat#1{\expandafter\doiffloat#1==\finish} + % +@@ -10388,7 +10430,7 @@ + \uppercase{.} + \endgroup + \else +- \errhelp = \EMsimple ++ \errhelp = \EMsimple + \errmessage{Unicode character U+#1 not supported, sorry}% + \fi + \else +@@ -10421,7 +10463,7 @@ + \countUTFz = "#1\relax + \begingroup + \parseXMLCharref +- ++ + % Give \u8:... its definition. The sequence of seven \expandafter's + % expands after the \gdef three times, e.g. + % +@@ -10433,7 +10475,7 @@ + \expandafter\expandafter + \expandafter\expandafter + \expandafter\gdef \UTFviiiTmp{#2}% +- % ++ % + \expandafter\ifx\csname uni:#1\endcsname \relax \else + \message{Internal error, already defined: #1}% + \fi +@@ -10472,7 +10514,7 @@ + \divide\countUTFz by 64 + \countUTFy = \countUTFz % Save to be the future value of \countUTFz. + \multiply\countUTFz by 64 +- ++ + % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract + % in order to get the last five bits. + \advance\countUTFx by -\countUTFz +@@ -10507,7 +10549,7 @@ + % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block) + % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A + % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B +-% ++% + % Many of our renditions are less than wonderful, and all the missing + % characters are available somewhere. Loading the necessary fonts + % awaits user request. We can't truly support Unicode without +@@ -10808,6 +10850,8 @@ + \DeclareUnicodeCharacter{0233}{\=y}% + \DeclareUnicodeCharacter{0237}{\dotless{j}}% + % ++ \DeclareUnicodeCharacter{02BC}{'}% ++ % + \DeclareUnicodeCharacter{02DB}{\ogonek{ }}% + % + % Greek letters upper case +@@ -11242,21 +11286,14 @@ + \relax + } + +-% define all Unicode characters we know about, for the sake of @U. ++% Define all Unicode characters we know about. This makes UTF-8 the default ++% input encoding and allows @U to work. + \iftxinativeunicodecapable + \nativeunicodechardefsatu + \else + \utfeightchardefs + \fi + +- +-% Make non-ASCII characters printable again for compatibility with +-% existing Texinfo documents that may use them, even without declaring a +-% document encoding. +-% +-\setnonasciicharscatcode \other +- +- + \message{formatting,} + + \newdimen\defaultparindent \defaultparindent = 15pt +@@ -11449,6 +11486,18 @@ + \globaldefs = 0 + }} + ++\def\bsixpaper{{\globaldefs = 1 ++ \afourpaper ++ \internalpagesizes{140mm}{100mm}% ++ {-6.35mm}{-12.7mm}% ++ {\bindingoffset}{14pt}% ++ {176mm}{125mm}% ++ \let\SETdispenvsize=\smallword ++ \lispnarrowing = 0.2in ++ \globaldefs = 0 ++}} ++ ++ + % @pagesizes TEXTHEIGHT[,TEXTWIDTH] + % Perhaps we should allow setting the margins, \topskip, \parskip, + % and/or leading, also. Or perhaps we should compute them somehow. +@@ -11462,12 +11511,12 @@ + \setleading{\textleading}% + % + \dimen0 = #1\relax +- \advance\dimen0 by \voffset +- \advance\dimen0 by 1in % reference point for DVI is 1 inch from top of page ++ \advance\dimen0 by 2.5in % default 1in margin above heading line ++ % and 1.5in to include heading, footing and ++ % bottom margin + % + \dimen2 = \hsize +- \advance\dimen2 by \normaloffset +- \advance\dimen2 by 1in % reference point is 1 inch from left edge of page ++ \advance\dimen2 by 2in % default to 1 inch margin on each side + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% +@@ -11552,9 +11601,9 @@ + \def\texinfochars{% + \let< = \activeless + \let> = \activegtr +- \let~ = \activetilde ++ \let~ = \activetilde + \let^ = \activehat +- \markupsetuplqdefault \markupsetuprqdefault ++ \markupsetuplqdefault \markupsetuprqdefault + \let\b = \strong + \let\i = \smartitalic + % in principle, all other definitions in \tex have to be undone too. +@@ -11572,11 +11621,9 @@ + % \backslashcurfont outputs one backslash character in current font, + % as in \char`\\. + \global\chardef\backslashcurfont=`\\ +-\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +-% \realbackslash is an actual character `\' with catcode other, and +-% \doublebackslash is two of them (for the pdf outlines). +-{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} ++% \realbackslash is an actual character `\' with catcode other. ++{\catcode`\\=\other @gdef@realbackslash{\}} + + % In Texinfo, backslash is an active character; it prints the backslash + % in fixed width font. +@@ -11594,10 +11641,8 @@ + @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} + @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents. + +-% \rawbackslash defines an active \ to do \backslashcurfont. + % \otherbackslash defines an active \ to be a literal `\' character with +-% catcode other. We switch back and forth between these. +-@gdef@rawbackslash{@let\=@backslashcurfont} ++% catcode other. + @gdef@otherbackslash{@let\=@realbackslash} + + % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +@@ -11669,7 +11714,7 @@ + @ifx\@eatinput @let\ = @ttbackslash @fi + @catcode13=5 % regular end of line + @enableemergencynewline +- @let@c=@texinfoc ++ @let@c=@comment + @let@parsearg@originalparsearg + % Also turn back on active characters that might appear in the input + % file name, in case not using a pre-dumped format. +@@ -11715,7 +11760,7 @@ + @markupsetuprqdefault + + @c Local variables: +-@c eval: (add-hook 'write-file-hooks 'time-stamp) ++@c eval: (add-hook 'before-save-hook 'time-stamp) + @c page-delimiter: "^\\\\message\\|emacs-page" + @c time-stamp-start: "def\\\\texinfoversion{" + @c time-stamp-format: "%:y-%02m-%02d.%02H" +diff -ur libffi-3.3/fficonfig.h.in libffi-3.3.new/fficonfig.h.in +--- libffi-3.3/fficonfig.h.in 2019-11-01 03:30:04.000000000 -0600 ++++ libffi-3.3.new/fficonfig.h.in 2021-01-04 19:48:48.000000000 -0700 +@@ -32,6 +32,10 @@ + /* Define this if you do not want support for aggregate types. */ + #undef FFI_NO_STRUCTS + ++/* Creating a separate libffi-trampolines.dylib and remapping the entire dylib ++ */ ++#undef FFI_TRAMPOLINE_WHOLE_DYLIB ++ + /* Define to 1 if you have `alloca', as a function or macro. */ + #undef HAVE_ALLOCA + +@@ -94,6 +98,9 @@ + /* Define if read-only mmap of a plain file works. */ + #undef HAVE_MMAP_FILE + ++/* Define if your compiler supports pointer authentication. */ ++#undef HAVE_PTRAUTH ++ + /* Define if .eh_frame sections should be read-only. */ + #undef HAVE_RO_EH_FRAME + +diff -ur libffi-3.3/include/Makefile.in libffi-3.3.new/include/Makefile.in +--- libffi-3.3/include/Makefile.in 2019-11-23 06:59:04.000000000 -0700 ++++ libffi-3.3.new/include/Makefile.in 2021-01-04 19:48:49.000000000 -0700 +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.16.1 from Makefile.am. ++# Makefile.in generated by automake 1.16.3 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2018 Free Software Foundation, Inc. ++# Copyright (C) 1994-2020 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +diff -ur libffi-3.3/include/ffi.h.in libffi-3.3.new/include/ffi.h.in +--- libffi-3.3/include/ffi.h.in 2019-11-13 05:57:22.000000000 -0700 ++++ libffi-3.3.new/include/ffi.h.in 2021-01-04 19:39:16.000000000 -0700 +@@ -349,6 +349,11 @@ + void *user_data, + void*codeloc); + ++#if defined(__x86_64__) || defined(__arm64__) ++FFI_API ffi_closure * ++ffi_find_closure_for_code(void *code); ++#endif ++ + #ifdef __sgi + # pragma pack 8 + #endif +diff -ur libffi-3.3/install-sh libffi-3.3.new/install-sh +--- libffi-3.3/install-sh 2019-11-01 03:30:05.000000000 -0600 ++++ libffi-3.3.new/install-sh 2021-01-04 19:48:49.000000000 -0700 +@@ -1,7 +1,7 @@ + #!/bin/sh + # install - install a program, script, or datafile + +-scriptversion=2018-03-11.20; # UTC ++scriptversion=2020-11-14.01; # UTC + + # This originates from X11R5 (mit/util/scripts/install.sh), which was + # later released in X11R6 (xc/config/util/install.sh) with the +@@ -69,6 +69,11 @@ + # Desired mode of installed file. + mode=0755 + ++# Create dirs (including intermediate dirs) using mode 755. ++# This is like GNU 'install' as of coreutils 8.32 (2020). ++mkdir_umask=22 ++ ++backupsuffix= + chgrpcmd= + chmodcmd=$chmodprog + chowncmd= +@@ -99,18 +104,28 @@ + --version display version info and exit. + + -c (ignored) +- -C install only if different (preserve the last data modification time) ++ -C install only if different (preserve data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. ++ -p pass -p to $cpprog. + -s $stripprog installed files. ++ -S SUFFIX attempt to back up existing files, with suffix SUFFIX. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + + Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG ++ ++By default, rm is invoked with -f; when overridden with RMPROG, ++it's up to you to specify -f if you want it. ++ ++If -S is not specified, no backups are attempted. ++ ++Email bug reports to bug-automake@gnu.org. ++Automake home page: https://www.gnu.org/software/automake/ + " + + while test $# -ne 0; do +@@ -137,8 +152,13 @@ + -o) chowncmd="$chownprog $2" + shift;; + ++ -p) cpprog="$cpprog -p";; ++ + -s) stripcmd=$stripprog;; + ++ -S) backupsuffix="$2" ++ shift;; ++ + -t) + is_target_a_directory=always + dst_arg=$2 +@@ -255,6 +275,10 @@ + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? ++ # Don't chown directories that already exist. ++ if test $dstdir_status = 0; then ++ chowncmd="" ++ fi + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command +@@ -301,22 +325,6 @@ + if test $dstdir_status != 0; then + case $posix_mkdir in + '') +- # Create intermediate dirs using mode 755 as modified by the umask. +- # This is like FreeBSD 'install' as of 1997-10-28. +- umask=`umask` +- case $stripcmd.$umask in +- # Optimize common cases. +- *[2367][2367]) mkdir_umask=$umask;; +- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; +- +- *[0-7]) +- mkdir_umask=`expr $umask + 22 \ +- - $umask % 100 % 40 + $umask % 20 \ +- - $umask % 10 % 4 + $umask % 2 +- `;; +- *) mkdir_umask=$umask,go-w;; +- esac +- + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then +@@ -326,52 +334,49 @@ + fi + + posix_mkdir=false +- case $umask in +- *[123567][0-7][0-7]) +- # POSIX mkdir -p sets u+wx bits regardless of umask, which +- # is incompatible with FreeBSD 'install' when (umask & 300) != 0. +- ;; +- *) +- # Note that $RANDOM variable is not portable (e.g. dash); Use it +- # here however when possible just to lower collision chance. +- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ +- +- trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 +- +- # Because "mkdir -p" follows existing symlinks and we likely work +- # directly in world-writeable /tmp, make sure that the '$tmpdir' +- # directory is successfully created first before we actually test +- # 'mkdir -p' feature. +- if (umask $mkdir_umask && +- $mkdirprog $mkdir_mode "$tmpdir" && +- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 +- then +- if test -z "$dir_arg" || { +- # Check for POSIX incompatibilities with -m. +- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or +- # other-writable bit of parent directory when it shouldn't. +- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. +- test_tmpdir="$tmpdir/a" +- ls_ld_tmpdir=`ls -ld "$test_tmpdir"` +- case $ls_ld_tmpdir in +- d????-?r-*) different_mode=700;; +- d????-?--*) different_mode=755;; +- *) false;; +- esac && +- $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { +- ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` +- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" +- } +- } +- then posix_mkdir=: +- fi +- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" +- else +- # Remove any dirs left behind by ancient mkdir implementations. +- rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null +- fi +- trap '' 0;; +- esac;; ++ # The $RANDOM variable is not portable (e.g., dash). Use it ++ # here however when possible just to lower collision chance. ++ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ ++ ++ trap ' ++ ret=$? ++ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null ++ exit $ret ++ ' 0 ++ ++ # Because "mkdir -p" follows existing symlinks and we likely work ++ # directly in world-writeable /tmp, make sure that the '$tmpdir' ++ # directory is successfully created first before we actually test ++ # 'mkdir -p'. ++ if (umask $mkdir_umask && ++ $mkdirprog $mkdir_mode "$tmpdir" && ++ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 ++ then ++ if test -z "$dir_arg" || { ++ # Check for POSIX incompatibilities with -m. ++ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or ++ # other-writable bit of parent directory when it shouldn't. ++ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ++ test_tmpdir="$tmpdir/a" ++ ls_ld_tmpdir=`ls -ld "$test_tmpdir"` ++ case $ls_ld_tmpdir in ++ d????-?r-*) different_mode=700;; ++ d????-?--*) different_mode=755;; ++ *) false;; ++ esac && ++ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ++ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` ++ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" ++ } ++ } ++ then posix_mkdir=: ++ fi ++ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" ++ else ++ # Remove any dirs left behind by ancient mkdir implementations. ++ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null ++ fi ++ trap '' 0;; + esac + + if +@@ -382,7 +387,7 @@ + then : + else + +- # The umask is ridiculous, or mkdir does not conform to POSIX, ++ # mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + +@@ -411,7 +416,7 @@ + prefixes= + else + if $posix_mkdir; then +- (umask=$mkdir_umask && ++ (umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 +@@ -451,7 +456,18 @@ + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. +- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && ++ (umask $cp_umask && ++ { test -z "$stripcmd" || { ++ # Create $dsttmp read-write so that cp doesn't create it read-only, ++ # which would cause strip to fail. ++ if test -z "$doit"; then ++ : >"$dsttmp" # No need to fork-exec 'touch'. ++ else ++ $doit touch "$dsttmp" ++ fi ++ } ++ } && ++ $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # +@@ -477,6 +493,13 @@ + then + rm -f "$dsttmp" + else ++ # If $backupsuffix is set, and the file being installed ++ # already exists, attempt a backup. Don't worry if it fails, ++ # e.g., if mv doesn't support -f. ++ if test -n "$backupsuffix" && test -f "$dst"; then ++ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null ++ fi ++ + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + +@@ -491,9 +514,9 @@ + # file should still install successfully. + { + test ! -f "$dst" || +- $doit $rmcmd -f "$dst" 2>/dev/null || ++ $doit $rmcmd "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && +- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } ++ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 +diff -ur libffi-3.3/ltmain.sh libffi-3.3.new/ltmain.sh +--- libffi-3.3/ltmain.sh 2019-11-01 03:30:00.000000000 -0600 ++++ libffi-3.3.new/ltmain.sh 2021-01-04 19:48:46.000000000 -0700 +@@ -2124,7 +2124,7 @@ + # a configuration failure hint, and exit. + func_fatal_configuration () + { +- func_fatal_error ${1+"$@"} \ ++ func__fatal_error ${1+"$@"} \ + "See the $PACKAGE documentation for more information." \ + "Fatal configuration error." + } +@@ -7272,12 +7272,10 @@ + # -tp=* Portland pgcc target processor selection + # --sysroot=* for sysroot support + # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization +- # -specs=* GCC specs files + # -stdlib=* select c++ std lib with clang + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ +- -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ +- -specs=*) ++ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) + func_quote_for_eval "$arg" + arg=$func_quote_for_eval_result + func_append compile_command " $arg" +diff -ur libffi-3.3/m4/libtool.m4 libffi-3.3.new/m4/libtool.m4 +--- libffi-3.3/m4/libtool.m4 2019-11-01 03:30:00.000000000 -0600 ++++ libffi-3.3.new/m4/libtool.m4 2021-01-04 19:48:46.000000000 -0700 +@@ -1067,16 +1067,11 @@ + _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- darwin*) # darwin 5.x on +- # if running on 10.5 or later, the deployment target defaults +- # to the OS version, if on x86, and 10.4, the deployment +- # target defaults to 10.4. Don't you love it? +- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in +- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) +- _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; +- 10.[[012]][[,.]]*) ++ darwin*) ++ case ${MACOSX_DEPLOYMENT_TARGET},$host in ++ 10.[[012]],*|,*powerpc*) + _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; +- 10.*) ++ *) + _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; + esac + ;; +@@ -2867,9 +2862,6 @@ + # before this can be enabled. + hardcode_into_libs=yes + +- # Add ABI-specific directories to the system library path. +- sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" +- + # Ideally, we could use ldconfig to report *all* directores which are + # searched for libraries, however this is still not possible. Aside from not + # being certain /sbin/ldconfig is available, command +@@ -2878,7 +2870,7 @@ + # appending ld.so.conf contents (and includes) to the search path. + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` +- sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" ++ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on +diff -ur libffi-3.3/man/Makefile.in libffi-3.3.new/man/Makefile.in +--- libffi-3.3/man/Makefile.in 2019-11-23 06:59:04.000000000 -0700 ++++ libffi-3.3.new/man/Makefile.in 2021-01-04 19:48:49.000000000 -0700 +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.16.1 from Makefile.am. ++# Makefile.in generated by automake 1.16.3 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2018 Free Software Foundation, Inc. ++# Copyright (C) 1994-2020 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +diff -ur libffi-3.3/missing libffi-3.3.new/missing +--- libffi-3.3/missing 2019-11-01 03:30:05.000000000 -0600 ++++ libffi-3.3.new/missing 2021-01-04 19:48:49.000000000 -0700 +@@ -3,7 +3,7 @@ + + scriptversion=2018-03-07.03; # UTC + +-# Copyright (C) 1996-2018 Free Software Foundation, Inc. ++# Copyright (C) 1996-2020 Free Software Foundation, Inc. + # Originally written by Fran,cois Pinard , 1996. + + # This program is free software; you can redistribute it and/or modify +diff -ur libffi-3.3/src/aarch64/ffi.c libffi-3.3.new/src/aarch64/ffi.c +--- libffi-3.3/src/aarch64/ffi.c 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/aarch64/ffi.c 2021-01-04 19:40:32.000000000 -0700 +@@ -62,6 +62,9 @@ + #if FFI_EXEC_TRAMPOLINE_TABLE + + #ifdef __MACH__ ++#ifdef HAVE_PTRAUTH ++#include ++#endif + #include + #endif + +@@ -599,11 +602,12 @@ + else if (flags & AARCH64_RET_NEED_COPY) + rsize = 16; + +- /* Allocate consectutive stack for everything we'll need. */ +- context = alloca (sizeof(struct call_context) + stack_bytes + 32 + rsize); ++ /* Allocate consectutive stack for everything we'll need. ++ The frame uses 40 bytes for: lr, fp, rvalue, flags, sp */ ++ context = alloca (sizeof(struct call_context) + stack_bytes + 40 + rsize); + stack = context + 1; + frame = (void*)((uintptr_t)stack + (uintptr_t)stack_bytes); +- rvalue = (rsize ? (void*)((uintptr_t)frame + 32) : orig_rvalue); ++ rvalue = (rsize ? (void*)((uintptr_t)frame + 40) : orig_rvalue); + + arg_init (&state); + for (i = 0, nargs = cif->nargs; i < nargs; i++) +@@ -643,12 +647,13 @@ + state.ngrn = N_X_ARG_REG; + /* Note that the default abi extends each argument + to a full 64-bit slot, while the iOS abi allocates +- only enough space. */ ++ only enough space, except for variadic arguments. */ + #ifdef __APPLE__ +- memcpy(d, a, s); +-#else +- *(ffi_arg *)d = ext; ++ if (!state.allocating_variadic) ++ memcpy(d, a, s); ++ else + #endif ++ *(ffi_arg *)d = ext; + } + } + break; +@@ -756,6 +761,8 @@ + ffi_call_int (cif, fn, rvalue, avalue, NULL); + } + ++#if FFI_CLOSURES ++ + #ifdef FFI_GO_CLOSURES + void + ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, +@@ -789,7 +796,14 @@ + + #if FFI_EXEC_TRAMPOLINE_TABLE + #ifdef __MACH__ ++#ifdef HAVE_PTRAUTH ++ codeloc = ptrauth_auth_data(codeloc, ptrauth_key_function_pointer, 0); ++#endif ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++ void **config = (void **)((uint8_t *)codeloc - 2*PAGE_MAX_SIZE); ++#else + void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); ++#endif + config[0] = closure; + config[1] = start; + #endif +@@ -825,6 +839,22 @@ + return FFI_OK; + } + ++ffi_closure * ++ffi_find_closure_for_code(void *codeloc) ++{ ++#if FFI_EXEC_TRAMPOLINE_TABLE ++# ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++ void **config = (void **)((uint8_t *)codeloc - 2*PAGE_MAX_SIZE); ++# else ++ void **config = (void **)((uint8_t *)codeloc - PAGE_MAX_SIZE); ++# endif ++ return config[0]; ++#else ++ return (ffi_closure*)codeloc; ++#endif ++} ++ ++ + #ifdef FFI_GO_CLOSURES + extern void ffi_go_closure_SYSV (void) FFI_HIDDEN; + extern void ffi_go_closure_SYSV_V (void) FFI_HIDDEN; +@@ -1006,4 +1036,6 @@ + return flags; + } + ++#endif /* FFI_CLOSURES */ ++ + #endif /* (__aarch64__) || defined(__arm64__)|| defined (_M_ARM64)*/ +diff -ur libffi-3.3/src/aarch64/internal.h libffi-3.3.new/src/aarch64/internal.h +--- libffi-3.3/src/aarch64/internal.h 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/aarch64/internal.h 2021-01-04 19:39:16.000000000 -0700 +@@ -65,3 +65,24 @@ + #define N_X_ARG_REG 8 + #define N_V_ARG_REG 8 + #define CALL_CONTEXT_SIZE (N_V_ARG_REG * 16 + N_X_ARG_REG * 8) ++ ++/* Helpers for writing assembly compatible with arm ptr auth */ ++#ifdef LIBFFI_ASM ++ ++#ifdef HAVE_PTRAUTH ++#define SIGN_LR pacibsp ++#define SIGN_LR_WITH_REG(x) pacib lr, x ++#define AUTH_LR_AND_RET retab ++#define AUTH_LR_WITH_REG(x) autib lr, x ++#define BRANCH_AND_LINK_TO_REG blraaz ++#define BRANCH_TO_REG braaz ++#else ++#define SIGN_LR ++#define SIGN_LR_WITH_REG(x) ++#define AUTH_LR_AND_RET ret ++#define AUTH_LR_WITH_REG(x) ++#define BRANCH_AND_LINK_TO_REG blr ++#define BRANCH_TO_REG br ++#endif ++ ++#endif +diff -ur libffi-3.3/src/aarch64/sysv.S libffi-3.3.new/src/aarch64/sysv.S +--- libffi-3.3/src/aarch64/sysv.S 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/aarch64/sysv.S 2021-01-04 19:40:21.000000000 -0700 +@@ -78,9 +78,22 @@ + + cfi_startproc + CNAME(ffi_call_SYSV): ++ /* Sign the lr with x1 since that is where it will be stored */ ++ SIGN_LR_WITH_REG(x1) ++ + /* Use a stack frame allocated by our caller. */ +- cfi_def_cfa(x1, 32); ++#if defined(HAVE_PTRAUTH) && defined(__APPLE__) ++ /* darwin's libunwind assumes that the cfa is the sp and that's the data ++ * used to sign the lr. In order to allow unwinding through this ++ * function it is necessary to point the cfa at the signing register. ++ */ ++ cfi_def_cfa(x1, 0); ++#else ++ cfi_def_cfa(x1, 40); ++#endif + stp x29, x30, [x1] ++ mov x9, sp ++ str x9, [x1, #32] + mov x29, x1 + mov sp, x0 + cfi_def_cfa_register(x29) +@@ -111,13 +124,15 @@ + /* Deallocate the context, leaving the stacked arguments. */ + add sp, sp, #CALL_CONTEXT_SIZE + +- blr x9 /* call fn */ ++ BRANCH_AND_LINK_TO_REG x9 /* call fn */ + + ldp x3, x4, [x29, #16] /* reload rvalue and flags */ + + /* Partially deconstruct the stack frame. */ +- mov sp, x29 ++ ldr x9, [x29, #32] ++ mov sp, x9 + cfi_def_cfa_register (sp) ++ mov x2, x29 /* Preserve for auth */ + ldp x29, x30, [x29] + + /* Save the return value as directed. */ +@@ -131,71 +146,76 @@ + and therefore we want to extend to 64 bits; these types + have two consecutive entries allocated for them. */ + .align 4 +-0: ret /* VOID */ ++0: b 99f /* VOID */ + nop + 1: str x0, [x3] /* INT64 */ +- ret ++ b 99f + 2: stp x0, x1, [x3] /* INT128 */ +- ret ++ b 99f + 3: brk #1000 /* UNUSED */ +- ret ++ b 99f + 4: brk #1000 /* UNUSED */ +- ret ++ b 99f + 5: brk #1000 /* UNUSED */ +- ret ++ b 99f + 6: brk #1000 /* UNUSED */ +- ret ++ b 99f + 7: brk #1000 /* UNUSED */ +- ret ++ b 99f + 8: st4 { v0.s, v1.s, v2.s, v3.s }[0], [x3] /* S4 */ +- ret ++ b 99f + 9: st3 { v0.s, v1.s, v2.s }[0], [x3] /* S3 */ +- ret ++ b 99f + 10: stp s0, s1, [x3] /* S2 */ +- ret ++ b 99f + 11: str s0, [x3] /* S1 */ +- ret ++ b 99f + 12: st4 { v0.d, v1.d, v2.d, v3.d }[0], [x3] /* D4 */ +- ret ++ b 99f + 13: st3 { v0.d, v1.d, v2.d }[0], [x3] /* D3 */ +- ret ++ b 99f + 14: stp d0, d1, [x3] /* D2 */ +- ret ++ b 99f + 15: str d0, [x3] /* D1 */ +- ret ++ b 99f + 16: str q3, [x3, #48] /* Q4 */ + nop + 17: str q2, [x3, #32] /* Q3 */ + nop + 18: stp q0, q1, [x3] /* Q2 */ +- ret ++ b 99f + 19: str q0, [x3] /* Q1 */ +- ret ++ b 99f + 20: uxtb w0, w0 /* UINT8 */ + str x0, [x3] +-21: ret /* reserved */ ++21: b 99f /* reserved */ + nop + 22: uxth w0, w0 /* UINT16 */ + str x0, [x3] +-23: ret /* reserved */ ++23: b 99f /* reserved */ + nop + 24: mov w0, w0 /* UINT32 */ + str x0, [x3] +-25: ret /* reserved */ ++25: b 99f /* reserved */ + nop + 26: sxtb x0, w0 /* SINT8 */ + str x0, [x3] +-27: ret /* reserved */ ++27: b 99f /* reserved */ + nop + 28: sxth x0, w0 /* SINT16 */ + str x0, [x3] +-29: ret /* reserved */ ++29: b 99f /* reserved */ + nop + 30: sxtw x0, w0 /* SINT32 */ + str x0, [x3] +-31: ret /* reserved */ ++31: b 99f /* reserved */ + nop + ++ /* Return now that result has been populated. */ ++99: ++ AUTH_LR_WITH_REG(x2) ++ ret ++ + cfi_endproc + + .globl CNAME(ffi_call_SYSV) +@@ -205,6 +225,8 @@ + .size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV) + #endif + ++#if FFI_CLOSURES ++ + /* ffi_closure_SYSV + + Closure invocation glue. This is the low level code invoked directly by +@@ -224,6 +246,7 @@ + .align 4 + CNAME(ffi_closure_SYSV_V): + cfi_startproc ++ SIGN_LR + stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! + cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + cfi_rel_offset (x29, 0) +@@ -247,6 +270,7 @@ + .align 4 + cfi_startproc + CNAME(ffi_closure_SYSV): ++ SIGN_LR + stp x29, x30, [sp, #-ffi_closure_SYSV_FS]! + cfi_adjust_cfa_offset (ffi_closure_SYSV_FS) + cfi_rel_offset (x29, 0) +@@ -263,7 +287,9 @@ + /* Load ffi_closure_inner arguments. */ + ldp PTR_REG(0), PTR_REG(1), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET] /* load cif, fn */ + ldr PTR_REG(2), [x17, #FFI_TRAMPOLINE_CLOSURE_OFFSET+PTR_SIZE*2] /* load user_data */ ++#ifdef FFI_GO_CLOSURES + .Ldo_closure: ++#endif + add x3, sp, #16 /* load context */ + add x4, sp, #ffi_closure_SYSV_FS /* load stack */ + add x5, sp, #16+CALL_CONTEXT_SIZE /* load rvalue */ +@@ -346,7 +372,7 @@ + cfi_adjust_cfa_offset (-ffi_closure_SYSV_FS) + cfi_restore (x29) + cfi_restore (x30) +- ret ++ AUTH_LR_AND_RET + cfi_endproc + + .globl CNAME(ffi_closure_SYSV) +@@ -432,6 +458,7 @@ + .size CNAME(ffi_go_closure_SYSV), . - CNAME(ffi_go_closure_SYSV) + #endif + #endif /* FFI_GO_CLOSURES */ ++#endif /* FFI_CLOSURES */ + #endif /* __arm64__ */ + + #if defined __ELF__ && defined __linux__ +Only in libffi-3.3.new/src/aarch64: trampoline.S +diff -ur libffi-3.3/src/arm/ffi.c libffi-3.3.new/src/arm/ffi.c +--- libffi-3.3/src/arm/ffi.c 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/arm/ffi.c 2021-01-04 19:39:16.000000000 -0700 +@@ -421,12 +421,14 @@ + ffi_call_int (cif, fn, rvalue, avalue, NULL); + } + ++#ifdef FFI_GO_CLOSURES + void + ffi_call_go (ffi_cif *cif, void (*fn) (void), void *rvalue, + void **avalue, void *closure) + { + ffi_call_int (cif, fn, rvalue, avalue, closure); + } ++#endif + + static void * + ffi_prep_incoming_args_SYSV (ffi_cif *cif, void *rvalue, +@@ -529,6 +531,8 @@ + return rvalue; + } + ++#if FFI_CLOSURES ++ + struct closure_frame + { + char vfp_space[8*8] __attribute__((aligned(8))); +@@ -564,8 +568,11 @@ + + void ffi_closure_SYSV (void) FFI_HIDDEN; + void ffi_closure_VFP (void) FFI_HIDDEN; ++ ++#ifdef FFI_GO_CLOSURES + void ffi_go_closure_SYSV (void) FFI_HIDDEN; + void ffi_go_closure_VFP (void) FFI_HIDDEN; ++#endif + + /* the cif must already be prep'ed */ + +@@ -622,6 +629,7 @@ + return FFI_OK; + } + ++#ifdef FFI_GO_CLOSURES + ffi_status + ffi_prep_go_closure (ffi_go_closure *closure, ffi_cif *cif, + void (*fun) (ffi_cif *, void *, void **, void *)) +@@ -643,6 +651,9 @@ + + return FFI_OK; + } ++#endif ++ ++#endif /* FFI_CLOSURES */ + + /* Below are routines for VFP hard-float support. */ + +diff -ur libffi-3.3/src/arm/sysv.S libffi-3.3.new/src/arm/sysv.S +--- libffi-3.3/src/arm/sysv.S 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/arm/sysv.S 2021-01-04 19:39:16.000000000 -0700 +@@ -208,6 +208,7 @@ + UNWIND(.fnend) + ARM_FUNC_END(ffi_call_SYSV) + ++#if FFI_CLOSURES + + /* + int ffi_closure_inner_* (cif, fun, user_data, frame) +@@ -354,6 +355,8 @@ + cfi_endproc + ARM_FUNC_END(ffi_closure_ret) + ++#endif /* FFI_CLOSURES */ ++ + #if FFI_EXEC_TRAMPOLINE_TABLE + + #ifdef __MACH__ +diff -ur libffi-3.3/src/closures.c libffi-3.3.new/src/closures.c +--- libffi-3.3/src/closures.c 2019-11-20 04:15:41.000000000 -0700 ++++ libffi-3.3.new/src/closures.c 2021-01-04 19:39:16.000000000 -0700 +@@ -148,10 +148,19 @@ + + #include + #include ++#ifdef HAVE_PTRAUTH ++#include ++#endif + #include + #include + ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++#include ++#include ++#include ++#else + extern void *ffi_closure_trampoline_table_page; ++#endif + + typedef struct ffi_trampoline_table ffi_trampoline_table; + typedef struct ffi_trampoline_table_entry ffi_trampoline_table_entry; +@@ -160,7 +169,6 @@ + { + /* contiguous writable and executable pages */ + vm_address_t config_page; +- vm_address_t trampoline_page; + + /* free list tracking */ + uint16_t free_count; +@@ -180,6 +188,21 @@ struct ffi_trampoline_table_entry + /* Total number of trampolines that fit in one trampoline table */ + #define FFI_TRAMPOLINE_COUNT (PAGE_MAX_SIZE / FFI_TRAMPOLINE_SIZE) + ++/* The trampoline dylib has one page for the MACHO_HEADER and one page for the ++ * trampolines. iOS 12.0 and later, and macOS on Apple Silicon require that ++ * the entire dylib needs to be remapped as a unit. ++ * ++ * arm (legacy): Allocate two pages -- a config page and a placeholder for the trampolines ++ * arm64 (modern): Allocate three pages -- a config page and two placeholders for the trampoline dylib ++ */ ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++#define FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT 3 ++#define FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET PAGE_MAX_SIZE ++#else ++#define FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT 2 ++#define FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET 0 ++#endif ++ + static pthread_mutex_t ffi_trampoline_lock = PTHREAD_MUTEX_INITIALIZER; + static ffi_trampoline_table *ffi_trampoline_tables = NULL; + +@@ -195,34 +218,67 @@ + kern_return_t kt; + uint16_t i; + +- /* Allocate two pages -- a config page and a placeholder page */ + config_page = 0x0; +- kt = vm_allocate (mach_task_self (), &config_page, PAGE_MAX_SIZE * 2, ++ /* The entire allocation is: ++ * config_page ++ * trampoline_segment ++ * ++ * trampoline_segment is: ++ * trampoline dylib mach-o header (if FFI_TRAMPOLINE_WHOLE_DYLIB) ++ * trampoline page ++ */ ++ kt = vm_allocate (mach_task_self (), &config_page, FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT * PAGE_MAX_SIZE, + VM_FLAGS_ANYWHERE); + if (kt != KERN_SUCCESS) + return NULL; + +- /* Remap the trampoline table on top of the placeholder page */ +- trampoline_page = config_page + PAGE_MAX_SIZE; +- trampoline_page_template = (vm_address_t)&ffi_closure_trampoline_table_page; ++ static void *trampoline_table_page; ++ ++#ifdef FFI_TRAMPOLINE_WHOLE_DYLIB ++ static dispatch_once_t trampoline_template_init_once; ++ ++ dispatch_once(&trampoline_template_init_once, ^{ ++ void * const trampoline_handle = dlopen("/usr/lib/libffi-trampolines.dylib", RTLD_NOW | RTLD_LOCAL | RTLD_FIRST); ++ assert(trampoline_handle); ++ ++ trampoline_table_page = dlsym(trampoline_handle, "ffi_closure_trampoline_table_page"); ++ assert(trampoline_table_page); ++ }); ++#else ++ trampoline_table_page = &ffi_closure_trampoline_table_page; ++#endif ++ ++#ifdef HAVE_PTRAUTH ++ trampoline_page_template = (uintptr_t)ptrauth_auth_data(trampoline_table_page, ptrauth_key_function_pointer, 0); ++#else ++ trampoline_page_template = (uintptr_t)trampoline_table_page; ++#endif ++ + #ifdef __arm__ + /* ffi_closure_trampoline_table_page can be thumb-biased on some ARM archs */ + trampoline_page_template &= ~1UL; + #endif +- kt = vm_remap (mach_task_self (), &trampoline_page, PAGE_MAX_SIZE, 0x0, +- VM_FLAGS_OVERWRITE, mach_task_self (), trampoline_page_template, ++ ++ vm_address_t trampoline_segment_template = trampoline_page_template - FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET; ++ vm_size_t trampoline_segment_size = (FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT - 1) * PAGE_MAX_SIZE; ++ ++ /* Remap the trampoline table on top of the placeholder page */ ++ vm_address_t trampoline_segment = config_page + PAGE_MAX_SIZE; ++ kt = vm_remap (mach_task_self(), &trampoline_segment, trampoline_segment_size, 0x0, ++ VM_FLAGS_FIXED | VM_FLAGS_OVERWRITE, mach_task_self(), trampoline_segment_template, + FALSE, &cur_prot, &max_prot, VM_INHERIT_SHARE); +- if (kt != KERN_SUCCESS) ++ if (kt != KERN_SUCCESS || !(cur_prot & VM_PROT_EXECUTE)) + { +- vm_deallocate (mach_task_self (), config_page, PAGE_MAX_SIZE * 2); ++ vm_deallocate (mach_task_self (), config_page, FFI_TRAMPOLINE_ALLOCATION_PAGE_COUNT * PAGE_MAX_SIZE); + return NULL; + } + ++ trampoline_page = trampoline_segment + FFI_TRAMPOLINE_PAGE_SEGMENT_OFFSET; ++ + /* We have valid trampoline and config pages */ + table = calloc (1, sizeof (ffi_trampoline_table)); + table->free_count = FFI_TRAMPOLINE_COUNT; + table->config_page = config_page; +- table->trampoline_page = trampoline_page; + + /* Create and initialize the free list */ + table->free_list_pool = +@@ -232,7 +278,10 @@ + { + ffi_trampoline_table_entry *entry = &table->free_list_pool[i]; + entry->trampoline = +- (void *) (table->trampoline_page + (i * FFI_TRAMPOLINE_SIZE)); ++ (void *) (trampoline_page + (i * FFI_TRAMPOLINE_SIZE)); ++#ifdef HAVE_PTRAUTH ++ entry->trampoline = ptrauth_sign_unauthenticated(entry->trampoline, ptrauth_key_function_pointer, 0); ++#endif + + if (i < table->free_count - 1) + entry->next = &table->free_list_pool[i + 1]; +diff -ur libffi-3.3/src/x86/ffi.c libffi-3.3.new/src/x86/ffi.c +--- libffi-3.3/src/x86/ffi.c 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/x86/ffi.c 2021-01-04 19:38:38.000000000 -0700 +@@ -397,12 +397,14 @@ + ffi_call_int (cif, fn, rvalue, avalue, NULL); + } + ++#ifdef FFI_GO_CLOSURES + void + ffi_call_go (ffi_cif *cif, void (*fn)(void), void *rvalue, + void **avalue, void *closure) + { + ffi_call_int (cif, fn, rvalue, avalue, closure); + } ++#endif + + /** private members **/ + +@@ -572,6 +574,8 @@ + return FFI_OK; + } + ++#ifdef FFI_GO_CLOSURES ++ + void FFI_HIDDEN ffi_go_closure_EAX(void); + void FFI_HIDDEN ffi_go_closure_ECX(void); + void FFI_HIDDEN ffi_go_closure_STDCALL(void); +@@ -608,6 +612,8 @@ + return FFI_OK; + } + ++#endif /* FFI_GO_CLOSURES */ ++ + /* ------- Native raw API support -------------------------------- */ + + #if !FFI_NO_RAW_API +diff -ur libffi-3.3/src/x86/ffi64.c libffi-3.3.new/src/x86/ffi64.c +--- libffi-3.3/src/x86/ffi64.c 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/x86/ffi64.c 2021-01-04 19:39:16.000000000 -0700 +@@ -688,6 +688,8 @@ + ffi_call_int (cif, fn, rvalue, avalue, NULL); + } + ++#ifdef FFI_GO_CLOSURES ++ + #ifndef __ILP32__ + extern void + ffi_call_go_efi64(ffi_cif *cif, void (*fn)(void), void *rvalue, +@@ -708,6 +710,7 @@ + ffi_call_int (cif, fn, rvalue, avalue, closure); + } + ++#endif /* FFI_GO_CLOSURES */ + + extern void ffi_closure_unix64(void) FFI_HIDDEN; + extern void ffi_closure_unix64_sse(void) FFI_HIDDEN; +@@ -761,6 +764,12 @@ + return FFI_OK; + } + ++ffi_closure * ++ffi_find_closure_for_code(void *code) ++{ ++ return (ffi_closure *) code; ++} ++ + int FFI_HIDDEN + ffi_closure_unix64_inner(ffi_cif *cif, + void (*fun)(ffi_cif*, void*, void**, void*), +@@ -854,6 +863,8 @@ + return flags; + } + ++#ifdef FFI_GO_CLOSURES ++ + extern void ffi_go_closure_unix64(void) FFI_HIDDEN; + extern void ffi_go_closure_unix64_sse(void) FFI_HIDDEN; + +@@ -883,4 +894,6 @@ + return FFI_OK; + } + ++#endif /* FFI_GO_CLOSURES */ ++ + #endif /* __x86_64__ */ +diff -ur libffi-3.3/src/x86/ffiw64.c libffi-3.3.new/src/x86/ffiw64.c +--- libffi-3.3/src/x86/ffiw64.c 2019-10-31 08:49:54.000000000 -0600 ++++ libffi-3.3.new/src/x86/ffiw64.c 2021-01-04 19:38:38.000000000 -0700 +@@ -187,7 +187,10 @@ + + + extern void ffi_closure_win64(void) FFI_HIDDEN; ++ ++#ifdef FFI_GO_CLOSURES + extern void ffi_go_closure_win64(void) FFI_HIDDEN; ++#endif + + ffi_status + EFI64(ffi_prep_closure_loc)(ffi_closure* closure, +@@ -225,6 +228,7 @@ + return FFI_OK; + } + ++#ifdef FFI_GO_CLOSURES + ffi_status + EFI64(ffi_prep_go_closure)(ffi_go_closure* closure, ffi_cif* cif, + void (*fun)(ffi_cif*, void*, void**, void*)) +@@ -244,6 +248,7 @@ + + return FFI_OK; + } ++#endif + + struct win64_closure_frame + { +diff -ur libffi-3.3/testsuite/Makefile.in libffi-3.3.new/testsuite/Makefile.in +--- libffi-3.3/testsuite/Makefile.in 2019-11-23 08:50:18.000000000 -0700 ++++ libffi-3.3.new/testsuite/Makefile.in 2021-01-04 19:48:49.000000000 -0700 +@@ -1,7 +1,7 @@ +-# Makefile.in generated by automake 1.16.1 from Makefile.am. ++# Makefile.in generated by automake 1.16.3 from Makefile.am. + # @configure_input@ + +-# Copyright (C) 1994-2018 Free Software Foundation, Inc. ++# Copyright (C) 1994-2020 Free Software Foundation, Inc. + + # This Makefile.in is free software; the Free Software Foundation + # gives unlimited permission to copy and/or distribute it, +@@ -462,7 +462,7 @@ + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir "$(srcdir)"' >>site.tmp +- @echo "set objdir `pwd`" >>site.tmp ++ @echo "set objdir \"`pwd`\"" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp +diff -ur libffi-3.3/testsuite/libffi.closures/huge_struct.c libffi-3.3.new/testsuite/libffi.closures/huge_struct.c +--- libffi-3.3/testsuite/libffi.closures/huge_struct.c 2019-11-19 08:06:49.000000000 -0700 ++++ libffi-3.3.new/testsuite/libffi.closures/huge_struct.c 2021-01-04 19:39:02.000000000 -0700 +@@ -9,6 +9,8 @@ + /* { dg-options -mlong-double-128 { target powerpc64*-*-linux* } } */ + /* { dg-options -Wformat=0 { target moxie*-*-elf or1k-*-* } } */ + ++#include ++ + #include "ffitest.h" + + typedef struct BigStruct{ diff --git a/omnibus/config/patches/m4/m4-1.4.18-glibc-change-work-around.patch b/omnibus/config/patches/m4/m4-1.4.18-glibc-change-work-around.patch new file mode 100644 index 000000000..582ae9b53 --- /dev/null +++ b/omnibus/config/patches/m4/m4-1.4.18-glibc-change-work-around.patch @@ -0,0 +1,115 @@ +diff -up m4-1.4.18/lib/fflush.c.orig m4-1.4.18/lib/fflush.c +--- m4-1.4.18/lib/fflush.c.orig 2018-05-02 12:35:59.536851666 +0200 ++++ m4-1.4.18/lib/fflush.c 2018-05-02 12:37:02.768958606 +0200 +@@ -33,7 +33,7 @@ + #undef fflush + + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + /* Clear the stream's ungetc buffer, preserving the value of ftello (fp). */ + static void +@@ -72,7 +72,7 @@ clear_ungetc_buffer (FILE *fp) + + #endif + +-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) ++#if ! (defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */) + + # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +@@ -148,7 +148,7 @@ rpl_fflush (FILE *stream) + if (stream == NULL || ! freading (stream)) + return fflush (stream); + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + + clear_ungetc_buffer_preserving_position (stream); + +diff -up m4-1.4.18/lib/fpending.c.orig m4-1.4.18/lib/fpending.c +--- m4-1.4.18/lib/fpending.c.orig 2018-05-02 12:35:32.305806774 +0200 ++++ m4-1.4.18/lib/fpending.c 2018-05-02 12:35:44.944827347 +0200 +@@ -32,7 +32,7 @@ __fpending (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return fp->_IO_write_ptr - fp->_IO_write_base; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ + /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */ +diff -up m4-1.4.18/lib/fpurge.c.orig m4-1.4.18/lib/fpurge.c +--- m4-1.4.18/lib/fpurge.c.orig 2018-05-02 12:38:13.586078669 +0200 ++++ m4-1.4.18/lib/fpurge.c 2018-05-02 12:38:38.785121867 +0200 +@@ -62,7 +62,7 @@ fpurge (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_IO_read_end = fp->_IO_read_ptr; + fp->_IO_write_ptr = fp->_IO_write_base; + /* Avoid memory leak when there is an active ungetc buffer. */ +diff -up m4-1.4.18/lib/freadahead.c.orig m4-1.4.18/lib/freadahead.c +--- m4-1.4.18/lib/freadahead.c.orig 2016-12-31 14:54:41.000000000 +0100 ++++ m4-1.4.18/lib/freadahead.c 2018-05-02 11:43:19.570336724 +0200 +@@ -25,7 +25,7 @@ + size_t + freadahead (FILE *fp) + { +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_write_ptr > fp->_IO_write_base) + return 0; + return (fp->_IO_read_end - fp->_IO_read_ptr) +diff -up m4-1.4.18/lib/freading.c.orig m4-1.4.18/lib/freading.c +--- m4-1.4.18/lib/freading.c.orig 2018-05-02 12:37:33.970011368 +0200 ++++ m4-1.4.18/lib/freading.c 2018-05-02 12:37:59.393054359 +0200 +@@ -31,7 +31,7 @@ freading (FILE *fp) + /* Most systems provide FILE as a struct and the necessary bitmask in + , because they need it for implementing getc() and putc() as + fast macros. */ +-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++# if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + return ((fp->_flags & _IO_NO_WRITES) != 0 + || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0 + && fp->_IO_read_base != NULL)); +diff -up m4-1.4.18/lib/fseeko.c.orig m4-1.4.18/lib/fseeko.c +--- m4-1.4.18/lib/fseeko.c.orig 2018-05-02 11:44:17.947460233 +0200 ++++ m4-1.4.18/lib/fseeko.c 2018-05-02 12:39:49.537216897 +0200 +@@ -47,7 +47,7 @@ fseeko (FILE *fp, off_t offset, int when + #endif + + /* These tests are based on fpurge.c. */ +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + if (fp->_IO_read_end == fp->_IO_read_ptr + && fp->_IO_write_ptr == fp->_IO_write_base + && fp->_IO_save_base == NULL) +@@ -123,7 +123,7 @@ fseeko (FILE *fp, off_t offset, int when + return -1; + } + +-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ ++#if defined _IO_EOF_SEEN || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; + fp->_offset = pos; + #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__ +diff -up m4-1.4.18/lib/stdio-impl.h.orig m4-1.4.18/lib/stdio-impl.h +--- m4-1.4.18/lib/stdio-impl.h.orig 2016-12-31 14:54:42.000000000 +0100 ++++ m4-1.4.18/lib/stdio-impl.h 2018-05-02 11:43:19.570336724 +0200 +@@ -18,6 +18,12 @@ + the same implementation of stdio extension API, except that some fields + have different naming conventions, or their access requires some casts. */ + ++/* Glibc 2.28 made _IO_IN_BACKUP private. For now, work around this ++ problem by defining it ourselves. FIXME: Do not rely on glibc ++ internals. */ ++#if !defined _IO_IN_BACKUP && defined _IO_EOF_SEEN ++# define _IO_IN_BACKUP 0x100 ++#endif + + /* BSD stdio derived implementations. */ + diff --git a/omnibus/config/patches/ncurses/ncurses-5.9-gcc-5.patch b/omnibus/config/patches/ncurses/ncurses-5.9-gcc-5.patch new file mode 100644 index 000000000..ddfbf30a7 --- /dev/null +++ b/omnibus/config/patches/ncurses/ncurses-5.9-gcc-5.patch @@ -0,0 +1,46 @@ +https://bugs.gentoo.org/545114 + +extracted from the upstream change (which had many unrelated commits in one) + +From 97bb4678dc03e753290b39bbff30ba2825df9517 Mon Sep 17 00:00:00 2001 +From: "Thomas E. Dickey" +Date: Sun, 7 Dec 2014 03:10:09 +0000 +Subject: [PATCH] ncurses 5.9 - patch 20141206 + ++ modify MKlib_gen.sh to work around change in development version of + gcc introduced here: + https://gcc.gnu.org/ml/gcc-patches/2014-06/msg02185.html + https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00236.html + (reports by Marcus Shawcroft, Maohui Lei). + +diff --git a/ncurses/base/MKlib_gen.sh b/ncurses/base/MKlib_gen.sh +index d8cc3c9..b91398c 100755 +--- a/ncurses/base/MKlib_gen.sh ++++ b/ncurses/base/MKlib_gen.sh +@@ -474,11 +474,22 @@ sed -n -f $ED1 \ + -e 's/gen_$//' \ + -e 's/ / /g' >>$TMP + ++cat >$ED1 < $ED2 ++cat $ED2 >$TMP ++ + $preprocessor $TMP 2>/dev/null \ +-| sed \ +- -e 's/ / /g' \ +- -e 's/^ //' \ +- -e 's/_Bool/NCURSES_BOOL/g' \ ++| sed -f $ED1 \ + | $AWK -f $AW2 \ + | sed -f $ED3 \ + | sed \ diff --git a/omnibus/config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch b/omnibus/config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch new file mode 100644 index 000000000..270c02a19 --- /dev/null +++ b/omnibus/config/patches/ncurses/ncurses-5.9-solaris-xopen_source_extended-detection.patch @@ -0,0 +1,11 @@ +--- configure.after.pkgin.patches 2012-12-17 01:06:16.964187316 +0000 ++++ configure 2012-12-17 01:07:17.046932230 +0000 +@@ -7864,7 +7864,7 @@ + else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 +-cf_result=yes ++cf_result=no + fi + rm -f conftest.$ac_objext conftest.$ac_ext + echo "$as_me:7863: result: $cf_result" >&5 diff --git a/omnibus/config/patches/ncurses/ncurses-clang.patch b/omnibus/config/patches/ncurses/ncurses-clang.patch new file mode 100644 index 000000000..30e0f216d --- /dev/null +++ b/omnibus/config/patches/ncurses/ncurses-clang.patch @@ -0,0 +1,42 @@ +diff -ruNp ncurses-5.9.orig/c++/cursesf.h ncurses-5.9/c++/cursesf.h +--- ncurses-5.9.orig/c++/cursesf.h 2005-08-13 21:08:24.000000000 +0300 ++++ ncurses-5.9/c++/cursesf.h 2011-04-03 18:29:29.000000000 +0300 +@@ -681,7 +681,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +- : NCursesForm (Fields, with_frame, autoDelete_Fields) { ++ : NCursesForm (&Fields, with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); + }; +@@ -694,7 +694,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +- : NCursesForm (Fields, nlines, ncols, begin_y, begin_x, ++ : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x, + with_frame, autoDelete_Fields) { + if (form) + set_user (const_cast(p_UserData)); +diff -ruNp ncurses-5.9.orig/c++/cursesm.h ncurses-5.9/c++/cursesm.h +--- ncurses-5.9.orig/c++/cursesm.h 2005-08-13 21:10:36.000000000 +0300 ++++ ncurses-5.9/c++/cursesm.h 2011-04-03 18:31:42.000000000 +0300 +@@ -639,7 +639,7 @@ public: + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Items=FALSE) +- : NCursesMenu (Items, with_frame, autoDelete_Items) { ++ : NCursesMenu (&Items, with_frame, autoDelete_Items) { + if (menu) + set_user (const_cast(p_UserData)); + }; +@@ -651,7 +651,7 @@ public: + int begin_x = 0, + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE) +- : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) { ++ : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) { + if (menu) + set_user (const_cast(p_UserData)); + }; diff --git a/omnibus/config/patches/ncurses/patch-aa b/omnibus/config/patches/ncurses/patch-aa new file mode 100644 index 000000000..215921d8c --- /dev/null +++ b/omnibus/config/patches/ncurses/patch-aa @@ -0,0 +1,23 @@ +$NetBSD: patch-aa,v 1.16 2011/02/28 11:02:46 adam Exp $ + +--- misc/run_tic.in.orig 2006-10-28 21:43:30.000000000 +0200 ++++ misc/run_tic.in +@@ -122,7 +122,7 @@ TICDIR=`echo $TERMINFO | sed -e 's%/shar + # would generate a lot of confusing error messages if we tried to overwrite it. + # We explicitly remove its contents rather than the directory itself, in case + # the directory is actually a symbolic link. +-( test -d "$TERMINFO" && cd $TERMINFO && rm -fr ? 2>/dev/null ) ++#( test -d "$TERMINFO" && cd $TERMINFO && rm -fr ? 2>/dev/null ) + + if test "$ext_funcs" = 1 ; then + cat <&6 + + ### Construct the list of include-directories to be generated + +-CPPFLAGS="$CPPFLAGS -I. -I../include" ++CPPFLAGS="-I. -I../include $CPPFLAGS" + if test "$srcdir" != "."; then + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" + fi diff --git a/omnibus/config/patches/ncurses/patch-ad b/omnibus/config/patches/ncurses/patch-ad new file mode 100644 index 000000000..46c758f79 --- /dev/null +++ b/omnibus/config/patches/ncurses/patch-ad @@ -0,0 +1,12 @@ +$NetBSD: patch-ad,v 1.11 2011/02/28 11:02:46 adam Exp $ + +--- c++/Makefile.in.orig 2010-11-27 21:45:27.000000000 +0000 ++++ c++/Makefile.in +@@ -167,7 +167,7 @@ LIB_OBJS = \ + + ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS) + cd ../lib && $(LIBTOOL_LINK) $(CXX) $(CXXFLAGS) \ +- -o $(LIBNAME) $(LIB_OBJS:$o=.lo) \ ++ -o $(LIBNAME) $(LIB_OBJS:.o=.lo) \ + -rpath $(INSTALL_PREFIX)$(libdir) \ + $(LIBTOOL_VERSION) $(NCURSES_MAJOR):$(NCURSES_MINOR) $(LT_UNDEF) $(SHLIB_LIST) diff --git a/omnibus/config/patches/ncurses/patch-cxx_cursesf.h b/omnibus/config/patches/ncurses/patch-cxx_cursesf.h new file mode 100644 index 000000000..f27c14aff --- /dev/null +++ b/omnibus/config/patches/ncurses/patch-cxx_cursesf.h @@ -0,0 +1,22 @@ +$NetBSD: patch-cxx_cursesf.h,v 1.1 2011/02/28 11:02:46 adam Exp $ + +--- c++/cursesf.h.orig 2011-02-28 09:23:33.000000000 +0000 ++++ c++/cursesf.h +@@ -677,7 +677,7 @@ protected: + } + + public: +- NCursesUserForm (NCursesFormField Fields[], ++ NCursesUserForm (NCursesFormField *Fields[], + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Fields=FALSE) +@@ -686,7 +686,7 @@ public: + set_user (const_cast(p_UserData)); + }; + +- NCursesUserForm (NCursesFormField Fields[], ++ NCursesUserForm (NCursesFormField *Fields[], + int nlines, + int ncols, + int begin_y = 0, diff --git a/omnibus/config/patches/ncurses/patch-cxx_cursesm.h b/omnibus/config/patches/ncurses/patch-cxx_cursesm.h new file mode 100644 index 000000000..9455082e3 --- /dev/null +++ b/omnibus/config/patches/ncurses/patch-cxx_cursesm.h @@ -0,0 +1,22 @@ +$NetBSD: patch-cxx_cursesm.h,v 1.1 2011/02/28 11:02:46 adam Exp $ + +--- c++/cursesm.h.orig 2011-02-28 09:25:22.000000000 +0000 ++++ c++/cursesm.h +@@ -635,7 +635,7 @@ protected: + } + + public: +- NCursesUserMenu (NCursesMenuItem Items[], ++ NCursesUserMenu (NCursesMenuItem *Items[], + const T* p_UserData = STATIC_CAST(T*)(0), + bool with_frame=FALSE, + bool autoDelete_Items=FALSE) +@@ -644,7 +644,7 @@ public: + set_user (const_cast(p_UserData)); + }; + +- NCursesUserMenu (NCursesMenuItem Items[], ++ NCursesUserMenu (NCursesMenuItem *Items[], + int nlines, + int ncols, + int begin_y = 0, diff --git a/omnibus/config/patches/ncurses/patch-ncurses_tinfo_lib__baudrate.c b/omnibus/config/patches/ncurses/patch-ncurses_tinfo_lib__baudrate.c new file mode 100644 index 000000000..766813511 --- /dev/null +++ b/omnibus/config/patches/ncurses/patch-ncurses_tinfo_lib__baudrate.c @@ -0,0 +1,24 @@ +$NetBSD: patch-ncurses_tinfo_lib__baudrate.c,v 1.1 2014/05/11 16:55:17 rodent Exp $ + +sys/ttydev.h doesn't exist in OpenBSD 5.5 + +--- ncurses/tinfo/lib_baudrate.c.orig Sun Dec 19 01:50:50 2010 ++++ ncurses/tinfo/lib_baudrate.c +@@ -39,7 +39,7 @@ + + #include + #include /* ospeed */ +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__OpenBSD__) + #include + #endif + +@@ -49,7 +49,7 @@ + * of the indices up to B115200 fit nicely in a 'short', allowing us to retain + * ospeed's type for compatibility. + */ +-#if (defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || defined(__OpenBSD__) ++#if (defined(__FreeBSD__) && (__FreeBSD_version < 700000)) || defined(__NetBSD__) || (defined(__OpenBSD__) && (OpenBSD < 201405)) + #undef B0 + #undef B50 + #undef B75 diff --git a/omnibus/config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch b/omnibus/config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch new file mode 100644 index 000000000..9162cd9c1 --- /dev/null +++ b/omnibus/config/patches/openssl/openssl-1.0.1f-do-not-build-docs.patch @@ -0,0 +1,28 @@ +--- openssl-1.0.1f/Makefile.org.orig 2014-01-08 10:58:40.000000000 -0800 ++++ openssl-1.0.1f/Makefile.org 2014-01-08 11:06:29.000000000 -0800 +@@ -167,7 +167,7 @@ + + TOP= . + ONEDIRS=out tmp +-EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS ++EDIRS= times bugs util include certs ms shlib mt demos perl sf dep VMS + WDIRS= windows + LIBS= libcrypto.a libssl.a + SHARED_CRYPTO=libcrypto$(SHLIB_EXT) +@@ -538,7 +538,7 @@ + dist_pem_h: + (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) + +-install: all install_docs install_sw ++install: all install_sw + + install_sw: + @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ +@@ -603,7 +603,6 @@ + echo 'OpenSSL shared libraries have been installed in:'; \ + echo ' $(INSTALLTOP)'; \ + echo ''; \ +- sed -e '1,/^$$/d' doc/openssl-shared.txt; \ + fi; \ + fi + cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/pkgconfig diff --git a/omnibus/config/patches/openssl/openssl-1.0.1j-windows-relocate-dll.patch b/omnibus/config/patches/openssl/openssl-1.0.1j-windows-relocate-dll.patch new file mode 100644 index 000000000..96e6efc9a --- /dev/null +++ b/omnibus/config/patches/openssl/openssl-1.0.1j-windows-relocate-dll.patch @@ -0,0 +1,20 @@ +diff --git a/Makefile.shared b/Makefile.shared +index e8d222a..02ec85b 100644 +--- a/Makefile.shared ++++ b/Makefile.shared +@@ -283,13 +283,12 @@ link_a.cygwin: + base=-Wl,--enable-auto-image-base; \ + if expr $(PLATFORM) : 'mingw' > /dev/null; then \ + case $(LIBNAME) in \ +- crypto) SHLIB=libeay;; \ +- ssl) SHLIB=ssleay;; \ ++ crypto) SHLIB=libeay; base=-Wl,--image-base,0x64000000;; \ ++ ssl) SHLIB=ssleay; base=-Wl,--image-base,0x65000000;; \ + esac; \ + SHLIB_SOVER=32; \ + extras="$(LIBNAME).def"; \ + $(PERL) util/mkdef.pl 32 $$SHLIB > $$extras; \ +- base=; [ $(LIBNAME) = "crypto" -a -n "$(FIPSCANLIB)" ] && base=-Wl,--image-base,0x63000000; \ + fi; \ + dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ + $(PERL) util/mkrc.pl $$dll_name | \ diff --git a/omnibus/config/patches/openssl/openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch b/omnibus/config/patches/openssl/openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch new file mode 100644 index 000000000..d205cd6b2 --- /dev/null +++ b/omnibus/config/patches/openssl/openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch @@ -0,0 +1,20 @@ +--- openssl-1.0.1q/Configure.orig 2015-12-15 17:47:52.000000000 -0500 ++++ openssl-1.0.1q/Configure 2015-12-15 18:31:01.000000000 -0500 +@@ -537,7 +537,7 @@ + "BC-32","bcc32::::WIN32::BN_LLONG DES_PTR RC4_INDEX EXPORT_VAR_AS_FN:${no_asm}:win32", + + # MinGW +-"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL -DOPENSSL_USE_APPLINK:-mno-cygwin:.dll.a", ++"mingw", "gcc:-mno-cygwin -DL_ENDIAN -DWIN32_LEAN_AND_MEAN -fomit-frame-pointer -O3 -march=i486 -Wall::-D_MT:MINGW32:-lws2_32 -lgdi32 -lcrypt32:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts} EXPORT_VAR_AS_FN:${x86_asm}:coff:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", + # As for OPENSSL_USE_APPLINK. Applink makes it possible to use .dll + # compiled with one compiler with application compiled with another + # compiler. It's possible to engage Applink support in mingw64 build, +@@ -545,7 +545,7 @@ + # handling, one can't seriously consider its binaries for using with + # non-mingw64 run-time environment. And as mingw64 is always consistent + # with itself, Applink is never engaged and can as well be omitted. +-"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", ++"mingw64", "gcc:-mno-cygwin -DL_ENDIAN -O3 -Wall -DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE::-D_MT:MINGW64:-lws2_32 -lgdi32 -lcrypt32:SIXTY_FOUR_BIT RC4_CHUNK_LL DES_INT EXPORT_VAR_AS_FN:${x86_64_asm}:mingw64:win32:cygwin-shared:-D_WINDLL:-mno-cygwin:.dll.a", + + # UWIN + "UWIN", "cc:-DTERMIOS -DL_ENDIAN -O -Wall:::UWIN::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${no_asm}:win32", diff --git a/omnibus/config/patches/openssl/openssl-1.0.2x-darwin-arm64.patch b/omnibus/config/patches/openssl/openssl-1.0.2x-darwin-arm64.patch new file mode 100644 index 000000000..7c245e011 --- /dev/null +++ b/omnibus/config/patches/openssl/openssl-1.0.2x-darwin-arm64.patch @@ -0,0 +1,54 @@ +diff -ur openssl-1.0.2x/Configure openssl-1.0.2x.new/Configure +--- openssl-1.0.2x/Configure 2020-12-08 13:23:12.000000000 +0000 ++++ openssl-1.0.2x.new/Configure 2021-01-12 08:24:27.000000000 +0000 +@@ -156,6 +156,7 @@ + + my $x86_elf_asm="$x86_asm:elf"; + ++my $arm64_asm="arm64cpuid.o:arm64-gcc.o arm64-mont.o arm64-mont5.o arm64-gf2m.o modexp512-arm64.o::aes-arm64.o vpaes-arm64.o bsaes-arm64.o aesni-arm64.o aesni-sha1-arm64.o::md5-arm64.o:sha1-arm64.o sha256-arm64.o sha512-arm64.o::rc4-arm64.o rc4-md5-arm64.o:::wp-arm64.o:cmll-arm64.o cmll_misc.o:ghash-arm64.o:"; + my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o:ecp_nistz256.o ecp_nistz256-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o aesni-gcm-x86_64.o:"; + my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.o:::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o rc4_skey.o:::::ghash-ia64.o::void"; + my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o vis3-mont.o sparct4-mont.o sparcv9-gf2m.o::des_enc-sparc.o fcrypt_b.o dest4-sparcv9.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o::::::camellia.o cmll_misc.o cmll_cbc.o cmllt4-sparcv9.o:ghash-sparcv9.o::void"; +@@ -649,6 +650,7 @@ + "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", ++"darwin64-arm64-cc","cc:-arch arm64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$arm64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", + "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib", +diff -ur openssl-1.0.2x/config openssl-1.0.2x.new/config +--- openssl-1.0.2x/config 2020-12-08 13:23:12.000000000 +0000 ++++ openssl-1.0.2x.new/config 2021-01-12 08:39:17.000000000 +0000 +@@ -274,6 +274,9 @@ + + Darwin:*) + case "$MACHINE" in ++ arm*) ++ echo "arm-apple-darwin${VERSION}" ++ ;; + Power*) + echo "ppc-apple-darwin${VERSION}" + ;; +@@ -560,6 +563,21 @@ + else + OUT="darwin-ppc-cc" + fi ;; ++ arm-apple-darwin*) ++ ISA64=`(sysctl -n hw.optional.arm64) 2>/dev/null` ++ if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then ++ echo "WARNING! If you wish to build M1 ARM 64-bit library, then you have to" ++ echo " invoke './Configure darwin64-arm64-cc' *manually*." ++ if [ "$TEST" = "false" -a -t 1 ]; then ++ echo " You have about 5 seconds to press Ctrl-C to abort." ++ (trap "stty `stty -g`" 2 0; stty -icanon min 0 time 50; read waste) <&1 ++ fi ++ fi ++ if [ "$ISA64" = "1" -a "$KERNEL_BITS" = "64" ]; then ++ OUT="darwin64-arm64-cc" ++ else ++ OUT="darwin-arm64-cc" ++ fi ;; + i?86-apple-darwin*) + ISA64=`(sysctl -n hw.optional.x86_64) 2>/dev/null` + if [ "$ISA64" = "1" -a -z "$KERNEL_BITS" ]; then diff --git a/omnibus/config/patches/openssl/openssl-1.1.0f-do-not-install-docs.patch b/omnibus/config/patches/openssl/openssl-1.1.0f-do-not-install-docs.patch new file mode 100644 index 000000000..4cb140613 --- /dev/null +++ b/omnibus/config/patches/openssl/openssl-1.1.0f-do-not-install-docs.patch @@ -0,0 +1,10 @@ +--- openssl-1.1.0f/Configurations/unix-Makefile.tmpl.orig 2017-10-22 13:23:48.592533617 +0300 ++++ openssl-1.1.0f/Configurations/unix-Makefile.tmpl 2017-10-22 13:26:21.199065333 +0300 +@@ -260,7 +260,7 @@ + @echo "Tests are not supported with your chosen Configure options" + @ : {- output_on() if !$disabled{tests}; "" -} + +-install: install_sw install_ssldirs install_docs ++install: install_sw install_ssldirs + + uninstall: uninstall_docs uninstall_sw diff --git a/omnibus/config/patches/perl/perl-5.18.1-remove_lnsl.patch b/omnibus/config/patches/perl/perl-5.18.1-remove_lnsl.patch new file mode 100644 index 000000000..6cf59a718 --- /dev/null +++ b/omnibus/config/patches/perl/perl-5.18.1-remove_lnsl.patch @@ -0,0 +1,441 @@ +diff -ru perl-5.18.1.orig/Configure perl-5.18.1/Configure +--- perl-5.18.1.orig/Configure 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/Configure 2019-08-21 09:07:10.876345427 -0600 +@@ -1381,7 +1381,7 @@ + : set usesocks on the Configure command line to enable socks. + : List of libraries we want. + : If anyone needs extra -lxxx, put those in a hint file. +-libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun" ++libswanted="sfio socket bind inet nm ndbm gdbm dbm db malloc dl dld ld sun" + libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD" + : We probably want to search /usr/shlib before most other libraries. + : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. +diff -ru perl-5.18.1.orig/configure.com perl-5.18.1/configure.com +--- perl-5.18.1.orig/configure.com 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/configure.com 2019-08-21 09:07:10.878345427 -0600 +@@ -121,7 +121,7 @@ + $!: full support for void wanted by default !sfn + $!defvoidused=15 !sfn + $!: List of libraries we want. !sfn +-$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn ++$!libswanted='net socket inet nm ndbm gdbm dbm db malloc dl' !sfn + $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn + $!libswanted="$libswanted ucb bsd BSD PW x" !sfn + $!: We probably want to search /usr/shlib before most other libraries. !sfn +diff -ru perl-5.18.1.orig/cpan/Config-Perl-V/t/20_plv.t perl-5.18.1/cpan/Config-Perl-V/t/20_plv.t +--- perl-5.18.1.orig/cpan/Config-Perl-V/t/20_plv.t 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/cpan/Config-Perl-V/t/20_plv.t 2019-08-21 09:07:10.879345427 -0600 +@@ -48,8 +48,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.6.1' + Dynamic Linking: +diff -ru perl-5.18.1.orig/Cross/config.sh-arm-linux perl-5.18.1/Cross/config.sh-arm-linux +--- perl-5.18.1.orig/Cross/config.sh-arm-linux 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/Cross/config.sh-arm-linux 2019-08-21 09:08:35.251345202 -0600 +@@ -777,12 +777,12 @@ + libc='/lib/libc-2.2.2.so' + libperl='libperl.so' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='sfio socket bind inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -865,7 +865,7 @@ + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff -ru perl-5.18.1.orig/Cross/config.sh-arm-linux-n770 perl-5.18.1/Cross/config.sh-arm-linux-n770 +--- perl-5.18.1.orig/Cross/config.sh-arm-linux-n770 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/Cross/config.sh-arm-linux-n770 2019-08-21 09:08:35.252345202 -0600 +@@ -748,12 +748,12 @@ + libc='/lib/libc-2.2.2.so' + libperl='libperl.arma' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='sfio socket bind inet nm ndbm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -835,7 +835,7 @@ + perl='' + perl_patchlevel='' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff -ru perl-5.18.1.orig/hints/aix_4.sh perl-5.18.1/hints/aix_4.sh +--- perl-5.18.1.orig/hints/aix_4.sh 2013-04-30 20:52:55.000000000 -0600 ++++ perl-5.18.1/hints/aix_4.sh 2019-08-21 09:07:10.880345427 -0600 +@@ -583,7 +583,7 @@ + + *** + *** You seem to be compiling in AIX for the OS/400 PASE environment. +-*** I'm not going to use the AIX bind, nsl, and possible util libraries, then. ++*** I'm not going to use the AIX bind, and possible util libraries, then. + *** I'm also not going to install perl as /usr/bin/perl. + *** Perl will be installed under $prefix. + *** For instructions how to install this build from AIX to PASE, +@@ -591,7 +591,7 @@ + *** about "Operating system name". + *** + EOF +- set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` ++ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ util @ @'` + shift + libswanted="$*" + installusrbinperl="$undef" +diff -ru perl-5.18.1.orig/hints/aix.sh perl-5.18.1/hints/aix.sh +--- perl-5.18.1.orig/hints/aix.sh 2013-08-11 20:44:48.000000000 -0600 ++++ perl-5.18.1/hints/aix.sh 2019-08-21 09:07:10.880345427 -0600 +@@ -505,7 +505,7 @@ + + *** + *** You seem to be compiling in AIX for the OS/400 PASE environment. +-*** I'm not going to use the AIX bind, nsl, and possible util libraries, then. ++*** I'm not going to use the AIX bind, and possible util libraries, then. + *** I'm also not going to install perl as /usr/bin/perl. + *** Perl will be installed under $prefix. + *** For instructions how to install this build from AIX to PASE, +@@ -513,7 +513,7 @@ + *** about "Operating system name". + *** + EOF +- set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` ++ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ util @ @'` + shift + libswanted="$*" + installusrbinperl="$undef" +diff -ru perl-5.18.1.orig/hints/dgux.sh perl-5.18.1/hints/dgux.sh +--- perl-5.18.1.orig/hints/dgux.sh 2013-08-11 20:44:48.000000000 -0600 ++++ perl-5.18.1/hints/dgux.sh 2019-08-21 09:07:10.880345427 -0600 +@@ -154,7 +154,7 @@ + #libswanted="dbm posix $libswanted" + # Do *NOT* add there the malloc native + # DG/UX library! +-libswanted="dbm posix resolv socket nsl dl m" ++libswanted="dbm posix resolv socket dl m" + + ##################################### + # +@@ -203,7 +203,7 @@ + # DG/UX's sched_yield is in -lrte + # Do *NOT* add there the malloc native + # DG/UX library! +- libswanted="dbm posix resolv socket nsl dl m rte" ++ libswanted="dbm posix resolv socket dl m rte" + archname="ix86-dgux-thread" + sitearch="$prefix/lib/perl518/$archname" + sitelib="$prefix/lib/perl518" +diff -ru perl-5.18.1.orig/hints/epix.sh perl-5.18.1/hints/epix.sh +--- perl-5.18.1.orig/hints/epix.sh 2013-04-30 20:52:55.000000000 -0600 ++++ perl-5.18.1/hints/epix.sh 2019-08-21 09:07:10.880345427 -0600 +@@ -37,7 +37,7 @@ + # Old version had this, but I'm not sure why since the old version + # also mucked around with libswanted. This is also definitely wrong + # if the user is trying to use DB_File or GDBM_File. +-# libs='-lsocket -lnsl -ldbm -ldl -lc -lcrypt -lm -lucb' ++# libs='-lsocket -ldbm -ldl -lc -lcrypt -lm -lucb' + + # We include support for using libraries in /usr/ucblib, but the setting + # of libswanted excludes some libraries found there. You may want to +diff -ru perl-5.18.1.orig/hints/gnu.sh perl-5.18.1/hints/gnu.sh +--- perl-5.18.1.orig/hints/gnu.sh 2013-05-23 17:38:10.000000000 -0600 ++++ perl-5.18.1/hints/gnu.sh 2019-08-21 09:07:10.880345427 -0600 +@@ -4,7 +4,7 @@ + + # libnsl is unusable on the Hurd. + # XXX remove this once SUNRPC is implemented. +-set `echo X "$libswanted "| sed -e 's/ nsl / /' -e 's/ c / pthread /'` ++set `echo X "$libswanted "| sed -e 's/ c / pthread /'` + shift + libswanted="$*" + +diff -ru perl-5.18.1.orig/hints/irix_5.sh perl-5.18.1/hints/irix_5.sh +--- perl-5.18.1.orig/hints/irix_5.sh 2013-02-26 14:28:27.000000000 -0700 ++++ perl-5.18.1/hints/irix_5.sh 2019-08-21 09:07:10.881345427 -0600 +@@ -27,9 +27,9 @@ + esac + + lddlflags="-shared" +-# For some reason we don't want -lsocket -lnsl or -ldl. Can anyone ++# For some reason we don't want -lsocket or -ldl. Can anyone + # contribute an explanation? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + +diff -ru perl-5.18.1.orig/hints/irix_6_0.sh perl-5.18.1/hints/irix_6_0.sh +--- perl-5.18.1.orig/hints/irix_6_0.sh 2013-02-26 14:28:27.000000000 -0700 ++++ perl-5.18.1/hints/irix_6_0.sh 2019-08-21 09:07:10.881345427 -0600 +@@ -19,7 +19,7 @@ + lddlflags="-32 -shared" + + # We don't want these libraries. Anyone know why? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + # +@@ -29,7 +29,7 @@ + # taken from irix_5.sh . Changes from irix_5.sh: + # Olimit and nested comments (warning 1009) no longer accepted + # -OPT:fold_arith_limit so POSIX module will optimize +-# no 64bit versions of sun, crypt, nsl, socket, dl dso's available ++# no 64bit versions of sun, crypt, socket, dl dso's available + # as of IRIX 6.0.1 so omit those from libswanted line via `sed'. + + # perl 5 built with this hints file passes most tests (`make test'). +@@ -38,7 +38,7 @@ + # i_time='define' + # ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -woff 1009 -OPT:fold_arith_limit=1046" + # lddlflags="-shared" +-# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` ++# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ dl / /'` + # shift + # libswanted="$*" + +diff -ru perl-5.18.1.orig/hints/irix_6_1.sh perl-5.18.1/hints/irix_6_1.sh +--- perl-5.18.1.orig/hints/irix_6_1.sh 2013-02-26 14:28:27.000000000 -0700 ++++ perl-5.18.1/hints/irix_6_1.sh 2019-08-21 09:07:10.881345427 -0600 +@@ -19,7 +19,7 @@ + lddlflags="-32 -shared" + + # We don't want these libraries. Anyone know why? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + # +@@ -29,7 +29,7 @@ + # taken from irix_5.sh . Changes from irix_5.sh: + # Olimit and nested comments (warning 1009) no longer accepted + # -OPT:fold_arith_limit so POSIX module will optimize +-# no 64bit versions of sun, crypt, nsl, socket, dl dso's available ++# no 64bit versions of sun, crypt, socket, dl dso's available + # as of IRIX 6.0.1 so omit those from libswanted line via `sed'. + + # perl 5 built with this hints file passes most tests (`make test'). +@@ -38,7 +38,7 @@ + # i_time='define' + # ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -woff 1009 -OPT:fold_arith_limit=1046" + # lddlflags="-shared" +-# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` ++# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ dl / /'` + # shift + # libswanted="$*" + +diff -ru perl-5.18.1.orig/hints/irix_6.sh perl-5.18.1/hints/irix_6.sh +--- perl-5.18.1.orig/hints/irix_6.sh 2013-04-30 20:52:55.000000000 -0600 ++++ perl-5.18.1/hints/irix_6.sh 2019-08-21 09:07:10.881345427 -0600 +@@ -359,7 +359,7 @@ + # Socket networking is in libc, these are not installed by default, + # and just slow perl down. (scotth@sgi.com) + # librt contains nothing we need (some places need it for Time::HiRes) --jhi +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /' -e 's/ rt / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /' -e 's/ rt / /'` + shift + libswanted="$*" + +diff -ru perl-5.18.1.orig/hints/powerux.sh perl-5.18.1/hints/powerux.sh +--- perl-5.18.1.orig/hints/powerux.sh 2013-04-30 20:52:55.000000000 -0600 ++++ perl-5.18.1/hints/powerux.sh 2019-08-21 09:07:10.882345427 -0600 +@@ -27,11 +27,11 @@ + exit 2 + fi + +-# We DO NOT want -lmalloc or -lPW, we DO need -lgen to follow -lnsl, so ++# We DO NOT want -lmalloc or -lPW, we DO need -lgen to follow, so + # fixup libswanted to reflect that desire (also need -lresolv if you want + # DNS name lookup to work, which seems desirable :-). + # +-libswanted=`echo ' '$libswanted' ' | sed -e 's/ malloc / /' -e 's/ PW / /' -e 's/ nsl / nsl gen resolv /'` ++libswanted=`echo ' '$libswanted' ' | sed -e 's/ malloc / /' -e 's/ PW / /'` + + # We DO NOT want /usr/ucblib in glibpth + # +diff -ru perl-5.18.1.orig/hints/titanos.sh perl-5.18.1/hints/titanos.sh +--- perl-5.18.1.orig/hints/titanos.sh 2013-02-26 14:28:27.000000000 -0700 ++++ perl-5.18.1/hints/titanos.sh 2019-08-21 09:07:10.882345427 -0600 +@@ -17,14 +17,14 @@ + stdchar='unsigned char' + # + # Apparently there are some harmful libs in Configure's $libswanted. +-# Perl5.000 had: libs='-lnsl -ldbm -lPW -lmalloc -lm' ++# Perl5.000 had: libs='-ldbm -lPW -lmalloc -lm' + # Unfortunately, this line prevents users from including things like + # -lgdbm and -ldb, which they may or may not have or want. + # We should probably fiddle with libswanted instead of libs. + # And even there, we should only bother to delete harmful libraries. + # However, I don't know what they are or why they should be deleted, + # so this will have to do for now. --AD 28 Mar 1995 +-libswanted='sfio nsl dbm gdbm db PW malloc m' ++libswanted='sfio dbm gdbm db PW malloc m' + # + # Extensions: This system can not compile POSIX. We'll let Configure + # figure out the others. +diff -ru perl-5.18.1.orig/INSTALL perl-5.18.1/INSTALL +--- perl-5.18.1.orig/INSTALL 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/INSTALL 2019-08-21 09:07:10.883345427 -0600 +@@ -1583,7 +1583,7 @@ + undefined symbols, check the libs variable in the config.sh file. It + should look something like + +- libs='-lsocket -lnsl -ldl -lm -lc' ++ libs='-lsocket -ldl -lm -lc' + + The exact libraries will vary from system to system, but you typically + need to include at least the math library -lm. Normally, Configure +diff -ru perl-5.18.1.orig/NetWare/config.wc perl-5.18.1/NetWare/config.wc +--- perl-5.18.1.orig/NetWare/config.wc 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/NetWare/config.wc 2019-08-21 09:07:10.883345427 -0600 +@@ -757,7 +757,7 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff -ru perl-5.18.1.orig/plan9/config_sh.sample perl-5.18.1/plan9/config_sh.sample +--- perl-5.18.1.orig/plan9/config_sh.sample 2013-08-11 20:44:48.000000000 -0600 ++++ perl-5.18.1/plan9/config_sh.sample 2019-08-21 09:07:10.883345427 -0600 +@@ -764,7 +764,7 @@ + libsfiles='' + libsfound='' + libspath=' /lib' +-libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' ++libswanted='sfio socket bind inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' + libswanted_uselargefiles='' + line='' + lint='' +diff -ru perl-5.18.1.orig/pod/perlrun.pod perl-5.18.1/pod/perlrun.pod +--- perl-5.18.1.orig/pod/perlrun.pod 2013-08-11 20:44:48.000000000 -0600 ++++ perl-5.18.1/pod/perlrun.pod 2019-08-21 09:07:10.884345427 -0600 +@@ -862,11 +862,11 @@ + $ perl -V:libc + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib. +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib.* + libpth='/usr/local/lib /lib /usr/lib'; +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + lib_ext='.a'; + libc='/lib/libc-2.2.4.so'; + libperl='libperl.a'; +diff -ru perl-5.18.1.orig/Porting/bisect-runner.pl perl-5.18.1/Porting/bisect-runner.pl +--- perl-5.18.1.orig/Porting/bisect-runner.pl 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/Porting/bisect-runner.pl 2019-08-21 09:07:10.885345427 -0600 +@@ -922,7 +922,7 @@ + my @libs; + # This is the current libswanted list from Configure, less the libs removed + # by current hints/linux.sh +- foreach my $lib (qw(sfio socket inet nsl nm ndbm gdbm dbm db malloc dl dld ++ foreach my $lib (qw(sfio socket inet nm ndbm gdbm dbm db malloc dl dld + ld sun m crypt sec util c cposix posix ucb BSD)) { + foreach my $dir (@paths) { + next unless -f "$dir/lib$lib.so"; +diff -ru perl-5.18.1.orig/Porting/config.sh perl-5.18.1/Porting/config.sh +--- perl-5.18.1.orig/Porting/config.sh 2013-08-11 20:44:47.000000000 -0600 ++++ perl-5.18.1/Porting/config.sh 2019-08-21 09:08:35.252345202 -0600 +@@ -795,12 +795,12 @@ + libc='/lib/libc-2.7.so' + libperl='libperl.a' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' ++libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so /usr/lib/libgdbm_compat.so' ++libsfiles=' libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' ++libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so /usr/lib/libgdbm_compat.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='sfio socket inet nsl nm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' ++libswanted='sfio socket inet nm gdbm dbm db malloc dl dld ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' + libswanted_uselargefiles='' + line='' + lint='' +@@ -886,7 +886,7 @@ + perl_patchlevel='34948' + perl_static_inline='static __inline__' + perladmin='yourname@yourhost.yourplace.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/opt/perl/bin/perl5.18.1' + pg='pg' + phostname='' +diff -ru perl-5.18.1.orig/win32/config.ce perl-5.18.1/win32/config.ce +--- perl-5.18.1.orig/win32/config.ce 2013-08-11 20:44:49.000000000 -0600 ++++ perl-5.18.1/win32/config.ce 2019-08-21 09:07:10.886345427 -0600 +@@ -749,7 +749,7 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff -ru perl-5.18.1.orig/win32/config.gc perl-5.18.1/win32/config.gc +--- perl-5.18.1.orig/win32/config.gc 2013-08-11 20:44:49.000000000 -0600 ++++ perl-5.18.1/win32/config.gc 2019-08-21 09:07:10.886345427 -0600 +@@ -775,8 +775,8 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff -ru perl-5.18.1.orig/win32/config.vc perl-5.18.1/win32/config.vc +--- perl-5.18.1.orig/win32/config.vc 2013-08-11 20:44:49.000000000 -0600 ++++ perl-5.18.1/win32/config.vc 2019-08-21 09:07:10.887345427 -0600 +@@ -774,8 +774,8 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' diff --git a/omnibus/config/patches/perl/perl-5.22.1-remove_lnsl.patch b/omnibus/config/patches/perl/perl-5.22.1-remove_lnsl.patch new file mode 100644 index 000000000..d232c003b --- /dev/null +++ b/omnibus/config/patches/perl/perl-5.22.1-remove_lnsl.patch @@ -0,0 +1,512 @@ +diff -ru perl-5.22.1.orig/Configure perl-5.22.1/Configure +--- perl-5.22.1.orig/Configure 2015-10-17 06:38:37.000000000 -0600 ++++ perl-5.22.1/Configure 2019-08-21 09:12:01.271379908 -0600 +@@ -1454,7 +1454,7 @@ + : set usesocks on the Configure command line to enable socks. + : List of libraries we want. + : If anyone needs extra -lxxx, put those in a hint file. +-libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld" ++libswanted="cl pthread socket bind inet nm ndbm gdbm dbm db malloc dl ld" + libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" + : We probably want to search /usr/shlib before most other libraries. + : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. +diff -ru perl-5.22.1.orig/configure.com perl-5.22.1/configure.com +--- perl-5.22.1.orig/configure.com 2015-10-17 06:38:37.000000000 -0600 ++++ perl-5.22.1/configure.com 2019-08-21 09:12:01.271379908 -0600 +@@ -119,7 +119,7 @@ + $!: machines, like the mips. Usually, it should be empty. !sfn + $!plibpth='' !sfn + $!: List of libraries we want. !sfn +-$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn ++$!libswanted='net socket inet nm ndbm gdbm dbm db malloc dl' !sfn + $!libswanted="$libswanted ld sun m c cposix posix ndir dir crypt" !sfn + $!libswanted="$libswanted ucb bsd BSD PW x" !sfn + $!: We probably want to search /usr/shlib before most other libraries. !sfn +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/20_plv56.t perl-5.22.1/cpan/Config-Perl-V/t/20_plv56.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/20_plv56.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/20_plv56.t 2019-08-21 09:12:01.272379909 -0600 +@@ -58,8 +58,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil +- perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil ++ libs=-lgdbm -ldb -ldl -lm -lc -lcrypt -lutil ++ perllibs=-ldl -lm -lc -lcrypt -lutil + libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/21_plv58.t perl-5.22.1/cpan/Config-Perl-V/t/21_plv58.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/21_plv58.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/21_plv58.t 2019-08-21 09:12:01.272379909 -0600 +@@ -62,8 +62,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.11.2' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/22_plv510.t perl-5.22.1/cpan/Config-Perl-V/t/22_plv510.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/22_plv510.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/22_plv510.t 2019-08-21 09:12:01.272379909 -0600 +@@ -52,8 +52,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.6.1' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/23_plv512.t perl-5.22.1/cpan/Config-Perl-V/t/23_plv512.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/23_plv512.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/23_plv512.t 2019-08-21 09:12:01.272379909 -0600 +@@ -63,8 +63,8 @@ + Linker and Libraries: + ld='/usr/bin/ld', ldflags ='-L/pro/local/lib +DD64 -L/usr/lib/hpux64' + libpth=/pro/local/lib /usr/lib/hpux64 /lib /usr/lib /usr/ccs/lib /usr/local/lib +- libs=-lcl -lpthread -lnsl -lnm -ldb -ldl -ldld -lm -lsec -lc +- perllibs=-lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc ++ libs=-lcl -lpthread -lnm -ldb -ldl -ldld -lm -lsec -lc ++ perllibs=-lcl -lpthread -lnm -ldl -ldld -lm -lsec -lc + libc=/usr/lib/hpux64/libc.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/24_plv514.t perl-5.22.1/cpan/Config-Perl-V/t/24_plv514.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/24_plv514.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/24_plv514.t 2019-08-21 09:12:01.272379909 -0600 +@@ -64,8 +64,8 @@ + Linker and Libraries: + ld='ld', ldflags ='-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64' + libpth=/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs/lib /usr/local/lib /usr/lib64 +- libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc +- perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc ++ libs=-lbind -ldbm -ldb -ldl -lld -lm -lcrypt -lc ++ perllibs=-lbind -ldl -lld -lm -lcrypt -lc + libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/25_plv516.t perl-5.22.1/cpan/Config-Perl-V/t/25_plv516.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/25_plv516.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/25_plv516.t 2019-08-21 09:12:01.272379909 -0600 +@@ -64,8 +64,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.15' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/26_plv5182.t perl-5.22.1/cpan/Config-Perl-V/t/26_plv5182.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/26_plv5182.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/26_plv5182.t 2019-08-21 09:12:01.272379909 -0600 +@@ -89,8 +89,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/26_plv518.t perl-5.22.1/cpan/Config-Perl-V/t/26_plv518.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/26_plv518.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/26_plv518.t 2019-08-21 09:12:01.272379909 -0600 +@@ -89,8 +89,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.17' + Dynamic Linking: +diff -ru perl-5.22.1.orig/cpan/Config-Perl-V/t/27_plv5200.t perl-5.22.1/cpan/Config-Perl-V/t/27_plv5200.t +--- perl-5.22.1.orig/cpan/Config-Perl-V/t/27_plv5200.t 2015-10-17 06:31:54.000000000 -0600 ++++ perl-5.22.1/cpan/Config-Perl-V/t/27_plv5200.t 2019-08-21 09:12:01.272379909 -0600 +@@ -91,8 +91,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +diff -ru perl-5.22.1.orig/Cross/config.sh-arm-linux perl-5.22.1/Cross/config.sh-arm-linux +--- perl-5.22.1.orig/Cross/config.sh-arm-linux 2015-10-18 11:26:26.000000000 -0600 ++++ perl-5.22.1/Cross/config.sh-arm-linux 2019-08-21 09:12:19.907386879 -0600 +@@ -838,12 +838,12 @@ + libc='/lib/libc-2.2.2.so' + libperl='libperl.so' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -927,7 +927,7 @@ + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff -ru perl-5.22.1.orig/Cross/config.sh-arm-linux-n770 perl-5.22.1/Cross/config.sh-arm-linux-n770 +--- perl-5.22.1.orig/Cross/config.sh-arm-linux-n770 2015-10-18 11:26:52.000000000 -0600 ++++ perl-5.22.1/Cross/config.sh-arm-linux-n770 2019-08-21 09:12:19.907386879 -0600 +@@ -744,12 +744,12 @@ + libc='/lib/libc-2.2.2.so' + libperl='libperl.arma' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -831,7 +831,7 @@ + perl='' + perl_patchlevel='' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff -ru perl-5.22.1.orig/hints/aix_4.sh perl-5.22.1/hints/aix_4.sh +--- perl-5.22.1.orig/hints/aix_4.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/aix_4.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -583,7 +583,7 @@ + + *** + *** You seem to be compiling in AIX for the OS/400 PASE environment. +-*** I'm not going to use the AIX bind, nsl, and possible util libraries, then. ++*** I'm not going to use the AIX bind, and possible util libraries, then. + *** I'm also not going to install perl as /usr/bin/perl. + *** Perl will be installed under $prefix. + *** For instructions how to install this build from AIX to PASE, +@@ -591,7 +591,7 @@ + *** about "Operating system name". + *** + EOF +- set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` ++ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ util @ @'` + shift + libswanted="$*" + installusrbinperl="$undef" +diff -ru perl-5.22.1.orig/hints/aix.sh perl-5.22.1/hints/aix.sh +--- perl-5.22.1.orig/hints/aix.sh 2015-10-17 06:38:37.000000000 -0600 ++++ perl-5.22.1/hints/aix.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -504,7 +504,7 @@ + + *** + *** You seem to be compiling in AIX for the OS/400 PASE environment. +-*** I'm not going to use the AIX bind, nsl, and possible util libraries, then. ++*** I'm not going to use the AIX bind, and possible util libraries, then. + *** I'm also not going to install perl as /usr/bin/perl. + *** Perl will be installed under $prefix. + *** For instructions how to install this build from AIX to PASE, +@@ -512,7 +512,7 @@ + *** about "Operating system name". + *** + EOF +- set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` ++ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ util @ @'` + shift + libswanted="$*" + installusrbinperl="$undef" +diff -ru perl-5.22.1.orig/hints/epix.sh perl-5.22.1/hints/epix.sh +--- perl-5.22.1.orig/hints/epix.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/epix.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -37,7 +37,7 @@ + # Old version had this, but I'm not sure why since the old version + # also mucked around with libswanted. This is also definitely wrong + # if the user is trying to use DB_File or GDBM_File. +-# libs='-lsocket -lnsl -ldbm -ldl -lc -lcrypt -lm -lucb' ++# libs='-lsocket -ldbm -ldl -lc -lcrypt -lm -lucb' + + # We include support for using libraries in /usr/ucblib, but the setting + # of libswanted excludes some libraries found there. You may want to +diff -ru perl-5.22.1.orig/hints/gnu.sh perl-5.22.1/hints/gnu.sh +--- perl-5.22.1.orig/hints/gnu.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/gnu.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -4,7 +4,7 @@ + + # libnsl is unusable on the Hurd. + # XXX remove this once SUNRPC is implemented. +-set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ nsl / /' -e 's/ c / pthread /'` ++set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ c / pthread /'` + shift + libswanted="$*" + +diff -ru perl-5.22.1.orig/hints/irix_5.sh perl-5.22.1/hints/irix_5.sh +--- perl-5.22.1.orig/hints/irix_5.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/irix_5.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -27,9 +27,9 @@ + esac + + lddlflags="-shared" +-# For some reason we don't want -lsocket -lnsl or -ldl. Can anyone ++# For some reason we don't want -lsocket or -ldl. Can anyone + # contribute an explanation? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + +diff -ru perl-5.22.1.orig/hints/irix_6_0.sh perl-5.22.1/hints/irix_6_0.sh +--- perl-5.22.1.orig/hints/irix_6_0.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/irix_6_0.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -19,7 +19,7 @@ + lddlflags="-32 -shared" + + # We don't want these libraries. Anyone know why? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + # +@@ -29,7 +29,7 @@ + # taken from irix_5.sh . Changes from irix_5.sh: + # Olimit and nested comments (warning 1009) no longer accepted + # -OPT:fold_arith_limit so POSIX module will optimize +-# no 64bit versions of sun, crypt, nsl, socket, dl dso's available ++# no 64bit versions of sun, crypt, socket, dl dso's available + # as of IRIX 6.0.1 so omit those from libswanted line via `sed'. + + # perl 5 built with this hints file passes most tests (`make test'). +@@ -38,7 +38,7 @@ + # i_time='define' + # ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -woff 1009 -OPT:fold_arith_limit=1046" + # lddlflags="-shared" +-# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` ++# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ dl / /'` + # shift + # libswanted="$*" + +diff -ru perl-5.22.1.orig/hints/irix_6_1.sh perl-5.22.1/hints/irix_6_1.sh +--- perl-5.22.1.orig/hints/irix_6_1.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/irix_6_1.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -19,7 +19,7 @@ + lddlflags="-32 -shared" + + # We don't want these libraries. Anyone know why? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + # +@@ -29,7 +29,7 @@ + # taken from irix_5.sh . Changes from irix_5.sh: + # Olimit and nested comments (warning 1009) no longer accepted + # -OPT:fold_arith_limit so POSIX module will optimize +-# no 64bit versions of sun, crypt, nsl, socket, dl dso's available ++# no 64bit versions of sun, crypt, socket, dl dso's available + # as of IRIX 6.0.1 so omit those from libswanted line via `sed'. + + # perl 5 built with this hints file passes most tests (`make test'). +@@ -38,7 +38,7 @@ + # i_time='define' + # ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -woff 1009 -OPT:fold_arith_limit=1046" + # lddlflags="-shared" +-# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` ++# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ dl / /'` + # shift + # libswanted="$*" + +diff -ru perl-5.22.1.orig/hints/irix_6.sh perl-5.22.1/hints/irix_6.sh +--- perl-5.22.1.orig/hints/irix_6.sh 2015-10-18 06:40:25.000000000 -0600 ++++ perl-5.22.1/hints/irix_6.sh 2019-08-21 09:12:01.273379909 -0600 +@@ -388,7 +388,7 @@ + # Socket networking is in libc, these are not installed by default, + # and just slow perl down. (scotth@sgi.com) + # librt contains nothing we need (some places need it for Time::HiRes) --jhi +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /' -e 's/ rt / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /' -e 's/ rt / /'` + shift + libswanted="$*" + +diff -ru perl-5.22.1.orig/hints/powerux.sh perl-5.22.1/hints/powerux.sh +--- perl-5.22.1.orig/hints/powerux.sh 2015-10-17 06:32:14.000000000 -0600 ++++ perl-5.22.1/hints/powerux.sh 2019-08-21 09:12:01.274379910 -0600 +@@ -27,11 +27,11 @@ + exit 2 + fi + +-# We DO NOT want -lmalloc or -lPW, we DO need -lgen to follow -lnsl, so ++# We DO NOT want -lmalloc or -lPW, we DO need -lgen to follow, so + # fixup libswanted to reflect that desire (also need -lresolv if you want + # DNS name lookup to work, which seems desirable :-). + # +-libswanted=`echo ' '$libswanted' ' | sed -e 's/ malloc / /' -e 's/ PW / /' -e 's/ nsl / nsl gen resolv /'` ++libswanted=`echo ' '$libswanted' ' | sed -e 's/ malloc / /' -e 's/ PW / /'` + + # We DO NOT want /usr/ucblib in glibpth + # +diff -ru perl-5.22.1.orig/INSTALL perl-5.22.1/INSTALL +--- perl-5.22.1.orig/INSTALL 2015-10-18 11:46:25.000000000 -0600 ++++ perl-5.22.1/INSTALL 2019-08-21 09:12:01.274379910 -0600 +@@ -1617,7 +1617,7 @@ + undefined symbols, check the libs variable in the config.sh file. It + should look something like + +- libs='-lsocket -lnsl -ldl -lm -lc' ++ libs='-lsocket -ldl -lm -lc' + + The exact libraries will vary from system to system, but you typically + need to include at least the math library -lm. Normally, Configure +diff -ru perl-5.22.1.orig/NetWare/config.wc perl-5.22.1/NetWare/config.wc +--- perl-5.22.1.orig/NetWare/config.wc 2015-10-17 06:38:37.000000000 -0600 ++++ perl-5.22.1/NetWare/config.wc 2019-08-21 09:12:01.274379910 -0600 +@@ -818,7 +818,7 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff -ru perl-5.22.1.orig/plan9/config_sh.sample perl-5.22.1/plan9/config_sh.sample +--- perl-5.22.1.orig/plan9/config_sh.sample 2015-10-18 11:39:19.000000000 -0600 ++++ perl-5.22.1/plan9/config_sh.sample 2019-08-21 09:12:01.274379910 -0600 +@@ -825,7 +825,7 @@ + libsfiles='' + libsfound='' + libspath=' /lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' + libswanted_uselargefiles='' + line='' + lint='' +diff -ru perl-5.22.1.orig/pod/perlrun.pod perl-5.22.1/pod/perlrun.pod +--- perl-5.22.1.orig/pod/perlrun.pod 2015-10-17 06:32:18.000000000 -0600 ++++ perl-5.22.1/pod/perlrun.pod 2019-08-21 09:12:01.274379910 -0600 +@@ -874,11 +874,11 @@ + $ perl -V:libc + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib. +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib.* + libpth='/usr/local/lib /lib /usr/lib'; +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + lib_ext='.a'; + libc='/lib/libc-2.2.4.so'; + libperl='libperl.a'; +diff -ru perl-5.22.1.orig/Porting/bisect-runner.pl perl-5.22.1/Porting/bisect-runner.pl +--- perl-5.22.1.orig/Porting/bisect-runner.pl 2015-10-17 06:38:37.000000000 -0600 ++++ perl-5.22.1/Porting/bisect-runner.pl 2019-08-21 09:12:01.275379910 -0600 +@@ -1269,7 +1269,7 @@ + my @libs; + # This is the current libswanted list from Configure, less the libs removed + # by current hints/linux.sh +- foreach my $lib (qw(sfio socket inet nsl nm ndbm gdbm dbm db malloc dl ++ foreach my $lib (qw(sfio socket inet nm ndbm gdbm dbm db malloc dl + ld sun m crypt sec util c cposix posix ucb BSD)) { + foreach my $dir (@paths) { + # Note the wonderful consistency of dot-or-not in the config vars: +diff -ru perl-5.22.1.orig/Porting/config.sh perl-5.22.1/Porting/config.sh +--- perl-5.22.1.orig/Porting/config.sh 2015-10-18 11:34:00.000000000 -0600 ++++ perl-5.22.1/Porting/config.sh 2019-08-21 09:12:19.908386879 -0600 +@@ -856,12 +856,12 @@ + libc='libc-2.18.so' + libperl='libperl.a' + libpth='/usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib' +-libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' ++libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so /usr/lib/libgdbm_compat.so' ++libsfiles=' libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' ++libsfound=' /usr/lib/libgdbm.so /usr/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so /usr/lib/libgdbm_compat.so' + libspath=' /usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib' +-libswanted='socket inet nsl nm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' ++libswanted='socket inet nm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' + libswanted_uselargefiles='' + line='' + lint='' +@@ -945,7 +945,7 @@ + perl_patchlevel='' + perl_static_inline='static __inline__' + perladmin='hmbrand@cpan.org' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/pro/bin/perl5.22.1' + pg='pg' + phostname='hostname' +diff -ru perl-5.22.1.orig/win32/config.ce perl-5.22.1/win32/config.ce +--- perl-5.22.1.orig/win32/config.ce 2015-10-17 06:38:38.000000000 -0600 ++++ perl-5.22.1/win32/config.ce 2019-08-21 09:12:01.275379910 -0600 +@@ -810,7 +810,7 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff -ru perl-5.22.1.orig/win32/config.gc perl-5.22.1/win32/config.gc +--- perl-5.22.1.orig/win32/config.gc 2015-10-17 06:38:38.000000000 -0600 ++++ perl-5.22.1/win32/config.gc 2019-08-21 09:12:01.275379910 -0600 +@@ -836,8 +836,8 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff -ru perl-5.22.1.orig/win32/config.vc perl-5.22.1/win32/config.vc +--- perl-5.22.1.orig/win32/config.vc 2015-10-17 06:38:38.000000000 -0600 ++++ perl-5.22.1/win32/config.vc 2019-08-21 09:12:01.275379910 -0600 +@@ -835,8 +835,8 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' diff --git a/omnibus/config/patches/perl/perl-5.30.0-remove_lnsl.patch b/omnibus/config/patches/perl/perl-5.30.0-remove_lnsl.patch new file mode 100644 index 000000000..48b63f567 --- /dev/null +++ b/omnibus/config/patches/perl/perl-5.30.0-remove_lnsl.patch @@ -0,0 +1,518 @@ +diff -ur perl-5.30.0.orig/Configure perl-5.30.0/Configure +--- perl-5.30.0.orig/Configure 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/Configure 2019-10-14 17:37:29.512567849 -0400 +@@ -1487,7 +1487,7 @@ + usereentrant='undef' + : List of libraries we want. + : If anyone needs extra -lxxx, put those in a hint file. +-libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld" ++libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld" + libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" + : We probably want to search /usr/shlib before most other libraries. + : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. +diff -ur perl-5.30.0.orig/configure.com perl-5.30.0/configure.com +--- perl-5.30.0.orig/configure.com 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/configure.com 2019-10-14 17:35:46.608063565 -0400 +@@ -117,7 +117,7 @@ + $!: machines, like the mips. Usually, it should be empty. !sfn + $!plibpth='' !sfn + $!: List of libraries we want. !sfn +-$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn ++$!libswanted='net socket inet nm ndbm gdbm dbm db malloc dl' !sfn + $!libswanted="$libswanted ld sun m c cposix posix ndir dir crypt" !sfn + $!libswanted="$libswanted ucb bsd BSD PW x" !sfn + $!: We probably want to search /usr/shlib before most other libraries. !sfn +Only in perl-5.30.0/: configure.com.orig +Only in perl-5.30.0/: Configure.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/20_plv56.t perl-5.30.0/cpan/Config-Perl-V/t/20_plv56.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/20_plv56.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/20_plv56.t 2019-10-14 17:35:46.612063373 -0400 +@@ -63,8 +63,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil +- perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil ++ libs=-lgdbm -ldb -ldl -lm -lc -lcrypt -lutil ++ perllibs=-ldl -lm -lc -lcrypt -lutil + libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' +Only in perl-5.30.0/cpan/Config-Perl-V/t: 20_plv56.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/21_plv58.t perl-5.30.0/cpan/Config-Perl-V/t/21_plv58.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/21_plv58.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/21_plv58.t 2019-10-14 17:35:46.612063373 -0400 +@@ -67,8 +67,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.11.2' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 21_plv58.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/22_plv510.t perl-5.30.0/cpan/Config-Perl-V/t/22_plv510.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/22_plv510.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/22_plv510.t 2019-10-14 17:35:46.612063373 -0400 +@@ -57,8 +57,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.6.1' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 22_plv510.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/23_plv512.t perl-5.30.0/cpan/Config-Perl-V/t/23_plv512.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/23_plv512.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/23_plv512.t 2019-10-14 17:35:46.612063373 -0400 +@@ -68,8 +68,8 @@ + Linker and Libraries: + ld='/usr/bin/ld', ldflags ='-L/pro/local/lib +DD64 -L/usr/lib/hpux64' + libpth=/pro/local/lib /usr/lib/hpux64 /lib /usr/lib /usr/ccs/lib /usr/local/lib +- libs=-lcl -lpthread -lnsl -lnm -ldb -ldl -ldld -lm -lsec -lc +- perllibs=-lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc ++ libs=-lcl -lpthread -lnm -ldb -ldl -ldld -lm -lsec -lc ++ perllibs=-lcl -lpthread -lnm -ldl -ldld -lm -lsec -lc + libc=/usr/lib/hpux64/libc.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 23_plv512.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/24_plv514.t perl-5.30.0/cpan/Config-Perl-V/t/24_plv514.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/24_plv514.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/24_plv514.t 2019-10-14 17:35:46.612063373 -0400 +@@ -69,8 +69,8 @@ + Linker and Libraries: + ld='ld', ldflags ='-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64' + libpth=/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs/lib /usr/local/lib /usr/lib64 +- libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc +- perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc ++ libs=-lbind -ldbm -ldb -ldl -lld -lm -lcrypt -lc ++ perllibs=-lbind -ldl -lld -lm -lcrypt -lc + libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 24_plv514.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/25_plv516.t perl-5.30.0/cpan/Config-Perl-V/t/25_plv516.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/25_plv516.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/25_plv516.t 2019-10-14 17:35:46.612063373 -0400 +@@ -69,8 +69,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.15' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 25_plv516.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/26_plv5182.t perl-5.30.0/cpan/Config-Perl-V/t/26_plv5182.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/26_plv5182.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/26_plv5182.t 2019-10-14 17:35:46.612063373 -0400 +@@ -94,8 +94,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 26_plv5182.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/26_plv518.t perl-5.30.0/cpan/Config-Perl-V/t/26_plv518.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/26_plv518.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/26_plv518.t 2019-10-14 17:35:46.616063181 -0400 +@@ -94,8 +94,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.17' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 26_plv518.t.orig +diff -ur perl-5.30.0.orig/cpan/Config-Perl-V/t/27_plv5200.t perl-5.30.0/cpan/Config-Perl-V/t/27_plv5200.t +--- perl-5.30.0.orig/cpan/Config-Perl-V/t/27_plv5200.t 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/cpan/Config-Perl-V/t/27_plv5200.t 2019-10-14 17:35:46.620062988 -0400 +@@ -96,8 +96,8 @@ + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +Only in perl-5.30.0/cpan/Config-Perl-V/t: 27_plv5200.t.orig +diff -ur perl-5.30.0.orig/Cross/config.sh-arm-linux perl-5.30.0/Cross/config.sh-arm-linux +--- perl-5.30.0.orig/Cross/config.sh-arm-linux 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/Cross/config.sh-arm-linux 2019-10-14 17:35:46.620062988 -0400 +@@ -866,12 +866,12 @@ + libc='/lib/libc-2.2.2.so' + libperl='libperl.so' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -959,7 +959,7 @@ + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff -ur perl-5.30.0.orig/Cross/config.sh-arm-linux-n770 perl-5.30.0/Cross/config.sh-arm-linux-n770 +--- perl-5.30.0.orig/Cross/config.sh-arm-linux-n770 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/Cross/config.sh-arm-linux-n770 2019-10-14 17:35:46.620062988 -0400 +@@ -864,12 +864,12 @@ + libc='/lib/libc-2.2.2.so' + libperl='libperl.arma' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -957,7 +957,7 @@ + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +Only in perl-5.30.0/Cross: config.sh-arm-linux-n770.orig +Only in perl-5.30.0/Cross: config.sh-arm-linux.orig +diff -ur perl-5.30.0.orig/hints/aix_4.sh perl-5.30.0/hints/aix_4.sh +--- perl-5.30.0.orig/hints/aix_4.sh 2018-06-27 07:17:56.000000000 -0400 ++++ perl-5.30.0/hints/aix_4.sh 2019-10-14 17:35:46.620062988 -0400 +@@ -583,7 +583,7 @@ + + *** + *** You seem to be compiling in AIX for the OS/400 PASE environment. +-*** I'm not going to use the AIX bind, nsl, and possible util libraries, then. ++*** I'm not going to use the AIX bind, and possible util libraries, then. + *** I'm also not going to install perl as /usr/bin/perl. + *** Perl will be installed under $prefix. + *** For instructions how to install this build from AIX to PASE, +@@ -591,7 +591,7 @@ + *** about "Operating system name". + *** + EOF +- set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` ++ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ util @ @'` + shift + libswanted="$*" + installusrbinperl="$undef" +diff -ur perl-5.30.0.orig/hints/aix.sh perl-5.30.0/hints/aix.sh +--- perl-5.30.0.orig/hints/aix.sh 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/hints/aix.sh 2019-10-14 17:35:46.620062988 -0400 +@@ -504,7 +504,7 @@ + + *** + *** You seem to be compiling in AIX for the OS/400 PASE environment. +-*** I'm not going to use the AIX bind, nsl, and possible util libraries, then. ++*** I'm not going to use the AIX bind, and possible util libraries, then. + *** I'm also not going to install perl as /usr/bin/perl. + *** Perl will be installed under $prefix. + *** For instructions how to install this build from AIX to PASE, +@@ -512,7 +512,7 @@ + *** about "Operating system name". + *** + EOF +- set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ nsl @ @' -e 's@ util @ @'` ++ set `echo " $libswanted " | sed -e 's@ bind @ @' -e 's@ util @ @'` + shift + libswanted="$*" + installusrbinperl="$undef" +diff -ur perl-5.30.0.orig/hints/epix.sh perl-5.30.0/hints/epix.sh +--- perl-5.30.0.orig/hints/epix.sh 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/hints/epix.sh 2019-10-14 17:35:46.620062988 -0400 +@@ -37,7 +37,7 @@ + # Old version had this, but I'm not sure why since the old version + # also mucked around with libswanted. This is also definitely wrong + # if the user is trying to use DB_File or GDBM_File. +-# libs='-lsocket -lnsl -ldbm -ldl -lc -lcrypt -lm -lucb' ++# libs='-lsocket -ldbm -ldl -lc -lcrypt -lm -lucb' + + # We include support for using libraries in /usr/ucblib, but the setting + # of libswanted excludes some libraries found there. You may want to +diff -ur perl-5.30.0.orig/hints/gnu.sh perl-5.30.0/hints/gnu.sh +--- perl-5.30.0.orig/hints/gnu.sh 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/hints/gnu.sh 2019-10-14 17:35:46.620062988 -0400 +@@ -3,7 +3,7 @@ + + # libnsl is unusable on the Hurd. + # XXX remove this once SUNRPC is implemented. +-set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ nsl / /' -e 's/ c / pthread /'` ++set `echo X "$libswanted "| sed -e 's/ bsd / /' -e 's/ c / pthread /'` + shift + libswanted="$*" + +Only in perl-5.30.0/hints: gnu.sh.orig +diff -ur perl-5.30.0.orig/hints/irix_5.sh perl-5.30.0/hints/irix_5.sh +--- perl-5.30.0.orig/hints/irix_5.sh 2018-06-27 07:17:56.000000000 -0400 ++++ perl-5.30.0/hints/irix_5.sh 2019-10-14 17:35:46.624062797 -0400 +@@ -27,9 +27,9 @@ + esac + + lddlflags="-shared" +-# For some reason we don't want -lsocket -lnsl or -ldl. Can anyone ++# For some reason we don't want -lsocket or -ldl. Can anyone + # contribute an explanation? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + +diff -ur perl-5.30.0.orig/hints/irix_6_0.sh perl-5.30.0/hints/irix_6_0.sh +--- perl-5.30.0.orig/hints/irix_6_0.sh 2018-06-27 07:17:56.000000000 -0400 ++++ perl-5.30.0/hints/irix_6_0.sh 2019-10-14 17:35:46.624062797 -0400 +@@ -19,7 +19,7 @@ + lddlflags="-32 -shared" + + # We don't want these libraries. Anyone know why? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + # +@@ -29,7 +29,7 @@ + # taken from irix_5.sh . Changes from irix_5.sh: + # Olimit and nested comments (warning 1009) no longer accepted + # -OPT:fold_arith_limit so POSIX module will optimize +-# no 64bit versions of sun, crypt, nsl, socket, dl dso's available ++# no 64bit versions of sun, crypt, socket, dl dso's available + # as of IRIX 6.0.1 so omit those from libswanted line via `sed'. + + # perl 5 built with this hints file passes most tests (`make test'). +@@ -38,7 +38,7 @@ + # i_time='define' + # ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -woff 1009 -OPT:fold_arith_limit=1046" + # lddlflags="-shared" +-# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` ++# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ dl / /'` + # shift + # libswanted="$*" + +diff -ur perl-5.30.0.orig/hints/irix_6_1.sh perl-5.30.0/hints/irix_6_1.sh +--- perl-5.30.0.orig/hints/irix_6_1.sh 2018-06-27 07:17:56.000000000 -0400 ++++ perl-5.30.0/hints/irix_6_1.sh 2019-10-14 17:35:46.624062797 -0400 +@@ -19,7 +19,7 @@ + lddlflags="-32 -shared" + + # We don't want these libraries. Anyone know why? +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /'` + shift + libswanted="$*" + # +@@ -29,7 +29,7 @@ + # taken from irix_5.sh . Changes from irix_5.sh: + # Olimit and nested comments (warning 1009) no longer accepted + # -OPT:fold_arith_limit so POSIX module will optimize +-# no 64bit versions of sun, crypt, nsl, socket, dl dso's available ++# no 64bit versions of sun, crypt, socket, dl dso's available + # as of IRIX 6.0.1 so omit those from libswanted line via `sed'. + + # perl 5 built with this hints file passes most tests (`make test'). +@@ -38,7 +38,7 @@ + # i_time='define' + # ccflags="$ccflags -D_POSIX_SOURCE -ansiposix -D_BSD_TYPES -woff 1009 -OPT:fold_arith_limit=1046" + # lddlflags="-shared" +-# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ nsl / /' -e 's/ dl / /'` ++# set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ sun / /' -e 's/ crypt / /' -e 's/ dl / /'` + # shift + # libswanted="$*" + +diff -ur perl-5.30.0.orig/hints/irix_6.sh perl-5.30.0/hints/irix_6.sh +--- perl-5.30.0.orig/hints/irix_6.sh 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/hints/irix_6.sh 2019-10-14 17:35:46.624062797 -0400 +@@ -388,7 +388,7 @@ + # Socket networking is in libc, these are not installed by default, + # and just slow perl down. (scotth@sgi.com) + # librt contains nothing we need (some places need it for Time::HiRes) --jhi +-set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ nsl / /' -e 's/ dl / /' -e 's/ rt / /'` ++set `echo X "$libswanted "|sed -e 's/ socket / /' -e 's/ dl / /' -e 's/ rt / /'` + shift + libswanted="$*" + +diff -ur perl-5.30.0.orig/INSTALL perl-5.30.0/INSTALL +--- perl-5.30.0.orig/INSTALL 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/INSTALL 2019-10-14 17:36:13.034898813 -0400 +@@ -1623,7 +1623,7 @@ + undefined symbols, check the libs variable in the config.sh file. It + should look something like + +- libs='-lsocket -lnsl -ldl -lm -lc' ++ libs='-lsocket -ldl -lm -lc' + + The exact libraries will vary from system to system, but you typically + need to include at least the math library -lm. Normally, Configure +Only in perl-5.30.0/: INSTALL.orig +diff -ur perl-5.30.0.orig/NetWare/config.wc perl-5.30.0/NetWare/config.wc +--- perl-5.30.0.orig/NetWare/config.wc 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/NetWare/config.wc 2019-10-14 17:36:13.034898813 -0400 +@@ -846,7 +846,7 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +Only in perl-5.30.0/NetWare: config.wc.orig +diff -ur perl-5.30.0.orig/plan9/config_sh.sample perl-5.30.0/plan9/config_sh.sample +--- perl-5.30.0.orig/plan9/config_sh.sample 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/plan9/config_sh.sample 2019-10-14 17:36:13.038898652 -0400 +@@ -853,7 +853,7 @@ + libsfiles='' + libsfound='' + libspath=' /lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' + libswanted_uselargefiles='' + line='' + lint='' +Only in perl-5.30.0/plan9: config_sh.sample.orig +diff -ur perl-5.30.0.orig/pod/perlrun.pod perl-5.30.0/pod/perlrun.pod +--- perl-5.30.0.orig/pod/perlrun.pod 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/pod/perlrun.pod 2019-10-14 17:36:13.038898652 -0400 +@@ -887,11 +887,11 @@ + $ perl -V:libc + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib. +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib.* + libpth='/usr/local/lib /lib /usr/lib'; +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + lib_ext='.a'; + libc='/lib/libc-2.2.4.so'; + libperl='libperl.a'; +Only in perl-5.30.0/pod: perlrun.pod.orig +diff -ur perl-5.30.0.orig/Porting/bisect-runner.pl perl-5.30.0/Porting/bisect-runner.pl +--- perl-5.30.0.orig/Porting/bisect-runner.pl 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/Porting/bisect-runner.pl 2019-10-14 17:36:13.038898652 -0400 +@@ -1384,7 +1384,7 @@ + my @libs; + # This is the current libswanted list from Configure, less the libs removed + # by current hints/linux.sh +- foreach my $lib (qw(sfio socket inet nsl nm ndbm gdbm dbm db malloc dl ++ foreach my $lib (qw(sfio socket inet nm ndbm gdbm dbm db malloc dl + ld sun m crypt sec util c cposix posix ucb BSD)) { + foreach my $dir (@paths) { + # Note the wonderful consistency of dot-or-not in the config vars: +Only in perl-5.30.0/Porting: bisect-runner.pl.orig +diff -ur perl-5.30.0.orig/Porting/config.sh perl-5.30.0/Porting/config.sh +--- perl-5.30.0.orig/Porting/config.sh 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/Porting/config.sh 2019-10-14 17:38:20.815713492 -0400 +@@ -891,12 +891,12 @@ + libc='libc-2.19.so' + libperl='libperl.a' + libpth='/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib' +-libs='-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' ++libs='-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' + libsdirs=' /usr/lib/x86_64-linux-gnu' +-libsfiles=' libpthread.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' +-libsfound=' /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libnsl.so /usr/lib/x86_64-linux-gnu/libgdbm.so /usr/lib/x86_64-linux-gnu/libdb.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libcrypt.so /usr/lib/x86_64-linux-gnu/libutil.so /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libgdbm_compat.so' ++libsfiles=' libpthread.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' ++libsfound=' /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libgdbm.so /usr/lib/x86_64-linux-gnu/libdb.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libcrypt.so /usr/lib/x86_64-linux-gnu/libutil.so /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libgdbm_compat.so' + libspath=' /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib' +-libswanted='cl pthread cl pthread socket inet nsl gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' ++libswanted='cl pthread cl pthread socket inet gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' + libswanted_uselargefiles='' + line='' + lint='' +@@ -983,7 +983,7 @@ + perl_patchlevel='' + perl_static_inline='static __inline__' + perladmin='yourname@yourhost.yourplace.com' +-perllibs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-lpthread -ldl -lm -lcrypt -lutil -lc' + perlpath='/opt/perl/bin/perl5.30.0' + pg='pg' + phostname='' +Only in perl-5.30.0/Porting: config.sh.orig +diff -ur perl-5.30.0.orig/win32/config.ce perl-5.30.0/win32/config.ce +--- perl-5.30.0.orig/win32/config.ce 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/win32/config.ce 2019-10-14 17:36:13.090896568 -0400 +@@ -839,7 +839,7 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +Only in perl-5.30.0/win32: config.ce.orig +diff -ur perl-5.30.0.orig/win32/config.gc perl-5.30.0/win32/config.gc +--- perl-5.30.0.orig/win32/config.gc 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/win32/config.gc 2019-10-14 17:36:13.090896568 -0400 +@@ -865,8 +865,8 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +Only in perl-5.30.0/win32: config.gc.orig +diff -ur perl-5.30.0.orig/win32/config.vc perl-5.30.0/win32/config.vc +--- perl-5.30.0.orig/win32/config.vc 2019-05-11 05:50:20.000000000 -0400 ++++ perl-5.30.0/win32/config.vc 2019-10-14 17:36:13.094896407 -0400 +@@ -864,8 +864,8 @@ + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +Only in perl-5.30.0/win32: config.vc.orig diff --git a/omnibus/config/patches/perl/perl-5.32.1-remove_lnsl.patch b/omnibus/config/patches/perl/perl-5.32.1-remove_lnsl.patch new file mode 100644 index 000000000..fdc63aa0b --- /dev/null +++ b/omnibus/config/patches/perl/perl-5.32.1-remove_lnsl.patch @@ -0,0 +1,456 @@ +diff --git a/Configure b/Configure +index fbc2258..14d9eba 100755 +--- a/Configure ++++ b/Configure +@@ -1491,7 +1491,7 @@ archname='' + usereentrant='undef' + : List of libraries we want. + : If anyone needs extra -lxxx, put those in a hint file. +-libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld" ++libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld" + libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" + : We probably want to search /usr/shlib before most other libraries. + : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. +diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux +index d97a698..0eec85e 100644 +--- a/Cross/config.sh-arm-linux ++++ b/Cross/config.sh-arm-linux +@@ -869,12 +869,12 @@ lib_ext='.a' + libc='/lib/libc-2.2.2.so' + libperl='libperl.so' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -962,7 +962,7 @@ perl='' + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770 +index 3ad709f..b3752bb 100644 +--- a/Cross/config.sh-arm-linux-n770 ++++ b/Cross/config.sh-arm-linux-n770 +@@ -867,12 +867,12 @@ lib_ext='.arma' + libc='/lib/libc-2.2.2.so' + libperl='libperl.arma' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -960,7 +960,7 @@ perl='' + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff --git a/INSTALL b/INSTALL +index 76edeec..6a039a2 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -1629,7 +1629,7 @@ If the build of miniperl fails with a long list of missing functions or + undefined symbols, check the libs variable in the config.sh file. It + should look something like + +- libs='-lsocket -lnsl -ldl -lm -lc' ++ libs='-lsocket -ldl -lm -lc' + + The exact libraries will vary from system to system, but you typically + need to include at least the math library -lm. Normally, Configure +diff --git a/NetWare/config.wc b/NetWare/config.wc +index b0a02f5..f699a65 100644 +--- a/NetWare/config.wc ++++ b/NetWare/config.wc +@@ -849,7 +849,7 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl +index b6c75a9..33de0c0 100755 +--- a/Porting/bisect-runner.pl ++++ b/Porting/bisect-runner.pl +@@ -1550,7 +1550,7 @@ unless (extract_from_file('Configure', 'ignore_versioned_solibs')) { + my @libs; + # This is the current libswanted list from Configure, less the libs removed + # by current hints/linux.sh +- foreach my $lib (qw(sfio socket inet nsl nm ndbm gdbm dbm db malloc dl ++ foreach my $lib (qw(sfio socket inet nm ndbm gdbm dbm db malloc dl + ld sun m crypt sec util c cposix posix ucb BSD)) { + foreach my $dir (@paths) { + # Note the wonderful consistency of dot-or-not in the config vars: +diff --git a/Porting/config.sh b/Porting/config.sh +index 2d2287c..c8fab58 100644 +--- a/Porting/config.sh ++++ b/Porting/config.sh +@@ -894,12 +894,12 @@ lib_ext='.a' + libc='libc-2.19.so' + libperl='libperl.a' + libpth='/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib' +-libs='-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' ++libs='-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' + libsdirs=' /usr/lib/x86_64-linux-gnu' +-libsfiles=' libpthread.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' +-libsfound=' /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libnsl.so /usr/lib/x86_64-linux-gnu/libgdbm.so /usr/lib/x86_64-linux-gnu/libdb.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libcrypt.so /usr/lib/x86_64-linux-gnu/libutil.so /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libgdbm_compat.so' ++libsfiles=' libpthread.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' ++libsfound=' /usr/lib/x86_64-linux-gnu/libpthread.so /usr/lib/x86_64-linux-gnu/libgdbm.so /usr/lib/x86_64-linux-gnu/libdb.so /usr/lib/x86_64-linux-gnu/libdl.so /usr/lib/x86_64-linux-gnu/libm.so /usr/lib/x86_64-linux-gnu/libcrypt.so /usr/lib/x86_64-linux-gnu/libutil.so /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libgdbm_compat.so' + libspath=' /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.9/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib' +-libswanted='cl pthread cl pthread socket inet nsl gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' ++libswanted='cl pthread cl pthread socket inet gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' + libswanted_uselargefiles='' + line='' + lint='' +@@ -986,7 +986,7 @@ perl='perl' + perl_patchlevel='' + perl_static_inline='static __inline__' + perladmin='yourname@yourhost.yourplace.com' +-perllibs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-lpthread -ldl -lm -lcrypt -lutil -lc' + perlpath='/opt/perl/bin/perl5.32.1' + pg='pg' + phostname='' +diff --git a/configure.com b/configure.com +index 713e875..6273d5d 100644 +--- a/configure.com ++++ b/configure.com +@@ -117,7 +117,7 @@ $!: is prepended to libpth. This variable takes care of special !sfn + $!: machines, like the mips. Usually, it should be empty. !sfn + $!plibpth='' !sfn + $!: List of libraries we want. !sfn +-$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn ++$!libswanted='net socket inet nm ndbm gdbm dbm db malloc dl' !sfn + $!libswanted="$libswanted ld sun m c cposix posix ndir dir crypt" !sfn + $!libswanted="$libswanted ucb bsd BSD PW x" !sfn + $!: We probably want to search /usr/shlib before most other libraries. !sfn +diff --git a/cpan/Config-Perl-V/t/20_plv56.t b/cpan/Config-Perl-V/t/20_plv56.t +index 252a162..5004c9a 100644 +--- a/cpan/Config-Perl-V/t/20_plv56.t ++++ b/cpan/Config-Perl-V/t/20_plv56.t +@@ -63,8 +63,8 @@ Summary of my perl5 (revision 5.0 version 6 subversion 2) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil +- perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil ++ libs=-lgdbm -ldb -ldl -lm -lc -lcrypt -lutil ++ perllibs=-ldl -lm -lc -lcrypt -lutil + libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' +diff --git a/cpan/Config-Perl-V/t/21_plv58.t b/cpan/Config-Perl-V/t/21_plv58.t +index b354e24..d747355 100644 +--- a/cpan/Config-Perl-V/t/21_plv58.t ++++ b/cpan/Config-Perl-V/t/21_plv58.t +@@ -67,8 +67,8 @@ Summary of my perl5 (revision 5 version 8 subversion 9) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.11.2' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/22_plv510.t b/cpan/Config-Perl-V/t/22_plv510.t +index bec688c..4641d12 100644 +--- a/cpan/Config-Perl-V/t/22_plv510.t ++++ b/cpan/Config-Perl-V/t/22_plv510.t +@@ -57,8 +57,8 @@ Summary of my perl5 (revision 5 version 10 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.6.1' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/23_plv512.t b/cpan/Config-Perl-V/t/23_plv512.t +index 03c69cb..47d7f97 100644 +--- a/cpan/Config-Perl-V/t/23_plv512.t ++++ b/cpan/Config-Perl-V/t/23_plv512.t +@@ -68,8 +68,8 @@ Summary of my perl5 (revision 5 version 12 subversion 2) configuration: + Linker and Libraries: + ld='/usr/bin/ld', ldflags ='-L/pro/local/lib +DD64 -L/usr/lib/hpux64' + libpth=/pro/local/lib /usr/lib/hpux64 /lib /usr/lib /usr/ccs/lib /usr/local/lib +- libs=-lcl -lpthread -lnsl -lnm -ldb -ldl -ldld -lm -lsec -lc +- perllibs=-lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc ++ libs=-lcl -lpthread -lnm -ldb -ldl -ldld -lm -lsec -lc ++ perllibs=-lcl -lpthread -lnm -ldl -ldld -lm -lsec -lc + libc=/usr/lib/hpux64/libc.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/24_plv514.t b/cpan/Config-Perl-V/t/24_plv514.t +index 3377b41..fdd8046 100644 +--- a/cpan/Config-Perl-V/t/24_plv514.t ++++ b/cpan/Config-Perl-V/t/24_plv514.t +@@ -69,8 +69,8 @@ Summary of my perl5 (revision 5 version 14 subversion 2) configuration: + Linker and Libraries: + ld='ld', ldflags ='-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64' + libpth=/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs/lib /usr/local/lib /usr/lib64 +- libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc +- perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc ++ libs=-lbind -ldbm -ldb -ldl -lld -lm -lcrypt -lc ++ perllibs=-lbind -ldl -lld -lm -lcrypt -lc + libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/25_plv516.t b/cpan/Config-Perl-V/t/25_plv516.t +index 5505245..5bad2ce 100644 +--- a/cpan/Config-Perl-V/t/25_plv516.t ++++ b/cpan/Config-Perl-V/t/25_plv516.t +@@ -69,8 +69,8 @@ Summary of my perl5 (revision 5 version 16 subversion 3) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.15' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/26_plv518.t b/cpan/Config-Perl-V/t/26_plv518.t +index a255797..d3ab0b6 100644 +--- a/cpan/Config-Perl-V/t/26_plv518.t ++++ b/cpan/Config-Perl-V/t/26_plv518.t +@@ -94,8 +94,8 @@ Summary of my perl5 (revision 5 version 18 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.17' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/26_plv5182.t b/cpan/Config-Perl-V/t/26_plv5182.t +index 25e52bb..fc24cd1 100644 +--- a/cpan/Config-Perl-V/t/26_plv5182.t ++++ b/cpan/Config-Perl-V/t/26_plv5182.t +@@ -94,8 +94,8 @@ Summary of my perl5 (revision 5 version 18 subversion 2) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/27_plv5200.t b/cpan/Config-Perl-V/t/27_plv5200.t +index f44273d..ca84b18 100644 +--- a/cpan/Config-Perl-V/t/27_plv5200.t ++++ b/cpan/Config-Perl-V/t/27_plv5200.t +@@ -96,8 +96,8 @@ Summary of my perl5 (revision 5 version 20 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/27_plv5202.t b/cpan/Config-Perl-V/t/27_plv5202.t +index 83c3cb0..13b58a2 100644 +--- a/cpan/Config-Perl-V/t/27_plv5202.t ++++ b/cpan/Config-Perl-V/t/27_plv5202.t +@@ -97,8 +97,8 @@ Summary of my perl5 (revision 5 version 20 subversion 2) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.19' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/28_plv5220.t b/cpan/Config-Perl-V/t/28_plv5220.t +index 885445b..26506c3 100644 +--- a/cpan/Config-Perl-V/t/28_plv5220.t ++++ b/cpan/Config-Perl-V/t/28_plv5220.t +@@ -97,8 +97,8 @@ Summary of my perl5 (revision 5 version 22 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.19' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/30_plv5240.t b/cpan/Config-Perl-V/t/30_plv5240.t +index 2d6c0fd..c4a8e13 100644 +--- a/cpan/Config-Perl-V/t/30_plv5240.t ++++ b/cpan/Config-Perl-V/t/30_plv5240.t +@@ -102,8 +102,8 @@ Summary of my perl5 (revision 5 version 24 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/5/include-fixed /usr/lib64/gcc/x86_64-suse-linux/5/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.23.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.23' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/31_plv52511.t b/cpan/Config-Perl-V/t/31_plv52511.t +index a5b39ca..bcceca7 100644 +--- a/cpan/Config-Perl-V/t/31_plv52511.t ++++ b/cpan/Config-Perl-V/t/31_plv52511.t +@@ -131,8 +131,8 @@ Summary of my perl5 (revision 5 version 25 subversion 11) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/6/include-fixed /usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.24.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/32_plv5261rc1.t b/cpan/Config-Perl-V/t/32_plv5261rc1.t +index 9db16b2..57b1e11 100644 +--- a/cpan/Config-Perl-V/t/32_plv5261rc1.t ++++ b/cpan/Config-Perl-V/t/32_plv5261rc1.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 26 subversion 1) configuration: + ld='ccache cc' + ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.19.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/33_plv52711r.t b/cpan/Config-Perl-V/t/33_plv52711r.t +index c6940d2..d7f2147 100644 +--- a/cpan/Config-Perl-V/t/33_plv52711r.t ++++ b/cpan/Config-Perl-V/t/33_plv52711r.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 27 subversion 11) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/7/include-fixed /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.27.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/34_plv5280.t b/cpan/Config-Perl-V/t/34_plv5280.t +index f6c38df..47a1e0e 100644 +--- a/cpan/Config-Perl-V/t/34_plv5280.t ++++ b/cpan/Config-Perl-V/t/34_plv5280.t +@@ -129,8 +129,8 @@ Summary of my perl5 (revision 5 version 28 subversion 0) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.27.so + so=so + useshrplib=false +diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample +index cd494c4..cf0d41b 100644 +--- a/plan9/config_sh.sample ++++ b/plan9/config_sh.sample +@@ -856,7 +856,7 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath=' /lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' + libswanted_uselargefiles='' + line='' + lint='' +diff --git a/pod/perlrun.pod b/pod/perlrun.pod +index 89a7aa8..f92a2a5 100644 +--- a/pod/perlrun.pod ++++ b/pod/perlrun.pod +@@ -895,11 +895,11 @@ non-letters). For example: + $ perl -V:libc + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib. +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib.* + libpth='/usr/local/lib /lib /usr/lib'; +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + lib_ext='.a'; + libc='/lib/libc-2.2.4.so'; + libperl='libperl.a'; +diff --git a/win32/config.gc b/win32/config.gc +index 793b455..bb6ea3f 100644 +--- a/win32/config.gc ++++ b/win32/config.gc +@@ -868,8 +868,8 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff --git a/win32/config.vc b/win32/config.vc +index a2c3f5a..f223095 100644 +--- a/win32/config.vc ++++ b/win32/config.vc +@@ -867,8 +867,8 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' diff --git a/omnibus/config/patches/perl/perl-5.34.0-remove_lnsl.patch b/omnibus/config/patches/perl/perl-5.34.0-remove_lnsl.patch new file mode 100644 index 000000000..c8e2e81c3 --- /dev/null +++ b/omnibus/config/patches/perl/perl-5.34.0-remove_lnsl.patch @@ -0,0 +1,516 @@ +diff --git a/Configure b/Configure +index 913e080..a015175 100755 +--- a/Configure ++++ b/Configure +@@ -1493,7 +1493,7 @@ archname='' + usereentrant='undef' + : List of libraries we want. + : If anyone needs extra -lxxx, put those in a hint file. +-libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld" ++libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld" + libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" + : We probably want to search /usr/shlib before most other libraries. + : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. +diff --git a/Cross/config.sh-arm-linux b/Cross/config.sh-arm-linux +index 33bab37..910e834 100644 +--- a/Cross/config.sh-arm-linux ++++ b/Cross/config.sh-arm-linux +@@ -870,12 +870,12 @@ lib_ext='.a' + libc='/lib/libc-2.2.2.so' + libperl='libperl.so' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -963,7 +963,7 @@ perl='' + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff --git a/Cross/config.sh-arm-linux-n770 b/Cross/config.sh-arm-linux-n770 +index 73567fb..08288ce 100644 +--- a/Cross/config.sh-arm-linux-n770 ++++ b/Cross/config.sh-arm-linux-n770 +@@ -868,12 +868,12 @@ lib_ext='.arma' + libc='/lib/libc-2.2.2.so' + libperl='libperl.arma' + libpth='/usr/local/lib /lib /usr/lib' +-libs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++libs='-ldl -lm -lcrypt -lutil -lc' + libsdirs=' /usr/lib' +-libsfiles=' libnsl.so libdl.so libm.so libcrypt.so libutil.so libc.so' +-libsfound=' /usr/lib/libnsl.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' ++libsfiles=' libdl.so libm.so libcrypt.so libutil.so libc.so' ++libsfound=' /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libcrypt.so /usr/lib/libutil.so /usr/lib/libc.so' + libspath=' /usr/local/lib /lib /usr/lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD' + libswanted_uselargefiles='' + line='' + lint='' +@@ -961,7 +961,7 @@ perl='' + perl_patchlevel='' + perl_static_inline='static' + perladmin='red@criticalintegration.com' +-perllibs='-lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-ldl -lm -lcrypt -lutil -lc' + perlpath='/usr/bin/perl' + pg='pg' + phostname='hostname' +diff --git a/INSTALL b/INSTALL +index ce5ad45..da89b58 100644 +--- a/INSTALL ++++ b/INSTALL +@@ -1653,7 +1653,7 @@ If the build of miniperl fails with a long list of missing functions or + undefined symbols, check the libs variable in the config.sh file. It + should look something like + +- libs='-lsocket -lnsl -ldl -lm -lc' ++ libs='-lsocket -ldl -lm -lc' + + The exact libraries will vary from system to system, but you typically + need to include at least the math library -lm. Normally, Configure +diff --git a/NetWare/config.wc b/NetWare/config.wc +index 26c1755..5fd4985 100644 +--- a/NetWare/config.wc ++++ b/NetWare/config.wc +@@ -850,7 +850,7 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff --git a/Porting/bisect-runner.pl b/Porting/bisect-runner.pl +index b6c75a9..33de0c0 100755 +--- a/Porting/bisect-runner.pl ++++ b/Porting/bisect-runner.pl +@@ -1550,7 +1550,7 @@ unless (extract_from_file('Configure', 'ignore_versioned_solibs')) { + my @libs; + # This is the current libswanted list from Configure, less the libs removed + # by current hints/linux.sh +- foreach my $lib (qw(sfio socket inet nsl nm ndbm gdbm dbm db malloc dl ++ foreach my $lib (qw(sfio socket inet nm ndbm gdbm dbm db malloc dl + ld sun m crypt sec util c cposix posix ucb BSD)) { + foreach my $dir (@paths) { + # Note the wonderful consistency of dot-or-not in the config vars: +diff --git a/Porting/config.sh b/Porting/config.sh +index d1f54f2..f126291 100644 +--- a/Porting/config.sh ++++ b/Porting/config.sh +@@ -900,12 +900,12 @@ lib_ext='.a' + libc='libc-2.31.so' + libperl='libperl.a' + libpth='/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/10/include-fixed /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64' +-libs='-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' ++libs='-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat' + libsdirs=' /usr/lib/../lib64' +-libsfiles=' libpthread.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' +-libsfound=' /usr/lib/../lib64/libpthread.so /usr/lib/../lib64/libnsl.so /usr/lib/../lib64/libgdbm.so /usr/lib/../lib64/libdb.so /usr/lib/../lib64/libdl.so /usr/lib/../lib64/libm.so /usr/lib/../lib64/libcrypt.so /usr/lib/../lib64/libutil.so /usr/lib/../lib64/libc.so /usr/lib/../lib64/libgdbm_compat.so' ++libsfiles=' libpthread.so libgdbm.so libdb.so libdl.so libm.so libcrypt.so libutil.so libc.so libgdbm_compat.so' ++libsfound=' /usr/lib/../lib64/libpthread.so /usr/lib/../lib64/libgdbm.so /usr/lib/../lib64/libdb.so /usr/lib/../lib64/libdl.so /usr/lib/../lib64/libm.so /usr/lib/../lib64/libcrypt.so /usr/lib/../lib64/libutil.so /usr/lib/../lib64/libc.so /usr/lib/../lib64/libgdbm_compat.so' + libspath=' /usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/10/include-fixed /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/lib /usr/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64' +-libswanted='cl pthread cl pthread socket inet nsl gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' ++libswanted='cl pthread cl pthread socket inet gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb BSD gdbm_compat' + libswanted_uselargefiles='' + line='' + lint='' +@@ -992,7 +992,7 @@ perl='perl' + perl_patchlevel='' + perl_static_inline='static __inline__' + perladmin='yourname@yourhost.yourplace.com' +-perllibs='-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc' ++perllibs='-lpthread -ldl -lm -lcrypt -lutil -lc' + perlpath='/opt/perl/bin/perl5.34.0' + pg='pg' + phostname='' +diff --git a/configure.com b/configure.com +index df29582..0171264 100644 +--- a/configure.com ++++ b/configure.com +@@ -117,7 +117,7 @@ $!: is prepended to libpth. This variable takes care of special !sfn + $!: machines, like the mips. Usually, it should be empty. !sfn + $!plibpth='' !sfn + $!: List of libraries we want. !sfn +-$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn ++$!libswanted='net socket inet nm ndbm gdbm dbm db malloc dl' !sfn + $!libswanted="$libswanted ld sun m c cposix posix ndir dir crypt" !sfn + $!libswanted="$libswanted ucb bsd BSD PW x" !sfn + $!: We probably want to search /usr/shlib before most other libraries. !sfn +diff --git a/cpan/Config-Perl-V/t/20_plv56.t b/cpan/Config-Perl-V/t/20_plv56.t +index 252a162..5004c9a 100644 +--- a/cpan/Config-Perl-V/t/20_plv56.t ++++ b/cpan/Config-Perl-V/t/20_plv56.t +@@ -63,8 +63,8 @@ Summary of my perl5 (revision 5.0 version 6 subversion 2) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil +- perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil ++ libs=-lgdbm -ldb -ldl -lm -lc -lcrypt -lutil ++ perllibs=-ldl -lm -lc -lcrypt -lutil + libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a + Dynamic Linking: + dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' +diff --git a/cpan/Config-Perl-V/t/21_plv58.t b/cpan/Config-Perl-V/t/21_plv58.t +index b354e24..d747355 100644 +--- a/cpan/Config-Perl-V/t/21_plv58.t ++++ b/cpan/Config-Perl-V/t/21_plv58.t +@@ -67,8 +67,8 @@ Summary of my perl5 (revision 5 version 8 subversion 9) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=/lib/libc-2.11.2.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.11.2' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/22_plv510.t b/cpan/Config-Perl-V/t/22_plv510.t +index bec688c..4641d12 100644 +--- a/cpan/Config-Perl-V/t/22_plv510.t ++++ b/cpan/Config-Perl-V/t/22_plv510.t +@@ -57,8 +57,8 @@ Summary of my perl5 (revision 5 version 10 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.6.1' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/23_plv512.t b/cpan/Config-Perl-V/t/23_plv512.t +index 03c69cb..47d7f97 100644 +--- a/cpan/Config-Perl-V/t/23_plv512.t ++++ b/cpan/Config-Perl-V/t/23_plv512.t +@@ -68,8 +68,8 @@ Summary of my perl5 (revision 5 version 12 subversion 2) configuration: + Linker and Libraries: + ld='/usr/bin/ld', ldflags ='-L/pro/local/lib +DD64 -L/usr/lib/hpux64' + libpth=/pro/local/lib /usr/lib/hpux64 /lib /usr/lib /usr/ccs/lib /usr/local/lib +- libs=-lcl -lpthread -lnsl -lnm -ldb -ldl -ldld -lm -lsec -lc +- perllibs=-lcl -lpthread -lnsl -lnm -ldl -ldld -lm -lsec -lc ++ libs=-lcl -lpthread -lnm -ldb -ldl -ldld -lm -lsec -lc ++ perllibs=-lcl -lpthread -lnm -ldl -ldld -lm -lsec -lc + libc=/usr/lib/hpux64/libc.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/24_plv514.t b/cpan/Config-Perl-V/t/24_plv514.t +index 3377b41..fdd8046 100644 +--- a/cpan/Config-Perl-V/t/24_plv514.t ++++ b/cpan/Config-Perl-V/t/24_plv514.t +@@ -69,8 +69,8 @@ Summary of my perl5 (revision 5 version 14 subversion 2) configuration: + Linker and Libraries: + ld='ld', ldflags ='-L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64' + libpth=/usr/local/ppc64/lib64 /lib /usr/lib /usr/ccs/lib /usr/local/lib /usr/lib64 +- libs=-lbind -lnsl -ldbm -ldb -ldl -lld -lm -lcrypt -lc +- perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc ++ libs=-lbind -ldbm -ldb -ldl -lld -lm -lcrypt -lc ++ perllibs=-lbind -ldl -lld -lm -lcrypt -lc + libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a + gnulibc_version='' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/25_plv516.t b/cpan/Config-Perl-V/t/25_plv516.t +index 5505245..5bad2ce 100644 +--- a/cpan/Config-Perl-V/t/25_plv516.t ++++ b/cpan/Config-Perl-V/t/25_plv516.t +@@ -69,8 +69,8 @@ Summary of my perl5 (revision 5 version 16 subversion 3) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.15.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.15' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/26_plv518.t b/cpan/Config-Perl-V/t/26_plv518.t +index a255797..d3ab0b6 100644 +--- a/cpan/Config-Perl-V/t/26_plv518.t ++++ b/cpan/Config-Perl-V/t/26_plv518.t +@@ -94,8 +94,8 @@ Summary of my perl5 (revision 5 version 18 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.17' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/26_plv5182.t b/cpan/Config-Perl-V/t/26_plv5182.t +index 25e52bb..fc24cd1 100644 +--- a/cpan/Config-Perl-V/t/26_plv5182.t ++++ b/cpan/Config-Perl-V/t/26_plv5182.t +@@ -94,8 +94,8 @@ Summary of my perl5 (revision 5 version 18 subversion 2) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/pro/local/lib /lib /usr/lib /usr/local/lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lc + libc=/lib/libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/27_plv5200.t b/cpan/Config-Perl-V/t/27_plv5200.t +index f44273d..ca84b18 100644 +--- a/cpan/Config-Perl-V/t/27_plv5200.t ++++ b/cpan/Config-Perl-V/t/27_plv5200.t +@@ -96,8 +96,8 @@ Summary of my perl5 (revision 5 version 20 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib/gcc/i586-suse-linux/4.8/include-fixed /usr/lib/gcc/i586-suse-linux/4.8/../../../../i586-suse-linux/lib /usr/lib /pro/local/lib /lib +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.18.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.18' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/27_plv5202.t b/cpan/Config-Perl-V/t/27_plv5202.t +index 83c3cb0..13b58a2 100644 +--- a/cpan/Config-Perl-V/t/27_plv5202.t ++++ b/cpan/Config-Perl-V/t/27_plv5202.t +@@ -97,8 +97,8 @@ Summary of my perl5 (revision 5 version 20 subversion 2) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat +- perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc ++ libs=-lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat ++ perllibs=-ldl -lm -lcrypt -lutil -lpthread -lc + libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.19' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/28_plv5220.t b/cpan/Config-Perl-V/t/28_plv5220.t +index 885445b..26506c3 100644 +--- a/cpan/Config-Perl-V/t/28_plv5220.t ++++ b/cpan/Config-Perl-V/t/28_plv5220.t +@@ -97,8 +97,8 @@ Summary of my perl5 (revision 5 version 22 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.19' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/30_plv5240.t b/cpan/Config-Perl-V/t/30_plv5240.t +index 2d6c0fd..c4a8e13 100644 +--- a/cpan/Config-Perl-V/t/30_plv5240.t ++++ b/cpan/Config-Perl-V/t/30_plv5240.t +@@ -102,8 +102,8 @@ Summary of my perl5 (revision 5 version 24 subversion 0) configuration: + Linker and Libraries: + ld='cc', ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/5/include-fixed /usr/lib64/gcc/x86_64-suse-linux/5/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.23.so, so=so, useshrplib=false, libperl=libperl.a + gnulibc_version='2.23' + Dynamic Linking: +diff --git a/cpan/Config-Perl-V/t/31_plv52511.t b/cpan/Config-Perl-V/t/31_plv52511.t +index a5b39ca..bcceca7 100644 +--- a/cpan/Config-Perl-V/t/31_plv52511.t ++++ b/cpan/Config-Perl-V/t/31_plv52511.t +@@ -131,8 +131,8 @@ Summary of my perl5 (revision 5 version 25 subversion 11) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/6/include-fixed /usr/lib64/gcc/x86_64-suse-linux/6/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.24.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/32_plv5261rc1.t b/cpan/Config-Perl-V/t/32_plv5261rc1.t +index 9db16b2..57b1e11 100644 +--- a/cpan/Config-Perl-V/t/32_plv5261rc1.t ++++ b/cpan/Config-Perl-V/t/32_plv5261rc1.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 26 subversion 1) configuration: + ld='ccache cc' + ldflags ='-L/pro/local/lib -fstack-protector' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/4.8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -ldb -ldl -lm -lcrypt -lutil -lc ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.19.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/33_plv52711r.t b/cpan/Config-Perl-V/t/33_plv52711r.t +index c6940d2..d7f2147 100644 +--- a/cpan/Config-Perl-V/t/33_plv52711r.t ++++ b/cpan/Config-Perl-V/t/33_plv52711r.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 27 subversion 11) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/7/include-fixed /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.27.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/34_plv5280.t b/cpan/Config-Perl-V/t/34_plv5280.t +index f6c38df..47a1e0e 100644 +--- a/cpan/Config-Perl-V/t/34_plv5280.t ++++ b/cpan/Config-Perl-V/t/34_plv5280.t +@@ -129,8 +129,8 @@ Summary of my perl5 (revision 5 version 28 subversion 0) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.27.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/35_plv52910g.t b/cpan/Config-Perl-V/t/35_plv52910g.t +index 6d822d1..383d146 100644 +--- a/cpan/Config-Perl-V/t/35_plv52910g.t ++++ b/cpan/Config-Perl-V/t/35_plv52910g.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 29 subversion 10) configuration: + ld='g++' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/include/c++/8 /usr/include/c++/8/x86_64-suse-linux /usr/include/c++/8/backward /usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.29.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/36_plv5300.t b/cpan/Config-Perl-V/t/36_plv5300.t +index 6db7512..b3e26e3 100644 +--- a/cpan/Config-Perl-V/t/36_plv5300.t ++++ b/cpan/Config-Perl-V/t/36_plv5300.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 30 subversion 0) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/8/include-fixed /usr/lib64/gcc/x86_64-suse-linux/8/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.29.so + so=so + useshrplib=true +diff --git a/cpan/Config-Perl-V/t/37_plv53111qm.t b/cpan/Config-Perl-V/t/37_plv53111qm.t +index f566f76..f94c275 100644 +--- a/cpan/Config-Perl-V/t/37_plv53111qm.t ++++ b/cpan/Config-Perl-V/t/37_plv53111qm.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 31 subversion 11) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/10/include-fixed /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat -lquadmath +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc -lquadmath ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat -lquadmath ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc -lquadmath + libc=libc-2.31.so + so=so + useshrplib=false +diff --git a/cpan/Config-Perl-V/t/38_plv5320tld.t b/cpan/Config-Perl-V/t/38_plv5320tld.t +index a8f0d73..b1ba340 100644 +--- a/cpan/Config-Perl-V/t/38_plv5320tld.t ++++ b/cpan/Config-Perl-V/t/38_plv5320tld.t +@@ -130,8 +130,8 @@ Summary of my perl5 (revision 5 version 32 subversion 0) configuration: + ld='cc' + ldflags ='-L/pro/local/lib -fstack-protector-strong' + libpth=/usr/local/lib /usr/lib64/gcc/x86_64-suse-linux/10/include-fixed /usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/lib /usr/lib /pro/local/lib /lib/../lib64 /usr/lib/../lib64 /lib /lib64 /usr/lib64 /usr/local/lib64 +- libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat +- perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc ++ libs=-lpthread -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat ++ perllibs=-lpthread -ldl -lm -lcrypt -lutil -lc + libc=libc-2.31.so + so=so + useshrplib=true +diff --git a/plan9/config_sh.sample b/plan9/config_sh.sample +index b761363..ad711d5 100644 +--- a/plan9/config_sh.sample ++++ b/plan9/config_sh.sample +@@ -857,7 +857,7 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath=' /lib' +-libswanted='socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' ++libswanted='socket bind inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt sec ucb bsd BSD PW x util' + libswanted_uselargefiles='' + line='' + lint='' +diff --git a/pod/perlrun.pod b/pod/perlrun.pod +index 5d3aa3e..e632e0a 100644 +--- a/pod/perlrun.pod ++++ b/pod/perlrun.pod +@@ -895,11 +895,11 @@ non-letters). For example: + $ perl -V:libc + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib. +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + libc='/lib/libc-2.2.4.so'; + $ perl -V:lib.* + libpth='/usr/local/lib /lib /usr/lib'; +- libs='-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; ++ libs='-lgdbm -ldb -ldl -lm -lcrypt -lutil -lc'; + lib_ext='.a'; + libc='/lib/libc-2.2.4.so'; + libperl='libperl.a'; +diff --git a/win32/config.gc b/win32/config.gc +index af6fed9..111d4ad 100644 +--- a/win32/config.gc ++++ b/win32/config.gc +@@ -869,8 +869,8 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' +diff --git a/win32/config.vc b/win32/config.vc +index f4625bf..cfa1c8a 100644 +--- a/win32/config.vc ++++ b/win32/config.vc +@@ -868,8 +868,8 @@ libsdirs='' + libsfiles='' + libsfound='' + libspath='' +-libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' +-libswanted_uselargefiles='net socket inet nsl nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' ++libswanted_uselargefiles='net socket inet nm ndbm gdbm dbm db malloc dl ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' + line='line' + lint='' + lkflags='' diff --git a/omnibus/config/patches/postgresql/no_docs.patch b/omnibus/config/patches/postgresql/no_docs.patch new file mode 100644 index 000000000..227c47d90 --- /dev/null +++ b/omnibus/config/patches/postgresql/no_docs.patch @@ -0,0 +1,19 @@ +--- GNUmakefile.in.original 2016-12-19 06:01:36.664961781 -0500 ++++ GNUmakefile.in 2016-12-19 06:02:15.872961781 -0500 +@@ -16,7 +16,7 @@ + docs: + $(MAKE) -C doc all + +-$(call recurse,world,doc src config contrib,all) ++$(call recurse,world,src config contrib,all) + world: + +@echo "PostgreSQL, contrib, and documentation successfully made. Ready to install." + +@@ -32,7 +32,7 @@ + install-docs: + $(MAKE) -C doc install + +-$(call recurse,install-world,doc src config contrib,install) ++$(call recurse,install-world,src config contrib,install) + install-world: + +@echo "PostgreSQL, contrib, and documentation installation complete." diff --git a/omnibus/config/patches/readline/8.1.patch b/omnibus/config/patches/readline/8.1.patch new file mode 100644 index 000000000..70a67aae5 --- /dev/null +++ b/omnibus/config/patches/readline/8.1.patch @@ -0,0 +1,75 @@ +*** ../readline-8.1-patched/bind.c 2020-10-26 10:03:14.000000000 -0400 +--- bind.c 2021-01-18 16:38:48.000000000 -0500 +*************** +*** 1235,1239 **** + else if (_rl_strnicmp (args, "version", 7) == 0) + { +! int rlversion, versionarg, op, previ, major, minor; + + _rl_parsing_conditionalized_out = 1; +--- 1235,1239 ---- + else if (_rl_strnicmp (args, "version", 7) == 0) + { +! int rlversion, versionarg, op, previ, major, minor, opresult; + + _rl_parsing_conditionalized_out = 1; +*************** +*** 1295,1316 **** + { + case OP_EQ: +! _rl_parsing_conditionalized_out = rlversion == versionarg; + break; + case OP_NE: +! _rl_parsing_conditionalized_out = rlversion != versionarg; + break; + case OP_GT: +! _rl_parsing_conditionalized_out = rlversion > versionarg; + break; + case OP_GE: +! _rl_parsing_conditionalized_out = rlversion >= versionarg; + break; + case OP_LT: +! _rl_parsing_conditionalized_out = rlversion < versionarg; + break; + case OP_LE: +! _rl_parsing_conditionalized_out = rlversion <= versionarg; + break; + } + } + /* Check to see if the first word in ARGS is the same as the +--- 1295,1317 ---- + { + case OP_EQ: +! opresult = rlversion == versionarg; + break; + case OP_NE: +! opresult = rlversion != versionarg; + break; + case OP_GT: +! opresult = rlversion > versionarg; + break; + case OP_GE: +! opresult = rlversion >= versionarg; + break; + case OP_LT: +! opresult = rlversion < versionarg; + break; + case OP_LE: +! opresult = rlversion <= versionarg; + break; + } ++ _rl_parsing_conditionalized_out = 1 - opresult; + } + /* Check to see if the first word in ARGS is the same as the + +*** ../readline-8.1/patchlevel 2013-11-15 08:11:11.000000000 -0500 +--- patchlevel 2014-03-21 08:28:40.000000000 -0400 +*************** +*** 1,3 **** + # Do not edit -- exists only for use by patch + +! 0 +--- 1,3 ---- + # Do not edit -- exists only for use by patch + +! 1 diff --git a/omnibus/config/patches/zlib/zlib-windows-relocate.patch b/omnibus/config/patches/zlib/zlib-windows-relocate.patch new file mode 100644 index 000000000..6d92496e8 --- /dev/null +++ b/omnibus/config/patches/zlib/zlib-windows-relocate.patch @@ -0,0 +1,19 @@ +--- zlib-1.2.8/win32/Makefile.gcc.orig 2016-02-11 13:46:54.000000000 -0500 ++++ zlib-1.2.8/win32/Makefile.gcc 2016-02-11 13:53:08.000000000 -0500 +@@ -57,6 +57,8 @@ + RC = $(PREFIX)windres + RCFLAGS = --define GCC_WINDRES + ++IMAGE_BASE = 0x63300000 ++ + STRIP = $(PREFIX)strip + + CP = cp -fp +@@ -93,7 +95,7 @@ + $(IMPLIB): $(SHAREDLIB) + + $(SHAREDLIB): win32/zlib.def $(OBJS) $(OBJA) zlibrc.o +- $(CC) -shared -Wl,--out-implib,$(IMPLIB) $(LDFLAGS) \ ++ $(CC) -shared -Wl,--out-implib,$(IMPLIB),--image-base,$(IMAGE_BASE) $(LDFLAGS) \ + -o $@ win32/zlib.def $(OBJS) $(OBJA) zlibrc.o + $(STRIP) $@ diff --git a/omnibus/config/projects/firezone.rb b/omnibus/config/projects/firezone.rb new file mode 100644 index 000000000..a7f3bd1ca --- /dev/null +++ b/omnibus/config/projects/firezone.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +# Copyright 2021 FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "firezone" +maintainer "FireZone" +homepage "https://firez.one" +license "Apache-2.0" +license_file "../LICENSE" + +description <<~DESC + Web UI + Firewall manager for WireGuardâ„¢ +DESC + +# Defaults to C:/firezone on Windows +# and /opt/firezone on all other platforms +install_dir "#{default_root}/#{name}" + +build_version Omnibus::BuildVersion.semver +build_iteration 1 + +# Creates required build directories +# dependency "preparation" + +# firezone build dependencies/components +dependency "compile_release" +dependency "erlang" +dependency "elixir" +dependency "openssl" +dependency "postgresql" +dependency "wireguard-tools" +dependency "nftables" + +exclude "**/.git" +exclude "**/bundler/git" diff --git a/omnibus/config/software/autoconf.rb b/omnibus/config/software/autoconf.rb new file mode 100644 index 000000000..473ffe8fe --- /dev/null +++ b/omnibus/config/software/autoconf.rb @@ -0,0 +1,47 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-04 + +name "autoconf" +default_version "2.71" + +license "GPL-3.0" +license_file "COPYING" +license_file "COPYING.EXCEPTION" +skip_transitive_dependency_licensing true + +dependency "m4" + +version("2.69") { source sha256: "954bd69b391edc12d6a4a51a2dd1476543da5c6bbf05a95b59dc0dd6fd4c2969" } +version("2.71") { source sha256: "431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c" } + +source url: "https://ftp.gnu.org/gnu/autoconf/autoconf-#{version}.tar.gz" + +relative_path "autoconf-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + if solaris2? + env["M4"] = "#{install_dir}/embedded/bin/m4" + end + + command "./configure" \ + " --prefix=#{install_dir}/embedded", env: env + + make "-j #{workers}", env: env + make "install", env: env +end diff --git a/omnibus/config/software/automake.rb b/omnibus/config/software/automake.rb new file mode 100644 index 000000000..0e944c4b7 --- /dev/null +++ b/omnibus/config/software/automake.rb @@ -0,0 +1,50 @@ +# +# Copyright 2012-2014 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-04 + +name "automake" +default_version "1.16.4" + +dependency "autoconf" +dependency "perl-thread-queue" + +license "GPL-2.0" +license_file "COPYING" +skip_transitive_dependency_licensing true + +version("1.16.4") { source sha256: "8a0f0be7aaae2efa3a68482af28e5872d8830b9813a6a932a2571eac63ca1794" } +version("1.16") { source sha256: "80da43bb5665596ee389e6d8b64b4f122ea4b92a685b1dbd813cd1f0e0c2d83f" } +version("1.15") { source sha256: "7946e945a96e28152ba5a6beb0625ca715c6e32ac55f2e353ef54def0c8ed924" } +version("1.11.2") { source sha256: "c339e3871d6595620760725da61de02cf1c293af8a05b14592d6587ac39ce546" } + +source url: "https://ftp.gnu.org/gnu/automake/automake-#{version}.tar.gz" + +relative_path "automake-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + if version == "1.15" + command "./bootstrap.sh", env: env + else + command "./bootstrap", env: env + end + command "./configure" \ + " --prefix=#{install_dir}/embedded", env: env + + make "-j #{workers}", env: env + make "install", env: env +end diff --git a/omnibus/config/software/bison.rb b/omnibus/config/software/bison.rb new file mode 100644 index 000000000..c74b633db --- /dev/null +++ b/omnibus/config/software/bison.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright:: FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-04 +name "bison" +license "GPL-3.0" +license_file "COPYING" +skip_transitive_dependency_licensing true +default_version "3.7" +source url: "http://mirrors.ibiblio.org/gnu/bison/bison-#{version}.tar.gz" +version("3.7") do + source sha256: "492ad61202de893ca21a99b621d63fa5389da58804ad79d3f226b8d04b803998" +end +relative_path "bison-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "./configure --prefix=#{install_dir}/embedded", env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/bzip2.rb b/omnibus/config/software/bzip2.rb new file mode 100644 index 000000000..afa2ef606 --- /dev/null +++ b/omnibus/config/software/bzip2.rb @@ -0,0 +1,55 @@ +# +# Copyright 2013-2018 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Install bzip2 and its shared library, libbz2.so +# This library object is required for building Python with the bz2 module, +# and should be picked up automatically when building Python. + +name "bzip2" +default_version "1.0.8" + +license "BSD-2-Clause" +license_file "LICENSE" +skip_transitive_dependency_licensing true + +dependency "zlib" +dependency "openssl" + +# version_list: url=https://sourceware.org/pub/bzip2/ filter=*.tar.gz +version("1.0.8") { source sha256: "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269" } + +source url: "https://fossies.org/linux/misc/#{name}-#{version}.tar.gz" + +relative_path "#{name}-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + # Avoid warning where .rodata cannot be used when making a shared object + env["CFLAGS"] << " -fPIC" unless aix? + + # The list of arguments to pass to make + args = "PREFIX='#{install_dir}/embedded' VERSION='#{version}'" + args << " CFLAGS='-qpic=small -qpic=large -O2 -g -D_ALL_SOURCE -D_LARGE_FILES'" if aix? + + patch source: "makefile_take_env_vars.patch", plevel: 1, env: env + patch source: "makefile_no_bins.patch", plevel: 1, env: env # removes various binaries we don't want to ship + patch source: "soname_install_dir.patch", env: env if mac_os_x? + patch source: "aix_makefile.patch", env: env if aix? + + make "#{args}", env: env + make "#{args} -f Makefile-libbz2_so", env: env + make "#{args} install", env: env +end diff --git a/omnibus/config/software/cacerts.rb b/omnibus/config/software/cacerts.rb new file mode 100644 index 000000000..2a6524c63 --- /dev/null +++ b/omnibus/config/software/cacerts.rb @@ -0,0 +1,48 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "cacerts" + +license "MPL-2.0" +license_file "https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt" +skip_transitive_dependency_licensing true + +default_version "2021-01-19" + +source url: "https://curl.haxx.se/ca/cacert-#{version}.pem" + +# versions_list: https://curl.se/docs/caextract.html +version("2021-01-19") { source sha256: "e010c0c071a2c79a76aa3c289dc7e4ac4ed38492bfda06d766a80b707ebd2f29" } +version("2020-12-08") { source sha256: "313d562594ebd07846ad6b840dd18993f22e0f8b3f275d9aacfae118f4f00fb7" } +version("2020-10-14") { source sha256: "bb28d145ed1a4ee67253d8ddb11268069c9dafe3db25a9eee654974c4e43eee5" } +version("2020-07-22") { source sha256: "2782f0f8e89c786f40240fc1916677be660fb8d8e25dede50c9f6f7b0c2c2178" } +version("2020-06-24") { source sha256: "726889705b00f736200ed7999f7a50021b8735d53228d679c4e6665aa3b44987" } + +relative_path "cacerts-#{version}" + +build do + mkdir "#{install_dir}/embedded/ssl/certs" + + copy "#{project_dir}/cacert*.pem", "#{install_dir}/embedded/ssl/certs/cacert.pem" + copy "#{project_dir}/cacert*.pem", "#{install_dir}/embedded/ssl/cert.pem" if windows? + + # Windows does not support symlinks + unless windows? + link "certs/cacert.pem", "#{install_dir}/embedded/ssl/cert.pem", unchecked: true + + block { File.chmod(0644, "#{install_dir}/embedded/ssl/certs/cacert.pem") } + end +end diff --git a/omnibus/config/software/compile_release.rb b/omnibus/config/software/compile_release.rb new file mode 100644 index 000000000..69d928067 --- /dev/null +++ b/omnibus/config/software/compile_release.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2021 FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "compile_release" +description "the steps required to compile the firezone elixir application" +default_version "1.0.0" + +dependency "postgresql" +dependency "nodejs" +dependency "elixir" + +version("1.0.0") do + source path: File.expand_path("../", Omnibus::Config.project_root), + options: { exclude: [ + ".env", + ".git", + ".ci", + ".vagrant", + ".github", + "_build", + "deps", + "omnibus", + "apps/fz_http/assets/node_modules" + ] } +end + +license :project_license +skip_transitive_dependency_licensing true + +build do + env = with_standard_compiler_flags(with_embedded_path).merge("MIX_ENV" => "prod") + + command "mix local.hex --force", env: env + command "mix local.rebar --force", env: env + command "mix deps.get --only prod", env: env + command "mix deps.compile --only prod", env: env + command "npm ci --prefix apps/fz_http/assets --progress=false --no-audit --loglevel=error", env: env + command "npm run --prefix apps/fz_http/assets deploy", env: env + command "cd apps/fz_http && mix phx.digest", env: env + command "mix release", env: env + move "_build/prod/rel/firezone", "#{install_dir}/embedded/firezone" +end diff --git a/omnibus/config/software/config_guess.rb b/omnibus/config/software/config_guess.rb new file mode 100644 index 000000000..dfbc39053 --- /dev/null +++ b/omnibus/config/software/config_guess.rb @@ -0,0 +1,37 @@ +# +# Copyright 2015 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: no version pinning + +name "config_guess" +default_version "master" + +# Use our github mirror of the savannah repository +source git: "https://github.com/chef/config-mirror.git" + +# http://savannah.gnu.org/projects/config +license "GPL-3.0 (with exception)" +license_file "config.guess" +license_file "config.sub" +skip_transitive_dependency_licensing true + +relative_path "config_guess-#{version}" + +build do + mkdir "#{install_dir}/embedded/lib/config_guess" + + copy "#{project_dir}/config.guess", "#{install_dir}/embedded/lib/config_guess/config.guess" + copy "#{project_dir}/config.sub", "#{install_dir}/embedded/lib/config_guess/config.sub" +end diff --git a/omnibus/config/software/elixir.rb b/omnibus/config/software/elixir.rb new file mode 100644 index 000000000..db917b10d --- /dev/null +++ b/omnibus/config/software/elixir.rb @@ -0,0 +1,37 @@ +# +# Copyright 2017 Chef Software, Inc. +# Copyright 2021 FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-04 + +name "elixir" +default_version "1.12.2" + +license "Apache-2.0" +license_file "LICENSE" + +dependency "erlang" + +version("1.4.2") { source sha256: "cb4e2ec4d68b3c8b800179b7ae5779e2999aa3375f74bd188d7d6703497f553f" } +version("1.12.2") { source sha256: "701006d1279225fc42f15c8d3f39906db127ddcc95373d34d8d160993356b15c" } +source url: "https://github.com/elixir-lang/elixir/archive/v#{version}.tar.gz" +relative_path "elixir-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + make "-j #{workers}", env: env + make "install PREFIX=#{install_dir}/embedded", env: env +end diff --git a/omnibus/config/software/erlang.rb b/omnibus/config/software/erlang.rb new file mode 100644 index 000000000..385c117ae --- /dev/null +++ b/omnibus/config/software/erlang.rb @@ -0,0 +1,136 @@ +# +# Copyright:: Chef Software, Inc. +# Copyright:: FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "erlang" +default_version "24.0.5" + +license "Apache-2.0" +license_file "LICENSE.txt" +skip_transitive_dependency_licensing true + +dependency "zlib" +dependency "openssl" +dependency "ncurses" +dependency "config_guess" + +# grab from github so we can get patch releases if we need to +source url: "https://github.com/erlang/otp/archive/OTP-#{version}.tar.gz" +relative_path "otp-OTP-#{version}" + +# versions_list: https://github.com/erlang/otp/tags filter=*.tar.gz +version("24.0.5") { source sha256: "dd189cf94bf86c610a66f5d9f1a49b8d95a7ce1a7534d216e97e8fade271e624" } +version("23.3.3") { source sha256: "839d74e71a457295d95b8674f1848a5d7d9c4c274a041ef8026d035da88858ae" } +version("23.3.2") { source sha256: "02443dd42023d0eb73f73dc05f4d3ded7bc4ab59d348041a37a045ba1581b48b" } +version("22.2") { source sha256: "232c37a502c7e491a9cbf86acb7af64fbc1a793fcbcbd0093cb029cf1c3830a7" } +version("22.1.8") { source sha256: "7302be70cee2c33689bf2c2a3e7cfee597415d0fb3e4e71bd3e86bd1eff9cfdc" } +version("21.3.8.11") { source sha256: "aab77124285820608cd7a90f6b882e42bb5739283e10a8593d7f5bce9b30b16a" } +version("21.1") { source sha256: "7212f895ae317fa7a086fa2946070de5b910df5d41263e357d44b0f1f410af0f" } +version("20.3.8.9") { source sha256: "897dd8b66c901bfbce09ed64e0245256aca9e6e9bdf78c36954b9b7117192519" } +version("20.0") { source sha256: "22710927ad2e48a0964997bf5becb24abb1f4fed86f5f05af22a9e1df636b787" } +version("19.3.6.11") { source sha256: "c857ea6d2c901bfb633d9ceeb5e05332475357f185dd5112b7b6e4db80072827" } +version("18.3.4.9") { source sha256: "25ef8ba3824cb726c4830abf32c2a2967925b1e33a8e8851dba596e933e2689a" } +version("18.3") { source sha256: "a6d08eb7df06e749ccaf3049b33ceae617a3c466c6a640ee8d248c2372d48f4e" } +version("18.2") { source sha256: "3944ce41d13fbef1e1e80d7335b2167849e8566581513d5d9226cd211d3d58f9" } +version("18.1") { source sha256: "6b956dda690d3f3bf244249e8d422dd606231cc7229675bf5e34b5ba2ae83e9b" } + +build do + if version.satisfies?(">= 18.3") + # Don't listen on 127.0.0.1/::1 implicitly whenever ERL_EPMD_ADDRESS is given + patch source: "epmd-require-explicitly-adding-loopback-address.patch", plevel: 1 + end + + env = with_standard_compiler_flags(with_embedded_path).merge( + # WARNING! + "CFLAGS" => "-L#{install_dir}/embedded/lib -I#{install_dir}/embedded/erlang/include", + "LDFLAGS" => "-Wl,-rpath #{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/erlang/include" + ) + env.delete("CPPFLAGS") + + # The TYPE env var sets the type of emulator you want + # We want the default so we give TYPE and empty value + # in case it was set by CI. + env["TYPE"] = "" + + update_config_guess(target: "erts/autoconf") + update_config_guess(target: "lib/common_test/priv/auxdir") + update_config_guess(target: "lib/erl_interface/src/auxdir") + update_config_guess(target: "lib/wx/autoconf") + + if version.satisfies?(">= 19.0") + update_config_guess(target: "lib/common_test/test_server/src") + else + update_config_guess(target: "lib/test_server/src") + end + + # Setup the erlang include dir + mkdir "#{install_dir}/embedded/erlang/include" + + # At this time, erlang does not expose a way to specify the path(s) to these + # libraries, but it looks in its local +include+ directory as part of the + # search, so we will symlink them here so they are picked up. + # + # In future releases of erlang, someone should check if these flags (or + # environment variables) are avaiable to remove this ugly hack. + %w{ncurses openssl zlib.h zconf.h}.each do |name| + link "#{install_dir}/embedded/include/#{name}", "#{install_dir}/embedded/erlang/include/#{name}" + end + + # Note 2017-02-28 sr: HiPE doesn't compile with OTP 18.3 on ppc64le (https://bugs.erlang.org/browse/ERL-369) + # Compiling fails when linking beam.smp, with + # powerpc64le-linux-gnu/libutil.so: error adding symbols: File in wrong format + # + # We've been having issues with ppc64le and hipe before, too: + # https://github.com/chef/chef-server/commit/4fa25ed695acaf819b11f71c6db1aab5c8adcaee + # + # It's trying to compile using a linker script for ppc64, it seems: + # https://github.com/erlang/otp/blob/c1ea854fac3d8ed14/erts/emulator/hipe/elf64ppc.x + # Probably introduced with https://github.com/erlang/otp/commit/37d63e9b8a0a96 + # See also https://sourceware.org/ml/binutils/2015-05/msg00148.html + hipe = ppc64le? ? "disable" : "enable" + + unless File.exist?("./configure") + # Building from github source requires this step + command "./otp_build autoconf" + end + # Note: et, debugger and observer applications require wx to + # build. The tarballs from the downloads site has prebuilt the beam + # files, so we were able to get away without disabling them and + # still build. When building from raw source we must disable them + # explicitly. + wx = "without" + + command "./configure" \ + " --prefix=#{install_dir}/embedded" \ + " --enable-threads" \ + " --enable-smp-support" \ + " --enable-kernel-poll" \ + " --enable-dynamic-ssl-lib" \ + " --enable-shared-zlib" \ + " --enable-fips" \ + " --#{hipe}-hipe" \ + " --#{wx}-wx" \ + " --#{wx}-et" \ + " --#{wx}-debugger" \ + " --#{wx}-observer" \ + " --without-megaco" \ + " --without-javac" \ + " --with-ssl=#{install_dir}/embedded" \ + " --disable-debug", env: env + + make "-j #{workers}", env: env + make "install", env: env +end diff --git a/omnibus/config/software/flex.rb b/omnibus/config/software/flex.rb new file mode 100644 index 000000000..86e947549 --- /dev/null +++ b/omnibus/config/software/flex.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright:: FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name "flex" +license_file "COPYING" +skip_transitive_dependency_licensing true +default_version "2.6.4" +source url: "https://github.com/westes/flex/releases/download/v#{version}/flex-#{version}.tar.gz" +version("2.6.4") do + source sha256: "e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995" +end +relative_path "#{name}-#{version}" + +dependency "bison" +dependency "m4" +dependency "gettext" +dependency "libtool" +dependency "autoconf" +dependency "automake" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + # Fixes https://github.com/spack/spack/issues/8152 + env["CFLAGS"] << " -D_GNU_SOURCE" if debian? + + command "./autogen.sh", env: env + command "./configure --prefix=#{install_dir}/embedded", env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/gettext.rb b/omnibus/config/software/gettext.rb new file mode 100644 index 000000000..ef77075c0 --- /dev/null +++ b/omnibus/config/software/gettext.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright:: FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name "gettext" +license "GPL-3.0" +license_file "COPYING" + +default_version "0.21" + +dependency "m4" +dependency "autoconf" +dependency "automake" +dependency "bison" +dependency "perl" +dependency "libiconv" +dependency "ncurses" +dependency "bzip2" +dependency "zlib" +dependency "libxml2" +dependency "liblzma" +dependency "icu" +dependency "pkg-config" + +source url: "https://ftp.gnu.org/pub/gnu/gettext/gettext-#{version}.tar.gz" +version("0.21") do + source sha256: "c77d0da3102aec9c07f43671e60611ebff89a996ef159497ce8e59d075786b12" +end + +relative_path "#{name}-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + configure_command = [ + "./configure", + # Enabling OpenMP requires libgomp, which requires building gcc which is very slow. + "--disable-openmp", + "--prefix=#{install_dir}/embedded" + ] + + command configure_command, env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/gmp.rb b/omnibus/config/software/gmp.rb new file mode 100644 index 000000000..62df9e5a1 --- /dev/null +++ b/omnibus/config/software/gmp.rb @@ -0,0 +1,48 @@ +# +# Copyright 2014 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "gmp" +default_version "6.2.1" + +# version_list: url=https://ftp.gnu.org/gnu/gmp/ filter=*.tar.bz2 + +version("6.2.1") { source sha256: "eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c" } +version("6.1.0") { source sha256: "498449a994efeba527885c10405993427995d3f86b8768d8cdf8d9dd7c6b73e8" } +version("6.0.0a") { source sha256: "7f8e9a804b9c6d07164cf754207be838ece1219425d64e28cfa3e70d5c759aaf" } + +source url: "https://ftp.gnu.org/gnu/gmp/gmp-#{version}.tar.bz2" + +if version == "6.0.0a" + # version 6.0.0a expands to 6.0.0 + relative_path "gmp-6.0.0" +else + relative_path "gmp-#{version}" +end + +build do + env = with_standard_compiler_flags(with_embedded_path) + + if solaris2? + env["ABI"] = "32" + end + + configure_command = ["./configure", + "--prefix=#{install_dir}/embedded"] + + command configure_command.join(" "), env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/icu.rb b/omnibus/config/software/icu.rb new file mode 100644 index 000000000..c31bf5659 --- /dev/null +++ b/omnibus/config/software/icu.rb @@ -0,0 +1,20 @@ +name "icu" +license_file "LICENSE" +skip_transitive_dependency_licensing true +default_version "69.1" + +source url: "https://github.com/unicode-org/icu/releases/download/release-#{version.gsub(".", "-")}/icu4c-#{version.gsub(".", "_")}-src.tgz" +version("69.1") do + source sha256: "4cba7b7acd1d3c42c44bb0c14be6637098c7faf2b330ce876bc5f3b915d09745" +end + +relative_path "icu/source" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "./configure --prefix=#{install_dir}/embedded", env: env + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/libedit.rb b/omnibus/config/software/libedit.rb new file mode 100644 index 000000000..01cbec4cc --- /dev/null +++ b/omnibus/config/software/libedit.rb @@ -0,0 +1,68 @@ + +# Copyright 2012-2014 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libedit" +default_version "20210419-3.1" + +license "BSD-3-Clause" +license_file "COPYING" +skip_transitive_dependency_licensing true + +dependency "ncurses" +dependency "config_guess" + +# version_list: url=http://thrysoee.dk/editline/ filter=*.tar.gz + +version("20210419-3.1") { source sha256: "571ebe44b74860823e24a08cf04086ff104fd7dfa1020abf26c52543134f5602" } +version("20150325-3.1") { source sha256: "c88a5e4af83c5f40dda8455886ac98923a9c33125699742603a88a0253fcc8c5" } +version("20141030-3.1") { source sha256: "9701e16570fb8f7fa407b506986652221b701a9dd61defc05bb7d1c61cdf5a40" } +version("20130712-3.1") { source sha256: "5d9b1a9dd66f1fe28bbd98e4d8ed1a22d8da0d08d902407dcc4a0702c8d88a37" } +version("20120601-3.0") { source sha256: "51f0f4b4a97b7ebab26e7b5c2564c47628cdb3042fd8ba8d0605c719d2541918" } + +source url: "http://www.thrysoee.dk/editline/libedit-#{version}.tar.gz" + +if version == "20141030-3.1" + # released tar file has name discrepency in folder name for this version + relative_path "libedit-20141029-3.1" +else + relative_path "libedit-#{version}" +end + +build do + env = with_standard_compiler_flags(with_embedded_path) + + # The patch is from the FreeBSD ports tree and is for GCC compatibility. + # http://svnweb.freebsd.org/ports/head/devel/libedit/files/patch-vi.c?annotate=300896 + if version.to_i < 20150325 && (freebsd? || openbsd?) + patch source: "freebsd-vi-fix.patch", env: env + end + + if openbsd? + patch source: "openbsd-weak-alias-fix.patch", plevel: 1, env: env + elsif aix? + # this forces us to build correctly, in the event that the system locale + # is non-standard. + env["LC_ALL"] = "en_US" + end + + update_config_guess + + command "./configure" \ + " --prefix=#{install_dir}/embedded", env: env + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/libffi.rb b/omnibus/config/software/libffi.rb new file mode 100644 index 000000000..ad8dd422d --- /dev/null +++ b/omnibus/config/software/libffi.rb @@ -0,0 +1,67 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libffi" +default_version "3.4.2" + +license "MIT" +license_file "LICENSE" +skip_transitive_dependency_licensing true + +# version_list: url=ftp://sourceware.org/pub/libffi/ filter=*.tar.gz + +version("3.2.1") { source sha256: "d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37" } +version("3.3") { source sha256: "72fba7922703ddfa7a028d513ac15a85c8d54c8d67f55fa5a4802885dc652056" } +version("3.4.2") { source sha256: "540fb721619a6aba3bdeef7d940d8e9e0e6d2c193595bc243241b77ff9e93620" } + +source url: "https://github.com/libffi/libffi/releases/download/v#{version}/libffi-#{version}.tar.gz" +relative_path "libffi-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + env["INSTALL"] = "/opt/freeware/bin/install" if aix? + + # disable option checking as disable-docs is 3.3+ only + configure_command = ["--disable-option-checking", + "--disable-docs", + ] + + if version == "3.3" && mac_os_x? && arm? + patch source: "libffi-3.3-arm64.patch", plevel: 1, env: env + end + + # AIX's old version of patch doesn't like the patch here + unless aix? + # disable multi-os-directory via configure flag (don't use /lib64) + # Works on all platforms, and is compatible on 32bit platforms as well + configure_command << "--disable-multi-os-directory" + + # add the --disable-multi-os-directory flag to 3.2.1 + if version == "3.2.1" + patch source: "libffi-3.2.1-disable-multi-os-directory.patch", plevel: 1, env: env + end + end + + configure(*configure_command, env: env) + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env + + # libffi's default install location of header files is awful... + mkdir "#{install_dir}/embedded/include" + copy "#{install_dir}/embedded/lib/libffi-#{version}/include/*", "#{install_dir}/embedded/include/" +end diff --git a/omnibus/config/software/libiconv.rb b/omnibus/config/software/libiconv.rb new file mode 100644 index 000000000..76a4d48a1 --- /dev/null +++ b/omnibus/config/software/libiconv.rb @@ -0,0 +1,53 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# CAUTION - although its not used, external libraries such as nokogiri may pick up an optional dep on +# libiconv such that removal of libiconv will break those libraries on upgrade. With an better story around +# external gem handling when chef-client is upgraded libconv could be dropped. +name "libiconv" +default_version "1.16" + +license "LGPL-2.1" +license_file "COPYING.LIB" +skip_transitive_dependency_licensing true + +dependency "config_guess" + +# versions_list: https://ftp.gnu.org/pub/gnu/libiconv/ filter=*.tar.gz +version("1.15") { source sha256: "ccf536620a45458d26ba83887a983b96827001e92a13847b45e4925cc8913178" } +version("1.16") { source sha256: "e6a1b1b589654277ee790cce3734f07876ac4ccfaecbee8afa0b649cf529cc04" } + +source url: "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-#{version}.tar.gz" + +relative_path "libiconv-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + # freebsd 10 needs to be build PIC + env["CFLAGS"] << " -fPIC" if freebsd? + + update_config_guess(target: "build-aux") + update_config_guess(target: "libcharset/build-aux") + + configure(env: env) + + pmake = "-j #{workers}" + make "#{pmake}", env: env + make "#{pmake} install-lib" \ + " libdir=#{install_dir}/embedded/lib" \ + " includedir=#{install_dir}/embedded/include", env: env +end diff --git a/omnibus/config/software/liblzma.rb b/omnibus/config/software/liblzma.rb new file mode 100644 index 000000000..2b7813556 --- /dev/null +++ b/omnibus/config/software/liblzma.rb @@ -0,0 +1,58 @@ +# +# Copyright 2014-2018 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "liblzma" +default_version "5.2.5" + +license "Public-Domain" +license_file "COPYING" +skip_transitive_dependency_licensing true + +# version_list: url=http://tukaani.org/xz/ filer=*.tar.gz + +version("5.2.5") { source sha256: "f6f4910fd033078738bd82bfba4f49219d03b17eb0794eb91efbae419f4aba10" } +version("5.2.4") { source sha256: "b512f3b726d3b37b6dc4c8570e137b9311e7552e8ccbab4d39d47ce5f4177145" } +version("5.2.3") { source sha256: "71928b357d0a09a12a4b4c5fafca8c31c19b0e7d3b8ebb19622e96f26dbf28cb" } +version("5.2.2") { source sha256: "73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2" } + +source url: "http://tukaani.org/xz/xz-#{version}.tar.gz" + +relative_path "xz-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + # liblzma properly uses CFLAGS for C compilation and CPPFLAGS for common + # flags used across tools such as windres. Don't put anything in it + # that can be misinterpreted by windres. + env["CPPFLAGS"] = "-I#{install_dir}/embedded/include" if windows? + + config_command = [ + "--disable-debug", + "--disable-dependency-tracking", + "--disable-doc", + "--disable-scripts", + "--disable-lzma-links", + "--disable-lzmainfo", + "--disable-lzmadec", + "--disable-xzdec", + "--disable-xz", + ] + config_command << "--disable-nls" if windows? + + configure(*config_command, env: env) + + make "install", env: env +end diff --git a/omnibus/config/software/libmnl.rb b/omnibus/config/software/libmnl.rb new file mode 100644 index 000000000..81ea48cc5 --- /dev/null +++ b/omnibus/config/software/libmnl.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libmnl" +default_version "1.0.4" + +license "GPL-2.1" +license_file "COPYING" +skip_transitive_dependency_licensing true + +version("1.0.4") { source sha256: "171f89699f286a5854b72b91d06e8f8e3683064c5901fb09d954a9ab6f551f81" } + +source url: "https://www.netfilter.org/pub/libmnl/libmnl-#{version}.tar.bz2" + +relative_path "#{name}-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "./configure --prefix=#{install_dir}/embedded", env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/libnftnl.rb b/omnibus/config/software/libnftnl.rb new file mode 100644 index 000000000..13a3843be --- /dev/null +++ b/omnibus/config/software/libnftnl.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libnftnl" +default_version "1.2.0" + +license "GPL-2.1" +license_file "COPYING" +skip_transitive_dependency_licensing true + +version("1.2.0") { source sha256: "90b01fddfe9be8c3245c3ba5ff5a4424a8df708828f92b2b361976b658c074f5" } + +source url: "https://www.netfilter.org/pub/libnftnl/libnftnl-#{version}.tar.bz2" + +relative_path "#{name}-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "./configure --prefix=#{install_dir}/embedded", env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/libossp-uuid.rb b/omnibus/config/software/libossp-uuid.rb new file mode 100644 index 000000000..2d625916a --- /dev/null +++ b/omnibus/config/software/libossp-uuid.rb @@ -0,0 +1,45 @@ +# +# Copyright 2012-2014 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libossp-uuid" +default_version "1.6.2" + +license "MIT" +license_file "README" +skip_transitive_dependency_licensing true + +dependency "config_guess" + +# version_list: url=https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/ filter=*.tar.gz + +version("1.6.2") { source sha256: "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0" } + +# ftp on ftp.ossp.org is unavaiable so we must use another mirror site. +source url: "https://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-#{version}.tar.gz" + +relative_path "uuid-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + update_config_guess + + command "./configure" \ + " --prefix=#{install_dir}/embedded", env: env + + make "-j #{workers}", env: env + make "install", env: env +end diff --git a/omnibus/config/software/libtool.rb b/omnibus/config/software/libtool.rb new file mode 100644 index 000000000..a850304fe --- /dev/null +++ b/omnibus/config/software/libtool.rb @@ -0,0 +1,55 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libtool" +default_version "2.4.6" + +license "GPL-2.0" +license_file "COPYING" +skip_transitive_dependency_licensing true + +dependency "config_guess" + +# version_list: url=https://ftp.gnu.org/gnu/libtool/ filter=*.tar.gz + +version("2.4.6") { source sha256: "e3bd4d5d3d025a36c21dd6af7ea818a2afcd4dfc1ea5a17b39d7854bcd0c06e3" } +version("2.4.2") { source sha256: "b38de44862a987293cd3d8dfae1c409d514b6c4e794ebc93648febf9afc38918" } +version("2.4") { source sha256: "13df57ab63a94e196c5d6e95d64e53262834fe780d5e82c28f177f9f71ddf62e" } + +source url: "https://ftp.gnu.org/gnu/libtool/libtool-#{version}.tar.gz" + +relative_path "libtool-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + update_config_guess + update_config_guess(target: "libltdl/config") + + if aix? + env["M4"] = "/opt/freeware/bin/m4" + elsif solaris2? + # We hit this bug on Solaris11 platforms bug#14291: libtool 2.4.2 fails to build due to macro_revision reversion + # The problem occurs with LANG=en_US.UTF-8 but not with LANG=C + env["LANG"] = "C" + end + + command "./configure" \ + " --prefix=#{install_dir}/embedded", env: env + + make env: env + make "install", env: env +end diff --git a/omnibus/config/software/libxml2.rb b/omnibus/config/software/libxml2.rb new file mode 100644 index 000000000..6c6e966e8 --- /dev/null +++ b/omnibus/config/software/libxml2.rb @@ -0,0 +1,61 @@ +# +# Copyright:: Chef Software Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "libxml2" +default_version "2.9.10" # 2.9.12 is not properly building as of 5.20.21 + +license "MIT" +license_file "COPYING" +skip_transitive_dependency_licensing true + +dependency "zlib" +dependency "liblzma" +dependency "config_guess" + +# version_list: url=ftp://xmlsoft.org/libxml2/ filter=libxml2-*.tar.gz +version("2.9.12") { source sha256: "c8d6681e38c56f172892c85ddc0852e1fd4b53b4209e7f4ebf17f7e2eae71d92" } +version("2.9.10") { source sha256: "aafee193ffb8fe0c82d4afef6ef91972cbaf5feea100edc2f262750611b4be1f" } +version("2.9.9") { source sha256: "94fb70890143e3c6549f265cee93ec064c80a84c42ad0f23e85ee1fd6540a871" } + +source url: "ftp://xmlsoft.org/libxml2/libxml2-#{version}.tar.gz" + +relative_path "libxml2-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + configure_command = [ + "--with-zlib=#{install_dir}/embedded", + "--with-lzma=#{install_dir}/embedded", + "--with-sax1", # required for nokogiri to compile + "--without-iconv", + "--without-python", + "--without-icu", + "--without-debug", + "--without-mem-debug", + "--without-run-debug", + "--without-legacy", # we don't need legacy interfaces + "--without-catalog", + "--without-docbook", + ] + + update_config_guess + + configure(*configure_command, env: env) + + make "-j #{workers}", env: env + make "install", env: env +end diff --git a/omnibus/config/software/linenoise.rb b/omnibus/config/software/linenoise.rb new file mode 100644 index 000000000..2e660d366 --- /dev/null +++ b/omnibus/config/software/linenoise.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2012-2014 FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "linenoise" +description "A small self-contained alternative to readline and libedit" + +license_file "LICENSE" +skip_transitive_dependency_licensing true + +source github: "antirez/linenoise" +default_version "master" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "gcc -c linenoise.c -o linenoise.o -fPIC", env: env + command "gcc -shared -o liblinenoise.so linenoise.o -lm", env: env + + copy "liblinenoise.so", "#{install_dir}/embedded/lib/" + copy "linenoise.h", "#{install_dir}/embedded/include/" +end diff --git a/omnibus/config/software/m4.rb b/omnibus/config/software/m4.rb new file mode 100644 index 000000000..3b66693f0 --- /dev/null +++ b/omnibus/config/software/m4.rb @@ -0,0 +1,40 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-04 + +name "m4" +default_version "1.4.18" + +license "GPL-3.0" +license_file "COPYING" +skip_transitive_dependency_licensing true + +version("1.4.18") { source sha256: "ab2633921a5cd38e48797bf5521ad259bdc4b979078034a3b790d7fec5493fab" } + +source url: "https://ftp.gnu.org/gnu/m4/m4-#{version}.tar.gz" + +relative_path "m4-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + patch source: "m4-1.4.18-glibc-change-work-around.patch", plevel: 1, env: env if version == "1.4.18" + + command "./configure --prefix=#{install_dir}/embedded", env: env + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/ncurses.rb b/omnibus/config/software/ncurses.rb new file mode 100644 index 000000000..8f6e98b0d --- /dev/null +++ b/omnibus/config/software/ncurses.rb @@ -0,0 +1,159 @@ +# frozen_string_literal: true + +# Copyright 2012-2019, Chef Software Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "ncurses" +default_version "6.2" + +license "MIT" +license_file "http://invisible-island.net/ncurses/ncurses-license.html" +license_file "http://invisible-island.net/ncurses/ncurses.faq.html" +skip_transitive_dependency_licensing true + +dependency "config_guess" + +# versions_list: https://ftp.gnu.org/gnu/ncurses/ filter=*.tar.gz +version("6.2") { source sha256: "30306e0c76e0f9f1f0de987cf1c82a5c21e1ce6568b9227f7da5b71cbea86c9d" } +version("6.1") { source sha256: "aa057eeeb4a14d470101eff4597d5833dcef5965331be3528c08d99cebaa0d17" } +version("5.9") { source sha256: "9046298fb440324c9d4135ecea7879ffed8546dd1b58e59430ea07a4633f563b" } + +source url: "https://ftp.gnu.org/gnu/ncurses/ncurses-#{version}.tar.gz" + +relative_path "ncurses-#{version}" + +######################################################################## +# +# wide-character support: +# Ruby 1.9 optimistically builds against libncursesw for UTF-8 +# support. In order to prevent Ruby from linking against a +# package-installed version of ncursesw, we build wide-character +# support into ncurses with the "--enable-widec" configure parameter. +# To support other applications and libraries that still try to link +# against libncurses, we also have to create non-wide libraries. +# +# The methods below are adapted from: +# http://www.linuxfromscratch.org/lfs/view/development/chapter06/ncurses.html +# +######################################################################## + +build do + env = with_standard_compiler_flags(with_embedded_path) + env.delete("CPPFLAGS") + + if smartos? + # SmartOS is Illumos Kernel, plus NetBSD userland with a GNU toolchain. + # These patches are taken from NetBSD pkgsrc and provide GCC 4.7.0 + # compatibility: + # http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/devel/ncurses/patches/ + patch source: "patch-aa", plevel: 0, env: env + patch source: "patch-ab", plevel: 0, env: env + patch source: "patch-ac", plevel: 0, env: env + patch source: "patch-ad", plevel: 0, env: env + patch source: "patch-cxx_cursesf.h", plevel: 0, env: env + patch source: "patch-cxx_cursesm.h", plevel: 0, env: env + + # Chef patches - + # The configure script from the pristine tarball detects xopen_source_extended incorrectly. + # Manually working around a false positive. + patch source: "ncurses-5.9-solaris-xopen_source_extended-detection.patch", plevel: 0, env: env + end + + update_config_guess + + # AIX's old version of patch doesn't like the patches here + unless aix? + if version == "5.9" + # Patch to add support for GCC 5, doesn't break previous versions + patch source: "ncurses-5.9-gcc-5.patch", plevel: 1, env: env + end + end + + if mac_os_x? || + # Clang became the default compiler in FreeBSD 10+ + (freebsd? && ohai["os_version"].to_i >= 1000024) + # References: + # https://github.com/Homebrew/homebrew-dupes/issues/43 + # http://invisible-island.net/ncurses/NEWS.html#t20110409 + # + # Patches ncurses for clang compiler. Changes have been accepted into + # upstream, but occurred shortly after the 5.9 release. We should be able + # to remove this after upgrading to any release created after June 2012 + patch source: "ncurses-clang.patch", env: env + end + + if openbsd? + patch source: "patch-ncurses_tinfo_lib__baudrate.c", plevel: 0, env: env + end + + configure_command = [ + "./configure", + "--prefix=#{install_dir}/embedded", + "--enable-overwrite", + "--with-shared", + "--with-termlib", + "--without-ada", + "--without-cxx-binding", + "--without-debug", + "--without-manpages" + ] + + if aix? + # AIX kinda needs 5.9-20140621 or later + # because of a naming snafu in shared library naming. + # see http://invisible-island.net/ncurses/NEWS.html#t20140621 + + # let libtool deal with library silliness + configure_command << "--with-libtool=\"#{install_dir}/embedded/bin/libtool\"" + + # stick with just the shared libs on AIX + configure_command << "--without-normal" + + # ncurses's ./configure incorrectly + # "figures out" ARFLAGS if you try + # to set them yourself + env.delete("ARFLAGS") + + # use gnu install from the coreutils IBM rpm package + env["INSTALL"] = "/opt/freeware/bin/install" + end + + command configure_command.join(" "), env: env + + # unfortunately, libtool may try to link to libtinfo + # before it has been assembled; so we have to build in serial + make "libs", env: env if aix? + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env + + # Build non-wide-character libraries + make "distclean", env: env + configure_command << "--enable-widec" + + command configure_command.join(" "), env: env + make "libs", env: env if aix? + make "-j #{workers}", env: env + + # Installing the non-wide libraries will also install the non-wide + # binaries, which doesn't happen to be a problem since we don't + # utilize the ncurses binaries in private-chef (or oss chef) + make "-j #{workers} install", env: env + + # Ensure embedded ncurses wins in the LD search path + if smartos? + link "#{install_dir}/embedded/lib/libcurses.so", "#{install_dir}/embedded/lib/libcurses.so.1" + end +end diff --git a/omnibus/config/software/nftables.rb b/omnibus/config/software/nftables.rb new file mode 100644 index 000000000..019735130 --- /dev/null +++ b/omnibus/config/software/nftables.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright:: FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +name "nftables" + +license_file "COPYING" + +# Some weirdness in the official release package so use git and switch to tag +# default_version "0.9.9" +# source url: "https://www.netfilter.org/pub/nftables/nftables-#{version}.tar.bz2" +# version("0.9.9") { source sha256: "76ef2dc7fd0d79031a8369487739a217ca83996b3a746cec5bda79da11e3f1b4" } +source git: "git://git.netfilter.org/nftables" +default_version "v0.9.9" + +relative_path "#{name}-#{version}" + +dependency "gmp" +dependency "m4" +dependency "bison" +dependency "flex" +dependency "libmnl" +dependency "libnftnl" +dependency "libtool" +dependency "linenoise" +dependency "pkg-config" + +build do + env = with_standard_compiler_flags(with_embedded_path) + configure_cmd = [ + "./configure", + "--prefix=#{install_dir}/embedded", + "--disable-debug", + "--disable-man-doc", + "--with-cli=linenoise" # readline seems to fail to be detected and libedit fails with missing "editline/history.h" + ] + command "./autogen.sh", env: env + command configure_cmd.join(" "), env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/nodejs.rb b/omnibus/config/software/nodejs.rb new file mode 100644 index 000000000..79a94aae5 --- /dev/null +++ b/omnibus/config/software/nodejs.rb @@ -0,0 +1,22 @@ +name "nodejs" +description "NodeJS" +default_version "16.6.2" +license_file "LICENSE" + +source url: "https://github.com/nodejs/node/archive/refs/tags/v#{version}.tar.gz" + +version("16.6.2") do + source sha256: "9b539b1ea5e3fbd173fcbaae97088401b228c36c2076c98d04c73802713bbb73" +end + +dependency "python" + +relative_path "node-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "./configure --prefix=#{install_dir}/embedded", env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/openssl.rb b/omnibus/config/software/openssl.rb new file mode 100644 index 000000000..48829bbea --- /dev/null +++ b/omnibus/config/software/openssl.rb @@ -0,0 +1,177 @@ +# +# Copyright:: Chef Software Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "openssl" + +license "OpenSSL" +license_file "LICENSE" +skip_transitive_dependency_licensing true + +dependency "cacerts" +dependency "openssl-fips" if fips_mode? + +default_version "1.1.1k" # do_not_auto_update + +# Openssl builds engines as libraries into a special directory. We need to include +# that directory in lib_dirs so omnibus can sign them during macOS deep signing. +lib_dirs lib_dirs.concat(["#{install_dir}/embedded/lib/engines"]) +lib_dirs lib_dirs.concat(["#{install_dir}/embedded/lib/engines-1.1"]) if version.start_with?("1.1") + +# OpenSSL source ships with broken symlinks which windows doesn't allow. +# So skip error checking with `extract: :lax_tar` +if version.satisfies?("> 1.0.2u") && version.satisfies?("< 1.1.0") + # 1.0.2u was the last public release of 1.0.2. Subsequent releases come from a support contract with OpenSSL Software Services + source url: "https://s3.amazonaws.com/chef-releng/openssl/openssl-#{version}.tar.gz", extract: :lax_tar +else + # As of 2020-09-09 even openssl-1.0.0.tar.gz can be downloaded from /source/openssl-VERSION.tar.gz + # However, the latest releases are not in /source/old/VERSION/openssl-VERSION.tar.gz. + # Let's stick with the simpler one for now. + source url: "https://www.openssl.org/source/openssl-#{version}.tar.gz", extract: :lax_tar +end + +version("1.1.1k") { source sha256: "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5" } +version("1.1.1j") { source sha256: "aaf2fcb575cdf6491b98ab4829abf78a3dec8402b8b81efc8f23c00d443981bf" } +version("1.1.1i") { source sha256: "e8be6a35fe41d10603c3cc635e93289ed00bf34b79671a3a4de64fcee00d5242" } + +version("1.0.2y") { source sha256: "4882ec99f8e147ab26375da8a6af92efae69b6aef505234764f8cd00a1b81ffc" } +version("1.0.2x") { source sha256: "79cb4e20004a0d1301210aee7e154ddfba3d6a33d0df1f6c5d3257cb915a59c9" } +version("1.0.2w") { source sha256: "a675ad1a9df59015cebcdf713de76a422347c5d99f11232fe75758143defd680" } +version("1.0.2i") { source sha256: "9287487d11c9545b6efb287cdb70535d4e9b284dd10d51441d9b9963d000de6f" } + + +relative_path "openssl-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + if aix? + env["M4"] = "/opt/freeware/bin/m4" + elsif mac_os_x? && arm? + env["CFLAGS"] << " -Qunused-arguments" + elsif freebsd? + # Should this just be in standard_compiler_flags? + env["LDFLAGS"] += " -Wl,-rpath,#{install_dir}/embedded/lib" + elsif windows? + # XXX: OpenSSL explicitly sets -march=i486 and expects that to be honored. + # It has OPENSSL_IA32_SSE2 controlling whether it emits optimized SSE2 code + # and the 32-bit calling convention involving XMM registers is... vague. + # Do not enable SSE2 generally because the hand optimized assembly will + # overwrite registers that mingw expects to get preserved. + env["CFLAGS"] = "-I#{install_dir}/embedded/include" + env["CPPFLAGS"] = env["CFLAGS"] + env["CXXFLAGS"] = env["CFLAGS"] + end + + configure_args = [ + "--prefix=#{install_dir}/embedded", + "no-unit-test", + "no-comp", + "no-idea", + "no-mdc2", + "no-rc5", + "no-ssl2", + "no-ssl3", + "no-zlib", + "shared", + ] + + configure_args += ["--with-fipsdir=#{install_dir}/embedded", "fips"] if fips_mode? + + configure_cmd = + if aix? + "perl ./Configure aix64-cc" + elsif mac_os_x? + intel? ? "./Configure darwin64-x86_64-cc" : "./Configure darwin64-arm64-cc no-asm" + elsif smartos? + "/bin/bash ./Configure solaris64-x86_64-gcc -static-libgcc" + elsif omnios? + "/bin/bash ./Configure solaris-x86-gcc" + elsif solaris2? + platform = sparc? ? "solaris64-sparcv9-gcc" : "solaris64-x86_64-gcc" + if version.satisfies?("< 1.1.0") + "/bin/bash ./Configure #{platform} -static-libgcc" + else + "./Configure #{platform} -static-libgcc" + end + elsif windows? + platform = windows_arch_i386? ? "mingw" : "mingw64" + "perl.exe ./Configure #{platform}" + else + prefix = + if linux? && ppc64? + "./Configure linux-ppc64" + elsif linux? && s390x? + # With gcc > 4.3 on s390x there is an error building + # with inline asm enabled + "./Configure linux64-s390x -DOPENSSL_NO_INLINE_ASM" + else + "./config" + end + "#{prefix} disable-gost" + end + + patch_env = if aix? + # This enables omnibus to use 'makedepend' + # from fileset 'X11.adt.imake' (AIX install media) + env["PATH"] = "/usr/lpp/X11/bin:#{ENV["PATH"]}" + penv = env.dup + penv["PATH"] = "/opt/freeware/bin:#{env["PATH"]}" + penv + else + env + end + + if version.start_with? "1.0" + patch source: "openssl-1.0.1f-do-not-build-docs.patch", env: patch_env + elsif version.start_with? "1.1" + patch source: "openssl-1.1.0f-do-not-install-docs.patch", env: patch_env + end + + if version.start_with?("1.0.2") && mac_os_x? && arm? + patch source: "openssl-1.0.2x-darwin-arm64.patch" + end + + if version.start_with?("1.0.2") && windows? + # Patch Makefile.org to update the compiler flags/options table for mingw. + patch source: "openssl-1.0.1q-fix-compiler-flags-table-for-msys.patch", env: env + end + + # Out of abundance of caution, we put the feature flags first and then + # the crazy platform specific compiler flags at the end. + configure_args << env["CFLAGS"] << env["LDFLAGS"] + + configure_command = configure_args.unshift(configure_cmd).join(" ") + + command configure_command, env: env, in_msys_bash: true + + if version.start_with?("1.0.2") && windows? + patch source: "openssl-1.0.1j-windows-relocate-dll.patch", env: env + end + + make "depend", env: env + # make -j N on openssl is not reliable + make "-j #{workers}", env: env + if aix? + # We have to sudo this because you can't actually run slibclean without being root. + # Something in openssl changed in the build process so now it loads the libcrypto + # and libssl libraries into AIX's shared library space during the first part of the + # compile. This means we need to clear the space since it's not being used and we + # can't install the library that is already in use. Ideally we would patch openssl + # to make this not be an issue. + # Bug Ref: http://rt.openssl.org/Ticket/Display.html?id=2986&user=guest&pass=guest + command "sudo /usr/sbin/slibclean", env: env + end + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/perl-thread-queue.rb b/omnibus/config/software/perl-thread-queue.rb new file mode 100644 index 000000000..bd5461084 --- /dev/null +++ b/omnibus/config/software/perl-thread-queue.rb @@ -0,0 +1,40 @@ +# +# Copyright 2019 Oregon State University +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-04 + +name "perl-thread-queue" +default_version "3.13" + +dependency "perl" + +version "3.13" do + source sha256: "6ba3dacddd2fbb66822b4aa1d11a0a5273cd04c825cb3ff31c20d7037cbfdce8" +end + +source url: "http://search.cpan.org/CPAN/authors/id/J/JD/JDHEDDEN/Thread-Queue-#{version}.tar.gz" + +relative_path "Thread-Queue-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path).merge( + "INSTALL_BASE" => "#{install_dir}/embedded" + ) + + command "#{install_dir}/embedded/bin/perl Makefile.PL", env: env + + make env: env + make "install", env: env +end diff --git a/omnibus/config/software/perl.rb b/omnibus/config/software/perl.rb new file mode 100644 index 000000000..2cb55bec7 --- /dev/null +++ b/omnibus/config/software/perl.rb @@ -0,0 +1,74 @@ +# +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "perl" + +license "Artistic-2.0" +license_file "Artistic" +skip_transitive_dependency_licensing true + +default_version "5.34.0" + +# versions_list: http://www.cpan.org/src/ filter=*.tar.gz +version("5.34.0") { source sha256: "551efc818b968b05216024fb0b727ef2ad4c100f8cb6b43fab615fa78ae5be9a" } +version("5.32.1") { source sha256: "03b693901cd8ae807231b1787798cf1f2e0b8a56218d07b7da44f784a7caeb2c" } +version("5.30.0") { source sha256: "851213c754d98ccff042caa40ba7a796b2cee88c5325f121be5cbb61bbf975f2" } +version("5.22.1") { source sha256: "2b475d0849d54c4250e9cba4241b7b7291cffb45dfd083b677ca7b5d38118f27" } +version("5.18.1") { source sha256: "655e11a8ffba8853efcdce568a142c232600ed120ac24aaebb4e6efe74e85b2b" } +source url: "http://www.cpan.org/src/5.0/perl-#{version}.tar.gz" + +# perl builds perl as libraries into a special directory. We need to include +# that directory in lib_dirs so omnibus can sign them during macOS deep signing. +lib_dirs lib_dirs.concat ["#{install_dir}/embedded/lib/perl5/**"] + +relative_path "perl-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + patch source: "perl-#{version}-remove_lnsl.patch", plevel: 1, env: env + + if solaris2? + cc_command = "-Dcc='gcc -m64 -static-libgcc'" + elsif aix? + cc_command = "-Dcc='/opt/IBM/xlc/13.1.0/bin/cc_r -q64'" + elsif freebsd? && ohai["os_version"].to_i >= 1000024 + cc_command = "-Dcc='clang'" + elsif mac_os_x? + cc_command = "-Dcc='clang'" + else + cc_command = "-Dcc='gcc -static-libgcc'" + end + + configure_command = ["sh Configure", + " -de", + " -Dprefix=#{install_dir}/embedded", + " -Duseshrplib", + " -Dusethreads", + " #{cc_command}", + " -Dnoextensions='DB_File GDBM_File NDBM_File ODBM_File'"] + + if aix? + configure_command << "-Dmake=gmake" + configure_command << "-Duse64bitall" + end + + command configure_command.join(" "), env: env + make "-j #{workers}", env: env + # using the install.perl target lets + # us skip install the manpages + make "install.perl", env: env +end diff --git a/omnibus/config/software/pkg-config.rb b/omnibus/config/software/pkg-config.rb new file mode 100644 index 000000000..9cb179803 --- /dev/null +++ b/omnibus/config/software/pkg-config.rb @@ -0,0 +1,66 @@ +# +# Copyright 2013-2014 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# expeditor/ignore: deprecated 2021-05 + +name "pkg-config" +default_version "0.28" + +dependency "libiconv" +dependency "config_guess" + +# version_list: url=https://pkgconfig.freedesktop.org/releases/ filter=*.tar.gz + +version("0.28") { source sha256: "6b6eb31c6ec4421174578652c7e141fdaae2dabad1021f420d8713206ac1f845" } + +source url: "https://pkgconfig.freedesktop.org/releases/pkg-config-#{version}.tar.gz" + +relative_path "pkg-config-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + update_config_guess + + # pkg-config (at least up to 0.28) includes an older version of + # libcharset/lib/config.charset that doesn't know about openbsd + if openbsd? + patch source: "openbsd-charset.patch", plevel: 1, env: env + end + + command "./configure" \ + " --prefix=#{install_dir}/embedded" \ + " --disable-debug" \ + " --disable-host-tool" \ + " --with-internal-glib" \ + " --with-pc-path=#{install_dir}/embedded/bin/pkgconfig", env: env + + # #203: pkg-configs internal glib does not provide a way to pass ldflags. + # Only allows GLIB_CFLAGS and GLIB_LIBS. + # These do not serve our purpose, so we must explicitly + # ./configure in the glib dir, with the Omnibus ldflags. + command "./configure" \ + " --prefix=#{install_dir}/embedded" \ + " --with-libiconv=gnu", env: env, cwd: "#{project_dir}/glib" + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env + + # ensure charset.alias gets installed on openbsd else pkg-config will + # exit with byte conversion errors. + if openbsd? + copy "#{project_dir}/glib/glib/libcharset/charset.alias", "#{install_dir}/embedded/lib/charset.alias" + end +end diff --git a/omnibus/config/software/postgresql.rb b/omnibus/config/software/postgresql.rb new file mode 100644 index 000000000..2fa76fa2d --- /dev/null +++ b/omnibus/config/software/postgresql.rb @@ -0,0 +1,65 @@ +# frozen_string_literal: true + +# Copyright:: Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "postgresql" +default_version "13.3" + +license "PostgreSQL" +license_file "COPYRIGHT" +skip_transitive_dependency_licensing true + +dependency "zlib" +dependency "openssl" +dependency "libedit" +dependency "libossp-uuid" +dependency "ncurses" +dependency "config_guess" + +# version_list: url=https://ftp.postgresql.org/pub/source/v#{version}/ filter=*.tar.bz2 + +version("13.3") { source sha256: "3cd9454fa8c7a6255b6743b767700925ead1b9ab0d7a0f9dcb1151010f8eb4a1" } + +# Version 12.x will EoL November 14, 2024 +version("12.7") { source sha256: "8490741f47c88edc8b6624af009ce19fda4dc9b31c4469ce2551d84075d5d995" } + +# Version 9.6 will EoL November 11, 2021 +version("9.6.22") { source sha256: "3d32cd101025a0556813397c69feff3df3d63736adb8adeaf365c522f39f2930" } + +# Version 9.3 was EoL November 8, 2018 (but used in Supermarket as of 6.2021) +version("9.3.25") { source sha256: "e4953e80415d039ccd33d34be74526a090fd585cf93f296cd9c593972504b6db" } + +source url: "https://ftp.postgresql.org/pub/source/v#{version}/postgresql-#{version}.tar.bz2" + +relative_path "postgresql-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + update_config_guess(target: "config") + + command "./configure" \ + " --prefix=#{install_dir}/embedded" \ + " --with-libedit-preferred" \ + " --with-openssl" \ + " --enable-thread-safety" \ + " --with-uuid=ossp" \ + " --with-includes=#{install_dir}/embedded/include" \ + " --with-libraries=#{install_dir}/embedded/lib", env: env + + make "world -j #{workers}", env: env + make "install-world", env: env +end diff --git a/omnibus/config/software/preparation.rb b/omnibus/config/software/preparation.rb new file mode 100644 index 000000000..b45d8a241 --- /dev/null +++ b/omnibus/config/software/preparation.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +# Copyright 2021 FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "preparation" +description "the steps required to prepare the build" +default_version "1.0.0" + +license :project_license +skip_transitive_dependency_licensing true + +build do + block do + touch "#{install_dir}/embedded/lib/.gitkeep" + touch "#{install_dir}/embedded/bin/.gitkeep" + touch "#{install_dir}/bin/.gitkeep" + end +end diff --git a/omnibus/config/software/python.rb b/omnibus/config/software/python.rb new file mode 100644 index 000000000..6065eda71 --- /dev/null +++ b/omnibus/config/software/python.rb @@ -0,0 +1,27 @@ +name "python" +description "Python" +default_version "3.9.6" +license_file "LICENSE" +skip_transitive_dependency_licensing true + +source url: "https://www.python.org/ftp/python/#{version}/Python-#{version}.tgz" + +version("3.9.6") do + source sha256: "d0a35182e19e416fc8eae25a3dcd4d02d4997333e4ad1f2eee6010aadc3fe866" +end + +dependency "bzip2" +dependency "zlib" +dependency "openssl" +dependency "ncurses" +dependency "libffi" + +relative_path "Python-#{version}" + +build do + env = with_standard_compiler_flags(with_embedded_path) + + command "./configure --prefix=#{install_dir}/embedded", env: env + make "-j #{workers}", env: env + make "-j #{workers} install", env: env +end diff --git a/omnibus/config/software/wireguard-tools.rb b/omnibus/config/software/wireguard-tools.rb new file mode 100644 index 000000000..8a9330baa --- /dev/null +++ b/omnibus/config/software/wireguard-tools.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +# Copyright 2021 FireZone +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "wireguard-tools" +description "wireguard userspace utilities" +default_version "1.0.20210424" + +default_src_url = "https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-#{version}.zip" + +version "1.0.20210424" do + source url: default_src_url, sha256: "1ad170ded2d66d7c5a02fc2fd5ac3e195ec1c98133986f2d8223ed5a72c8877f" +end + +relative_path "wireguard-tools-#{version}/src" +license "GPL-2.0" + +build do + env = with_standard_compiler_flags(with_embedded_path).merge( + "PREFIX" => "#{install_dir}/embedded", + "RUNSTATEDIR" => "#{install_dir}/embedded/var/run", + "SYSCONFDIR" => "#{install_dir}/embedded/etc", + "DESTDIR" => "#{install_dir}/embedded" + ) + + make "-j #{workers}", env: env + make "install", env: env +end diff --git a/omnibus/config/software/zlib.rb b/omnibus/config/software/zlib.rb new file mode 100644 index 000000000..1addf87f8 --- /dev/null +++ b/omnibus/config/software/zlib.rb @@ -0,0 +1,83 @@ +# +# Copyright 2012-2018 Chef Software, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name "zlib" +default_version "1.2.11" + +# version_list: url=https://zlib.net/fossils/ filter=*.tar.gz + +version("1.2.11") { source sha256: "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1" } +version("1.2.8") { source sha256: "36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d" } +version("1.2.6") { source sha256: "21235e08552e6feba09ea5e8d750805b3391c62fb81c71a235c0044dc7a8a61b" } + +source url: "https://zlib.net/fossils/zlib-#{version}.tar.gz" + +license "Zlib" +license_file "README" +skip_transitive_dependency_licensing true + +relative_path "zlib-#{version}" + +build do + if windows? + env = with_standard_compiler_flags(with_embedded_path) + + patch source: "zlib-windows-relocate.patch", env: env + + # We can't use the top-level Makefile. Instead, the developers have made + # an organic, artisanal, hand-crafted Makefile.gcc for us which takes a few + # variables. + env["BINARY_PATH"] = "/bin" + env["LIBRARY_PATH"] = "/lib" + env["INCLUDE_PATH"] = "/include" + env["DESTDIR"] = "#{install_dir}/embedded" + + make_args = [ + "-fwin32/Makefile.gcc", + "SHARED_MODE=1", + "CFLAGS=\"#{env["CFLAGS"]} -Wall\"", + "ASFLAGS=\"#{env["CFLAGS"]} -Wall\"", + "LDFLAGS=\"#{env["LDFLAGS"]}\"", + # The win32 makefile for zlib does not handle parallel make correctly. + # In particular, see its rule for IMPLIB and SHAREDLIB. The ld step in + # SHAREDLIB will generate both the dll and the dll.a files. The step to + # strip the dll occurs next but since the dll.a file is already present, + # make will attempt to link example_d.exe and minigzip_d.exe in parallel + # with the strip step - causing gcc to freak out when a source file is + # rewritten part way through the linking stage. + # "-j #{workers}", + ] + + make(*make_args, env: env) + make("install", *make_args, env: env) + else + # We omit the omnibus path here because it breaks mac_os_x builds by picking + # up the embedded libtool instead of the system libtool which the zlib + # configure script cannot handle. + # TODO: Do other OSes need this? Is this strictly a mac thing? + env = with_standard_compiler_flags + if freebsd? + # FreeBSD 10+ gets cranky if zlib is not compiled in a + # position-independent way. + env["CFLAGS"] << " -fPIC" + end + + configure env: env + + make "-j #{workers}", env: env + make "-j #{workers} install", env: env + end +end diff --git a/omnibus/omnibus.rb b/omnibus/omnibus.rb new file mode 100644 index 000000000..a6ac50a23 --- /dev/null +++ b/omnibus/omnibus.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# This file is used to configure the firezone project. It contains +# some minimal configuration examples for working with Omnibus. For a full list +# of configurable options, please see the documentation for +omnibus/config.rb+. +# + +# Build internally +# ------------------------------ +# By default, Omnibus uses system folders (like +/var+ and +/opt+) to build and +# cache components. If you would to build everything internally, you can +# uncomment the following options. This will prevent the need for root +# permissions in most cases. +# +# Uncomment this line to change the default base directory to "local" +# ------------------------------------------------------------------- +base_dir("/tmp/omnibus-local") +# +# Alternatively you can tune the individual values +# ------------------------------------------------ +# cache_dir './local/omnibus/cache' +# git_cache_dir './local/omnibus/cache/git_cache' +# source_dir './local/omnibus/src' +# build_dir './local/omnibus/build' +# package_dir './local/omnibus/pkg' +# package_tmp './local/omnibus/pkg-tmp' + +# Disable git caching +# ------------------------------ +# use_git_caching false + +# Enable S3 asset caching +# ------------------------------ +# use_s3_caching true +# s3_access_key ENV['AWS_ACCESS_KEY_ID'] +# s3_secret_key ENV['AWS_SECRET_ACCESS_KEY'] +# s3_profile ENV['AWS_S3_PROFILE'] +# s3_iam_role_arn ENV['S3_IAM_ROLE_ARN'] +# s3_bucket ENV['AWS_S3_BUCKET'] + +# Customize compiler bits +# ------------------------------ +# solaris_compiler 'gcc' +# build_retries 5 +# fetcher_read_timeout 120 +# fetcher_retries 5 + +# Load additional software +# ------------------------------ +# software_gems ['omnibus-software', 'my-company-software'] +# local_software_dirs ['/path/to/local/software'] + +# Windows architecture defaults +# ------------------------------ +windows_arch %w[x86 x64].include?((ENV["OMNIBUS_WINDOWS_ARCH"] || "").downcase) ? + ENV["OMNIBUS_WINDOWS_ARCH"].downcase.to_sym : :x86 diff --git a/omnibus/package-scripts/firezone/postinst b/omnibus/package-scripts/firezone/postinst new file mode 100755 index 000000000..15757b513 --- /dev/null +++ b/omnibus/package-scripts/firezone/postinst @@ -0,0 +1,17 @@ +#!/bin/sh +# +# Perform necessary firezone setup steps +# after package is installed. +# + +PROGNAME=`basename $0` + +error_exit() +{ + echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + exit 1 +} + +echo "Thank you for installing firezone!" + +exit 0 diff --git a/omnibus/package-scripts/firezone/postrm b/omnibus/package-scripts/firezone/postrm new file mode 100755 index 000000000..6bdd7d3dd --- /dev/null +++ b/omnibus/package-scripts/firezone/postrm @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Perform necessary firezone removal steps +# after package is uninstalled. +# + +echo "firezone has been uninstalled!" + +exit 0 diff --git a/omnibus/package-scripts/firezone/preinst b/omnibus/package-scripts/firezone/preinst new file mode 100755 index 000000000..3994a1f0f --- /dev/null +++ b/omnibus/package-scripts/firezone/preinst @@ -0,0 +1,7 @@ +#!/bin/sh +# +# Perform necessary firezone setup steps +# before package is installed. +# + +echo "You're about to install firezone!" diff --git a/omnibus/package-scripts/firezone/prerm b/omnibus/package-scripts/firezone/prerm new file mode 100755 index 000000000..1caed5c47 --- /dev/null +++ b/omnibus/package-scripts/firezone/prerm @@ -0,0 +1,15 @@ +#!/bin/sh +# +# Perform necessary firezone setup steps +# prior to uninstalling package. +# + +PROGNAME=`basename $0` + +error_exit() +{ + echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 + exit 1 +} + +exit 0 diff --git a/scripts/install.sh b/scripts/install.sh index 5a8b29139..0344039f1 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -34,7 +34,43 @@ else download_release fi -echo "Extracting package to /opt/firezone..." -tar -zxf $file -C /opt/ +echo "Setting up FireZone..." +echo -echo "FireZone installed!" +if id firezone &>/dev/null; then + echo "firezone user exists... not creating." +else + echo "Creating system user firezone" + useradd --system firezone +fi + +echo "Extracting package to /opt/firezone..." +echo +tar -zxf $file -C /opt/ +chmod -R firezone:firezone /opt/firezone + +# Create DB user +echo "Creating DB user..." +hostname=$(hostname) +db_user=firezone +db_password="$(openssl rand -hex 16)" +res=$(su postgres -c "psql -c \"SELECT 1 FROM pg_roles WHERE rolname = '${db_user}';\"") +if [[ $res == *"0 rows"* ]]; then + su postgres -c "psql -c \"CREATE ROLE ${db_user} WITH LOGIN PASSWORD '${db_password}';\"" +else + echo "${db_user} role found in DB" +fi + +# Create DB if not exists +db_name=firezone +res=$(su postgres -c "psql -c \"SELECT 1 FROM pg_database WHERE datname = '${db_name}';\"") +if [[ $res == *"0 rows"* ]]; then + su postgres -c "psql -c \"CREATE DATABASE firezone;\" || true" +else + echo "${db_name} exists; not creating" +fi + + + + +echo "FireZone installed successfully!"