configure.ac 135 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574
  1. # Process this file with autoconf to produce a configure script.
  2. #AC_PREREQ([2.62])
  3. AC_INIT(mono, [5.4.0],
  4. [http://bugzilla.xamarin.com/enter_bug.cgi?classification=Mono])
  5. AC_CONFIG_SRCDIR([README.md])
  6. AC_CONFIG_MACRO_DIR([m4])
  7. AC_CANONICAL_SYSTEM
  8. AC_CANONICAL_HOST
  9. # Gross hack to enable 'make dist' on automake 1.9+tar 1.14.
  10. # The extra brackets are to foil regex-based scans.
  11. m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
  12. AM_INIT_AUTOMAKE([1.9 dist-bzip2 tar-ustar no-dist-gzip foreign subdir-objects]
  13. m4_esyscmd([case `automake --version | head -n 1` in # parallel-tests is default in automake 1.13+, we need to explicitly enable it
  14. *1.11*|*1.12*) echo parallel-tests;; # for 1.11 and 1.12 but not below as those versions don't recognize the flag
  15. esac])) # TODO: remove this hack once we require automake 1.11+
  16. AC_CONFIG_HEADERS([config.h])
  17. AM_MAINTAINER_MODE
  18. API_VER=2.0
  19. AC_SUBST(API_VER)
  20. AC_PROG_LN_S
  21. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  22. MONO_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
  23. MONO_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
  24. MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
  25. # This is the version number of the corlib-runtime interface. When
  26. # making changes to this interface (by changing the layout
  27. # of classes the runtime knows about, changing icall signature or
  28. # semantics etc), increment this variable.
  29. #
  30. # This can be reset to 0 when Mono's version number is bumped
  31. # since it's part of the corlib version (the prefix '1' in the full
  32. # version number is to ensure the number isn't treated as octal in C)
  33. MONO_CORLIB_COUNTER=3
  34. MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR 0 $MONO_CORLIB_COUNTER`
  35. AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
  36. AC_SUBST(MONO_CORLIB_VERSION)
  37. case $host_os in
  38. *cygwin* )
  39. echo "Run configure using ./configure --host=i686-pc-mingw32"
  40. exit 1
  41. esac
  42. # In case of cygwin, override LN_S, irrespective of what it determines.
  43. # The build uses cygwin, but the actual runtime doesn't.
  44. case $host_os in
  45. *cygwin* ) LN_S='cp -p';;
  46. esac
  47. #
  48. # libgc defaults
  49. #
  50. libgc_configure_args=
  51. # These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
  52. # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
  53. CPPFLAGS_FOR_LIBGC=$CPPFLAGS
  54. CFLAGS_FOR_LIBGC=$CFLAGS
  55. CPPFLAGS_FOR_EGLIB=$CPPFLAGS
  56. CFLAGS_FOR_EGLIB=$CFLAGS
  57. CPPFLAGS_FOR_BTLS=$CPPFLAGS
  58. CFLAGS_FOR_BTLS=$CFLAGS
  59. # libgc uses some deprecated APIs
  60. CFLAGS_FOR_LIBGC="$CFLAGS -Wno-deprecated-declarations"
  61. #
  62. # These are the flags that need to be stored in the mono.pc file for
  63. # compiling code that will embed Mono
  64. #
  65. libmono_cflags=""
  66. libmono_ldflags=""
  67. AC_SUBST(libmono_cflags)
  68. AC_SUBST(libmono_ldflags)
  69. # Variable to have relocatable .pc files (lib, or lib64)
  70. # realpath isn't always available, and requires that all but the tip of the provided
  71. # path exists. Fall back to the old behaviour, but realpath allows depth >1
  72. # e.g. Debian puts Mono in /usr/bin and libs in /usr/lib/x86_64-linux-gnu/ which is
  73. # too deep for the old method to work
  74. reloc_libdir=`realpath --relative-to=${prefix} ${libdir} 2> /dev/null || basename ${libdir}`
  75. AC_SUBST(reloc_libdir)
  76. # Set to yes if Unix sockets cannot be created in an anonymous namespace
  77. need_link_unlink=no
  78. #Set to extra linker flags to be passed to the runtime binaries (mono /mono-sgen)
  79. extra_runtime_ldflags=""
  80. # Thread configuration inspired by sleepycat's db
  81. AC_MSG_CHECKING([host platform characteristics])
  82. libgc_threads=no
  83. has_dtrace=no
  84. parallel_mark=yes
  85. ikvm_native=yes
  86. host_win32=no
  87. target_win32=no
  88. platform_android=no
  89. host_darwin=no
  90. case "$host" in
  91. *-mingw*|*-*-cygwin*)
  92. AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
  93. AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
  94. host_win32=yes
  95. mono_cv_clang=no
  96. if test "x$cross_compiling" = "xno"; then
  97. if test "x$host" = "x$build" -a "x$host" = "x$target"; then
  98. target_win32=yes
  99. fi
  100. else
  101. if test "x$host" = "x$target"; then
  102. target_win32=yes
  103. fi
  104. fi
  105. HOST_CC="gcc"
  106. # Windows Vista or later is required
  107. CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
  108. LDFLAGS="$LDFLAGS -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32 -liphlpapi"
  109. libmono_cflags="-mms-bitfields -mwindows"
  110. libmono_ldflags="-mms-bitfields -mwindows"
  111. libdl=
  112. libgc_threads=win32
  113. with_sigaltstack=no
  114. with_tls=pthread
  115. with_sgen_default_concurrent=yes
  116. LN_S=cp
  117. # This forces libgc to use the DllMain based thread registration code on win32
  118. libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
  119. ;;
  120. *-*-*netbsd*)
  121. CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
  122. libmono_cflags="-D_REENTRANT"
  123. LDFLAGS="$LDFLAGS -pthread"
  124. CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
  125. libmono_ldflags="-pthread"
  126. need_link_unlink=yes
  127. libdl="-ldl"
  128. libgc_threads=pthreads
  129. with_sigaltstack=no
  130. use_sigposix=yes
  131. with_sgen_default_concurrent=yes
  132. ;;
  133. *-*-kfreebsd*-gnu)
  134. CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
  135. libmono_cflags="-D_REENTRANT -DTHREAD_LOCAL_ALLOC -pthread"
  136. libmono_ldflags="-lpthread -pthread"
  137. libdl="-ldl"
  138. libgc_threads=pthreads
  139. need_link_unlink=yes
  140. with_sigaltstack=no
  141. use_sigposix=yes
  142. with_sgen_default_concurrent=yes
  143. ;;
  144. *-*-*freebsd*)
  145. if test "x$PTHREAD_CFLAGS" = "x"; then
  146. CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
  147. libmono_cflags=
  148. else
  149. CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
  150. libmono_cflags="$PTHREAD_CFLAGS"
  151. fi
  152. if test "x$PTHREAD_LIBS" = "x"; then
  153. LDFLAGS="$LDFLAGS -pthread -L/usr/local/lib"
  154. libmono_ldflags="-pthread"
  155. else
  156. LDFLAGS="$LDFLAGS $PTHREAD_LIBS -L/usr/local/lib"
  157. libmono_ldflags="$PTHREAD_LIBS"
  158. fi
  159. CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
  160. need_link_unlink=yes
  161. AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
  162. libdl=
  163. libgc_threads=pthreads
  164. use_sigposix=yes
  165. has_dtrace=yes
  166. with_sgen_default_concurrent=yes
  167. ;;
  168. *-*-*openbsd*)
  169. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_REENTRANT -DUSE_MMAP"
  170. if test "x$disable_munmap" != "xyes"; then
  171. CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
  172. fi
  173. libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
  174. LDFLAGS="$LDFLAGS -pthread"
  175. need_link_unlink=yes
  176. AC_DEFINE(PTHREAD_POINTER_ID)
  177. libdl=
  178. libgc_threads=pthreads
  179. with_sigaltstack=no
  180. use_sigposix=yes
  181. with_sgen_default_concurrent=yes
  182. ;;
  183. *-*-linux-android*)
  184. platform_android=yes
  185. AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
  186. AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
  187. CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
  188. if test "x$disable_munmap" != "xyes"; then
  189. CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
  190. fi
  191. libmono_cflags="-D_REENTRANT"
  192. libdl="-ldl"
  193. libgc_threads=pthreads
  194. use_sigposix=yes
  195. with_tls=pthread
  196. with_sigaltstack=no
  197. with_static_mono=no
  198. # Android doesn't support boehm, as it's missing <link.h>
  199. support_boehm=no
  200. with_gc=sgen
  201. # isinf(3) requires -lm; see isinf check below
  202. LDFLAGS="$LDFLAGS -lm"
  203. # Bionic's <pthread.h> sets PTHREAD_STACK_MIN=2*PAGE_SIZE; doesn't define
  204. # PAGE_SIZE; breaks mono/io-layer/collection.c
  205. # Bionic doesn't provide S_IWRITE; breaks io-layer/io.c
  206. CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
  207. CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
  208. # to bypass the underscore linker check, can't work when cross-compiling
  209. mono_cv_uscore=yes
  210. mono_cv_clang=no
  211. ;;
  212. *-*-linux*)
  213. CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
  214. if test "x$disable_munmap" != "xyes"; then
  215. CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
  216. fi
  217. libmono_cflags="-D_REENTRANT"
  218. libdl="-ldl"
  219. libgc_threads=pthreads
  220. use_sigposix=yes
  221. if test "x$cross_compiling" != "xno"; then
  222. # to bypass the underscore linker check, not
  223. # available during cross-compilation
  224. mono_cv_uscore=no
  225. fi
  226. case "$host" in
  227. aarch64-*)
  228. support_boehm=no
  229. with_gc=sgen
  230. ;;
  231. powerpc*-*-linux*)
  232. # https://bugzilla.novell.com/show_bug.cgi?id=504411
  233. disable_munmap=yes
  234. ;;
  235. esac
  236. with_sgen_default_concurrent=yes
  237. ;;
  238. *-*-nacl*)
  239. echo "nacl no longer supported."
  240. exit 1
  241. ;;
  242. *-*-hpux*)
  243. CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
  244. # +ESdbgasm only valid on bundled cc on RISC
  245. # silently ignored for ia64
  246. if test $GCC != "yes"; then
  247. CFLAGS="$CFLAGS +ESdbgasm"
  248. # Arrange for run-time dereferencing of null
  249. # pointers to produce a SIGSEGV signal.
  250. LDFLAGS="$LDFLAGS -z"
  251. fi
  252. CFLAGS="$CFLAGS +ESdbgasm"
  253. LDFLAGS="$LDFLAGS -z"
  254. libmono_cflags="-D_REENTRANT"
  255. libmono_ldflags="-lpthread"
  256. libgc_threads=pthreads
  257. need_link_unlink=yes
  258. use_sigposix=yes
  259. ;;
  260. *-*-solaris*)
  261. CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS"
  262. need_link_unlink=yes
  263. libmono_cflags="-D_REENTRANT"
  264. libgc_threads=pthreads
  265. has_dtrace=yes
  266. use_sigposix=yes
  267. enable_solaris_tar_check=yes
  268. ;;
  269. *-*-darwin*)
  270. parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
  271. host_darwin=yes
  272. target_mach=yes
  273. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
  274. libmono_cflags="-D_THREAD_SAFE"
  275. need_link_unlink=yes
  276. AC_DEFINE(PTHREAD_POINTER_ID)
  277. AC_DEFINE(USE_MACH_SEMA, 1, [...])
  278. libdl=
  279. libgc_threads=pthreads
  280. has_dtrace=yes
  281. if test "x$cross_compiling" = "xyes"; then
  282. has_broken_apple_cpp=yes
  283. fi
  284. dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin*, but
  285. dnl its gcc defaults to 64-bit mode. They have also deprecated the usage of ucontext
  286. dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
  287. case "$host" in
  288. dnl Snow Leopard and newer config.guess reports as this
  289. i*86-*-darwin*)
  290. BROKEN_DARWIN_FLAGS="-arch i386 -D_XOPEN_SOURCE"
  291. BROKEN_DARWIN_CPPFLAGS="-D_XOPEN_SOURCE"
  292. CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_CPPFLAGS"
  293. CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
  294. CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
  295. CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
  296. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_CPPFLAGS"
  297. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
  298. CPPFLAGS_FOR_EGLIB="$CPPFLAGS_FOR_EGLIB $BROKEN_DARWIN_CPPFLAGS"
  299. CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB $BROKEN_DARWIN_FLAGS"
  300. with_sgen_default_concurrent=yes
  301. ;;
  302. x*64-*-darwin*)
  303. with_sgen_default_concurrent=yes
  304. ;;
  305. arm*-darwin*)
  306. has_dtrace=no
  307. ;;
  308. esac
  309. ;;
  310. *-*-haiku*)
  311. CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_THREAD_SAFE"
  312. libmono_cflags="-D_REENTRANT -D_THREAD_SAFE"
  313. libdl=
  314. LIBS="$LIBS -lnetwork -ltextencoding"
  315. need_link_unlink=yes
  316. AC_DEFINE(PTHREAD_POINTER_ID)
  317. dnl Haiku does not support static TLS with __thread
  318. with_tls=pthread
  319. dnl Boehm is too much work to backport Haiku support for
  320. support_boehm=no
  321. libgc_threads=pthreads
  322. use_sigposix=yes
  323. ;;
  324. *)
  325. AC_MSG_WARN([*** Please add $host to configure.ac checks!])
  326. libdl="-ldl"
  327. ;;
  328. esac
  329. AC_MSG_RESULT(ok)
  330. if test x$need_link_unlink = xyes; then
  331. AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
  332. fi
  333. if test x$host_win32 = xyes; then
  334. AC_DEFINE(HOST_WIN32, 1, [Host Platform is Win32])
  335. fi
  336. if test x$target_win32 = xyes; then
  337. AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
  338. fi
  339. # Defined for all targets/platforms using classic Windows API support.
  340. AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
  341. AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
  342. AC_SUBST(extra_runtime_ldflags)
  343. AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
  344. AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
  345. AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
  346. AM_CONDITIONAL(PLATFORM_DARWIN, test x$host_darwin = xyes)
  347. AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
  348. AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
  349. if test -z "$PLATFORM_DARWIN_TRUE"; then :
  350. PLATFORM_AOT_SUFFIX=.dylib
  351. fi
  352. if test -z "$PLATFORM_LINUX_TRUE"; then :
  353. PLATFORM_AOT_SUFFIX=.so
  354. fi
  355. if test -z "$HOST_WIN32_TRUE"; then :
  356. PLATFORM_AOT_SUFFIX=.dll
  357. fi
  358. AC_SUBST(PLATFORM_AOT_SUFFIX)
  359. ## PLATFORM_AOT_SUFFIX not so simple for windows :-)
  360. AC_CHECK_TOOL(CC, gcc, gcc)
  361. AC_PROG_CC
  362. AC_CHECK_TOOL(CXX, g++, g++)
  363. AC_PROG_CXX
  364. AM_PROG_AS
  365. AC_PROG_INSTALL
  366. AC_PROG_AWK
  367. AM_PROG_CC_C_O
  368. dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
  369. : ${CCAS='$(CC)'}
  370. # Set ASFLAGS if not already set.
  371. : ${CCASFLAGS='$(CFLAGS)'}
  372. AC_SUBST(CCAS)
  373. AC_SUBST(CCASFLAGS)
  374. # AC_PROG_CXX helpfully sets CXX to g++ even if no c++ compiler is found so check
  375. # GXX instead. See http://lists.gnu.org/archive/html/bug-autoconf/2002-04/msg00056.html
  376. if test "x$CXX" = "xg++"; then
  377. if test "x$GXX" != "xyes"; then
  378. # automake/libtool is so broken, it requires g++ even if the c++ sources
  379. # are inside automake conditionals
  380. AC_MSG_ERROR([You need to install g++])
  381. fi
  382. fi
  383. dnl may require a specific autoconf version
  384. dnl AC_PROG_CC_FOR_BUILD
  385. dnl CC_FOR_BUILD not automatically detected
  386. CC_FOR_BUILD=$CC
  387. CFLAGS_FOR_BUILD=$CFLAGS
  388. BUILD_EXEEXT=
  389. if test "x$cross_compiling" = "xyes"; then
  390. CC_FOR_BUILD=cc
  391. CFLAGS_FOR_BUILD=
  392. BUILD_EXEEXT=""
  393. fi
  394. AC_SUBST(CC_FOR_BUILD)
  395. AC_SUBST(CFLAGS_FOR_BUILD)
  396. AC_SUBST(HOST_CC)
  397. AC_SUBST(BUILD_EXEEXT)
  398. AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
  399. AM_CONDITIONAL(USE_BATCH_FILES, [test x$host_win32 = xyes -a x$cross_compiling = xyes])
  400. # Set STDC_HEADERS
  401. AC_HEADER_STDC
  402. AC_LIBTOOL_WIN32_DLL
  403. # This causes monodis to not link correctly
  404. #AC_DISABLE_FAST_INSTALL
  405. #lookup makedev() header
  406. AC_HEADER_MAJOR
  407. AM_PROG_LIBTOOL
  408. # Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
  409. DOLT
  410. export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
  411. AC_SUBST(export_ldflags)
  412. # Test whenever ld supports -version-script
  413. AC_PROG_LD
  414. AC_PROG_LD_GNU
  415. AM_ICONV()
  416. 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 sys/sysctl.h libproc.h sys/prctl.h)
  417. AC_CHECK_HEADERS(sys/param.h sys/socket.h sys/ipc.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 arpa/inet.h complex.h unwind.h)
  418. AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
  419. [], [], [#include <stddef.h>
  420. #include <sys/socket.h>
  421. #include <linux/socket.h>])
  422. AC_CHECK_HEADERS(sys/user.h, [], [],
  423. [
  424. #ifdef HAVE_SYS_PARAM_H
  425. # include <sys/param.h>
  426. #endif
  427. ])
  428. AC_CHECK_HEADERS(linux/serial.h)
  429. AC_CHECK_HEADER(zlib.h, [have_zlib=yes], [have_zlib=no])
  430. if test x$have_zlib = xyes; then
  431. AC_TRY_COMPILE([#include <zlib.h>], [
  432. #if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
  433. return 0;
  434. #else
  435. #error No good zlib found
  436. #endif
  437. ],[
  438. AC_MSG_RESULT(Using system zlib)
  439. zlib_msg="system zlib"
  440. AC_DEFINE(HAVE_SYS_ZLIB,1,[Have system zlib])
  441. ],[
  442. AC_MSG_RESULT(Using embedded zlib)
  443. have_zlib=no
  444. zlib_msg="bundled zlib"
  445. ])
  446. fi
  447. AM_CONDITIONAL(HAVE_ZLIB, test x$have_zlib = xyes)
  448. AC_DEFINE(HAVE_ZLIB,1,[Have system zlib])
  449. # for mono/metadata/debug-symfile.c
  450. AC_CHECK_HEADERS(elf.h)
  451. # for support
  452. AC_CHECK_HEADERS(poll.h)
  453. AC_CHECK_HEADERS(sys/poll.h)
  454. AC_CHECK_HEADERS(sys/wait.h)
  455. AC_CHECK_HEADERS(grp.h)
  456. AC_CHECK_HEADERS(syslog.h)
  457. # for mono/dis
  458. AC_CHECK_HEADERS(wchar.h)
  459. AC_CHECK_HEADERS(ieeefp.h)
  460. AC_MSG_CHECKING(for isinf)
  461. AC_TRY_LINK([#include <math.h>], [
  462. int f = isinf (1.0);
  463. ], [
  464. AC_MSG_RESULT(yes)
  465. AC_DEFINE(HAVE_ISINF, 1, [isinf available])
  466. ], [
  467. # We'll have to use signals
  468. AC_MSG_RESULT(no)
  469. ])
  470. # mingw
  471. AC_CHECK_FUNCS(_finite, , AC_MSG_CHECKING(for _finite in math.h)
  472. AC_TRY_LINK([#include <math.h>],
  473. [ _finite(0.0); ],
  474. AC_DEFINE(HAVE__FINITE, 1, [Have _finite in -lm]) AC_MSG_RESULT(yes),
  475. AC_MSG_RESULT(no)))
  476. # for Linux statfs support
  477. AC_CHECK_HEADERS(linux/magic.h)
  478. # not 64 bit clean in cross-compile
  479. AC_CHECK_SIZEOF(void *, 4)
  480. AC_CACHE_CHECK([for clang],
  481. mono_cv_clang,[
  482. AC_TRY_COMPILE([], [
  483. #ifdef __clang__
  484. #else
  485. #error "FAILED"
  486. #endif
  487. return 0;
  488. ],
  489. [mono_cv_clang=yes],
  490. [mono_cv_clang=no],
  491. [])
  492. ])
  493. AC_ARG_ENABLE(visibility-hidden,
  494. [ --disable-visibility-hidden disable usage of -fvisiblity=hidden],
  495. disable_visibility_hidden=yes, disable_visibility_hidden=no)
  496. WARN=''
  497. if test x"$GCC" = xyes; then
  498. 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 -Wno-attributes -Wno-format-zero-length'
  499. # We require C99 with some GNU extensions, e.g. `linux` macro
  500. CFLAGS="$CFLAGS -std=gnu99"
  501. # The runtime code does not respect ANSI C strict aliasing rules
  502. CFLAGS="$CFLAGS -fno-strict-aliasing"
  503. # We rely on signed overflow to behave
  504. CFLAGS="$CFLAGS -fwrapv"
  505. CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
  506. if test x"$disable_visibility_hidden" = xno; then
  507. # Don't export any symbols by default
  508. SHARED_CFLAGS="-fvisibility=hidden"
  509. CFLAGS_FOR_EGLIB="$CFLAGS_FOR_EGLIB -fvisibility=hidden"
  510. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  511. fi
  512. ORIG_CFLAGS=$CFLAGS
  513. # Check for the normal version, since gcc ignores unknown -Wno options
  514. CFLAGS="$CFLAGS -Wunused-but-set-variable -Werror"
  515. AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
  516. AC_TRY_COMPILE([],[
  517. return 0;
  518. ], [
  519. AC_MSG_RESULT(yes)
  520. CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
  521. ], [
  522. AC_MSG_RESULT(no)
  523. CFLAGS=$ORIG_CFLAGS
  524. ])
  525. if test "x$mono_cv_clang" = "xyes"; then
  526. # https://bugzilla.samba.org/show_bug.cgi?id=8118
  527. WARN="$WARN -Qunused-arguments"
  528. WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand"
  529. # We rely on zero length arrays in structs
  530. WARN="$WARN -Wno-zero-length-array"
  531. fi
  532. else
  533. # The Sun Forte compiler complains about inline functions that access static variables
  534. # so disable all inlining.
  535. case "$host" in
  536. *-*-solaris*)
  537. CFLAGS="$CFLAGS -Dinline="
  538. ;;
  539. esac
  540. fi
  541. CFLAGS="$CFLAGS -g $WARN"
  542. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -g"
  543. CPPFLAGS="$CPPFLAGS -g $WARN"
  544. # Where's the 'mcs' source tree?
  545. if test -d $srcdir/mcs; then
  546. mcsdir=mcs
  547. else
  548. mcsdir=../mcs
  549. fi
  550. AC_ARG_WITH(mcs-path, [ --with-mcs-path=/path/to/mcs Specify an alternate mcs source tree],
  551. if test x$with_mcs_path != "x" -a -d $with_mcs_path ; then
  552. mcsdir=$with_mcs_path
  553. fi
  554. )
  555. AC_ARG_WITH(jumptables, [ --with-jumptables=yes,no enable/disable support for jumptables (ARM-only for now) (defaults to no)],[],[with_jumptables=no])
  556. #
  557. # A sanity check to catch cases where the package was unpacked
  558. # with an ancient tar program (Solaris)
  559. #
  560. AC_ARG_ENABLE(solaris-tar-check,
  561. [ --disable-solaris-tar-check disable solaris tar check],
  562. do_solaris_tar_check=no, do_solaris_tar_check=yes)
  563. if test x"$do_solaris_tar_check" = xyes -a x"$enable_solaris_tar_check" = xyes; then
  564. AC_MSG_CHECKING(integrity of package)
  565. if test -f $mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
  566. then
  567. AC_MSG_RESULT(ok)
  568. else
  569. 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"
  570. AC_MSG_ERROR([$errorm])
  571. fi
  572. fi
  573. if test "x$with_mcs_path" != "x"; then
  574. mcs_topdir=$(cd "$mcsdir" && pwd)
  575. mcs_topdir_from_srcdir=$mcs_topdir
  576. else
  577. mcs_topdir=$(cd "$srcdir/$mcsdir" && pwd)
  578. mcs_topdir_from_srcdir='$(top_builddir)'/$mcsdir
  579. fi
  580. # Convert mcs_topdir* paths to Windows syntax.
  581. if test x$cross_compiling$host_win32 = xnoyes; then
  582. mcs_topdir=$(cygpath -m $mcs_topdir)
  583. case $mcs_topdir_from_srcdir in
  584. /cygdrive/*)
  585. mcs_topdir_from_srcdir=$(cygpath -m $mcs_topdir_from_srcdir)
  586. ;;
  587. esac
  588. fi
  589. AC_SUBST([mcs_topdir])
  590. AC_SUBST([mcs_topdir_from_srcdir])
  591. # gettext: prepare the translation directories.
  592. # we do not configure the full gettext, as we consume it dynamically from C#
  593. AM_PO_SUBDIRS
  594. if test "x$USE_NLS" = "xyes"; then
  595. AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
  596. if test "x$HAVE_MSGFMT" = "xno"; then
  597. AC_MSG_ERROR([msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure.])
  598. fi
  599. fi
  600. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  601. pkg_config_path=
  602. AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
  603. if test x$with_crosspkgdir = "x"; then
  604. if test -s $PKG_CONFIG_PATH; then
  605. pkg_config_path=$PKG_CONFIG_PATH
  606. fi
  607. else
  608. pkg_config_path=$with_crosspkgdir
  609. PKG_CONFIG_PATH=$pkg_config_path
  610. export PKG_CONFIG_PATH
  611. fi
  612. )
  613. AC_ARG_ENABLE(werror, [ --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
  614. if test x$werror_flag = xyes; then
  615. WERROR_CFLAGS="-Werror"
  616. fi
  617. AC_SUBST([WERROR_CFLAGS])
  618. AC_SUBST([SHARED_CFLAGS])
  619. ac_configure_args="$ac_configure_args \"CPPFLAGS_FOR_EGLIB=$EGLIB_CPPFLAGS\" \"CFLAGS_FOR_EGLIB=$CFLAGS_FOR_EGLIB\""
  620. AC_CONFIG_SUBDIRS(eglib)
  621. GLIB_CFLAGS='-I$(top_srcdir)/eglib/src -I$(top_builddir)/eglib/src'
  622. GLIB_LIBS='-L$(top_builddir)/eglib/src -leglib -lm'
  623. AC_SUBST(GLIB_CFLAGS)
  624. AC_SUBST(GLIB_LIBS)
  625. # Enable support for fast thread-local storage
  626. # Some systems have broken support, so we allow to disable it.
  627. AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation (defaults to __thread)],[],[with_tls=__thread])
  628. # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
  629. # This does not work on some platforms (bug #55253)
  630. AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack (defaults to yes)],[],[with_sigaltstack=yes])
  631. AC_ARG_WITH(static_mono, [ --with-static_mono=yes,no link mono statically to libmono (faster) (defaults to yes)],[],[with_static_mono=yes])
  632. AC_ARG_WITH(shared_mono, [ --with-shared_mono=yes,no build a shared libmono library (defaults to yes)],[],[with_shared_mono=yes])
  633. # Same as --with-shared_mono=no
  634. AC_ARG_ENABLE(libraries, [ --disable-libraries disable the build of libmono], enable_libraries=$enableval, enable_libraries=yes)
  635. if test "x$enable_static" = "xno"; then
  636. with_static_mono=no
  637. fi
  638. if test "x$enable_shared" = "xno"; then
  639. with_shared_mono=no
  640. fi
  641. if test "x$enable_libraries" = "xno"; then
  642. with_shared_mono=no
  643. fi
  644. AM_CONDITIONAL(DISABLE_LIBRARIES, test x$enable_libraries = xno)
  645. if test "x$host_win32" = "xyes"; then
  646. # Boehm GC requires the runtime to be in its own dll
  647. with_static_mono=no
  648. fi
  649. AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
  650. AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
  651. AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
  652. AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
  653. if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
  654. AC_DEFINE(MONO_XEN_OPT, 1, [Xen-specific behaviour])
  655. ORIG_CFLAGS=$CFLAGS
  656. CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
  657. AC_MSG_CHECKING(for -mno-tls-direct-seg-refs option to gcc)
  658. AC_TRY_COMPILE([], [
  659. return 0;
  660. ], [
  661. AC_MSG_RESULT(yes)
  662. # Pass it to libgc as well
  663. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -mno-tls-direct-seg-refs"
  664. ], [
  665. AC_MSG_RESULT(no)
  666. CFLAGS=$ORIG_CFLAGS
  667. ])
  668. fi
  669. AC_ARG_ENABLE(small-config, [ --enable-small-config Enable tweaks to reduce requirements (and capabilities)], enable_small_config=$enableval, enable_small_config=no)
  670. if test x$enable_small_config = xyes; then
  671. AC_DEFINE(MONO_SMALL_CONFIG,1,[Reduce runtime requirements (and capabilities)])
  672. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DSMALL_CONFIG"
  673. fi
  674. 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)
  675. DISABLED_FEATURES=none
  676. csc_compiler=default
  677. endian=unknown
  678. AC_C_BIGENDIAN([endian=big],[endian=little],[endian=unknown])
  679. AC_MSG_CHECKING([CSharp compiler to use])
  680. AC_ARG_WITH(csc, [ --with-csc=mcs,roslyn,default Configures the CSharp compiler to use],[
  681. if test x$withval = xmcs; then
  682. csc_compiler=mcs
  683. elif test x$withval = xroslyn; then
  684. csc_compiler=roslyn
  685. elif test x$withval = xdefault; then
  686. :
  687. else
  688. AC_MSG_ERROR([You must supply one of "mcs", "roslyn" or "default" to the --with-csc option])
  689. fi
  690. ],[csc_compiler=default])
  691. if test $csc_compiler = default; then
  692. if test $endian = big; then
  693. csc_compiler=mcs
  694. elif test $endian = little; then
  695. csc_compiler=roslyn
  696. else
  697. csc_compiler=mcs
  698. fi
  699. fi
  700. AC_MSG_RESULT($csc_compiler)
  701. #
  702. # Set the build profiles and options before things which use them
  703. #
  704. AC_ARG_WITH(profile4_x, [ --with-profile4_x=yes,no If you want to install the 4.x FX (defaults to yes)], [], [with_profile4_x=default])
  705. AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=default])
  706. AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=default])
  707. AC_ARG_WITH(monotouch_watch, [ --with-monotouch_watch=yes,no If you want to build the Xamarin.WatchOS assemblies (defaults to no)], [], [with_monotouch_watch=default])
  708. AC_ARG_WITH(monotouch_tv, [ --with-monotouch_tv=yes,no If you want to build the Xamarin.TVOS assemblies (defaults to no)], [], [with_monotouch_tv=default])
  709. AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=default])
  710. AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=default])
  711. AC_ARG_WITH(testing_aot_hybrid, [ --with-testing_aot_hybrid=yes,no If you want to build the testing_aot_hybrid assemblies (defaults to no)], [], [with_testing_aot_hybrid=default])
  712. AC_ARG_WITH(testing_aot_full, [ --with-testing_aot_full=yes,no If you want to build the testing_aot_full assemblies (defaults to no)], [], [with_testing_aot_full=default])
  713. AC_ARG_WITH(winaot, [ --with-winaot=yes,no If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
  714. AC_ARG_WITH(orbis, [ --with-orbis=yes,no If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
  715. AC_ARG_WITH(runtime_preset, [ --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
  716. dnl
  717. dnl Profile defaults
  718. dnl
  719. TEST_PROFILE=default
  720. enable_llvm_default=no
  721. with_profile4_x_default=no
  722. with_monodroid_default=no
  723. with_monotouch_default=no
  724. with_monotouch_watch_default=no
  725. with_monotouch_tv_default=no
  726. with_xammac_default=no
  727. with_testing_aot_hybrid_default=no
  728. with_testing_aot_full_default=no
  729. with_winaot_default=no
  730. with_orbis_default=no
  731. with_bitcode_default=no
  732. with_cooperative_gc_default=no
  733. INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=8000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4000
  734. if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
  735. DISABLE_MCS_DOCS_default=yes
  736. elif test x$with_runtime_preset = xnet_4_x; then
  737. with_profile4_x_default=yes
  738. elif test x$with_runtime_preset = xall; then
  739. with_profile4_x_default=yes
  740. with_monodroid_default=yes
  741. with_monotouch_default=yes
  742. with_monotouch_watch_default=yes
  743. with_monotouch_tv_default=yes
  744. with_xammac_default=yes
  745. with_winaot_default=yes
  746. with_orbis_default=yes
  747. elif test x$with_runtime_preset = xfullaot; then
  748. DISABLE_MCS_DOCS_default=yes
  749. with_testing_aot_full_default=yes
  750. TEST_PROFILE=testing_aot_full
  751. mono_feature_disable_com='yes'
  752. mono_feature_disable_remoting='yes'
  753. mono_feature_disable_reflection_emit_save='yes'
  754. mono_feature_disable_reflection_emit='yes'
  755. mono_feature_disable_appdomains='yes'
  756. AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
  757. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  758. elif test x$with_runtime_preset = xbitcode; then
  759. DISABLE_MCS_DOCS_default=yes
  760. with_testing_aot_full_default=yes
  761. with_bitcode_default=yes
  762. with_cooperative_gc_default=yes
  763. TEST_PROFILE=testing_aot_full
  764. enable_llvm_default=yes
  765. mono_feature_disable_com='yes'
  766. mono_feature_disable_remoting='yes'
  767. mono_feature_disable_reflection_emit_save='yes'
  768. mono_feature_disable_reflection_emit='yes'
  769. mono_feature_disable_appdomains='yes'
  770. AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,$INVARIANT_AOT_OPTIONS"
  771. AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
  772. elif test x$with_runtime_preset = xhybridaot; then
  773. DISABLE_MCS_DOCS_default=yes
  774. with_testing_aot_hybrid_default=yes
  775. TEST_PROFILE=testing_aot_hybrid
  776. AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
  777. AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
  778. elif test x$with_runtime_preset = xaot; then
  779. with_profile4_x_default=yes
  780. AOT_BUILD_FLAGS="--aot=$INVARIANT_AOT_OPTIONS"
  781. AOT_RUN_FLAGS=""
  782. DISABLE_MCS_DOCS_default=yes
  783. elif test x$with_runtime_preset = xwinaot; then
  784. DISABLE_MCS_DOCS_default=yes
  785. with_winaot_default=yes
  786. TEST_PROFILE=winaot
  787. mono_feature_disable_com='yes'
  788. mono_feature_disable_remoting='yes'
  789. mono_feature_disable_reflection_emit_save='yes'
  790. mono_feature_disable_reflection_emit='yes'
  791. mono_feature_disable_appdomains='yes'
  792. AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
  793. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  794. elif test x$with_runtime_preset = xorbis; then
  795. DISABLE_MCS_DOCS_default=yes
  796. with_orbis_default=yes
  797. TEST_PROFILE=orbis
  798. mono_feature_disable_com='yes'
  799. mono_feature_disable_remoting='yes'
  800. mono_feature_disable_reflection_emit_save='yes'
  801. mono_feature_disable_reflection_emit='yes'
  802. mono_feature_disable_appdomains='yes'
  803. AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
  804. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  805. else
  806. with_profile4_x_default=yes
  807. fi
  808. if test "x$AOT_BUILD_FLAGS" != "x"; then :
  809. AC_SUBST(AOT_BUILD_FLAGS)
  810. AC_SUBST(AOT_RUN_FLAGS)
  811. # For llvmonlycheck + fullaotcheck
  812. AC_SUBST(INVARIANT_AOT_OPTIONS)
  813. fi
  814. AC_SUBST(TEST_PROFILE)
  815. if test "x$with_profile4_x" = "xdefault"; then
  816. with_profile4_x=$with_profile4_x_default
  817. fi
  818. if test "x$with_monodroid" = "xdefault"; then
  819. with_monodroid=$with_monodroid_default
  820. fi
  821. if test "x$with_monotouch" = "xdefault"; then
  822. with_monotouch=$with_monotouch_default
  823. fi
  824. if test "x$with_monotouch_watch" = "xdefault"; then
  825. with_monotouch_watch=$with_monotouch_watch_default
  826. fi
  827. if test "x$with_monotouch_tv" = "xdefault"; then
  828. with_monotouch_tv=$with_monotouch_tv_default
  829. fi
  830. if test "x$with_bitcode" = "xdefault"; then
  831. with_bitcode=$with_bitcode_default
  832. fi
  833. if test "x$with_xammac" = "xdefault"; then
  834. with_xammac=$with_xammac_default
  835. fi
  836. if test "x$with_testing_aot_hybrid" = "xdefault"; then
  837. with_testing_aot_hybrid=$with_testing_aot_hybrid_default
  838. fi
  839. if test "x$with_testing_aot_full" = "xdefault"; then
  840. with_testing_aot_full=$with_testing_aot_full_default
  841. fi
  842. if test "x$with_winaot" = "xdefault"; then
  843. with_winaot=$with_winaot_default
  844. fi
  845. if test "x$with_orbis" = "xdefault"; then
  846. with_orbis=$with_orbis_default
  847. fi
  848. AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = "xyes"])
  849. AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
  850. AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
  851. AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
  852. AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"])
  853. AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes")
  854. AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
  855. AM_CONDITIONAL(INSTALL_TESTING_AOT_HYBRID, [test "x$with_testing_aot_hybrid" != "xno"])
  856. AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL, [test "x$with_testing_aot_full" != "xno"])
  857. AM_CONDITIONAL(INSTALL_WINAOT, [test "x$with_winaot" != "xno"])
  858. AM_CONDITIONAL(INSTALL_ORBIS, [test "x$with_orbis" != "xno"])
  859. AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"])
  860. AM_CONDITIONAL(HYBRID_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_hybrid"])
  861. default_profile=net_4_x
  862. if test -z "$INSTALL_MONODROID_TRUE"; then :
  863. default_profile=monodroid
  864. fi
  865. if test -z "$INSTALL_MONOTOUCH_TRUE"; then :
  866. default_profile=monotouch
  867. fi
  868. if test -z "$INSTALL_XAMMAC_TRUE"; then :
  869. default_profile=xammac
  870. fi
  871. if test -z "$INSTALL_TESTING_AOT_HYBRID_TRUE"; then :
  872. default_profile=testing_aot_hybrid
  873. fi
  874. if test -z "$INSTALL_TESTING_AOT_FULL_TRUE"; then :
  875. default_profile=testing_aot_full
  876. fi
  877. if test -z "$INSTALL_WINAOT_TRUE"; then :
  878. default_profile=winaot
  879. fi
  880. if test -z "$INSTALL_ORBIS_TRUE"; then :
  881. default_profile=orbis
  882. fi
  883. if test -z "$INSTALL_4_x_TRUE"; then :
  884. default_profile=net_4_x
  885. fi
  886. DEFAULT_PROFILE=$default_profile
  887. AC_SUBST(DEFAULT_PROFILE)
  888. #
  889. # End build profile configuration
  890. #
  891. if test x$USE_NLS = xprofile_default; then
  892. AC_MSG_CHECKING([NLS used])
  893. # We make the default value for USE_NLS
  894. # "no" on OSX because it isn't available on most
  895. # default OSX installs. The most common configurations will
  896. # all disable it, so this saves us typing.
  897. if test x$host_darwin = xyes; then
  898. USE_NLS=no;
  899. else
  900. USE_NLS=yes;
  901. fi
  902. AC_SUBST([USE_NLS])
  903. AC_MSG_RESULT([$USE_NLS])
  904. fi
  905. AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
  906. LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
  907. reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
  908. security, lldb, mdb, sgen_remset, sgen_marksweep_par, sgen_marksweep_fixed, sgen_marksweep_fixed_par, sgen_copying.],
  909. [
  910. for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
  911. eval "mono_feature_disable_$feature='yes'"
  912. done
  913. DISABLED_FEATURES=$enable_minimal
  914. disabled="Disabled: $enable_minimal"
  915. ],[])
  916. AC_DEFINE_UNQUOTED(DISABLED_FEATURES, "$DISABLED_FEATURES", [String of disabled features])
  917. if test "x$mono_feature_disable_aot" = "xyes"; then
  918. AC_DEFINE(DISABLE_AOT, 1, [Disable AOT Compiler])
  919. enable_system_aot=no
  920. AC_MSG_NOTICE([Disabled AOT compiler])
  921. fi
  922. if test "x$mono_feature_disable_profiler" = "xyes"; then
  923. AC_DEFINE(DISABLE_PROFILER, 1, [Disable default profiler support])
  924. AC_MSG_NOTICE([Disabled support for the profiler])
  925. fi
  926. AM_CONDITIONAL(DISABLE_PROFILER, test x$mono_feature_disable_profiler = xyes)
  927. if test "x$mono_feature_disable_decimal" = "xyes"; then
  928. AC_DEFINE(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
  929. AC_MSG_NOTICE([Disabled support for decimal])
  930. fi
  931. if test "x$mono_feature_disable_pinvoke" = "xyes"; then
  932. AC_DEFINE(DISABLE_PINVOKE, 1, [Disable P/Invoke support])
  933. AC_MSG_NOTICE([Disabled support for P/Invoke])
  934. fi
  935. if test "x$mono_feature_disable_debug" = "xyes"; then
  936. AC_DEFINE(DISABLE_DEBUG, 1, [Disable runtime debugging support])
  937. AC_MSG_NOTICE([Disabled support for runtime debugging])
  938. fi
  939. if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
  940. AC_DEFINE(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
  941. mono_feature_disable_reflection_emit_save=yes
  942. AC_MSG_NOTICE([Disabled support for Reflection.Emit])
  943. fi
  944. if test "x$mono_feature_disable_reflection_emit_save" = "xyes"; then
  945. AC_DEFINE(DISABLE_REFLECTION_EMIT_SAVE, 1, [Disable assembly saving support in reflection emit])
  946. AC_MSG_NOTICE([Disabled support for Reflection.Emit.Save])
  947. fi
  948. if test "x$mono_feature_disable_large_code" = "xyes"; then
  949. AC_DEFINE(DISABLE_LARGE_CODE, 1, [Disable support for huge assemblies])
  950. AC_MSG_NOTICE([Disabled support for large assemblies])
  951. fi
  952. if test "x$mono_feature_disable_logging" = "xyes"; then
  953. AC_DEFINE(DISABLE_LOGGING, 1, [Disable support debug logging])
  954. AC_MSG_NOTICE([Disabled support for logging])
  955. fi
  956. if test "x$mono_feature_disable_com" = "xyes"; then
  957. AC_DEFINE(DISABLE_COM, 1, [Disable COM support])
  958. AC_MSG_NOTICE([Disabled COM support])
  959. fi
  960. if test "x$mono_feature_disable_ssa" = "xyes"; then
  961. AC_DEFINE(DISABLE_SSA, 1, [Disable advanced SSA JIT optimizations])
  962. AC_MSG_NOTICE([Disabled SSA JIT optimizations])
  963. fi
  964. if test "x$mono_feature_disable_generics" = "xyes"; then
  965. AC_DEFINE(DISABLE_GENERICS, 1, [Disable generics support])
  966. AC_MSG_NOTICE([Disabled Generics Support])
  967. fi
  968. if test "x$mono_feature_disable_shadowcopy" = "xyes"; then
  969. AC_DEFINE(DISABLE_SHADOW_COPY, 1, [Disable Shadow Copy for AppDomains])
  970. AC_MSG_NOTICE([Disabled Shadow copy for AppDomains])
  971. fi
  972. if test "x$mono_feature_disable_portability" = "xyes"; then
  973. AC_DEFINE(DISABLE_PORTABILITY, 1, [Disables the IO portability layer])
  974. AC_MSG_NOTICE([Disabled IO Portability layer])
  975. fi
  976. if test "x$mono_feature_disable_attach" = "xyes"; then
  977. AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
  978. AC_MSG_NOTICE([Disabled agent attach])
  979. fi
  980. if test "x$mono_feature_disable_verifier" = "xyes"; then
  981. AC_DEFINE(DISABLE_VERIFIER, 1, [Disables the verifier])
  982. AC_MSG_NOTICE([Disabled the metadata and IL verifiers])
  983. fi
  984. if test "x$mono_feature_disable_jit" = "xyes"; then
  985. AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode will be supported by the runtime.])
  986. AC_MSG_NOTICE([Disabled the JIT engine, only full AOT will be supported])
  987. fi
  988. AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
  989. if test "x$mono_feature_disable_simd" = "xyes"; then
  990. AC_DEFINE(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
  991. AC_MSG_NOTICE([Disabled SIMD support])
  992. fi
  993. if test "x$mono_feature_disable_soft_debug" = "xyes"; then
  994. AC_DEFINE(DISABLE_SOFT_DEBUG, 1, [Disable Soft Debugger Agent.])
  995. AC_MSG_NOTICE([Disabled Soft Debugger.])
  996. fi
  997. if test "x$mono_feature_disable_perfcounters" = "xyes"; then
  998. AC_DEFINE(DISABLE_PERFCOUNTERS, 1, [Disable Performance Counters.])
  999. AC_MSG_NOTICE([Disabled Performance Counters.])
  1000. fi
  1001. if test "x$mono_feature_disable_normalization" = "xyes"; then
  1002. AC_DEFINE(DISABLE_NORMALIZATION, 1, [Disable String normalization support.])
  1003. AC_MSG_NOTICE([Disabled String normalization support.])
  1004. fi
  1005. #TODO: remove assembly_remapping feature name once everyone is using desktop_loader
  1006. if test "x$mono_feature_disable_assembly_remapping" = "xyes" || test "x$mono_feature_disable_desktop_loader" = "xyes"; then
  1007. AC_DEFINE(DISABLE_DESKTOP_LOADER, 1, [Disable desktop assembly loader semantics.])
  1008. AC_MSG_NOTICE([Disabled desktop assembly loader semantics.])
  1009. fi
  1010. if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then
  1011. AC_DEFINE(DISABLE_SHARED_PERFCOUNTERS, 1, [Disable shared perfcounters.])
  1012. AC_MSG_NOTICE([Disabled Shared perfcounters.])
  1013. fi
  1014. if test "x$mono_feature_disable_appdomains" = "xyes"; then
  1015. AC_DEFINE(DISABLE_APPDOMAINS, 1, [Disable support for multiple appdomains.])
  1016. AC_MSG_NOTICE([Disabled support for multiple appdomains.])
  1017. fi
  1018. if test "x$mono_feature_disable_remoting" = "xyes"; then
  1019. AC_DEFINE(DISABLE_REMOTING, 1, [Disable remoting support (This disables type proxies and make com non-functional)])
  1020. AC_MSG_NOTICE([Disabled remoting])
  1021. fi
  1022. if test "x$mono_feature_disable_security" = "xyes"; then
  1023. AC_DEFINE(DISABLE_SECURITY, 1, [Disable CAS/CoreCLR security])
  1024. AC_MSG_NOTICE([Disabled CAS/CoreCLR security manager (used e.g. for Moonlight)])
  1025. fi
  1026. if test "x$mono_feature_disable_lldb" = "xyes"; then
  1027. AC_DEFINE(DISABLE_LLDB, 1, [Disable support code for the LLDB plugin.])
  1028. AC_MSG_NOTICE([Disabled LLDB plugin support code.])
  1029. fi
  1030. if test "x$mono_feature_disable_mdb" = "xyes"; then
  1031. AC_DEFINE(DISABLE_MDB, 1, [Disable support for .mdb symbol files.])
  1032. AC_MSG_NOTICE([Disabled support for .mdb symbol files.])
  1033. fi
  1034. if test "x$mono_feature_disable_sgen_remset" = "xyes"; then
  1035. AC_DEFINE(DISABLE_SGEN_REMSET, 1, [Disable wbarrier=remset support in SGEN.])
  1036. AC_MSG_NOTICE([Disabled wbarrier=remset support in SGEN.])
  1037. fi
  1038. if test "x$mono_feature_disable_sgen_marksweep_par" = "xyes"; then
  1039. AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_PAR, 1, [Disable major=marksweep-par support in SGEN.])
  1040. AC_MSG_NOTICE([Disabled major=marksweep-par support in SGEN.])
  1041. fi
  1042. if test "x$mono_feature_disable_sgen_marksweep_fixed" = "xyes"; then
  1043. AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_FIXED, 1, [Disable major=marksweep-fixed support in SGEN.])
  1044. AC_MSG_NOTICE([Disabled major=marksweep-fixed support in SGEN.])
  1045. fi
  1046. if test "x$mono_feature_disable_sgen_marksweep_fixed_par" = "xyes"; then
  1047. AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_FIXED_PAR, 1, [Disable major=marksweep-fixed-par support in SGEN.])
  1048. AC_MSG_NOTICE([Disabled major=marksweep-fixed-par support in SGEN.])
  1049. fi
  1050. if test "x$mono_feature_disable_sgen_copying" = "xyes"; then
  1051. AC_DEFINE(DISABLE_SGEN_MAJOR_COPYING, 1, [Disable major=copying support in SGEN.])
  1052. AC_MSG_NOTICE([Disabled major=copying support in SGEN.])
  1053. fi
  1054. AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
  1055. AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
  1056. has_extension_module=no
  1057. AC_ARG_ENABLE(extension-module, [ --enable-extension-module=LIST enable the core-extensions from LIST],
  1058. [
  1059. for extension in `echo "$enable_extension_module" | sed -e "s/,/ /g"`; do
  1060. if test x$extension = xdefault ; then
  1061. has_extension_module=yes;
  1062. fi
  1063. done
  1064. if test x$enable_extension_module = xyes; then
  1065. has_extension_module=yes;
  1066. fi
  1067. ], [])
  1068. AM_CONDITIONAL([HAS_EXTENSION_MODULE], [test x$has_extension_module != xno])
  1069. if test x$has_extension_module != xno ; then
  1070. AC_DEFINE([ENABLE_EXTENSION_MODULE], 1, [Extension module enabled])
  1071. AC_MSG_NOTICE([Enabling mono extension module.])
  1072. fi
  1073. # Deprecated
  1074. AC_ARG_ENABLE(gsharedvt, [ --enable-gsharedvt Enable generic valuetype sharing (Deprecated)], enable_gsharedvt=$enableval, enable_gsharedvt=no)
  1075. AC_MSG_CHECKING(for visibility __attribute__)
  1076. AC_COMPILE_IFELSE([
  1077. AC_LANG_SOURCE([[
  1078. void __attribute__ ((visibility ("hidden"))) doit (void) {}
  1079. int main () { doit (); return 0; }
  1080. ]])
  1081. ], [
  1082. have_visibility_hidden=yes
  1083. AC_MSG_RESULT(yes)
  1084. ], [
  1085. have_visibility_hidden=no
  1086. AC_MSG_RESULT(no)
  1087. ])
  1088. dnl
  1089. dnl Boehm GC configuration
  1090. dnl
  1091. AC_ARG_WITH(libgc, [ --with-libgc=included,none Controls the Boehm GC config, default=included],[libgc=$with_gc],[libgc=included])
  1092. AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
  1093. AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
  1094. if test "x$support_boehm" = "xyes"; then
  1095. AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables Boehm GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
  1096. if test x$enable_parallel_mark = xyes; then
  1097. libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
  1098. fi
  1099. gc_msg=""
  1100. LIBGC_CPPFLAGS=
  1101. LIBGC_LIBS=
  1102. LIBGC_STATIC_LIBS=
  1103. libgc_dir=
  1104. case "x$libgc" in
  1105. xincluded)
  1106. if test "x$support_boehm" = "xyes"; then
  1107. libgc_dir=libgc
  1108. fi
  1109. LIBGC_CPPFLAGS='-I$(top_srcdir)/libgc/include'
  1110. LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
  1111. LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
  1112. BOEHM_DEFINES="-DHAVE_BOEHM_GC"
  1113. if test x$target_win32 = xyes; then
  1114. BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
  1115. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DGC_BUILD -DGC_NOT_DLL"
  1116. fi
  1117. gc_msg="Included Boehm GC with typed GC"
  1118. if test x$enable_parallel_mark = xyes; then
  1119. AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
  1120. gc_msg="$gc_msg and parallel mark"
  1121. else
  1122. AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC)", [GC description])
  1123. fi
  1124. ;;
  1125. xboehm|xbohem|xyes)
  1126. AC_MSG_WARN("External Boehm is no longer supported")
  1127. ;;
  1128. xsgen)
  1129. AC_MSG_WARN("Use --with-sgen instead, --with-libgc= controls Boehm configuration")
  1130. ;;
  1131. xnone)
  1132. AC_MSG_WARN("Compiling mono without GC.")
  1133. AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "none", [GC description])
  1134. AC_DEFINE(HAVE_NULL_GC,1,[No GC support.])
  1135. gc_msg="none"
  1136. ;;
  1137. *)
  1138. AC_MSG_ERROR([Invalid argument to --with-libgc.])
  1139. ;;
  1140. esac
  1141. 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])
  1142. if test "x$large_heap" = "xyes"; then
  1143. CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
  1144. fi
  1145. AC_SUBST(LIBGC_CPPFLAGS)
  1146. AC_SUBST(LIBGC_LIBS)
  1147. AC_SUBST(LIBGC_STATIC_LIBS)
  1148. AC_SUBST(libgc_dir)
  1149. AC_SUBST(BOEHM_DEFINES)
  1150. fi
  1151. dnl
  1152. dnl End of Boehm GC Configuration
  1153. dnl
  1154. dnl *************************************
  1155. dnl *** Checks for zero length arrays ***
  1156. dnl *************************************
  1157. AC_MSG_CHECKING(whether $CC supports zero length arrays)
  1158. AC_TRY_COMPILE([
  1159. struct s {
  1160. int length;
  1161. char data [0];
  1162. };
  1163. ], [], [
  1164. AC_MSG_RESULT(yes)
  1165. AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 0, [Length of zero length arrays])
  1166. ], [
  1167. AC_MSG_RESULT(no)
  1168. AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
  1169. ])
  1170. dnl ***********************************
  1171. dnl *** Checks for signals
  1172. dnl ***********************************
  1173. AC_CHECK_HEADERS(signal.h)
  1174. AC_CHECK_FUNCS(sigaction)
  1175. AC_CHECK_FUNCS(kill)
  1176. AC_CHECK_FUNCS(signal)
  1177. # signal() is declared inline in Android headers
  1178. # so we need to workaround it by overriding the check.
  1179. if test x$platform_android = xyes; then
  1180. AC_DEFINE(HAVE_SIGNAL,1)
  1181. fi
  1182. if test x$host_win32 = xno; then
  1183. dnl hires monotonic clock support
  1184. AC_SEARCH_LIBS(clock_gettime, rt)
  1185. AC_CHECK_FUNCS(clock_nanosleep)
  1186. dnl dynamic loader support
  1187. AC_CHECK_FUNC(dlopen, DL_LIB="",
  1188. AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", dl_support=no)
  1189. )
  1190. if test x$dl_support = xno; then
  1191. AC_MSG_WARN([No dynamic loading support available])
  1192. else
  1193. LIBS="$LIBS $DL_LIB"
  1194. AC_DEFINE(HAVE_DL_LOADER,1,[dlopen-based dynamic loader available])
  1195. dnl from glib's configure.ac
  1196. AC_CACHE_CHECK([for preceeding underscore in symbols],
  1197. mono_cv_uscore,[
  1198. AC_TRY_RUN([#include <dlfcn.h>
  1199. int mono_underscore_test (void) { return 42; }
  1200. int main() {
  1201. void *f1 = (void*)0, *f2 = (void*)0, *handle;
  1202. handle = dlopen ((void*)0, 0);
  1203. if (handle) {
  1204. f1 = dlsym (handle, "mono_underscore_test");
  1205. f2 = dlsym (handle, "_mono_underscore_test");
  1206. } return (!f2 || f1);
  1207. }],
  1208. [mono_cv_uscore=yes],
  1209. [mono_cv_uscore=no],
  1210. [])
  1211. ])
  1212. if test "x$mono_cv_uscore" = "xyes"; then
  1213. MONO_DL_NEED_USCORE=1
  1214. else
  1215. MONO_DL_NEED_USCORE=0
  1216. fi
  1217. AC_SUBST(MONO_DL_NEED_USCORE)
  1218. AC_CHECK_FUNC(dlerror)
  1219. fi
  1220. dnl ******************************************************************
  1221. dnl *** Checks for the IKVM JNI interface library ***
  1222. dnl ******************************************************************
  1223. 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=$ikvm_native])
  1224. ikvm_native_dir=
  1225. if test x$with_ikvm_native = xyes; then
  1226. ikvm_native_dir=ikvm-native
  1227. jdk_headers_found="IKVM Native"
  1228. fi
  1229. AC_SUBST(ikvm_native_dir)
  1230. AC_CHECK_HEADERS(execinfo.h)
  1231. AC_CHECK_HEADERS(sys/auxv.h sys/resource.h)
  1232. AC_CHECK_FUNCS(getgrgid_r)
  1233. AC_CHECK_FUNCS(getgrnam_r)
  1234. AC_CHECK_FUNCS(getresuid)
  1235. AC_CHECK_FUNCS(setresuid)
  1236. AC_CHECK_FUNCS(kqueue)
  1237. AC_CHECK_FUNCS(backtrace_symbols)
  1238. AC_CHECK_FUNCS(mkstemp)
  1239. AC_CHECK_FUNCS(mmap)
  1240. AC_CHECK_FUNCS(madvise)
  1241. AC_CHECK_FUNCS(getrusage)
  1242. AC_CHECK_FUNCS(getpriority)
  1243. AC_CHECK_FUNCS(setpriority)
  1244. AC_CHECK_FUNCS(dl_iterate_phdr)
  1245. AC_CHECK_FUNCS(dladdr)
  1246. AC_CHECK_FUNCS(sysconf)
  1247. AC_CHECK_FUNCS(getrlimit)
  1248. AC_CHECK_FUNCS(prctl)
  1249. AC_CHECK_FUNCS(sched_getaffinity)
  1250. AC_CHECK_FUNCS(sched_setaffinity)
  1251. AC_CHECK_FUNCS(sched_getcpu)
  1252. if test x$platform_android != xyes; then
  1253. AC_CHECK_FUNCS(getpwnam_r)
  1254. AC_CHECK_FUNCS(getpwuid_r)
  1255. fi
  1256. dnl ****************************************************************
  1257. dnl *** Check for sched_setaffinity from glibc versions before ***
  1258. dnl *** 2.3.4. The older versions of the function only take 2 ***
  1259. dnl *** parameters, not 3. ***
  1260. dnl *** ***
  1261. dnl *** Because the interface change was not made in a minor ***
  1262. dnl *** version rev, the __GLIBC__ and __GLIBC_MINOR__ macros ***
  1263. dnl *** won't always indicate the interface sched_affinity has. ***
  1264. dnl ****************************************************************
  1265. AC_MSG_CHECKING(for sched_setaffinity from glibc < 2.3.4)
  1266. AC_TRY_COMPILE([#include <sched.h>], [
  1267. int mask = 1;
  1268. sched_setaffinity(0, &mask);
  1269. return 0;
  1270. ], [
  1271. # Yes, we have it...
  1272. AC_MSG_RESULT(yes)
  1273. AC_DEFINE(GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY, 1, [Have GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY])
  1274. ], [
  1275. # We have the new, three-parameter version
  1276. AC_MSG_RESULT(no)
  1277. ])
  1278. AC_TRY_COMPILE([#include <sched.h>], [
  1279. CPU_COUNT((void *) 0);
  1280. ], [
  1281. AC_MSG_RESULT(yes)
  1282. AC_DEFINE(GLIBC_HAS_CPU_COUNT, 1, [GLIBC has CPU_COUNT macro in sched.h])
  1283. ], [
  1284. # We have the new, three-parameter version
  1285. AC_MSG_RESULT(no)
  1286. ])
  1287. dnl ******************************************************************
  1288. dnl *** Check for large file support ***
  1289. dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
  1290. dnl ******************************************************************
  1291. # Check that off_t can represent 2**63 - 1 correctly, working around
  1292. # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
  1293. # CPPFLAGS and sets $large_offt to yes if the test succeeds
  1294. large_offt=no
  1295. AC_DEFUN([LARGE_FILES], [
  1296. large_CPPFLAGS=$CPPFLAGS
  1297. CPPFLAGS="$CPPFLAGS $1"
  1298. AC_TRY_COMPILE([
  1299. #include <sys/types.h>
  1300. #include <limits.h>
  1301. ], [
  1302. /* Lifted this compile time assert method from: http://www.jaggersoft.com/pubs/CVu11_3.html */
  1303. #define COMPILE_TIME_ASSERT(pred) \
  1304. switch(0){case 0:case pred:;}
  1305. COMPILE_TIME_ASSERT(sizeof(off_t) * CHAR_BIT == 64);
  1306. ], [
  1307. AC_MSG_RESULT(ok)
  1308. AC_DEFINE(HAVE_LARGE_FILE_SUPPORT, 1, [Have large file support])
  1309. large_CPPFLAGS="$large_CPPFLAGS $1"
  1310. large_offt=yes
  1311. ], [
  1312. AC_MSG_RESULT(no)
  1313. ])
  1314. CPPFLAGS=$large_CPPFLAGS
  1315. ])
  1316. AC_MSG_CHECKING(if off_t is 64 bits wide)
  1317. LARGE_FILES("")
  1318. if test $large_offt = no; then
  1319. AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
  1320. LARGE_FILES("-D_FILE_OFFSET_BITS=64")
  1321. fi
  1322. if test $large_offt = no; then
  1323. AC_MSG_WARN([No 64 bit file size support available])
  1324. fi
  1325. dnl *****************************
  1326. dnl *** Checks for libsocket ***
  1327. dnl *****************************
  1328. AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
  1329. case "$host" in
  1330. *-*-*freebsd*)
  1331. dnl *****************************
  1332. dnl *** Checks for libinotify ***
  1333. dnl *****************************
  1334. AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify")
  1335. esac
  1336. dnl *******************************
  1337. dnl *** Checks for MSG_NOSIGNAL ***
  1338. dnl *******************************
  1339. AC_MSG_CHECKING(for MSG_NOSIGNAL)
  1340. AC_TRY_COMPILE([#include <sys/socket.h>], [
  1341. int f = MSG_NOSIGNAL;
  1342. ], [
  1343. # Yes, we have it...
  1344. AC_MSG_RESULT(yes)
  1345. AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Have MSG_NOSIGNAL])
  1346. ], [
  1347. # We'll have to use signals
  1348. AC_MSG_RESULT(no)
  1349. ])
  1350. dnl *****************************
  1351. dnl *** Checks for IPPROTO_IP ***
  1352. dnl *****************************
  1353. AC_MSG_CHECKING(for IPPROTO_IP)
  1354. AC_TRY_COMPILE([#include <netinet/in.h>], [
  1355. int level = IPPROTO_IP;
  1356. ], [
  1357. # Yes, we have it...
  1358. AC_MSG_RESULT(yes)
  1359. AC_DEFINE(HAVE_IPPROTO_IP, 1, [Have IPPROTO_IP])
  1360. ], [
  1361. # We'll have to use getprotobyname
  1362. AC_MSG_RESULT(no)
  1363. ])
  1364. dnl *******************************
  1365. dnl *** Checks for IPPROTO_IPV6 ***
  1366. dnl *******************************
  1367. AC_MSG_CHECKING(for IPPROTO_IPV6)
  1368. AC_TRY_COMPILE([#include <netinet/in.h>], [
  1369. int level = IPPROTO_IPV6;
  1370. ], [
  1371. # Yes, we have it...
  1372. AC_MSG_RESULT(yes)
  1373. AC_DEFINE(HAVE_IPPROTO_IPV6, 1, [Have IPPROTO_IPV6])
  1374. ], [
  1375. # We'll have to use getprotobyname
  1376. AC_MSG_RESULT(no)
  1377. ])
  1378. dnl ******************************
  1379. dnl *** Checks for IPPROTO_TCP ***
  1380. dnl ******************************
  1381. AC_MSG_CHECKING(for IPPROTO_TCP)
  1382. AC_TRY_COMPILE([#include <netinet/in.h>], [
  1383. int level = IPPROTO_TCP;
  1384. ], [
  1385. # Yes, we have it...
  1386. AC_MSG_RESULT(yes)
  1387. AC_DEFINE(HAVE_IPPROTO_TCP, 1, [Have IPPROTO_TCP])
  1388. ], [
  1389. # We'll have to use getprotobyname
  1390. AC_MSG_RESULT(no)
  1391. ])
  1392. dnl *****************************
  1393. dnl *** Checks for SOL_IP ***
  1394. dnl *****************************
  1395. AC_MSG_CHECKING(for SOL_IP)
  1396. AC_TRY_COMPILE([#include <netdb.h>], [
  1397. int level = SOL_IP;
  1398. ], [
  1399. # Yes, we have it...
  1400. AC_MSG_RESULT(yes)
  1401. AC_DEFINE(HAVE_SOL_IP, 1, [Have SOL_IP])
  1402. ], [
  1403. # We'll have to use getprotobyname
  1404. AC_MSG_RESULT(no)
  1405. ])
  1406. dnl *****************************
  1407. dnl *** Checks for SOL_IPV6 ***
  1408. dnl *****************************
  1409. AC_MSG_CHECKING(for SOL_IPV6)
  1410. AC_TRY_COMPILE([#include <netdb.h>], [
  1411. int level = SOL_IPV6;
  1412. ], [
  1413. # Yes, we have it...
  1414. AC_MSG_RESULT(yes)
  1415. AC_DEFINE(HAVE_SOL_IPV6, 1, [Have SOL_IPV6])
  1416. ], [
  1417. # We'll have to use getprotobyname
  1418. AC_MSG_RESULT(no)
  1419. ])
  1420. dnl *****************************
  1421. dnl *** Checks for SOL_TCP ***
  1422. dnl *****************************
  1423. AC_MSG_CHECKING(for SOL_TCP)
  1424. AC_TRY_COMPILE([#include <netdb.h>], [
  1425. int level = SOL_TCP;
  1426. ], [
  1427. # Yes, we have it...
  1428. AC_MSG_RESULT(yes)
  1429. AC_DEFINE(HAVE_SOL_TCP, 1, [Have SOL_TCP])
  1430. ], [
  1431. # We'll have to use getprotobyname
  1432. AC_MSG_RESULT(no)
  1433. ])
  1434. dnl *****************************
  1435. dnl *** Checks for IP_PKTINFO ***
  1436. dnl *****************************
  1437. AC_MSG_CHECKING(for IP_PKTINFO)
  1438. AC_TRY_COMPILE([#include <linux/in.h>], [
  1439. int level = IP_PKTINFO;
  1440. ], [
  1441. # Yes, we have it...
  1442. AC_MSG_RESULT(yes)
  1443. AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
  1444. ], [
  1445. AC_MSG_RESULT(no)
  1446. ])
  1447. dnl *****************************
  1448. dnl *** Checks for IPV6_PKTINFO ***
  1449. dnl *****************************
  1450. AC_MSG_CHECKING(for IPV6_PKTINFO)
  1451. AC_TRY_COMPILE([#include <netdb.h>], [
  1452. int level = IPV6_PKTINFO;
  1453. ], [
  1454. # Yes, we have it...
  1455. AC_MSG_RESULT(yes)
  1456. AC_DEFINE(HAVE_IPV6_PKTINFO, 1, [Have IPV6_PKTINFO])
  1457. ], [
  1458. AC_MSG_RESULT(no)
  1459. ])
  1460. dnl **********************************
  1461. dnl *** Checks for IP_DONTFRAG ***
  1462. dnl **********************************
  1463. AC_MSG_CHECKING(for IP_DONTFRAG)
  1464. AC_TRY_COMPILE([#include <netinet/in.h>], [
  1465. int level = IP_DONTFRAG;
  1466. ], [
  1467. # Yes, we have it...
  1468. AC_MSG_RESULT(yes)
  1469. AC_DEFINE(HAVE_IP_DONTFRAG, 1, [Have IP_DONTFRAG])
  1470. ], [
  1471. AC_MSG_RESULT(no)
  1472. ])
  1473. dnl **********************************
  1474. dnl *** Checks for IP_DONTFRAGMENT ***
  1475. dnl **********************************
  1476. AC_MSG_CHECKING(for IP_DONTFRAGMENT)
  1477. AC_TRY_COMPILE([#include <Ws2ipdef.h>], [
  1478. int level = IP_DONTFRAGMENT;
  1479. ], [
  1480. # Yes, we have it...
  1481. AC_MSG_RESULT(yes)
  1482. AC_DEFINE(HAVE_IP_DONTFRAGMENT, 1, [Have IP_DONTFRAGMENT])
  1483. ], [
  1484. AC_MSG_RESULT(no)
  1485. ])
  1486. dnl **********************************
  1487. dnl *** Checks for IP_MTU_DISCOVER ***
  1488. dnl **********************************
  1489. AC_MSG_CHECKING(for IP_MTU_DISCOVER)
  1490. AC_TRY_COMPILE([#include <linux/in.h>], [
  1491. int level = IP_MTU_DISCOVER;
  1492. ], [
  1493. # Yes, we have it...
  1494. AC_MSG_RESULT(yes)
  1495. AC_DEFINE(HAVE_IP_MTU_DISCOVER, 1, [Have IP_MTU_DISCOVER])
  1496. ], [
  1497. AC_MSG_RESULT(no)
  1498. ])
  1499. dnl **********************************
  1500. dnl *** Checks for IP_PMTUDISC_DO ***
  1501. dnl **********************************
  1502. AC_MSG_CHECKING(for IP_PMTUDISC_DO)
  1503. AC_TRY_COMPILE([#include <linux/in.h>], [
  1504. int level = IP_PMTUDISC_DO;
  1505. ], [
  1506. # Yes, we have it...
  1507. AC_MSG_RESULT(yes)
  1508. AC_DEFINE(HAVE_IP_PMTUDISC_DO, 1, [Have IP_PMTUDISC_DO])
  1509. ], [
  1510. AC_MSG_RESULT(no)
  1511. ])
  1512. dnl *********************************
  1513. dnl *** Check for struct ip_mreqn ***
  1514. dnl *********************************
  1515. AC_MSG_CHECKING(for struct ip_mreqn)
  1516. AC_TRY_COMPILE([#include <netinet/in.h>], [
  1517. struct ip_mreqn mreq;
  1518. mreq.imr_address.s_addr = 0;
  1519. ], [
  1520. # Yes, we have it...
  1521. AC_MSG_RESULT(yes)
  1522. AC_DEFINE(HAVE_STRUCT_IP_MREQN, 1, [Have struct ip_mreqn])
  1523. ], [
  1524. # We'll just have to try and use struct ip_mreq
  1525. AC_MSG_RESULT(no)
  1526. AC_MSG_CHECKING(for struct ip_mreq)
  1527. AC_TRY_COMPILE([#include <netinet/in.h>], [
  1528. struct ip_mreq mreq;
  1529. mreq.imr_interface.s_addr = 0;
  1530. ], [
  1531. # Yes, we have it...
  1532. AC_MSG_RESULT(yes)
  1533. AC_DEFINE(HAVE_STRUCT_IP_MREQ, 1, [Have struct ip_mreq])
  1534. ], [
  1535. # No multicast support
  1536. AC_MSG_RESULT(no)
  1537. ])
  1538. ])
  1539. dnl **********************************
  1540. dnl *** Check for getaddrinfo ***
  1541. dnl **********************************
  1542. AC_MSG_CHECKING(for getaddrinfo)
  1543. AC_TRY_LINK([
  1544. #include <stdio.h>
  1545. #include <netdb.h>
  1546. ], [
  1547. getaddrinfo(NULL,NULL,NULL,NULL);
  1548. ], [
  1549. # Yes, we have it...
  1550. AC_MSG_RESULT(yes)
  1551. AC_DEFINE(HAVE_GETADDRINFO, 1, [Have getaddrinfo])
  1552. ], [
  1553. AC_MSG_RESULT(no)
  1554. ])
  1555. dnl **********************************
  1556. dnl *** Check for gethostbyname2_r ***
  1557. dnl **********************************
  1558. AC_MSG_CHECKING(for gethostbyname2_r)
  1559. AC_TRY_LINK([
  1560. #include <stdio.h>
  1561. #include <netdb.h>
  1562. ], [
  1563. gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
  1564. ], [
  1565. # Yes, we have it...
  1566. AC_MSG_RESULT(yes)
  1567. AC_DEFINE(HAVE_GETHOSTBYNAME2_R, 1, [Have gethostbyname2_r])
  1568. ], [
  1569. AC_MSG_RESULT(no)
  1570. ])
  1571. dnl **********************************
  1572. dnl *** Check for gethostbyname2 ***
  1573. dnl **********************************
  1574. AC_MSG_CHECKING(for gethostbyname2)
  1575. AC_TRY_LINK([
  1576. #include <stdio.h>
  1577. #include <netdb.h>
  1578. ], [
  1579. gethostbyname2(NULL,0);
  1580. ], [
  1581. # Yes, we have it...
  1582. AC_MSG_RESULT(yes)
  1583. AC_DEFINE(HAVE_GETHOSTBYNAME2, 1, [Have gethostbyname2])
  1584. ], [
  1585. AC_MSG_RESULT(no)
  1586. ])
  1587. dnl **********************************
  1588. dnl *** Check for gethostbyname ***
  1589. dnl **********************************
  1590. AC_MSG_CHECKING(for gethostbyname)
  1591. AC_TRY_LINK([
  1592. #include <stdio.h>
  1593. #include <netdb.h>
  1594. ], [
  1595. gethostbyname(NULL);
  1596. ], [
  1597. # Yes, we have it...
  1598. AC_MSG_RESULT(yes)
  1599. AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [Have gethostbyname])
  1600. ], [
  1601. AC_MSG_RESULT(no)
  1602. ])
  1603. dnl **********************************
  1604. dnl *** Check for getprotobyname ***
  1605. dnl **********************************
  1606. AC_MSG_CHECKING(for getprotobyname)
  1607. AC_TRY_LINK([
  1608. #include <stdio.h>
  1609. #include <netdb.h>
  1610. ], [
  1611. getprotobyname(NULL);
  1612. ], [
  1613. # Yes, we have it...
  1614. AC_MSG_RESULT(yes)
  1615. AC_DEFINE(HAVE_GETPROTOBYNAME, 1, [Have getprotobyname])
  1616. ], [
  1617. AC_MSG_RESULT(no)
  1618. ])
  1619. dnl **********************************
  1620. dnl *** Check for getnameinfo ***
  1621. dnl **********************************
  1622. AC_MSG_CHECKING(for getnameinfo)
  1623. AC_TRY_LINK([
  1624. #include <stdio.h>
  1625. #include <netdb.h>
  1626. ], [
  1627. getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);
  1628. ], [
  1629. # Yes, we have it...
  1630. AC_MSG_RESULT(yes)
  1631. AC_DEFINE(HAVE_GETNAMEINFO, 1, [Have getnameinfo])
  1632. ], [
  1633. AC_MSG_RESULT(no)
  1634. ])
  1635. dnl **********************************
  1636. dnl *** Check for inet_ntop ***
  1637. dnl **********************************
  1638. AC_MSG_CHECKING(for inet_ntop)
  1639. AC_TRY_LINK([
  1640. #include <stdio.h>
  1641. #include <arpa/inet.h>
  1642. ], [
  1643. inet_ntop (0, NULL, NULL, 0);
  1644. ], [
  1645. # Yes, we have it...
  1646. AC_MSG_RESULT(yes)
  1647. AC_DEFINE(HAVE_INET_NTOP, 1, [Have inet_ntop])
  1648. ], [
  1649. AC_MSG_RESULT(no)
  1650. ])
  1651. dnl *****************************
  1652. dnl *** Checks for libnsl ***
  1653. dnl *****************************
  1654. AC_CHECK_FUNC(gethostbyaddr, , AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl"))
  1655. AC_CHECK_FUNCS(inet_pton inet_aton)
  1656. dnl *****************************
  1657. dnl *** Checks for libxnet ***
  1658. dnl *****************************
  1659. case "${host}" in
  1660. *solaris* )
  1661. AC_MSG_CHECKING(for Solaris XPG4 support)
  1662. if test -f /usr/lib/libxnet.so; then
  1663. CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
  1664. CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
  1665. CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
  1666. LIBS="$LIBS -lxnet"
  1667. AC_MSG_RESULT(yes)
  1668. else
  1669. AC_MSG_RESULT(no)
  1670. fi
  1671. if test "$GCC" = "yes"; then
  1672. CFLAGS="$CFLAGS -Wno-char-subscripts"
  1673. fi
  1674. ;;
  1675. esac
  1676. dnl *****************************
  1677. dnl *** Checks for libpthread ***
  1678. dnl *****************************
  1679. # on FreeBSD -STABLE, the pthreads functions all reside in libc_r
  1680. # and libpthread does not exist
  1681. #
  1682. case "${host}" in
  1683. *-*-*haiku*)
  1684. dnl Haiku has pthread in libroot (libc equiv)
  1685. AC_CHECK_LIB(pthread, main, LIBS="$LIBS")
  1686. ;;
  1687. *-*-*freebsd*)
  1688. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
  1689. ;;
  1690. *-*-*openbsd*)
  1691. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
  1692. ;;
  1693. *)
  1694. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
  1695. ;;
  1696. esac
  1697. AC_CHECK_HEADERS(pthread.h)
  1698. AC_CHECK_HEADERS(pthread_np.h)
  1699. AC_CHECK_FUNCS(pthread_mutex_timedlock)
  1700. AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_setname_np)
  1701. AC_CHECK_FUNCS(pthread_kill)
  1702. AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
  1703. AC_TRY_COMPILE([ #include <pthread.h>], [
  1704. pthread_mutexattr_t attr;
  1705. pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  1706. ], [
  1707. AC_MSG_RESULT(ok)
  1708. ], [
  1709. AC_MSG_RESULT(no)
  1710. AC_ERROR(Posix system lacks support for recursive mutexes)
  1711. ])
  1712. AC_CHECK_FUNCS(pthread_attr_setstacksize)
  1713. AC_CHECK_FUNCS(pthread_attr_getstack pthread_attr_getstacksize)
  1714. AC_CHECK_FUNCS(pthread_get_stacksize_np pthread_get_stackaddr_np)
  1715. dnl **********************************
  1716. dnl *** Check for mincore ***
  1717. dnl **********************************
  1718. AC_MSG_CHECKING(for mincore)
  1719. AC_TRY_LINK([
  1720. #include <stdio.h>
  1721. #include <sys/types.h>
  1722. #include <sys/mman.h>
  1723. ], [
  1724. mincore(NULL, 0, NULL);
  1725. ], [
  1726. # Yes, we have it...
  1727. AC_MSG_RESULT(yes)
  1728. AC_DEFINE(HAVE_MINCORE, 1, [Have mincore])
  1729. ], [
  1730. AC_MSG_RESULT(no)
  1731. ])
  1732. dnl ***********************************
  1733. dnl *** Checks for working __thread ***
  1734. dnl ***********************************
  1735. AC_MSG_CHECKING(for working __thread)
  1736. if test "x$with_tls" != "x__thread"; then
  1737. AC_MSG_RESULT(disabled)
  1738. elif test "x$cross_compiling" = "xyes"; then
  1739. AC_MSG_RESULT(cross compiling, assuming yes)
  1740. else
  1741. AC_TRY_RUN([
  1742. #if defined(__APPLE__) && defined(__clang__)
  1743. #error "__thread does not currently work with clang on Mac OS X"
  1744. #endif
  1745. #include <pthread.h>
  1746. __thread int i;
  1747. static int res1, res2;
  1748. void thread_main (void *arg)
  1749. {
  1750. i = arg;
  1751. sleep (1);
  1752. if (arg == 1)
  1753. res1 = (i == arg);
  1754. else
  1755. res2 = (i == arg);
  1756. }
  1757. int main () {
  1758. pthread_t t1, t2;
  1759. i = 5;
  1760. pthread_create (&t1, NULL, thread_main, 1);
  1761. pthread_create (&t2, NULL, thread_main, 2);
  1762. pthread_join (t1, NULL);
  1763. pthread_join (t2, NULL);
  1764. return !(res1 + res2 == 2);
  1765. }
  1766. ], [
  1767. AC_MSG_RESULT(yes)
  1768. ], [
  1769. AC_MSG_RESULT(no)
  1770. with_tls=pthread
  1771. ])
  1772. fi
  1773. dnl **************************************
  1774. dnl *** Checks for working sigaltstack ***
  1775. dnl **************************************
  1776. AC_MSG_CHECKING(for working sigaltstack)
  1777. if test "x$with_sigaltstack" != "xyes"; then
  1778. AC_MSG_RESULT(disabled)
  1779. elif test "x$cross_compiling" = "xyes"; then
  1780. AC_MSG_RESULT(cross compiling, assuming yes)
  1781. else
  1782. AC_TRY_RUN([
  1783. #include <stdio.h>
  1784. #include <stdlib.h>
  1785. #include <unistd.h>
  1786. #include <signal.h>
  1787. #include <pthread.h>
  1788. #include <sys/wait.h>
  1789. #if defined(__FreeBSD__) || defined(__NetBSD__)
  1790. #define SA_STACK SA_ONSTACK
  1791. #endif
  1792. static void
  1793. sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
  1794. {
  1795. exit (0);
  1796. }
  1797. volatile char*__ptr = NULL;
  1798. static void *
  1799. loop (void *ignored)
  1800. {
  1801. *__ptr = 0;
  1802. return NULL;
  1803. }
  1804. static void
  1805. child ()
  1806. {
  1807. struct sigaction sa;
  1808. #ifdef __APPLE__
  1809. stack_t sas;
  1810. #else
  1811. struct sigaltstack sas;
  1812. #endif
  1813. pthread_t id;
  1814. pthread_attr_t attr;
  1815. sa.sa_sigaction = sigsegv_signal_handler;
  1816. sigemptyset (&sa.sa_mask);
  1817. sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
  1818. if (sigaction (SIGSEGV, &sa, NULL) == -1) {
  1819. perror ("sigaction");
  1820. return;
  1821. }
  1822. /* x86 darwin deliver segfaults using SIGBUS */
  1823. if (sigaction (SIGBUS, &sa, NULL) == -1) {
  1824. perror ("sigaction");
  1825. return;
  1826. }
  1827. sas.ss_sp = malloc (SIGSTKSZ);
  1828. sas.ss_size = SIGSTKSZ;
  1829. sas.ss_flags = 0;
  1830. if (sigaltstack (&sas, NULL) == -1) {
  1831. perror ("sigaltstack");
  1832. return;
  1833. }
  1834. pthread_attr_init (&attr);
  1835. if (pthread_create(&id, &attr, loop, &attr) != 0) {
  1836. printf ("pthread_create\n");
  1837. return;
  1838. }
  1839. sleep (100);
  1840. }
  1841. int
  1842. main ()
  1843. {
  1844. pid_t son;
  1845. int status;
  1846. int i;
  1847. son = fork ();
  1848. if (son == -1) {
  1849. return 1;
  1850. }
  1851. if (son == 0) {
  1852. child ();
  1853. return 0;
  1854. }
  1855. for (i = 0; i < 300; ++i) {
  1856. waitpid (son, &status, WNOHANG);
  1857. if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
  1858. return 0;
  1859. usleep (10000);
  1860. }
  1861. kill (son, SIGKILL);
  1862. return 1;
  1863. }
  1864. ], [
  1865. AC_MSG_RESULT(yes)
  1866. AC_DEFINE(HAVE_WORKING_SIGALTSTACK, 1, [Have a working sigaltstack])
  1867. ], [
  1868. with_sigaltstack=no
  1869. AC_MSG_RESULT(no)
  1870. ])
  1871. fi
  1872. dnl ********************************
  1873. dnl *** Checks for semaphore lib ***
  1874. dnl ********************************
  1875. # 'Real Time' functions on Solaris
  1876. # posix4 on Solaris 2.6
  1877. # pthread (first!) on Linux
  1878. AC_SEARCH_LIBS(sem_init, pthread rt posix4)
  1879. AC_SEARCH_LIBS(shm_open, pthread rt posix4)
  1880. AC_CHECK_FUNCS(shm_open)
  1881. dnl ********************************
  1882. dnl *** Checks for timezone stuff **
  1883. dnl ********************************
  1884. AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
  1885. AC_TRY_COMPILE([
  1886. #include <time.h>
  1887. ], [
  1888. struct tm tm;
  1889. tm.tm_gmtoff = 1;
  1890. ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
  1891. if test $ac_cv_struct_tm_gmtoff = yes; then
  1892. AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
  1893. else
  1894. AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
  1895. AC_TRY_COMPILE([
  1896. #include <time.h>
  1897. ], [
  1898. timezone = 1;
  1899. ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
  1900. if test $ac_cv_var_timezone = yes; then
  1901. AC_DEFINE(HAVE_TIMEZONE, 1, [Have timezone variable])
  1902. else
  1903. AC_ERROR(unable to find a way to determine timezone)
  1904. fi
  1905. fi
  1906. dnl *********************************
  1907. dnl *** Checks for math functions ***
  1908. dnl *********************************
  1909. AC_SEARCH_LIBS(sqrtf, m)
  1910. if test "x$has_broken_apple_cpp" != "xyes"; then
  1911. AC_CHECK_FUNCS(finite, , AC_MSG_CHECKING(for finite in math.h)
  1912. AC_TRY_LINK([#include <math.h>],
  1913. [ finite(0.0); ],
  1914. AC_DEFINE(HAVE_FINITE, 1, [Have finite in -lm]) AC_MSG_RESULT(yes),
  1915. AC_MSG_RESULT(no)))
  1916. fi
  1917. AC_CHECK_FUNCS(isfinite, , AC_MSG_CHECKING(for isfinite in math.h)
  1918. AC_TRY_LINK([#include <math.h>],
  1919. [ isfinite(0.0); ],
  1920. AC_DEFINE(HAVE_ISFINITE, 1, [Have isfinite]) AC_MSG_RESULT(yes),
  1921. AC_MSG_RESULT(no)))
  1922. dnl ****************************************************************
  1923. dnl *** Checks for working poll() (macosx defines it but doesn't ***
  1924. dnl *** have it in the library (duh)) ***
  1925. dnl ****************************************************************
  1926. AC_CHECK_FUNCS(poll)
  1927. dnl *************************
  1928. dnl *** Check for signbit ***
  1929. dnl *************************
  1930. AC_MSG_CHECKING(for signbit)
  1931. AC_TRY_LINK([#include <math.h>], [
  1932. int s = signbit(1.0);
  1933. ], [
  1934. AC_MSG_RESULT(yes)
  1935. AC_DEFINE(HAVE_SIGNBIT, 1, [Have signbit])
  1936. ], [
  1937. AC_MSG_RESULT(no)
  1938. ])
  1939. dnl **********************************
  1940. dnl *** epoll ***
  1941. dnl **********************************
  1942. AC_CHECK_HEADERS(sys/epoll.h)
  1943. haveepoll=no
  1944. AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
  1945. if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
  1946. AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
  1947. fi
  1948. havekqueue=no
  1949. AC_CHECK_HEADERS(sys/event.h)
  1950. AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
  1951. dnl **************************************
  1952. dnl * Darwin has a race that prevents us from using reliably:
  1953. dnl * http://lists.apple.com/archives/darwin-dev/2011/Jun/msg00016.html
  1954. dnl * Since kqueue is mostly used for scaling large web servers,
  1955. dnl * and very few folks run Mono on large web servers on OSX, falling
  1956. dnl * back
  1957. dnl **************************************
  1958. if test "x$havekqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"; then
  1959. if test "x$host_darwin" = "xno"; then
  1960. AC_DEFINE(USE_KQUEUE_FOR_THREADPOOL, 1, [Use kqueue for the threadpool])
  1961. fi
  1962. fi
  1963. dnl ******************************
  1964. dnl *** Checks for SIOCGIFCONF ***
  1965. dnl ******************************
  1966. AC_CHECK_HEADERS(sys/ioctl.h)
  1967. AC_CHECK_HEADERS(net/if.h, [], [],
  1968. [
  1969. #ifdef HAVE_SYS_TYPES_H
  1970. # include <sys/types.h>
  1971. #endif
  1972. #ifdef HAVE_SYS_SOCKET_H
  1973. # include <sys/socket.h>
  1974. #endif
  1975. ])
  1976. AC_MSG_CHECKING(for ifreq)
  1977. AC_TRY_COMPILE([
  1978. #include <stdio.h>
  1979. #include <sys/ioctl.h>
  1980. #include <net/if.h>
  1981. ], [
  1982. struct ifconf ifc;
  1983. struct ifreq *ifr;
  1984. void *x;
  1985. ifc.ifc_len = 0;
  1986. ifc.ifc_buf = NULL;
  1987. x = (void *) &ifr->ifr_addr;
  1988. ],[
  1989. AC_MSG_RESULT(yes)
  1990. AC_DEFINE(HAVE_SIOCGIFCONF, 1, [Can get interface list])
  1991. ], [
  1992. AC_MSG_RESULT(no)
  1993. ])
  1994. dnl **********************************
  1995. dnl *** Checks for sin_len ***
  1996. dnl **********************************
  1997. AC_MSG_CHECKING(for sockaddr_in.sin_len)
  1998. AC_TRY_COMPILE([
  1999. #include <netinet/in.h>
  2000. ], [
  2001. struct sockaddr_in saddr;
  2002. saddr.sin_len = sizeof (saddr);
  2003. ],[
  2004. AC_MSG_RESULT(yes)
  2005. AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [sockaddr_in has sin_len])
  2006. ], [
  2007. AC_MSG_RESULT(no)
  2008. ])
  2009. dnl **********************************
  2010. dnl *** Checks for sin6_len ***
  2011. dnl **********************************
  2012. AC_MSG_CHECKING(for sockaddr_in6.sin6_len)
  2013. AC_TRY_COMPILE([
  2014. #include <netinet/in.h>
  2015. ], [
  2016. struct sockaddr_in6 saddr6;
  2017. saddr6.sin6_len = sizeof (saddr6);
  2018. ],[
  2019. AC_MSG_RESULT(yes)
  2020. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN_LEN, 1, [sockaddr_in6 has sin6_len])
  2021. ], [
  2022. AC_MSG_RESULT(no)
  2023. ])
  2024. dnl **********************************
  2025. dnl *** Check for getifaddrs ***
  2026. dnl **********************************
  2027. AC_MSG_CHECKING(for getifaddrs)
  2028. AC_TRY_LINK([
  2029. #include <stdio.h>
  2030. #include <sys/types.h>
  2031. #include <sys/socket.h>
  2032. #include <ifaddrs.h>
  2033. ], [
  2034. getifaddrs(NULL);
  2035. ], [
  2036. # Yes, we have it...
  2037. AC_MSG_RESULT(yes)
  2038. AC_DEFINE(HAVE_GETIFADDRS, 1, [Have getifaddrs])
  2039. ], [
  2040. AC_MSG_RESULT(no)
  2041. ])
  2042. dnl **********************************
  2043. dnl *** Check for if_nametoindex ***
  2044. dnl **********************************
  2045. AC_MSG_CHECKING(for if_nametoindex)
  2046. AC_TRY_LINK([
  2047. #include <stdio.h>
  2048. #include <sys/types.h>
  2049. #include <sys/socket.h>
  2050. #include <net/if.h>
  2051. ], [
  2052. if_nametoindex(NULL);
  2053. ], [
  2054. # Yes, we have it...
  2055. AC_MSG_RESULT(yes)
  2056. AC_DEFINE(HAVE_IF_NAMETOINDEX, 1, [Have if_nametoindex])
  2057. ], [
  2058. AC_MSG_RESULT(no)
  2059. ])
  2060. dnl **********************************
  2061. dnl *** Checks for proclib ***
  2062. dnl **********************************
  2063. AC_CHECK_HEADER(sys/errno.h, [AC_DEFINE(HAVE_SYS_ERRNO_H, 1, Define to 1 if you have the <sys/errno.h> header file.)])
  2064. dnl **********************************
  2065. dnl *** Checks for MonoPosixHelper ***
  2066. dnl **********************************
  2067. AC_CHECK_HEADERS(checklist.h)
  2068. AC_CHECK_HEADERS(pathconf.h)
  2069. AC_CHECK_HEADERS(fstab.h)
  2070. AC_CHECK_HEADERS(attr/xattr.h)
  2071. AC_CHECK_HEADERS(sys/extattr.h)
  2072. AC_CHECK_HEADERS(sys/sendfile.h)
  2073. AC_CHECK_HEADERS(sys/statvfs.h)
  2074. AC_CHECK_HEADERS(sys/statfs.h)
  2075. AC_CHECK_HEADERS(sys/vfstab.h)
  2076. AC_CHECK_HEADERS(sys/xattr.h)
  2077. AC_CHECK_HEADERS(sys/mman.h)
  2078. AC_CHECK_HEADERS(sys/param.h)
  2079. AC_CHECK_HEADERS(sys/mount.h, [], [],
  2080. [
  2081. #ifdef HAVE_SYS_PARAM_H
  2082. # include <sys/param.h>
  2083. #endif
  2084. ])
  2085. AC_CHECK_HEADERS(sys/mount.h)
  2086. AC_CHECK_FUNCS(confstr)
  2087. AC_CHECK_FUNCS(seekdir telldir)
  2088. AC_CHECK_FUNCS(getdomainname)
  2089. AC_CHECK_FUNCS(setdomainname)
  2090. AC_CHECK_FUNCS(endgrent getgrent fgetgrent setgrent)
  2091. AC_CHECK_FUNCS(setgroups)
  2092. AC_CHECK_FUNCS(endpwent getpwent fgetpwent setpwent)
  2093. AC_CHECK_FUNCS(getfsstat)
  2094. AC_CHECK_FUNCS(lutimes futimes)
  2095. AC_CHECK_FUNCS(mremap)
  2096. AC_CHECK_FUNCS(remap_file_pages)
  2097. AC_CHECK_FUNCS(posix_fadvise)
  2098. AC_CHECK_FUNCS(posix_fallocate)
  2099. AC_CHECK_FUNCS(posix_madvise)
  2100. AC_CHECK_FUNCS(vsnprintf)
  2101. AC_CHECK_FUNCS(sendfile)
  2102. AC_CHECK_FUNCS(gethostid sethostid)
  2103. AC_CHECK_FUNCS(sethostname)
  2104. AC_CHECK_FUNCS(statfs)
  2105. AC_CHECK_FUNCS(fstatfs)
  2106. AC_CHECK_FUNCS(statvfs)
  2107. AC_CHECK_FUNCS(fstatvfs)
  2108. AC_CHECK_FUNCS(stime)
  2109. AC_CHECK_FUNCS(strerror_r)
  2110. AC_CHECK_FUNCS(ttyname_r)
  2111. AC_CHECK_FUNCS(psignal)
  2112. AC_CHECK_FUNCS(getlogin_r)
  2113. AC_CHECK_FUNCS(lockf)
  2114. AC_CHECK_FUNCS(swab)
  2115. AC_CHECK_FUNCS(setusershell endusershell)
  2116. AC_CHECK_FUNCS(futimens utimensat)
  2117. AC_CHECK_FUNCS(fstatat mknodat readlinkat)
  2118. AC_CHECK_FUNCS(readv writev preadv pwritev)
  2119. AC_CHECK_FUNCS(setpgid)
  2120. AC_CHECK_FUNCS(system)
  2121. AC_CHECK_FUNCS(fork execv execve)
  2122. AC_CHECK_FUNCS(accept4)
  2123. AC_CHECK_FUNCS(localtime_r)
  2124. AC_CHECK_FUNCS(mkdtemp)
  2125. AC_CHECK_SIZEOF(size_t)
  2126. AC_CHECK_TYPES([blksize_t], [AC_DEFINE(HAVE_BLKSIZE_T)], ,
  2127. [#include <sys/types.h>
  2128. #include <sys/stat.h>
  2129. #include <unistd.h>])
  2130. AC_CHECK_TYPES([blkcnt_t], [AC_DEFINE(HAVE_BLKCNT_T)], ,
  2131. [#include <sys/types.h>
  2132. #include <sys/stat.h>
  2133. #include <unistd.h>])
  2134. AC_CHECK_TYPES([suseconds_t], [AC_DEFINE(HAVE_SUSECONDS_T)], ,
  2135. [#include <sys/time.h>])
  2136. AC_CHECK_TYPES([struct cmsghdr], [AC_DEFINE(HAVE_STRUCT_CMSGHDR)], ,
  2137. [#include <sys/socket.h>])
  2138. AC_CHECK_TYPES([struct flock], [AC_DEFINE(HAVE_STRUCT_FLOCK)], ,
  2139. [#include <unistd.h>
  2140. #include <fcntl.h>])
  2141. AC_CHECK_TYPES([struct iovec], [AC_DEFINE(HAVE_STRUCT_IOVEC)], ,
  2142. [#include <sys/uio.h>])
  2143. AC_CHECK_TYPES([struct linger], [AC_DEFINE(HAVE_STRUCT_LINGER)], ,
  2144. [#include <sys/socket.h>])
  2145. AC_CHECK_TYPES([struct pollfd], [AC_DEFINE(HAVE_STRUCT_POLLFD)], ,
  2146. [#include <sys/poll.h>])
  2147. AC_CHECK_TYPES([struct sockaddr], [AC_DEFINE(HAVE_STRUCT_SOCKADDR)], ,
  2148. [#include <sys/socket.h>])
  2149. AC_CHECK_TYPES([struct sockaddr_storage], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)], ,
  2150. [#include <sys/socket.h>])
  2151. AC_CHECK_TYPES([struct sockaddr_in], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN)], ,
  2152. [#include <netinet/in.h>])
  2153. AC_CHECK_TYPES([struct sockaddr_in6], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)], ,
  2154. [#include <netinet/in.h>])
  2155. AC_CHECK_TYPES([struct sockaddr_un], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_UN)], ,
  2156. [#include <sys/un.h>])
  2157. AC_CHECK_TYPES([struct stat], [AC_DEFINE(HAVE_STRUCT_STAT)], ,
  2158. [#include <sys/types.h>
  2159. #include <sys/stat.h>
  2160. #include <unistd.h>])
  2161. AC_CHECK_TYPES([struct timespec], [AC_DEFINE(HAVE_STRUCT_TIMESPEC)], ,
  2162. [#include <time.h>])
  2163. AC_CHECK_TYPES([struct timeval], [AC_DEFINE(HAVE_STRUCT_TIMEVAL)], ,
  2164. [#include <sys/time.h>
  2165. #include <sys/types.h>
  2166. #include <utime.h>])
  2167. AC_CHECK_TYPES([struct timezone], [AC_DEFINE(HAVE_STRUCT_TIMEZONE)], ,
  2168. [#include <sys/time.h>])
  2169. AC_CHECK_TYPES([struct utimbuf], [AC_DEFINE(HAVE_STRUCT_UTIMBUF)], ,
  2170. [#include <sys/types.h>
  2171. #include <utime.h>])
  2172. AC_CHECK_MEMBERS(
  2173. [struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,,
  2174. [#include <sys/types.h>
  2175. #include <dirent.h>])
  2176. AC_CHECK_MEMBERS(
  2177. [struct passwd.pw_gecos],,,
  2178. [#include <sys/types.h>
  2179. #include <pwd.h>])
  2180. AC_CHECK_MEMBERS(
  2181. [struct statfs.f_flags],,,
  2182. [#include <sys/types.h>
  2183. #include <sys/vfs.h>])
  2184. AC_CHECK_MEMBERS(
  2185. [struct stat.st_atim, struct stat.st_mtim, struct stat.st_ctim],,,
  2186. [#include <sys/types.h>
  2187. #include <sys/stat.h>
  2188. #include <unistd.h>])
  2189. dnl Favour xattr through glibc, but use libattr if we have to
  2190. AC_CHECK_FUNC(lsetxattr, ,
  2191. AC_CHECK_LIB(attr, lsetxattr, XATTR_LIB="-lattr",)
  2192. )
  2193. AC_SUBST(XATTR_LIB)
  2194. dnl kinfo_proc.kp_proc works on darwin but fails on other simil-bsds
  2195. AC_CHECK_MEMBERS(
  2196. [struct kinfo_proc.kp_proc],,,
  2197. [#include <sys/types.h>
  2198. #include <sys/param.h>
  2199. #include <sys/sysctl.h>
  2200. #include <sys/proc.h>
  2201. ])
  2202. dnl *********************************
  2203. dnl *** Checks for Windows compilation ***
  2204. dnl *********************************
  2205. AC_CHECK_HEADERS(sys/time.h)
  2206. AC_CHECK_HEADERS(sys/param.h)
  2207. AC_CHECK_HEADERS(dirent.h)
  2208. dnl ******************************************
  2209. dnl *** Checks for OSX and iOS compilation ***
  2210. dnl ******************************************
  2211. AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
  2212. dnl *********************************
  2213. dnl *** Check for Console 2.0 I/O ***
  2214. dnl *********************************
  2215. AC_CHECK_HEADERS([curses.h])
  2216. AC_CHECK_HEADERS([term.h], [], [],
  2217. [#if HAVE_CURSES_H
  2218. #include <curses.h>
  2219. #endif
  2220. ])
  2221. AC_CHECK_HEADERS([termios.h])
  2222. else
  2223. dnl *********************************
  2224. dnl *** Checks for Windows compilation ***
  2225. dnl *********************************
  2226. AC_CHECK_HEADERS(winternl.h)
  2227. jdk_headers_found=no
  2228. AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
  2229. AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
  2230. AC_CHECK_LIB(ole32, main, LIBS="$LIBS -lole32", AC_ERROR(bad mingw install?))
  2231. AC_CHECK_LIB(winmm, main, LIBS="$LIBS -lwinmm", AC_ERROR(bad mingw install?))
  2232. AC_CHECK_LIB(oleaut32, main, LIBS="$LIBS -loleaut32", AC_ERROR(bad mingw install?))
  2233. AC_CHECK_LIB(advapi32, main, LIBS="$LIBS -ladvapi32", AC_ERROR(bad mingw install?))
  2234. AC_CHECK_LIB(version, main, LIBS="$LIBS -lversion", AC_ERROR(bad mingw install?))
  2235. dnl *********************************
  2236. dnl *** Check for struct ip_mreqn ***
  2237. dnl *********************************
  2238. AC_MSG_CHECKING(for struct ip_mreqn)
  2239. AC_TRY_COMPILE([#include <ws2tcpip.h>], [
  2240. struct ip_mreqn mreq;
  2241. mreq.imr_address.s_addr = 0;
  2242. ], [
  2243. # Yes, we have it...
  2244. AC_MSG_RESULT(yes)
  2245. AC_DEFINE(HAVE_STRUCT_IP_MREQN)
  2246. ], [
  2247. # We'll just have to try and use struct ip_mreq
  2248. AC_MSG_RESULT(no)
  2249. AC_MSG_CHECKING(for struct ip_mreq)
  2250. AC_TRY_COMPILE([#include <ws2tcpip.h>], [
  2251. struct ip_mreq mreq;
  2252. mreq.imr_interface.s_addr = 0;
  2253. ], [
  2254. # Yes, we have it...
  2255. AC_MSG_RESULT(yes)
  2256. AC_DEFINE(HAVE_STRUCT_IP_MREQ)
  2257. ], [
  2258. # No multicast support
  2259. AC_MSG_RESULT(no)
  2260. ])
  2261. ])
  2262. dnl **********************************
  2263. dnl *** Check for getaddrinfo ***
  2264. dnl **********************************
  2265. AC_MSG_CHECKING(for getaddrinfo)
  2266. AC_TRY_LINK([
  2267. #include <stdio.h>
  2268. #include <winsock2.h>
  2269. #include <ws2tcpip.h>
  2270. ], [
  2271. getaddrinfo(NULL,NULL,NULL,NULL);
  2272. ], [
  2273. # Yes, we have it...
  2274. AC_MSG_RESULT(yes)
  2275. AC_DEFINE(HAVE_GETADDRINFO, 1, [Have getaddrinfo])
  2276. ], [
  2277. AC_MSG_RESULT(no)
  2278. ])
  2279. dnl **********************************
  2280. dnl *** Check for gethostbyname ***
  2281. dnl **********************************
  2282. AC_MSG_CHECKING(for gethostbyname)
  2283. AC_TRY_LINK([
  2284. #include <stdio.h>
  2285. #include <winsock2.h>
  2286. #include <ws2tcpip.h>
  2287. ], [
  2288. gethostbyname(NULL);
  2289. ], [
  2290. # Yes, we have it...
  2291. AC_MSG_RESULT(yes)
  2292. AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [Have gethostbyname])
  2293. ], [
  2294. AC_MSG_RESULT(no)
  2295. ])
  2296. dnl **********************************
  2297. dnl *** Check for getprotobyname ***
  2298. dnl **********************************
  2299. AC_MSG_CHECKING(for getprotobyname)
  2300. AC_TRY_LINK([
  2301. #include <stdio.h>
  2302. #include <winsock2.h>
  2303. #include <ws2tcpip.h>
  2304. ], [
  2305. getprotobyname(NULL);
  2306. ], [
  2307. # Yes, we have it...
  2308. AC_MSG_RESULT(yes)
  2309. AC_DEFINE(HAVE_GETPROTOBYNAME, 1, [Have getprotobyname])
  2310. ], [
  2311. AC_MSG_RESULT(no)
  2312. ])
  2313. dnl **********************************
  2314. dnl *** Check for getnameinfo ***
  2315. dnl **********************************
  2316. AC_MSG_CHECKING(for getnameinfo)
  2317. AC_TRY_LINK([
  2318. #include <stdio.h>
  2319. #include <winsock2.h>
  2320. #include <ws2tcpip.h>
  2321. ], [
  2322. getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);
  2323. ], [
  2324. # Yes, we have it...
  2325. AC_MSG_RESULT(yes)
  2326. AC_DEFINE(HAVE_GETNAMEINFO, 1, [Have getnameinfo])
  2327. ], [
  2328. AC_MSG_RESULT(no)
  2329. ])
  2330. dnl **********************************
  2331. dnl *** Check for inet_ntop ***
  2332. dnl **********************************
  2333. AC_MSG_CHECKING(for inet_ntop)
  2334. AC_TRY_LINK([
  2335. #include <stdio.h>
  2336. #include <winsock2.h>
  2337. #include <ws2tcpip.h>
  2338. ], [
  2339. inet_ntop (0, NULL, NULL, 0);
  2340. ], [
  2341. # Yes, we have it...
  2342. AC_MSG_RESULT(yes)
  2343. AC_DEFINE(HAVE_INET_NTOP, 1, [Have inet_ntop])
  2344. ], [
  2345. AC_MSG_RESULT(no)
  2346. ])
  2347. dnl **********************************
  2348. dnl *** Check for inet_pton ***
  2349. dnl **********************************
  2350. AC_MSG_CHECKING(for inet_pton)
  2351. AC_TRY_LINK([
  2352. #include <stdio.h>
  2353. #include <winsock2.h>
  2354. #include <ws2tcpip.h>
  2355. ], [
  2356. #ifndef inet_pton
  2357. (void) inet_pton;
  2358. #endif
  2359. inet_pton (0, NULL, NULL);
  2360. ], [
  2361. # Yes, we have it...
  2362. AC_MSG_RESULT(yes)
  2363. AC_DEFINE(HAVE_INET_PTON, 1, [Have inet_pton])
  2364. ], [
  2365. AC_MSG_RESULT(no)
  2366. ])
  2367. AC_CHECK_DECLS(InterlockedExchange64, [], [], [[#include <windows.h>]])
  2368. AC_CHECK_DECLS(InterlockedCompareExchange64, [], [], [[#include <windows.h>]])
  2369. AC_CHECK_DECLS(InterlockedDecrement64, [], [], [[#include <windows.h>]])
  2370. AC_CHECK_DECLS(InterlockedIncrement64, [], [], [[#include <windows.h>]])
  2371. AC_CHECK_DECLS(InterlockedAdd, [], [], [[#include <windows.h>]])
  2372. AC_CHECK_DECLS(InterlockedAdd64, [], [], [[#include <windows.h>]])
  2373. AC_CHECK_DECLS(__readfsdword, [], [], [[#include <windows.h>]])
  2374. fi
  2375. dnl socklen_t check
  2376. AC_MSG_CHECKING(for socklen_t)
  2377. AC_TRY_COMPILE([
  2378. #include <sys/types.h>
  2379. #include <sys/socket.h>
  2380. ],[
  2381. socklen_t foo;
  2382. ],[
  2383. ac_cv_c_socklen_t=yes
  2384. AC_DEFINE(HAVE_SOCKLEN_T, 1, [Have socklen_t])
  2385. AC_MSG_RESULT(yes)
  2386. ],[
  2387. AC_MSG_RESULT(no)
  2388. ])
  2389. AC_MSG_CHECKING(for array element initializer support)
  2390. AC_TRY_COMPILE([#include <sys/socket.h>], [
  2391. const int array[] = {[1] = 2,};
  2392. ], [
  2393. # Yes, we have it...
  2394. AC_MSG_RESULT(yes)
  2395. AC_DEFINE(HAVE_ARRAY_ELEM_INIT,1,[Supports C99 array initialization])
  2396. ], [
  2397. # We'll have to use signals
  2398. AC_MSG_RESULT(no)
  2399. ])
  2400. AC_CHECK_FUNCS(trunc, , AC_MSG_CHECKING(for trunc in math.h)
  2401. # Simply calling trunc (0.0) is no good since gcc will optimize the call away
  2402. AC_TRY_LINK([#include <math.h>],
  2403. [ static void *p = &trunc; ],
  2404. [
  2405. AC_DEFINE(HAVE_TRUNC)
  2406. AC_MSG_RESULT(yes)
  2407. ac_cv_trunc=yes
  2408. ],
  2409. AC_MSG_RESULT(no)))
  2410. if test "x$ac_cv_truncl" != "xyes"; then
  2411. AC_CHECK_LIB(sunmath, aintl, [ AC_DEFINE(HAVE_AINTL, 1, [Has the 'aintl' function]) LIBS="$LIBS -lsunmath"])
  2412. fi
  2413. AC_CHECK_FUNCS(execvp)
  2414. dnl ****************************
  2415. dnl *** Look for /dev/random ***
  2416. dnl ****************************
  2417. AC_MSG_CHECKING([if usage of random device is requested])
  2418. AC_ARG_ENABLE(dev-random,
  2419. [ --disable-dev-random disable the use of the random device (enabled by default)],
  2420. try_dev_random=$enableval, try_dev_random=yes)
  2421. AC_MSG_RESULT($try_dev_random)
  2422. case "{$build}" in
  2423. *-openbsd*)
  2424. NAME_DEV_RANDOM="/dev/srandom"
  2425. ;;
  2426. dnl Win32 does not have /dev/random, they have their own method...
  2427. *-mingw*|*-*-cygwin*)
  2428. ac_cv_have_dev_random=no
  2429. ;;
  2430. dnl Everywhere else, it's /dev/random
  2431. *)
  2432. NAME_DEV_RANDOM="/dev/random"
  2433. ;;
  2434. esac
  2435. AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM", [Name of /dev/random])
  2436. dnl Now check if the device actually exists
  2437. if test "x$try_dev_random" = "xyes"; then
  2438. AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
  2439. [if test -r "$NAME_DEV_RANDOM" ; then
  2440. ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
  2441. if test "x$ac_cv_have_dev_random" = "xyes"; then
  2442. AC_DEFINE(HAVE_CRYPT_RNG, 1, [Have /dev/random])
  2443. fi
  2444. else
  2445. AC_MSG_CHECKING(for random device)
  2446. ac_cv_have_dev_random=no
  2447. AC_MSG_RESULT(has been disabled)
  2448. fi
  2449. if test "x$host_win32" = "xyes"; then
  2450. AC_DEFINE(HAVE_CRYPT_RNG)
  2451. fi
  2452. if test "x$ac_cv_have_dev_random" = "xno" \
  2453. && test "x$host_win32" = "xno"; then
  2454. AC_MSG_WARN([[
  2455. ***
  2456. *** A system-provided entropy source was not found on this system.
  2457. *** Because of this, the System.Security.Cryptography random number generator
  2458. *** will throw a NotImplemented exception.
  2459. ***
  2460. *** If you are seeing this message, and you know your system DOES have an
  2461. *** entropy collection in place, please contact <[email protected]> and
  2462. *** provide information about the system and how to access the random device.
  2463. ***
  2464. *** Otherwise you can install either egd or prngd and set the environment
  2465. *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
  2466. ***]])
  2467. fi
  2468. AC_ARG_ENABLE(bcl-opt, [ --disable-bcl-opt BCL is compiled with no optimizations (allows accurate BCL debugging)], test_bcl_opt=$enableval, test_bcl_opt=yes)
  2469. AC_MSG_CHECKING([if big-arrays are to be enabled])
  2470. AC_ARG_ENABLE(big-arrays, [ --enable-big-arrays Enable the allocation and indexing of arrays greater than Int32.MaxValue], enable_big_arrays=$enableval, enable_big_arrays=no)
  2471. if test "x$enable_big_arrays" = "xyes" ; then
  2472. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  2473. AC_DEFINE(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
  2474. else
  2475. AC_MSG_ERROR([The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform.])
  2476. fi
  2477. fi
  2478. AC_MSG_RESULT($enable_big_arrays)
  2479. dnl **************
  2480. dnl *** DTRACE ***
  2481. dnl **************
  2482. AC_ARG_ENABLE(dtrace,[ --enable-dtrace Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=$has_dtrace)
  2483. if test "x$enable_dtrace" = "xyes"; then
  2484. if test "x$has_dtrace" = "xno"; then
  2485. AC_MSG_ERROR([DTrace probes are not supported on this platform.])
  2486. fi
  2487. AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
  2488. if test "x$DTRACE" = "xno"; then
  2489. AC_MSG_RESULT([dtrace utility not found, dtrace support disabled.])
  2490. enable_dtrace=no
  2491. elif ! $DTRACE -h -s $srcdir/data/mono.d > /dev/null 2>&1; then
  2492. AC_MSG_RESULT([dtrace doesn't support -h option, dtrace support disabled.])
  2493. enable_dtrace=no
  2494. fi
  2495. fi
  2496. dtrace_g=no
  2497. if test "x$enable_dtrace" = "xyes"; then
  2498. AC_DEFINE(ENABLE_DTRACE, 1, [Enable DTrace probes])
  2499. DTRACEFLAGS=
  2500. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  2501. case "$host" in
  2502. powerpc-*-darwin*)
  2503. DTRACEFLAGS="-arch ppc64"
  2504. ;;
  2505. i*86-*-darwin*)
  2506. DTRACEFLAGS="-arch x86_64"
  2507. ;;
  2508. *)
  2509. DTRACEFLAGS=-64
  2510. ;;
  2511. esac
  2512. else
  2513. case "$host" in
  2514. powerpc-*-darwin*)
  2515. DTRACEFLAGS="-arch ppc"
  2516. ;;
  2517. i*86-*-darwin*)
  2518. DTRACEFLAGS="-arch i386"
  2519. ;;
  2520. *)
  2521. DTRACEFLAGS=-32
  2522. ;;
  2523. esac
  2524. fi
  2525. AC_SUBST(DTRACEFLAGS)
  2526. case "$host" in
  2527. *-*-solaris*)
  2528. dtrace_g=yes
  2529. ;;
  2530. esac
  2531. AC_CHECK_HEADERS([sys/sdt.h])
  2532. fi
  2533. AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
  2534. AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
  2535. dnl **************************
  2536. dnl *** AOT cross offsets ***
  2537. dnl **************************
  2538. AC_ARG_WITH(cross-offsets, [ --with-cross-offsets=<offsets file path> Explicit AOT cross offsets file],
  2539. AC_DEFINE_UNQUOTED(MONO_OFFSETS_FILE, "$withval", [AOT cross offsets file]))
  2540. dnl **************
  2541. dnl *** LLVM ***
  2542. dnl **************
  2543. AC_ARG_ENABLE(llvm,[ --enable-llvm Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=default)
  2544. AC_ARG_ENABLE(loadedllvm,[ --enable-loadedllvm Load the LLVM back-end dynamically], enable_llvm=$enableval && enable_loadedllvm=$enableval, enable_loadedllvm=no)
  2545. AC_ARG_ENABLE(llvm-version-check,[ --enable-llvm-version-check Check that the LLVM matches the version expected by mono], enable_llvm_version_check=$enableval, enable_llvm_version_check=no)
  2546. AC_ARG_ENABLE(llvm-runtime,[ --enable-llvm-runtime Enable runtime support for llvmonly code], enable_llvm_runtime=$enableval, enable_llvm_runtime=no)
  2547. AC_ARG_WITH(llvm, [ --with-llvm=<llvm prefix> Enable the LLVM back-end], enable_llvm=yes,)
  2548. if test "x$enable_llvm" = "xdefault"; then
  2549. enable_llvm=$enable_llvm_default
  2550. fi
  2551. if test "x$enable_llvm" = "xyes"; then
  2552. if test "x$with_llvm" != "x"; then
  2553. LLVM_CONFIG=$with_llvm/bin/llvm-config
  2554. if test x$host_win32 = xyes; then
  2555. LLVM_CONFIG=$LLVM_CONFIG.exe
  2556. fi
  2557. if test ! -x $LLVM_CONFIG; then
  2558. AC_MSG_ERROR([LLVM executable $LLVM_CONFIG not found.])
  2559. fi
  2560. else
  2561. AC_PATH_PROG(LLVM_CONFIG, llvm-config, no)
  2562. if test "x$LLVM_CONFIG" = "xno"; then
  2563. AC_MSG_ERROR([llvm-config not found.])
  2564. fi
  2565. fi
  2566. llvm_codegen="x86codegen"
  2567. case "$target" in
  2568. arm*)
  2569. llvm_codegen="armcodegen"
  2570. ;;
  2571. esac
  2572. if test "x$host_win32" = "xno"; then
  2573. # Should be something like '2.6' or '2.7svn'
  2574. llvm_version=`$LLVM_CONFIG --version`
  2575. llvm_api_version=`$LLVM_CONFIG --mono-api-version 2>/dev/null`
  2576. AC_MSG_CHECKING(LLVM version)
  2577. AC_MSG_RESULT($llvm_version $llvm_api_version)
  2578. if echo $llvm_version | grep -q 'mono'; then
  2579. if test "x$enable_llvm_version_check" = "xyes"; then
  2580. if test "$llvm_version" != "$expected_llvm_version"; then
  2581. AC_MSG_ERROR([Expected llvm version $expected_llvm_version, but llvm-config --version returned $llvm_version"])
  2582. fi
  2583. fi
  2584. else
  2585. AC_MSG_ERROR([Compiling with stock LLVM is not supported, please use the Mono LLVM repo at https://github.com/mono/llvm, with the GIT branch which matches this version of mono, i.e. 'mono-2-10' for Mono 2.10.])
  2586. fi
  2587. # The output of --cflags seems to include optimizations flags too
  2588. if test $llvm_api_version -gt 100; then
  2589. # The --cflags argument includes all kinds of warnings -pendantic etc.
  2590. LLVM_CFLAGS="-I$with_llvm/include -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
  2591. LLVM_CXXFLAGS="-I$with_llvm/include -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
  2592. else
  2593. LLVM_CFLAGS=`$LLVM_CONFIG --cflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
  2594. LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags | sed -e 's/-O2//g' | sed -e 's/-O0//g' | sed -e 's/-fomit-frame-pointer//g' | sed -e 's/-fPIC//g'`
  2595. fi
  2596. # LLVM is compiled with -fno-rtti, so we need this too, since our classes inherit
  2597. # from LLVM classes.
  2598. LLVM_CXXFLAGS="$LLVM_CXXFLAGS -fno-rtti -fexceptions"
  2599. LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
  2600. # This might include empty lines
  2601. LLVM_SYSTEM_LIBS=`$LLVM_CONFIG --system-libs 2>/dev/null | grep -- -`
  2602. llvm_jit_supported=yes
  2603. llvm_jit_libs="jit mcjit $llvm_codegen"
  2604. if test "x$host" != "x$target"; then
  2605. # No need for jit libs
  2606. llvm_jit_supported=no
  2607. llvm_jit_libs=""
  2608. elif test $llvm_api_version -gt 100; then
  2609. llvm_jit_libs="orcjit $llvm_codegen"
  2610. fi
  2611. LLVM_LIBS=`$LLVM_CONFIG --libs analysis core bitwriter $llvm_jit_libs`
  2612. if test "x$LLVM_LIBS" = "x"; then
  2613. echo "$LLVM_CONFIG --libs failed."
  2614. exit 1
  2615. fi
  2616. LLVM_LIBS="$LLVM_LIBS $LLVM_LDFLAGS $LLVM_SYSTEM_LIBS"
  2617. # The c++ standard library used by llvm doesn't show up in $LLVM_SYSTEM_LIBS so add it manually
  2618. if echo $LLVM_CXXFLAGS | grep -q -- '-stdlib=libc++'; then
  2619. LLVM_LIBS="$LLVM_LIBS -lc++"
  2620. else
  2621. LLVM_LIBS="$LLVM_LIBS -lstdc++"
  2622. fi
  2623. expected_llvm_version="3.4svn-mono-mono/e656cac"
  2624. else
  2625. LLVM_CFLAGS="-I$with_llvm/include -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS"
  2626. LLVM_CXXFLAGS="$LLVM_CFLAGS -std=gnu++11 -fvisibility-inlines-hidden -fno-rtti -Woverloaded-virtual -Wcast-qual"
  2627. LLVM_LDFLAGS="-L$with_llvm/lib"
  2628. LLVM_SYSTEM_LIBS="-lshell32 -lpsapi -limagehlp -ldbghelp -lm"
  2629. LLVM_LIBS="-lLLVMLTO -lLLVMObjCARCOpts -lLLVMLinker -lLLVMipo -lLLVMVectorize -lLLVMBitWriter \
  2630. -lLLVMARMDisassembler -lLLVMARMCodeGen -lLLVMARMAsmParser -lLLVMARMDesc -lLLVMARMInfo \
  2631. -lLLVMARMAsmPrinter -lLLVMTableGen -lLLVMDebugInfo -lLLVMOption -lLLVMX86Disassembler \
  2632. -lLLVMX86AsmParser -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Desc \
  2633. -lLLVMMCDisassembler -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT \
  2634. -lLLVMAnalysis -lLLVMTarget \
  2635. -lLLVMIRReader -lLLVMAsmParser -lLLVMLineEditor -lLLVMMCAnalysis -lLLVMInstrumentation \
  2636. -lLLVMInterpreter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils \
  2637. -lLLVMipa -lLLVMAnalysis -lLLVMProfileData -lLLVMMCJIT -lLLVMTarget -lLLVMRuntimeDyld \
  2638. -lLLVMObject -lLLVMMCParser -lLLVMBitReader -lLLVMExecutionEngine -lLLVMMC -lLLVMCore \
  2639. -lLLVMSupport -lstdc++"
  2640. LLVM_LIBS="$LLVM_LIBS $LLVM_SYSTEM_LIBS"
  2641. llvm_config_path=$with_llvm/include/llvm/Config/llvm-config.h
  2642. llvm_api_version=`awk '/MONO_API_VERSION/ { print $3 }' $llvm_config_path`
  2643. fi
  2644. if test "x$llvm_api_version" = "x"; then
  2645. LLVM_CFLAGS="$LLVM_CFLAGS -DLLVM_API_VERSION=0"
  2646. LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_API_VERSION=0"
  2647. else
  2648. LLVM_CFLAGS="$LLVM_CFLAGS -DLLVM_API_VERSION=$llvm_api_version"
  2649. LLVM_CXXFLAGS="$LLVM_CXXFLAGS -DLLVM_API_VERSION=$llvm_api_version"
  2650. fi
  2651. AC_DEFINE_UNQUOTED(LLVM_VERSION, "$llvm_version", [Full version of LLVM libraries])
  2652. AC_SUBST(LLVM_CFLAGS)
  2653. AC_SUBST(LLVM_CXXFLAGS)
  2654. AC_SUBST(LLVM_LIBS)
  2655. AC_SUBST(LLVM_LDFLAGS)
  2656. AC_DEFINE(ENABLE_LLVM, 1, [Enable the LLVM back end])
  2657. fi
  2658. AM_CONDITIONAL(ENABLE_LLVM, [test x$enable_llvm = xyes])
  2659. if test "x$enable_loadedllvm" = "xyes"; then
  2660. AC_DEFINE(MONO_LLVM_LOADED, 1, [The LLVM back end is dynamically loaded])
  2661. fi
  2662. AM_CONDITIONAL(LOADED_LLVM, [test x$enable_loadedllvm = xyes])
  2663. if test "x$enable_llvm" = "xyes"; then
  2664. enable_llvm_runtime=yes
  2665. fi
  2666. if test "x$enable_llvm_runtime" = "xyes"; then
  2667. AC_DEFINE(ENABLE_LLVM_RUNTIME, 1, [Runtime support code for llvm enabled])
  2668. fi
  2669. AM_CONDITIONAL(ENABLE_LLVM_RUNTIME, [test x$enable_llvm_runtime = xyes])
  2670. TARGET="unknown"
  2671. ACCESS_UNALIGNED="yes"
  2672. LIBC="libc.so.6"
  2673. INTL="libc.so.6"
  2674. SQLITE="libsqlite.so.0"
  2675. SQLITE3="libsqlite3.so.0"
  2676. X11="libX11.so"
  2677. GDKX11="libgdk-x11-2.0.so.0"
  2678. GTKX11="libgtk-x11-2.0.so.0"
  2679. XINERAMA="libXinerama.so.1"
  2680. sizeof_register="SIZEOF_VOID_P"
  2681. jit_wanted=true
  2682. boehm_supported=true
  2683. BTLS_SUPPORTED=no
  2684. BTLS_PLATFORM=
  2685. case "$host" in
  2686. mips*)
  2687. TARGET=MIPS;
  2688. arch_target=mips;
  2689. with_tls=pthread;
  2690. ACCESS_UNALIGNED="no"
  2691. AC_MSG_CHECKING(for mips n32)
  2692. AC_TRY_COMPILE([],[
  2693. #if _MIPS_SIM != _ABIN32
  2694. #error Not mips n32
  2695. #endif
  2696. return 0;
  2697. ],[
  2698. AC_MSG_RESULT(yes)
  2699. sizeof_register=8
  2700. ],[
  2701. AC_MSG_RESULT(no)
  2702. ])
  2703. ;;
  2704. i*86-*-*)
  2705. TARGET=X86;
  2706. arch_target=x86;
  2707. case $host_os in
  2708. solaris*)
  2709. LIBC="libc.so"
  2710. INTL="libintl.so"
  2711. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  2712. TARGET=AMD64
  2713. arch_target=amd64
  2714. fi
  2715. # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. A test case:
  2716. # int astruct __attribute__ ((visibility ("hidden")));
  2717. # void foo ()
  2718. # {
  2719. # void *p = &astruct;
  2720. # }
  2721. # gcc -fPIC --shared -o libfoo.so foo.c
  2722. # yields:
  2723. # foo.c:6: warning: visibility attribute not supported in this configuration; ignored
  2724. # ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
  2725. have_visibility_hidden=no
  2726. ;;
  2727. mingw*|cygwin*)
  2728. have_visibility_hidden=no
  2729. ;;
  2730. haiku*)
  2731. LIBC=libroot.so
  2732. ;;
  2733. linux*)
  2734. AOT_SUPPORTED="yes"
  2735. BTLS_SUPPORTED=yes
  2736. BTLS_PLATFORM=i386
  2737. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  2738. ;;
  2739. darwin*)
  2740. AOT_SUPPORTED="yes"
  2741. BTLS_SUPPORTED=yes
  2742. BTLS_PLATFORM=i386
  2743. ;;
  2744. openbsd*|freebsd*|kfreebsd-gnu*)
  2745. ;;
  2746. esac
  2747. ;;
  2748. x86_64-*-* | amd64-*-*)
  2749. TARGET=AMD64;
  2750. arch_target=amd64;
  2751. if test "x$ac_cv_sizeof_void_p" = "x4"; then
  2752. AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
  2753. sizeof_register=8
  2754. fi
  2755. case $host_os in
  2756. linux*)
  2757. AOT_SUPPORTED="yes"
  2758. BTLS_SUPPORTED=yes
  2759. BTLS_PLATFORM=x86_64
  2760. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  2761. ;;
  2762. darwin*)
  2763. AOT_SUPPORTED="yes"
  2764. BTLS_SUPPORTED=yes
  2765. BTLS_PLATFORM=x86_64
  2766. boehm_supported=false
  2767. ;;
  2768. openbsd*|freebsd*|kfreebsd-gnu*)
  2769. ;;
  2770. mingw*)
  2771. ;;
  2772. esac
  2773. ;;
  2774. sparc*-*-*)
  2775. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  2776. TARGET=SPARC64
  2777. else
  2778. TARGET=SPARC
  2779. fi
  2780. arch_target=sparc;
  2781. ACCESS_UNALIGNED="no"
  2782. case $host_os in
  2783. linux*) ;;
  2784. *)
  2785. LIBC="libc.so"
  2786. INTL="libintl.so"
  2787. esac
  2788. if test x"$GCC" = xyes; then
  2789. # We don't support v8 cpus
  2790. CFLAGS="$CFLAGS -Wno-cast-align -mcpu=v9"
  2791. fi
  2792. if test x"$AR" = xfalse; then
  2793. AC_MSG_ERROR([The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin.])
  2794. fi
  2795. ;;
  2796. *-mingw*|*-*-cygwin*)
  2797. # When this is enabled, it leads to very strange crashes at runtime (gcc-3.4.4)
  2798. have_visibility_hidden=no
  2799. INTL="intl"
  2800. ;;
  2801. macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
  2802. powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | powerpc-*-freebsd* )
  2803. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  2804. TARGET=POWERPC64;
  2805. CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
  2806. CFLAGS="$CFLAGS -mminimal-toc"
  2807. else
  2808. TARGET=POWERPC;
  2809. CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
  2810. fi
  2811. arch_target=ppc;
  2812. case $host_os in
  2813. linux*|darwin*)
  2814. ;;
  2815. esac
  2816. ;;
  2817. armv7k-*-darwin*)
  2818. TARGET=ARM;
  2819. TARGET_SYS=WATCHOS
  2820. arch_target=arm;
  2821. arm_fpu=VFP_HARD
  2822. ACCESS_UNALIGNED="no"
  2823. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2824. ;;
  2825. arm*-darwin*)
  2826. TARGET=ARM;
  2827. arch_target=arm;
  2828. ACCESS_UNALIGNED="no"
  2829. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2830. ;;
  2831. arm*-linux*)
  2832. TARGET=ARM;
  2833. arch_target=arm;
  2834. ACCESS_UNALIGNED="no"
  2835. AOT_SUPPORTED="yes"
  2836. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2837. BTLS_SUPPORTED=yes
  2838. BTLS_PLATFORM=arm
  2839. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  2840. case "$target" in
  2841. arm*-linux*-gnueabi)
  2842. BTLS_PLATFORM=armsoft
  2843. ;;
  2844. esac
  2845. ;;
  2846. arm*-netbsd*-eabi*)
  2847. TARGET=ARM;
  2848. arch_target=arm;
  2849. ACCESS_UNALIGNED="no"
  2850. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2851. ;;
  2852. aarch64-*)
  2853. # https://lkml.org/lkml/2012/7/15/133
  2854. TARGET=ARM64
  2855. arch_target=arm64
  2856. boehm_supported=false
  2857. AOT_SUPPORTED="yes"
  2858. BTLS_SUPPORTED=yes
  2859. BTLS_PLATFORM=aarch64
  2860. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  2861. ;;
  2862. s390x-*-linux*)
  2863. TARGET=S390X;
  2864. arch_target=s390x;
  2865. ACCESS_UNALIGNED="yes"
  2866. CFLAGS="$CFLAGS -mbackchain -D__USE_STRING_INLINES"
  2867. ;;
  2868. esac
  2869. HOST=$TARGET
  2870. if test "x$host" != "x$target"; then
  2871. AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
  2872. enable_mcs_build=no
  2873. BTLS_SUPPORTED=no
  2874. case "$target" in
  2875. arm*-darwin*)
  2876. TARGET=ARM;
  2877. arch_target=arm;
  2878. ACCESS_UNALIGNED="no"
  2879. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2880. # Can't use tls, since it depends on the runtime detection of tls offsets
  2881. # in mono-compiler.h
  2882. with_tls=pthread
  2883. case "$target" in
  2884. armv7k-*)
  2885. arm_fpu=VFP_HARD
  2886. AC_DEFINE(TARGET_WATCHOS, 1, [...])
  2887. ;;
  2888. esac
  2889. ;;
  2890. powerpc64-ps3-linux-gnu)
  2891. TARGET=POWERPC64
  2892. arch_target=powerpc64
  2893. AC_DEFINE(TARGET_PS3, 1, [...])
  2894. # It would be better to just use TARGET_POWERPC64, but lots of code already
  2895. # uses this define
  2896. AC_DEFINE(__mono_ppc64__, 1, [...])
  2897. AC_DEFINE(__mono_ilp32__, 1, [64 bit mode with 4 byte longs and pointers])
  2898. sizeof_register=8
  2899. target_byte_order=G_BIG_ENDIAN
  2900. ;;
  2901. powerpc64-xbox360-linux-gnu)
  2902. TARGET=POWERPC64
  2903. arch_target=powerpc64
  2904. AC_DEFINE(TARGET_XBOX360, 1, [...])
  2905. # It would be better to just use TARGET_POWERPC64, but lots of code already
  2906. # uses this define
  2907. sizeof_register=8
  2908. target_byte_order=G_BIG_ENDIAN
  2909. ;;
  2910. arm*-linux-*)
  2911. TARGET=ARM;
  2912. arch_target=arm;
  2913. AC_DEFINE(TARGET_ARM, 1, [...])
  2914. ACCESS_UNALIGNED="no"
  2915. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2916. # Can't use tls, since it depends on the runtime detection of tls offsets
  2917. # in mono-compiler.h
  2918. with_tls=pthread
  2919. target_mach=no
  2920. case "$target" in
  2921. armv7l-unknown-linux-gnueabi*)
  2922. # TEGRA
  2923. CPPFLAGS="$CPPFLAGS"
  2924. ;;
  2925. armv5-*-linux-androideabi*)
  2926. AC_DEFINE(TARGET_ANDROID, 1, [...])
  2927. CPPFLAGS="$CPPFLAGS"
  2928. ;;
  2929. *-linux-androideabi*)
  2930. AC_DEFINE(TARGET_ANDROID, 1, [...])
  2931. CPPFLAGS="$CPPFLAGS"
  2932. ;;
  2933. esac
  2934. ;;
  2935. arm*-netbsd*-eabi*)
  2936. TARGET=ARM;
  2937. arch_target=arm;
  2938. AC_DEFINE(TARGET_ARM, 1, [...])
  2939. ACCESS_UNALIGNED="no"
  2940. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  2941. # Can't use tls, since it depends on the runtime detection of tls offsets
  2942. # in mono-compiler.h
  2943. with_tls=pthread
  2944. target_mach=no
  2945. ;;
  2946. i686*-linux-*)
  2947. TARGET=X86;
  2948. arch_target=x86;
  2949. AC_DEFINE(TARGET_X86, 1, [...])
  2950. CPPFLAGS="$CPPFLAGS"
  2951. # Can't use tls, since it depends on the runtime detection of tls offsets
  2952. # in mono-compiler.h
  2953. with_tls=pthread
  2954. target_mach=no
  2955. case "$target" in
  2956. *-linux-android*)
  2957. AC_DEFINE(TARGET_ANDROID, 1, [...])
  2958. ;;
  2959. esac
  2960. ;;
  2961. x86_64*-linux-*)
  2962. TARGET=AMD64;
  2963. arch_target=amd64;
  2964. AC_DEFINE(TARGET_AMD64, 1, [...])
  2965. CPPFLAGS="$CPPFLAGS"
  2966. # Can't use tls, since it depends on the runtime detection of tls offsets
  2967. # in mono-compiler.h
  2968. with_tls=pthread
  2969. target_mach=no
  2970. case "$target" in
  2971. *-linux-android*)
  2972. AC_DEFINE(TARGET_ANDROID, 1, [...])
  2973. ;;
  2974. esac
  2975. ;;
  2976. x86_64-ps4-freebsd)
  2977. TARGET=AMD64;
  2978. arch_target=amd64;
  2979. AC_DEFINE(TARGET_AMD64, 1, [...])
  2980. AC_DEFINE(TARGET_PS4, 1, [...])
  2981. AC_DEFINE(DISABLE_HW_TRAPS, 1, [...])
  2982. CPPFLAGS="$CPPFLAGS"
  2983. # Can't use tls, since it depends on the runtime detection of tls offsets
  2984. # in mono-compiler.h
  2985. with_tls=pthread
  2986. target_mach=no
  2987. target_win32=no
  2988. ;;
  2989. aarch64*-linux-*)
  2990. TARGET=ARM64;
  2991. arch_target=arm64;
  2992. AC_DEFINE(TARGET_ARM64, 1, [...])
  2993. CPPFLAGS="$CPPFLAGS"
  2994. # Can't use tls, since it depends on the runtime detection of tls offsets
  2995. # in mono-compiler.h
  2996. with_tls=pthread
  2997. target_mach=no
  2998. case "$target" in
  2999. *-linux-android*)
  3000. AC_DEFINE(TARGET_ANDROID, 1, [...])
  3001. ;;
  3002. esac
  3003. ;;
  3004. aarch64-*)
  3005. TARGET=ARM64
  3006. ;;
  3007. *)
  3008. AC_MSG_ERROR([Cross compiling is not supported for target $target])
  3009. esac
  3010. fi
  3011. case "$TARGET" in
  3012. X86)
  3013. AC_DEFINE(TARGET_X86, 1, [...])
  3014. ;;
  3015. AMD64)
  3016. AC_DEFINE(TARGET_AMD64, 1, [...])
  3017. ;;
  3018. ARM)
  3019. AC_DEFINE(TARGET_ARM, 1, [...])
  3020. ;;
  3021. ARM64)
  3022. AC_DEFINE(TARGET_ARM64, 1, [...])
  3023. ;;
  3024. POWERPC)
  3025. AC_DEFINE(TARGET_POWERPC, 1, [...])
  3026. ;;
  3027. POWERPC64)
  3028. AC_DEFINE(TARGET_POWERPC, 1, [...])
  3029. AC_DEFINE(TARGET_POWERPC64, 1, [...])
  3030. ;;
  3031. S390X)
  3032. AC_DEFINE(TARGET_S390X, 1, [...])
  3033. ;;
  3034. MIPS)
  3035. AC_DEFINE(TARGET_MIPS, 1, [...])
  3036. ;;
  3037. SPARC)
  3038. AC_DEFINE(TARGET_SPARC, 1, [...])
  3039. ;;
  3040. SPARC64)
  3041. AC_DEFINE(TARGET_SPARC64, 1, [...])
  3042. ;;
  3043. esac
  3044. case "$HOST" in
  3045. X86)
  3046. AC_DEFINE(HOST_X86, 1, [...])
  3047. ;;
  3048. AMD64)
  3049. AC_DEFINE(HOST_AMD64, 1, [...])
  3050. ;;
  3051. ARM)
  3052. AC_DEFINE(HOST_ARM, 1, [...])
  3053. ;;
  3054. ARM64)
  3055. AC_DEFINE(HOST_ARM64, 1, [...])
  3056. ;;
  3057. POWERPC)
  3058. AC_DEFINE(HOST_POWERPC, 1, [...])
  3059. ;;
  3060. POWERPC64)
  3061. AC_DEFINE(HOST_POWERPC, 1, [...])
  3062. AC_DEFINE(HOST_POWERPC64, 1, [...])
  3063. ;;
  3064. S390X)
  3065. AC_DEFINE(HOST_S390X, 1, [...])
  3066. ;;
  3067. MIPS)
  3068. AC_DEFINE(HOST_MIPS, 1, [...])
  3069. ;;
  3070. SPARC)
  3071. AC_DEFINE(HOST_SPARC, 1, [...])
  3072. ;;
  3073. SPARC64)
  3074. AC_DEFINE(HOST_SPARC64, 1, [...])
  3075. ;;
  3076. esac
  3077. dnl *************
  3078. dnl *** VTUNE ***
  3079. dnl *************
  3080. AC_ARG_ENABLE(vtune,[ --enable-vtune Enable the VTUNE back-end], enable_vtune=$enableval, enable_vtune=no)
  3081. AC_ARG_WITH(vtune, [ --with-vtune=<vtune prefix> Enable jit vtune profiling], enable_vtune=yes,)
  3082. AM_CONDITIONAL(HAVE_VTUNE, test x$enable_vtune = xyes)
  3083. if test "x$enable_vtune" = "xyes"; then
  3084. if test "x$with_vtune" = "x"; then
  3085. VTUNE_PATH=/opt/intel/vtune_amplifier_xe
  3086. else
  3087. VTUNE_PATH=$with_vtune
  3088. fi
  3089. VTUNE_INCLUDE=$VTUNE_PATH/include
  3090. case "$TARGET" in
  3091. X86)
  3092. VTUNE_LIB=$VTUNE_PATH/lib32
  3093. ;;
  3094. AMD64)
  3095. VTUNE_LIB=$VTUNE_PATH/lib64
  3096. ;;
  3097. *)
  3098. AC_MSG_ERROR([Unsupported target $TARGET for VTUNE.])
  3099. ;;
  3100. esac
  3101. if test ! -f $VTUNE_INCLUDE/jitprofiling.h; then
  3102. AC_MSG_ERROR([VTUNE $VTUNE_INCLUDE/jitprofiling.h not found.])
  3103. fi
  3104. if test ! -f $VTUNE_LIB/libjitprofiling.a; then
  3105. AC_MSG_ERROR([VTUNE $VTUNE_LIB/libjitprofiling.a not found.])
  3106. fi
  3107. VTUNE_CFLAGS=-I$VTUNE_INCLUDE
  3108. VTUNE_LIBS="-L/$VTUNE_LIB/ -ljitprofiling"
  3109. AC_SUBST(VTUNE_LIBS)
  3110. AC_SUBST(VTUNE_CFLAGS)
  3111. fi
  3112. dnl Use GCC atomic ops if they work on the target.
  3113. if test x$GCC = "xyes"; then
  3114. case $TARGET in
  3115. X86 | AMD64 | ARM | ARM64 | POWERPC | POWERPC64 | MIPS | S390X | SPARC | SPARC64)
  3116. AC_DEFINE(USE_GCC_ATOMIC_OPS, 1, [...])
  3117. ;;
  3118. esac
  3119. fi
  3120. if test "x$target_mach" = "xyes"; then
  3121. if test "x$TARGET_SYS" = "xWATCHOS"; then
  3122. AC_DEFINE(TARGET_WATCHOS,1,[The JIT/AOT targets WatchOS])
  3123. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
  3124. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
  3125. BTLS_SUPPORTED=no
  3126. elif test "x$TARGET" = "xARM" -o "x$TARGET" = "xARM64"; then
  3127. AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
  3128. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
  3129. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
  3130. BTLS_SUPPORTED=no
  3131. else
  3132. AC_TRY_COMPILE([#include "TargetConditionals.h"],[
  3133. #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
  3134. #error fail this for ios
  3135. #endif
  3136. return 0;
  3137. ], [
  3138. AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
  3139. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
  3140. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX"
  3141. target_osx=yes
  3142. ], [
  3143. AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
  3144. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
  3145. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
  3146. BTLS_SUPPORTED=no
  3147. ])
  3148. fi
  3149. AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
  3150. fi
  3151. AM_CONDITIONAL(TARGET_OSX, test x$target_osx = xyes)
  3152. if test "x$sizeof_register" = "x4"; then
  3153. AC_DEFINE(SIZEOF_REGISTER,4,[size of machine integer registers])
  3154. elif test "x$sizeof_register" = "x8"; then
  3155. AC_DEFINE(SIZEOF_REGISTER,8,[size of machine integer registers])
  3156. else
  3157. AC_DEFINE(SIZEOF_REGISTER,SIZEOF_VOID_P,[size of machine integer registers])
  3158. fi
  3159. if test "x$target_byte_order" = "xG_BIG_ENDIAN"; then
  3160. AC_DEFINE(TARGET_BYTE_ORDER,G_BIG_ENDIAN,[byte order of target])
  3161. elif test "x$target_byte_order" = "xG_LITTLE_ENDIAN"; then
  3162. AC_DEFINE(TARGET_BYTE_ORDER,G_LITTLE_ENDIAN,[byte order of target])
  3163. else
  3164. AC_DEFINE(TARGET_BYTE_ORDER,G_BYTE_ORDER,[byte order of target])
  3165. fi
  3166. if test "x$have_visibility_hidden" = "xyes"; then
  3167. AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
  3168. fi
  3169. if test "x$have_deprecated" = "xyes"; then
  3170. AC_DEFINE(HAVE_DEPRECATED, 1, [Support for the deprecated attribute])
  3171. fi
  3172. AC_ARG_ENABLE(interpreter, [ --enable-interpreter Enable Interpreter], enable_interpreter=$enableval, enable_interpreter=no)
  3173. if test "x$enable_interpreter" = "xyes"; then
  3174. AC_DEFINE(ENABLE_INTERPRETER, 1, [Enable Interpreter])
  3175. fi
  3176. AM_CONDITIONAL(ENABLE_INTERPRETER, [test x$enable_interpreter = xyes])
  3177. if test "x$enable_interpreter" = "xyes" || test "x$mono_feature_disable_jit" != "xyes"; then
  3178. AC_DEFINE(HAVE_ONLINE_VES, 1, [Some VES is available at runtime])
  3179. fi
  3180. AM_CONDITIONAL(HAVE_ONLINE_VES, [test x$enable_interpreter = xyes] || [test x$mono_feature_disable_jit != xyes])
  3181. dnl
  3182. dnl Simple Generational checks (sgen)
  3183. dnl
  3184. SGEN_DEFINES=
  3185. AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
  3186. AC_ARG_WITH(sgen-default-concurrent, [ --with-sgen-default-concurrent=yes,no Use Concurrent GC, default=no],[],[with_sgen_default_concurrent=no])
  3187. if test x$buildsgen = xyes; then
  3188. AC_DEFINE(HAVE_MOVING_COLLECTOR, 1, [Moving collector])
  3189. SGEN_DEFINES="-DHAVE_SGEN_GC"
  3190. conc_gc_msg=""
  3191. if test x$with_sgen_default_concurrent != xno; then
  3192. AC_DEFINE(HAVE_CONC_GC_AS_DEFAULT, 1, [Defaults to concurrent GC])
  3193. conc_gc_msg=" (concurrent by default)"
  3194. fi
  3195. if test "x$gc_msg" = "x"; then
  3196. gc_msg="sgen$conc_gc_msg"
  3197. else
  3198. gc_msg="sgen$conc_gc_msg and $gc_msg"
  3199. fi
  3200. fi
  3201. AC_SUBST(SGEN_DEFINES)
  3202. AM_CONDITIONAL(SUPPORT_SGEN, test x$buildsgen = xyes)
  3203. jit_status="Building and using the JIT"
  3204. libsuffix=".so"
  3205. case "$host" in
  3206. *-*-darwin*)
  3207. libsuffix=".dylib"
  3208. LIBC="libc.dylib"
  3209. INTL="libintl.dylib"
  3210. SQLITE="libsqlite.0.dylib"
  3211. SQLITE3="libsqlite3.0.dylib"
  3212. X11="libX11.dylib"
  3213. GDKX11="libgdk-x11-2.0.dylib"
  3214. GTKX11="libgtk-x11-2.0.dylib"
  3215. ;;
  3216. *-*-*netbsd*)
  3217. LIBC="libc.so"
  3218. INTL="libintl.so"
  3219. SQLITE="libsqlite.so"
  3220. SQLITE3="libsqlite3.so"
  3221. ;;
  3222. *-*-kfreebsd*-gnu)
  3223. LIBC="libc.so.0.1"
  3224. INTL="libc.so.0.1"
  3225. X11="libX11.so.6"
  3226. ;;
  3227. *-*-*freebsd*)
  3228. LIBC="libc.so.7"
  3229. INTL="libintl.so"
  3230. SQLITE="libsqlite.so"
  3231. SQLITE3="libsqlite3.so"
  3232. ;;
  3233. *-*-*openbsd*)
  3234. LIBC="libc.so"
  3235. INTL="libintl.so"
  3236. SQLITE="libsqlite.so"
  3237. SQLITE3="libsqlite3.so"
  3238. ;;
  3239. *-*-*linux*)
  3240. AC_PATH_X
  3241. dlsearch_path=`(libtool --config ; echo eval echo \\$sys_lib_dlsearch_path_spec) | sh`
  3242. AC_MSG_CHECKING(for the soname of libX11.so)
  3243. for i in $x_libraries $dlsearch_path; do
  3244. for r in 4 5 6; do
  3245. if test -f $i/libX11.so.$r; then
  3246. X11=libX11.so.$r
  3247. AC_MSG_RESULT($X11)
  3248. fi
  3249. done
  3250. done
  3251. if test "x$X11" = "xlibX11.so"; then
  3252. AC_MSG_WARN([Could not find libX11.so. Do you have X.org or XFree86 installed? Assuming libX11.so.6...]);
  3253. X11=libX11.so.6
  3254. fi
  3255. ;;
  3256. esac
  3257. AC_SUBST(libsuffix)
  3258. AC_ARG_WITH([libgdiplus],
  3259. [ --with-libgdiplus=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to installed)],
  3260. [], [with_libgdiplus=installed])
  3261. # default install location
  3262. libgdiplus_install_loc=libgdiplus${libsuffix}
  3263. case "$host" in
  3264. *-*-*linux*)
  3265. libgdiplus_install_loc=libgdiplus${libsuffix}.0
  3266. ;;
  3267. esac
  3268. case $with_libgdiplus in
  3269. no|installed)
  3270. libgdiplus_loc=
  3271. ;;
  3272. yes|sibling)
  3273. libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la
  3274. ;;
  3275. /*) # absolute path, assume it is an install location
  3276. libgdiplus_loc=$with_libgdiplus
  3277. libgdiplus_install_loc=$with_libgdiplus
  3278. ;;
  3279. *)
  3280. libgdiplus_loc=`pwd`/$with_libgdiplus
  3281. ;;
  3282. esac
  3283. AC_SUBST([libgdiplus_loc])
  3284. AC_SUBST([libgdiplus_install_loc])
  3285. AC_ARG_ENABLE(icall-symbol-map,[ --enable-icall-symbol-map Generate tables which map icall functions to their C symbols], icall_symbol_map=$enableval, icall_symbol_map=no)
  3286. if test "x$icall_symbol_map" = "xyes"; then
  3287. AC_DEFINE(ENABLE_ICALL_SYMBOL_MAP, 1, [Icall symbol map enabled])
  3288. fi
  3289. AC_ARG_ENABLE(icall-export,[ --enable-icall-export Export icall functions], icall_export=$enableval, icall_export=no)
  3290. if test "x$icall_export" = "xyes"; then
  3291. AC_DEFINE(ENABLE_ICALL_EXPORT, 1, [Icall export enabled])
  3292. fi
  3293. AC_ARG_ENABLE(icall-tables,[ --disable-icall-tables Disable the runtime lookup of icalls], icall_tables=$enableval, icall_tables=yes)
  3294. if test "x$icall_tables" = "xno"; then
  3295. AC_DEFINE(DISABLE_ICALL_TABLES, 1, [Icall tables disabled])
  3296. fi
  3297. if test "x$with_tls" = "x__thread"; then
  3298. AC_DEFINE(HAVE_KW_THREAD, 1, [Have __thread keyword])
  3299. # Pass the information to libgc
  3300. CPPFLAGS="$CPPFLAGS -DUSE_COMPILER_TLS"
  3301. AC_MSG_CHECKING(if the tls_model attribute is supported)
  3302. AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [
  3303. ], [
  3304. AC_MSG_RESULT(yes)
  3305. AC_DEFINE(HAVE_TLS_MODEL_ATTR, 1, [tls_model available])
  3306. ], [
  3307. AC_MSG_RESULT(no)
  3308. ])
  3309. fi
  3310. if test ${TARGET} = ARM; then
  3311. dnl ******************************************
  3312. dnl *** Check to see what FPU is available ***
  3313. dnl ******************************************
  3314. AC_MSG_CHECKING(which FPU to use)
  3315. #
  3316. # This is a bit tricky:
  3317. #
  3318. # if (__ARM_PCS_VFP) {
  3319. # /* mfloat-abi=hard == VFP with hard ABI */
  3320. # } elif (!__SOFTFP__) {
  3321. # /* mfloat-abi=softfp == VFP with soft ABI */
  3322. # } else {
  3323. # /* mfloat-abi=soft == no VFP */
  3324. # }
  3325. #
  3326. # The exception is iOS (w/ GCC) where none of the above
  3327. # are defined (but iOS always uses the 'softfp' ABI).
  3328. #
  3329. # No support for FPA.
  3330. #
  3331. fpu=NONE
  3332. # iOS GCC always uses the 'softfp' ABI.
  3333. if test x"$GCC" = xyes && test x$host_darwin = xyes; then
  3334. fpu=VFP
  3335. fi
  3336. # Are we using the 'hard' ABI?
  3337. if test x$fpu = xNONE; then
  3338. AC_TRY_COMPILE([], [
  3339. #ifndef __ARM_PCS_VFP
  3340. #error "Float ABI is not 'hard'"
  3341. #endif
  3342. return 0;
  3343. ], [
  3344. fpu=VFP_HARD
  3345. ], [
  3346. fpu=NONE
  3347. ])
  3348. fi
  3349. # No 'hard' ABI. 'soft' or 'softfp'?
  3350. if test x$fpu = xNONE; then
  3351. AC_TRY_COMPILE([], [
  3352. #ifdef __SOFTFP__
  3353. #error "Float ABI is not 'softfp'"
  3354. #endif
  3355. return 0;
  3356. ], [
  3357. fpu=VFP
  3358. ], [
  3359. fpu=NONE
  3360. ])
  3361. fi
  3362. if test x$arm_fpu != x; then
  3363. fpu=$arm_fpu
  3364. fi
  3365. AC_MSG_RESULT($fpu)
  3366. CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
  3367. unset fpu
  3368. dnl *********************************************
  3369. dnl *** Check which ARM version(s) we can use ***
  3370. dnl *********************************************
  3371. AC_MSG_CHECKING(which ARM version to use)
  3372. AC_TRY_COMPILE([], [
  3373. #if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__)
  3374. #error Not on ARM v5.
  3375. #endif
  3376. return 0;
  3377. ], [
  3378. arm_v5=yes
  3379. arm_ver=ARMv5
  3380. ], [])
  3381. AC_TRY_COMPILE([], [
  3382. #if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__)
  3383. #error Not on ARM v6.
  3384. #endif
  3385. return 0;
  3386. ], [
  3387. arm_v5=yes
  3388. arm_v6=yes
  3389. arm_ver=ARMv6
  3390. ], [])
  3391. AC_TRY_COMPILE([], [
  3392. #if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
  3393. #error Not on ARM v7.
  3394. #endif
  3395. return 0;
  3396. ], [
  3397. arm_v5=yes
  3398. arm_v6=yes
  3399. arm_v7=yes
  3400. arm_ver=ARMv7
  3401. ], [])
  3402. AC_MSG_RESULT($arm_ver)
  3403. if test x$arm_v5 = xyes; then
  3404. AC_DEFINE(HAVE_ARMV5, 1, [ARM v5])
  3405. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV5=1"
  3406. fi
  3407. if test x$arm_v6 = xyes; then
  3408. AC_DEFINE(HAVE_ARMV6, 1, [ARM v6])
  3409. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6=1"
  3410. fi
  3411. if test x$arm_v7 = xyes; then
  3412. AC_DEFINE(HAVE_ARMV7, 1, [ARM v7])
  3413. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV7=1"
  3414. fi
  3415. fi
  3416. if test ${TARGET} = unknown; then
  3417. CPPFLAGS="$CPPFLAGS -DNO_PORT"
  3418. AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
  3419. fi
  3420. if test "x$platform_android" = "xyes"; then
  3421. case "x${TARGET}" in
  3422. xARM)
  3423. case "x$arm_ver" in
  3424. xARMv5)
  3425. BTLS_SUPPORTED=yes
  3426. BTLS_PLATFORM=android-armv5
  3427. ;;
  3428. xARMv6)
  3429. BTLS_SUPPORTED=yes
  3430. BTLS_PLATFORM=android-armv6
  3431. ;;
  3432. xARMv7)
  3433. BTLS_SUPPORTED=yes
  3434. BTLS_PLATFORM=android-armv7
  3435. ;;
  3436. *)
  3437. BTLS_SUPPORTED=no
  3438. ;;
  3439. esac
  3440. ;;
  3441. xARM64)
  3442. BTLS_SUPPORTED=yes
  3443. BTLS_PLATFORM=android-v8a
  3444. ;;
  3445. xX86)
  3446. BTLS_SUPPORTED=yes
  3447. BTLS_PLATFORM=android-x86
  3448. ;;
  3449. xAMD64)
  3450. BTLS_SUPPORTED=yes
  3451. BTLS_PLATFORM=android-x64
  3452. ;;
  3453. *)
  3454. BTLS_SUPPORTED=no
  3455. ;;
  3456. esac
  3457. fi
  3458. if test ${ACCESS_UNALIGNED} = no; then
  3459. CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
  3460. fi
  3461. if test x$host_darwin = xyes; then
  3462. AC_MSG_CHECKING([for ranlib that supports -no_warning_for_no_symbols option])
  3463. AS_IF(
  3464. [$RANLIB -no_warning_for_no_symbols 2>&1 | grep -q "unknown option"],
  3465. [AC_MSG_RESULT([no])],
  3466. [
  3467. # avoid AR calling ranlib, libtool calls it anyway. suppress no symbols warning.
  3468. AR_FLAGS="Scru"
  3469. RANLIB="$RANLIB -no_warning_for_no_symbols"
  3470. AC_MSG_RESULT([yes])
  3471. ]
  3472. )
  3473. fi
  3474. case "x$libgc" in
  3475. xincluded)
  3476. # Pass CPPFLAGS to libgc configure
  3477. # We should use a separate variable for this to avoid passing useless and
  3478. # potentially problematic defines to libgc (like -D_FILE_OFFSET_BITS=64)
  3479. # This should be executed late so we pick up the final version of CPPFLAGS
  3480. # The problem with this approach, is that during a reconfigure, the main
  3481. # configure scripts gets invoked with these arguments, so we use separate
  3482. # variables understood by libgc's configure to pass CPPFLAGS and CFLAGS.
  3483. TMP_CPPFLAGS="$CPPFLAGS $CPPFLAGS_FOR_LIBGC"
  3484. if test x$TARGET = xSPARC -o x$TARGET = xSPARC64; then
  3485. TMP_CPPFLAGS=`echo $TMP_CPPFLAGS | sed -e 's/-D_FILE_OFFSET_BITS=64//g'`
  3486. fi
  3487. # Don't pass -finstrument-for-thread-suspension in,
  3488. # if these are instrumented it will be very bad news
  3489. # (infinite recursion, undefined parking behavior, etc)
  3490. TMP_CPPFLAGS=`echo $TMP_CPPFLAGS | sed -e 's/-finstrument-for-thread-suspension//g'`
  3491. ac_configure_args="$ac_configure_args --disable-embed-check --with-libgc-threads=$libgc_threads $libgc_configure_args \"CPPFLAGS_FOR_LIBGC=$TMP_CPPFLAGS\" \"CFLAGS_FOR_LIBGC=$CFLAGS_FOR_LIBGC\""
  3492. if test "x$support_boehm" = "xyes"; then
  3493. AC_CONFIG_SUBDIRS(libgc)
  3494. fi
  3495. ;;
  3496. esac
  3497. MALLOC_MEMPOOLS=no
  3498. AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for each single mempool allocation (only for runtime debugging, defaults to no)],[
  3499. if test x$with_malloc_mempools = xyes; then
  3500. MALLOC_MEMPOOLS=yes
  3501. AC_DEFINE(USE_MALLOC_FOR_MEMPOOLS,1,[Use malloc for each single mempool allocation])
  3502. fi
  3503. ])
  3504. DISABLE_MCS_DOCS=default
  3505. AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the documentation under mcs (defaults to yes)],[
  3506. if test x$with_mcs_docs != xyes; then
  3507. DISABLE_MCS_DOCS=yes
  3508. fi
  3509. ])
  3510. if test -n "$INSTALL_4_x_TRUE"; then :
  3511. DISABLE_MCS_DOCS=yes
  3512. fi
  3513. if test "x$DISABLE_MCS_DOCS" = "xdefault"; then
  3514. DISABLE_MCS_DOCS=$DISABLE_MCS_DOCS_default
  3515. fi
  3516. AC_ARG_WITH(lazy_gc_thread_creation, [ --with-lazy-gc-thread-creation=yes|no Enable lazy runtime thread creation, embedding host must do it explicitly (defaults to no)],[
  3517. if test x$with_lazy_gc_thread_creation != xno ; then
  3518. AC_DEFINE(LAZY_GC_THREAD_CREATION,1,[Enable lazy gc thread creation by the embedding host.])
  3519. fi
  3520. ], [with_lazy_gc_thread_creation=no])
  3521. AC_ARG_WITH(cooperative_gc, [ --with-cooperative-gc=yes|no Enable cooperative stop-the-world garbage collection (sgen only) (defaults to no)], [], [with_cooperative_gc=default])
  3522. if test x$with_cooperative_gc = xdefault; then
  3523. with_cooperative_gc=$with_cooperative_gc_default
  3524. fi
  3525. if test x$with_cooperative_gc != xno; then
  3526. AC_DEFINE(USE_COOP_GC,1,[Enable cooperative stop-the-world garbage collection.])
  3527. fi
  3528. AM_CONDITIONAL([ENABLE_COOP], [test x$with_cooperative_gc != xno])
  3529. AC_ARG_ENABLE(checked_build, [ --enable-checked-build=LIST To enable checked build (expensive asserts), configure with a comma-separated LIST of checked build modules and then include that same list in the environment variable MONO_CHECK_MODE at runtime. Recognized checked build modules: all, gc, metadata, thread],[
  3530. if test x$enable_checked_build != x ; then
  3531. AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
  3532. fi
  3533. for feature in `echo "$enable_checked_build" | sed -e "s/,/ /g"`; do
  3534. eval "mono_checked_build_test_enable_$feature='yes'"
  3535. done
  3536. if test "x$mono_checked_build_test_enable_all" = "xyes"; then
  3537. eval "mono_checked_build_test_enable_gc='yes'"
  3538. eval "mono_checked_build_test_enable_metadata='yes'"
  3539. eval "mono_checked_build_test_enable_thread='yes'"
  3540. fi
  3541. if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
  3542. AC_DEFINE(ENABLE_CHECKED_BUILD_GC, 1, [Enable GC checked build])
  3543. fi
  3544. if test "x$mono_checked_build_test_enable_metadata" = "xyes"; then
  3545. AC_DEFINE(ENABLE_CHECKED_BUILD_METADATA, 1, [Enable metadata checked build])
  3546. fi
  3547. if test "x$mono_checked_build_test_enable_thread" = "xyes"; then
  3548. AC_DEFINE(ENABLE_CHECKED_BUILD_THREAD, 1, [Enable thread checked build])
  3549. fi
  3550. ], [])
  3551. AC_CHECK_HEADER([malloc.h],
  3552. [AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
  3553. [Define to 1 if you have /usr/include/malloc.h.])],,)
  3554. if test x"$GCC" = xyes; then
  3555. # Implicit function declarations are not 64 bit safe
  3556. # Do this late, since this causes lots of configure tests to fail
  3557. CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
  3558. # jay has a lot of implicit declarations
  3559. JAY_CFLAGS="-Wno-implicit-function-declaration"
  3560. fi
  3561. # When --disable-shared is used, libtool transforms libmono-2.0.la into libmono-2.0.so
  3562. # instead of libmono-static.a
  3563. if test "x$enable_shared" = "xno" -a "x$enable_executables" = "xyes"; then
  3564. LIBMONO_LA=libmini-static.la
  3565. else
  3566. if test x$buildsgen = xyes; then
  3567. LIBMONO_LA=libmonosgen-$API_VER.la
  3568. else
  3569. LIBMONO_LA=libmonoboehm-$API_VER.la
  3570. fi
  3571. fi
  3572. AC_SUBST(LIBMONO_LA)
  3573. dnl **************
  3574. dnl *** Btls ***
  3575. dnl **************
  3576. AC_ARG_ENABLE(btls, [ --disable-btls Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
  3577. AC_ARG_WITH(btls_android_ndk, [ --with-btls-android-ndk Android NDK for BoringTls])
  3578. AM_CONDITIONAL(BTLS, test x$enable_btls = xyes)
  3579. btls_android=no
  3580. if test "x$enable_btls" = "xyes"; then
  3581. AC_PATH_PROG(CMAKE, [cmake], [no], [$PATH:/Applications/CMake.app/Contents/bin:/usr/local/bin])
  3582. if test "x$CMAKE" = "xno"; then
  3583. AC_MSG_ERROR("cmake not found")
  3584. fi
  3585. BTLS_ROOT=`cd $srcdir && pwd`/external/boringssl
  3586. AC_SUBST(BTLS_ROOT)
  3587. btls_arch=
  3588. btls_cflags=
  3589. BTLS_CMAKE_ARGS=
  3590. case "$BTLS_PLATFORM" in
  3591. i386)
  3592. btls_arch=i386
  3593. btls_cflags="-m32"
  3594. case $host_os in
  3595. darwin*)
  3596. btls_cflags="$btls_cflags -arch i386"
  3597. esac
  3598. ;;
  3599. x86_64)
  3600. btls_arch=x86_64
  3601. ;;
  3602. arm)
  3603. btls_arch=arm
  3604. ;;
  3605. armsoft)
  3606. btls_arch=arm
  3607. btls_cflags="-DOPENSSL_NO_ASM=1"
  3608. ;;
  3609. aarch64)
  3610. btls_arch=aarch64
  3611. ;;
  3612. android-armv5)
  3613. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=12"
  3614. ;;
  3615. android-armv6)
  3616. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=12"
  3617. ;;
  3618. android-armv7)
  3619. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=12"
  3620. ;;
  3621. android-v8a)
  3622. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=12"
  3623. ;;
  3624. android-x86)
  3625. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=12"
  3626. ;;
  3627. android-x64)
  3628. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=12"
  3629. ;;
  3630. *)
  3631. AC_MSG_ERROR(Invalid BTLS platform)
  3632. esac
  3633. if test "x$platform_android" = "xyes"; then
  3634. btls_android=yes
  3635. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
  3636. if test "x$with_btls_android_ndk" != "x"; then
  3637. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
  3638. else
  3639. AC_MSG_ERROR([Need to pass the --with-btls-android-ndk argument when building with BTLS support on Android.])
  3640. fi
  3641. fi
  3642. if test "x$btls_arch" != "x"; then
  3643. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DBTLS_ARCH=\"$btls_arch\""
  3644. fi
  3645. BTLS_CFLAGS="$CPPFLAGS_FOR_BTLS $btls_cflags"
  3646. AC_SUBST(BTLS_ARCH)
  3647. AC_SUBST(BTLS_CFLAGS)
  3648. AC_SUBST(BTLS_PLATFORM)
  3649. AC_SUBST(BTLS_CMAKE_ARGS)
  3650. AC_DEFINE(HAVE_BTLS, 1, [BoringTls is supported])
  3651. else
  3652. enable_btls=no
  3653. fi
  3654. AM_CONDITIONAL(BTLS_ANDROID, test x$btls_android = xyes)
  3655. if test x$DISABLE_MCS_DOCS = xyes; then
  3656. docs_dir=""
  3657. else
  3658. docs_dir=docs
  3659. fi
  3660. AC_SUBST(docs_dir)
  3661. ## Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
  3662. AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
  3663. libmono_ldflags="$libmono_ldflags $LIBS"
  3664. AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
  3665. AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
  3666. AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
  3667. AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
  3668. AM_CONDITIONAL(X86, test x$TARGET = xX86)
  3669. AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
  3670. AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
  3671. AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
  3672. AM_CONDITIONAL(POWERPC64, test x$TARGET = xPOWERPC64)
  3673. AM_CONDITIONAL(ARM, test x$TARGET = xARM)
  3674. AM_CONDITIONAL(ARM64, test x$TARGET = xARM64)
  3675. AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
  3676. AM_CONDITIONAL(HOST_X86, test x$HOST = xX86)
  3677. AM_CONDITIONAL(HOST_AMD64, test x$HOST = xAMD64)
  3678. AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
  3679. AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
  3680. AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
  3681. AC_SUBST(LIBC)
  3682. AC_SUBST(INTL)
  3683. AC_SUBST(SQLITE)
  3684. AC_SUBST(SQLITE3)
  3685. AC_SUBST(X11)
  3686. AC_SUBST(GDKX11)
  3687. AC_SUBST(GTKX11)
  3688. AC_SUBST(XINERAMA)
  3689. AC_DEFINE_UNQUOTED(MONO_ARCHITECTURE,"$arch_target",[The architecture this is running on])
  3690. AC_SUBST(arch_target)
  3691. AC_SUBST(CFLAGS)
  3692. AC_SUBST(CPPFLAGS)
  3693. AC_SUBST(LDFLAGS)
  3694. #This must always be defined when building the runtime
  3695. AC_DEFINE(MONO_INSIDE_RUNTIME,1, [Disable banned functions from being used by the runtime])
  3696. mono_build_root=`pwd`
  3697. AC_SUBST(mono_build_root)
  3698. mono_runtime=mono/mini/mono
  3699. AC_SUBST(mono_runtime)
  3700. CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/Microsoft.Net.Compilers.2.3.1/tools/csc.exe
  3701. if test $csc_compiler = mcs; then
  3702. CSC=$mcs_topdir/class/lib/build/mcs.exe
  3703. else
  3704. CSC=$CSC_LOCATION
  3705. fi
  3706. mono_cfg_root=$mono_build_root/runtime
  3707. if test x$host_win32 = xyes; then
  3708. if test "x$cross_compiling" = "xno"; then
  3709. mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
  3710. CSC=`cygpath -m -a $CSC`
  3711. CSC_LOCATION=`cygpath -m -a $CSC_LOCATION`
  3712. else
  3713. mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\'`\\etc
  3714. fi
  3715. else
  3716. mono_cfg_dir=$mono_cfg_root/etc
  3717. fi
  3718. AC_SUBST(mono_cfg_dir)
  3719. AC_SUBST(CSC)
  3720. AC_CONFIG_FILES([po/mcs/Makefile.in])
  3721. AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
  3722. AC_CONFIG_FILES([runtime/monodis-wrapper],[chmod +x runtime/monodis-wrapper])
  3723. AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
  3724. [ depth=../../../..
  3725. case $srcdir in
  3726. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3727. .) reldir=$depth ;;
  3728. *) reldir=$depth/$srcdir ;;
  3729. esac
  3730. $ac_aux_dir/install-sh -d runtime/etc/mono/1.0
  3731. cd runtime/etc/mono/1.0
  3732. rm -f machine.config
  3733. $LN_S $reldir/data/net_1_1/machine.config machine.config
  3734. cd $depth
  3735. ],[LN_S='$LN_S'])
  3736. AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
  3737. [ depth=../../../..
  3738. case $srcdir in
  3739. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3740. .) reldir=$depth ;;
  3741. *) reldir=$depth/$srcdir ;;
  3742. esac
  3743. $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
  3744. cd runtime/etc/mono/2.0
  3745. rm -f machine.config
  3746. $LN_S $reldir/data/net_2_0/machine.config machine.config
  3747. cd $depth
  3748. ],[LN_S='$LN_S'])
  3749. AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
  3750. [ depth=../../../..
  3751. case $srcdir in
  3752. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3753. .) reldir=$depth ;;
  3754. *) reldir=$depth/$srcdir ;;
  3755. esac
  3756. $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
  3757. cd runtime/etc/mono/2.0
  3758. rm -f web.config
  3759. $LN_S $reldir/data/net_2_0/web.config web.config
  3760. cd $depth
  3761. ],[LN_S='$LN_S'])
  3762. AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
  3763. [ depth=../../..
  3764. case $srcdir in
  3765. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3766. .) reldir=$depth ;;
  3767. *) reldir=$depth/$srcdir ;;
  3768. esac
  3769. $ac_aux_dir/install-sh -d runtime/etc/mono/
  3770. cd runtime/etc/mono/
  3771. rm -f browscap.ini
  3772. $LN_S $reldir/data/browscap.ini browscap.ini
  3773. cd $depth
  3774. ],[LN_S='$LN_S'])
  3775. AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
  3776. [ depth=../../../../..
  3777. case $srcdir in
  3778. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3779. .) reldir=$depth ;;
  3780. *) reldir=$depth/$srcdir ;;
  3781. esac
  3782. $ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
  3783. cd runtime/etc/mono/2.0/Browsers
  3784. rm -f Compat.browser
  3785. $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
  3786. cd $depth
  3787. ],[LN_S='$LN_S'])
  3788. AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/Browsers/Compat.browser],
  3789. [ depth=../../../../..
  3790. case $srcdir in
  3791. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3792. .) reldir=$depth ;;
  3793. *) reldir=$depth/$srcdir ;;
  3794. esac
  3795. $ac_aux_dir/install-sh -d runtime/etc/mono/4.0/Browsers/
  3796. cd runtime/etc/mono/4.0/Browsers
  3797. rm -f Compat.browser
  3798. $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
  3799. cd $depth
  3800. ],[LN_S='$LN_S'])
  3801. AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/Browsers/Compat.browser],
  3802. [ depth=../../../../..
  3803. case $srcdir in
  3804. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3805. .) reldir=$depth ;;
  3806. *) reldir=$depth/$srcdir ;;
  3807. esac
  3808. $ac_aux_dir/install-sh -d runtime/etc/mono/4.5/Browsers/
  3809. cd runtime/etc/mono/4.5/Browsers
  3810. rm -f Compat.browser
  3811. $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
  3812. cd $depth
  3813. ],[LN_S='$LN_S'])
  3814. AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/machine.config],
  3815. [ depth=../../../..
  3816. case $srcdir in
  3817. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3818. .) reldir=$depth ;;
  3819. *) reldir=$depth/$srcdir ;;
  3820. esac
  3821. $ac_aux_dir/install-sh -d runtime/etc/mono/4.0
  3822. cd runtime/etc/mono/4.0
  3823. rm -f machine.config
  3824. $LN_S $reldir/data/net_4_0/machine.config machine.config
  3825. cd $depth
  3826. ],[LN_S='$LN_S'])
  3827. AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/web.config],
  3828. [ depth=../../../..
  3829. case $srcdir in
  3830. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3831. .) reldir=$depth ;;
  3832. *) reldir=$depth/$srcdir ;;
  3833. esac
  3834. $ac_aux_dir/install-sh -d runtime/etc/mono/4.0
  3835. cd runtime/etc/mono/4.0
  3836. rm -f web.config
  3837. $LN_S $reldir/data/net_4_0/web.config web.config
  3838. cd $depth
  3839. ],[LN_S='$LN_S'])
  3840. AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/machine.config],
  3841. [ depth=../../../..
  3842. case $srcdir in
  3843. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3844. .) reldir=$depth ;;
  3845. *) reldir=$depth/$srcdir ;;
  3846. esac
  3847. $ac_aux_dir/install-sh -d runtime/etc/mono/4.5
  3848. cd runtime/etc/mono/4.5
  3849. rm -f machine.config
  3850. $LN_S $reldir/data/net_4_5/machine.config machine.config
  3851. cd $depth
  3852. ],[LN_S='$LN_S'])
  3853. AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/web.config],
  3854. [ depth=../../../..
  3855. case $srcdir in
  3856. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  3857. .) reldir=$depth ;;
  3858. *) reldir=$depth/$srcdir ;;
  3859. esac
  3860. $ac_aux_dir/install-sh -d runtime/etc/mono/4.5
  3861. cd runtime/etc/mono/4.5
  3862. rm -f web.config
  3863. $LN_S $reldir/data/net_4_5/web.config web.config
  3864. cd $depth
  3865. ],[LN_S='$LN_S'])
  3866. AC_CONFIG_COMMANDS([quiet-libtool], [sed -e 's/echo "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool; sed -e 's/$ECHO "copying selected/# "copying selected/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
  3867. AC_CONFIG_COMMANDS([nolock-libtool], [sed -e 's/lock_old_archive_extraction=yes/lock_old_archive_extraction=no/g' < libtool > libtool.tmp && mv libtool.tmp libtool && chmod a+x libtool])
  3868. AC_OUTPUT([
  3869. Makefile
  3870. mono-uninstalled.pc
  3871. acceptance-tests/Makefile
  3872. llvm/Makefile
  3873. scripts/mono-find-provides
  3874. scripts/mono-find-requires
  3875. mono/Makefile
  3876. mono/btls/Makefile
  3877. mono/utils/Makefile
  3878. mono/metadata/Makefile
  3879. mono/dis/Makefile
  3880. mono/cil/Makefile
  3881. mono/arch/Makefile
  3882. mono/arch/x86/Makefile
  3883. mono/arch/amd64/Makefile
  3884. mono/arch/ppc/Makefile
  3885. mono/arch/sparc/Makefile
  3886. mono/arch/s390x/Makefile
  3887. mono/arch/arm/Makefile
  3888. mono/arch/arm64/Makefile
  3889. mono/arch/mips/Makefile
  3890. mono/sgen/Makefile
  3891. mono/tests/Makefile
  3892. mono/tests/tests-config
  3893. mono/tests/gc-descriptors/Makefile
  3894. mono/tests/testing_gac/Makefile
  3895. mono/unit-tests/Makefile
  3896. mono/benchmark/Makefile
  3897. mono/mini/Makefile
  3898. mono/profiler/Makefile
  3899. m4/Makefile
  3900. ikvm-native/Makefile
  3901. scripts/Makefile
  3902. man/Makefile
  3903. docs/Makefile
  3904. data/Makefile
  3905. data/net_2_0/Makefile
  3906. data/net_4_0/Makefile
  3907. data/net_4_5/Makefile
  3908. data/net_2_0/Browsers/Makefile
  3909. data/net_4_0/Browsers/Makefile
  3910. data/net_4_5/Browsers/Makefile
  3911. data/mint.pc
  3912. data/mono-2.pc
  3913. data/monosgen-2.pc
  3914. data/mono.pc
  3915. data/mono-cairo.pc
  3916. data/mono-nunit.pc
  3917. data/mono-options.pc
  3918. data/mono-lineeditor.pc
  3919. data/monodoc.pc
  3920. data/dotnet.pc
  3921. data/dotnet35.pc
  3922. data/wcf.pc
  3923. data/cecil.pc
  3924. data/system.web.extensions_1.0.pc
  3925. data/system.web.extensions.design_1.0.pc
  3926. data/system.web.mvc.pc
  3927. data/system.web.mvc2.pc
  3928. data/system.web.mvc3.pc
  3929. data/aspnetwebstack.pc
  3930. data/reactive.pc
  3931. samples/Makefile
  3932. support/Makefile
  3933. data/config
  3934. tools/Makefile
  3935. tools/locale-builder/Makefile
  3936. tools/sgen/Makefile
  3937. tools/monograph/Makefile
  3938. tools/pedump/Makefile
  3939. runtime/Makefile
  3940. msvc/Makefile
  3941. po/Makefile
  3942. ])
  3943. # Update all submodules recursively to ensure everything is checked out
  3944. $srcdir/scripts/update_submodules.sh
  3945. if test x$host_win32 = xyes; then
  3946. # Get rid of 'cyg' prefixes in library names
  3947. sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
  3948. # libtool seems to inherit -mno-cygwin from our CFLAGS, and uses it to compile its executable
  3949. # wrapper scripts which use exec(). gcc has no problem compiling+linking this, but the resulting
  3950. # executable doesn't work...
  3951. sed -e "s,-mno-cygwin,,g" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
  3952. fi
  3953. if test x$host_darwin = xyes; then
  3954. # This doesn't seem to be required and it slows down parallel builds
  3955. sed -e 's,lock_old_archive_extraction=yes,lock_old_archive_extraction=no,g' < libtool > libtool.new && mv libtool.new libtool && chmod +x libtool
  3956. fi
  3957. (
  3958. case $prefix in
  3959. NONE) prefix=$ac_default_prefix ;;
  3960. esac
  3961. case $exec_prefix in
  3962. NONE) exec_prefix='${prefix}' ;;
  3963. esac
  3964. #
  3965. # If we are cross compiling, we don't build in the mcs/ tree. Let us not clobber
  3966. # any existing config.make. This allows people to share the same source tree
  3967. # with different build directories, one native and one cross
  3968. #
  3969. if test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
  3970. test -w $mcs_topdir/build || chmod +w $mcs_topdir/build
  3971. echo "prefix=$prefix" > $mcs_topdir/build/config.make
  3972. echo "exec_prefix=$exec_prefix" >> $mcs_topdir/build/config.make
  3973. echo "sysconfdir=$sysconfdir" >> $mcs_topdir/build/config.make
  3974. echo 'mono_libdir=${exec_prefix}/lib' >> $mcs_topdir/build/config.make
  3975. echo "mono_build_root=$mono_build_root" >> $mcs_topdir/build/config.make
  3976. echo 'IL_FLAGS = /debug' >> $mcs_topdir/build/config.make
  3977. echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $mcs_topdir/build/config.make
  3978. echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $mcs_topdir/build/config.make
  3979. echo "JAY_CFLAGS = $JAY_CFLAGS" >> $mcs_topdir/build/config.make
  3980. case $INSTALL in
  3981. [[\\/$]]* | ?:[[\\/]]* ) mcs_INSTALL=$INSTALL ;;
  3982. *) mcs_INSTALL=$mono_build_root/$INSTALL ;;
  3983. esac
  3984. echo "INSTALL = $mcs_INSTALL" >> $mcs_topdir/build/config.make
  3985. export VERSION
  3986. [myver=$($AWK 'BEGIN {
  3987. split (ENVIRON["VERSION"] ".0.0.0", vsplit, ".")
  3988. if(length(vsplit [1]) > 4) {
  3989. split (substr(ENVIRON["VERSION"], 0, 4) "." substr(ENVIRON["VERSION"], 5) ".0.0", vsplit, ".")
  3990. }
  3991. print vsplit [1] "." vsplit [2] "." vsplit [3] "." vsplit [4]
  3992. }')]
  3993. echo "MONO_VERSION = $myver" >> $mcs_topdir/build/config.make
  3994. echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> $mcs_topdir/build/config.make
  3995. if test x$host_darwin = xyes; then
  3996. echo "BUILD_PLATFORM = darwin" >> $mcs_topdir/build/config.make
  3997. elif test x$host_win32 = xyes; then
  3998. echo "BUILD_PLATFORM = win32" >> $mcs_topdir/build/config.make
  3999. else
  4000. echo "BUILD_PLATFORM = linux" >> $mcs_topdir/build/config.make
  4001. fi
  4002. if test x$host_darwin = xyes; then
  4003. echo "HOST_PLATFORM ?= darwin" >> $mcs_topdir/build/config.make
  4004. elif test x$host_win32 = xyes; then
  4005. echo "HOST_PLATFORM ?= win32" >> $mcs_topdir/build/config.make
  4006. else
  4007. echo "HOST_PLATFORM ?= linux" >> $mcs_topdir/build/config.make
  4008. fi
  4009. if test "x$PLATFORM_AOT_SUFFIX" != "x"; then
  4010. echo "PLATFORM_AOT_SUFFIX = $PLATFORM_AOT_SUFFIX" >> $mcs_topdir/build/config.make
  4011. fi
  4012. if test x$AOT_SUPPORTED = xyes -a x$enable_system_aot = xdefault; then
  4013. enable_system_aot=yes
  4014. fi
  4015. if test x$host_win32 = xno -a x$enable_system_aot = xyes; then
  4016. echo "ENABLE_AOT = 1" >> $mcs_topdir/build/config.make
  4017. fi
  4018. if test x$DISABLE_MCS_DOCS = xyes; then
  4019. echo "DISABLE_MCS_DOCS = yes" >> $mcs_topdir/build/config.make
  4020. fi
  4021. if test x$has_extension_module != xno; then
  4022. echo "EXTENSION_MODULE = 1" >> $srcdir/$mcsdir/build/config.make
  4023. fi
  4024. echo "DEFAULT_PROFILE = $default_profile" >> $srcdir/$mcsdir/build/config.make
  4025. if test "x$test_bcl_opt" = "xyes"; then
  4026. echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make
  4027. fi
  4028. echo "CSC_LOCATION = $CSC_LOCATION" >> $srcdir/$mcsdir/build/config.make
  4029. if test $csc_compiler = mcs; then
  4030. echo "MCS_MODE = 1" >> $srcdir/$mcsdir/build/config.make
  4031. fi
  4032. if test "x$AOT_BUILD_FLAGS" != "x" ; then
  4033. echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
  4034. echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
  4035. fi
  4036. if test "x$enable_btls" = "xyes"; then
  4037. echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
  4038. fi
  4039. fi
  4040. )
  4041. libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
  4042. btls_platform_string=
  4043. if test x$enable_btls = xyes; then
  4044. if test x$btls_android = xyes; then
  4045. btls_platform_string=" (android:$BTLS_PLATFORM)"
  4046. else
  4047. btls_platform_string=" ($BTLS_PLATFORM)"
  4048. fi
  4049. fi
  4050. echo "
  4051. mcs source: $mcsdir
  4052. C# Compiler: $csc_compiler
  4053. Engine:
  4054. Host: $host
  4055. Target: $target
  4056. GC: $gc_msg
  4057. TLS: $with_tls
  4058. SIGALTSTACK: $with_sigaltstack
  4059. Engine: $jit_status
  4060. BigArrays: $enable_big_arrays
  4061. DTrace: $enable_dtrace
  4062. LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm)
  4063. Interpreter: $enable_interpreter
  4064. Libraries:
  4065. .NET 4.x: $with_profile4_x
  4066. Xamarin.Android: $with_monodroid
  4067. Xamarin.iOS: $with_monotouch
  4068. Xamarin.WatchOS: $with_monotouch_watch
  4069. Xamarin.TVOS: $with_monotouch_tv
  4070. Xamarin.Mac: $with_xammac
  4071. Windows AOT: $with_winaot
  4072. Orbis: $with_orbis
  4073. Test profiles: AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid)
  4074. JNI support: $jdk_headers_found
  4075. libgdiplus: $libgdiplus_msg
  4076. zlib: $zlib_msg
  4077. BTLS: $enable_btls$btls_platform_string
  4078. $disabled
  4079. "
  4080. if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
  4081. AC_MSG_WARN(Turning off static Mono is a risk, you might run into unexpected bugs)
  4082. fi