-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathconfigure.ac
735 lines (659 loc) · 22.3 KB
/
configure.ac
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
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# "configure.ac"
# Process this file with "autoconf" to generate the "configure" script.
# (Prior to 2005/06/19, this file was "configure.in",
# in case one should want to trace back the CVS revision history.)
#
# $Id: configure.ac,v 1.228 2011/05/03 19:20:32 fang Exp $
# Hint: Try running "autoscan" for suggestions on what should go in here.
# Results of autoscan appear in "configure.scan".
AC_PREREQ(2.59)
dnl also works with autoconf 2.60 now
AC_INIT(hackt, 0.1.4-devel-20170223, [email protected])
dnl prefer to push this into src directory,
dnl and have "src/config.h" wrap around this.
AC_CONFIG_HEADERS([src/__config__.h])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_MACRO_DIR([config]) dnl wish these were in config/m4 instead
dnl AM_CONFIG_HEADER(config.h) dnl obsolete macro
AC_CONFIG_SRCDIR([src/main/main_funcs.cc])
# don't need this yet
dnl AC_CONFIG_SUBDIRS()
# Propagate the make warning flags recursively
AM_INIT_AUTOMAKE([1.9 -Wall -Werror])
# Enable or disable automatic reconfiguring.
# AM_MAINTAINER_MODE
AC_CANONICAL_HOST
dnl may need to readlink to dereference sym-links
if test "$AWK" = "mawk" ; then
AC_MSG_ERROR([mawk is known to reject valid input, please try any other awk!
You can override the tool by passing AWK=... to the configure options.
])
fi
HACKT_AUTO_GITIGNORE
dnl true if building in srcdir
AM_CONDITIONAL(SRCDIR_BUILD, test "$srcdir" = ".")
AC_CHECK_PROG([SH], sh, sh)
AC_PATH_PROG(SH_PATH, sh)
dnl AM_TRUE is always true, needed to fake conditional Makefile
AM_CONDITIONAL(ALWAYS_TRUE, true)
HACKT_MAKE_SHELL_PIPEFAIL
# CALLMAKE is intended for shell scripts' invocations of make
# NOT intended for direct use in configured Makefiles, because
# MAKE is more appropriate and configured for automake already.
AC_CHECK_PROGS([CALLMAKE], gmake make)
# basic program checks
AC_PROG_LN_S
AC_CHECK_PROG([CAT], cat, cat)
AC_CHECK_PROG([CPP_TRADITIONAL], cpp, cpp)
AC_CHECK_PROG([CHMOD], chmod, chmod)
# git is not required, but will enable some handy targets
AC_CHECK_PROG([GIT], git, git)
AM_CONDITIONAL(HAVE_GIT, test -n "$GIT")
AC_CHECK_PROG([DATE], date, date)
AC_CHECK_PROG([DIFF], diff, diff)
AC_CHECK_PROG([PATCH], patch, patch)
AC_CHECK_PROG([FIND], find, find)
AC_CHECK_PROG([GREP], grep, grep)
AC_CHECK_PROG([HEXDUMP], hexdump, hexdump)
AC_CHECK_PROG([PRINTF], printf, printf)
AC_CHECK_PROG([SORT], sort, sort)
AC_CHECK_PROG([CUT], cut, cut)
AC_CHECK_PROG([PASTE], paste, paste)
AC_CHECK_PROG([HEAD], head, head)
AC_CHECK_PROG([TAIL], tail, tail)
AC_CHECK_PROG([TEE], tee, tee)
AC_CHECK_PROG([TR], tr, tr)
# AC_CHECK_PROG([PWD], pwd, pwd)
# checking for PWD doesn't work as expected...
AC_CHECK_PROG([SED], sed, sed)
AC_CHECK_PROG([TOUCH], touch, touch)
FANG_PROG_SLEEP
AC_CHECK_PROG([INDENT], indent, indent)
AC_CHECK_PROGS([M4], gm4 m4, m4)
AC_CHECK_PROGS([XARGS], xargs, xargs)
# AC_PROG_PERL
AC_CHECK_PROG([PERL], perl, perl)
AC_PATH_PROG([PERL_PATH], perl)
# documentation support, macros efined in "config/documentation.m4"
DOC_CHECK_PROG_DOXYGEN
DOC_CHECK_PROGS_GRAPHVIZ
FANG_CHECK_PROGS_TETEX
dnl already checked and defined by texinfos.am
dnl DOC_CHECK_PROG_DVIPS
DOC_CHECK_PROG_PS2PDF
DOC_CHECK_PROG_PS2EPSI
AC_CHECK_PROG([PSNUP], psnup, psnup)
AC_CHECK_PROG([INFO], info, info)
AM_CONDITIONAL(HAVE_INFO, test -n "$INFO" )
AC_CHECK_PROG([MAKEINFO], makeinfo, makeinfo)
dnl covered by texinfos.am already
dnl AC_CHECK_PROG([TEXI2DVI], texi2dvi, texi2dvi)
dnl AC_CHECK_PROG([TEXI2PDF], texi2pdf, texi2pdf)
AC_CHECK_PROG([TEXI2HTML], texi2html, texi2html)
# figure related stuff
FANG_CHECK_PROGS_XFIG
dnl checks for xfig, transfig, fig2dev
AC_CHECK_FILES([/dev/null])
dnl standard terminal devices for redirection (test doesn't work)
dnl AC_CHECK_FILES([/dev/stdin /dev/stdout /dev/stderr])
# checking for old CAST tools for regression and backwards compatibility tests
# no big deal if they don't exist...
# NOTE: AM_CONDITIONAL is usable in generation of AC_CONFIG_FILES
# just use @VAR_TRUE@ instead of the if ... version in automake
AC_CHECK_PROG([PRSIM], prsim, prsim)
AC_CHECK_PROG([LVS], lvs, lvs)
AC_CHECK_PROG([CFLAT], cflat, cflat)
AM_CONDITIONAL(HAVE_PRSIM, test -n "$PRSIM" )
AM_CONDITIONAL(HAVE_LVS, test -n "$LVS" )
AM_CONDITIONAL(HAVE_CFLAT, test -n "$CFLAT" )
# Lex/Yacc support
# note: autoconf-2.60 overrides this with its own built-in YACC check
# but it doesn't break anything
HACKT_ARG_VAR_LEX
HACKT_ARG_VAR_YACC
HACKT_LEX_VERSION
dnl naive macro to check whether automake produces .h or .hh from .cc after .yy
AM_CONDITIONAL(YLWRAP_CC2HH, grep -q am__yacc_c2h $srcdir/src/Makefile.in)
AC_CHECK_PROG([PKG_CONFIG], pkg-config, pkg-config)
AM_CONDITIONAL(HAVE_PKG_CONFIG, test -n "$PKG_CONFIG" )
# interface generator, no longer needed
dnl AC_CHECK_PROG([SWIG], swig, swig)
dnl AM_CONDITIONAL(HAVE_SWIG, test -n "$SWIG" )
# comment out until time for release
# this causes too many rebuilds during development
# AC_DEFINE_UNQUOTED(HACKT_BUILD_DATE, "`$DATE`", [Define the build date.])
# This takes care of many standard C[++] compiler configuration checks.
AC_PROG_RANLIB
dnl -------------------------- LIBTOOL SECTION --------------------------------
dnl MAINTAINER INSTRUCTIONS:
dnl uncomment the macros in either the 1.5.x section or the 2.x section
dnl need ltdl: dlopen-ing plug-ins and module shared objects/libraries
dnl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
m4_ifdef([LT_INIT],[
dnl libtool-2.x setup
LT_INIT([dlopen])
AC_LIBLTDL_INSTALLABLE
AC_DISABLE_STATIC
LTDL_INIT
LT_MODULE_PATH_VAR=$lt_cv_module_path_var
LT_OBJDIR=$lt_cv_objdir
dnl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
],[
dnl libtool-1.5.x setup
AC_LIBLTDL_CONVENIENCE
AC_LIB_LTDL
AC_LIBTOOL_DLOPEN
AC_DISABLE_STATIC
AC_LIBLTDL_INSTALLABLE
AC_PROG_LIBTOOL
AC_CONFIG_SUBDIRS(libltdl)
dnl need these variables to augment test environment
dnl some of these are mapped over from libtool 1.5 to 2.x
LTDL_SHLIBPATH_VAR=$libltdl_cv_shlibpath_var
LT_MODULE_PATH_VAR=$LTDL_SHLIBPATH_VAR
LTDL_OBJDIR=$libltdl_cv_objdir
LT_OBJDIR=$LTDL_OBJDIR
])
dnl - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dnl common libtool setup
HACKT_ARG_VAR_LIBTOOL_FLAGS
dnl e.g. --silent
AC_SUBST(LTDLINCL)
AC_SUBST(LIBLTDL)
# Automatically update if libtool script is outdated.
# Adds corresponding dependencies to "Makefile.in".
AC_SUBST(LIBTOOL_DEPS)
dnl need these variables to augment test environment
LT_MODULE_EXT=$libltdl_cv_shlibext
AC_SUBST(LT_MODULE_EXT)
AC_SUBST(LT_MODULE_PATH_VAR)
AC_SUBST(LT_OBJDIR)
dnl ----------------------- end LIBTOOL SECTION -------------------------------
dnl we move this down here b/c libtool.m4:LT_INIT redefines ECHO with
dnl its own improperly quoted "printf '%s\n'", which comes out wrong
dnl in Makefiles after substitution, due to quote stripping.
ECHO=
AC_CHECK_PROG([ECHO], echo, echo)
dnl AM_CONDITIONAL(NEED_SHLIBPATH_VAR, test -n "$LTDL_SHLIBPATH_VAR")
dnl case $build_os in
dnl darwin*) AM_CONDITIONAL(BUILD_DARWIN, true) ;;
dnl *) AM_CONDITIONAL(BUILD_DARWIN, false) ;;
dnl esac
if test "$enable_shared" = "no" ; then
AC_MSG_WARN([You requested disabling shared libraries, however some features of this package require shared libraries, so certain tests will fail!])
fi
AC_ARG_VAR(ACLOCAL_FLAGS, [Additional aclocal flags, for bootstrap only.])
dnl defined in config.hackt.m4
HACKT_ARG_ENABLE_OBJECT_ALIGN_CHECKING
HACKT_ARG_ENABLE_GOD_MODE
dnl defined in config/header_validation.m4
FANG_ARG_ENABLE_HEADER_VALIDATION
dnl test control
HACKT_ARG_ENABLE_CHECK_TESTS
HACKT_ARG_ENABLE_RANDOM_TESTS
HACKT_ARG_ENABLE_INTERACTIVE_TESTS
HACKT_ARG_ENABLE_INSTALL_TESTS
dnl from "config/rl_el.m4"
FANG_ARG_WITH_READLINE_EDITLINE
HACKT_ARG_WITH_GMP
HACKT_ARG_WITH_XDR
HACKT_ARG_WITH_VPI
dnl whether or not to build universal binary (config/hackt.m4)
dnl not actually implemented yet
HACKT_ARG_ENABLE_MULTILIB
dnl AC_ARG_ENABLE for building documentation (on by default)
dnl from "config/documentation.m4"
DOC_ARG_ENABLE_DOCS
HACKT_ARG_ENABLE_VERBOSE_CHECK
dnl enable or disable fun modules ("config/hackt.m4")
HACKT_ARG_ENABLE_FUN
dnl define WORDS_BIGENDIAN if is big endian
dnl not actually needed in this project yet
AC_C_BIGENDIAN
dnl check for __typeof__ operator, or equivalent
AC_C_TYPEOF
AC_PROG_CXX
dnl check for decltype operator, like typeof.
FANG_CXX_DECLTYPE
dnl from "config/cxx.m4"
FANG_CXX_VERSION
dnl checkpoint
AC_CACHE_SAVE
dnl we need these anal flags for checking for certain charateristics
dnl TODO: what are the equivalent flags for other compilers?
dnl from "config/cxx.m4"
FANG_ANAL_COMPILE_FLAGS
FANG_AM_FLAGS
dnl which set of pre-determined compiler flags to apply?
FANG_CXX_COMPILER
dnl TODO: add other conditionals for other common compilers
dnl XLC++, ICC, HPCC, etc...
AM_PROG_CC_C_O
AC_ISC_POSIX
dnl checks tons of standard C++ headers in various locations
dnl from "config/cxx_STL.m4"
dnl from this point to the end, we also apply ANAL_FLAGS before CFLAGS
dnl and CXXFLAGS to reflect what will be used during the build process.
FANG_HEADER_STDCXX
dnl AC_MSG_NOTIFY([Checking library functions and types with $ANAL_FLAGS])
FANG_CXX_ATTRIBUTE_UNUSED
FANG_CXX_ATTRIBUTE_UNUSED_CTOR
FANG_CXX_ATTRIBUTE_CONST
FANG_CXX_ATTRIBUTE_PURE
FANG_CXX_ATTRIBUTE_HOLY
FANG_CXX_ATTRIBUTE_NORETURN
FANG_CXX_ATTRIBUTE_MALLOC
FANG_CXX_ATTRIBUTE_PRECIOUS
FANG_CXX_ATTRIBUTE_VISIBILITY
FANG_CXX_ATTRIBUTE_PACKED
FANG_CXX_ATTRIBUTE_ALIGNED
FANG_CXX_ATTRIBUTE_ALIGNED_SIZE
FANG_CXX_ATTRIBUTE_EVIL
FANG_CXX_DEFAULT_TEMPLATE_TEMPLATE_PARAMETER_BINDING
FANG_CXX_TEMPLATE_FORMAL_BASE_CLASS
FANG_CXX_FRIEND_FUNCTION_NAMESPACE
FANG_CXX_OVERLOAD_VIRTUAL_USING
FANG_HASH_MAP_NAMESPACE
FANG_HASH_MAP_STYLE
FANG_HASH_MAP_DEPRECATED
FANG_CXXLIB_VERSIONED_NAMESPACE
FANG_CXX_STL_FUNCTIONAL_SELECT
FANG_CXX_STL_VALARRAY_BEGIN_END
FANG_CXX_STL_REVERSE_ITERATOR_COMPARISONS
FANG_CXX_STL_COPY_IF
FANG_CXX_STL_CONSTRUCT
FANG_CXX_STL_CONSTRUCT_COPY
FANG_CXX_STL_TREE
FANG_CXX_STD_BEGIN_END
FANG_CXX_STD_IFSTREAM_DEV_STDIN
FANG_CXX_STD_OFSTREAM_DEV_STDOUT
FANG_CXX_STD_OFSTREAM_DEV_STDERR
FANG_CXX_ISTREAM_NEGATIVE_UNSIGNED
FANG_CXX_STL_BITSET_EXTENSIONS
dnl check for compiler's built-in functions
FANG_C_BUILTIN_EXPECT
AC_LANG_PUSH(C++)
FANG_FUNC_BUILTIN_BITOPS
AC_LANG_POP(C++)
AC_CACHE_SAVE
# additional header checks
AC_HEADER_STDC
AC_CHECK_HEADERS([stddef.h stdlib.h stdint.h string.h unistd.h getopt.h])
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([ctype.h])
AC_CHECK_HEADERS([sys/stdtypes.h])
AC_HEADER_DIRENT
AC_CHECK_HEADERS([dirent.h sys/dirent.h])
AC_CHECK_HEADERS([signal.h sys/signal.h])
AC_CHECK_HEADERS([sys/stat.h])
AC_CHECK_HEADERS([fcntl.h sys/fcntl.h])
AC_CACHE_SAVE
dnl we deliberaly spare these basic check from Fang's anal compile flags
dnl suggestions from autoscan
AC_FUNC_ALLOCA dnl wanted by the y.tab.c generated
AC_FUNC_CLOSEDIR_VOID dnl wanted by src/util/dirent.cc
AC_FUNC_STAT dnl wanted by src/util/file_status.h
# compiler characteristic checks
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_C_VOLATILE
FANG_TYPEDEF_FILE dnl defined in "config/cc.m4"
# library functions
AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([calloc free])
AC_MSG_CHECKING([for free food])
AC_MSG_RESULT([YES]);
AC_FUNC_SETVBUF_REVERSED
top_saved_CFLAGS="$CFLAGS"
top_saved_CXXFLAGS="$CXXFLAGS"
dnl ignore warnings for function checks
dnl CONFTEST flags are defined by FANG_CONFTEST_FLAGS from hackt.m4
CFLAGS="$CONFTEST_CFLAGS -Wno-error"
CXXFLAGS="$CONFTEST_CXXFLAGS -Wno-error"
dnl temporarily override ac_compile and ac_link to force checking in C++ mode
dnl language mode doesn't really matter because these test by linking
AC_LANG_PUSH(C++)
AC_CHECK_TYPES([ptrdiff_t])
AC_CHECK_TYPES([std::ptrdiff_t])
AC_CHECK_TYPES([pid_t])
dnl AC_CHECK_FUNCS([sqrt])
FANG_FUNC_SQRT
dnl AC_CHECK_FUNCS([fmod fmodf])
FANG_FUNC_FMOD
FANG_FUNC_FMODF
AC_CHECK_FUNCS([getopt strsep strtok strtok_r strdup \]
dnl strsep is missing on Solaris 2.9
dnl <stdio.h>
[fgets fputs fputc fgetc fopen fdopen fclose fflush ferror \]
[feof clearerr open close fseek ftell rewind fgetpos fsetpos \]
[tmpfile tmpnam tempnam mktemp mkstemp mkstemps mkdtemp \]
[remove rename \]
[setbuf setbuffer setlinebuf setvbuf \]
dnl <ctype.h>
[isascii isspace isdigit isalpha isalnum islower isupper \]
[iscntrl isgraph ishexnumber isideogram isnumber isphonogram \]
[isspecial isprint ispunct isrune isxdigit tolower toupper \]
[abs labs llabs fabs fabsf fabsl \]
[drand48 erand48 lrand48 nrand48 \]
[mrand48 jrand48 srand48 seed48 lcong48 \]
[sincos fsincos sincosf sincosl \]
[system exec \]
[atexit \]
[getenv setenv putenv unsetenv \]
[pipe fork vfork popen pclose dup dup2 \]
dnl vfork is not always available
[wait waitpid wait3 wait4 \]
dnl wait3 and wait4 are not specificed by POSIX, avoid using them if possible
dnl the following are expected to be in glibc
[fmemopen open_memstream]
)
FANG_CHECK_CXX_RAND48_FUNCS
FANG_CHECK_CXX_FDOPEN
FANG_CHECK_CXX_POPEN
AC_LANG_POP(C++)
dnl but keep errors for type checks.
CFLAGS="$CONFTEST_CFLAGS"
CXXFLAGS="$CONFTEST_CXXFLAGS"
# sizeof checks, useful for checking ILP model
AC_LANG_PUSH(C++)
dnl testing in C++ mode coerces test to use CXXFLAGS
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(uchar)
AC_CHECK_SIZEOF(u_char)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(ushort)
AC_CHECK_SIZEOF(u_short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(uint)
AC_CHECK_SIZEOF(u_int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(ulong)
AC_CHECK_SIZEOF(u_long)
dnl NOTE: o some systems, system headers protect long long, which causes
dnl the following test to *unexpectedly* pass even with -pedantic-errors
dnl This inconsistency between configure and use is quite annoying and
dnl motivates us to automatically apply -Wno-long-long.
dnl Below, we call FANG_CXX_AUTO_NO_LONG_LONG after CXXFLAGS is restored.
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(ulonglong)
AC_CHECK_SIZEOF(float)
AC_CHECK_SIZEOF(double)
AC_CHECK_SIZEOF(long double)
AC_CHECK_SIZEOF(void*)
AC_CHECK_SIZEOF(size_t)
AC_CHECK_SIZEOF(int16)
AC_CHECK_SIZEOF(uint16)
AC_CHECK_SIZEOF(u_int16)
AC_CHECK_SIZEOF(int16_t)
AC_CHECK_SIZEOF(uint16_t)
AC_CHECK_SIZEOF(u_int16_t)
AC_CHECK_SIZEOF(int32)
AC_CHECK_SIZEOF(uint32)
AC_CHECK_SIZEOF(u_int32)
AC_CHECK_SIZEOF(int32_t)
AC_CHECK_SIZEOF(uint32_t)
AC_CHECK_SIZEOF(u_int32_t)
AC_CHECK_SIZEOF(int64)
AC_CHECK_SIZEOF(uint64)
AC_CHECK_SIZEOF(u_int64)
AC_CHECK_SIZEOF(int64_t)
AC_CHECK_SIZEOF(uint64_t)
AC_CHECK_SIZEOF(u_int64_t)
FANG_TYPE_QUAD_T_ARITHMETIC
FANG_TYPE_U_QUAD_T_ARITHMETIC
FANG_TYPE_EQUIV_SIZE_T_UNSIGNED_LONG
FANG_TYPE_EQUIV_UINT32_UNSIGNED_LONG
FANG_TYPE_EQUIV_UINT32_SIZE_T
FANG_TYPE_EQUIV_UINT64_UNSIGNED_LONG
FANG_TYPE_EQUIV_UINT64_SIZE_T
AC_LANG_POP(C++)
dnl test whether or not we're expecting 32b binary interface
dnl this is used to expect binary differences on non-LP32 platforms.
AM_CONDITIONAL(ABI_ILP32, test "$ac_cv_sizeof_size_t" = "4")
AM_CONDITIONAL(ABI_ILP64, test "$ac_cv_sizeof_size_t" = "8")
CFLAGS="$top_saved_CFLAGS"
CXXFLAGS="$top_saved_CXXFLAGS"
dnl detect dialect/test inconsistency and workaround
FANG_CXXFLAGS_AUTO_NO_LONG_LONG
AC_CACHE_SAVE
HACKT_CHECK_SANITY
dnl PACKAGE CHECKS
dnl readline or editline support
FANG_CHECK_READLINE
FANG_CHECK_EDITLINE
dnl check prototype of readline() if applicable
FANG_CHECK_READLINE_ARG_CONST
dnl check for X11 includes and libraries
hackt_have_x11=no
AC_PATH_X
if test -d "$ac_x_includes" ; then
X11_INCLUDE="-I$ac_x_includes"
if test -d "$ac_x_libraries" ; then
hackt_have_x11=yes
fi
fi
if test -d "$ac_x_libraries" ; then
X11_LDPATH="-L$ac_x_libraries"
fi
AC_SUBST(X11_INCLUDE)
AC_SUBST(X11_LDPATH)
if test "$hackt_have_x11" = "yes" ; then
AC_DEFINE(HAVE_X11, 1, [Define to 1 if we X11 includes/libs found])
fi
AM_CONDITIONAL(HAVE_X11, test "$hackt_have_x11" = "yes")
dnl check for guile-config
FANG_GUILE
dnl TODO: AC_SUBST these flags into separate options
dnl TODO: xdr
dnl for automake consumption
dnl order would matter if there are cross-conflicting headers installed
AUTO_CPPFLAGS="$EL_INCLUDE $RL_INCLUDE $NCURSES_INCLUDE $GMP_INCLUDE"
dnl order might matter in the presence of cross-conflicting libraries
AUTO_LDFLAGS="$EL_LDPATH $RL_LDPATH $NCURSES_LDPATH $GMP_LDPATH"
dnl order matters! we are taking responsibility for this
dnl rather than letting LIBS accumulate over checks.
AUTO_LIBS="$EL_LIB $RL_LIB $NCURSES_LIB $GMP_LIB"
dnl LIBS="$AUTO_LIBS"
dnl may decide not to use these, depending on how much control is needed
AC_SUBST(AUTO_CPPFLAGS)
AC_SUBST(AUTO_LDFLAGS)
dnl AC_SUBST(AUTO_LIBS)
dnl NOTE USED ANY MORE
dnl first, create a useful variable substitution script for use in config.status
dnl AC_CONFIG_FILES([config_subst.awk.sh:config/config_subst.awk],
dnl [dollar=$
dnl at=@
dnl cat > config_subst.awk.sh <<EOF
dnl #!$SHELL
dnl awk -f $srcdir/config/config_subst.awk $dollar$at
dnl EOF
dnl chmod +x config_subst.awk.sh
dnl ])
CONFIGDATE=`$DATE`
AC_SUBST(CONFIGDATE)
cat <<ACEOF
configuration summary:
CONFIG_SHELL: $CONFIG_SHELL
AWK: $AWK
CXX: $CXX_VERSION
CPPFLAGS: $CPPFLAGS
CXXFLAGS: $CXXFLAGS
LDFLAGS: $LDFLAGS
LEX: $LEX_VERSION
YACC: $YACC_VERSION
ltdl include: $LTDLINCL
ltdl libs: $LIBLTDL
readline include: $RL_INCLUDE
readline LDFLAGS: $RL_LDPATH
readline libs: $RL_LIB
editline include: $EL_INCLUDE
editline LDFLAGS: $EL_LDPATH
editline libs: $EL_LIB
ncurses include: $NCURSES_INCLUDE
ncurses LDFLAGS: $NCURSES_LDPATH
ncurses libs: $NCURSES_LDPATH
GMP include: $GMP_INCLUDE
GMP LDFLAGS: $GMP_LDPATH
GMP libs: $GMP_LIB
X11 include: $X11_INCLUDE
X11 LDFLAGS: $X11_LDPATH
guile: $GUILE [[$GUILE_PATH]]
guile config: $GUILE_CONFIG_VERSION
guile CPPFLAGS: $GUILE_CPPFLAGS
guile LDFLAGS: $GUILE_LDFLAGS
VCS: $VCS
vpi CPPFLAGS: $VPI_INCLUDE
ACEOF
dnl error out if critical dependencies are not met
test "$LEX_VERSION" || AC_MSG_ERROR([lex or flex required, but none found!])
test "$YACC_VERSION" || AC_MSG_ERROR([yacc or bison required, but none found!])
# additional patch to Makefile to work around automake shortcoming
# recursive rm may fail if too many files in particular subdir.
# Makefile patch is currently disabled
# sed substitution forces POSIX-mode of tar to not be limited to 99 chars
# in full path names of files
AC_CONFIG_FILES([Makefile],
[
dnl patch -p0 < $srcdir/config/am__remove_distdir.diff
sed '/^am__tar/s/chof/chf/' Makefile > Makefile.tmp
mv Makefile.tmp Makefile
])
dnl ignore errors during attempt to make directories in parallel
AC_CONFIG_FILES([src/Makefile],
[sed '/test.*mkdir.*DESTDIR/s/test/-test/g' src/Makefile > src/Makefile.tmp && mv src/Makefile.tmp src/Makefile])
AC_CONFIG_FILES([
scripts/Makefile
src/util/test/Makefile
src/scm/Makefile
test/Makefile
test/lexer/Makefile
test/parser/Makefile
test/parser/basic/Makefile
test/parser/namespace/Makefile
test/parser/param/Makefile
test/parser/array/Makefile
test/parser/process/Makefile
test/parser/prs/Makefile
test/parser/chp/Makefile
test/parser/datatype/Makefile
test/parser/channel/Makefile
test/parser/template/Makefile
test/parser/typedef/Makefile
test/parser/connect/Makefile
test/parser/flow/Makefile
test/parser/rte/Makefile
test/prsim/Makefile
test/prsim/vpi/Makefile
test/chpsim/Makefile
test/chpsim/testlib/Makefile
test/chpsim/router/Makefile
test/chpsim/bingcd/Makefile
test/chpsim/installtest/Makefile
test/chpsim/libinstalltest/Makefile
test/guile/Makefile
test/net/Makefile
test/net/hac/Makefile
test/net/verilog/Makefile
test/lib/Makefile
test/PR/Makefile
test/benchmarks/Makefile
test/quarantine/Makefile
dox/Makefile
dox/mk/Makefile
dox/lang/Makefile
dox/util/Makefile
dox/objfmt/Makefile
dox/man/Makefile
dox/tutorial/Makefile
dox/cast2hac/Makefile
dox/prsim/Makefile
dox/chpsim/Makefile
dox/net/Makefile
dox/ipple/Makefile
lib/Makefile
lib/mk/Makefile
hackt.doxygen.config
installcheck.mk
])
AC_CONFIG_FILES([pre-inst-env],
[chmod +x pre-inst-env])
AC_CONFIG_FILES([hackt-config],
[chmod +x hackt-config])
AC_CONFIG_FILES([src/hac-cpp],
[chmod +x src/hac-cpp])
AC_CONFIG_FILES([src/hacguile],
[chmod +x src/hacguile])
AC_CONFIG_FILES([src/hacchpsimguile],
[chmod +x src/hacchpsimguile])
AC_CONFIG_FILES([src/spicegrind],
[chmod +x src/spicegrind])
AC_CONFIG_FILES([scripts/replace_if_changed.sh],
[chmod +x scripts/replace_if_changed.sh])
AC_CONFIG_FILES([src/util/test/hash_map_iterator_O2_bug_test.test],
[chmod +x src/util/test/hash_map_iterator_O2_bug_test.test])
AC_CONFIG_FILES([src/scripts/deps_to_dot.awk],
[chmod +x src/scripts/deps_to_dot.awk])
AC_CONFIG_FILES([install_transform.sh],
[chmod +x install_transform.sh])
AC_CONFIG_FILES([test/POM-header-filter.awk],
[chmod +x test/POM-header-filter.awk])
AC_CONFIG_FILES([test/test-series.sh],
[chmod +x test/test-series.sh])
dnl the AC_CONFIG_HEADERS macro does not perform AC_SUBST-itution
dnl so we have to fall back onto AC_CONFIG_FILES :(
dnl It wouldve been nice to have difference checking from AC_CONFIG_HEADERS...
dnl work on this nicety later...
dnl no input file needed, just referencing arbitrary existing file
dnl AC_CONFIG_FILES([configdate.h:config/macro-value.h.in],
dnl [out=configdate.h
dnl date=`./config_subst.awk.sh -v var=DATE config.status`
dnl sed 's/MACRO/CONFIGDATE/g' $srcdir/config/macro-value.h.in | \
dnl sed "s/VALUE/\"`$date`\"/g" > $out
dnl ])
AC_CONFIG_FILES([configdate.h src/buildhost.h])
AC_CONFIG_FILES([src/cxxflags.h src/cxx_version.h])
AC_CONFIG_FILES([src/lexer/lex_version.h src/parser/yacc_version.h])
AC_CONFIG_FILES([src/parser/hackt-parse.yy])
AC_CONFIG_FILES([src/parser/instref-parse.yy])
AC_CONFIG_FILES([src/parser/type-parse.yy])
AC_CONFIG_FILES([src/parser/verilog-parse.yy])
AC_CONFIG_FILES([src/parser/spice-parse.yy])
AC_CONFIG_FILES([src/guile/config_version.h])
AC_CONFIG_FILES([src/util/lang/CX/cx-parse.yy])
AC_CONFIG_FILES([src/scripts/init_hackt.sh],
[chmod +x src/scripts/init_hackt.sh])
AC_CONFIG_FILES([src/scripts/init_hackt.csh],
[chmod +x src/scripts/init_hackt.csh])
AC_CONFIG_FILES([src/scripts/hackt-env],
[chmod +x src/scripts/hackt-env])
AC_CONFIG_FILES([src/scripts/hacalloc],
[chmod +x src/scripts/hacalloc])
dnl initialize and reset header check dependencies
dnl also depend on Makefile?
dnl can't run make until depfiles has run! doh... work on this later...
dnl
dnl AC_CONFIG_FILES([src/headers_deps.make],
dnl [out=src/headers_deps.make
dnl (cd src && make echo-header-depbases) | \
dnl awk -f $srcdir/src/scripts/automake_include.awk >> $out
dnl ])
dnl auxiliary directories
AC_CONFIG_COMMANDS([mkdir-builddir],
[builddirlist='
dox/chpsim/figs
src/util/STL/.deps
src/util/lang/lexyacc
'
for d in $builddirlist
do
test -d $d || mkdir -p $d
done
])
AC_OUTPUT