-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathconfigure
executable file
·276 lines (236 loc) · 9.37 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
#!/bin/bash
#*=====================================================================*/
#* serrano/prgm/project/hiphop/hiphop/configure */
#* ------------------------------------------------------------- */
#* Author : Manuel Serrano */
#* Creation : Fri Sep 14 08:27:50 2018 */
#* Last change : Wed Jun 19 07:49:36 2024 (serrano) */
#* Copyright : 2018-24 Manuel Serrano */
#* ------------------------------------------------------------- */
#* HipHop configuration */
#*=====================================================================*/
#*---------------------------------------------------------------------*/
#* configure parameters */
#*---------------------------------------------------------------------*/
hz=hiphop
version=`grep version package.json | awk '{ print $2 }' | sed 's/[",]//g'`
license=`grep license package.json | awk '{ print $2 }' | sed 's/[",]//g'`
date=`date +'%d %B %Y'`
minor=
bglversion=latest
hiphopbuildid=
license=gpl
hoprepository=$HOME/prgm/distrib
urlbase=http://hop.inria.fr/hiphop
#*---------------------------------------------------------------------*/
#* compilers and options */
#*---------------------------------------------------------------------*/
hop=hop
hopjs=hopjs
hopc=hopc
hflags=-Ox
# environment parsing
if [ "$HFLAGS " != " " ]; then
hflags=$HFLAGS;
fi
# Argument parsing
while : ; do
case $1 in
"")
break;;
--prefix=*)
prefix="`echo $1 | sed 's/^[^=]*=//'`";
bindir=$prefix/bin;
libdir=$prefix/lib
mandir=$prefix/man/$mansec;
etcdir=$prefix/etc;
sharedir=$prefix/share;
contribsdir=$prefix/share/hiphop/contribs
docdir=$prefix/share/doc/hiphop;;
--etcdir=*)
etcdir="`echo $1 | sed 's/^[^=]*=//'`";;
--sharedir=*)
sharedir="`echo $1 | sed 's/^[^=]*=//'`";;
--bindir=*)
bindir="`echo $1 | sed 's/^[^=]*=//'`";;
--libdir=*)
libdir="`echo $1 | sed 's/^[^=]*=//'`";;
--mandir=*)
mandir="`echo $1 | sed 's/^[^=]*=//'`";;
--hopversion=*)
hopversion="`echo $1 | sed 's/^[^=]*=//'`"
hopc=hopc-$hopversion
hop=hopc-$hopversion
hopjs=hopjs-$hopversion;;
--hopminorversion=*)
hopminorversion="`echo $1 | sed 's/^[^=]*=//'`";;
--hopc=*)
hopc="`echo $1 | sed 's/^[^=]*=//'`";;
--hop=*)
hop="`echo $1 | sed 's/^[^=]*=//'`";;
--hopjs=*)
hopjs="`echo $1 | sed 's/^[^=]*=//'`";;
--hflags=*)
hflags="`echo $1 | sed 's/^[^=]*=//'`";;
--debug)
hflags=-g2;;
-*)
if [ $1 != "--help" ]; then
echo "*** Configure error, unknown option $1" >&2;
echo >&2;
fi
echo "Usage: configure [options]" >&2;
echo "" >&2;
echo "options:" >&2;
echo " --help..................... this message" >&2;
echo " --hopversion=version....... hop and hopc version" >&2;
echo " --hopminorversion=version.. hop and hopc minor version" >&2;
echo " --hop=path................. hop command" >&2;
echo " --hopjs=path............... hopjs command" >&2;
echo " --hopc=path................ hopc command" >&2;
echo " --hflags=flags............. hopc flags" >&2;
echo " --prefix=dir............... prefix to HOP install" >&2;
echo " --etcdir=dir............... hop etc directory" >&2;
echo " --sharedir=dir............. hop share directory" >&2;
echo " --bindir=dir............... alternative Hop bin directory" >&2;
echo " --libdir=dir............... alternative Hop lib directory" >&2;
echo " --mandir=dir............... alternative Hop man directory" >&2;
echo " --debug.................... debug mode" >&2;
echo "" >&2;
exit 255;
esac
shift
done
#*---------------------------------------------------------------------*/
#* buildid */
#*---------------------------------------------------------------------*/
if [ "$hiphopbuildid " = " " ]; then
hiphopbuildid=`git rev-parse --short HEAD`
fi
#*---------------------------------------------------------------------*/
#* default paths */
#*---------------------------------------------------------------------*/
if [ "$etcdir " = " " ]; then
etcdir=`$hop --configure --etcdir`
fi
if [ "$sharedir " = " " ]; then
sharedir=`$hop --configure --sharedir`
sharedir=`dirname $sharedir`
sharedir=`dirname $sharedir`
fi
#*---------------------------------------------------------------------*/
#* sopath */
#*---------------------------------------------------------------------*/
hopversion=`$hopc $hflags --configure --version`
hoplibdir=`$hopc $hflags --configure --libdir`
hopbuildid=`$hopc $hflags --configure --build-id`
hopbuildtag=`$hopc $hflags --configure --build-tag`
hopbuildarch=`$hopc $hflags --configure --build-arch`
hopmoddir=`$hopc $hflags --configure --node_modules`
hopsodirname=`$hopc $hflags --configure --so-dirname`
hopso=`$hop --no-server --eval "(print (bigloo-config 'shared-lib-suffix)))"`
if [ "$libdir " = " " ]; then
libdir=$hoplibdir
fi
sodir="so/$hopsodirname"
#*---------------------------------------------------------------------*/
#* checking hop installation */
#*---------------------------------------------------------------------*/
hopcso=$hopmoddir/@hop/hopc/hop/so/$hopsodirname/hopc.$hopso
if [ ! -f $DESTDIR$hopcso ]; then
echo "*** ERROR: Cannot find $hopcso"
exit 1
fi
if [ "$libdir " = " " ]; then
libdir=$hoplibdir/$hz/$version
fi
#*---------------------------------------------------------------------*/
#* Debian, Homebrew, and Docker scripts */
#*---------------------------------------------------------------------*/
# debian
for deb in arch/debian/makedeb.sh arch/debian/makedebremote.sh; do
rm -f $deb 2> /dev/null
echo "#!/bin/sh" > $deb
echo "#* Automatically generated file (don't edit) */" >> $deb
cat $deb.in \
| sed -e "s|#!/bin/sh||" \
-e "s|@BIGLOOREQUIRED@|$bigloorequired|" \
-e "s|@VERSION@|$version|" \
-e "s|@WEBLETSDIR@|$webletsdir|" \
-e "s|@NMODULESDIR@|$nodemodulesdir|" \
-e "s|@MINOR@|$minorversion|" \
-e "s|@HIPHOPBUILDID@|$hiphopbuildid|g" \
>> $deb
chmod a+rx $deb
done
# homebrew
brew=arch/homebrew/makebrew.sh
rm -f $brew 2> /dev/null
echo "#!/bin/sh" > $brew
echo "#* Automatically generated file (don't edit) */" >> $brew
cat $brew.in \
| sed -e "s|#!/bin/sh||" \
-e "s|@BIGLOOREQUIRED@|$bigloorequired|" \
-e "s|@VERSION@|$version|" \
-e "s|@WEBLETSDIR@|$webletsdir|" \
-e "s|@NMODULESDIR@|$nodemodulesdir|" \
-e "s|@MINOR@|$minorversion|" \
-e "s|@HIPHOPBUILDID@|$hiphopbuildid|g" \
>> $brew
chmod a+rx $brew
# docker/Dockerfile.in
for path in docker/Dockerfile etc/hiphop.el doc/doc.json arch/debian/makedeb.sh arch/homebrew/makebrew.sh Makefile lib/config.js examples/hhdroid/Makefile test/TEST; do
rm -f $path 2> /dev/null
cat $path.in \
| sed -e "s|@HIPHOPVERSION@|$version|g" \
-e "s|@VERSION@|$version|g" \
-e "s|@MINOR@|$minor|g" \
-e "s|@HOPVERSION@|$hopversion|g" \
-e "s|@HOPMINORVERSION@|$hopminorversion|g" \
-e "s|@BGLVERSION@|$bglversion|g" \
-e "s|@HOPREPOSITORY@|$hoprepository|g" \
-e "s|@LICENSE@|$license|g" \
-e "s|@HZ@|$hz|g" \
-e "s|@DATE@|$date|g" \
-e "s|@URLBASE@|$urlbase|g" \
-e "s|@BUILDDIR@|$PWD|g" \
-e "s|@LIBDIR@|$libdir|g" \
-e "s|@HOPSHAREDIR@|$sharedir|g" \
-e "s|@HOPLIBDIR@|$hoplibdir|g" \
-e "s|@HOPBUILDID@|$hopbuildid|g" \
-e "s|@HOPBUILDTAG@|$hopbuildtag|g" \
-e "s|@HOPBUILDARCH@|$hopbuildarch|g" \
-e "s|@HOP@|$hop|g" \
-e "s|@HOPJS@|$hopjs|g" \
-e "s|@HOPC@|$hopc|g" \
-e "s|@HFLAGS@|$hflags|g" \
-e "s|@SODIR@|$sodir|g" \
-e "s|@SO@|$hopso|g" \
-e "s|@HIPHOPBUILDID@|$hiphopbuildid|g" \
>> $path
done
chmod a+rx arch/debian/makedeb.sh
chmod a+rx arch/homebrew/makebrew.sh
chmod a+rx test/TEST
#*---------------------------------------------------------------------*/
#* Summary */
#*---------------------------------------------------------------------*/
# Generate the config.status file to please debian packages
echo "configuration completed" > config.status
echo "** Configuration summary **"
echo
echo "Release:"
echo " hiphop release number... $version"
echo " hiphop build id......... $hiphopbuildid"
echo " hop command............. $hop $hopversion$hopminorversion"
echo " hopjs command........... hopjs"
echo " hopc command............ $hopc"
echo " hflags ................. $hflags"
echo " etc directory........... $etcdir"
echo " share directory......... $sharedir"
echo " lib directory........... $libdir"
echo " so directory name....... $hopsodirname"
echo ""
echo "Emacs users, add"
echo "'(hopjs-site-lisp-extra-dir (quote (\"/usr/local/share/hiphop/site-lisp\")))"
echo "to your emacs '(custom-set-variables ...)' expression"