-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·134 lines (101 loc) · 2.96 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
#!/bin/bash
#######################################################
# configure
#######################################################
default_prefix=/usr/local/encap/webLauncher
#######################################################
#
# We seek to have a (run in a shell):
#
# ./configure --prefix=/Path/to/Prefix
# make
# make install
#
# software build and installation method via
# this file and the file GNUmakefile.
#
# And other software build and installation methods too.
#
####### NOTES ##########################################
#
# We'd like to keep configuration parameters minimized.
# It seems that the installation prefix is needed,
# but we do wish to keep the program from braking
# if the installed files move.
#######################################################
scriptdir="$(dirname $0)" || exit $?
cd "$scriptdir" || exit $?
scriptdir="$PWD"
default_shabang='#!/usr/bin/env node'
shabang="$default_shabang"
function usage()
{
local prog="$(basename $0)"
cat << EOF
Usage: $prog [--prefix PREFIX] [--no-compress] [--node NPATH]
Configure the webLauncher package installation.
OPTIONS
--no-compress do not apply yui-compressor to installed installed
javascript and CSS files. The default is compress
if yui-compressor is found when this script runs,
otherwise not
--node NPATH set the full file path to the node (js) executable.
By default it $prog will set the node server script
to run with $default_shabang , when NPATH is set it
will be #!NPATH
--prefix PREFIX set the installation directory prefix
the default PREFIX is $default_prefix
For example in bash run:
./configure --prefix=$default_prefix && make && make install
EOF
exit 1
}
prefix=$default_prefix
if which yui-compressor > /dev/null ; then
jscompress="yui-compressor --line-break 70 --type js"
csscompress="yui-compressor --line-break 70 --type css"
else
jscompress="cat"
csscompress="cat"
fi
# yui-compressor does not work for the webLauncher nodejs code.
# uglifyjs 2.7.3 (the latest at this writing) is broken.
while [ -n "$1" ] ; do
case "$1" in
-*prefix)
shift 1
prefix="$1"
;;
-*prefix=*)
prefix="${1#*-prefix=}"
;;
-*node)
shift 1
shabang="#!${1}"
;;
-*node=*)
shabang="#!${1#*-node=}"
;;
-*no-compress)
jscompress="cat"
csscompress="cat"
;;
*)
usage
;;
esac
shift 1
done
echo "PREFIX=$prefix"
cat << EOF > config.make
# This was generated by running $0 $*
# $(date)
PREFIX = $prefix
jscompress = $jscompress
csscompress = $csscompress
shabang = \\$shabang
EOF
cat << EOF
Now try running:
make
EOF