#!/bin/bash #=============================================================================== # RPL/2 version @VERSION@ # Interpréteur du langage de programmation du calculateur HP-28S, # # Date de création : 02 Avril 1.998 # # Tous droits réservés à l'auteur, Joël BERTRAND #=============================================================================== #=============================================================================== # Copyright (C) 2001 BERTRAND Joël # # This file is part of RPL/2. # # RPL/2 is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version. # # RPL/2 is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License # along with Octave; see the file COPYING. If not, write to the Free # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #=============================================================================== #=============================================================================== # Script de compilation des bibliothèques partagées du langage RPL/2 # # Tous droits réservés, J. BERTRAND 29.03.2001 #=============================================================================== #=============================================================================== # Les paramètres du script sont identiques à ceux de g77. Seul # ajout, l'option -strip retirant la table des symboles de la bibliothèque # dynamique. # # Exemples : # mkrplso essai.c -o essai.rplso -strip # mkrplso essai.c -o essai.rplso -O6 # mkrplso essai.c lib.a -o essai.rplso #=============================================================================== echo +++RPL/2 @VERSION@ shared library build tool PRESENCE_FICHIER_SORTIE=FAUX PRESENCE_OPTION_STRIP=FAUX COMPILATION_SEULE=FAUX DRAPEAU=FAUX P=1 for i in $@; do P=$(($P+1)) if [ $DRAPEAU = "VRAI" ]; then DRAPEAU=FAUX FICHIER_SORTIE=$i fi if [ $i = "-o" ]; then if [ $PRESENCE_FICHIER_SORTIE = VRAI ]; then echo +++Error: more than one output file exit 1 fi PRESENCE_FICHIER_SORTIE=VRAI if [ $P -gt $# ]; then echo +++Error: no output file exit 1 else DRAPEAU=VRAI fi fi if [ $i = "-c" ]; then COMPILATION_SEULE=VRAI fi done if [ $PRESENCE_FICHIER_SORTIE = FAUX ]; then echo +++Error: no output file exit 1 fi PROCESSEUR=$(uname -m) test $PROCESSEUR = i386 && OPTIONS=-mieee-fp test $PROCESSEUR = i486 && OPTIONS=-mieee-fp test $PROCESSEUR = i586 && OPTIONS=-mieee-fp test $PROCESSEUR = i686 && OPTIONS=-mieee-fp test $PROCESSEUR = alpha && OPTIONS=-mieee test $PROCESSEUR = sparc && OPTIONS= test $PROCESSEUR = i86pc && OPTIONS= ARGUMENTS_G77="" for i in $@; do if [ $i = "-strip" ]; then PRESENCE_OPTION_STRIP=VRAI else ARGUMENTS_G77="$ARGUMENTS_G77 $i" fi done P=0 for i in $(which $0 | tr '/' ' '); do P=$(($P+1)) done if [ $COMPILATION_SEULE = "VRAI" ]; then echo +++Compiler for RPL/2 version @VERSION@ gfortran -x c $ARGUMENTS_G77 -fPIC -Wall -DRPLCONFIG $OPTIONS $CFLAGS\ -I$(which $0 | cut -d '/' -f -$(($P-1)))/include -funsigned-char\ -D_d_version_rpl=\"@VERSION@\" -std=gnu99 else echo +++Linker for RPL/2 version @VERSION@ gfortran $ARGUMENTS_G77 -shared -fPIC -Wall -DRPLCONFIG $OPTIONS $CFLAGS\ -I$(which $0 | cut -d '/' -f -$(($P-1)))/include -funsigned-char fi test $PRESENCE_OPTION_STRIP = VRAI && strip -s $FICHIER_SORTIE chmod 644 $FICHIER_SORTIE exit 0