diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml new file mode 100644 index 0000000..3e5933b --- /dev/null +++ b/.github/workflows/build-docker.yml @@ -0,0 +1,47 @@ +# Copyright (c) NetworkFusion 2023 +# See LICENSE file in the project root for full license information. + +name: Build Docker Container + +env: + GCR_FILE: Dockerfile + GCR_REPO: n64-tools + GCR_IMAGE: gcc-toolchain-mips64 + GCR_VERSION: 12.0 + +on: + push: + branches: + - main + - master + paths: + - '**Dockerfile' + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v3 + with: + file: ${{ env.GCR_FILE }} + push: true # Will only build if this is not here + tags: | + ghcr.io/${{ env.GCR_REPO }}/${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }} + ghcr.io/${{ env.GCR_REPO }}/${{ env.GCR_IMAGE }}:latest \ No newline at end of file diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 41216f0..b2820b7 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -1,111 +1,270 @@ -name: CI +# Copyright (c) NetworkFusion 2023 +# See LICENSE file in the project root for full license information. + +# This workflow will build the libdragon N64 GCC toolchain to keep it up-to-date. +name: Build latest libdragon N64 MIPS GCC toolchain on: + # This action will take about 40-70 minutes to run! + # TODO: Should actually do it on cron once a month (if not manually run). push: pull_request: - branches: - - '!develop**' # excludes develop* branches (reserved to not duplicate builds that are not on forks) - # repository_dispatch: - # types: [run_build] - + jobs: - build: + build-toolchain: + # targets the oldest ubuntu image available to create valid packages for as many versions possible. + # TODO: move to using a docker container to support older versions. + runs-on: ubuntu-20.04 + outputs: + gcc-version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} + newlib-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} + binutils-version: ${{ steps.gcc-version-generator.outputs.BINUTILS_VERSION }} + gmp-version: ${{ steps.gcc-version-generator.outputs.GMP_VERSION }} + mpc-version: ${{ steps.gcc-version-generator.outputs.MPC_VERSION }} + mpfr-version: ${{ steps.gcc-version-generator.outputs.MPFR_VERSION }} + make-version: ${{ steps.gcc-version-generator.outputs.MAKE_VERSION }} + strategy: + fail-fast: false + matrix: + include: [ + { target-platform: Windows-x86_64, host: x86_64-w64-mingw32, makefile-version: 4.4 }, + { target-platform: Linux-x86_64, host: '', makefile-version: '' } + ] + + env: + Build_Directory: gcc-toolchain-mips64 + + steps: + - name: Install native system build dependencies + run: | + sudo apt-get install libmpfr-dev + sudo apt-get install texinfo + sudo apt-get install libmpc-dev + sudo apt-get install squashfs-tools + # If there are other dependencies, we should add them here and make sure the documentation is updated! + continue-on-error: true + + - name: Install x-compile system build dependencies + if: ${{ matrix.target-platform == 'Windows-x86_64' }} + run: | + sudo apt-get install -y mingw-w64 + # If there are other dependencies, we should add them here and make sure the documentation is updated! + + # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby + - name: Set up Ruby + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: '3.1' + continue-on-error: true + + - name: Install Package Creator + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + run: | + echo installing jordansissel/fpm ruby package + gem install fpm + fpm --version + continue-on-error: true + + - name: Checkout Code + uses: actions/checkout@v3 + with: + repository: dragonminded/libdragon + fetch-depth: 1 # we only require the last check-in, unless we want to create a changelog. + + # Cache and restore dependencies instead of downloading them to increase build speed. + # Expires after 7 days. + - uses: actions/cache@v3 + id: cache + with: + path: | + ./tools/**/*.tar.gz + ./tools/**/*.tar.bz2 + key: ${{ runner.os }}-dependency-downloads # TODO: concurrency errors may currently occur due to matrix, but they are the same files. + + - name: Get versions from toolchain file + id: gcc-version-generator + run: | + echo "BINUTILS_VERSION=$(grep -Po 'BINUTILS_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "NEWLIB_VERSION=$(grep -Po 'NEWLIB_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + + echo "GMP_VERSION=$(grep -Po 'GMP_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "MPC_VERSION=$(grep -Po 'MPC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "MPFR_VERSION=$(grep -Po 'MPFR_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + # TODO: this version is set explicitly. We need to fix! + echo "MAKE_VERSION=4.4" >> $GITHUB_OUTPUT + continue-on-error: false + + - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} + run: | + # required for newlib (as not the default?!) + export PATH="$PATH:${{ runner.temp }}/${{ env.Build_Directory }}" + cd ./tools/ + sudo N64_INST=${{ runner.temp }}/${{ env.Build_Directory }} HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh + + echo Remove un-necessary content + rm -rf ${N64_INST}/share/locale/* + continue-on-error: true + + # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html + - name: Generate toolchain packages for Linux based OS + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + run: | + echo Generate environment var file + echo 'export N64_INST=$Package_Installation_Directory' > "$Package_Name-env.sh" + chmod 755 "$Package_Name-env.sh" + + # TODO: there is currently a dependency on makefile. but it is not added. + # packages need something like `--depends bash \` + echo Generating debian package + # TODO: a warning is generated when adding files to `\etc`. The current workaround is: --deb-no-default-config-files + fpm \ + -t deb \ + -s dir \ + -p $Package_Name-$Package_Version-$Package_Revision-any.deb \ + --name $Package_Name \ + --license $Package_License \ + --version $Package_Version \ + --architecture all \ + --description "$Package_Description" \ + --url "$Package_Url" \ + --maintainer "$Package_Maintainer" \ + --deb-no-default-config-files \ + $Package_Source_Directory=$Package_Installation_Directory/ \ + $Package_Name-env.sh=/etc/profile.d/$Package_Name-env.sh + + echo Generating rpm package + fpm \ + -t rpm \ + -s dir \ + -p $Package_Name-$Package_Version-$Package_Revision-x86_64.rpm \ + --name $Package_Name \ + --license $Package_License \ + --version $Package_Version \ + --architecture x86_64 \ + --description "$Package_Description" \ + --url "$Package_Url" \ + --maintainer "$Package_Maintainer" \ + $Package_Source_Directory=$Package_Installation_Directory/ \ + $Package_Name-env.sh=/etc/profile.d/$Package_Name-env.sh + continue-on-error: true + env: + Package_Source_Directory: ${{ runner.temp }}/${{ env.Build_Directory }}/ + Package_Installation_Directory: /opt/${{ env.Build_Directory }}-n64tools + Package_Name: ${{ env.Build_Directory }}-n64tools + Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} + Package_Revision: ${{ github.run_id }} + Package_License: GPL + Package_Description: MIPS GCC toolchain for the N64 + Package_Url: https://github.com/n64-tools/ + Package_Maintainer: N64-Tool Contributers + + - name: Publish Windows-x86_64 Build Artifact + if: ${{ matrix.target-platform == 'Windows-x86_64' }} + uses: actions/upload-artifact@v3 + with: + name: gcc-toolchain-mips64-${{ matrix.target-platform }} + path: | + ${{ runner.temp }}/${{ env.Build_Directory }} + continue-on-error: true + + - name: Publish Linux-x86_64 Build Artifacts + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + uses: actions/upload-artifact@v3 + with: + name: gcc-toolchain-mips64-${{ matrix.target-platform }} + path: | + ./**/*.deb + ./**/*.rpm + continue-on-error: true + + release: runs-on: ubuntu-latest +# if: github.event_name == 'release' && github.event.action == 'created' + needs: build-toolchain steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # # Depending on Ubuntu version, maybe required for GCC install. - # - name: Add GCC Repository - # run: | - # sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - # sudo apt-get -qq update - - # Some of these packages may already be installed, but update just incase (it doesn't hurt)! - - name: Install Required Packages - run: | - sudo apt-get install -y build-essential software-properties-common - # sudo apt-get install -y gcc-10 - # sudo apt-get install -y g++-10 - sudo apt-get install -y mingw-w64 - # sudo apt-get install -y libgmp-dev bison - sudo apt-get install -y libmpfr-dev libmpc-dev - sudo apt-get install -y byacc texinfo - sudo apt-get install -y zip gzip tar - # sudo apt-gey install -y gcc-9-locales wine wine64 # not actually required, but suggested by the CI - - # # Generate a changelog (not currently that helpful (and not required for local builds)). - # - name: Create Changelog - # run: | - # touch "CHANGELOG.txt" - # git log --oneline --decorate > CHANGELOG.txt - - # We do it first to fail fast (as most unknown)! - # Build MakeFile against linux (for windows) - - name: Build win64 makefile executable - run: | - cd $GITHUB_WORKSPACE/scripts/build/win64 - bash ./build-win64-makefile.sh - rm ./build-win64-makefile.sh - - # Build the mips64 GCC toolchain against linux - - name: Build linux64 toolchain - run: | - cd $GITHUB_WORKSPACE/scripts/build/linux64 - bash ./build-linux64-toolchain.sh - rm ./build-linux64-toolchain.sh - - # Compress and move the linux folder ready for upload (not needed for local builds). - - name: Compress and move linux artifact to $GITHUB_WORKSPACE/linux64 - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p $GITHUB_WORKSPACE/linux64/ - cd $GITHUB_WORKSPACE/scripts/build/linux64 - tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * - mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-linux64.tar.gz" "$GITHUB_WORKSPACE/linux64/" - - # # Publish the compressed linux folder to the to github Artifacts (not needed unless debugging (adds considerable time)). - # - name: Publish linux Build Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: gcc-toolchain-mips64-linux64 - # path: ${{ github.workspace }}/scripts/build/linux64/* - # retention-days: 5 - - # Build the GCC toolchain against linux (for windows) and compress it (local builds could run build.sh). - - name: Build win64 toolchain - run: | - cd $GITHUB_WORKSPACE/scripts/build/win64 - bash ./build-win64-toolchain.sh - rm ./build-win64-toolchain.sh - - # Compress and move the windows folder ready for upload (not needed for local builds). - - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p $GITHUB_WORKSPACE/win64/ - cd $GITHUB_WORKSPACE/scripts/build/win64 - zip -r -q $GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip * - mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip" "$GITHUB_WORKSPACE/win64/" - - # Publish windows build artifacts to github Artifacts (not needed for local builds). - - name: Publish windows Build Artifacts - uses: actions/upload-artifact@v3 - with: - name: gcc-toolchain-mips64-win64 - path: ${{ github.workspace }}/scripts/build/win64/* - - - name: Generate Draft Release - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 - with: - draft: true - prerelease: true - name: "Vx.x.x-y" - #tag_name: "latest" - files: | - linux64/gcc-toolchain-mips64-linux64.tar.gz - win64/gcc-toolchain-mips64-win64.zip - # CHANGELOG.txt + - uses: actions/checkout@v3 + + - name: Download Windows artifact + id: download-windows-artifact + uses: actions/download-artifact@v3 + with: + name: gcc-toolchain-mips64-Windows-x86_64 + path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 + + - name: Download Linux artifact + id: download-linux-artifact + uses: actions/download-artifact@v3 + with: + name: gcc-toolchain-mips64-Linux-x86_64 + path: ${{ runner.temp }}/gcc-toolchain-mips64-Linux-x86_64 + + - name: Convert files for release upload + run: | + mv ${{ github.workspace }}/LICENSE ${{ github.workspace }}/LICENSE.txt + mv ${{ github.workspace }}/INSTALLATION.md ${{ github.workspace }}/INSTALLATION.txt + + - name: Generate Changelog + run: | + CHANGELOG_TEXT="Latest GCC toolchain for the N64
" + CHANGELOG_TEXT+="Generated from libDragon.
" + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+="Builds toolchain dependencies:
" + CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}
" + CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}
" + CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}
" + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+="With dependencies:
" + CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}
" + CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}
" + CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}
" + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+="Also generates Windows toolchain dependencies:
" + CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}
" + CHANGELOG_TEXT+='
' + echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG + + # Compress and move the windows folder ready for upload. + - name: Compress and move windows artifacts + run: | + cd ${{ steps.download-windows-artifact.outputs.download-path }} + zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * + +# TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. + - name: Generate Release + if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + draft: false + prerelease: false + body_path: CHANGELOG + generate_release_notes: false + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}' + tag_name: "latest" + files: | + ${{ runner.temp }}/**/*.deb + ${{ runner.temp }}/**/*.rpm + ${{ runner.temp }}/*.zip + LICENSE.txt + INSTALLATION.txt + + - name: Generate Draft Pre-Release + if: github.event_name != 'pull_request' + uses: softprops/action-gh-release@v1 + with: + draft: true + prerelease: true + body_path: CHANGELOG + generate_release_notes: false + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}' + tag_name: "toolchain-continuous-prerelease" + files: | + ${{ runner.temp }}/**/*.deb + ${{ runner.temp }}/**/*.rpm + ${{ runner.temp }}/*.zip + LICENSE.txt + INSTALLATION.txt diff --git a/.gitignore b/.gitignore index 32f752f..942be1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,54 +1,9 @@ -# Prerequisites -*.d - -# Object files -*.o -*.ko +# Generated debug files +*.zip +*.bin *.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf +*.tar.* +*.deb +*.rpm .vs/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8f6b8c9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1 +# V0 - Use this comment to force a re-build without changing the contents + +# Stage 1 - Build the toolchain +FROM debian:stable-slim AS toolchain-builder +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# Install required dependencies +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils \ + && apt-get install -y \ + curl \ + bzip2 \ + make \ + file \ + libmpfr-dev \ + libmpc-dev \ + zlib1g-dev \ + texinfo \ + git \ + gcc \ + g++ + +ARG N64_INST=/n64_toolchain +ENV N64_INST=${N64_INST} + +# Build +ADD https://raw.githubusercontent.com/DragonMinded/libdragon/trunk/tools/build-toolchain.sh /tmp/tools/build-toolchain.sh +WORKDIR /tmp/tools +RUN chmod 755 "./build-toolchain.sh" && ./build-toolchain.sh + +# Remove locale strings which are not so important in our use case +RUN rm -rf ${N64_INST}/share/locale/* + +# Stage 2 - Prepare minimal image +FROM debian:stable-slim +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Setup paths for the libgragon toolchain +ARG N64_INST=/n64_toolchain +ENV N64_INST=${N64_INST} +ENV PATH="${N64_INST}/bin:$PATH" + +# Install dependencies for building libdragon tools and ROMS (using makefiles and CMake) +# and (commented out) ability to use it as a vs-code devcontainer. +RUN apt-get update && \ + apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 &&\ + apt-get install -yq \ + gcc \ + g++ \ + make \ + libpng-dev \ + git \ + curl \ + cmake \ + ninja-build + +COPY --from=toolchain-builder ${N64_INST} ${N64_INST} + +# Clean up downloaded files +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog diff --git a/INSTALLATION.md b/INSTALLATION.md new file mode 100644 index 0000000..90153a7 --- /dev/null +++ b/INSTALLATION.md @@ -0,0 +1,18 @@ +# Installing packages + +## Operating System + + +### Debian +Download and install the debian (.deb) package: +`$ sudo dpkg -i .deb` + +### RPM +Download and install the RPM (.rpm) package. +`rpm -i .rpm` + +### Windows +Download the .zip file and extract it. +Move the folder. +Add the file path to an environment variable +Enjoy! diff --git a/README.md b/README.md index 78965e5..79e39ef 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,15 @@ -NOTE: This repo will be updated or deprecated in the near future as the libDragon toolchain now supports the ability to do the same thing using: -``` -sudo apt-get install -y mingw-w64 -cd ./tools/ -sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh -``` +**NOTE:** This repo uses the [official libDragon](dragonminded/libdragon) toolchain build script to generate its artifacts. However, it may also include features or abilities that have not yet been added. -# Windows mips64-gcc-toolchain for the N64 +# mips64-gcc-toolchain for the N64 This repo automatically generates the MIPS64 GCC toolchain to allow cross compilation for the N64. -The binaries can be downloaded and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment. - -[![Azure Pipeline CI](https://dev.azure.com/n64-tools/N64-Tools/_apis/build/status/N64-tools.mips64-gcc-toolchain)](https://dev.azure.com/n64-tools/N64-Tools/_build/latest?definitionId=1) +The binaries can be downloaded (from releases) and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment (without using docker). [![Github Action CI](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml/badge.svg)](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml) Architecture | Download Links --- | --- -Windows x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip) -Windows i386 | none currently available! +Windows x86_x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip) +Debian | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-linux64.deb) +Redhat | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-linux64.rpm) +Docker | [Latest](https://github.com/n64-tools/packages) diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 583e31a..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,92 +0,0 @@ -trigger: - branches: - include: - - master - - develop* - - release* - - refs/tags/* - -pr: - autoCancel: true - -pool: - vmImage: 'ubuntu-latest' - -steps: - -# Some of these packages may already be installed, but update just incase (it doesn't hurt)! -- script: | - sudo apt-get install -y build-essential software-properties-common - # sudo apt-get install -y gcc-10 - # sudo apt-get install -y g++-10 - sudo apt-get install -y mingw-w64 - # sudo apt-get install -y libgmp-dev bison - sudo apt-get install -y libmpfr-dev libmpc-dev - sudo apt-get install -y byacc texinfo - sudo apt-get install -y zip gzip tar - displayName: 'Install Required Packages' - continueOnError: false - - # We do it first to fail fast (as most unknown)! - # Build MakeFile against linux (for windows) -- script: | - cd $BUILD_SOURCESDIRECTORY/scripts/build/win64 - bash ./build-win64-makefile.sh - rm ./build-win64-makefile.sh - displayName: 'Build win64 makefile executable' - continueOnError: false - -# Build the mips64 GCC toolchain against linux and compress it ready for upload (local builds could run build.sh). -- script: | - cd $BUILD_SOURCESDIRECTORY/scripts/build/linux64 - bash ./build-linux64-toolchain.sh - rm ./build-linux64-toolchain.sh - tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * - displayName: 'Build linux64 Project' - continueOnError: false - -# Move the compressed linux folder ready for upload (not needed for local builds). -- bash: | - mkdir -p $BUILD_ARTIFACTSTAGINGDIRECTORY/linux64/ - mv "$BUILD_SOURCESDIRECTORY/scripts/build/gcc-toolchain-mips64-linux64.tar.gz" "$BUILD_ARTIFACTSTAGINGDIRECTORY/linux64/" - displayName: 'Move linux Artifacts to Staging Directory' - continueOnError: false - -# # Publish the compressed linux folder to the to Azure Artifacts/TFS or a file share (not needed for local builds). -# - task: PublishBuildArtifacts@1 -# displayName: Publish linux Build Artifacts -# inputs: -# pathtoPublish: '$(Build.ArtifactStagingDirectory)/linux64/' -# artifactName: 'binaries/linux64' -# publishLocation: 'Container' # Options: container, filePath -# #targetPath: # Required when publishLocation == FilePath -# parallel: true # Optional -# #parallelCount: # Optional - - -# Build the GCC toolchain against linux (for windows) and compress it (local builds could run build.sh). -- script: | - cd $BUILD_SOURCESDIRECTORY/scripts/build/win64 - bash ./build-win64-toolchain.sh - rm ./build-win64-toolchain.sh - zip -r -q $BUILD_SOURCESDIRECTORY/scripts/build/gcc-toolchain-mips64-win64.zip * - displayName: 'Build win64 Project' - continueOnError: false - -# Move the compressed windows folder ready for upload (not needed for local builds). -- bash: | - mkdir -p $BUILD_ARTIFACTSTAGINGDIRECTORY/win64/ - mv "$BUILD_SOURCESDIRECTORY/scripts/build/gcc-toolchain-mips64-win64.zip" "$BUILD_ARTIFACTSTAGINGDIRECTORY/win64/" - displayName: 'Move windows Artifacts to Staging Directory' - continueOnError: false - -# Publish windows build artifacts to Azure Artifacts/TFS or a file share (not needed for local builds). -- task: PublishBuildArtifacts@1 - displayName: Publish windows Build Artifacts - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)/win64/' - artifactName: 'binaries/win64' - publishLocation: 'Container' # Options: container, filePath - #targetPath: # Required when publishLocation == FilePath - parallel: true # Optional - #parallelCount: # Optional diff --git a/build.sh b/build.sh deleted file mode 100644 index 28f140e..0000000 --- a/build.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Abort on Error -set -e - -export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Put build scripts here: -LINUX_BUILD_DIR="${WORKDIR}/scripts/build/linux64" -WIN_BUILD_DIR="${WORKDIR}/scripts/build/win64" - -echo "Starting the linux build process..." -cd ${LINUX_BUILD_DIR} -bash ./build-linux64-toolchain.sh - -rm -rf ./tarballs -rm -rf ./*-source -rm -rf ./*-build -rm -rf ./stamps -rm ./build-linux64-toolchain.sh - -echo "Starting the Windows build process..." -export PATH="${PATH}:${LINUX_BUILD_DIR}/bin" -cd ${WIN_BUILD_DIR} -bash ./build-win64-toolchain.sh - -rm -rf ./tarballs -rm -rf ./*-source -rm -rf ./*-build -rm -rf ./stamps -rm -rf ./x86_64-w64-mingw32 -rm ./build-win64-toolchain.sh - -echo "Compressing files for upload..." -cd ${WORKDIR}/scripts/build/linux64 -tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * -cd ${WORKDIR}/scripts/build/win64 -zip -rq ../gcc-toolchain-mips64-win64.zip * - -echo "The build completed successfully." diff --git a/scripts/build/linux64/build-linux64-toolchain.sh b/scripts/build/linux64/build-linux64-toolchain.sh deleted file mode 100644 index 823277b..0000000 --- a/scripts/build/linux64/build-linux64-toolchain.sh +++ /dev/null @@ -1,289 +0,0 @@ -#!/bin/bash -set -eu - -# -# N64 linux GCC/BINUTILS/NEWLIB/GDB toolchain build script. -# -# Attributions: -# Tyler J. Stachecki -# Robin Jones (NetworkFusion/JonesAlmighty) -# -# This script builds library source covered under the 'GNU LESSER GENERAL PUBLIC LICENSE' -# However, the original source is not changed. -# The repo 'LICENSE' is added for assurance. -# - -# Parallel GCC build jobs -NUM_CPU_THREADS=`grep -c '^processor' /proc/cpuinfo` #$(nproc) -BUILD_NUM_JOBS="--jobs=$NUM_CPU_THREADS --load-average=$NUM_CPU_THREADS" - -BINUTILS="https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" -GCC="https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.gz" -NEWLIB="https://sourceware.org/pub/newlib/newlib-4.1.0.tar.gz" -GDB="https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz" # fails to x compile on 11.2. requires investigation! - -BUILD=${BUILD:-x86_64-linux-gnu} -HOST=${HOST:-x86_64-linux-gnu} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd ${SCRIPT_DIR} && mkdir -p {stamps,tarballs} - -export PATH="${PATH}:${SCRIPT_DIR}/bin" - -if [ ! -f stamps/binutils-download ]; then - wget "${BINUTILS}" -O "tarballs/$(basename ${BINUTILS})" - touch stamps/binutils-download -fi - -if [ ! -f stamps/binutils-extract ]; then - mkdir -p binutils-{build,source} - tar -xf tarballs/$(basename ${BINUTILS}) -C binutils-source --strip 1 - touch stamps/binutils-extract -fi - -if [ ! -f stamps/binutils-configure ]; then - pushd binutils-build - ../binutils-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --with-lib-path="${SCRIPT_DIR}/lib" \ - --enable-64-bit-bfd \ - --enable-plugins \ - --enable-shared \ - --disable-gold \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-werror - popd - - touch stamps/binutils-configure -fi - -if [ ! -f stamps/binutils-build ]; then - pushd binutils-build - make $BUILD_NUM_JOBS - popd - - touch stamps/binutils-build -fi - -if [ ! -f stamps/binutils-install ]; then - pushd binutils-build - make install-strip - popd - - touch stamps/binutils-install -fi - -if [ ! -f stamps/gcc-download ]; then - wget "${GCC}" -O "tarballs/$(basename ${GCC})" - touch stamps/gcc-download -fi - -if [ ! -f stamps/gcc-extract ]; then - mkdir -p gcc-{build,source} - tar -xf tarballs/$(basename ${GCC}) -C gcc-source --strip 1 - touch stamps/gcc-extract -fi - -if [ ! -f stamps/gcc-configure ]; then - pushd gcc-build - ../gcc-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --with-tune=vr4300 \ - --enable-languages=c,c++ --without-headers --with-newlib \ - --with-gnu-as=${SCRIPT_DIR}/bin/mips64-elf-as \ - --with-gnu-ld=${SCRIPT_DIR}/bin/mips64-elf-ld \ - --enable-checking=release \ - --enable-shared \ - --enable-shared-libgcc \ - --disable-decimal-float \ - --disable-gold \ - --disable-libatomic \ - --disable-libgomp \ - --disable-libitm \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-libsanitizer \ - --disable-libssp \ - --disable-libunwind-exceptions \ - --disable-libvtv \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-threads \ - --disable-win32-registry \ - --enable-lto \ - --enable-plugin \ - --enable-static \ - --without-included-gettext - popd - - touch stamps/gcc-configure -fi - -if [ ! -f stamps/gcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-gcc - popd - - touch stamps/gcc-build -fi - -if [ ! -f stamps/gcc-install ]; then - pushd gcc-build - make install-strip-gcc - popd - - # build-win32-toolchain.sh needs this; the cross-compiler build - # will look for mips64-elf-cc and we only have mips64-elf-gcc. - pushd "${SCRIPT_DIR}/bin" - ln -sfv mips64-elf-{gcc,cc} - popd - - touch stamps/gcc-install -fi - -if [ ! -f stamps/libgcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-target-libgcc - popd - - touch stamps/libgcc-build -fi - -if [ ! -f stamps/libgcc-install ]; then - pushd gcc-build - make install-target-libgcc - popd - - touch stamps/libgcc-install -fi - -if [ ! -f stamps/newlib-download ]; then - wget "${NEWLIB}" -O "tarballs/$(basename ${NEWLIB})" - touch stamps/newlib-download -fi - -if [ ! -f stamps/newlib-extract ]; then - mkdir -p newlib-{build,source} - tar -xf tarballs/$(basename ${NEWLIB}) -C newlib-source --strip 1 - touch stamps/newlib-extract -fi - -if [ ! -f stamps/newlib-configure ]; then - pushd newlib-build - CFLAGS="-O2 -DHAVE_ASSERT_FUNC -fomit-frame-pointer -ffast-math -fstrict-aliasing" \ - ../newlib-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --disable-bootstrap \ - --disable-build-poststage1-with-cxx \ - --disable-build-with-cxx \ - --disable-cloog-version-check \ - --disable-dependency-tracking \ - --disable-libada \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-maintainer-mode \ - --disable-malloc-debugging \ - --disable-multilib \ - --disable-newlib-atexit-alloc \ - --disable-newlib-hw-fp \ - --disable-newlib-iconv \ - --disable-newlib-io-float \ - --disable-newlib-io-long-double \ - --disable-newlib-io-long-long \ - --disable-newlib-mb \ - --disable-newlib-multithread \ - --disable-newlib-register-fini \ - --disable-newlib-supplied-syscalls \ - --disable-objc-gc \ - --enable-newlib-io-c99-formats \ - --enable-newlib-io-pos-args \ - --enable-newlib-reent-small \ - --with-endian=little \ - --without-cloog \ - --without-gmp \ - --without-mpc \ - --without-mpfr \ - --disable-libssp \ - --disable-threads \ - --disable-werror - popd - - touch stamps/newlib-configure -fi - -if [ ! -f stamps/newlib-build ]; then - pushd newlib-build - make $BUILD_NUM_JOBS - popd - - touch stamps/newlib-build -fi - -if [ ! -f stamps/newlib-install ]; then - pushd newlib-build - make install - popd - - touch stamps/newlib-install -fi - -if [ ! -f stamps/gdb-download ]; then - wget "${GDB}" -O "tarballs/$(basename ${GDB})" - touch stamps/gdb-download -fi - -if [ ! -f stamps/gdb-extract ]; then - mkdir -p gdb-{build,source} - tar -xf tarballs/$(basename ${GDB}) -C gdb-source --strip 1 - touch stamps/gdb-extract -fi - -if [ ! -f stamps/gdb-configure ]; then - pushd gdb-build - CFLAGS="" LDFLAGS="" \ - ../gdb-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --disable-werror - popd - - touch stamps/gdb-configure -fi - -if [ ! -f stamps/gdb-build ]; then - pushd gdb-build - make $BUILD_NUM_JOBS - popd - - touch stamps/gdb-build -fi - -if [ ! -f stamps/gdb-install ]; then - pushd gdb-build - make install - popd - - touch stamps/gdb-install -fi - -rm -rf "${SCRIPT_DIR}"/tarballs -rm -rf "${SCRIPT_DIR}"/*-source -rm -rf "${SCRIPT_DIR}"/*-build -rm -rf "${SCRIPT_DIR}"/stamps -exit 0 diff --git a/scripts/build/win64/build-win64-makefile.sh b/scripts/build/win64/build-win64-makefile.sh deleted file mode 100644 index badb29f..0000000 --- a/scripts/build/win64/build-win64-makefile.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -set -eu - -# -# MakeFile (for windows) build script. -# -# Attributions: -# Robin Jones (NetworkFusion/JonesAlmighty) -# -# This script builds library source covered under the 'GNU LESSER GENERAL PUBLIC LICENSE' -# However, the original source is not changed and an OSS patch file is used. -# The repo 'LICENSE' is added for assurance. -# - -# Parallel GCC build jobs -NUM_CPU_THREADS=`grep -c '^processor' /proc/cpuinfo` #$(nproc) -BUILD_NUM_JOBS="--jobs=$NUM_CPU_THREADS --load-average=$NUM_CPU_THREADS" - -MAKE="https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz" # patches for 4.3 could be provided from https://github.com/mbuilov/gnumake-windows however, there are currently issues with canadian cross! - -BUILD=${BUILD:-x86_64-linux-gnu} -HOST=${HOST:-x86_64-w64-mingw32} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd ${SCRIPT_DIR} && mkdir -p {stamps,tarballs} - -export PATH="${PATH}:${SCRIPT_DIR}/bin:${SCRIPT_DIR}/../linux64/bin" - -if [ ! -f stamps/make-download ]; then - wget "${MAKE}" -O "tarballs/$(basename ${MAKE})" - touch stamps/make-download -fi - -if [ ! -f stamps/make-extract ]; then - mkdir -p make-{build,source} - tar -xf tarballs/$(basename ${MAKE}) -C make-source --strip 1 - touch stamps/make-extract -fi - -if [ ! -f stamps/make-patch ]; then - pushd make-source - patch -p1 -i ../make-*.patch - popd - touch stamps/make-patch -fi - -if [ ! -f stamps/make-configure ]; then - pushd make-build - ../make-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --disable-largefile \ - --disable-nls \ - --disable-rpath - popd - - touch stamps/make-configure -fi - -if [ ! -f stamps/make-build ]; then - pushd make-build - make $BUILD_NUM_JOBS - popd - - touch stamps/make-build -fi - -if [ ! -f stamps/make-install ]; then - pushd make-build - make install - popd - - touch stamps/make-install -fi - -rm -rf "${SCRIPT_DIR}"/make-*.patch -rm -rf "${SCRIPT_DIR}"/tarballs -rm -rf "${SCRIPT_DIR}"/*-source -rm -rf "${SCRIPT_DIR}"/*-build -rm -rf "${SCRIPT_DIR}"/stamps -exit 0 diff --git a/scripts/build/win64/build-win64-toolchain.sh b/scripts/build/win64/build-win64-toolchain.sh deleted file mode 100644 index 3bfcfb0..0000000 --- a/scripts/build/win64/build-win64-toolchain.sh +++ /dev/null @@ -1,330 +0,0 @@ -#!/bin/bash -set -eu - -# -# N64 (for windows) GCC/BINUTILS/NEWLIB/GDB toolchain build script. -# -# Attributions: -# Tyler J. Stachecki -# Robin Jones (NetworkFusion/JonesAlmighty) -# -# This script builds library source covered under the 'GNU LESSER GENERAL PUBLIC LICENSE' -# However, the original source is not changed. -# The repo 'LICENSE' is added for assurance. -# - -# Parallel GCC build jobs -NUM_CPU_THREADS=`grep -c '^processor' /proc/cpuinfo` #$(nproc) -BUILD_NUM_JOBS="--jobs=$NUM_CPU_THREADS --load-average=$NUM_CPU_THREADS" - -GMP="https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz" # No gz file available! -MPC="https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz" -MPFR="https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.gz" -BINUTILS="https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" -GCC="https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.gz" -NEWLIB="https://sourceware.org/pub/newlib/newlib-4.1.0.tar.gz" -GDB="https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz" # fails to x compile on 11.2. requires investigation! - -BUILD=${BUILD:-x86_64-linux-gnu} -HOST=${HOST:-x86_64-w64-mingw32} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd ${SCRIPT_DIR} && mkdir -p {stamps,tarballs} - -export PATH="${PATH}:${SCRIPT_DIR}/bin:${SCRIPT_DIR}/../linux64/bin" - -if [ ! -f stamps/binutils-download ]; then - wget "${BINUTILS}" -O "tarballs/$(basename ${BINUTILS})" - touch stamps/binutils-download -fi - -if [ ! -f stamps/binutils-extract ]; then - mkdir -p binutils-{build,source} - tar -xf tarballs/$(basename ${BINUTILS}) -C binutils-source --strip 1 - touch stamps/binutils-extract -fi - -if [ ! -f stamps/binutils-configure ]; then - pushd binutils-build - ../binutils-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --with-lib-path="${SCRIPT_DIR}/lib" \ - --enable-64-bit-bfd \ - --enable-plugins \ - --enable-shared \ - --disable-gold \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-werror - popd - - touch stamps/binutils-configure -fi - -if [ ! -f stamps/binutils-build ]; then - pushd binutils-build - make $BUILD_NUM_JOBS - popd - - touch stamps/binutils-build -fi - -if [ ! -f stamps/binutils-install ]; then - pushd binutils-build - make install-strip - popd - - touch stamps/binutils-install -fi - -if [ ! -f stamps/gmp-download ]; then - wget "${GMP}" -O "tarballs/$(basename ${GMP})" - touch stamps/gmp-download -fi - -if [ ! -f stamps/mpfr-download ]; then - wget "${MPFR}" -O "tarballs/$(basename ${MPFR})" - touch stamps/mpfr-download -fi - -if [ ! -f stamps/mpc-download ]; then - wget "${MPC}" -O "tarballs/$(basename ${MPC})" - touch stamps/mpc-download -fi - -if [ ! -f stamps/gcc-download ]; then - wget "${GCC}" -O "tarballs/$(basename ${GCC})" - touch stamps/gcc-download -fi - -if [ ! -f stamps/gcc-extract ]; then - mkdir -p gcc-{build,source} - tar -xf tarballs/$(basename ${GCC}) -C gcc-source --strip 1 - touch stamps/gcc-extract -fi - -if [ ! -f stamps/gmp-extract ]; then - mkdir -p gcc-source/gmp - tar -xf tarballs/$(basename ${GMP}) -C gcc-source/gmp --strip 1 - touch stamps/gmp-extract -fi - -if [ ! -f stamps/mpfr-extract ]; then - mkdir -p gcc-source/mpfr - tar -xf tarballs/$(basename ${MPFR}) -C gcc-source/mpfr --strip 1 - touch stamps/mpfr-extract -fi - -if [ ! -f stamps/mpc-extract ]; then - mkdir -p gcc-source/mpc - tar -xf tarballs/$(basename ${MPC}) -C gcc-source/mpc --strip 1 - touch stamps/mpc-extract -fi - -if [ ! -f stamps/gcc-configure ]; then - pushd gcc-build - ../gcc-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --with-tune=vr4300 \ - --enable-languages=c,c++ --without-headers --with-newlib \ - --with-gnu-as=${SCRIPT_DIR}/bin/mips64-elf-as.exe \ - --with-gnu-ld=${SCRIPT_DIR}/bin/mips64-elf-ld.exe \ - --enable-checking=release \ - --enable-shared \ - --enable-shared-libgcc \ - --disable-decimal-float \ - --disable-gold \ - --disable-libatomic \ - --disable-libgomp \ - --disable-libitm \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-libsanitizer \ - --disable-libssp \ - --disable-libunwind-exceptions \ - --disable-libvtv \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-symvers \ - --disable-threads \ - --disable-win32-registry \ - --enable-lto \ - --enable-plugin \ - --without-included-gettext - popd - - touch stamps/gcc-configure -fi - -if [ ! -f stamps/gcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-gcc - popd - - touch stamps/gcc-build -fi - -if [ ! -f stamps/gcc-install ]; then - pushd gcc-build - make install-strip-gcc - popd - - # While not necessary, this is still a good idea. - pushd "${SCRIPT_DIR}/bin" - cp mips64-elf-{gcc,cc}.exe - popd - - touch stamps/gcc-install -fi - -if [ ! -f stamps/libgcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-target-libgcc - popd - - touch stamps/libgcc-build -fi - -if [ ! -f stamps/libgcc-install ]; then - pushd gcc-build - make install-target-libgcc - popd - - touch stamps/libgcc-install -fi - -if [ ! -f stamps/newlib-download ]; then - wget "${NEWLIB}" -O "tarballs/$(basename ${NEWLIB})" - touch stamps/newlib-download -fi - -if [ ! -f stamps/newlib-extract ]; then - mkdir -p newlib-{build,source} - tar -xf tarballs/$(basename ${NEWLIB}) -C newlib-source --strip 1 - touch stamps/newlib-extract -fi - -if [ ! -f stamps/newlib-configure ]; then - pushd newlib-build - CFLAGS="-O2 -DHAVE_ASSERT_FUNC -fomit-frame-pointer -ffast-math -fstrict-aliasing" \ - ../newlib-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --disable-bootstrap \ - --disable-build-poststage1-with-cxx \ - --disable-build-with-cxx \ - --disable-cloog-version-check \ - --disable-dependency-tracking \ - --disable-libada \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-maintainer-mode \ - --disable-malloc-debugging \ - --disable-multilib \ - --disable-newlib-atexit-alloc \ - --disable-newlib-hw-fp \ - --disable-newlib-iconv \ - --disable-newlib-io-float \ - --disable-newlib-io-long-double \ - --disable-newlib-io-long-long \ - --disable-newlib-mb \ - --disable-newlib-multithread \ - --disable-newlib-register-fini \ - --disable-newlib-supplied-syscalls \ - --disable-objc-gc \ - --enable-newlib-io-c99-formats \ - --enable-newlib-io-pos-args \ - --enable-newlib-reent-small \ - --with-endian=little \ - --without-cloog \ - --without-gmp \ - --without-mpc \ - --without-mpfr \ - --disable-libssp \ - --disable-threads \ - --disable-werror - popd - - touch stamps/newlib-configure -fi - -if [ ! -f stamps/newlib-build ]; then - pushd newlib-build - make $BUILD_NUM_JOBS - popd - - touch stamps/newlib-build -fi - -if [ ! -f stamps/newlib-install ]; then - pushd newlib-build - make install - popd - - touch stamps/newlib-install -fi - -if [ ! -f stamps/gdb-download ]; then - wget "${GDB}" -O "tarballs/$(basename ${GDB})" - touch stamps/gdb-download -fi - -if [ ! -f stamps/gdb-extract ]; then - mkdir -p gdb-{build,source} - tar -xf tarballs/$(basename ${GDB}) -C gdb-source --strip 1 - touch stamps/gdb-extract -fi - -if [ ! -f stamps/gdb-configure ]; then - pushd gdb-build - CFLAGS="" LDFLAGS="" \ - ../gdb-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --disable-werror - popd - - touch stamps/gdb-configure -fi - -if [ ! -f stamps/gdb-build ]; then - pushd gdb-build - make $BUILD_NUM_JOBS - popd - - touch stamps/gdb-build -fi - -if [ ! -f stamps/gdb-install ]; then - pushd gdb-build - make install - popd - - # While not necessary, this is still a good idea. - #pushd "${SCRIPT_DIR}/bin" - #cp mips64-elf-{gdb,gdb-add-index}.exe - #popd - - touch stamps/gdb-install -fi - -rm -rf "${SCRIPT_DIR}"/tarballs -rm -rf "${SCRIPT_DIR}"/*-source -rm -rf "${SCRIPT_DIR}"/*-build -rm -rf "${SCRIPT_DIR}"/stamps -rm -rf "${SCRIPT_DIR}"/x86_64-w64-mingw32 -exit 0 diff --git a/scripts/build/win64/make-4.2.1.patch b/scripts/build/win64/make-4.2.1.patch deleted file mode 100644 index 61a3581..0000000 --- a/scripts/build/win64/make-4.2.1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- clean/make-4.2/glob/glob.c 2013-10-20 17:14:38.000000000 +0000 -+++ make-4.2/glob/glob.c 2018-09-18 10:16:03.860886356 +0000 -@@ -208,7 +208,7 @@ - #endif /* __GNU_LIBRARY__ || __DJGPP__ */ - - --#if !defined __alloca && !defined __GNU_LIBRARY__ -+#if !defined __alloca && defined __GNU_LIBRARY__ - - # ifdef __GNUC__ - # undef alloca