forked from erlang/otp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
4851 lines (4313 loc) · 131 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
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 Process this file with autoconf to produce a configure script. -*-m4-*-
dnl %CopyrightBegin%
dnl
dnl Copyright Ericsson AB 1997-2014. All Rights Reserved.
dnl
dnl The contents of this file are subject to the Erlang Public License,
dnl Version 1.1, (the "License"); you may not use this file except in
dnl compliance with the License. You should have received a copy of the
dnl Erlang Public License along with this software. If not, it can be
dnl retrieved online at http://www.erlang.org/.
dnl
dnl Software distributed under the License is distributed on an "AS IS"
dnl basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
dnl the License for the specific language governing rights and limitations
dnl under the License.
dnl
dnl %CopyrightEnd%
dnl The string "FIXME convbreak" means that there is a break of
dnl autoconf convention that should be cleaned up.
AC_INIT(vsn.mk)
AC_PREREQ(2.59)
LM_PRECIOUS_VARS
if test "x$no_recursion" != "xyes" -a "x$OVERRIDE_CONFIG_CACHE" = "x"; then
# We do not want to use a common cache!
cache_file=/dev/null
fi
dnl How to set srcdir absolute is taken from the GNU Emacs distribution
#### Make srcdir absolute, if it isn't already. It's important to
#### avoid running the path through pwd unnecessary, since pwd can
#### give you automounter prefixes, which can go away.
case "${srcdir}" in
/* ) ;;
. )
## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate.
## Make sure CDPATH doesn't affect cd (in case PWD is relative).
CDPATH=
if test "${PWD}" != "" && test "`(cd ${PWD} ; sh -c pwd)`" = "`pwd`" ;
then
srcdir="$PWD"
else
srcdir="`(cd ${srcdir}; pwd)`"
fi
;;
* ) srcdir="`(cd ${srcdir}; pwd)`" ;;
esac
## Now, make sure that ERL_TOP is set and is the same as srcdir
##
if test -z "$ERL_TOP" || test ! -d $ERL_TOP ; then
AC_MSG_ERROR(You need to set the environment variable ERL_TOP!)
fi
if test x"${ERL_TOP}/erts" != x"$srcdir"; then
AC_MSG_ERROR([You need to run configure with argument --srcdir=${ERL_TOP}/erts])
fi
erl_top=${ERL_TOP}
# Remove old configuration information
/bin/rm -f "$ERL_TOP/erts/CONF_INFO"
# echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
# echo X
# echo "X srcdir = $srcdir"
# echo "X ERL_TOP = $ERL_TOP"
# echo X
# echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
AC_CONFIG_AUX_DIRS($srcdir/autoconf)
dnl ----------------------------------------------------------------------
dnl Figure out what system we are running on.
dnl ----------------------------------------------------------------------
#
# To configure for free source run ./configure --host=free_source
#
dnl
dnl AC_CANONICAL_HOST does not like free_source as a host specification,
dnl so we make a little special case.
dnl
if test "X$host" != "Xfree_source" -a "X$host" != "Xwin32"; then
AC_CANONICAL_HOST
else
host_os=$host
fi
if test "$cross_compiling" = "yes"; then
CROSS_COMPILING=yes
else
CROSS_COMPILING=no
fi
AC_SUBST(CROSS_COMPILING)
ERL_XCOMP_SYSROOT_INIT
AC_ISC_POSIX
AC_CONFIG_HEADER($host/config.h:config.h.in include/internal/$host/ethread_header_config.h:include/internal/ethread_header_config.h.in include/$host/erl_int_sizes_config.h:include/erl_int_sizes_config.h.in include/$host/erl_native_features_config.h:include/erl_native_features_config.h.in)
dnl ----------------------------------------------------------------------
dnl Optional features.
dnl ----------------------------------------------------------------------
enable_child_waiter_thread=no
ENABLE_ALLOC_TYPE_VARS=
AC_SUBST(ENABLE_ALLOC_TYPE_VARS)
AC_ARG_ENABLE(bootstrap-only,
AS_HELP_STRING([--enable-bootstrap-only],
[enable bootstrap only configuration]),
[ if test "X$enableval" = "Xyes"; then
# Disable stuff not necessary in a bootstrap only system in order
# to speed up things by reducing the amount of stuff needing to be
# built...
enable_threads=no
enable_smp_support=no
with_termcap=no
with_ssl=no
with_ssl_zlib=no
enable_hipe=no
enable_sctp=no
enable_dirty_schedulers=no
fi
])
AC_ARG_ENABLE(threads,
AS_HELP_STRING([--enable-threads], [enable async thread support])
AS_HELP_STRING([--disable-threads], [disable async thread support]),
[ case "$enableval" in
no) enable_threads=no ;;
*) enable_threads=yes ;;
esac ], enable_threads=unknown)
AC_ARG_ENABLE(dirty-schedulers,
AS_HELP_STRING([--enable-dirty-schedulers], [enable dirty scheduler support]),
[ case "$enableval" in
no) enable_dirty_schedulers=no ;;
*) enable_dirty_schedulers=yes ;;
esac ], enable_dirty_schedulers=no)
AC_ARG_ENABLE(halfword-emulator,
AS_HELP_STRING([--enable-halfword-emulator],
[enable halfword emulator (only for 64bit builds). Note: Halfword emulator is marked as deprecated and scheduled for removal in future major release.]),
[ case "$enableval" in
no) enable_halfword_emualtor=no ;;
*) enable_halfword_emulator=yes ;;
esac ], enable_halfword_emulator=unknown)
AC_ARG_ENABLE(smp-support,
AS_HELP_STRING([--enable-smp-support], [enable smp support])
AS_HELP_STRING([--disable-smp-support], [disable smp support]),
[ case "$enableval" in
no) enable_smp_support=no ;;
*) enable_smp_support=yes ;;
esac ], enable_smp_support=unknown)
AC_ARG_ENABLE(smp-require-native-atomics,
AS_HELP_STRING([--disable-smp-require-native-atomics],
[disable the SMP requirement of a native atomic implementation]),
[ case "$enableval" in
no) smp_require_native_atomics=no ;;
*) smp_require_native_atomics=yes ;;
esac ], smp_require_native_atomics=yes)
AC_ARG_WITH(termcap,
AS_HELP_STRING([--with-termcap], [use termcap (default)])
AS_HELP_STRING([--without-termcap],
[do not use any termcap libraries (ncurses,curses,termcap,termlib)]),
[],
[with_termcap=yes])
AC_ARG_ENABLE(lock-checking,
AS_HELP_STRING([--enable-lock-checking], [enable lock checking]),
[ case "$enableval" in
no) enable_lock_check=no ;;
*) enable_lock_check=yes ;;
esac
],
enable_lock_check=no)
AC_ARG_ENABLE(lock-counter,
AS_HELP_STRING([--enable-lock-counter], [enable lock counters]),
[ case "$enableval" in
no) enable_lock_count=no ;;
*) enable_lock_count=yes ;;
esac ], enable_lock_count=no)
AC_ARG_ENABLE(kernel-poll,
AS_HELP_STRING([--enable-kernel-poll], [enable kernel poll support])
AS_HELP_STRING([--disable-kernel-poll], [disable kernel poll support]),
[ case "$enableval" in
no) enable_kernel_poll=no ;;
*) enable_kernel_poll=yes ;;
esac ], enable_kernel_poll=unknown)
AC_ARG_ENABLE(sctp,
AS_HELP_STRING([--enable-sctp], [enable sctp support (default)])
AS_HELP_STRING([--disable-sctp], [disable sctp support]),
[ case "$enableval" in
no) enable_sctp=no ;;
*) enable_sctp=yes ;;
esac ], enable_sctp=unknown)
AC_ARG_ENABLE(hipe,
AS_HELP_STRING([--enable-hipe], [enable hipe support])
AS_HELP_STRING([--disable-hipe], [disable hipe support]))
AC_ARG_ENABLE(native-libs,
AS_HELP_STRING([--enable-native-libs],
[compile Erlang libraries to native code]))
AC_ARG_ENABLE(fp-exceptions,
AS_HELP_STRING([--enable-fp-exceptions],
[use hardware floating point exceptions (default if hipe enabled)]),
[ case "$enableval" in
no) enable_fp_exceptions=no ;;
*) enable_fp_exceptions=yes ;;
esac
],enable_fp_exceptions=auto)
AC_ARG_ENABLE(darwin-universal,
AS_HELP_STRING([--enable-darwin-universal],
[build universal binaries on darwin i386]),
[ case "$enableval" in
no) enable_darwin_universal=no ;;
*) enable_darwin_univeral=yes ;;
esac
],enable_darwin_universal=no)
AC_ARG_ENABLE(darwin-64bit,
AS_HELP_STRING([--enable-darwin-64bit], [build 64bit binaries on darwin]),
[ case "$enableval" in
no) enable_darwin_64bit=no ;;
*) enable_darwin_64bit=yes ;;
esac
],enable_darwin_64bit=no)
AC_ARG_ENABLE(m64-build,
AS_HELP_STRING([--enable-m64-build],
[build 64bit binaries using the -m64 flag to (g)cc]),
[ case "$enableval" in
no) enable_m64_build=no ;;
*) enable_m64_build=yes ;;
esac
],enable_m64_build=no)
AC_ARG_ENABLE(m32-build,
AS_HELP_STRING([--enable-m32-build],
[build 32bit binaries using the -m32 flag to (g)cc]),
[ case "$enableval" in
no) enable_m32_build=no ;;
*)
if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes;
then
AC_MSG_ERROR([(--enable-darwin-64bit or --enable-m64-build) and --enable-m32-build are mutually exclusive]) ;
fi ;
enable_m32_build=yes ;;
esac
],enable_m32_build=no)
AC_SUBST(PERFCTR_PATH)
AC_ARG_WITH(perfctr,
AS_HELP_STRING([--with-perfctr=PATH],
[specify location of perfctr include and lib])
AS_HELP_STRING([--without-perfctr], [don't use perfctr (default)]))
if test "x$with_perfctr" = "xno" -o "x$with_perfctr" = "x" ; then
PERFCTR_PATH=
else
if test ! -f "$with_perfctr/usr.lib/libperfctr.a" ; then
AC_MSG_ERROR(Invalid path to option --with-perfctr=PATH)
fi
PERFCTR_PATH="$with_perfctr"
AC_DEFINE(USE_PERFCTR,[1],
[Define to enable hrvtime() on Linux systems with perfctr extension])
fi
AC_ARG_WITH(dynamic-trace,
AS_HELP_STRING([--with-dynamic-trace={dtrace|systemtap}],
[specify use of dynamic trace framework, dtrace or systemtap])
AS_HELP_STRING([--without-dynamic-trace],
[don't enable any dynamic tracing (default)]))
if test X"$with_dynamic_trace" = X""; then
with_dynamic_trace=no
fi
case "$with_dynamic_trace" in
no) DYNAMIC_TRACE_FRAMEWORK=;;
dtrace)
AC_DEFINE(USE_DTRACE,[1],
[Define if you want to use dtrace for dynamic tracing])
DYNAMIC_TRACE_FRAMEWORK=dtrace;;
systemtap)
AC_DEFINE(USE_SYSTEMTAP,[1],
[Define if you want to use systemtap for dynamic tracing])
DYNAMIC_TRACE_FRAMEWORK=systemtap;;
*)
AC_MSG_ERROR(Unknown dynamic tracing framework specified with --with-dynamic-trace!);;
esac
if test X"$DYNAMIC_TRACE_FRAMEWORK" != X""; then
AC_DEFINE(USE_DYNAMIC_TRACE,[1],
[Define if you want to use dynamic tracing])
fi
AC_ARG_ENABLE(vm-probes,
AS_HELP_STRING([--enable-vm-probes],
[add dynamic trace probes to the Beam VM (only possible if --with-dynamic-trace is enabled, and then default)]),
[ case "$enableval" in
no) use_vm_probes=no ;;
*)
if test X"$DYNAMIC_TRACE_FRAMEWORK" != X""; then
use_vm_probes=yes ;
else
AC_MSG_ERROR(Can not enable VM probes without any dynamic tracing framework!);
fi;;
esac ], if test X"$DYNAMIC_TRACE_FRAMEWORK" != X""; then
use_vm_probes=yes ;
else
use_vm_probes=no
fi)
AC_SUBST(USE_VM_PROBES)
if test X"$use_vm_probes" = X"yes"; then
USE_VM_PROBES=yes
AC_DEFINE(USE_VM_PROBES,[1],
[Define to enable VM dynamic trace probes])
fi
AC_ARG_ENABLE(clock-gettime,
AS_HELP_STRING([--enable-clock-gettime],
[use clock-gettime for time correction]),
[ case "$enableval" in
no) clock_gettime_correction=no ;;
*) clock_gettime_correction=yes ;;
esac ], clock_gettime_correction=unknown)
AC_ARG_WITH(assumed-cache-line-size,
AS_HELP_STRING([--with-assumed-cache-line-size=SIZE],
[specify assumed cache line size in bytes (valid values are powers of two between and including 16 and 8192; default is 64)]))
dnl Require the assumed cache-line size to be a power of two between 16 and 8192
case "$with_assumed_cache_line_size" in
""|no|yes)
with_assumed_cache_line_size=64;;
16|32|64|128|256|512|1024|2048|4096|8192)
;;
*)
AC_MSG_ERROR([Invalid assumed cache-line size of $with_assumed_cache_line_size bytes])
;;
esac
AC_DEFINE_UNQUOTED(ASSUMED_CACHE_LINE_SIZE,
$with_assumed_cache_line_size,
[Assumed cache-line size (in bytes)])
AC_ARG_ENABLE(systemd,
AS_HELP_STRING([--enable-systemd], [enable systemd support in epmd]),
[],
[enable_systemd=no])
dnl Magic test for clearcase.
OTP_RELEASE=
if test "${ERLANG_COMMERCIAL_BUILD}" != ""; then
OTP_EXTRA_FLAGS=-DOTP_RELEASE
OTP_RELEASE=yes
else
OTP_EXTRA_FLAGS=
fi
AC_SUBST(OTP_RELEASE)
AC_MSG_CHECKING([OTP release])
[SYSTEM_VSN=`cat $ERL_TOP/OTP_VERSION | sed "s|\([0-9]*\).*|\1|"`]
AC_MSG_RESULT([$SYSTEM_VSN])
AC_SUBST(SYSTEM_VSN)
AC_MSG_CHECKING([OTP version])
[OTP_VERSION=`cat $ERL_TOP/OTP_VERSION`]
AC_MSG_RESULT([$OTP_VERSION])
AC_SUBST(OTP_VERSION)
dnl OK, we might have darwin switches off different kinds, lets
dnl check it all before continuing.
TMPSYS=`uname -s`-`uname -m`
if test X${enable_darwin_universal} = Xyes; then
if test X${enable_darwin_64bit} = Xyes; then
AC_MSG_ERROR([--enable-darwin-universal and --enable-darwin-64bit mutually exclusive])
fi
enable_hipe=no
case $CFLAGS in
*-arch\ ppc*)
;;
*)
CFLAGS="-arch ppc $CFLAGS"
;;
esac
case $CFLAGS in
*-arch\ i386*)
;;
*)
CFLAGS="-arch i386 $CFLAGS"
;;
esac
fi
if test X${enable_darwin_64bit} = Xyes; then
case "$TMPSYS" in
Darwin-i386|Darwin-x86_64)
;;
Darwin*)
AC_MSG_ERROR([--enable-darwin-64bit only supported on x86 hosts])
;;
*)
AC_MSG_ERROR([--enable-darwin-64bit only supported on Darwin])
;;
esac
fi
if test X${enable_darwin_64bit} = Xyes -o X${enable_m64_build} = Xyes; then
case $CFLAGS in
*-m64*)
;;
*)
CFLAGS="-m64 $CFLAGS"
;;
esac
else
if test X${enable_m32_build} = Xyes;
then
enable_hipe=no;
case $CFLAGS in
*-m32*)
;;
*)
CFLAGS="-m32 $CFLAGS"
;;
esac ;
fi
fi
AC_ARG_ENABLE(static-nifs,
AS_HELP_STRING([--enable-static-nifs], [link nifs statically. If yes then all nifs in all Erlang/OTP applications will be statically linked into the main binary. It is also possible to give a list of nifs that should be linked statically. The list should be a comma seperated and contain the absolute path to a .a archive for each nif that is to be statically linked. The name of the .a archive has to be the same as the name of the nif. Note that you have to link any external dependencies that the nifs have to the main binary, so for the crypto nif you want to pass LIBS=-lcrypto to configure.]),
STATIC_NIFS="$enableval",
STATIC_NIFS=no)
AC_SUBST(STATIC_NIFS)
AC_ARG_ENABLE(static-drivers,
AS_HELP_STRING([--enable-static-drivers], [comma seperated list of linked-in drivers to link statically with the main binary. The list should contain the absolute path to a .a archive for each driver that is to be statically linked. The name of the .a archive has to be the same as the name of the driver.]),
STATIC_DRIVERS="$enableval",
STATIC_DRIVERS=no)
AC_SUBST(STATIC_DRIVERS)
AC_ARG_WITH(ets-write-concurrency-locks,
AS_HELP_STRING([--with-ets-write-concurrency-locks={8|16|32|64|128|256}],
[specify how many locks the write_concurrency option for ets should use.])
AS_HELP_STRING([--without-ets-write-concurrency-locks],
[use the default number of write_concurrency locks (default)]))
if test X"$with_ets_write_concurrency_locks" != X""; then
AC_DEFINE_UNQUOTED(ERTS_DB_HASH_LOCK_CNT,$with_ets_write_concurrency_locks,
[Define to override the default number of write_concurrency locks])
fi
dnl ----------------------------------------------------------------------
dnl Checks for programs.
dnl ----------------------------------------------------------------------
AC_PROG_CC
AC_SUBST(GCC)
dnl ---------------------------------------------------------------------
dnl Special stuff regarding CFLAGS and details in the environment...
dnl ---------------------------------------------------------------------
dnl NOTE: CPPFLAGS will be included in CFLAGS at the end
case $host_os in
linux*) CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE";;
win32)
# The ethread library requires _WIN32_WINNT of at least 0x0403.
# -D_WIN32_WINNT=* from CPPFLAGS is saved in ETHR_DEFS.
CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0501 -DWINVER=0x0501"
;;
darwin*)
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE"
;;
*)
;;
esac
LM_WINDOWS_ENVIRONMENT
dnl
dnl Flags to the C compiler
dnl
dnl Make sure we find config.h
dnl
extra_flags="-I${ERL_TOP}/erts/$host $OTP_EXTRA_FLAGS"
CFLAGS="$CFLAGS $extra_flags"
DEBUG_CFLAGS="-g $CPPFLAGS $extra_flags $DEBUG_CFLAGS"
DEBUG_FLAGS=-g
dnl
dnl Adjust DEBUG_CFLAGS to match CFLAGS in terms of -m
dnl
case $CFLAGS in
*-m64*)
case $DEBUG_CFLAGS in
*-m64*)
;;
*)
DEBUG_CFLAGS="-m64 $DEBUG_CFLAGS"
;;
esac
;;
*-m32*)
case $DEBUG_CFLAGS in
*-m32*)
;;
*)
DEBUG_CFLAGS="-m32 $DEBUG_CFLAGS"
;;
esac
;;
*)
;;
esac
CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-R"
case $host_os in
darwin*)
CFLAG_RUNTIME_LIBRARY_PATH=
;;
win32)
CFLAG_RUNTIME_LIBRARY_PATH=
;;
osf*)
CFLAG_RUNTIME_LIBRARY_PATH="-Wl,-rpath,"
;;
*)
;;
esac
lfs_conf=ok
lfs_source=none
if test "${LFS_CFLAGS+set}" = "set" || \
test "${LFS_LDFLAGS+set}" = "set" || \
test "${LFS_LIBS+set}" = "set"; then
lfs_source=user
else
LM_CHECK_GETCONF
test "$GETCONF" = "false" || lfs_source=getconf
fi
if test "$lfs_source" = "none"; then
AC_MSG_WARN([Do not know how to check for large file support flags; no getconf is available])
else
for var in CFLAGS LDFLAGS LIBS; do
AC_MSG_CHECKING([for large file support $var])
if test $lfs_source = user; then
eval "lfs_val=\"\$LFS_$var\""
else
eval "lfs_var=LFS_$var"
lfs_val=`$GETCONF $lfs_var 2>/dev/null` || lfs_conf=failed
if test $lfs_conf = failed; then
AC_MSG_RESULT([failed])
break
fi
eval "$lfs_var=\"$lfs_val\""
fi
test "$lfs_val" != "" || lfs_val=none
AC_MSG_RESULT([$lfs_val])
done
if test $lfs_conf = failed; then
AC_MSG_WARN([Check for large file support flags failed; $GETCONF failed])
else
CFLAGS="$CFLAGS $LFS_CFLAGS"
DEBUG_CFLAGS="$DEBUG_CFLAGS $LFS_CFLAGS"
LDFLAGS="$LDFLAGS $LFS_LDFLAGS"
LIBS="$LIBS $LFS_LIBS"
fi
fi
if test "x$GCC" = xyes; then
# Treat certain GCC warnings as errors
LM_TRY_ENABLE_CFLAG([-Werror=return-type], [WERRORFLAGS])
# until the emulator can handle this, I suggest we turn it off!
#WFLAGS="-Wall -Wshadow -Wcast-qual -Wmissing-declarations"
WFLAGS="-Wall -Wstrict-prototypes"
case "$host_cpu" in
tile*)
# tile-gcc is a bit stricter with -Wmissing-prototypes than other gccs,
# and too strict for our taste.
;;
*)
WFLAGS="$WFLAGS -Wmissing-prototypes";;
esac
saved_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
AC_TRY_COMPILE([],[;], warn_decl_after_st=true, warn_decl_after_st=false)
if test "X$warn_decl_after_st" = "Xtrue"; then
WFLAGS="$WFLAGS -Wdeclaration-after-statement"
fi
CFLAGS=$saved_CFLAGS
else
WFLAGS=""
WERRORFLAGS=""
fi
dnl DEBUG_FLAGS is obsolete (I hope)
AC_SUBST(DEBUG_FLAGS)
AC_SUBST(DEBUG_CFLAGS)
AC_SUBST(WFLAGS)
AC_SUBST(WERRORFLAGS)
AC_SUBST(CFLAG_RUNTIME_LIBRARY_PATH)
AC_CHECK_SIZEOF(void *) # Needed for ARCH and smp checks below
if test "x$ac_cv_sizeof_void_p" = x8; then
AC_SUBST(EXTERNAL_WORD_SIZE, 64)
else
AC_SUBST(EXTERNAL_WORD_SIZE, 32)
fi
dnl
dnl Figure out operating system and cpu architecture
dnl
if test "x$host_alias" != "x"; then
chk_opsys_=$host_os
else
chk_opsys_=`uname -s`
if test "x$chk_opsys_" = "xSunOS"; then
chk_opsys_=$chk_opsys_`uname -r`
fi
fi
case $chk_opsys_ in
win32) OPSYS=win32;;
solaris2.*|SunOS5.*) OPSYS=sol2;;
linux|Linux) OPSYS=linux;;
darwin|Darwin) OPSYS=darwin;;
freebsd|FreeBSD) OPSYS=freebsd;;
*) OPSYS=noopsys
esac
if test "x$host_alias" != "x" -a "x$host_cpu" != "x"; then
chk_arch_=$host_cpu
else
chk_arch_=`uname -m`
fi
case $chk_arch_ in
sun4u) ARCH=ultrasparc;;
sparc64) ARCH=sparc64;;
sun4v) ARCH=ultrasparc;;
i86pc) ARCH=x86;;
i386) ARCH=x86;;
i486) ARCH=x86;;
i586) ARCH=x86;;
i686) ARCH=x86;;
x86_64) ARCH=amd64;;
amd64) ARCH=amd64;;
macppc) ARCH=ppc;;
powerpc) ARCH=ppc;;
ppc) ARCH=ppc;;
ppc64) ARCH=ppc64;;
"Power Macintosh") ARCH=ppc;;
armv5b) ARCH=arm;;
armv5teb) ARCH=arm;;
armv5tel) ARCH=arm;;
armv5tejl) ARCH=arm;;
armv6l) ARCH=arm;;
armv6hl) ARCH=arm;;
armv7l) ARCH=arm;;
armv7hl) ARCH=arm;;
tile) ARCH=tile;;
*) ARCH=noarch;;
esac
dnl
dnl Convert between x86 and amd64 based on the compiler's mode.
dnl Ditto between ultrasparc and sparc64.
dnl
AC_MSG_CHECKING(whether compilation mode forces ARCH adjustment)
case "$ARCH-$ac_cv_sizeof_void_p" in
i386-8)
AC_MSG_RESULT(yes: adjusting ARCH=x86 to ARCH=amd64)
ARCH=amd64
;;
x86-8)
AC_MSG_RESULT(yes: adjusting ARCH=x86 to ARCH=amd64)
ARCH=amd64
;;
amd64-4)
AC_MSG_RESULT(yes: adjusting ARCH=amd64 to ARCH=x86)
ARCH=x86
;;
ultrasparc-8)
AC_MSG_RESULT(yes: adjusting ARCH=ultrasparc to ARCH=sparc64)
ARCH=sparc64
;;
sparc64-4)
AC_MSG_RESULT(yes: adjusting ARCH=sparc64 to ARCH=ultrasparc)
ARCH=ultrasparc
;;
ppc64-4)
AC_MSG_RESULT(yes: adjusting ARCH=ppc64 to ARCH=ppc)
ARCH=ppc
;;
*)
AC_MSG_RESULT(no)
;;
esac
AC_SUBST(OPSYS)
AC_SUBST(ARCH)
dnl Check consistency of os and darwin-switches
dnl Take care of LDFLAGS on darwin, and disable common_test as it
dnl has a build/configure system re rx-lib that is not compatible
dnl First remove common_tests skip file.
dnl Adjust LDFLAGS to allow 64bit linkage on DARWIN
case $ARCH-$OPSYS in
amd64-darwin*)
AC_MSG_NOTICE([Adjusting LDFLAGS to cope with 64bit Darwin])
case $LDFLAGS in
*-m64*)
;;
*)
LDFLAGS="-m64 $LDFLAGS"
;;
esac
;;
*-darwin*)
if test X${enable_darwin_universal} = Xyes; then
AC_MSG_NOTICE([Adjusting LDFLAGS for universal binaries])
case $LDFLAGS in
*-arch\ ppc*)
;;
*)
LDFLAGS="-arch ppc $LDFLAGS"
;;
esac
case $LDFLAGS in
*-arch\ i386*)
;;
*)
LDFLAGS="-arch i386 $LDFLAGS"
;;
esac
else
case $LDFLAGS in
*-m32*)
;;
*)
LDFLAGS="-m32 $LDFLAGS"
;;
esac
fi
;;
*)
if test X${enable_m64_build} = Xyes; then
AC_MSG_NOTICE([Adjusting LDFLAGS to use -m64])
case $LDFLAGS in
*-m64*)
;;
*)
LDFLAGS="-m64 $LDFLAGS"
;;
esac
fi;
if test X${enable_m32_build} = Xyes; then
AC_MSG_NOTICE([Adjusting LDFLAGS to use -m32]) ;
case $LDFLAGS in
*-m32*)
;;
*)
LDFLAGS="-m32 $LDFLAGS"
;;
esac ;
fi
;;
esac
AC_MSG_CHECKING(if VM has to be linked with Carbon framework)
case $ARCH-$OPSYS in
*-darwin*)
LIBCARBON="-framework Carbon -framework Cocoa"
AC_MSG_RESULT([yes])
;;
*)
LIBCARBON=
AC_MSG_RESULT([no])
;;
esac
AC_SUBST(LIBCARBON)
dnl Check if we should/can build a halfword emulator
AC_MSG_CHECKING(if we are building a halfword emulator (32bit heap on 64bit machine))
if test "$enable_halfword_emulator" = "yes"; then
if test "$ARCH" = "amd64"; then
AC_DEFINE(HALFWORD_HEAP_EMULATOR, [1],
[Define if building a halfword-heap 64bit emulator])
ENABLE_ALLOC_TYPE_VARS="$ENABLE_ALLOC_TYPE_VARS halfword"
AC_MSG_RESULT([yes])
test -f "$ERL_TOP/erts/CONF_INFO" ||
echo "" > "$ERL_TOP/erts/CONF_INFO"
cat >> $ERL_TOP/erts/CONF_INFO <<EOF
The HALFWORD emulator has been enabled.
This is a DEPRECATED feature scheduled for removal
in a future major release.
EOF
else
AC_MSG_ERROR(no; halfword emulator not supported on this architecture)
fi
else
AC_MSG_RESULT([no])
fi
dnl some tests below will call this if we haven't already - and autoconf
dnl can't handle those tests being done conditionally at runtime
AC_PROG_CPP
AC_PROG_RANLIB
AC_PROG_YACC
LM_PROG_PERL5
if test "$ac_cv_path_PERL" = false; then
AC_MSG_ERROR([Perl version 5 is required to build the emulator!])
fi
AC_PROG_LN_S
AC_CHECK_TOOL([AR], [ar], [false])
if test "$ac_cv_prog_AR" = false; then
AC_MSG_ERROR([No 'ar' command found in PATH])
fi
_search_path=/bin:/usr/bin:/usr/local/bin:$PATH
AC_PATH_PROG(RM, rm, false, $_search_path)
if test "$ac_cv_path_RM" = false; then
AC_MSG_ERROR([No 'rm' command found])
fi
AC_PATH_PROG(MKDIR, mkdir, false, $_search_path)
if test "$ac_cv_path_MKDIR" = false; then
AC_MSG_ERROR([No 'mkdir' command found])
fi
_search_path=
#
# Get programs needed for building the documentation
#
## Delete previous failed configure results
if test -f doc/CONF_INFO; then
rm doc/CONF_INFO
fi
AC_CHECK_PROGS(XSLTPROC, xsltproc)
if test -z "$XSLTPROC"; then
echo "xsltproc" >> doc/CONF_INFO
AC_MSG_WARN([No 'xsltproc' command found: the documentation cannot be built])
fi
AC_CHECK_PROGS(FOP, fop)
if test -z "$FOP"; then
FOP="$ERL_TOP/make/fakefop"
echo "fop" >> doc/CONF_INFO
AC_MSG_WARN([No 'fop' command found: going to generate placeholder PDF files])
fi
AC_CHECK_PROGS(XMLLINT, xmllint)
if test -z "$XMLLINT"; then
echo "xmllint" >> doc/CONF_INFO
AC_MSG_WARN([No 'xmllint' command found: can't run the xmllint target for the documentation])
fi
dnl
dnl We can live with Solaris /usr/ucb/install
dnl
case $host in
*-*-solaris*|free_source)
if test -x /usr/ucb/install; then
INSTALL="/usr/ucb/install -c"
fi
;;
*)
;;
esac
AC_PROG_INSTALL
LM_PROG_INSTALL_DIR
case $host_os in
darwin*)
dnl Need to preserve modification time on archives;
dnl otherwise, ranlib has to be run on archives
dnl again after installation.
INSTALL_DATA="$INSTALL_DATA -p";;
*)
;;
esac
dnl
dnl Fix for Tilera install permissions
dnl
case $build in
*tile*)
INSTALL_PROGRAM="$INSTALL_PROGRAM -m755"
INSTALL_SCRIPT="$INSTALL_SCRIPT -m755"
;;
*)
;;
esac
dnl ----------------------------------------------------------------------
dnl Misc. things (some of them should go away)
dnl ----------------------------------------------------------------------
dnl
dnl An attempt to allow cross compiling. This is not the right way,
dnl nor does it work currently. Some makefiles still needs these
dnl variables, so we leave them in for now.
dnl
HCC='$(CC)' AC_SUBST(HCC)
HCFLAGS="" AC_SUBST(HCFLAGS)
HCFLAGS="$HCFLAGS -I${ERL_TOP}/erts/$host"
vxworks_reclaim="" AC_SUBST(vxworks_reclaim)
dnl We want to use $(CC) as linker for the emulator regardless of
dnl what the user say. This might not be the right way to do it, but
dnl for now that is the way we do it.
USER_LD=$LD
USER_LDFLAGS="$LDFLAGS"
case $host in
*ose) ;;
*) LD='$(CC)' ;;
esac
AC_SUBST(LD)
LDFLAG_RUNTIME_LIBRARY_PATH="$CFLAG_RUNTIME_LIBRARY_PATH"
AC_SUBST(LDFLAG_RUNTIME_LIBRARY_PATH)
dnl Check for cygwin and object/exe files extension
dnl AC_CYGWIN is deprecated
AC_EXEEXT
AC_OBJEXT
dnl This is the os flavour, should be unix, ose, vxworks or win32
case $host in
win32)
ERLANG_OSTYPE=win32 ;;
*ose)
ERLANG_OSTYPE=ose ;;
*)
ERLANG_OSTYPE=unix ;;
esac
AC_SUBST(ERLANG_OSTYPE)
# Check how to export functions from the emulator executable, needed
# when dynamically loaded drivers are loaded (so that they can find
# emulator functions).
# OS'es with ELF executables using the GNU linker (Linux and recent *BSD,
# in rare cases Solaris) typically need '-Wl,-export-dynamic' (i.e. pass
# -export-dynamic to the linker - also known as -rdynamic and some other
# variants); some sysVr4 system(s) instead need(s) '-Wl,-Bexport'.
# AIX 4.x (perhaps only for x>=2) wants -Wl,-bexpall,-brtl and doesn't
# reliably return an error for others, thus we separate it out.
# Otherwise we assume that if the linker accepts the flag, it is needed.
AC_MSG_CHECKING(for extra flags needed to export symbols)
DEXPORT=""