forked from Unity-Technologies/mono
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
2953 lines (2645 loc) · 86.6 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
AC_INIT(README)
AC_CANONICAL_SYSTEM
# 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_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(mono,2.6.5)
AM_MAINTAINER_MODE
API_VER=1.0
AC_SUBST(API_VER)
AC_PROG_LN_S
# 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
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
AC_ARG_WITH([macversion],
[ --with-macversion=<version> Choose minimum macos version],
[], [with_macversion=10.4])
if test -z $MACSDKOPTIONS; then
MACSYSROOTBASE="-isysroot /Developer/SDKs"
if [[ "$with_macversion" == "10.4" ]]; then
MACSYSROOT="$MACSYSROOTBASE/MacOSX10.4u.sdk"
else
MACSYSROOT="$MACSYSROOTBASE/MacOSX""$with_macversion"".sdk"
fi
MACSDKOPTIONS="-mmacosx-version-min=$with_macversion $MACSYSROOT"
fi
# Thread configuration inspired by sleepycat's db
AC_MSG_CHECKING([host platform characteristics])
libgc_threads=no
has_dtrace=no
parallel_mark=yes
case "$host" in
powerpc*-*-linux*)
# https://bugzilla.novell.com/show_bug.cgi?id=504411
disable_munmap=yes
;;
esac
case "$host" in
*-*-mingw*|*-*-cygwin*)
platform_win32=yes
AC_DEFINE(PLATFORM_WIN32,1,[Host Platform is Win32])
AC_DEFINE(TARGET_WIN32,1,[Target OS is Win32])
AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
if test "x$cross_compiling" = "xno"; then
CC="gcc -mno-cygwin -g"
CXX="g++ -mno-cygwin -g"
# So libgc configure gets -mno-cygwin
export CC
export CXX
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"
libmono_cflags="-mno-cygwin -mms-bitfields -mwindows"
libmono_ldflags="-mno-cygwin -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*)
platform_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*)
platform_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"
libmono_ldflags="-pthread"
else
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"
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
# This doesn't seem to work as of 7.0 on amd64
with_sigaltstack=no
# TLS is only partially implemented on -CURRENT (compiler support
# but NOT library support)
#
with_tls=pthread
use_sigposix=yes
;;
*-*-*openbsd*)
platform_win32=no
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_GNU_SOURCE -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
;;
*-*-qnx*)
CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_QNX_THREADS -D_QNX_SOURCE -D_REENTRANT -DUSE_MMAP"
libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
platform_win32=no
use_sigposix=yes
with_tls=pthread
libgc_threads=pthreads
with_sigaltstack=no
with_glib=embedded
disable_nls=yes
parallel_mark=no
mono_cv_uscore=yes
;;
*-*-linux*)
platform_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
AOT_SUPPORTED="yes"
use_sigposix=yes
;;
*-*-hpux*)
platform_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*)
platform_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"
platform_win32=no
platform_darwin=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"
if [[ "$host" != "arm-apple-darwin9" ]]; then
CPPFLAGS="$CPPFLAGS $MACSDKOPTIONS"
LDFLAGS="$LDFLAGS $MACSDKOPTIONS"
fi
libmono_cflags="-D_THREAD_SAFE"
LDFLAGS="$LDFLAGS -pthread"
libmono_ldflags="-pthread"
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-darwin10.0.0, 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* | x86_64-*-darwin*)
# BROKEN_DARWIN_FLAGS="-arch i386"
CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_FLAGS"
CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
;;
esac
;;
*)
AC_MSG_WARN([*** Please add $host to configure.in checks!])
platform_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
AM_CONDITIONAL(PLATFORM_WIN32, test x$platform_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)
AC_CHECK_TOOL(CC, gcc, gcc)
AC_PROG_CC
AC_CHECK_TOOL(CXX, g++, g++)
AC_PROG_CXX
AM_PROG_AS
AM_PROG_CC_STDC
AC_PROG_INSTALL
AC_PROG_AWK
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
if test "$GXX" != "yes"; 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
AC_CHECK_PROG(BISON, bison,yes,no)
if test "x$BISON" = "xno";
then
AC_MSG_ERROR([You need to install bison])
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])
# Always make .bat files when building classlibs
AM_CONDITIONAL(USE_BATCH_FILES, [test x$enable_mcs_build != xno])
# AM_CONDITIONAL(USE_BATCH_FILES, [test x$platform_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_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)
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)
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>], [
void main () {
#if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
}
#else
#error No good zlib found
#endif
],[
AC_MSG_RESULT(Using system zlib)
zlib_msg="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)
])
# not 64 bit clean in cross-compile
AC_CHECK_SIZEOF(void *, 4)
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'
# 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([], [
void main () { }
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
CFLAGS=$ORIG_CFLAGS
])
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 $WARN"
CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC "
# Where's the 'mcs' source tree?
if test -d $srcdir/mcs; then
mcsdir=mcs
else
mcsdir=../mcs
fi
#
# 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 $srcdir/$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
mcs_topdir='$(top_srcdir)/'$mcsdir
mcs_topdir_from_srcdir='$(top_builddir)/'$mcsdir
## Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
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])
#Lucas disabled the pkg-config configure check, as we build an eglib-mono, which means that
#we actually don't need pkgconfig to find anything for us anymore. woohoo! mono with no deps.
#
OS=`uname`
if test "x$OS" = "xLinux"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
if test "x$PKG_CONFIG" = "xno"; then
AC_MSG_ERROR([You need to install pkg-config])
fi
fi
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_ARG_WITH([glib],
[ --with-glib=embedded|system Choose glib API: system or embedded (default to system)],
[], [with_glib=system])
eglib_dir=
case $with_glib in
embedded)
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"
eglib_dir=eglib
#need to talk to kangaroo about what the right fix is here. eglib was being compiled against 10.6sdk, but linekd against 10.4
#causing _file$INODE64 symbols that dont exist in 10.4 to fail. this should be made configurable with the --with-macversion argument
case "$host" in
i*86-apple-darwin* | x86_64-*-darwin* | powerpc-apple-darwin* )
EGLIB_CPPFLAGS="$MACSDKOPTIONS"
CLAGS_FOR_EGLIB="$EGLIB_CPPFLAGS"
esac
ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
AC_CONFIG_SUBDIRS(eglib)
;;
system)
if test "x$cross_compiling" = "xyes"; then
pkg_config_path="$PKG_CONFIG_PATH"
unset PKG_CONFIG_PATH
fi
BUILD_GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
BUILD_GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
if test "x$cross_compiling" = "xyes"; then
PKG_CONFIG_PATH=$pkg_config_path
export PKG_CONFIG_PATH
fi
## Versions of dependencies
GLIB_REQUIRED_VERSION=2.4.0
dnl
dnl No, you will not replace this check with a pkg.m4 check
dnl
if $PKG_CONFIG --atleast-version=$GLIB_REQUIRED_VERSION glib-2.0; then
GLIB_CFLAGS=`$PKG_CONFIG --cflags glib-2.0 gthread-2.0`
GLIB_LIBS=`$PKG_CONFIG --libs glib-2.0 gthread-2.0`
GMODULE_CFLAGS=`$PKG_CONFIG --cflags gmodule-2.0`
GMODULE_LIBS=`$PKG_CONFIG --libs gmodule-2.0`
else
AC_MSG_ERROR([You need at least glib-2.0 $GLIB_REQUIRED_VERSION])
fi
;;
*)
AC_MSG_ERROR([Invalid argument to --with-glib.])
esac
AM_CONDITIONAL(EGLIB_BUILD, test x$with_glib = xembedded)
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_SUBST(eglib_dir)
if test x$cross_compiling$platform_win32 = xnoyes; then
AC_MSG_CHECKING(for cygwin glib2-dev package)
if [ cygcheck --f /usr/lib/libglib-2.0.dll.a | grep -q glib2-devel ]; then
AC_MSG_RESULT(found)
AC_MSG_ERROR([Mono cannot be built with the cygwin glib2-devel package installed, because that package doesn't work with -mno-cygwin. Please uninstall it then re-run configure.])
else
AC_MSG_RESULT(not found, ok)
fi
AC_MSG_CHECKING(for broken gwin32.h)
glib_include=`$PKG_CONFIG --cflags-only-I glib-2.0 | sed -e 's/ -I.*//g' | sed -e 's/-I//g'`
if test -f $glib_include/glib/gwin32.h; then
if [ grep ftruncate $glib_include/glib/gwin32.h | grep -q define ]; then
AC_MSG_RESULT(failed)
hashmark='#'
AC_MSG_ERROR([Your version of gwin32.h is broken and will cause compilation errors when building mono. Please fix it by deleting the line: '$hashmark define ftruncate...' from '$glib_include/glib/gwin32.h' then re-run configure.])
fi
fi
AC_MSG_RESULT(ok)
fi
AC_ARG_WITH(gc, [ --with-gc=boehm,included,none Defaults to 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])
if test "x$enable_static" = "xno"; then
with_static_mono=no
fi
if test "x$platform_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)
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"; 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([], [
void main () { }
], [
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(quiet-build, [ --enable-quiet-build Enable quiet runtime build (on by default)], enable_quiet_build=$enableval, enable_quiet_build=yes)
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,
reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization.],
[
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_normalization" = "xyes"; then
AC_DEFINE(DISABLE_NORMALIZATION, 1, [Disable String normalization support.])
AC_MSG_NOTICE([Disabled String normalization support.])
fi
AC_MSG_CHECKING(for visibility __attribute__)
AC_TRY_COMPILE([], [
void __attribute__ ((visibility ("hidden"))) doit (void) {}
void main () { doit (); }
], [
have_visibility_hidden=yes
AC_MSG_RESULT(yes)
], [
have_visibility_hidden=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
LIBGC_CFLAGS=
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
AC_DEFINE(HAVE_BOEHM_GC, 1, [Have Boehm GC])
AC_SUBST(HAVE_BOEHM_GC)
LIBGC_LIBS="-lgc $libdl"
LIBGC_STATIC_LIBS="$LIBGC_LIBS"
libmono_ldflags="$libmono_ldflags -lgc"
# 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
AC_DEFINE(HAVE_GC_GCJ_MALLOC, 1, [Have GC_gcj_malloc])
AC_DEFINE_UNQUOTED(USED_GC_NAME, "System Boehm (with typed GC)", [GC description])
else
AC_DEFINE_UNQUOTED(USED_GC_NAME, "System Boehm (no typed GC)", [GC description])
fi
AC_CHECK_LIB(gc, GC_enable, found_gc_enable="yes",,$libdl)
if test "x$found_gc_enable" = "xyes"; then
AC_DEFINE(HAVE_GC_ENABLE, 1, [Have 'GC_enable'])
fi
;;
xincluded)
found_boehm=yes
gc_headers=yes
use_included_gc=yes
libgc_dir=libgc
LIBGC_CFLAGS='-I$(top_srcdir)/libgc/include'
LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
AC_DEFINE(HAVE_BOEHM_GC, 1, [Have Boehm GC])
AC_SUBST(HAVE_BOEHM_GC)
AC_DEFINE(HAVE_GC_H, 1, [Have gc.h])
AC_DEFINE(USE_INCLUDED_LIBGC, 1, [Use included libgc])
# The included libgc contains GCJ support
AC_DEFINE(HAVE_GC_GCJ_MALLOC, 1, [Have GC_gcj_malloc])
AC_DEFINE(HAVE_GC_ENABLE, 1, [Have GC_enable])
if test x$enable_parallel_mark = xyes; then
AC_DEFINE_UNQUOTED(USED_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
else
AC_DEFINE_UNQUOTED(USED_GC_NAME, "Included Boehm (with typed GC)", [GC description])
fi
;;
xsgen)
found_boehm=no
gc_headers=no
use_included_gc=no
AC_DEFINE(HAVE_SGEN_GC,1,[Using the simple generational GC.])
AC_DEFINE(HAVE_MOVING_COLLECTOR,1,[The GC can move objects.])
AC_DEFINE(HAVE_WRITE_BARRIERS,1,[The GC needs write barriers.])
AC_DEFINE_UNQUOTED(USED_GC_NAME, "Simple generational", [GC description])
;;
xnone)
AC_MSG_WARN("Compiling mono without GC.")
AC_DEFINE_UNQUOTED(USED_GC_NAME, "none", [GC description])
AC_DEFINE(HAVE_NULL_GC,1,[No GC support.])
;;
*)
AC_MSG_ERROR([Invalid argument to --with-gc.])
;;
esac
AC_ARG_WITH(large-heap, [ --with-large-heap=yes,no Enable support for GC heaps larger than 3GB (defaults to no)], [large_heap=$withval], [large_heap=no])
if test "x$large_heap" = "xyes"; then
echo "FOO"
CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
fi
AM_CONDITIONAL(INCLUDED_LIBGC, test x$use_included_gc = xyes)
AC_SUBST(LIBGC_CFLAGS)
AC_SUBST(LIBGC_LIBS)
AC_SUBST(LIBGC_STATIC_LIBS)
AC_SUBST(libgc_dir)
dnl
dnl End of libgc checks
dnl
if test x$platform_win32 = xno; then
dnl hires monotonic clock support
AC_SEARCH_LIBS(clock_gettime, rt)
dnl dynamic loader support
AC_CHECK_FUNC(dlopen, DL_LIB="",
AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", dl_support=no)
)
if test x$dl_support = xno; then
AC_MSG_WARN([No dynamic loading support available])
else
LIBS="$LIBS $DL_LIB"
AC_DEFINE(HAVE_DL_LOADER,1,[dlopen-based dynamic loader available])
dnl from glib's configure.in
AC_CACHE_CHECK([for preceeding underscore in symbols],
mono_cv_uscore,[
AC_TRY_RUN([#include <dlfcn.h>
int mono_underscore_test (void) { return 42; }
int main() {
void *f1 = (void*)0, *f2 = (void*)0, *handle;
handle = dlopen ((void*)0, 0);
if (handle) {
f1 = dlsym (handle, "mono_underscore_test");
f2 = dlsym (handle, "_mono_underscore_test");
} return (!f2 || f1);
}],
[mono_cv_uscore=yes],
[mono_cv_uscore=no],
[])
])
if test "x$mono_cv_uscore" = "xyes"; then
MONO_DL_NEED_USCORE=1
else
MONO_DL_NEED_USCORE=0
fi
AC_SUBST(MONO_DL_NEED_USCORE)
AC_CHECK_FUNC(dlerror)
fi
dnl ******************************************************************
dnl *** Checks for the IKVM JNI interface library ***
dnl ******************************************************************
AC_ARG_WITH(ikvm-native, [ --with-ikvm-native=yes,no build the IKVM JNI interface library (defaults to yes)],[with_ikvm_native=$withval],[with_ikvm_native=yes])
ikvm_native_dir=
if test x$with_ikvm_native = xyes; then
ikvm_native_dir=ikvm-native
jdk_headers_found="IKVM Native"
fi
AC_SUBST(ikvm_native_dir)
AC_CHECK_HEADERS(execinfo.h)
AC_CHECK_FUNCS(getgrgid_r)
AC_CHECK_FUNCS(getgrnam_r)
AC_CHECK_FUNCS(getpwnam_r)
AC_CHECK_FUNCS(getpwuid_r)
AC_CHECK_FUNCS(getresuid)
AC_CHECK_FUNCS(setresuid)
AC_CHECK_FUNCS(kqueue)
AC_CHECK_FUNCS(backtrace_symbols)
AC_CHECK_FUNCS(mkstemp)
AC_CHECK_FUNCS(mmap)
AC_CHECK_FUNCS(madvise)
AC_CHECK_FUNCS(getrusage)
AC_CHECK_FUNCS(getpriority)
AC_CHECK_FUNCS(setpriority)
AC_CHECK_FUNCS(sched_setaffinity)
dnl ****************************************************************
dnl *** Check for sched_setaffinity from glibc versions before ***
dnl *** 2.3.4. The older versions of the function only take 2 ***
dnl *** parameters, not 3. ***
dnl *** ***
dnl *** Because the interface change was not made in a minor ***
dnl *** version rev, the __GLIBC__ and __GLIBC_MINOR__ macros ***
dnl *** won't always indicate the interface sched_affinity has. ***