-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·65 lines (51 loc) · 1.6 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
#!/bin/sh
set -e
if [ $# -ne 1 ]; then
echo "Fatal. Exactly one argument is expected: a nickname for the architecture."
echo " Example:"
echo " ./configure my_arch"
echo " which will look for Make.my_arch in ./setup"
exit 1
fi
root_path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
echo root_path = $root_path
arg_arch="$1"
bld_path=${root_path}/build_${1}
echo bld_path = $bld_path
if test ! -d $bld_path; then
mkdir -v $bld_path;
fi
setup_file=${root_path}/setup/Make.${arg_arch}
echo setup_file = $setup_file
CXX=$(grep -E "^CXX\s*=" $setup_file | tr -d ' ' | cut -d '=' -f 2)
# See row Adopt the File System TS for C++17
# at https://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#iso.2014.filesystemts
# and https://en.cppreference.com/w/cpp/compiler_support
LIBFS=""
if (test $CXX = "g++"); then
MAJ=$($CXX -dumpversion | cut -d '.' -f 1)
if [ "$MAJ" -lt "8" ]; then
echo Fatal. GCC version not supported `$CXX -dumpversion`. Minimum major version required is 8.
exit 1
elif [ "$MAJ" -eq 8 ]; then
LIBFS=-lstdc++fs
fi
else
echo what the hell
fi
if test ! -f $setup_file ; then
echo
echo Please create the configuration file $setup_file
echo
exit 1
fi
mkfile=${root_path}/Makefile
echo mkfile = $mkfile
if test -f $mkfile ; then
rm $mkfile
fi
sed -e "s:EDIT_BUILDDIR:${bld_path}:" ${root_path}/Makefile.ext \
| sed -e "s:EDIT_ARCH:${arg_arch}:" \
| sed -e "s:EDIT_ROOTDIR:${root_path}:" \
| sed -e "s:EDIT_SOURCEDIR:${root_path}/src:" \
| sed -e "s:EDIT_LIBFS:${LIBFS}:" > $mkfile