-
Notifications
You must be signed in to change notification settings - Fork 4
/
configure
executable file
·220 lines (172 loc) · 5.09 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
#!/bin/bash
set -e;
export ACE_VERSION=`cat .ace-version`
export REFLEX_VERSION=`cat .reflex-version`
#
# functions
#
function get_ace
{
if [[ -n $ACE_ROOT || -e ACE/ACE_wrappers ]]; then
return;
fi
pushd ACE;
if [[ ! -f ACE.tgz ]]; then
curl -L -o ACE.tgz https://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-${ACE_VERSION//./_}/ACE-${ACE_VERSION}.tar.gz;
fi
tar -xzf ACE.tgz;
popd;
}
function configure_ace
{
if [[ -n $ACE_ROOT ]]; then
return;
fi
ACE_CONFIG=$1;
MAKE_CONFIG=$2;
if [[ ! -f ACE/ACE_wrappers/ace/config.h ]]; then
ln -sf $ACE_CONFIG ACE/ACE_wrappers/ace/config.h;
fi
if [[ -d ACE/ACE_wrappers/include/makeinclude && ! -f ACE/ACE_wrappers/include/makeinclude/platform_macros.GNU ]]; then
ln -sf $MAKE_CONFIG ACE/ACE_wrappers/include/makeinclude/platform_macros.GNU;
fi
}
function get_reflex
{
if [[ ! -d misc/reflex || ! -f misc/reflex/lib/libreflex.a ]]; then
rm -rf misc/reflex;
git clone -b v$REFLEX_VERSION https://github.com/Genivia/RE-flex misc/reflex 2> /dev/null;
fi
}
function clean_links
{
rm -f include/jx-af/make/jx_config
if [[ -d ACE/ACE_wrappers ]]; then
rm -f ACE/ACE_wrappers/ace/config.h;
rm -f ACE/ACE_wrappers/include/makeinclude/platform_macros.GNU;
fi
}
function configure_linux
{
get_reflex;
clean_links;
ln -sf sys/Linux_g++ include/jx-af/make/jx_config;
if [[ -d ACE/ACE_wrappers ]]; then
configure_ace config-linux.h platform_linux.GNU;
fi
}
#
# main script
#
SYS=`uname -o`;
if [[ $UID != 0 ]]; then
SUDO="sudo";
fi
if [[ $1 == release ]]; then
echo -n 1 >| 0-RELEASE;
elif [[ $1 == package ]]; then
mkdir ACE misc;
fi
if [[ $SYS == Darwin ]]; then
if [[ -z $SNAPCRAFT_BUILD_ENVIRONMENT ]]; then
if ! command -v brew; then
echo Installing Homebrew...;
$SUDO /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)";
fi
if [[ -n $GITHUB_ACTIONS ]]; then
brew install [email protected] || brew link --overwrite [email protected];
brew install [email protected] || brew link --overwrite [email protected];
fi
brew bundle;
fi
if [[ $1 != package ]]; then
clean_links;
ln -sf sys/MacOS_g++ include/jx-af/make/jx_config;
fi
elif command -v apt-get; then
# debian
$SUDO apt update;
$SUDO apt -y install curl \
g++ bison make automake \
libx11-dev libxinerama-dev libxft-dev libxmu-dev libxi-dev \
libx11-xcb-dev libxcb-xfixes0-dev libxcb-dri2-0-dev \
libxpm-dev libjpeg-dev libpng-dev libgd-dev \
libace-dev libicu-dev libpcre3-dev libxml2-dev \
libboost-fiber-dev xutils-dev libdrm-dev \
libforms-bin aspell xdg-utils imagemagick;
if [[ $1 != package ]]; then
configure_linux;
fi
elif command -v dnf; then
# redhat
$SUDO dnf -y install findutils curl perl python-libxml2 \
gcc-c++ bison make rpm-build imake libtool \
libX11-devel libXinerama-devel libXft-devel libXmu-devel libXi-devel \
xorg-x11-proto-devel xorg-x11-server-devel libXdamage-devel \
libXpm-devel libjpeg-devel libpng-devel gd-devel \
libicu-devel pcre-devel libxml2-devel \
boost-devel expat-devel libdrm-devel \
xforms-devel aspell aspell-en xdg-utils ImageMagick;
if [[ $1 != package ]]; then
get_ace;
configure_linux;
fi
elif command -v zypper; then
# openSUSE
$SUDO zypper -in install curl perl python-libxml2 \
gcc-c++ bison make rpm-build imake libtool \
libX11-devel libXinerama-devel libXft-devel libXmu-devel libXi-devel \
xorg-x11-proto-devel xorg-x11-server-devel libXdamage-devel \
libXpm-devel libjpeg-devel libpng-devel gd-devel \
libicu-devel pcre-devel libxml2-devel \
boost-devel expat-devel libdrm-devel \
xforms-devel aspell aspell-en xdg-utils imagemagick;
if [[ $1 != package ]]; then
get_ace;
configure_linux;
fi
elif [[ $SYS == Cygwin ]]; then
ARCH=`uname -i`;
if [[ $ARCH == x86_64 ]]; then
SETUP=setup-x86_64.exe;
echo "Unsupported architecture '$ARCH'. Please file an issue on github.";
exit 1;
elif [[ ${ARCH:0:1} == i ]]; then
SETUP=setup-x86.exe;
SYS_CONFIG=sys/Linux-Intel-cygwin32;
ACE_CONFIG=config-cygwin32.h;
ACE_MAKE_CONFIG=platform_cygwin32.GNU;
else
echo "Unknown architecture '$ARCH'. Please file an issue on github.";
exit 1;
fi
$SETUP -q -P curl,perl,python2-libxml2;
$SETUP -q -P gcc-g++,bison,make,gdb;
$SETUP -q -P libX11-devel,libXinerama-devel,libXpm-devel,libXft-devel,libXmu-devel,libXi-devel;
$SETUP -q -P libxml2-devel,libgd-devel,libjpeg-devel,libpng-devel,libicu-devel,libpcre-devel;
$SETUP -q -P imake,libtool,xorg-server-devel,libXdamage-devel,libexpat-devel;
$SETUP -q -P aspell,aspell-en,imagemagick;
if [[ $1 != package ]]; then
get_ace;
get_reflex;
clean_links;
ln -sf $SYS_CONFIG include/jx-af/make/jx_config;
configure_ace $ACE_CONFIG $ACE_MAKE_CONFIG;
fi
else
echo "Unrecognized system! Please file an issue on github.";
exit 1;
fi
#
# final setup
#
if [[ ! -e libjcore/code/jStringData.h && $1 != package ]]; then
cp -f libjcore/jStringData_init.h libjcore/code/jStringData.h;
chmod u+w libjcore/code/jStringData.h;
fi
if [[ $1 != package ]]; then
touch libjexpr/code/JExprParserY.cpp libjexpr/code/JExprParserY.hpp;
for d in `find . -name image-build`; do
touch $d/*;
done
fi