File:
[local] /
rpl /
scripts /
mkrplso.in
Revision
1.13:
download - view:
text,
annotated -
select for diffs -
revision graph
Wed Oct 12 09:14:16 2016 UTC (8 years, 6 months ago) by
bertrand
Branches:
MAIN
CVS tags:
rpl-4_1_35,
rpl-4_1_34,
rpl-4_1_33,
rpl-4_1_32,
rpl-4_1_31,
rpl-4_1_30,
rpl-4_1_29,
rpl-4_1_28,
rpl-4_1_27,
rpl-4_1_26,
HEAD
Correction d'une erreur de typo dans src/Makefile.am et ajout
de la référence à rpl.exe.a pour la compilation d'extensions RPL/C sous
Cygwin.
1: #!@BASH_PATH@
2:
3: #===============================================================================
4: # RPL/2 version @VERSION@
5: # Interpréteur du langage de programmation du calculateur HP-28S,
6: #
7: # Date de création : 02 Avril 1.998
8: #
9: # Tous droits réservés à l'auteur, Joël BERTRAND
10: #===============================================================================
11:
12: #===============================================================================
13: # Copyright (C) 2001 BERTRAND Joël
14: #
15: # This file is part of RPL/2.
16: #
17: # RPL/2 is free software; you can redistribute it and/or modify it
18: # under the terms of the GNU General Public License as published by the
19: # Free Software Foundation; either version 2, or (at your option) any
20: # later version.
21: #
22: # RPL/2 is distributed in the hope that it will be useful, but WITHOUT
23: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
24: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25: # for more details.
26: #
27: # You should have received a copy of the GNU General Public License
28: # along with Octave; see the file COPYING. If not, write to the Free
29: # Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30: #===============================================================================
31:
32: #===============================================================================
33: # Script de compilation des bibliothèques partagées du langage RPL/2
34: #
35: # Tous droits réservés, J. BERTRAND 29.03.2001
36: #===============================================================================
37:
38: #===============================================================================
39: # Les paramètres du script sont identiques à ceux de g77. Seul
40: # ajout, l'option -strip retirant la table des symboles de la bibliothèque
41: # dynamique.
42: #
43: # Exemples :
44: # mkrplso essai.c -o essai.rplso -strip
45: # mkrplso essai.c -o essai.rplso -O6
46: # mkrplso essai.c lib.a -o essai.rplso
47: #===============================================================================
48:
49: echo +++RPL/2 @VERSION@ shared library build tool
50:
51: PRESENCE_FICHIER_SORTIE=FAUX
52: PRESENCE_OPTION_STRIP=FAUX
53: COMPILATION_SEULE=FAUX
54: DRAPEAU=FAUX
55: P=1
56: RPLC_MAIN=
57:
58: for i in $@;
59: do
60: P=$(($P+1))
61:
62: if [ $DRAPEAU = "VRAI" ]; then
63: DRAPEAU=FAUX
64: FICHIER_SORTIE=$i
65: fi
66:
67: if [ $i = "-o" ]; then
68: if [ $PRESENCE_FICHIER_SORTIE = VRAI ]; then
69: echo +++Error: more than one output file
70: exit 1
71: fi
72:
73: PRESENCE_FICHIER_SORTIE=VRAI
74:
75: if [ $P -gt $# ]; then
76: echo +++Error: no output file
77: exit 1
78: else
79: DRAPEAU=VRAI
80: fi
81: fi
82:
83: if [ $i = "-c" ]; then
84: COMPILATION_SEULE=VRAI
85: fi
86:
87: if [ -e "$i" ]; then
88: if [ $(rplfile -m $(dirname $(which $0))/../share/rplfiles $i | \
89: grep "C source" | wc -l) = 1 ]; then
90: if [ $(grep exportExternalFunctions $i | wc -l) = 1 ]; then
91: RPLC_MAIN=-D__RPLC_MAIN
92: fi
93: fi
94: fi
95:
96: done
97:
98: if [ $PRESENCE_FICHIER_SORTIE = FAUX ]; then
99: echo +++Error: no output file
100: exit 1
101: fi
102:
103: PROCESSEUR=$(uname -m)
104: test $PROCESSEUR = i386 && OPTIONS=-mieee-fp
105: test $PROCESSEUR = i486 && OPTIONS=-mieee-fp
106: test $PROCESSEUR = i586 && OPTIONS=-mieee-fp
107: test $PROCESSEUR = i686 && OPTIONS=-mieee-fp
108: test $PROCESSEUR = x86_64 && OPTIONS=-mieee-fp
109: test $PROCESSEUR = alpha && OPTIONS=-mieee
110: test $PROCESSEUR = sparc && OPTIONS=
111: test $PROCESSEUR = i86pc && OPTIONS=
112:
113: ARGUMENTS_G77=""
114:
115: for i in $@;
116: do
117: if [ $i = "-strip" ]; then
118: PRESENCE_OPTION_STRIP=VRAI
119: else
120: ARGUMENTS_G77="$ARGUMENTS_G77 $i"
121: fi
122: done
123:
124: P=0
125: for i in $(which $0 | tr '/' ' ');
126: do
127: P=$(($P+1))
128: done
129:
130: if [ $(uname -o) = Cygwin ]; then
131: RELOC=
132: EXE_A=$(which rpl)/../lib/rpl.exe.a
133: else
134: RELOC=-fPIC
135: EXE_A=
136: fi
137:
138: if [ $COMPILATION_SEULE = "VRAI" ]; then
139: echo +++Compiler for RPL/2 version @VERSION@
140: gfortran -x c $ARGUMENTS_G77 $RELOC -Wall -DRPLCONFIG $OPTIONS $CFLAGS\
141: -I$(which $0 | cut -d '/' -f -$(($P-1)))/include -funsigned-char\
142: -D_d_version_rpl=\"@VERSION@\" -std=gnu99 $RPLC_MAIN
143: else
144: echo +++Linker for RPL/2 version @VERSION@
145: gfortran $ARGUMENTS_G77 $EXE_A -shared $RELOC -Wall -DRPLCONFIG $OPTIONS\
146: $LDFLAGS\
147: -I$(which $0 | cut -d '/' -f -$(($P-1)))/include -funsigned-char\
148: $RPLC_MAIN
149: fi
150:
151: test $PRESENCE_OPTION_STRIP = VRAI && strip -s $FICHIER_SORTIE
152:
153: if [ $(uname -o) = Cygwin ]; then
154: chmod 755 $FICHIER_SORTIE
155: else
156: chmod 644 $FICHIER_SORTIE
157: fi
158:
159: exit 0
CVSweb interface <joel.bertrand@systella.fr>