Giter Club home page Giter Club logo

gprbuild's Introduction

gprbuild from AdaCore

This fork is a (slight) rework of the installation scripts and process as to build the software on exotic(!) OS systems as macOS & FreeBSD.

Aim is to have a working bootstrap on those plateforms.

Brought to you by AdaForge.

All merits go to Adacore's Team.

Major diffs with AdaCore's version

  • up to date info about version #, date and year
  • all build artefacts will lay in an dedicated build directory
  • corrected some gcc compiler switch typos in *.gpr files (-gnat2022)
  • clean-up .gitignore file

Prerequisites

Configuration as code

  • DESTDIR / PREFIX : I personnaly install exprimental dev-tools in my /home - /Users directory
    • typicaly on FreeBSD : /home/william/usr/local
    • typicaly on macOS : /Users/william/Library/Developer/GNAT
  • gprconfig_kb and xmlada are located at the same level as gprbuild
  • Build directory is a sub-directory of the gprbuild project’ named build
  • GPR_PROJECT_PATH is not set’ and defaults in my case to
    • on FreeBSD : /home/william/usr/local/share/gpr
    • on macOS : /Users/william/Library/Developer/GNAT/share/gpr

Environment variables

DESTDIR=your installation location WITH a TRAILING slash '/'; defaults to /usr/local export ADA_PROJECT_PATH=.. unset PRJ_PROJECT_PATH

Optional CC=(...your C/Ada compiler) CXX=(...your C++ compiler) GNATMAKE=(...your C/Ada compiler)

When compiling, you can choose whether you want to link statically with XML/Ada (the default), or dynamically. To compile dynamically, you should run:

gmake LIBRARY_TYPE=relocatable all

Sample

  • on FreeBSD
export ADA_PROJECT_PATH=..
unset PRJ_PROJECT_PATH
export DESTDIR=/users/william/
export CC=/home/william/usr/local/gcc-12.2.0/bin/gcc
export CXX=/home/william/usr/local/gcc-12.2.0/bin/g++
export GNATMAKE=/home/william/usr/local/gcc-12.2.0/bin/gnatmake
  • on MacOS
export ADA_PROJECT_PATH=..
unset PRJ_PROJECT_PATH
export DESTDIR=/Users/william/Library/Developer/
PREFIX=GNAT
export CC=/Users/william/Library/Developer/GNAT/gcc-12.2.0/bin/gcc
export CXX=/Users/william/Library/Developer/GNAT/gcc-12.2.0/bin/g++
export GNATMAKE=/Users/william/Library/Developer/GNAT/gcc-12.2.0/bin/gnatmake

FreeBSD tweek

export GNATMAKEFLAGS=-L/usr/lib or for a permanent setting:

ln -sv /usr/lib/libpthread.* /home/william/usr/local/gcc-12.2.0/lib/gcc/x86_64-unknown-freebsd13.1/12.2.0/adalib
ln -sv /usr/lib/libc.* /home/william/usr/local/gcc-12.2.0/lib/gcc/x86_64-unknown-freebsd13.1/12.2.0/adalib

Steps

Steps noted as 0. are done just once.

Go through the other steps after a clean-up of the build

0.a Get the software

From Adaforge.org's GitHub repository

git pull https://github.com/AdaForge/gprbuild.git 
git pull https://github.com/AdaForge/gprconfigure_kb.git 
git pull https://github.com/AdaForge/xmlada.git 

0.b Set environment variables

export ADA_PROJECT_PATH=..
unset PRJ_PROJECT_PATH
export DESTDIR=/.../
  • optional
export CC=/.../bin/gcc
export CXX=/.../bin/g++
export GNATMAKE=/.../bin/gnatmake

1. Build a first temporary gprbuild (ligth) = Bootstrap

cd gprbuild
mkdir -p build
cd build
../bootstrap.sh --with-xmlada=../../xmlada --with-kb=../../gprconfig_kb --prefix=./bootstrap --srcdir=.. --build
(sudo) ../bootstrap.sh --prefix=./bootstrap --srcdir=.. --install
  • short form
mkdir -p gprbuild/build
cd gprbuild/build
../bootstrap.sh  --build
(sudo) ../bootstrap.sh  --prefix=/.../ --install

2. Build xmlada

  • you are in .../xmlada/build. or .../xmlada.git/build
../configure --prefix=/.../
gmake all
(sudo) gmake install

2. Prepare build = Configure the Makefile

  • you are in .../gprbuild/build
gmake -f ../Makefile prefix=/Library/Developer/GNAT SOURCE_DIR=.. ENABLE_SHARED=no setup

3. Launch the build of the full gprbuild

  • you are in .../gprbuild/build
export ADA_PROJECT_PATH=..:/Library/Developer/GNAT/share/gpr
gmake -f ../Makefile all
(sudo) gmake -f ../Makefile install

99. Clean-up

  • you are in .../gprbuild/build
cd ..
gmake clean

or more straightforward:

cd ..
rm -r build

Doc & Examples

online at AdaCore.

Prerequisites

In order to build the docs, you need to have the following tools installed:

  • sphinx -> pip install sphinx
  • latexmkand texlive-latex-extra
    • [macOS] -> sudo port install latexmk texlive-latex-extra
    • [FreeBSD] -> sudo pkg install latexmk texlive-latex-extra
  • gsftopk

updating LaTex environment

sudo texhash

Style defs

* [TeX Gyre Termes](https://www.gust.org.pl/projects/e-foundry/tex-gyre/termes/index_html)
* [TeX Gyre Heros](https://www.gust.org.pl/projects/e-foundry/tex-gyre/heros)
* [sphinxmulticell.sty](https://github.com/Crashedmind/PlantUMLHitchhikersGuide/blob/master/sphinxmulticell.sty)
* [footnotehyper-sphinx.sty](https://github.com/Crashedmind/PlantUMLHitchhikersGuide/blob/master/sphinxmulticell.sty)

Fonts

  • /opt/local/share/texmf-texlive/fonts/tfm/public/tex-gyre/ec-qhvbi.tfm

gprbuild's People

Contributors

vcelier avatar turbogit avatar briot avatar anisimkov avatar gingold-adacore avatar cyrillecomar avatar t-14 avatar jeromeguittonadacore avatar rmorier avatar arnaudcharlet avatar enzbang avatar fedor-rybin avatar lambourg avatar nikokrock avatar captain-haddock17 avatar bobduff avatar asarhaddon avatar brobecke avatar brosgol avatar pat-rogers avatar pmderodat avatar setton avatar kirtchev-adacore avatar burratoo avatar hainque avatar miranda-adacore avatar fabien-chouteau avatar berrendo avatar atupone avatar yakobowski avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.