-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·135 lines (119 loc) · 3.88 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
#!/bin/bash
configure_options="$*"
platform=unix
dotprogram='dot'
dotviewer='dotviewer'
vcdviewer='gtkwave'
txtviewer='nano'
install_prefix='/usr/local/hocl'
install_bindir=''
install_libdir=''
install_docdir=''
#install_mandir=''
install_emacsdir=''
sysc_lib='yes'
doc='yes'
sysc_dir='/usr/local/systemc-2.3.0'
preesm_dir='/usr/local/preesm-dev'
local=''
# Parse command-line arguments
while : ; do
case "$1" in
"") break;;
-prefix|--prefix)
install_prefix=$2; shift;;
-bindir|--bindir)
install_binbdir=$2; shift;;
-libdir|--libdir)
install_libdir=$2; shift;;
-docdir|--docdir)
install_docdir=$2; shift;;
# -mandir|--mandir)
# install_mandir=$2; shift;;
-emacsdir|--emacsdir)
install_emacsdir=$2; shift;;
-no-doc|--no-doc)
doc='no';;
-dot|--dot)
dotprogram=$2; shift;;
-dotviewer|--dotviewer)
dotviewer=$2; shift;;
-systemcdir|--systemcdir)
sysc_dir=$2; shift;;
-preesmdir|--preesmdir)
preesm_dir=$2; shift;;
-local|--local)
local='yes';;
-help|--help)
cat <<EOF
Usage: configure [options]
Options: [defaults in brackets after descriptions]
--prefix DIR install executables, libs and docs in DIR [default: $prefix]
--bindir DIR install executables in DIR [default: $install_bindir]
--libdir DIR install libraries in in DIR [default: $install_libdir]
--docdir DIR install documentation in DIR [default: $install_docdir]
--emacsdir DIR install emacs mode in DIR [default:$install_emacsdir]
--dot NAME command for runing dot program [default: $dotprogram]
--dotviewer NAME command for displaying .dot files [default: $dotviewer]
--systemcdir DIR location of the SystemC installation [default: $sysc_dir]
--preesmdir DIR target dir for Preesm projects [default: $preesm_dir]
--help print this message
EOF
exit 0;;
*) echo "Unknown option \"$1\"." 1>&2; exit 2;;
esac
shift
done
if [ -n "$install_prefix" ]; then
install_bindir="$install_prefix/bin"
install_libdir="$install_prefix/lib"
install_docdir="$install_prefix/doc"
install_emacsdir="$install_prefix/share/emacs/site-lisp"
fi
# Generate the config file
rootdir=`dirname $0`
cd $rootdir
rm -f config
touch config
# Write options
version=`cat VERSION`
echo "# generated by ./configure $configure_options" >> config
echo "" >> config
echo "PLATFORM=$platform" >> config
echo "VERSION=$version" >> config
echo "BUILD_DOC=$doc" >> config
echo "" >> config
echo "# INSTALL PATHS" >> config
echo "INSTALL_BINDIR=$install_bindir" >> config
echo "INSTALL_LIBDIR=$install_libdir" >> config
# if [ -n "$doc" ]; then
# echo "INSTALL_DOCDIR=$install_docdir" >> config
# fi
#echo "INSTALL_MANDIR=$install_mandir" >> config
echo "INSTALL_EMACSDIR=$install_emacsdir" >> config
touch ./config-stamp
echo "** Wrote file ./config"
echo
echo "** Configuration summary **"
echo
echo "Directory where the distribution will be installed:"
echo " binaries................ $install_bindir"
echo " library................. $install_libdir"
# if [ -n "$doc" ]; then
# echo " documentation............. $install_docdir"
# fi
#echo " man pages................. $install_mandir"
echo " emacs mode................ $install_emacsdir"
echo
echo "HOCL=$install_prefix" > platform
echo "HOCLC=\$(HOCL)/bin/hoclc" >> platform
echo "DOTVIEWER=$dotviewer" >> platform
echo "VCDVIEWER=$vcdviewer" >> platform
echo "TXTVIEWER=$txtviewer" >> platform
echo "PREESM_REP=$preesm_dir" >> platform
echo "PREESM_PROJ=$preesm_dir/\$(PROJ)" >> platform
echo "** Wrote file ./platform"
echo "(* This file is generated *)" > ./src/version.ml
echo "let version=\"$version\"" >> ./src/version.ml
echo "let stdlib=\"$install_prefix/lib/hocl/stdlib.hcl\"" >> ./src/version.ml
echo "** Wrote file ./src/version.ml"