forked from llvm-mirror/llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
2234 lines (2026 loc) · 82.8 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
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl === configure.ac --------------------------------------------------------===
dnl The LLVM Compiler Infrastructure
dnl
dnl This file is distributed under the University of Illinois Open Source
dnl License. See LICENSE.TXT for details.
dnl
dnl===-----------------------------------------------------------------------===
dnl This is the LLVM configuration script. It is processed by the autoconf
dnl program to produce a script named configure. This script contains the
dnl configuration checks that LLVM needs in order to support multiple platforms.
dnl This file is composed of 10 sections per the recommended organization of
dnl autoconf input defined in the autoconf documentation. As this file evolves,
dnl please keep the various types of checks within their sections. The sections
dnl are as follows:
dnl
dnl SECTION 1: Initialization & Setup
dnl SECTION 2: Architecture, target, and host checks
dnl SECTION 3: Command line arguments for the configure script.
dnl SECTION 4: Check for programs we need and that they are the right version
dnl SECTION 5: Check for libraries
dnl SECTION 6: Check for header files
dnl SECTION 7: Check for types and structures
dnl SECTION 8: Check for specific functions needed
dnl SECTION 9: Additional checks, variables, etc.
dnl SECTION 10: Specify the output files and generate it
dnl
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 1: Initialization & Setup
dnl===
dnl===-----------------------------------------------------------------------===
dnl Initialize autoconf and define the package name, version number and
dnl address for reporting bugs.
AC_INIT([LLVM],[3.7.0svn],[http://llvm.org/bugs/])
LLVM_VERSION_MAJOR=3
LLVM_VERSION_MINOR=7
LLVM_VERSION_PATCH=0
LLVM_VERSION_SUFFIX=svn
AC_DEFINE_UNQUOTED([LLVM_VERSION_MAJOR], $LLVM_VERSION_MAJOR, [Major version of the LLVM API])
AC_DEFINE_UNQUOTED([LLVM_VERSION_MINOR], $LLVM_VERSION_MINOR, [Minor version of the LLVM API])
AC_DEFINE_UNQUOTED([LLVM_VERSION_PATCH], $LLVM_VERSION_PATCH, [Patch version of the LLVM API])
AC_DEFINE_UNQUOTED([LLVM_VERSION_STRING], "$PACKAGE_VERSION", [LLVM version string])
AC_SUBST([LLVM_VERSION_MAJOR])
AC_SUBST([LLVM_VERSION_MINOR])
AC_SUBST([LLVM_VERSION_PATCH])
AC_SUBST([LLVM_VERSION_SUFFIX])
dnl Provide a copyright substitution and ensure the copyright notice is included
dnl in the output of --version option of the generated configure script.
AC_SUBST(LLVM_COPYRIGHT,["Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign."])
AC_COPYRIGHT([Copyright (c) 2003-2015 University of Illinois at Urbana-Champaign.])
dnl Indicate that we require autoconf 2.60 or later.
AC_PREREQ(2.60)
dnl Verify that the source directory is valid. This makes sure that we are
dnl configuring LLVM and not some other package (it validates --srcdir argument)
AC_CONFIG_SRCDIR([lib/IR/Module.cpp])
dnl Place all of the extra autoconf files into the config subdirectory. Tell
dnl various tools where the m4 autoconf macros are.
AC_CONFIG_AUX_DIR([autoconf])
dnl Quit if the source directory has already been configured.
dnl NOTE: This relies upon undocumented autoconf behavior.
if test ${srcdir} != "." ; then
if test -f ${srcdir}/include/llvm/Config/config.h ; then
AC_MSG_ERROR([Already configured in ${srcdir}])
fi
fi
dnl Quit if it is an in-source build
if test ${srcdir} == "." ; then
AC_MSG_WARN([**************************************************************************************])
AC_MSG_WARN([* *])
AC_MSG_WARN([* WARNING *])
AC_MSG_WARN([* *])
AC_MSG_WARN([* In-source builds are deprecated. *])
AC_MSG_WARN([* *])
AC_MSG_WARN([* Please configure from a separate build directory! *])
AC_MSG_WARN([* *])
AC_MSG_WARN([**************************************************************************************])
fi
dnl Default to empty (i.e. assigning the null string to) CFLAGS and CXXFLAGS,
dnl instead of the autoconf default (for example, '-g -O2' for CC=gcc).
: ${CFLAGS=}
: ${CXXFLAGS=}
dnl We need to check for the compiler up here to avoid anything else
dnl starting with a different one.
AC_PROG_CC(clang gcc)
AC_PROG_CXX(clang++ g++)
AC_PROG_CPP
dnl If CXX is Clang, check that it can find and parse C++ standard library
dnl headers.
if test "$CXX" = "clang++" ; then
AC_MSG_CHECKING([whether clang works])
AC_LANG_PUSH([C++])
dnl Note that space between 'include' and '(' is required. There's a broken
dnl regex in aclocal that otherwise will think that we call m4's include
dnl builtin.
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <limits>
#if __has_include (<cxxabi.h>)
#include <cxxabi.h>
#endif
#if __has_include (<unwind.h>)
#include <unwind.h>
#endif
]])],
[
AC_MSG_RESULT([yes])
],
[
AC_MSG_RESULT([no])
AC_MSG_ERROR([Selected compiler could not find or parse C++ standard library headers. Rerun with CC=c-compiler CXX=c++-compiler LLVM_SRC_DIR/configure ...])
])
AC_LANG_POP([C++])
fi
dnl Set up variables that track whether the host compiler is GCC or Clang where
dnl we can effectively sanity check them. We don't try to sanity check all the
dnl other possible compilers.
AC_MSG_CHECKING([whether GCC or Clang is our host compiler])
AC_LANG_PUSH([C++])
llvm_cv_cxx_compiler=unknown
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#if ! __clang__
#error
#endif
]])],
llvm_cv_cxx_compiler=clang,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#if ! __GNUC__
#error
#endif
]])],
llvm_cv_cxx_compiler=gcc, [])])
AC_LANG_POP([C++])
AC_MSG_RESULT([${llvm_cv_cxx_compiler}])
dnl Configure all of the projects present in our source tree. While we could
dnl just AC_CONFIG_SUBDIRS on the set of directories in projects that have a
dnl configure script, that usage of the AC_CONFIG_SUBDIRS macro is deprecated.
dnl Instead we match on the known projects.
dnl
dnl One tricky part of doing this is that some projects depend upon other
dnl projects. For example, several projects rely upon the LLVM test suite.
dnl We want to configure those projects first so that their object trees are
dnl created before running the configure scripts of projects that depend upon
dnl them.
dnl
dnl Several projects use the LLVM test suite, so configure it next.
if test -d ${srcdir}/projects/test-suite ; then
AC_CONFIG_SUBDIRS([projects/test-suite])
fi
dnl llvm-test is the old name of the test-suite, kept here for backwards
dnl compatibility
if test -d ${srcdir}/projects/llvm-test ; then
AC_CONFIG_SUBDIRS([projects/llvm-test])
fi
dnl Some projects use poolalloc; configure that next
if test -d ${srcdir}/projects/poolalloc ; then
AC_CONFIG_SUBDIRS([projects/poolalloc])
fi
if test -d ${srcdir}/projects/llvm-poolalloc ; then
AC_CONFIG_SUBDIRS([projects/llvm-poolalloc])
fi
dnl Check for all other projects
for i in `ls ${srcdir}/projects`
do
if test -d ${srcdir}/projects/${i} ; then
case ${i} in
safecode) AC_CONFIG_SUBDIRS([projects/safecode]) ;;
compiler-rt) ;;
test-suite) ;;
llvm-test) ;;
poolalloc) ;;
llvm-poolalloc) ;;
*)
AC_MSG_WARN([Unknown project (${i}) won't be configured automatically])
;;
esac
fi
done
dnl Disable the build of polly, even if it is checked out into tools/polly.
AC_ARG_ENABLE(polly,
AS_HELP_STRING([--enable-polly],
[Use polly if available (default is YES)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_POLLY,[1]) ;;
no) AC_SUBST(ENABLE_POLLY,[0]) ;;
default) AC_SUBST(ENABLE_POLLY,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-polly. Use "yes" or "no"]) ;;
esac
dnl Check if polly is checked out into tools/polly and configure it if
dnl available.
if (test -d ${srcdir}/tools/polly) && (test $ENABLE_POLLY -eq 1) ; then
AC_SUBST(LLVM_HAS_POLLY,1)
AC_CONFIG_SUBDIRS([tools/polly])
fi
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 2: Architecture, target, and host checks
dnl===
dnl===-----------------------------------------------------------------------===
dnl Check the target for which we're compiling and the host that will do the
dnl compilations. This will tell us which LLVM compiler will be used for
dnl compiling SSA into object code. This needs to be done early because
dnl following tests depend on it.
AC_CANONICAL_TARGET
dnl Determine the platform type and cache its value. This helps us configure
dnl the System library to the correct build platform.
AC_CACHE_CHECK([type of operating system we're going to host on],
[llvm_cv_os_type],
[case $host in
*-*-aix*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="AIX"
llvm_cv_platform_type="Unix" ;;
*-*-irix*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="IRIX"
llvm_cv_platform_type="Unix" ;;
*-*-cygwin*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Cygwin"
llvm_cv_platform_type="Unix" ;;
*-*-darwin*)
llvm_cv_link_all_option="-Wl,-all_load"
llvm_cv_no_link_all_option="-Wl,-noall_load"
llvm_cv_os_type="Darwin"
llvm_cv_platform_type="Unix" ;;
*-*-minix*)
llvm_cv_link_all_option="-Wl,-all_load"
llvm_cv_no_link_all_option="-Wl,-noall_load"
llvm_cv_os_type="Minix"
llvm_cv_platform_type="Unix" ;;
*-*-freebsd*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="FreeBSD"
llvm_cv_platform_type="Unix" ;;
*-*-kfreebsd-gnu)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="GNU/kFreeBSD"
llvm_cv_platform_type="Unix" ;;
*-*-openbsd*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="OpenBSD"
llvm_cv_platform_type="Unix" ;;
*-*-netbsd*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="NetBSD"
llvm_cv_platform_type="Unix" ;;
*-*-dragonfly*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="DragonFly"
llvm_cv_platform_type="Unix" ;;
*-*-bitrig*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Bitrig"
llvm_cv_platform_type="Unix" ;;
*-*-hpux*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="HP-UX"
llvm_cv_platform_type="Unix" ;;
*-*-interix*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Interix"
llvm_cv_platform_type="Unix" ;;
*-*-linux*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Linux"
llvm_cv_platform_type="Unix" ;;
*-*-gnu*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="GNU"
llvm_cv_platform_type="Unix" ;;
*-*-solaris*)
llvm_cv_link_all_option="-Wl,-z,allextract"
llvm_cv_no_link_all_option="-Wl,-z,defaultextract"
llvm_cv_os_type="SunOS"
llvm_cv_platform_type="Unix" ;;
*-*-win32*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Win32"
llvm_cv_platform_type="Win32" ;;
*-*-mingw*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="MingW"
llvm_cv_platform_type="Win32" ;;
*-*-haiku*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Haiku"
llvm_cv_platform_type="Unix" ;;
*-unknown-eabi*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Freestanding"
llvm_cv_platform_type="Unix" ;;
*-unknown-elf*)
llvm_cv_link_all_option="-Wl,--whole-archive"
llvm_cv_no_link_all_option="-Wl,--no-whole-archive"
llvm_cv_os_type="Freestanding"
llvm_cv_platform_type="Unix" ;;
*)
llvm_cv_link_all_option=""
llvm_cv_no_link_all_option=""
llvm_cv_os_type="Unknown"
llvm_cv_platform_type="Unknown" ;;
esac])
AC_CACHE_CHECK([type of operating system we're going to target],
[llvm_cv_target_os_type],
[case $target in
*-*-aix*)
llvm_cv_target_os_type="AIX" ;;
*-*-irix*)
llvm_cv_target_os_type="IRIX" ;;
*-*-cygwin*)
llvm_cv_target_os_type="Cygwin" ;;
*-*-darwin*)
llvm_cv_target_os_type="Darwin" ;;
*-*-minix*)
llvm_cv_target_os_type="Minix" ;;
*-*-freebsd*)
llvm_cv_target_os_type="FreeBSD" ;;
*-*-kfreebsd-gnu)
llvm_cv_target_os_type="GNU/kFreeBSD" ;;
*-*-openbsd*)
llvm_cv_target_os_type="OpenBSD" ;;
*-*-netbsd*)
llvm_cv_target_os_type="NetBSD" ;;
*-*-dragonfly*)
llvm_cv_target_os_type="DragonFly" ;;
*-*-bitrig*)
llvm_cv_target_os_type="Bitrig" ;;
*-*-hpux*)
llvm_cv_target_os_type="HP-UX" ;;
*-*-interix*)
llvm_cv_target_os_type="Interix" ;;
*-*-linux*)
llvm_cv_target_os_type="Linux" ;;
*-*-gnu*)
llvm_cv_target_os_type="GNU" ;;
*-*-solaris*)
llvm_cv_target_os_type="SunOS" ;;
*-*-win32*)
llvm_cv_target_os_type="Win32" ;;
*-*-mingw*)
llvm_cv_target_os_type="MingW" ;;
*-*-haiku*)
llvm_cv_target_os_type="Haiku" ;;
*-*-rtems*)
llvm_cv_target_os_type="RTEMS" ;;
*-*-nacl*)
llvm_cv_target_os_type="NativeClient" ;;
*-unknown-eabi*)
llvm_cv_target_os_type="Freestanding" ;;
*-*-ps4)
llvm_cv_target_os_type="PS4" ;;
*)
llvm_cv_target_os_type="Unknown" ;;
esac])
dnl Make sure we aren't attempting to configure for an unknown system
if test "$llvm_cv_os_type" = "Unknown" ; then
AC_MSG_ERROR([Operating system is unknown, configure can't continue])
fi
dnl Set the "OS" Makefile variable based on the platform type so the
dnl makefile can configure itself to specific build hosts
AC_SUBST(OS,$llvm_cv_os_type)
AC_SUBST(HOST_OS,$llvm_cv_os_type)
AC_SUBST(TARGET_OS,$llvm_cv_target_os_type)
dnl Set the LINKALL and NOLINKALL Makefile variables based on the platform
AC_SUBST(LINKALL,$llvm_cv_link_all_option)
AC_SUBST(NOLINKALL,$llvm_cv_no_link_all_option)
dnl Set the "LLVM_ON_*" variables based on llvm_cv_platform_type
dnl This is used by lib/Support to determine the basic kind of implementation
dnl to use.
case $llvm_cv_platform_type in
Unix)
AC_DEFINE([LLVM_ON_UNIX],[1],[Define if this is Unixish platform])
AC_SUBST(LLVM_ON_UNIX,[1])
AC_SUBST(LLVM_ON_WIN32,[0])
;;
Win32)
AC_DEFINE([LLVM_ON_WIN32],[1],[Define if this is Win32ish platform])
AC_SUBST(LLVM_ON_UNIX,[0])
AC_SUBST(LLVM_ON_WIN32,[1])
;;
esac
dnl Determine what our target architecture is and configure accordingly.
dnl This will allow Makefiles to make a distinction between the hardware and
dnl the OS.
AC_CACHE_CHECK([target architecture],[llvm_cv_target_arch],
[case $target in
i?86-*) llvm_cv_target_arch="x86" ;;
amd64-* | x86_64-*) llvm_cv_target_arch="x86_64" ;;
sparc*-*) llvm_cv_target_arch="Sparc" ;;
powerpc*-*) llvm_cv_target_arch="PowerPC" ;;
arm64*-*) llvm_cv_target_arch="AArch64" ;;
arm*-*) llvm_cv_target_arch="ARM" ;;
aarch64*-*) llvm_cv_target_arch="AArch64" ;;
mips-* | mips64-*) llvm_cv_target_arch="Mips" ;;
mipsel-* | mips64el-*) llvm_cv_target_arch="Mips" ;;
xcore-*) llvm_cv_target_arch="XCore" ;;
msp430-*) llvm_cv_target_arch="MSP430" ;;
hexagon-*) llvm_cv_target_arch="Hexagon" ;;
nvptx-*) llvm_cv_target_arch="NVPTX" ;;
s390x-*) llvm_cv_target_arch="SystemZ" ;;
*) llvm_cv_target_arch="Unknown" ;;
esac])
if test "$llvm_cv_target_arch" = "Unknown" ; then
AC_MSG_WARN([Configuring LLVM for an unknown target archicture])
fi
dnl Determine the LLVM native architecture for the target
case "$llvm_cv_target_arch" in
x86) LLVM_NATIVE_ARCH="X86" ;;
x86_64) LLVM_NATIVE_ARCH="X86" ;;
*) LLVM_NATIVE_ARCH="$llvm_cv_target_arch" ;;
esac
dnl Define a substitution, ARCH, for the target architecture
AC_SUBST(ARCH,$llvm_cv_target_arch)
AC_SUBST(LLVM_NATIVE_ARCH,$LLVM_NATIVE_ARCH)
dnl Determine what our host architecture.
dnl This will allow MCJIT regress tests runs only for supported
dnl platforms.
case $host in
i?86-*) host_arch="x86" ;;
amd64-* | x86_64-*) host_arch="x86_64" ;;
sparc*-*) host_arch="Sparc" ;;
powerpc*-*) host_arch="PowerPC" ;;
arm64*-*) host_arch="AArch64" ;;
arm*-*) host_arch="ARM" ;;
aarch64*-*) host_arch="AArch64" ;;
mips-* | mips64-*) host_arch="Mips" ;;
mipsel-* | mips64el-*) host_arch="Mips" ;;
xcore-*) host_arch="XCore" ;;
msp430-*) host_arch="MSP430" ;;
hexagon-*) host_arch="Hexagon" ;;
s390x-*) host_arch="SystemZ" ;;
*) host_arch="Unknown" ;;
esac
if test "$host_arch" = "Unknown" ; then
AC_MSG_WARN([Configuring LLVM for an unknown host archicture])
fi
AC_SUBST(HOST_ARCH,$host_arch)
dnl Check for build platform executable suffix if we're cross-compiling
if test "$cross_compiling" = yes; then
AC_SUBST(LLVM_CROSS_COMPILING, [1])
AC_BUILD_EXEEXT
ac_build_prefix=${build_alias}-
AC_CHECK_PROG(BUILD_CXX, ${ac_build_prefix}g++, ${ac_build_prefix}g++)
if test -z "$BUILD_CXX"; then
AC_CHECK_PROG(BUILD_CXX, g++, g++)
if test -z "$BUILD_CXX"; then
AC_CHECK_PROG(BUILD_CXX, c++, c++, , , /usr/ucb/c++)
fi
fi
else
AC_SUBST(LLVM_CROSS_COMPILING, [0])
fi
dnl Check to see if there's a .svn or .git directory indicating that this
dnl build is being done from a checkout. This sets up several defaults for
dnl the command line switches. When we build with a checkout directory,
dnl we get a debug with assertions turned on. Without, we assume a source
dnl release and we get an optimized build without assertions.
dnl See --enable-optimized and --enable-assertions below
if test -d ".svn" -o -d "${srcdir}/.svn" -o -d ".git" -o -d "${srcdir}/.git"; then
cvsbuild="yes"
optimize="no"
AC_SUBST(CVSBUILD,[[CVSBUILD=1]])
else
cvsbuild="no"
optimize="yes"
fi
dnl===-----------------------------------------------------------------------===
dnl===
dnl=== SECTION 3: Command line arguments for the configure script.
dnl===
dnl===-----------------------------------------------------------------------===
dnl --enable-libcpp : check whether or not to use libc++ on the command line
AC_ARG_ENABLE(libcpp,
AS_HELP_STRING([--enable-libcpp],
[Use libc++ if available (default is NO)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_LIBCPP,[1]) ;;
no) AC_SUBST(ENABLE_LIBCPP,[0]) ;;
default) AC_SUBST(ENABLE_LIBCPP,[0]);;
*) AC_MSG_ERROR([Invalid setting for --enable-libcpp. Use "yes" or "no"]) ;;
esac
dnl Check both GCC and Clang for sufficiently modern versions. These checks can
dnl be bypassed by passing a flag if necessary on a platform. We have to do
dnl these checks here so that we have the configuration of the standard C++
dnl library finished.
AC_ARG_ENABLE(compiler-version-checks,
AS_HELP_STRING([--enable-compiler-version-checks],
[Check the version of the host compiler (default is YES)]),,
enableval=default)
case "$enableval" in
no)
;;
yes|default)
AC_LANG_PUSH([C++])
case "$llvm_cv_cxx_compiler" in
clang)
AC_MSG_CHECKING([whether Clang is new enough])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 1)
#error This version of Clang is too old to build LLVM
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([
The selected Clang compiler is not new enough to build LLVM. Please upgrade to
Clang 3.1. You may pass --disable-compiler-version-checks to configure to
bypass these sanity checks.])])
dnl Note that libstdc++4.6 is known broken for C++11 builds. The errors
dnl are sometimes deeply confusing though. Here we test for an obvious
dnl incomplete feature in 4.6's standard library that was completed in
dnl 4.7's. We also have to disable this test if 'ENABLE_LIBCPP' is set
dnl because the enable flags don't actually fix CXXFLAGS, they rely on
dnl that happening in the Makefile.
if test "$ENABLE_LIBCPP" -eq 0 ; then
AC_MSG_CHECKING([whether Clang will select a modern C++ standard library])
llvm_cv_old_cxxflags="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <atomic>
std::atomic<float> x(0.0f);
int main() { return (float)x; }
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([
We detected a missing feature in the standard C++ library that was known to be
missing in libstdc++4.6 and implemented in libstdc++4.7. There are numerous
C++11 problems with 4.6's library, and we don't support GCCs or libstdc++ older
than 4.7. You will need to update your system and ensure Clang uses the newer
standard library.
If this error is incorrect or you need to force things to work, you may pass
'--disable-compiler-version-checks' to configure to bypass this test.])])
CXXFLAGS="$llvm_cv_old_cxxflags"
fi
;;
gcc)
AC_MSG_CHECKING([whether GCC is new enough])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
#error This version of GCC is too old to build LLVM
#endif
]])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_ERROR([
The selected GCC C++ compiler is not new enough to build LLVM. Please upgrade
to GCC 4.7. You may pass --disable-compiler-version-checks to configure to
bypass these sanity checks.])])
;;
unknown)
;;
esac
AC_LANG_POP([C++])
;;
*)
AC_MSG_ERROR([Invalid setting for --enable-compiler-version-checks. Use "yes" or "no"])
;;
esac
dnl --enable-cxx1y : check whether or not to use -std=c++1y on the command line
AC_ARG_ENABLE(cxx1y,
AS_HELP_STRING([--enable-cxx1y],
[Use c++1y if available (default is NO)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_CXX1Y,[1]) ;;
no) AC_SUBST(ENABLE_CXX1Y,[0]) ;;
default) AC_SUBST(ENABLE_CXX1Y,[0]);;
*) AC_MSG_ERROR([Invalid setting for --enable-cxx1y. Use "yes" or "no"]) ;;
esac
dnl --enable-split-dwarf : check whether or not to use -gsplit-dwarf on the command
dnl line
AC_ARG_ENABLE(split-dwarf,
AS_HELP_STRING([--enable-split-dwarf],
[Use split-dwarf if available (default is NO)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_SPLIT_DWARF,[1]) ;;
no) AC_SUBST(ENABLE_SPLIT_DWARF,[0]) ;;
default) AC_SUBST(ENABLE_SPLIT_DWARF,[0]);;
*) AC_MSG_ERROR([Invalid setting for --enable-split-dwarf. Use "yes" or "no"]) ;;
esac
dnl --enable-clang-arcmt: check whether to enable clang arcmt
clang_arcmt="yes"
AC_ARG_ENABLE(clang-arcmt,
AS_HELP_STRING([--enable-clang-arcmt],
[Enable building of clang ARCMT (default is YES)]),
clang_arcmt="$enableval",
enableval="yes")
case "$enableval" in
yes) AC_SUBST(ENABLE_CLANG_ARCMT,[1]) ;;
no) AC_SUBST(ENABLE_CLANG_ARCMT,[0]) ;;
default) AC_SUBST(ENABLE_CLANG_ARCMT,[1]);;
*) AC_MSG_ERROR([Invalid setting for --enable-clang-arcmt. Use "yes" or "no"]) ;;
esac
dnl --enable-clang-plugin-support: check whether to enable plugins in clang
clang_plugin_support="yes"
AC_ARG_ENABLE(clang-plugin-support,
AS_HELP_STRING([--enable-clang-plugin-support],
[Enable plugin support in clang (default is YES)]),
clang_plugin_support="$enableval",
enableval="yes")
case "$enableval" in
yes) AC_SUBST(CLANG_PLUGIN_SUPPORT,[1]) ;;
no) AC_SUBST(CLANG_PLUGIN_SUPPORT,[0]) ;;
default) AC_SUBST(CLANG_PLUGIN_SUPPORT,[1]);;
*) AC_MSG_ERROR([Invalid setting for --enable-clang-plugin-support. Use "yes" or "no"]) ;;
esac
dnl --enable-clang-static-analyzer: check whether to enable static-analyzer
clang_static_analyzer="yes"
AC_ARG_ENABLE(clang-static-analyzer,
AS_HELP_STRING([--enable-clang-static-analyzer],
[Enable building of clang Static Analyzer (default is YES)]),
clang_static_analyzer="$enableval",
enableval="yes")
case "$enableval" in
yes) AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[1]) ;;
no)
if test ${clang_arcmt} != "no" ; then
AC_MSG_ERROR([Cannot enable clang ARC Migration Tool while disabling static analyzer.])
fi
AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[0])
;;
default) AC_SUBST(ENABLE_CLANG_STATIC_ANALYZER,[1]);;
*) AC_MSG_ERROR([Invalid setting for --enable-clang-static-analyzer. Use "yes" or "no"]) ;;
esac
dnl --enable-optimized : check whether they want to do an optimized build:
AC_ARG_ENABLE(optimized, AS_HELP_STRING(
--enable-optimized,[Compile with optimizations enabled (default is NO)]),,enableval=$optimize)
if test ${enableval} = "no" ; then
AC_SUBST(ENABLE_OPTIMIZED,[[]])
else
AC_SUBST(ENABLE_OPTIMIZED,[[ENABLE_OPTIMIZED=1]])
fi
dnl --enable-profiling : check whether they want to do a profile build:
AC_ARG_ENABLE(profiling, AS_HELP_STRING(
--enable-profiling,[Compile with profiling enabled (default is NO)]),,enableval="no")
if test ${enableval} = "no" ; then
AC_SUBST(ENABLE_PROFILING,[[]])
else
AC_SUBST(ENABLE_PROFILING,[[ENABLE_PROFILING=1]])
fi
dnl --enable-assertions : check whether they want to turn on assertions or not:
AC_ARG_ENABLE(assertions,AS_HELP_STRING(
--enable-assertions,[Compile with assertion checks enabled (default is YES)]),, enableval="yes")
if test ${enableval} = "yes" ; then
AC_SUBST(DISABLE_ASSERTIONS,[[]])
assertions_enabled="yes"
else
AC_SUBST(DISABLE_ASSERTIONS,[[DISABLE_ASSERTIONS=1]])
assertions_enabled="no"
fi
dnl --enable-werror : check whether we want Werror on by default
AC_ARG_ENABLE(werror,AS_HELP_STRING(
--enable-werror,[Compile with -Werror enabled (default is NO)]),, enableval="no")
case "$enableval" in
yes) AC_SUBST(ENABLE_WERROR,[1]) ;;
no) AC_SUBST(ENABLE_WERROR,[0]) ;;
default) AC_SUBST(ENABLE_WERROR,[0]);;
*) AC_MSG_ERROR([Invalid setting for --enable-werror. Use "yes" or "no"]) ;;
esac
dnl --enable-expensive-checks : check whether they want to turn on expensive debug checks:
AC_ARG_ENABLE(expensive-checks,AS_HELP_STRING(
--enable-expensive-checks,[Compile with expensive debug checks enabled (default is NO)]),, enableval="no")
if test ${enableval} = "yes" ; then
AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[ENABLE_EXPENSIVE_CHECKS=1]])
AC_SUBST(EXPENSIVE_CHECKS,[[yes]])
else
AC_SUBST(ENABLE_EXPENSIVE_CHECKS,[[]])
AC_SUBST(EXPENSIVE_CHECKS,[[no]])
fi
dnl --enable-abi-breaking-checks : decide whether we should compile in asserts and
dnl checks that make the build ABI incompatible with an llvm built without these
dnl checks enabled.
AC_ARG_ENABLE(abi-breaking-checks,AS_HELP_STRING(
--enable-abi-breaking-checks,[Compile with abi-breaking asserts support (default is with-asserts)]),, enableval="with-asserts")
case "$enableval" in
with-asserts) if test ${assertions_enabled} = "yes" ; then
AC_DEFINE([LLVM_ENABLE_ABI_BREAKING_CHECKS],[1],[Define to enable checks that alter the LLVM C++ ABI])
AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[1])
else
AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[0])
fi ;;
yes)
AC_DEFINE([LLVM_ENABLE_ABI_BREAKING_CHECKS],[1],[Define to enable checks that alter the LLVM C++ ABI])
AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[1])
;;
no)
AC_SUBST(ENABLE_ABI_BREAKING_CHECKS,[0])
;;
*) AC_MSG_ERROR([Invalid setting for --enable-abi-breaking-checks. Use "with-asserts", "yes" or "no"])
esac
dnl --enable-debug-runtime : should runtime libraries have debug symbols?
AC_ARG_ENABLE(debug-runtime,
AS_HELP_STRING(--enable-debug-runtime,[Build runtime libs with debug symbols (default is NO)]),,enableval=no)
if test ${enableval} = "no" ; then
AC_SUBST(DEBUG_RUNTIME,[[]])
else
AC_SUBST(DEBUG_RUNTIME,[[DEBUG_RUNTIME=1]])
fi
dnl --enable-debug-symbols : should even optimized compiler libraries
dnl have debug symbols?
AC_ARG_ENABLE(debug-symbols,
AS_HELP_STRING(--enable-debug-symbols,[Build compiler with debug symbols (default is NO if optimization is on and YES if it's off)]),,enableval=no)
if test ${enableval} = "no" ; then
AC_SUBST(DEBUG_SYMBOLS,[[]])
else
AC_SUBST(DEBUG_SYMBOLS,[[DEBUG_SYMBOLS=1]])
fi
dnl --enable-keep-symbols : do not strip installed executables
AC_ARG_ENABLE(keep-symbols,
AS_HELP_STRING(--enable-keep-symbols,[Do not strip installed executables)]),,enableval=no)
if test ${enableval} = "no" ; then
AC_SUBST(KEEP_SYMBOLS,[[]])
else
AC_SUBST(KEEP_SYMBOLS,[[KEEP_SYMBOLS=1]])
fi
dnl --enable-jit: check whether they want to enable the jit
AC_ARG_ENABLE(jit,
AS_HELP_STRING(--enable-jit,
[Enable Just In Time Compiling (default is YES)]),,
enableval=default)
if test ${enableval} = "no"
then
AC_SUBST(JIT,[[]])
else
case "$llvm_cv_target_arch" in
x86) AC_SUBST(TARGET_HAS_JIT,1) ;;
Sparc) AC_SUBST(TARGET_HAS_JIT,0) ;;
PowerPC) AC_SUBST(TARGET_HAS_JIT,1) ;;
x86_64) AC_SUBST(TARGET_HAS_JIT,1) ;;
ARM) AC_SUBST(TARGET_HAS_JIT,1) ;;
Mips) AC_SUBST(TARGET_HAS_JIT,1) ;;
XCore) AC_SUBST(TARGET_HAS_JIT,0) ;;
MSP430) AC_SUBST(TARGET_HAS_JIT,0) ;;
Hexagon) AC_SUBST(TARGET_HAS_JIT,0) ;;
NVPTX) AC_SUBST(TARGET_HAS_JIT,0) ;;
SystemZ) AC_SUBST(TARGET_HAS_JIT,1) ;;
*) AC_SUBST(TARGET_HAS_JIT,0) ;;
esac
fi
TARGETS_WITH_JIT="ARM AArch64 Mips PowerPC SystemZ X86"
AC_SUBST(TARGETS_WITH_JIT,$TARGETS_WITH_JIT)
dnl Allow enablement of building and installing docs
AC_ARG_ENABLE(docs,
AS_HELP_STRING([--enable-docs],
[Build documents (default is YES)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_DOCS,[1]) ;;
no) AC_SUBST(ENABLE_DOCS,[0]) ;;
default) AC_SUBST(ENABLE_DOCS,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-docs. Use "yes" or "no"]) ;;
esac
dnl Allow enablement of doxygen generated documentation
AC_ARG_ENABLE(doxygen,
AS_HELP_STRING([--enable-doxygen],
[Build doxygen documentation (default is NO)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_DOXYGEN,[1]) ;;
no|default) AC_SUBST(ENABLE_DOXYGEN,[0]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-doxygen. Use "yes" or "no"]) ;;
esac
dnl Allow enablement of doxygen search engine
AC_ARG_ENABLE(doxygen-search,
AS_HELP_STRING([--enable-doxygen-search],
[Enable doxygen search support (default is NO)]),,
enableval=default)
ENABLE_DOXYGEN_SEARCH="$enableval"
case "$enableval" in
yes|no|default) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-doxygen-search. Use "yes" or "no"]) ;;
esac
AC_ARG_ENABLE(doxygen-external-search,
AS_HELP_STRING([--enable-doxygen-external-search],
[Enable doxygen exteranl search (default is NO)]),,
enableval=default)
ENABLE_DOXYGEN_EXTERNAL_SEARCH="$enableval"
case "$enableval" in
yes)
dnl To match with the CMake behavior, enable doxygen when
dnl --enable-doxygen-external-search is enabled.
case "$ENABLE_DOXYGEN_SEARCH" in
yes|default) ENABLE_DOXYGEN_SEARCH="yes" ;;
no) AC_MSG_ERROR([The option --enable-doxygen-external-search requires --enable-doxygen-search]) ;;
esac
;;
no|default) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-doxygen-external-search. Use "yes" or "no"]) ;;
esac
AC_ARG_WITH(doxygen-search-engine-url,
AS_HELP_STRING([--with-doxygen-search-engine-url],
[Specify the external search engine for doxygen]),,)
WITH_DOXYGEN_SEARCH_ENGINE_URL="$withval"
AC_ARG_WITH(doxygen-search-mappings,
AS_HELP_STRING([--with-doxygen-search-mappings],
[Specify the extra search mapping for doxygen]),,)
WITH_DOXYGEN_SEARCH_MAPPINGS="$withval"
case "$ENABLE_DOXYGEN_SEARCH" in
yes)
if test "$ENABLE_DOXYGEN" = "0" ; then
AC_MSG_ERROR([The option --enable-doxygen-search requires --enable-doxygen.])
fi
AC_SUBST(enable_searchengine,[YES])
case "$ENABLE_DOXYGEN_EXTERNAL_SEARCH" in
yes)
AC_SUBST(enable_external_search,[YES])
AC_SUBST(enable_server_based_search,[YES])
AC_SUBST(searchengine_url,["$WITH_DOXYGEN_SEARCH_ENGINE_URL"])
AC_SUBST(extra_search_mappings,["$WITH_DOXYGEN_SEARCH_MAPPINGS"])
;;
no|default)
AC_SUBST(enable_external_search,[NO])
AC_SUBST(enable_server_based_search,[NO])
AC_SUBST(searchengine_url,[])
AC_SUBST(extra_search_mappings,[])
;;
esac
;;
no|default)
AC_SUBST(enable_searchengine,[NO])
AC_SUBST(searchengine_url,[])
AC_SUBST(enable_server_based_search,[NO])
AC_SUBST(enable_external_search,[NO])
AC_SUBST(extra_search_mappings,[])
;;
*)
AC_MSG_ERROR([Invalid setting for --enable-doxygen-search. Use "yes" or "no"])
;;
esac
dnl Allow enablement of doxygen generated Qt help files
AC_ARG_ENABLE(doxygen-qt-help,
AS_HELP_STRING([--enable-doxygen-qt-help],
[Build Qt help files (default is NO)]),,
enableval=default)
case "$enableval" in
yes)
if test "$ENABLE_DOXYGEN" = "0" ; then
AC_MSG_ERROR([The option --enable-doxygen-qt-help requires --enable-doxygen.])
fi
AC_PATH_PROG(QHELPGENERATOR, [qhelpgenerator], [qhelpgenerator])
dnl Qt help file for llvm doxygen documentation
AC_SUBST(llvm_doxygen_generate_qhp,[YES])
AC_SUBST(llvm_doxygen_qch_filename,[org.llvm.qch])
AC_SUBST(llvm_doxygen_qhp_namespace,[org.llvm])
AC_SUBST(llvm_doxygen_qhelpgenerator_path,["$QHELPGENERATOR"])
AC_SUBST(llvm_doxygen_qhp_cust_filter_name,["$PACKAGE_STRING"])
AC_SUBST(llvm_doxygen_qhp_cust_filter_attrs,["$PACKAGE_NAME,$PACKAGE_VERSION"])
dnl Qt help file for clang doxygen documentation
AC_SUBST(clang_doxygen_generate_qhp,[YES])
AC_SUBST(clang_doxygen_qch_filename,[org.llvm.clang.qch])
AC_SUBST(clang_doxygen_qhp_namespace,[org.llvm.clang])
AC_SUBST(clang_doxygen_qhelpgenerator_path,["$QHELPGENERATOR"])
AC_SUBST(clang_doxygen_qhp_cust_filter_name,["Clang $PACKAGE_VERSION"])
AC_SUBST(clang_doxygen_qhp_cust_filter_attrs,["Clang,$PACKAGE_VERSION"])
;;
no|default)
AC_SUBST(llvm_doxygen_generate_qhp,[NO])
AC_SUBST(llvm_doxygen_qch_filename,[])
AC_SUBST(llvm_doxygen_qhp_namespace,[])
AC_SUBST(llvm_doxygen_qhelpgenerator_path,[])
AC_SUBST(llvm_doxygen_qhp_cust_filter_name,[])
AC_SUBST(llvm_doxygen_qhp_cust_filter_attrs,[])
AC_SUBST(clang_doxygen_generate_qhp,[NO])
AC_SUBST(clang_doxygen_qch_filename,[])
AC_SUBST(clang_doxygen_qhp_namespace,[])
AC_SUBST(clang_doxygen_qhelpgenerator_path,[])
AC_SUBST(clang_doxygen_qhp_cust_filter_name,["Clang $PACKAGE_VERSION"])
AC_SUBST(clang_doxygen_qhp_cust_filter_attrs,["Clang,$PACKAGE_VERSION"])
;;
*)
AC_MSG_ERROR([Invalid setting for --enable-doxygen-qt-help. Use "yes" or "no"]) ;;
esac
dnl Allow disablement of threads
AC_ARG_ENABLE(threads,
AS_HELP_STRING([--enable-threads],
[Use threads if available (default is YES)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(LLVM_ENABLE_THREADS,[1]) ;;
no) AC_SUBST(LLVM_ENABLE_THREADS,[0]) ;;
default) AC_SUBST(LLVM_ENABLE_THREADS,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-threads. Use "yes" or "no"]) ;;
esac
AC_DEFINE_UNQUOTED([LLVM_ENABLE_THREADS],$LLVM_ENABLE_THREADS,
[Define if threads enabled])
dnl Allow disablement of pthread.h
AC_ARG_ENABLE(pthreads,
AS_HELP_STRING([--enable-pthreads],
[Use pthreads if available (default is YES)]),,
enableval=default)
case "$enableval" in
yes) AC_SUBST(ENABLE_PTHREADS,[1]) ;;
no) AC_SUBST(ENABLE_PTHREADS,[0]) ;;
default) AC_SUBST(ENABLE_PTHREADS,[1]) ;;
*) AC_MSG_ERROR([Invalid setting for --enable-pthreads. Use "yes" or "no"]) ;;
esac
dnl Allow disablement of zlib