-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
executable file
·3670 lines (3288 loc) · 108 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
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
AC_INIT(mono, [3.2.3],
[http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
AC_CONFIG_SRCDIR([README])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AC_CANONICAL_HOST
# Gross hack to enable 'make dist' on automake 1.9+tar 1.14.
# The extra brackets are to foil regex-based scans.
m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign subdir-objects])
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
API_VER=2.0
AC_SUBST(API_VER)
AC_PROG_LN_S
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# In case of cygwin, override LN_S, irrespective of what it determines.
# The build uses cygwin, but the actual runtime doesn't.
case $host_os in
*cygwin* ) LN_S='cp -p';;
esac
dnl
dnl libgc checks
dnl
gc_headers=no
gc=included
gc_msg="included Boehm"
use_included_gc=no
libgc_configure_args=
if test -d $srcdir/libgc ; then
gc_default=included
else
gc_default=boehm
fi
# These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
# libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
CPPFLAGS_FOR_LIBGC=$CPPFLAGS
CFLAGS_FOR_LIBGC=$CFLAGS
CPPFLAGS_FOR_EGLIB=$CPPFLAGS
CFLAGS_FOR_EGLIB=$CFLAGS
#
# These are the flags that need to be stored in the mono.pc file for
# compiling code that will embed Mono
#
libmono_cflags=""
libmono_ldflags=""
AC_SUBST(libmono_cflags)
AC_SUBST(libmono_ldflags)
# Variable to have relocatable .pc files (lib, or lib64)
reloc_libdir=`basename ${libdir}`
AC_SUBST(reloc_libdir)
dnl if linker handles the version script
no_version_script=no
# Set to yes if Unix sockets cannot be created in an anonymous namespace
need_link_unlink=no
#Set to extra linker flags to be passed to the runtime binaries (mono /mono-sgen)
extra_runtime_ldflags=""
# Thread configuration inspired by sleepycat's db
AC_MSG_CHECKING([host platform characteristics])
libgc_threads=no
has_dtrace=no
parallel_mark=yes
ikvm_native=yes
case "$host" in
powerpc*-*-linux*)
# https://bugzilla.novell.com/show_bug.cgi?id=504411
disable_munmap=yes
;;
esac
host_win32=no
target_win32=no
platform_android=no
platform_darwin=no
case "$host" in
*-mingw*|*-*-cygwin*)
AC_DEFINE(HOST_WIN32,1,[Host Platform is Win32])
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
host_win32=yes
mono_cv_clang=no
if test "x$cross_compiling" = "xno"; then
target_win32=yes
if test "x$host" == "x$build" -a "x$host" == "x$target"; then
AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
fi
else
target_win32=yes
AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32/MinGW])
AC_DEFINE(MINGW_CROSS_COMPILE,1,[Cross-compiling using MinGW])
fi
HOST_CC="gcc"
# Windows 2000 is required that includes Internet Explorer 5.01
CPPFLAGS="$CPPFLAGS -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32"
libmono_cflags="-mms-bitfields -mwindows"
libmono_ldflags="-mms-bitfields -mwindows"
libdl=
libgc_threads=win32
gc_default=included
with_sigaltstack=no
LN_S=cp
# This forces libgc to use the DllMain based thread registration code on win32
libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
;;
*-*-*netbsd*)
host_win32=no
CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
libmono_cflags="-D_REENTRANT"
LDFLAGS="$LDFLAGS -pthread"
CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
libmono_ldflags="-pthread"
need_link_unlink=yes
libdl="-ldl"
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
;;
*-*-*freebsd*)
host_win32=no
if test "x$PTHREAD_CFLAGS" = "x"; then
CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
libmono_cflags=
else
CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
libmono_cflags="$PTHREAD_CFLAGS"
fi
if test "x$PTHREAD_LIBS" = "x"; then
LDFLAGS="$LDFLAGS -pthread -L/usr/local/lib"
libmono_ldflags="-pthread"
else
LDFLAGS="$LDFLAGS $PTHREAD_LIBS -L/usr/local/lib"
libmono_ldflags="$PTHREAD_LIBS"
fi
CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
libdl=
libgc_threads=pthreads
use_sigposix=yes
has_dtrace=yes
;;
*-*-*openbsd*)
host_win32=no
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
LDFLAGS="$LDFLAGS -pthread"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
libdl=
gc_default=boehm
libgc_threads=pthreads
with_sigaltstack=no
use_sigposix=yes
;;
*-*-linux-android*)
host_win32=no
platform_android=yes
AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libdl="-ldl"
libgc_threads=pthreads
use_sigposix=yes
with_tls=pthread
with_sigaltstack=no
with_static_mono=no
# Android doesn't support boehm, as it's missing <link.h>
support_boehm=no
with_gc=sgen
# isinf(3) requires -lm; see isinf check below
LDFLAGS="$LDFLAGS -lm"
# Bionic's <pthread.h> sets PTHREAD_STACK_MIN=2*PAGE_SIZE; doesn't define
# PAGE_SIZE; breaks mono/io-layer/collection.c
# Bionic doesn't provide S_IWRITE; breaks io-layer/io.c
CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
# to bypass the underscore linker check, can't work when cross-compiling
mono_cv_uscore=yes
mono_cv_clang=no
;;
*-*-linux*)
host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libdl="-ldl"
libgc_threads=pthreads
use_sigposix=yes
if test "x$cross_compiling" != "xno"; then
# to bypass the underscore linker check, not
# available during cross-compilation
mono_cv_uscore=no
fi
;;
*-*-nacl*)
host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
if test "x$disable_munmap" != "xyes"; then
CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
fi
libmono_cflags="-D_REENTRANT"
libdl=
libgc_threads=pthreads
gc_default=boehm
use_sigposix=yes
ikvm_native=no
AC_DEFINE(DISABLE_SOCKETS,1,[Disable sockets support])
AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
;;
*-*-hpux*)
host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
# +ESdbgasm only valid on bundled cc on RISC
# silently ignored for ia64
if test $GCC != "yes"; then
CFLAGS="$CFLAGS +ESdbgasm"
# Arrange for run-time dereferencing of null
# pointers to produce a SIGSEGV signal.
LDFLAGS="$LDFLAGS -z"
fi
CFLAGS="$CFLAGS +ESdbgasm"
LDFLAGS="$LDFLAGS -z"
libmono_cflags="-D_REENTRANT"
libmono_ldflags="-lpthread"
libgc_threads=pthreads
need_link_unlink=yes
use_sigposix=yes
;;
*-*-solaris*)
host_win32=no
CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS"
need_link_unlink=yes
libmono_cflags="-D_REENTRANT"
libgc_threads=pthreads
# This doesn't seem to work on solaris/x86, but the configure test runs
with_tls=pthread
has_dtrace=yes
use_sigposix=yes
enable_solaris_tar_check=yes
;;
*-*-darwin*)
parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
host_win32=no
platform_darwin=yes
target_mach=yes
CPPFLAGS="$CPPFLAGS -no-cpp-precomp -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
CPPFLAGS="$CPPFLAGS -DGetCurrentProcess=MonoGetCurrentProcess -DGetCurrentThread=MonoGetCurrentThread -DCreateEvent=MonoCreateEvent"
libmono_cflags="-D_THREAD_SAFE"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
AC_DEFINE(USE_MACH_SEMA, 1, [...])
no_version_script=yes
libdl=
libgc_threads=pthreads
has_dtrace=yes
if test "x$cross_compiling" = "xyes"; then
has_broken_apple_cpp=yes
fi
dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin*, but
dnl its gcc defaults to 64-bit mode. They have also deprecated the usage of ucontext
dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
case "$host" in
dnl Snow Leopard and newer config.guess reports as this
i*86-*-darwin*)
BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE"
BROKEN_DARWIN_CPPFLAGS="-D_XOPEN_SOURCE"
CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_CPPFLAGS"
CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_CPPFLAGS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS"
CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
extra_runtime_ldflags="-stack_size,0x800000"
;;
x*64-*-darwin*)
extra_runtime_ldflags="-stack_size,0x800000"
;;
arm*-darwin*)
has_dtrace=no
;;
esac
;;
*-*-haiku*)
host_win32=no
CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_THREAD_SAFE"
libmono_cflags="-D_REENTRANT -D_THREAD_SAFE"
libdl=
LIBS="$LIBS -lnetwork"
need_link_unlink=yes
AC_DEFINE(PTHREAD_POINTER_ID)
libgc_threads=pthreads
use_sigposix=yes
;;
*)
AC_MSG_WARN([*** Please add $host to configure.in checks!])
host_win32=no
libdl="-ldl"
;;
esac
AC_MSG_RESULT(ok)
if test x$need_link_unlink = xyes; then
AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
fi
AC_SUBST(extra_runtime_ldflags)
AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
AM_CONDITIONAL(PLATFORM_DARWIN, test x$platform_darwin = xyes)
AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AC_CHECK_TOOL(CXX, g++, g++)
AC_PROG_CXX
AM_PROG_AS
AC_PROG_INSTALL
AC_PROG_AWK
AM_PROG_CC_C_O
dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
: ${CCAS='$(CC)'}
# Set ASFLAGS if not already set.
: ${CCASFLAGS='$(CFLAGS)'}
AC_SUBST(CCAS)
AC_SUBST(CCASFLAGS)
# AC_PROG_CXX helpfully sets CXX to g++ even if no c++ compiler is found so check
# GXX instead. See http://lists.gnu.org/archive/html/bug-autoconf/2002-04/msg00056.html
if test "x$CXX" = "xg++"; then
if test "x$GXX" != "xyes"; then
# automake/libtool is so broken, it requires g++ even if the c++ sources
# are inside automake conditionals
AC_MSG_ERROR([You need to install g++])
fi
fi
dnl may require a specific autoconf version
dnl AC_PROG_CC_FOR_BUILD
dnl CC_FOR_BUILD not automatically detected
CC_FOR_BUILD=$CC
CFLAGS_FOR_BUILD=$CFLAGS
BUILD_EXEEXT=
if test "x$cross_compiling" = "xyes"; then
CC_FOR_BUILD=cc
CFLAGS_FOR_BUILD=
BUILD_EXEEXT=""
fi
AC_SUBST(CC_FOR_BUILD)
AC_SUBST(CFLAGS_FOR_BUILD)
AC_SUBST(HOST_CC)
AC_SUBST(BUILD_EXEEXT)
AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
AM_CONDITIONAL(USE_BATCH_FILES, [test x$host_win32 = xyes -a x$cross_compiling = xyes])
# Set STDC_HEADERS
AC_HEADER_STDC
AC_LIBTOOL_WIN32_DLL
# This causes monodis to not link correctly
#AC_DISABLE_FAST_INSTALL
AM_PROG_LIBTOOL
# Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
DOLT
export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
AC_SUBST(export_ldflags)
# Test whenever ld supports -version-script
AC_PROG_LD
AC_PROG_LD_GNU
if test "x$lt_cv_prog_gnu_ld" = "xno"; then
no_version_script=yes
fi
AM_ICONV()
AM_CONDITIONAL(NO_VERSION_SCRIPT, test x$no_version_script = xyes)
AC_CHECK_HEADERS(sys/filio.h sys/sockio.h netdb.h utime.h sys/utime.h semaphore.h sys/un.h linux/rtc.h sys/syscall.h sys/mkdev.h sys/uio.h sys/param.h libproc.h)
AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.h sys/sem.h sys/utsname.h alloca.h ucontext.h pwd.h sys/select.h netinet/tcp.h netinet/in.h unistd.h sys/types.h link.h asm/sigcontext.h sys/inotify.h)
AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
[], [], [#include <stddef.h>
#include <sys/socket.h>
#include <linux/socket.h>])
AC_CHECK_HEADERS(sys/user.h, [], [],
[
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
])
AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
if test x$have_zlib = xyes; then
AC_TRY_COMPILE([#include <zlib.h>], [
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
return 0;
#else
#error No good zlib found
#endif
],[
AC_MSG_RESULT(Using system zlib)
zlib_msg="system zlib"
AC_DEFINE(HAVE_SYS_ZLIB,1,[Have system zlib])
],[
AC_MSG_RESULT(Using embedded zlib)
have_zlib=no
zlib_msg="bundled zlib"
])
fi
AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
AC_DEFINE(HAVE_ZLIB,1,[Have system zlib])
# for mono/metadata/debug-symfile.c
AC_CHECK_HEADERS(elf.h)
# for support
AC_CHECK_HEADERS(poll.h)
AC_CHECK_HEADERS(sys/poll.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(grp.h)
AC_CHECK_HEADERS(syslog.h)
# for mono/dis
AC_CHECK_HEADERS(wchar.h)
AC_CHECK_HEADERS(ieeefp.h)
AC_MSG_CHECKING(for isinf)
AC_TRY_LINK([#include <math.h>], [
int f = isinf (1);
], [
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_ISINF, 1, [isinf available])
], [
# We'll have to use signals
AC_MSG_RESULT(no)
])
# mingw
AC_CHECK_FUNCS(_finite, , AC_MSG_CHECKING(for _finite in math.h)
AC_TRY_LINK([#include <math.h>],
[ _finite(0.0); ],
AC_DEFINE(HAVE__FINITE, 1, [Have _finite in -lm]) AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)))
# for Linux statfs support
AC_CHECK_HEADERS(linux/magic.h)
# not 64 bit clean in cross-compile
AC_CHECK_SIZEOF(void *, 4)
AC_CACHE_CHECK([for clang],
mono_cv_clang,[
AC_TRY_COMPILE([], [
#ifdef __clang__
#else
#error "FAILED"
#endif
return 0;
],
[mono_cv_clang=yes],
[mono_cv_clang=no],
[])
])
WARN=''
if test x"$GCC" = xyes; then
WARN='-Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value'
# The runtime code does not respect ANSI C strict aliasing rules
CFLAGS="$CFLAGS -fno-strict-aliasing"
ORIG_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
AC_MSG_CHECKING(for -Wdeclaration-after-statement option to gcc)
AC_TRY_COMPILE([],[
return 0;
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
ORIG_CFLAGS=$CFLAGS
# Check for the normal version, since gcc ignores unknown -Wno options
CFLAGS="$CFLAGS -Wunused-but-set-variable -Werror"
AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
AC_TRY_COMPILE([],[
return 0;
], [
AC_MSG_RESULT(yes)
CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
if test "x$mono_cv_clang" = "xyes"; then
# https://bugzilla.samba.org/show_bug.cgi?id=8118
WARN="$WARN -Qunused-arguments"
WARN="$WARN -Wno-unused-function -Wno-tautological-compare"
fi
else
# The Sun Forte compiler complains about inline functions that access static variables
# so disable all inlining.
case "$host" in
*-*-solaris*)
CFLAGS="$CFLAGS -Dinline="
;;
esac
fi
CFLAGS="$CFLAGS -g $WARN"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -g"
# Where's the 'mcs' source tree?
if test -d $srcdir/mcs; then
mcsdir=mcs
else
mcsdir=../mcs
fi
AC_ARG_WITH(mcs-path, [ --with-mcs-path=/path/to/mcs Specify an alternate mcs source tree],
if test x$with_mcs_path != "x" -a -d $with_mcs_path ; then
mcsdir=$with_mcs_path
fi
)
AC_ARG_WITH(jumptables, [ --with-jumptables=yes,no enable/disable support for jumptables (ARM-only for now) (defaults to no)],[],[with_jumptables=no])
#
# A sanity check to catch cases where the package was unpacked
# with an ancient tar program (Solaris)
#
AC_ARG_ENABLE(solaris-tar-check,
[ --disable-solaris-tar-check disable solaris tar check],
do_solaris_tar_check=no, do_solaris_tar_check=yes)
if test x"$do_solaris_tar_check" = xyes -a x"$enable_solaris_tar_check" = xyes; then
AC_MSG_CHECKING(integrity of package)
if test -f $mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
then
AC_MSG_RESULT(ok)
else
errorm="Your mono distribution is incomplete; if unpacking from a tar file, make sure you use GNU tar; see http://www.mono-project.com/IncompletePackage for more details"
AC_MSG_ERROR([$errorm])
fi
fi
if test "x$with_mcs_path" != "x"; then
mcs_topdir=$(cd "$mcsdir" && pwd)
mcs_topdir_from_srcdir=$mcs_topdir
else
mcs_topdir=$(cd "$srcdir/$mcsdir" && pwd)
mcs_topdir_from_srcdir='$(top_builddir)'/$mcsdir
fi
# Convert mcs_topdir* paths to Windows syntax.
if test x$cross_compiling$host_win32 = xnoyes; then
mcs_topdir=$(cygpath -m $mcs_topdir)
case $mcs_topdir_from_srcdir in
/cygdrive/*)
mcs_topdir_from_srcdir=$(cygpath -m $mcs_topdir_from_srcdir)
;;
esac
fi
AC_SUBST([mcs_topdir])
AC_SUBST([mcs_topdir_from_srcdir])
# Where's the 'olive' source tree?
if test -d $srcdir/olive; then
olivedir=olive
else
olivedir=../olive
fi
if test -d $srcdir/$olivedir; then
olive_topdir='$(top_srcdir)/'$olivedir
fi
# gettext: prepare the translation directories.
# we do not configure the full gettext, as we consume it dynamically from C#
AM_PO_SUBDIRS
if test "x$USE_NLS" = "xyes"; then
AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
if test "x$HAVE_MSGFMT" = "xno"; then
AC_MSG_ERROR([msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure.])
fi
fi
AC_ARG_WITH([libgdiplus],
[ --with-libgdiplus=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to installed)],
[], [with_libgdiplus=installed])
case $with_libgdiplus in
no|installed) libgdiplus_loc= ;;
yes|sibling) libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la ;;
/*) libgdiplus_loc=$with_libgdiplus ;;
*) libgdiplus_loc=`pwd`/$with_libgdiplus ;;
esac
AC_SUBST([libgdiplus_loc])
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
pkg_config_path=
AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
if test x$with_crosspkgdir = "x"; then
if test -s $PKG_CONFIG_PATH; then
pkg_config_path=$PKG_CONFIG_PATH
fi
else
pkg_config_path=$with_crosspkgdir
PKG_CONFIG_PATH=$pkg_config_path
export PKG_CONFIG_PATH
fi
)
ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
AC_CONFIG_SUBDIRS(eglib)
GLIB_CFLAGS='-I$(top_srcdir)/eglib/src -I$(top_builddir)/eglib/src'
GLIB_LIBS='-L$(top_builddir)/eglib/src -leglib -lm'
BUILD_GLIB_CFLAGS="$GLIB_CFLAGS"
BUILD_GLIB_LIBS="$GLIB_LIBS"
GMODULE_CFLAGS="$GLIB_CFLAGS"
GMODULE_LIBS="$GLIB_LIBS"
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
AC_SUBST(GMODULE_CFLAGS)
AC_SUBST(GMODULE_LIBS)
AC_SUBST(BUILD_GLIB_CFLAGS)
AC_SUBST(BUILD_GLIB_LIBS)
AC_ARG_WITH(gc, [ --with-gc=boehm,included,none Controls the Boehm GC config, default=included],[gc=$with_gc],[gc=$gc_default])
# Enable support for fast thread-local storage
# Some systems have broken support, so we allow to disable it.
AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation (defaults to __thread)],[],[with_tls=__thread])
# Enable support for using sigaltstack for SIGSEGV and stack overflow handling
# This does not work on some platforms (bug #55253)
AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack (defaults to yes)],[],[with_sigaltstack=yes])
AC_ARG_WITH(static_mono, [ --with-static_mono=yes,no link mono statically to libmono (faster) (defaults to yes)],[],[with_static_mono=yes])
AC_ARG_WITH(shared_mono, [ --with-shared_mono=yes,no build a shared libmono library (defaults to yes)],[],[with_shared_mono=yes])
# Same as --with-shared_mono=no
AC_ARG_ENABLE(libraries, [ --disable-libraries disable the build of libmono], enable_libraries=$enableval, enable_libraries=yes)
if test "x$enable_static" = "xno"; then
with_static_mono=no
fi
if test "x$enable_shared" = "xno"; then
with_shared_mono=no
fi
if test "x$enable_libraries" = "xno"; then
with_shared_mono=no
fi
AM_CONDITIONAL(DISABLE_LIBRARIES, test x$enable_libraries = xno)
case $host in
*nacl* ) with_shared_mono=yes;;
esac
if test "x$host_win32" = "xyes"; then
# Boehm GC requires the runtime to be in its own dll
with_static_mono=no
fi
AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
AC_DEFINE(MONO_XEN_OPT, 1, [Xen-specific behaviour])
ORIG_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
AC_MSG_CHECKING(for -mno-tls-direct-seg-refs option to gcc)
AC_TRY_COMPILE([], [
return 0;
], [
AC_MSG_RESULT(yes)
# Pass it to libgc as well
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -mno-tls-direct-seg-refs"
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
fi
AC_ARG_ENABLE(small-config, [ --enable-small-config Enable tweaks to reduce requirements (and capabilities)], enable_small_config=$enableval, enable_small_config=no)
if test x$enable_small_config = xyes; then
AC_DEFINE(MONO_SMALL_CONFIG,1,[Reduce runtime requirements (and capabilities)])
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DSMALL_CONFIG"
fi
AC_ARG_ENABLE(system-aot, [ --enable-system-aot Enable the Ahead-Of-Time compilation of system assemblies during the build (on by default on some platforms)], enable_system_aot=$enableval, enable_system_aot=default)
DISABLED_FEATURES=none
AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, assembly_remapping, shared_perfcounters, remoting,
security, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
[
for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
eval "mono_feature_disable_$feature='yes'"
done
DISABLED_FEATURES=$enable_minimal
disabled="Disabled: $enable_minimal"
],[])
AC_DEFINE_UNQUOTED(DISABLED_FEATURES, "$DISABLED_FEATURES", [String of disabled features])
if test "x$mono_feature_disable_aot" = "xyes"; then
AC_DEFINE(DISABLE_AOT_COMPILER, 1, [Disable AOT Compiler])
AC_MSG_NOTICE([Disabled AOT compiler])
fi
if test "x$mono_feature_disable_profiler" = "xyes"; then
AC_DEFINE(DISABLE_PROFILER, 1, [Disable default profiler support])
AC_MSG_NOTICE([Disabled support for the profiler])
fi
AM_CONDITIONAL(DISABLE_PROFILER, test x$mono_feature_disable_profiler = xyes)
if test "x$mono_feature_disable_decimal" = "xyes"; then
AC_DEFINE(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
AC_MSG_NOTICE([Disabled support for decimal])
fi
if test "x$mono_feature_disable_pinvoke" = "xyes"; then
AC_DEFINE(DISABLE_PINVOKE, 1, [Disable P/Invoke support])
AC_MSG_NOTICE([Disabled support for P/Invoke])
fi
if test "x$mono_feature_disable_debug" = "xyes"; then
AC_DEFINE(DISABLE_DEBUG, 1, [Disable runtime debugging support])
AC_MSG_NOTICE([Disabled support for runtime debugging])
fi
if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
AC_DEFINE(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
mono_feature_disable_reflection_emit_save=yes
AC_MSG_NOTICE([Disabled support for Reflection.Emit])
fi
if test "x$mono_feature_disable_reflection_emit_save" = "xyes"; then
AC_DEFINE(DISABLE_REFLECTION_EMIT_SAVE, 1, [Disable assembly saving support in reflection emit])
AC_MSG_NOTICE([Disabled support for Reflection.Emit.Save])
fi
if test "x$mono_feature_disable_large_code" = "xyes"; then
AC_DEFINE(DISABLE_LARGE_CODE, 1, [Disable support for huge assemblies])
AC_MSG_NOTICE([Disabled support for large assemblies])
fi
if test "x$mono_feature_disable_logging" = "xyes"; then
AC_DEFINE(DISABLE_LOGGING, 1, [Disable support debug logging])
AC_MSG_NOTICE([Disabled support for logging])
fi
if test "x$mono_feature_disable_com" = "xyes"; then
AC_DEFINE(DISABLE_COM, 1, [Disable COM support])
AC_MSG_NOTICE([Disabled COM support])
fi
if test "x$mono_feature_disable_ssa" = "xyes"; then
AC_DEFINE(DISABLE_SSA, 1, [Disable advanced SSA JIT optimizations])
AC_MSG_NOTICE([Disabled SSA JIT optimizations])
fi
if test "x$mono_feature_disable_generics" = "xyes"; then
AC_DEFINE(DISABLE_GENERICS, 1, [Disable generics support])
AC_MSG_NOTICE([Disabled Generics Support])
fi
if test "x$mono_feature_disable_shadowcopy" = "xyes"; then
AC_DEFINE(DISABLE_SHADOW_COPY, 1, [Disable Shadow Copy for AppDomains])
AC_MSG_NOTICE([Disabled Shadow copy for AppDomains])
fi
if test "x$mono_feature_disable_portability" = "xyes"; then
AC_DEFINE(DISABLE_PORTABILITY, 1, [Disables the IO portability layer])
AC_MSG_NOTICE([Disabled IO Portability layer])
fi
if test "x$mono_feature_disable_attach" = "xyes"; then
AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
AC_MSG_NOTICE([Disabled agent attach])
fi
if test "x$mono_feature_disable_full_messages" = "xyes"; then
AC_DEFINE(DISABLE_FULL_MESSAGES, 1, [Disables building in the full table of WAPI messages])
AC_MSG_NOTICE([Disabled full messages for Win32 errors, only core message strings shipped])
fi
if test "x$mono_feature_disable_verifier" = "xyes"; then
AC_DEFINE(DISABLE_VERIFIER, 1, [Disables the verifier])
AC_MSG_NOTICE([Disabled the metadata and IL verifiers])
fi
if test "x$mono_feature_disable_jit" = "xyes"; then
AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
AC_MSG_NOTICE([Disabled the JIT engine, only full AOT will be supported])
fi
AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
if test "x$mono_feature_disable_simd" = "xyes"; then
AC_DEFINE(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
AC_MSG_NOTICE([Disabled SIMD support])
fi
if test "x$mono_feature_disable_soft_debug" = "xyes"; then
AC_DEFINE(DISABLE_SOFT_DEBUG, 1, [Disable Soft Debugger Agent.])
AC_MSG_NOTICE([Disabled Soft Debugger.])
fi
if test "x$mono_feature_disable_perfcounters" = "xyes"; then
AC_DEFINE(DISABLE_PERFCOUNTERS, 1, [Disable Performance Counters.])
AC_MSG_NOTICE([Disabled Performance Counters.])
fi
if test "x$mono_feature_disable_normalization" = "xyes"; then
AC_DEFINE(DISABLE_NORMALIZATION, 1, [Disable String normalization support.])
AC_MSG_NOTICE([Disabled String normalization support.])
fi
if test "x$mono_feature_disable_assembly_remapping" = "xyes"; then
AC_DEFINE(DISABLE_ASSEMBLY_REMAPPING, 1, [Disable assembly remapping.])
AC_MSG_NOTICE([Disabled Assembly remapping.])
fi
if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then
AC_DEFINE(DISABLE_SHARED_PERFCOUNTERS, 1, [Disable shared perfcounters.])
AC_MSG_NOTICE([Disabled Shared perfcounters.])
fi
if test "x$mono_feature_disable_appdomains" = "xyes"; then
AC_DEFINE(DISABLE_APPDOMAINS, 1, [Disable support for multiple appdomains.])
AC_MSG_NOTICE([Disabled support for multiple appdomains.])
fi
if test "x$mono_feature_disable_remoting" = "xyes"; then
AC_DEFINE(DISABLE_REMOTING, 1, [Disable remoting support (This disables type proxies and make com non-functional)])
AC_MSG_NOTICE([Disabled remoting])
fi
if test "x$mono_feature_disable_security" = "xyes"; then
AC_DEFINE(DISABLE_SECURITY, 1, [Disable CAS/CoreCLR security])
AC_MSG_NOTICE([Disabled CAS/CoreCLR security manager (used e.g. for Moonlight)])
fi
if test "x$mono_feature_disable_sgen_remset" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_REMSET, 1, [Disable wbarrier=remset support in SGEN.])
AC_MSG_NOTICE([Disabled wbarrier=remset support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_marksweep_par" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_PAR, 1, [Disable major=marksweep-par support in SGEN.])
AC_MSG_NOTICE([Disabled major=marksweep-par support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_marksweep_fixed" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_FIXED, 1, [Disable major=marksweep-fixed support in SGEN.])
AC_MSG_NOTICE([Disabled major=marksweep-fixed support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_marksweep_fixed_par" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_FIXED_PAR, 1, [Disable major=marksweep-fixed-par support in SGEN.])
AC_MSG_NOTICE([Disabled major=marksweep-fixed-par support in SGEN.])
fi
if test "x$mono_feature_disable_sgen_copying" = "xyes"; then
AC_DEFINE(DISABLE_SGEN_MAJOR_COPYING, 1, [Disable major=copying support in SGEN.])
AC_MSG_NOTICE([Disabled major=copying support in SGEN.])
fi
AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
AC_ARG_ENABLE(extension-module, [ --enable-extension-module enables usage of the extension module], has_extension_module=$enableval, has_extension_module=no)
AM_CONDITIONAL([HAS_EXTENSION_MODULE], [test x$has_extension_module != xno])
if test x$has_extension_module != xno ; then
AC_DEFINE([ENABLE_EXTENSION_MODULE], 1, [Extension module enabled])
AC_MSG_NOTICE([Enabling mono extension module.])
fi
AC_MSG_CHECKING(for visibility __attribute__)
AC_COMPILE_IFELSE([
AC_LANG_SOURCE([[
void __attribute__ ((visibility ("hidden"))) doit (void) {}
int main () { doit (); return 0; }
]])
], [
have_visibility_hidden=yes
AC_MSG_RESULT(yes)
], [
have_visibility_hidden=no
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for deprecated __attribute__)
AC_TRY_COMPILE([
int doit (void) __attribute__ ((deprecated));
int doit (void) { return 0; }
], [
return 0;
], [
have_deprecated=yes
AC_MSG_RESULT(yes)
], [
have_deprecated=no
AC_MSG_RESULT(no)
])
AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
if test x$enable_parallel_mark = xyes; then
libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
fi
AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
dnl
dnl Boehm GC configuration
dnl
LIBGC_CPPFLAGS=
LIBGC_LIBS=
LIBGC_STATIC_LIBS=
libgc_dir=
case "x$gc" in
xboehm|xbohem|xyes)
AC_CHECK_HEADERS(gc.h gc/gc.h, gc_headers=yes)
AC_CHECK_LIB(gc, GC_malloc, found_boehm="yes",,$libdl)
if test "x$found_boehm" != "xyes"; then
AC_MSG_ERROR("GC requested but libgc not found! Install libgc or run configure with --with-gc=none.")
fi
if test "x$gc_headers" != "xyes"; then
AC_MSG_ERROR("GC requested but header files not found! You may need to install them by hand.")
fi
LIBGC_LIBS="-lgc $libdl"
LIBGC_STATIC_LIBS="$LIBGC_LIBS"
libmono_ldflags="$libmono_ldflags -lgc"
BOEHM_DEFINES="-DHAVE_BOEHM_GC"
# AC_CHECK_FUNCS does not work for some reason...
AC_CHECK_LIB(gc, GC_gcj_malloc, found_gcj_malloc="yes",,$libdl)
if test "x$found_gcj_malloc" = "xyes"; then
BOEHM_DEFINES="-DHAVE_GC_GCJ_MALLOC $BOEHM_DEFINES"