-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathconfigure.in
421 lines (352 loc) · 11.4 KB
/
configure.in
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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
#!/bin/sh
AC_INIT(VERSION,, [email protected])
AC_PREREQ(2.60)
AC_CONFIG_SRCDIR([Makefile.in])
# Determine the host and build type.
# ===========================================================================
AC_CANONICAL_HOST
PACKAGE=qflow
VERSION=`cat ./VERSION | cut -d. -f1-2`
REVISION=`cat ./VERSION | cut -d. -f3`
AC_SUBST(VERSION)
AC_SUBST(REVISION)
AC_ARG_PROGRAM
# Required programs
# ===========================================================================
AC_PROG_CC
AC_PROG_CPP
AC_ISC_POSIX
if test "x$U" != "x"; then
AC_MSG_ERROR(Compiler not ANSI compliant)
fi
AC_PROG_INSTALL
AC_PROG_RANLIB
AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, :)
AC_CHECK_PROG(CP, cp, cp, :)
AC_CHECK_PROG(RM, rm, rm, :)
AC_CHECK_PROG(HAVE_PYTHON3, python3, yes, no)
AC_LANG_C
AC_HEADER_STDC
AC_CHECK_FUNCS(setenv putenv)
AC_PATH_PROG(ENV_PATH, env, env, $PATH)
# Options
# =========================================
dnl Path to Tcl/Tk
AC_ARG_WITH(tclsh,
[ --with-tclsh=DIR path to tclsh], [
if test -d "$withval"; then
TCLSH_DIR=$withval
elif test -f "$withval"; then
# Path includes "/tclsh"; remove it
TCLSH_DIR=${withval%/tclsh}
else
TCLSH_DIR=${PATH}
fi
AC_PATH_PROG(TCLSH_PATH, tclsh, tclsh, $TCLSH_DIR)
], [
AC_PATH_PROG(TCLSH_PATH, tclsh, tclsh, )])
AC_DEFINE_UNQUOTED(TCLSH_PATH, "$TCLSH_PATH")
dnl Path to Magic 8.X
AC_ARG_WITH(magic,
[ --with-magic=DIR path to magic-8.X], [
if test -d "$withval"; then
QFLOW_MAGIC_DIR=$withval
elif test -f "$withval"; then
# Path includes "/magic"; remove it
QFLOW_MAGIC_DIR=${withval%/magic}
else
QFLOW_MAGIC_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_MAGIC_PATH, magic, , $QFLOW_MAGIC_DIR)
], [
AC_PATH_PROG(QFLOW_MAGIC_PATH, magic, , )])
AC_DEFINE_UNQUOTED(QFLOW_MAGIC_PATH, "$QFLOW_MAGIC_PATH")
dnl Path to Netgen
AC_ARG_WITH(netgen,
[ --with-netgen=DIR path to netgen], [
if test -d "$withval"; then
QFLOW_NETGEN_DIR=$withval
elif test -f "$withval"; then
# Path includes "/netgen"; remove it
QFLOW_NETGEN_DIR=${withval%/netgen}
else
QFLOW_NETGEN_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_NETGEN_PATH, netgen, , $QFLOW_NETGEN_DIR)
], [
AC_PATH_PROG(QFLOW_NETGEN_PATH, netgen, , )])
AC_DEFINE_UNQUOTED(QFLOW_NETGEN_PATH, "$QFLOW_NETGEN_PATH")
dnl Path to Qrouter
AC_ARG_WITH(qrouter,
[ --with-qrouter=DIR path to qrouter], [
if test -d "$withval"; then
QFLOW_QROUTER_DIR=$withval
elif test -f "$withval"; then
# Path includes "/qrouter"; remove it
QFLOW_QROUTER_DIR=${withval%/qrouter}
else
QFLOW_QROUTER_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_QROUTER_PATH, qrouter, , $QFLOW_QROUTER_DIR)
], [
AC_PATH_PROG(QFLOW_QROUTER_PATH, qrouter, , )])
AC_DEFINE_UNQUOTED(QFLOW_QROUTER_PATH, "$QFLOW_QROUTER_PATH")
dnl Path to GrayWolf
AC_ARG_WITH(graywolf,
[ --with-graywolf=DIR path to graywolf], [
if test -d "$withval"; then
QFLOW_GRAYWOLF_DIR=$withval
elif test -f "$withval"; then
# Path includes "/graywolf"; remove it
QFLOW_GRAYWOLF_DIR=${withval%/graywolf}
else
QFLOW_GRAYWOLF_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_GRAYWOLF_PATH, graywolf, , $QFLOW_GRAYWOLF_DIR)
], [
AC_PATH_PROG(QFLOW_GRAYWOLF_PATH, graywolf, , )])
AC_DEFINE_UNQUOTED(QFLOW_GRAYWOLF_PATH, "$QFLOW_GRAYWOLF_PATH")
dnl Path to yosys
AC_ARG_WITH(yosys,
[ --with-yosys=DIR path to yosys], [
if test -d "$withval"; then
QFLOW_YOSYS_DIR=$withval
elif test -f "$withval"; then
# Path includes "/yosys"; remove it
QFLOW_YOSYS_DIR=${withval%/yosys}
else
QFLOW_YOSYS_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_YOSYS_PATH, yosys, , $QFLOW_YOSYS_DIR)
], [
AC_PATH_PROG(QFLOW_YOSYS_PATH, yosys, , )])
AC_DEFINE_UNQUOTED(QFLOW_YOSYS_PATH, "$QFLOW_YOSYS_PATH")
dnl Path to OpenTimer
AC_ARG_WITH(opentimer,
[ --with-opentimer=DIR path to ot-shell], [
if test -d "$withval"; then
QFLOW_OPENTIMER_DIR=$withval
elif test -f "$withval"; then
# Path includes "ot-shell"; remove it
QFLOW_OPENTIMER_DIR=${withval%/ot-shell}
else
QFLOW_OPENTIMER_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_OPENTIMER_PATH, ot-shell, , $QFLOW_OPENTIMER_DIR)
], [
AC_PATH_PROG(QFLOW_OPENTIMER_PATH, ot-shell, , )])
AC_DEFINE_UNQUOTED(QFLOW_OPENTIMER_PATH, "$QFLOW_OPENTIMER_PATH")
dnl Path to abk-openroad OpenSTA
AC_ARG_WITH(opensta,
[ --with-opensta=DIR path to sta], [
if test -d "$withval"; then
QFLOW_OPENSTA_DIR=$withval
elif test -f "$withval"; then
# Path includes "sta"; remove it
QFLOW_OPENSTA_DIR=${withval%/sta}
else
QFLOW_OPENSTA_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_OPENSTA_PATH, sta, , $QFLOW_OPENSTA_DIR)
], [
AC_PATH_PROG(QFLOW_OPENSTA_PATH, sta, , )])
AC_DEFINE_UNQUOTED(QFLOW_OPENSTA_PATH, "$QFLOW_OPENSTA_PATH")
dnl Path to abk-openroad RePlAce and detail placement ntuplace3/ntuplace4h
AC_ARG_WITH(replace,
[ --with-replace=DIR path to RePlAce], [
if test -d "$withval"; then
QFLOW_REPLACE_DIR=$withval
elif test -f "$withval"; then
# Path includes "/RePlAce"; remove it
QFLOW_REPLACE_DIR=${withval%/RePlAce}
else
QFLOW_REPLACE_DIR=${PATH}
fi
AC_PATH_PROG(QFLOW_REPLACE_PATH, RePlAce, , $QFLOW_REPLACE_DIR)
AC_PATH_PROG(QFLOW_NTUPLACE3_PATH, ntuplace3, , ${QFLOW_REPLACE_DIR}/../ntuplace)
AC_PATH_PROG(QFLOW_NTUPLACE4_PATH, ntuplace4h, , ${QFLOW_REPLACE_DIR}/../ntuplace)
], [
AC_PATH_PROG(QFLOW_REPLACE_PATH, RePlAce, , )
AC_PATH_PROG(QFLOW_NTUPLACE3_PATH, ntuplace3, , )
AC_PATH_PROG(QFLOW_NTUPLACE4_PATH, ntuplace4h, , )
])
AC_DEFINE_UNQUOTED(QFLOW_REPLACE_PATH, "$QFLOW_REPLACE_PATH")
dnl NOTE: The following is based on the current source distribution of RePlAce and
dnl is likely to change. QFLOW_NTUPLACE_PATH is set to the common prefix "ntuplace"
dnl of the actual tools, currently "ntuplace3" and "ntuplace4h". Probably better to
dnl write a custom autoconf script for this.
AC_DEFINE_UNQUOTED(QFLOW_NTUPLACE3_PATH, "$QFLOW_NTUPLACE3_PATH")
AC_DEFINE_UNQUOTED(QFLOW_NTUPLACE4_PATH, "$QFLOW_NTUPLACE4_PATH")
dnl Target library location
AC_ARG_WITH(libdir,
[ --with-libdir=DIR path to qflow runtime files], [
QFLOW_LIB_DIR=$withval
], [
QFLOW_LIB_DIR="\${prefix}/share/qflow"
])
AC_ARG_WITH(bindir,
[ --with-bindir=DIR path to qflow launch script], [
QFLOW_BIN_DIR=$withval
], [
QFLOW_BIN_DIR="\${prefix}/bin"
])
# For distributed installs, where the run-time files are installed in a
# place that is a temporary staging area, like DESTDIR, but unlike DESTDIR,
# the prefix is replaced by the destination directory, rather than appended
# to it.
DIST_DIR="\${exec_prefix}"
AC_ARG_WITH(distdir,
[ --with-distdir=DIR install into location DIR for distribution], [
if test "$withval" = "no" -o "$withval" = "NO" ; then
DIST_DIR="\${exec_prefix}"
else
DIST_DIR=${withval}
fi
], )
dnl AC_SUBST(QFLOW_YOSYS_PATH)
dnl AC_SUBST(QFLOW_GRAYWOLF_PATH)
dnl AC_SUBST(QFLOW_REPLACE_PATH)
dnl AC_SUBST(QFLOW_NTUPLACE3_PATH)
dnl AC_SUBST(QFLOW_NTUPLACE4_PATH)
dnl AC_SUBST(QFLOW_QROUTER_PATH)
dnl AC_SUBST(QFLOW_MAGIC_PATH)
dnl AC_SUBST(QFLOW_NETGEN_PATH)
dnl AC_SUBST(QFLOW_OPENTIMER_PATH)
dnl AC_SUBST(QFLOW_OPENSTA_PATH)
AC_SUBST(QFLOW_BIN_DIR)
AC_SUBST(QFLOW_LIB_DIR)
AC_SUBST(TCLSH_PATH)
AC_SUBST(HAVE_PYTHON3)
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
AC_SUBST(LD)
AC_SUBST(STDLIBS)
AC_SUBST(DIST_DIR)
if test "x${ac_cv_path_QFLOW_YOSYS_PATH}" == "x"; then
HAVE_YOSYS=0
else
HAVE_YOSYS=1
fi
AC_SUBST(HAVE_YOSYS)
if test "x${ac_cv_path_QFLOW_MAGIC_PATH}" == "x"; then
HAVE_MAGIC=0
else
HAVE_MAGIC=1
fi
AC_SUBST(HAVE_MAGIC)
if test "x${ac_cv_path_QFLOW_NETGEN_PATH}" == "x"; then
HAVE_NETGEN=0
else
HAVE_NETGEN=1
fi
AC_SUBST(HAVE_NETGEN)
if test "x${ac_cv_path_QFLOW_OPENTIMER_PATH}" == "x"; then
HAVE_OPENTIMER=0
else
HAVE_OPENTIMER=1
fi
AC_SUBST(HAVE_OPENTIMER)
if test "x${ac_cv_path_QFLOW_OPENSTA_PATH}" == "x"; then
HAVE_OPENSTA=0
else
HAVE_OPENSTA=1
fi
AC_SUBST(HAVE_OPENSTA)
if test "x${ac_cv_path_QFLOW_GRAYWOLF_PATH}" == "x"; then
HAVE_GRAYWOLF=0
else
HAVE_GRAYWOLF=1
fi
AC_SUBST(HAVE_GRAYWOLF)
if test "x${ac_cv_path_QFLOW_REPLACE_PATH}" == "x"; then
HAVE_REPLACE=0
else
HAVE_REPLACE=1
fi
AC_SUBST(HAVE_REPLACE)
if test "x${ac_cv_path_QFLOW_QROUTER_PATH}" == "x"; then
HAVE_QROUTER=0
else
HAVE_QROUTER=1
fi
AC_SUBST(HAVE_QROUTER)
AC_OUTPUT(Makefile scripts/Makefile src/Makefile tech/Makefile tech/osu050/Makefile tech/osu035/Makefile tech/osu035_redm4/Makefile tech/osu018/Makefile tech/gscl45nm/Makefile)
echo ""
echo "Configuration results:"
echo "----------------------------------------------------"
echo ""
FATAL=0
WARN=0
if test "x${ac_cv_path_QFLOW_YOSYS_PATH}" == "x"; then
FATAL=1
echo "ERROR: yosys not found. Use --with-yosys=<DIR>"
else
echo "Using yosys verilog synthesis tool at: ${ac_cv_path_QFLOW_YOSYS_PATH}"
fi
# Make sure one placement tool exists
if test "x${ac_cv_path_QFLOW_GRAYWOLF_PATH}" == "x" -a "x${ac_cv_path_QFLOW_REPLACE_PATH}" == "x"; then
FATAL=1
echo "ERROR: No placement tool found. Need either graywolf or RePlAce."
fi
if test "x${ac_cv_path_QFLOW_GRAYWOLF_PATH}" == "x"; then
echo "GrayWolf not found. Use --with-graywolf=<DIR> (optional)"
else
echo "Using graywolf placement tool at: ${ac_cv_path_QFLOW_GRAYWOLF_PATH}"
fi
if test "x${ac_cv_path_QFLOW_REPLACE_PATH}" == "x"; then
echo "RePlAce not found. Use --with-replace=<DIR> (optional)"
else
echo "Using RePlAce placement tool at: ${ac_cv_path_QFLOW_REPLACE_PATH}"
fi
if test "x${ac_cv_path_QFLOW_QROUTER_PATH}" == "x"; then
echo "ERROR: qrouter not found. Use --with-qrouter=<DIR>"
FATAL=1
else
echo "Using qrouter detail route tool at: ${ac_cv_path_QFLOW_QROUTER_PATH}"
fi
if test "x${ac_cv_path_QFLOW_MAGIC_PATH}" == "x"; then
WARN=1
echo "WARNING: Magic 8.X layout tool not found. Use --with-magic=<DIR>"
else
echo "Using Magic layout tool at: ${ac_cv_path_QFLOW_MAGIC_PATH}"
fi
if test "x${ac_cv_path_QFLOW_NETGEN_PATH}" == "x"; then
WARN=1
echo "WARNING: Netgen LVS tool not found. Use --with-netgen=<DIR>"
else
echo "Using Netgen LVS tool at: ${ac_cv_path_QFLOW_NETGEN_PATH}"
fi
echo "Using Vesta STA tool (internal)"
if test "x${ac_cv_path_QFLOW_OPENTIMER_PATH}" == "x"; then
echo "OpenTimer not found. Use --with-opentimer=<DIR> (optional)"
else
echo "Using OpenTimer static timing analysys tool at: ${ac_cv_path_QFLOW_OPENTIMER_PATH}"
fi
if test "x${ac_cv_path_QFLOW_OPENSTA_PATH}" == "x"; then
echo "OpenSTA not found. Use --with-opensta=<DIR> (optional)"
else
echo "Using OpenSTA static timing analysys tool at: ${ac_cv_path_QFLOW_OPENSTA_PATH}"
fi
if test "x${HAVE_PYTHON3}" == "x"; then
WARN=1
echo "No python3 on system, will not install qflow GUI or spi2xspice.py"
fi
echo "----------------------------------------------------"
if test x$WARN = x1; then
echo "Some tools needed for a complete flow were not found. This will result in"
echo "an incomplete synthesis flow."
echo ""
fi
if test x$FATAL = x1; then
echo "One or more mandatory tools needed for a basic synthesis flow were not found."
echo "This will result in an unusable synthesis flow. Please check the configure"
echo "options with \"./configure --help\" and ensure that all tools are available"
echo "to qflow for a complete synthesis flow."
echo ""
fi
if test x$WARN = x0 -a x$FATAL = x0; then
echo "All tools needed for complete flow have been found."
echo "Run \"make\" followed by \"sudo make install\" to install qflow."
echo ""
fi
echo "----------------------------------------------------"