-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
901 lines (724 loc) · 19.1 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
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
AC_INIT([multi2sim], [4.1])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/m2s.c])
AM_INIT_AUTOMAKE([nostdinc])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
# Silent rules if supported
ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Libtool
LT_INIT
AC_PROG_LIBTOOL
# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h float.h stddef.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h utime.h])
AC_CHECK_HEADER([elf.h], [AC_DEFINE([HAVE_ELF_H])], [AC_MSG_ERROR([cannot find header elf.h])])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_STRUCT_ST_BLOCKS
AC_CHECK_MEMBERS([struct stat.st_rdev])
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_ERROR_AT_LINE
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MALLOC
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_CHECK_FUNCS([alarm bzero ftruncate getcwd gettimeofday memset mkdir munmap select socket strcasecmp strchr strdup strncasecmp strtol utime])
#############################
# Note on tests for libraries
#############################
# We avoid using macro AC_CHECK_LIB, because it automatically updates variable
# LIBS, which is later used by any linker in the source tree. This is a problem
# when compiling runtimes with the -m32 flags. If LIBS are added, and the system
# has only the 64-bit versions, compilation fails.
# Thus, we perform tests manually by using AC_LINK_IFELSE and AC_LANG_PROGRAM.
# Then libraries are added only when generating the 'm2s' executable using
# LDFLAGS.
################
# Test for 'sed'
################
AC_MSG_CHECKING([for sed])
SED=`which sed`
if test $? == 0
then
AC_MSG_RESULT($SED)
AC_SUBST(SED)
else
AC_MSG_RESULT(no)
AC_MSG_ERROR([
Program 'sed' could not be found in your system. Please install this
command-line tool and retry compilation.]
)
fi
###############
# Test for libm
###############
AC_CHECK_HEADER([math.h], [], [AC_MSG_ERROR([cannot find header math.h])])
AC_MSG_CHECKING([for -lm])
# Use new LDFLAGS
saved_libs="$LIBS"
LIBS="-lm"
# Try program
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM([[#include <math.h>]], [[double x = sin(1.0);]])
],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([
The math library (libmath) is not present in your system. Please make
sure that your linker supports the -lm flag.]
)
]
)
# Restore original LDFLAGS
LIBS="$saved_libs"
#####################
# Test for libpthread
#####################
AC_CHECK_HEADER([pthread.h], [], [AC_MSG_ERROR([cannot find header pthread.h])])
AC_MSG_CHECKING([for -lpthread])
# Use temporary LDFLAGS
saved_libs="$LIBS"
LIBS="-lpthread"
# Try
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM([[int pthread_create();]], [[return pthread_create();]])
],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
AC_MSG_ERROR([
The POSIX threads library (libpthread) is not present in your system.
Please make sure that your linked supports the -lpthread flag.]
)
]
)
# Restore original LIBS
LIBS="$saved_libs"
###########
# Test ZLib
###########
have_zlib=yes
AC_CHECK_HEADER([zlib.h], [], [have_zlib=no])
AC_MSG_CHECKING([for -lz])
# Use temporary LIBS
saved_libs="$LIBS"
LIBS="-lz"
# Try them
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM([[int inflate();]], [[return inflate();]])
],
[],
[
have_zlib=no
]
)
# Restore original LIBS
LIBS="$saved_libs"
# Result
AC_MSG_RESULT($have_zlib)
if test x$have_zlib == xno
then
AC_MSG_ERROR([
The 'zlib' library development package is missing in your system.
Please install the package and then retry. In Ubuntu, the following
command is suggested:
sudo apt-get install zlib1g-dev]
)
fi
###################
# Test SSE4 Support
###################
have_sse4=no
AC_MSG_CHECKING([for SSE4 instructions support])
# Compile a test program with SSE4 assembly
AC_LINK_IFELSE(
[ AC_LANG_PROGRAM([[]], [[asm volatile( "pcmpeqq %xmm0, %xmm1\n\t");]]) ],
[ have_sse4=yes ],
[]
)
# Result
AC_MSG_RESULT($have_sse4)
if test x$have_sse4 == xno
then
AC_MSG_WARN([
Your CPU does not have support for x86 SSE4 instructions. Emulation of
these instructions will not be supported. The module in the x86 emulator
dealing with SSE4 instruction will not be compiled.]
)
else
AC_DEFINE(HAVE_SSE4, [1])
fi
##################
# Test flag '-m32'
##################
saved_flags="$CFLAGS"
CFLAGS="-m32"
AC_MSG_CHECKING([for -m32 compiler flag])
have_m32_flag="no"
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <stdio.h>]],
[[ printf("hello world\n"); ]]
)
],
[
have_m32_flag="yes"
]
)
AC_MSG_RESULT($have_m32_flag)
CFLAGS="$saved_flags"
# Show warning
if test "x$have_m32_flag" = "xno"
then
AC_MSG_WARN([
Your compiler does not support 32-bit compilation using the '-m32' flag.
This mode is needed to compile the Multi2Sim runtime libraries in
directory 'runtime', which you can later link with your OpenCL, OpenGL,
GLUT, ... guest programs.
This feature is not needed if you are just indenting to run pre-compiled
benchmarks. You need it only to compile your custom benchmarks that use
any of the Multi2Sim runtimes.
If you want to support this feature, please install the 32-bit gcc
libraries. For example, this can be done in Ubuntu 12.04 by running
command:
sudo apt-get install lib32gcc1 gcc-multilib]
)
fi
# Conditional for Makefile.am
AM_CONDITIONAL(HAVE_M32_FLAG, test x$have_m32_flag = xyes)
#############
# Test OpenCL
#############
# Check if the user explicitly disabled OpenCL
AC_ARG_ENABLE(opencl,
[ --enable-opencl={yes|no} Enable support for OpenCL (default=yes)],
[], [ enable_opencl=yes ])
# Check if OpenCL is present
have_opencl=no
if test "$enable_opencl" == "no"
then
AC_MSG_WARN([
Support for OpenCL has been explicitly disabled by a configuration flag.
Some features of Multi2Sim will be disabled.]
)
elif test "x$AMDAPPSDKROOT" != "x"
then
# Use temporary CFLAGS, LDFLAGS
saved_cflags="$CFLAGS"
saved_ldflags="$LDFLAGS"
saved_libs="$LIBS"
CFLAGS="-I$AMDAPPSDKROOT/include"
LDFLAGS="-L$AMDAPPSDKROOT/lib/x86 -L$AMDAPPSDKROOT/lib/x86_64"
LIBS="-lOpenCL"
# Try program
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <CL/cl.h>]],
[[
cl_int ret;
cl_platform_id platform;
cl_uint num_platforms;
ret = clGetPlatformIDs(1, &platform, &num_platforms);
return CL_SUCCESS;
]]
)
],
[
have_opencl=yes
])
# Restore original CFLAGS, LDFLAGS, LIBS
CFLAGS="$saved_cflags"
LDFLAGS="$saved_ldflags"
LIBS="$saved_libs"
fi
# Warning if not
if test "x$have_opencl" = "xno" -a "x$enable_opencl" = "xyes"
then
AC_MSG_WARN([
The AMD OpenCL SDK is not presently installed in your system, as
detected by the absence of the AMDAPPSDKROOT environment variable. The
headers and libraries provided by this package are needed to build the
command-line OpenCL kernel compiler provided by Multi2Sim.
This feature is only needed if you are intending to compile your own
OpenCL kernels, but not if you are using pre-compiled kernels available
on the benchmark suites. To enable this feature, you need to download
and install the AMD Catalyst GPU driver, as well as the AMD SDK.]
)
fi
# Conditional for Makefile.am
AM_CONDITIONAL(HAVE_OPENCL, test x$have_opencl = xyes)
#############
# Test OpenGL
#############
# Check if the user explicitly disabled OpenGL
AC_ARG_ENABLE(opengl,
[ --enable-opengl={yes|no} Enable support for OpenGL (default=yes)],
[], [ enable_opengl=yes ])
# Check if OpenGL is present
if test "$enable_opengl" == "no"
then
have_opengl=no
AC_MSG_WARN([
Support for OpenGL has been explicitly disabled by a configuration flag.
Some features of Multi2Sim will be disabled.]
)
else
# Assume that we have OpenGL
have_opengl=yes
# Check headers
AC_CHECK_HEADER([GL/glut.h], [], [have_opengl=no])
AC_CHECK_HEADER([GL/gl.h], [], [have_opengl=no])
AC_CHECK_HEADER([GL/glu.h], [], [have_opengl=no])
AC_CHECK_HEADER([GL/glew.h], [], [have_opengl=no])
# Linker flags for OpenGL
OPENGL_LDFLAGS="-lGL -lGLU -lGLEW -lglut"
AC_SUBST([OPENGL_LDFLAGS])
# Export temporary LDFLAGS
saved_libs="$LIBS"
LIBS="$OPENGL_LDFLAGS"
# Try link
AC_MSG_CHECKING([for $OPENGL_LDFLAGS])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[
#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>
]],
[[
glutInit(NULL, NULL);
glBegin(0);
gluOrtho2D(0.0, 0.0, 0.0, 0.0);
]]
)
],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
have_opengl=no
]
)
# Restore original LIBS
LIBS="$saved_libs"
# Message if not present
if test "x$have_opengl" = "xno"
then
AC_MSG_WARN([
Your system lacks at least one of the graphics libraries required to
compile some features of Multi2Sim. These libraries are OpenGL, GLU,
GLUT, and GLEW. Please make sure that your linker supports flags
$OPENGL_LDFLAGS
In Ubuntu, the following command is suggested to install the missing
libraries:
sudo apt-get install freeglut3-dev libglew-dev]
)
fi
fi
# Define macro for Automake and gcc
AM_CONDITIONAL(HAVE_OPENGL, test x$have_opengl == xyes -a x$enable_opengl == xyes)
if test x$have_opengl = xyes -a x$enable_opengl = xyes
then
AC_DEFINE(HAVE_OPENGL, [1])
fi
#####################
# Test Flex and Bison
#####################
# Message
have_flex=no
have_bison=no
# Check Flex
AC_PROG_LEX
if test "x$LEX" = xflex
then
have_flex=yes
fi
# Check Bison
AC_PROG_YACC
if test "x$YACC" != xyacc
then
have_bison=yes
fi
# Check if the user explicitly disabled Flex/Bison
AC_ARG_ENABLE(flex-bison,
[ --enable-flex-bison={yes|no} Enable support for Flex/Bison (default=yes)],
[ ], [ enable_flex_bison=yes ])
if test x$enable_flex_bison = xno
then
have_flex=no
have_bison=no
fi
# Define macro for Automake and gcc
AM_CONDITIONAL(HAVE_FLEX_BISON, test x$have_flex = xyes -a x$have_bison = xyes)
if test x$have_flex = xyes -a x$have_bison = xyes
then
AC_DEFINE(HAVE_FLEX_BISON, [1])
elif test x$enable_flex_bison = xno
then
AC_MSG_WARN([
Support for tools 'flex' and 'bison' has been explicitly disabled with
an argument in the ./configure script. Modules in the simulator
dependent on these tools will not be built.]
)
else
AC_MSG_WARN([
Tools 'flex' and/or 'bison' are missing in your system. Some modules in
Multi2Sim will not be built. In an Ubuntu distribution, you can install
these packages by running command
sudo apt-get install flex bison]
)
fi
###########
# Test LLVM
###########
have_llvm=yes
# Command-line option to force LLVM absence
AC_ARG_ENABLE(llvm,
[ --enable-llvm={yes|no} Enable support for LLVM (default=yes)],
[], [ enable_llvm=yes ])
if test x$enable_llvm = xno
then
have_llvm=no
fi
# Check for 'llvm-config' command
LLVM_CONFIG="llvm-config-3.1"
if test x$have_llvm = xyes
then
which $LLVM_CONFIG > /dev/null || \
have_llvm=no
fi
# Check for 'g++'
have_cxx=yes
which $CXX > /dev/null || have_cxx=no
if test x$have_cxx = xno
then
have_llvm=no
fi
AM_CONDITIONAL(HAVE_CXX, test x$have_cxx = xyes)
# Try to compile a program using LLVM
if test x$have_llvm = xyes
then
# Use temporary CXXFLAGS, LDFLAGS
saved_cxxflags="$CXXFLAGS"
saved_ldflags="$LDFLAGS"
saved_libs="$LIBS"
CXXFLAGS="`$LLVM_CONFIG --cflags`"
LDFLAGS=""
LIBS="`$LLVM_CONFIG --libs` `$LLVM_CONFIG --ldflags`"
# Try program
AC_LANG_PUSH([C++])
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[[
#include <llvm-c/Core.h>
#include <llvm-c/Analysis.h>
#include <llvm-c/ExecutionEngine.h>
#include <llvm-c/Target.h>
#include <llvm-c/Transforms/Scalar.h>
]],
[[
LLVMLinkInJIT();
LLVMInitializeNativeTarget();
LLVMBuilderRef builder = LLVMCreateBuilder();
LLVMModuleRef mod = LLVMModuleCreateWithName("hello_module");
LLVMTypeRef func_str_count_args[] = { LLVMPointerType(LLVMInt8Type(), 0) };
LLVMValueRef func_str_count = LLVMAddFunction(mod, "str_count",
LLVMFunctionType(LLVMInt32Type(), func_str_count_args, 1, 0));
LLVMSetFunctionCallConv(func_str_count, LLVMCCallConv);
/* Half type added in LLVM 3.1 */
LLVMHalfType();
]]
)
],
[],
[
have_llvm=no
])
AC_LANG_POP([C++])
# Restore original CXXFLAGS, LDFLAGS, LIBS
CXXFLAGS="$saved_cxxflags"
LDFLAGS="$saved_ldflags"
LIBS="$saved_libs"
fi
# Define macro for Automake and gcc
AM_CONDITIONAL(HAVE_LLVM, test x$have_llvm = xyes)
AM_CONDITIONAL(HAVE_FLEX_BISON_AND_LLVM, test x$have_flex = xyes -a x$have_bison = xyes -a x$have_llvm = xyes)
if test x$have_llvm = xyes
then
AC_DEFINE(HAVE_LLVM, [1])
# Use the LLVM flags suggested by 'llvm-config', but don't let them
# interfere with our own flags. Get rid of their -O2, -NDEBUG, and -g.
# We will decide if we want those with our --enable-debug.
LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed "s/\(\-DNDEBUG\>\)\|\(\-g\>\)\|\(\-O2\>\)//g"`
LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags`
LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
LLVM_LIBS=`$LLVM_CONFIG --libs`
AC_SUBST([LLVM_CFLAGS])
AC_SUBST([LLVM_CXXFLAGS])
AC_SUBST([LLVM_LDFLAGS])
AC_SUBST([LLVM_LIBS])
elif test x$enable_llvm = xno
then
AC_MSG_WARN([
Support for LLVM has been explicitly disabled with an argument in the
./configure script. Modules in the simulator dependent on these tools
will not be built.]
)
elif test x$have_cxx = xno
then
AC_MSG_WARN([
The C++ compiler g++ is not installed in your system. This compiler is
needed to build LLVM-based modules on Multi2Sim. Please install g++, and
recompile. In an Ubuntu distribution, you can run
sudo apt-get install g++]
)
else
AC_MSG_WARN([
LLVM support is missing in your system, or you have an older version of
this library. Some modules in Multi2Sim will not be built. In an Ubuntu
distribution, you can install these package by running command
sudo apt-get install llvm-3.1]
)
fi
##########
# Test GTK
##########
have_gtk=no
have_gtk_test=yes
# Check if the user explicitly disabled GTK
AC_ARG_ENABLE(gtk,
[ --enable-gtk={yes|no} Enable support for GTK (default=yes)],
[], [ enable_gtk=yes ])
# Check if test for GTK is available
ifdef([AM_PATH_GTK_3_0], [AM_PATH_GTK_3_0([3.0.0], have_gtk=yes, )], [have_gtk_test=no] )
if test x$have_gtk_test = xno
then
AC_MSG_WARN([
The 'autoconf' tool could not interpret the macro checking for the
presence of the GTK development library (libgtk-3-dev) in your system.
Multi2Sim will be permanently compiled without support for GTK.
Before releasing a version with this configuration (running 'make dist'),
please install this package and rerun 'autoconf'. This will guarantee
that the conditional inclusion of GTK will depend on the user configuration.]
)
fi
# Check if GTK is available
if test x$have_gtk = xno
then
AC_MSG_WARN([
Multi2Sim will be compiled without support for GTK graphical applications.
Some features are disabled under this configuration, such as the GPU pipeline
debugger. To enable it, please install the development packages for GTK on
your system (e.g., package 'libgtk-3-dev' in Debian-based distributions),
and run './configure' again.]
)
fi
# Check if GTK is enabled
if test x$enable_gtk = xno
then
AC_MSG_WARN([
GTK is present in your system, but you have explicitly disabled support
for it. The GTK-based subset of Multi2Sim will not be available in the
generated executable.]
)
fi
# Define macro for Automake and gcc
AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes -a x$enable_gtk = xyes)
if test x$have_gtk = xyes -a x$enable_gtk = xyes
then
AC_DEFINE(HAVE_GTK, [1])
fi
#
# Data directory
#
DATADIR=`eval echo $datadir`
AC_SUBST([DATADIR])
PKGDATADIR="$datadir/multi2sim"
AC_SUBST([PKGDATADIR])
###################
# Debug and profile
###################
debug=false
#CFLAGS="-msse2 -O3 -std=gnu99 -DNDEBUG"
CFLAGS="-msse2 -Wall -O3 -std=gnu99 -D_FILE_OFFSET_BITS=64"
CXXFLAGS="-msse2 -Wall -O3"
AC_ARG_ENABLE(debug,
[ --enable-debug Turn on debugging],
[
case "${enableval}" in
yes)
debug=true
# Add flag '-Wno-error=deprecated-declarations' only if it is supported.
# This flag prevents warnings caused by newer GTK versions that would cause with -Werror
saved_flags="-msse2 -Wall -Werror -DMHANDLE -D_FILE_OFFSET_BITS=64 -g3 -ggdb -O0 -std=gnu99"
CFLAGS="-Wno-error=deprecated-declarations"
AC_MSG_CHECKING([whether CC supports -Wno-error=deprecated-declarations])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
[ AC_MSG_RESULT([yes]) ]
[ saved_flags="$saved_flags -Wno-error=deprecated-declarations" ],
[ AC_MSG_RESULT([no]) ]
)
CFLAGS="$saved_flags"
CXXFLAGS="-msse2 -Wall -Werror -g -O0"
;;
no)
;;
*)
AC_MSG_ERROR(bad value ${enableval} for --enable-debug)
;;
esac
],
[])
AC_ARG_ENABLE(profile,
[ --enable-profile Turn on profiling],
[
case "${enableval}" in
yes)
CFLAGS+=" -pg"
;;
no)
;;
*)
AC_MSG_ERROR(bad value ${enableval} for --enable-profile)
;;
esac
],
[])
AC_ARG_ENABLE(no-strict-aliasing,
[ --enable-no-strict-aliasing Allow for no strict aliasing],
[
case "${enableval}" in
yes)
CFLAGS+=" -fno-strict-aliasing"
;;
no)
;;
*)
AC_MSG_ERROR(bad value ${enableval} for --enable-no-strict-aliasing)
;;
esac
],
[])
AC_ARG_ENABLE(static,
[ --enable-static Turn on static build],
[
case "${enableval}" in
yes)
CFLAGS+=" -static"
LDFLAGS+=" -all-static"
CXXFLAGS+=" -static"
;;
no)
;;
*)
AC_MSG_ERROR(bad value ${enableval} for --enable-static)
;;
esac
],
[])
AC_SUBST([CFLAGS])
##########
# Includes
##########
M2S_INCLUDES=" \
\
-I\$(top_srcdir) \
-I\$(top_srcdir)/src \
\
"
AC_SUBST(M2S_INCLUDES)
###########
# Makefiles
###########
AC_CONFIG_FILES([
Makefile
runtime/Makefile
runtime/cuda/Makefile
runtime/glew/Makefile
runtime/glu/Makefile
runtime/glut/Makefile
runtime/opencl/Makefile
runtime/opencl-old/Makefile
runtime/opengl/Makefile
runtime/include/Makefile
src/Makefile
src/arch/Makefile
src/driver/Makefile
src/lib/Makefile
src/mem-system/Makefile
src/network/Makefile
src/dram/Makefile
src/dramsim/Makefile
src/visual/Makefile
src/visual/common/Makefile
src/visual/evergreen/Makefile
src/visual/memory/Makefile
src/visual/southern-islands/Makefile
src/visual/x86/Makefile
src/arch/common/Makefile
src/arch/arm/Makefile
src/arch/arm/asm/Makefile
src/arch/arm/emu/Makefile
src/arch/arm/timing/Makefile
src/arch/evergreen/Makefile
src/arch/evergreen/asm/Makefile
src/arch/evergreen/emu/Makefile
src/arch/evergreen/timing/Makefile
src/arch/fermi/Makefile
src/arch/fermi/asm/Makefile
src/arch/fermi/emu/Makefile
src/arch/fermi/timing/Makefile
src/arch/kepler/Makefile
src/arch/kepler/asm/Makefile
src/arch/mips/Makefile
src/arch/mips/asm/Makefile
src/arch/mips/emu/Makefile
src/arch/mips/timing/Makefile
src/arch/southern-islands/Makefile
src/arch/southern-islands/asm/Makefile
src/arch/southern-islands/emu/Makefile
src/arch/southern-islands/timing/Makefile
src/arch/x86/Makefile
src/arch/x86/asm/Makefile
src/arch/x86/emu/Makefile
src/arch/x86/timing/Makefile
src/driver/cuda/Makefile
src/driver/glu/Makefile
src/driver/glut/Makefile
src/driver/glew/Makefile
src/driver/opencl/Makefile
src/driver/opencl-old/Makefile
src/driver/opencl-old/evergreen/Makefile
src/driver/opengl/Makefile
src/lib/esim/Makefile
src/lib/mhandle/Makefile
src/lib/util/Makefile
m2c/Makefile
m2c/amd/Makefile
m2c/cl2llvm/Makefile
m2c/frm2bin/Makefile
m2c/gl/Makefile
m2c/llvm2si/Makefile
m2c/si2bin/Makefile
])
AC_OUTPUT
AC_CONFIG_MACRO_DIR([m4])