configure.ac 218 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007
  1. # Process this file with autoconf to produce a configure script.
  2. #AC_PREREQ([2.62])
  3. # This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
  4. # It should remain in the format they expect.
  5. #
  6. AC_INIT(mono, [6.6.0],
  7. [https://github.com/mono/mono/issues/new])
  8. AC_CONFIG_SRCDIR([README.md])
  9. AC_CONFIG_MACRO_DIR([m4])
  10. AC_CANONICAL_SYSTEM
  11. AC_CANONICAL_HOST
  12. # Gross hack to enable 'make dist' on automake 1.9+tar 1.14.
  13. # The extra brackets are to foil regex-based scans.
  14. m4_ifdef([_A][M_PROG_TAR],[_A][M_SET_OPTION([tar-ustar])])
  15. AM_INIT_AUTOMAKE([1.9 dist-xz tar-ustar no-dist-gzip foreign subdir-objects]
  16. m4_esyscmd([case `automake --version | head -n 1` in # parallel-tests is default in automake 1.13+, we need to explicitly enable it
  17. *1.11*|*1.12*) echo parallel-tests;; # for 1.11 and 1.12 but not below as those versions don't recognize the flag
  18. esac])) # TODO: remove this hack once we require automake 1.11+
  19. AC_CONFIG_HEADERS([config.h])
  20. AM_MAINTAINER_MODE
  21. m4_ifdef([AM_EXTRA_RECURSIVE_TARGETS], AM_EXTRA_RECURSIVE_TARGETS([test]))
  22. m4_ifdef([AM_EXTRA_RECURSIVE_TARGETS], AM_EXTRA_RECURSIVE_TARGETS([test-bundle]))
  23. API_VER=2.0
  24. AC_SUBST(API_VER)
  25. AC_PROG_LN_S
  26. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  27. MONO_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
  28. MONO_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
  29. MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
  30. #
  31. # This is the version of the corlib-runtime interface. When
  32. # making changes to this interface (by changing the layout
  33. # of classes the runtime knows about, changing icall signature or
  34. # semantics etc), change this variable.
  35. #
  36. # This must be unique relative to corlib interface and semantics.
  37. #
  38. # If you change corlib such that a runtime change is required, or
  39. # vice versa, change this string. Examples include removing icalls,
  40. # adding icalls, changing icall signatures, and changing type layouts
  41. # that both sides know.
  42. #
  43. # It is an arbitrary string and should be parsed as such.
  44. # A guid works and is encouraged.
  45. #
  46. # Generate it with uuidgen. For example:
  47. # perl -pi.bak -e "s/^MONO_CORLIB_VERSION=\S+/MONO_CORLIB_VERSION=`uuidgen`/" configure.ac
  48. #
  49. # There is no ordering of corlib versions, no old or new,
  50. # an exact match is required between corlib and runtime.
  51. #
  52. # This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
  53. # It should remain in the format they expect.
  54. #
  55. MONO_CORLIB_VERSION=A144A63D-652C-4CCF-A9EE-8E5A091547F1
  56. #
  57. # Put a quoted #define in config.h.
  58. # Substitute @MONO_CORLIB_VERSION@ unquoted.
  59. #
  60. AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,"$MONO_CORLIB_VERSION",[Version of the corlib-runtime interface])
  61. AC_SUBST(MONO_CORLIB_VERSION)
  62. case $host_os in
  63. *cygwin* )
  64. echo "Run configure using ./configure --host=i686-w64-mingw32 or --host=x86_64-w64-mingw32"
  65. exit 1
  66. esac
  67. # In case of cygwin, override LN_S, irrespective of what it determines.
  68. # The build uses cygwin, but the actual runtime doesn't.
  69. case $host_os in
  70. *cygwin* ) LN_S='cp -p';;
  71. esac
  72. #
  73. # libgc defaults
  74. #
  75. libgc_configure_args=
  76. # These variables are the CPPFLAGS/CFLAGS passed to libgc's configure
  77. # libgc should inherit the original CFLAGS/CPPFLAGS passed to configure, i.e. -O0
  78. CPPFLAGS_FOR_LIBGC=$CPPFLAGS
  79. CFLAGS_FOR_LIBGC=$CFLAGS
  80. CPPFLAGS_FOR_BTLS=$CPPFLAGS
  81. CFLAGS_FOR_BTLS=$CFLAGS
  82. # libgc uses some deprecated APIs
  83. CFLAGS_FOR_LIBGC="$CFLAGS -Wno-deprecated-declarations"
  84. #
  85. # These are the flags that need to be stored in the mono.pc file for
  86. # compiling code that will embed Mono
  87. #
  88. libmono_cflags=""
  89. libmono_ldflags=""
  90. AC_SUBST(libmono_cflags)
  91. AC_SUBST(libmono_ldflags)
  92. # Variable to have relocatable .pc files (lib, or lib64)
  93. # realpath isn't always available, and requires that all but the tip of the provided
  94. # path exists. Fall back to the old behaviour, but realpath allows depth >1
  95. # e.g. Debian puts Mono in /usr/bin and libs in /usr/lib/x86_64-linux-gnu/ which is
  96. # too deep for the old method to work
  97. reloc_libdir=`realpath --relative-to=${prefix} ${libdir} 2> /dev/null || basename ${libdir}`
  98. AC_SUBST(reloc_libdir)
  99. # Set to yes if Unix sockets cannot be created in an anonymous namespace
  100. need_link_unlink=no
  101. #Set to extra linker flags to be passed to the runtime binaries (mono /mono-sgen)
  102. extra_runtime_ldflags=""
  103. # Thread configuration inspired by sleepycat's db
  104. AC_MSG_CHECKING([host platform characteristics])
  105. libgc_threads=no
  106. has_dtrace=no
  107. parallel_mark=yes
  108. ikvm_native=yes
  109. host_win32=no
  110. target_win32=no
  111. target_wasm=no
  112. platform_android=no
  113. platform_tizen=no
  114. platform_ios=no
  115. host_darwin=no
  116. host_linux=no
  117. case "$host" in
  118. wasm32*)
  119. CFLAGS="$CFLAGS -D_REENTRANT -D_GNU_SOURCE -s WASM=1"
  120. CPPFLAGS="$CPPFLAGS -D_REENTRANT -DUSE_MMAP -s WASM=1"
  121. libgc_threads=pthreads
  122. platform_wasm=yes
  123. ;;
  124. *-mingw*|*-*-cygwin*)
  125. AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
  126. AC_DEFINE(HOST_NO_SYMLINKS,1,[This platform does not support symlinks])
  127. host_win32=yes
  128. mono_cv_clang=no
  129. if test "x$cross_compiling" = "xno"; then
  130. if test "x$host" = "x$build" -a "x$host" = "x$target"; then
  131. target_win32=yes
  132. fi
  133. else
  134. if test "x$host" = "x$target"; then
  135. target_win32=yes
  136. fi
  137. fi
  138. HOST_CC="gcc"
  139. RID="win-x86"
  140. CORETARGETS="-p:TargetsWindows=true"
  141. COREARCH="x86"
  142. # Boehm not supported on 64-bit Windows.
  143. case "$host" in
  144. x86_64-*-* | amd64-*-*)
  145. support_boehm=no
  146. with_gc=sgen
  147. RID="win-x64"
  148. COREARCH="x64"
  149. ;;
  150. esac
  151. # Windows 7 or later is required
  152. WIN32_CPPFLAGS="-DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -D_UNICODE -DUNICODE -DWIN32_THREADS -DFD_SETSIZE=1024"
  153. CPPFLAGS="$CPPFLAGS $WIN32_CPPFLAGS"
  154. WIN32_LDFLAGS="-lbcrypt -lmswsock -lws2_32 -lole32 -loleaut32 -lpsapi -lversion -ladvapi32 -lwinmm -lkernel32 -liphlpapi -static-libgcc"
  155. LDFLAGS="$LDFLAGS $WIN32_LDFLAGS"
  156. libmono_cflags="-mms-bitfields -mwindows"
  157. libmono_ldflags="-mms-bitfields -mwindows"
  158. libgc_threads=win32
  159. with_sigaltstack=no
  160. with_tls=pthread
  161. with_sgen_default_concurrent=yes
  162. LN_S=cp
  163. # This forces libgc to use the DllMain based thread registration code on win32
  164. libgc_configure_args="$libgc_configure_args --enable-win32-dllmain=yes"
  165. ;;
  166. *-*-*netbsd*)
  167. CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
  168. libmono_cflags="-D_REENTRANT"
  169. LDFLAGS="$LDFLAGS -pthread"
  170. CPPFLAGS="$CPPFLAGS -DHOST_BSD"
  171. libmono_ldflags="-pthread"
  172. need_link_unlink=yes
  173. libgc_threads=pthreads
  174. with_sigaltstack=no
  175. use_sigposix=yes
  176. with_sgen_default_concurrent=yes
  177. ;;
  178. *-*-kfreebsd*-gnu)
  179. CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP -DUSE_MUNMAP -DTHREAD_LOCAL_ALLOC -pthread"
  180. libmono_cflags="-D_REENTRANT -DTHREAD_LOCAL_ALLOC -pthread"
  181. libmono_ldflags="-lpthread -pthread"
  182. libgc_threads=pthreads
  183. need_link_unlink=yes
  184. with_sigaltstack=no
  185. use_sigposix=yes
  186. with_sgen_default_concurrent=yes
  187. ;;
  188. *-*-*freebsd*)
  189. dnl For close_my_fds
  190. LDFLAGS="$LDFLAGS -lutil"
  191. if test "x$PTHREAD_CFLAGS" = "x"; then
  192. CPPFLAGS="$CPPFLAGS -DGC_FREEBSD_THREADS"
  193. libmono_cflags=
  194. else
  195. CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS -DGC_FREEBSD_THREADS"
  196. libmono_cflags="$PTHREAD_CFLAGS"
  197. fi
  198. if test "x$PTHREAD_LIBS" = "x"; then
  199. LDFLAGS="$LDFLAGS -pthread -L/usr/local/lib"
  200. libmono_ldflags="-pthread"
  201. else
  202. LDFLAGS="$LDFLAGS $PTHREAD_LIBS -L/usr/local/lib"
  203. libmono_ldflags="$PTHREAD_LIBS"
  204. fi
  205. CPPFLAGS="$CPPFLAGS -DHOST_BSD -D_WITH_GETLINE"
  206. need_link_unlink=yes
  207. AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
  208. libgc_threads=pthreads
  209. use_sigposix=yes
  210. has_dtrace=yes
  211. case "$host" in
  212. aarch64-*)
  213. support_boehm=no
  214. with_gc=sgen
  215. ;;
  216. riscv*)
  217. support_boehm=no
  218. with_gc=sgen
  219. ;;
  220. esac
  221. with_sgen_default_concurrent=yes
  222. ;;
  223. *-*-*openbsd*)
  224. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DHOST_BSD -D_REENTRANT -DUSE_MMAP"
  225. LDFLAGS="${LDFLAGS} -Wl,-zwxneeded"
  226. if test "x$disable_munmap" != "xyes"; then
  227. CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
  228. fi
  229. libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
  230. LDFLAGS="$LDFLAGS -pthread"
  231. need_link_unlink=yes
  232. AC_DEFINE(PTHREAD_POINTER_ID)
  233. libgc_threads=pthreads
  234. with_tls=pthread
  235. with_sigaltstack=no
  236. use_sigposix=yes
  237. with_sgen_default_concurrent=yes
  238. ;;
  239. *-*-linux-android*)
  240. platform_android=yes
  241. AC_DEFINE(HOST_ANDROID,1,[Targeting the Android platform])
  242. AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
  243. CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
  244. if test "x$disable_munmap" != "xyes"; then
  245. CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
  246. fi
  247. libmono_cflags="-D_REENTRANT"
  248. libgc_threads=pthreads
  249. use_sigposix=yes
  250. with_tls=pthread
  251. with_sigaltstack=no
  252. with_static_mono=no
  253. # Android doesn't support boehm, as it's missing <link.h>
  254. support_boehm=no
  255. with_gc=sgen
  256. # isinf(3) requires -lm
  257. LDFLAGS="$LDFLAGS -lm"
  258. # Bionic's <pthread.h> sets PTHREAD_STACK_MIN=2*PAGE_SIZE; doesn't define
  259. # PAGE_SIZE; breaks mono/io-layer/collection.c
  260. # Bionic doesn't provide S_IWRITE; breaks io-layer/io.c
  261. CFLAGS="$CFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
  262. CXXFLAGS="$CXXFLAGS -DPAGE_SIZE=4096 -DS_IWRITE=S_IWUSR"
  263. # FIXME? Only if __ANDROID_API__ < 24?
  264. # FILE32API means "long", which is stuck at 32bits for 32bit ABI (64bits for 64bit ABI).
  265. # ABI 24 introduces the "o" for "file offset" variations, which can be widened to 64bits for 32bit ABI (and still 64bits for 64bit).
  266. # Android itself uses FILE32API, and mono should use system zlib on Android anyway.
  267. ZLIB_CFLAGS="$ZLIB_CFLAGS -DUSE_FILE32API"
  268. # to bypass the underscore linker check, can't work when cross-compiling
  269. mono_cv_uscore=yes
  270. mono_cv_clang=no
  271. ;;
  272. *-*-linux*)
  273. host_linux=yes
  274. CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
  275. if test "x$disable_munmap" != "xyes"; then
  276. CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
  277. fi
  278. libmono_cflags="-D_REENTRANT"
  279. libgc_threads=pthreads
  280. CORETARGETS="-p:TargetsUnix=true"
  281. use_sigposix=yes
  282. if test "x$cross_compiling" != "xno"; then
  283. # to bypass the underscore linker check, not
  284. # available during cross-compilation
  285. mono_cv_uscore=no
  286. fi
  287. case "$host" in
  288. *-tizen-linux-*)
  289. platform_tizen=yes
  290. ;;
  291. esac
  292. case "$host" in
  293. ppc64-*)
  294. RID="linux-ppc64"
  295. ;;
  296. ppc64le-*)
  297. RID="linux-ppc64el"
  298. ;;
  299. mipsel-*)
  300. RID="linux-mipsel"
  301. ;;
  302. x86-*)
  303. RID="linux-x86"
  304. COREARCH="x86"
  305. ;;
  306. x86_64-*)
  307. RID="linux-x64"
  308. COREARCH="x64"
  309. ;;
  310. arm-*)
  311. # deal with this in the FPU detection section, since
  312. # we cannot determine FPU from triplet and don't want
  313. # to duplicate the logic
  314. ;;
  315. aarch64-*)
  316. support_boehm=no
  317. with_gc=sgen
  318. RID="linux-arm64"
  319. COREARCH="arm64"
  320. ;;
  321. powerpc*-*-linux*)
  322. # https://bugzilla.novell.com/show_bug.cgi?id=504411
  323. disable_munmap=yes
  324. ;;
  325. riscv*)
  326. support_boehm=no
  327. with_gc=sgen
  328. ;;
  329. esac
  330. with_sgen_default_concurrent=yes
  331. ;;
  332. *-*-nacl*)
  333. echo "nacl no longer supported."
  334. exit 1
  335. ;;
  336. *-*-hpux*)
  337. CPPFLAGS="$CPPFLAGS -DGC_HPUX_THREADS -D_HPUX_SOURCE -D_XOPEN_SOURCE_EXTENDED -D_REENTRANT"
  338. # +ESdbgasm only valid on bundled cc on RISC
  339. # silently ignored for ia64
  340. if test $GCC != "yes"; then
  341. CFLAGS="$CFLAGS +ESdbgasm"
  342. # Arrange for run-time dereferencing of null
  343. # pointers to produce a SIGSEGV signal.
  344. LDFLAGS="$LDFLAGS -z"
  345. fi
  346. CFLAGS="$CFLAGS +ESdbgasm"
  347. LDFLAGS="$LDFLAGS -z"
  348. libmono_cflags="-D_REENTRANT"
  349. libmono_ldflags="-lpthread"
  350. libgc_threads=pthreads
  351. need_link_unlink=yes
  352. use_sigposix=yes
  353. ;;
  354. *-*-solaris*)
  355. CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DHOST_SOLARIS"
  356. need_link_unlink=yes
  357. libmono_cflags="-D_REENTRANT"
  358. libgc_threads=pthreads
  359. has_dtrace=yes
  360. use_sigposix=yes
  361. enable_solaris_tar_check=yes
  362. ;;
  363. *-*-darwin*)
  364. parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
  365. host_darwin=yes
  366. target_mach=yes
  367. CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DUSE_MMAP -DUSE_MUNMAP"
  368. libmono_cflags="-D_THREAD_SAFE"
  369. need_link_unlink=yes
  370. AC_DEFINE(PTHREAD_POINTER_ID)
  371. AC_DEFINE(USE_MACH_SEMA, 1, [...])
  372. CORETARGETS="-p:TargetsUnix=true -p:TargetsOSX=true"
  373. libgc_threads=pthreads
  374. has_dtrace=yes
  375. if test "x$cross_compiling" = "xyes"; then
  376. has_broken_apple_cpp=yes
  377. fi
  378. dnl Snow Leopard is horribly broken -- it reports itself as i386-apple-darwin*, but
  379. dnl its gcc defaults to 64-bit mode. They have also deprecated the usage of ucontext
  380. dnl we need to set some flags to build our 32-bit binaries on 10.6 properly
  381. case "$host" in
  382. dnl Snow Leopard and newer config.guess reports as this
  383. i*86-*-darwin*)
  384. BROKEN_DARWIN_FLAGS="-arch i386"
  385. BROKEN_DARWIN_CPPFLAGS=""
  386. CPPFLAGS="$CPPFLAGS $BROKEN_DARWIN_CPPFLAGS"
  387. CFLAGS="$CFLAGS $BROKEN_DARWIN_FLAGS"
  388. CXXFLAGS="$CXXFLAGS $BROKEN_DARWIN_FLAGS"
  389. CCASFLAGS="$CCASFLAGS $BROKEN_DARWIN_FLAGS"
  390. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC $BROKEN_DARWIN_CPPFLAGS"
  391. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC $BROKEN_DARWIN_FLAGS"
  392. with_sgen_default_concurrent=yes
  393. RID="osx-x86"
  394. COREARCH="x86"
  395. ;;
  396. x*64-*-darwin*)
  397. with_sgen_default_concurrent=yes
  398. RID="osx-x64"
  399. COREARCH="x64"
  400. ;;
  401. arm*-darwin*)
  402. platform_ios=yes
  403. has_dtrace=no
  404. ;;
  405. aarch64*-darwin*)
  406. platform_ios=yes
  407. ;;
  408. esac
  409. ;;
  410. *-*-haiku*)
  411. dnl BSD_SOURCE is for getifaddrs
  412. CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE -D_REENTRANT -D_THREAD_SAFE"
  413. libmono_cflags="-D_REENTRANT -D_THREAD_SAFE"
  414. LIBS="$LIBS -lnetwork -ltextencoding"
  415. need_link_unlink=yes
  416. AC_DEFINE(PTHREAD_POINTER_ID)
  417. dnl Haiku does not support static TLS with __thread
  418. with_tls=pthread
  419. libgc_threads=pthreads
  420. use_sigposix=yes
  421. with_sigaltstack=no
  422. ;;
  423. *-*-fuchsia*)
  424. AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
  425. AC_DEFINE(HOST_FUCHSIA,1,[Targeting the Fuchsia platform])
  426. fuchsia=true
  427. with_tls=pthread
  428. with_sigaltstack=yes
  429. with_static_mono=no
  430. support_boehm=no
  431. with_gc=sgen
  432. mono_cv_uscore=yes
  433. mono_cv_clang=no
  434. ;;
  435. *-*-aix*|*-*-os400*)
  436. dnl IMPORTANT: For svr4 sonames on AIX, you should set
  437. dnl `OBJECT_MODE=64` when configuring.
  438. dnl libtool cannot generate functioning svr4 sonames on
  439. dnl 64-bit without it.
  440. dnl Unfortunately, everything is complicated by the fact that
  441. dnl gcc doesn't respect this variable. (otherwise we could set
  442. dnl it for build time for configure and make)
  443. dnl On IBM i PASE using IBM's packages, GCC *does* respect this
  444. dnl variable, and builds are 64-bit by default. svr4 sonames
  445. dnl must still be specified when configuring on i, however.
  446. dnl As such, because Mono doesn't support 32-bit AIX or PASE,
  447. dnl set up a 64-bit build (assming GCC; XLC not supported)
  448. dnl regardless of what variable is used.
  449. case $host_os in
  450. aix*)
  451. if test "x$OBJECT_MODE" = "x64" && test "x$CC" = "x" && test "x$CXX" = "x"; then
  452. dnl HACK: Set -maix64 at the GCC invocation
  453. dnl level explicitly to work around the fact
  454. dnl GCC in default maix32 mode explodes when
  455. dnl binutils respects OBJECT_MODE.
  456. dnl When that check occurs, flags are not
  457. dnl passed to to the compiler, so GCC has no
  458. dnl chance to change its mode.
  459. dnl Otherwise, it may enter a state where it
  460. dnl runs, but uses the libtool "compile"
  461. dnl wrapper, which subtly breaks other things.
  462. dnl This should propagate to all uses of CC.
  463. dnl This is only set if not manually set.
  464. CC="gcc -maix64"
  465. CXX="g++ -maix64"
  466. echo
  467. fi
  468. ;;
  469. dnl Not needed on i because it defaults to 64-bit and
  470. dnl has a GCC smart enough to respect OBJECT_MODE.
  471. esac
  472. dnl We still set this for *FLAGS, however, because we may not
  473. dnl be setting OBJECT_MODE.
  474. LDFLAGS="$LDFLAGS -maix64"
  475. CPPFLAGS="$CPPFLAGS -maix64 -DGC_AIX_THREADS -D_ALL_SOURCE -D_THREAD_SAFE -D_LARGE_FILES -D_REENTRANT"
  476. libmono_cflags="-D_THREAD_SAFE -D_REENTRANT"
  477. dnl Would you believe GNU nm doesn't know how to process AIX libraries?
  478. dnl Hardcode IBM binutils in case GNU ones end up on our path. Also
  479. dnl specifiy 64-bit mode for tools. (OBJECT_MODE is finicky with cmake.)
  480. dnl XXX: We should stop the hardcoding madness
  481. AR="/usr/bin/ar -X64"
  482. NM="/usr/bin/nm -X64"
  483. STRIP="/usr/bin/strip -X64"
  484. RANLIB="/usr/bin/ranlib -X64"
  485. dnl SGen is the future (changes to Boehm support code would be
  486. dnl required if you wish to re-enable Boehm)
  487. support_boehm=no
  488. with_gc=sgen
  489. need_link_unlink=yes
  490. use_sigposix=yes
  491. dnl Similar limitation to macOS about the first thread and the
  492. dnl guard page, except sometimes the runtime hangs. Disable for
  493. dnl now until cause can be determined or it seems OK enough.
  494. with_sigaltstack=no
  495. dnl use pthread TLS, __thread has issues with the compiler flags we use
  496. with_tls=pthread
  497. dnl ppc Linux is the same? test further
  498. disable_munmap=yes
  499. RID="aix-ppc64"
  500. CORETARGETS="-p:TargetsUnix=true"
  501. ;;
  502. *)
  503. AC_MSG_WARN([*** Please add $host to configure.ac checks!])
  504. ;;
  505. esac
  506. AC_MSG_RESULT(ok)
  507. if test x$need_link_unlink = xyes; then
  508. AC_DEFINE(NEED_LINK_UNLINK, 1, [Define if Unix sockets cannot be created in an anonymous namespace])
  509. fi
  510. if test x$host_win32 = xyes; then
  511. AC_DEFINE(HOST_WIN32, 1, [Host Platform is Win32])
  512. fi
  513. if test x$target_win32 = xyes; then
  514. AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
  515. fi
  516. if test x$host_darwin = xyes; then
  517. AC_DEFINE(HOST_DARWIN, 1, [Host Platform is Darwin])
  518. fi
  519. # Defined for all targets/platforms using classic Windows API support.
  520. AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
  521. AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
  522. AC_SUBST(extra_runtime_ldflags)
  523. AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
  524. AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
  525. AM_CONDITIONAL(HOST_LINUX, echo x$target_os | grep -q linux)
  526. AM_CONDITIONAL(HOST_DARWIN, test x$host_darwin = xyes)
  527. AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
  528. AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
  529. AM_CONDITIONAL(HOST_TIZEN, test x$platform_tizen = xyes)
  530. AM_CONDITIONAL(HOST_IOS, test x$platform_ios = xyes)
  531. AM_CONDITIONAL(HOST_WASM, test x$platform_wasm = xyes)
  532. if test -z "$HOST_DARWIN_TRUE"; then :
  533. PLATFORM_AOT_SUFFIX=.dylib
  534. PLATFORM_AOT_PREFIX=lib
  535. fi
  536. if test -z "$HOST_LINUX_TRUE"; then :
  537. PLATFORM_AOT_SUFFIX=.so
  538. PLATFORM_AOT_PREFIX=lib
  539. fi
  540. if test -z "$HOST_WIN32_TRUE"; then :
  541. PLATFORM_AOT_SUFFIX=.dll
  542. PLATFORM_AOT_PREFIX=
  543. fi
  544. AC_SUBST(PLATFORM_AOT_SUFFIX)
  545. AC_SUBST(PLATFORM_AOT_PREFIX)
  546. if test -z "$HOST_WASM_TRUE"; then :
  547. AC_DEFINE(HAVE_UTIME)
  548. AC_DEFINE(HAVE_UTIMES)
  549. fi
  550. ## PLATFORM_AOT_SUFFIX not so simple for windows :-)
  551. AC_CHECK_TOOL(CC, gcc, gcc)
  552. AC_PROG_CC
  553. AC_CHECK_TOOL(CXX, g++, g++)
  554. AC_PROG_CXX
  555. AM_PROG_AS
  556. AC_PROG_INSTALL
  557. AC_PROG_AWK
  558. AM_PROG_CC_C_O
  559. dnl We should use AM_PROG_AS, but it's not available on automake/aclocal 1.4
  560. : ${CCAS='$(CC)'}
  561. # Set ASFLAGS if not already set.
  562. : ${CCASFLAGS='$(CFLAGS)'}
  563. AC_SUBST(CCAS)
  564. AC_SUBST(CCASFLAGS)
  565. if test "x$CXX" = "xno"; then
  566. AC_MSG_ERROR([No c++ compiler found. You need to install a c++ compiler])
  567. fi
  568. # AC_PROG_CXX helpfully sets CXX to g++ even if no c++ compiler is found so check
  569. # GXX instead. See http://lists.gnu.org/archive/html/bug-autoconf/2002-04/msg00056.html
  570. if test "x$CXX" = "xg++"; then
  571. if test "x$GXX" != "xyes"; then
  572. # automake/libtool is so broken, it requires g++ even if the c++ sources
  573. # are inside automake conditionals
  574. AC_MSG_ERROR([You need to install g++])
  575. fi
  576. fi
  577. dnl may require a specific autoconf version
  578. dnl AC_PROG_CC_FOR_BUILD
  579. dnl CC_FOR_BUILD not automatically detected
  580. CC_FOR_BUILD=$CC
  581. CFLAGS_FOR_BUILD=$CFLAGS
  582. BUILD_EXEEXT=
  583. if test "x$cross_compiling" = "xyes"; then
  584. CC_FOR_BUILD=cc
  585. CFLAGS_FOR_BUILD=
  586. BUILD_EXEEXT=""
  587. fi
  588. AC_SUBST(CC_FOR_BUILD)
  589. AC_SUBST(CFLAGS_FOR_BUILD)
  590. AC_SUBST(HOST_CC)
  591. AC_SUBST(BUILD_EXEEXT)
  592. AM_CONDITIONAL(CROSS_COMPILING, [test x$cross_compiling = xyes])
  593. AM_CONDITIONAL(USE_BATCH_FILES, [test x$host_win32 = xyes -a x$cross_compiling = xyes])
  594. # Set STDC_HEADERS
  595. AC_HEADER_STDC
  596. AC_LIBTOOL_WIN32_DLL
  597. # This causes monodis to not link correctly
  598. #AC_DISABLE_FAST_INSTALL
  599. #lookup makedev() header
  600. AC_HEADER_MAJOR
  601. AM_PROG_LIBTOOL
  602. # Use dolt (http://dolt.freedesktop.org/) instead of libtool for building.
  603. DOLT
  604. export_ldflags=`(./libtool --config; echo eval echo \\$export_dynamic_flag_spec) | sh`
  605. AC_SUBST(export_ldflags)
  606. # Test whenever ld supports -version-script
  607. AC_PROG_LD
  608. AC_PROG_LD_GNU
  609. 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 copyfile.h)
  610. 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)
  611. # zlib/configure checks for unistd.h existance and defines HAVE_UNISTD_H on the compiler
  612. # command line (not config.h) if it is present.
  613. AC_CHECK_HEADER(unistd.h,
  614. [HAVE_UNISTD_H=1
  615. ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_UNISTD_H"],
  616. [HAVE_UNISTD_H=0])
  617. AC_SUBST(HAVE_UNISTD_H)
  618. AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h],
  619. [], [], [#include <stddef.h>
  620. #include <sys/socket.h>
  621. #include <linux/socket.h>])
  622. AC_CHECK_HEADERS(sys/user.h, [], [],
  623. [
  624. #ifdef HAVE_SYS_PARAM_H
  625. # include <sys/param.h>
  626. #endif
  627. ])
  628. AC_CHECK_HEADERS(linux/serial.h)
  629. case "$host" in
  630. # Use bundled zlib on Windows to be sure it is static.
  631. *-mingw*|*-cygwin*)
  632. have_sys_zlib=no
  633. zlib_msg="bundled zlib"
  634. ;;
  635. *)
  636. AC_CHECK_HEADER(zlib.h, [have_sys_zlib=yes], [have_sys_zlib=no])
  637. if test x$have_sys_zlib = xyes; then
  638. AC_TRY_COMPILE([#include <zlib.h>], [
  639. #if defined(ZLIB_VERNUM) && (ZLIB_VERNUM >= 0x1230)
  640. #else
  641. #error No good zlib found
  642. #endif
  643. ],[
  644. AC_MSG_RESULT(Using system zlib)
  645. zlib_msg="system zlib"
  646. have_sys_zlib=yes
  647. ],[
  648. AC_MSG_RESULT(zlib too old, using embedded zlib)
  649. have_sys_zlib=no
  650. zlib_msg="bundled zlib"
  651. ])
  652. else
  653. AC_MSG_RESULT(zlib not found, using embedded zlib)
  654. have_sys_zlib=no
  655. zlib_msg="bundled zlib"
  656. fi
  657. ;;
  658. esac
  659. AC_ARG_WITH(static-zlib, [ --with-static-zlib=PATH use the specified static zlib instead of -lz],[STATIC_ZLIB_PATH=$with_static_zlib],[STATIC_ZLIB_PATH=])
  660. if test "x$STATIC_ZLIB_PATH" != "x"; then
  661. have_static_zlib=yes
  662. have_sys_zlib=no
  663. zlib_msg="static zlib from $STATIC_ZLIB_PATH"
  664. AC_SUBST(STATIC_ZLIB_PATH)
  665. fi
  666. AM_CONDITIONAL(HAVE_STATIC_ZLIB, test x$have_static_zlib = xyes)
  667. AM_CONDITIONAL(HAVE_SYS_ZLIB, test x$have_sys_zlib = xyes)
  668. if test x$have_static_zlib = xyes; then
  669. AC_DEFINE(HAVE_STATIC_ZLIB, 1, [Use static zlib])
  670. fi
  671. if test x$have_sys_zlib = xyes; then
  672. AC_DEFINE(HAVE_SYS_ZLIB, 1, [Use OS-provided zlib])
  673. fi
  674. # for mono/metadata/debug-symfile.c
  675. AC_CHECK_HEADERS(elf.h)
  676. # for support
  677. AC_CHECK_HEADERS(poll.h)
  678. AC_CHECK_HEADERS(sys/poll.h)
  679. AC_CHECK_HEADERS(sys/wait.h)
  680. AC_CHECK_HEADERS(grp.h)
  681. AC_CHECK_HEADERS(syslog.h)
  682. AC_CHECK_FUNCS(vsyslog)
  683. # for mono/dis
  684. AC_CHECK_HEADERS(wchar.h)
  685. # for Linux statfs support
  686. AC_CHECK_HEADERS(linux/magic.h)
  687. # For Android NDK unified headers
  688. if test x$platform_android = xyes; then
  689. AC_CHECK_HEADERS(machine/endian.h sys/endian.h)
  690. AC_CHECK_HEADERS(android/legacy_signal_inlines.h, [have_android_signal_inlines=yes], [have_android_signal_inlines=no])
  691. AC_CHECK_HEADERS(android/ndk-version.h)
  692. # Make sure SIGRT{MIN,MAX} work - they will fail to work with unified headers if building for
  693. # API level < 21 *and* android/legacy_signal_inlines.h doesn't declare (and define) the required
  694. # libc APIs to obtain values for SIGRT{MIN,MAX}. We perform the check only if android/legacy_signal_inlines.h
  695. # is found because in other cases the macros will either work (for NDK < 14) or fail if the legacy header
  696. # doesn't contain the required definitions (NDK 14)
  697. if test x$have_android_signal_inlines = xyes; then
  698. AC_MSG_CHECKING([Whether Android SIGRTMIN/SGRTMAX macros are valid])
  699. AC_COMPILE_IFELSE([
  700. AC_LANG_PROGRAM([#include <signal.h>
  701. #include <android/legacy_signal_inlines.h>],[
  702. int i;
  703. for (i = SIGRTMIN + 1; i < SIGRTMAX; ++i) {
  704. }
  705. ])],[
  706. AC_MSG_RESULT(yes)
  707. android_sigrtminmax_work=yes
  708. ],[
  709. AC_MSG_RESULT(no)
  710. android_sigrtminmax_work=no
  711. ]
  712. )
  713. if test x$android_sigrtminmax_work = xno; then
  714. AC_MSG_ERROR([Android SIGRTMIN/SIGRTMAX macros don't work in this NDK])
  715. fi
  716. fi
  717. # Attempt to detect whether we're using Android NDK unified headers
  718. AC_CHECK_HEADERS(android/api-level.h, [have_android_api_level=yes], [have_android_api_level=no])
  719. AC_CHECK_HEADERS(android/versioning.h, [have_android_versioning=yes], [have_android_versioning=no])
  720. android_unified_headers=no
  721. if test x$have_android_api_level = xyes; then
  722. if test x$have_android_versioning = xyes; then
  723. AC_MSG_CHECKING([whether using Android NDK unified headers])
  724. # Both macros are defined only in the NDK unified headers
  725. AC_COMPILE_IFELSE([
  726. AC_LANG_PROGRAM([
  727. #include <android/api-level.h>
  728. #include <android/versioning.h>
  729. ],[
  730. #if __ANDROID_API_O__ == 26 && defined(__INTRODUCED_IN)
  731. #else
  732. #error __ANDROID_API_O__ != 26 or the __INTRODUCED_IN macro not defined
  733. #endif
  734. ])],[
  735. AC_MSG_RESULT(yes)
  736. android_unified_headers=yes
  737. ],[
  738. AC_MSG_RESULT(no)
  739. android_unified_headers=no
  740. ]
  741. )
  742. fi
  743. fi
  744. if test x$android_unified_headers = xyes; then
  745. AC_DEFINE(ANDROID_UNIFIED_HEADERS, 1, [Whether Android NDK unified headers are used])
  746. fi
  747. fi # Android
  748. # not 64 bit clean in cross-compile
  749. AC_CHECK_SIZEOF(void *)
  750. AC_CHECK_SIZEOF(long)
  751. AC_CHECK_SIZEOF(int)
  752. AC_CHECK_SIZEOF(long long)
  753. AC_CACHE_CHECK([for clang],
  754. mono_cv_clang,[
  755. AC_TRY_COMPILE([], [
  756. #ifdef __clang__
  757. #else
  758. #error "FAILED"
  759. #endif
  760. ],
  761. [mono_cv_clang=yes],
  762. [mono_cv_clang=no],
  763. [])
  764. ])
  765. AC_ARG_ENABLE(visibility-hidden,
  766. [ --disable-visibility-hidden disable usage of -fvisiblity=hidden],
  767. disable_visibility_hidden=yes, disable_visibility_hidden=no)
  768. WARN=''
  769. if test x"$GCC" = xyes; then
  770. WARN='-Wall -Wunused -Wmissing-declarations -Wpointer-arith -Wno-cast-qual -Wwrite-strings -Wno-switch -Wno-switch-enum -Wno-unused-value -Wno-attributes'
  771. CFLAGS="$CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wno-format-zero-length"
  772. # We require C99 with some GNU extensions, e.g. `linux` macro
  773. CFLAGS="$CFLAGS -std=gnu99"
  774. # The runtime code does not respect ANSI C strict aliasing rules
  775. CFLAGS="$CFLAGS -fno-strict-aliasing"
  776. # We rely on signed overflow to behave
  777. CFLAGS="$CFLAGS -fwrapv"
  778. CFLAGS="$CFLAGS -DMONO_DLL_EXPORT"
  779. if test x"$disable_visibility_hidden" = xno; then
  780. # Don't export any symbols by default
  781. SHARED_CFLAGS="-fvisibility=hidden"
  782. CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
  783. fi
  784. ORIG_CFLAGS=$CFLAGS
  785. # Check for the normal version, since gcc ignores unknown -Wno options
  786. CFLAGS="$CFLAGS -Wunused-but-set-variable -Werror"
  787. AC_MSG_CHECKING(for -Wno-unused-but-set-variable option to gcc)
  788. AC_TRY_COMPILE([],[
  789. ], [
  790. AC_MSG_RESULT(yes)
  791. CFLAGS="$ORIG_CFLAGS -Wno-unused-but-set-variable"
  792. ], [
  793. AC_MSG_RESULT(no)
  794. CFLAGS=$ORIG_CFLAGS
  795. ])
  796. if test "x$mono_cv_clang" = "xyes"; then
  797. # https://bugzilla.samba.org/show_bug.cgi?id=8118
  798. WARN="$WARN -Qunused-arguments"
  799. WARN="$WARN -Wno-unused-function -Wno-tautological-compare -Wno-parentheses-equality -Wno-self-assign -Wno-return-stack-address -Wno-constant-logical-operand"
  800. # We rely on zero length arrays in structs
  801. WARN="$WARN -Wno-zero-length-array"
  802. fi
  803. else
  804. # The Sun Forte compiler complains about inline functions that access static variables
  805. # so disable all inlining.
  806. case "$host" in
  807. *-*-solaris*)
  808. CFLAGS="$CFLAGS -Dinline="
  809. ;;
  810. esac
  811. fi
  812. CFLAGS="$WARN $CFLAGS -g"
  813. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -g"
  814. CPPFLAGS="$WARN $CPPFLAGS -g"
  815. # Where's the 'mcs' source tree?
  816. if test -d $srcdir/mcs; then
  817. mcsdir=mcs
  818. else
  819. mcsdir=../mcs
  820. fi
  821. AC_ARG_WITH(mcs-path, [ --with-mcs-path=/path/to/mcs Specify an alternate mcs source tree],
  822. if test x$with_mcs_path != "x" -a -d $with_mcs_path ; then
  823. mcsdir=$with_mcs_path
  824. fi
  825. )
  826. AC_ARG_WITH(jumptables, [ --with-jumptables=yes,no enable/disable support for jumptables (ARM-only for now) (defaults to no)],[],[with_jumptables=no])
  827. AC_ARG_WITH(core, [ --with-core=only controls whether to build Mono as a .NET Core runtime (defaults to no)],[],[with_core=no])
  828. if test x$with_core = xonly; then
  829. AC_DEFINE(ENABLE_NETCORE,1,[Enables the support for .NET Core Features in the MonoVM])
  830. with_runtime_preset=netcore
  831. fi
  832. AM_CONDITIONAL(ENABLE_NETCORE, test x$with_core = xonly)
  833. #
  834. # A sanity check to catch cases where the package was unpacked
  835. # with an ancient tar program (Solaris)
  836. #
  837. AC_ARG_ENABLE(solaris-tar-check,
  838. [ --disable-solaris-tar-check disable solaris tar check],
  839. do_solaris_tar_check=no, do_solaris_tar_check=yes)
  840. if test x"$do_solaris_tar_check" = xyes -a x"$enable_solaris_tar_check" = xyes; then
  841. AC_MSG_CHECKING(integrity of package)
  842. if test -f $mcsdir/class/System.Runtime.Serialization.Formatters.Soap/System.Runtime.Serialization.Formatters.Soap/SoapTypeMapper.cs
  843. then
  844. AC_MSG_RESULT(ok)
  845. else
  846. 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"
  847. AC_MSG_ERROR([$errorm])
  848. fi
  849. fi
  850. if test "x$with_mcs_path" != "x"; then
  851. mcs_topdir=$(cd "$mcsdir" && pwd)
  852. mcs_topdir_from_srcdir=$mcs_topdir
  853. else
  854. mcs_topdir=$(cd "$srcdir/$mcsdir" && pwd)
  855. mcs_topdir_from_srcdir='$(top_builddir)'/$mcsdir
  856. fi
  857. # Convert mcs_topdir* paths to Windows syntax.
  858. if test x$cross_compiling$host_win32 = xnoyes; then
  859. mcs_topdir=$(cygpath -m $mcs_topdir)
  860. case $mcs_topdir_from_srcdir in
  861. /cygdrive/*)
  862. mcs_topdir_from_srcdir=$(cygpath -m $mcs_topdir_from_srcdir)
  863. ;;
  864. esac
  865. fi
  866. AC_SUBST([mcs_topdir])
  867. AC_SUBST([mcs_topdir_from_srcdir])
  868. # gettext: prepare the translation directories.
  869. # we do not configure the full gettext, as we consume it dynamically from C#
  870. AM_PO_SUBDIRS
  871. if test "x$USE_NLS" = "xyes"; then
  872. AC_CHECK_PROG(HAVE_MSGFMT, msgfmt,yes,no)
  873. if test "x$HAVE_MSGFMT" = "xno"; then
  874. AC_MSG_ERROR([msgfmt not found. You need to install the 'gettext' package, or pass --enable-nls=no to configure.])
  875. fi
  876. fi
  877. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  878. pkg_config_path=
  879. AC_ARG_WITH(crosspkgdir, [ --with-crosspkgdir=/path/to/pkg-config/dir Change pkg-config dir to custom dir],
  880. if test x$with_crosspkgdir = "x"; then
  881. if test -s $PKG_CONFIG_PATH; then
  882. pkg_config_path=$PKG_CONFIG_PATH
  883. fi
  884. else
  885. pkg_config_path=$with_crosspkgdir
  886. PKG_CONFIG_PATH=$pkg_config_path
  887. export PKG_CONFIG_PATH
  888. fi
  889. )
  890. AC_ARG_ENABLE(ninja,[ --enable-ninja Enable using ninja where available], enable_ninja=$enableval)
  891. AC_CHECK_PROG(HAVE_NINJA, ninja, yes, no)
  892. AM_CONDITIONAL(NINJA, test x$enable_ninja = xyes -a x$HAVE_NINJA != xno)
  893. AC_ARG_ENABLE(werror, [ --enable-werror Pass -Werror to the C compiler], werror_flag=$enableval, werror_flag=no)
  894. if test x$werror_flag = xyes; then
  895. WERROR_CFLAGS="-Werror"
  896. fi
  897. AC_SUBST([WERROR_CFLAGS])
  898. AC_SUBST([SHARED_CFLAGS])
  899. GLIB_CFLAGS='-I$(top_srcdir)/mono/eglib -I$(top_builddir)/mono/eglib'
  900. AC_SUBST(GLIB_CFLAGS)
  901. # Enable support for fast thread-local storage
  902. # Some systems have broken support, so we allow to disable it.
  903. AC_ARG_WITH(tls, [ --with-tls=__thread,pthread select Thread Local Storage implementation (defaults to __thread)],[],[with_tls=__thread])
  904. # Enable support for using sigaltstack for SIGSEGV and stack overflow handling
  905. # This does not work on some platforms (bug #55253)
  906. AC_ARG_WITH(sigaltstack, [ --with-sigaltstack=yes,no enable/disable support for sigaltstack (defaults to yes)],[],[with_sigaltstack=yes])
  907. AC_ARG_WITH(static_mono, [ --with-static_mono=yes,no link mono statically to libmono (faster) (defaults to yes)],[],[with_static_mono=yes])
  908. AC_ARG_WITH(shared_mono, [ --with-shared_mono=yes,no build a shared libmono library (defaults to yes)],[],[with_shared_mono=yes])
  909. # Same as --with-shared_mono=no
  910. AC_ARG_ENABLE(libraries, [ --disable-libraries disable the build of libmono], enable_libraries=$enableval, enable_libraries=yes)
  911. if test "x$enable_static" = "xno"; then
  912. with_static_mono=no
  913. fi
  914. if test "x$enable_shared" = "xno"; then
  915. with_shared_mono=no
  916. fi
  917. if test "x$enable_libraries" = "xno"; then
  918. with_shared_mono=no
  919. fi
  920. AM_CONDITIONAL(DISABLE_LIBRARIES, test x$enable_libraries = xno)
  921. if test "x$host_win32" = "xyes"; then
  922. # Boehm GC requires the runtime to be in its own dll
  923. with_static_mono=no
  924. fi
  925. AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
  926. AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
  927. AC_ARG_ENABLE(mcs-build, [ --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
  928. AC_ARG_ENABLE(support-build, [ --disable-support-build disable the build of the support directory], try_support_build=$enableval, enable_support_build=yes)
  929. AC_ARG_WITH(xen_opt, [ --with-xen_opt=yes,no Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
  930. if test "x$with_xen_opt" = "xyes" -a "x$mono_cv_clang" = "xno"; then
  931. AC_DEFINE(MONO_XEN_OPT, 1, [Xen-specific behaviour])
  932. ORIG_CFLAGS=$CFLAGS
  933. CFLAGS="$CFLAGS -mno-tls-direct-seg-refs"
  934. AC_MSG_CHECKING(for -mno-tls-direct-seg-refs option to gcc)
  935. AC_TRY_COMPILE([], [
  936. ], [
  937. AC_MSG_RESULT(yes)
  938. # Pass it to libgc as well
  939. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -mno-tls-direct-seg-refs"
  940. ], [
  941. AC_MSG_RESULT(no)
  942. CFLAGS=$ORIG_CFLAGS
  943. ])
  944. fi
  945. AC_ARG_ENABLE(small-config, [ --enable-small-config Enable tweaks to reduce requirements (and capabilities)], enable_small_config=$enableval, enable_small_config=no)
  946. if test x$enable_small_config = xyes; then
  947. AC_DEFINE(MONO_SMALL_CONFIG,1,[Reduce runtime requirements (and capabilities)])
  948. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DSMALL_CONFIG"
  949. fi
  950. 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)
  951. DISABLED_FEATURES=none
  952. csc_compiler=default
  953. endian=unknown
  954. AC_C_BIGENDIAN([endian=big],[endian=little],[endian=unknown])
  955. AC_MSG_CHECKING([CSharp compiler to use])
  956. AC_ARG_WITH(csc, [ --with-csc=mcs,roslyn,default Configures the CSharp compiler to use],[
  957. if test x$withval = xmcs; then
  958. csc_compiler=mcs
  959. elif test x$withval = xroslyn; then
  960. csc_compiler=roslyn
  961. elif test x$withval = xdefault; then
  962. :
  963. else
  964. AC_MSG_ERROR([You must supply one of "mcs", "roslyn" or "default" to the --with-csc option])
  965. fi
  966. ],[csc_compiler=default])
  967. if test $csc_compiler = default; then
  968. if test $endian = big; then
  969. csc_compiler=mcs
  970. elif test $endian = little; then
  971. case "$host" in
  972. powerpc*) csc_compiler=mcs ;;
  973. *) csc_compiler=roslyn ;;
  974. esac
  975. else
  976. csc_compiler=mcs
  977. fi
  978. fi
  979. AC_MSG_RESULT($csc_compiler)
  980. AC_ARG_WITH(jemalloc, [ --with-jemalloc=yes,no If jemalloc is enabled (defaults to no)], [], [with_jemalloc=no])
  981. AC_ARG_WITH(jemalloc-always, [ --with-jemalloc_always=yes,no If jemalloc is enabled and always used (defaults to yes)], [], [with_jemalloc_always=no])
  982. AC_ARG_WITH(jemalloc-assert, [ --with-jemalloc_assert=yes,no If jemalloc performs runtime checks for memory correctness (defaults to no)], [], [with_jemalloc_assert=no])
  983. if test x$target_win32 = xyes; then
  984. with_jemalloc=no
  985. with_jemalloc_assert=no
  986. with_jemalloc_always=no
  987. fi
  988. AM_CONDITIONAL(MONO_JEMALLOC_ASSERT, [test "x$with_jemalloc_assert" = "xyes"])
  989. if test "x$with_jemalloc_assert" = "xyes"; then
  990. JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ASSERT"
  991. AC_DEFINE(MONO_JEMALLOC_ASSERT, 1, [Make jemalloc assert for mono])
  992. AC_SUBST(MONO_JEMALLOC_ASSERT, 1)
  993. fi
  994. AM_CONDITIONAL(MONO_JEMALLOC_DEFAULT, [test "x$with_jemalloc_always" = "xyes"])
  995. if test "x$with_jemalloc_always" = "xyes"; then
  996. with_jemalloc=yes
  997. JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_DEFAULT"
  998. AC_DEFINE(MONO_JEMALLOC_DEFAULT, 1, [Make jemalloc default for mono])
  999. AC_SUBST(MONO_JEMALLOC_DEFAULT, 1)
  1000. fi
  1001. AM_CONDITIONAL(MONO_JEMALLOC_ENABLED, [test "x$with_jemalloc" = "xyes"])
  1002. if test "x$with_jemalloc" = "xyes"; then
  1003. JEMALLOC_LDFLAGS="-L`pwd`/mono/utils/jemalloc/jemalloc/lib -ljemalloc_pic"
  1004. JEMALLOC_CFLAGS+=" -DMONO_JEMALLOC_ENABLED -I `pwd`/mono/utils/jemalloc/jemalloc/include"
  1005. JEMALLOC_AUTOCONF_FLAGS=" --build=$target --host=$host"
  1006. if test "x$target_mach" = "xyes"; then
  1007. JEMALLOC_CPPFLAGS=" -stdlib=libc++ "
  1008. fi
  1009. AC_DEFINE(MONO_JEMALLOC_ENABLED, 1, [Enable jemalloc usage for mono])
  1010. AC_SUBST(MONO_JEMALLOC_ENABLED, 1)
  1011. AC_SUBST(JEMALLOC_CFLAGS)
  1012. AC_SUBST(JEMALLOC_CPPFLAGS)
  1013. AC_SUBST(JEMALLOC_LDFLAGS)
  1014. AC_SUBST(JEMALLOC_AUTOCONF_FLAGS)
  1015. fi
  1016. # Terminology:
  1017. # Crash privacy - Attempts to not send identifying information in the crash dump / to protect the obscurity of the program control flow
  1018. # MERP - The MS telemetry profile. Not for general use.
  1019. # Structured crashes - crashes at runtime that trigger a stack walk by mono that happens cooperatively
  1020. # Structured crashes are not merp crashes. Structured crashes are json dumps made by mono during crashes. Merp upload is going to use the dumping code is a very specific way, and is enabled at runtime with an icall.
  1021. #--with-crash_privacy=yes --with-structured_crashes=no means we don't wanna dump in non-merp-enabled builds, and we want to not send symbol strings. This is going to be the default pair of settings for VS4Mac.
  1022. #--with-crash_privacy=yes --with-structured_crashes=yes means you want to see crashes on your console, and you want to not see unmanaged symbol names. This is an option for proprietary apps that have manual bugs filed.
  1023. #--with-crash_privacy=no --with-structured_crashes=no means you want to see no crash dumps on failure and you don't care about privacy. This is how you'd set a "don't want it, don't care" configuration.
  1024. #--with-crash_privacy=no --with-structured_crashes=yes means you want full crashes and you want to see them in the terminal, not on telemetry. This is going to be how we build for CI.
  1025. AC_ARG_WITH(crash-privacy, [ --with-crash_privacy=yes,no If you want your crashes to not include names of symbols present in the binary. ], [], [with_crash_privacy=yes])
  1026. AC_ARG_WITH(structured-crashes, [ --with-structured_crashes=yes,no If you want your unmanaged crashes to result in a small crash dump file. ], [], [with_structured_crashes=yes])
  1027. AC_ARG_ENABLE(crash-reporting, [ --disable-crash-reporting Enable or Disable crash reporting subsystem], [crash_reporting=$enableval], [crash_reporting=yes])
  1028. if test "x$with_crash_privacy" = "xyes"; then
  1029. AC_DEFINE(MONO_PRIVATE_CRASHES,1,[Do not include names of unmanaged functions in the crash dump])
  1030. fi
  1031. if test "x$with_structured_crashes" = "xno"; then
  1032. AC_DEFINE(DISABLE_STRUCTURED_CRASH,1,[Do not create structured crash files during unmanaged crashes])
  1033. fi
  1034. case "$host" in
  1035. *-mingw*|*-*-cygwin*|*-*-aix*|*-*-os400*)
  1036. crash_reporting=no
  1037. ;;
  1038. esac
  1039. if test "x$crash_reporting" != "xyes"; then
  1040. CFLAGS="$CFLAGS -DDISABLE_CRASH_REPORTING=1"
  1041. CXXFLAGS="$CXXFLAGS -DDISABLE_CRASH_REPORTING=1"
  1042. fi
  1043. AC_ARG_ENABLE(monodroid, [ --enable-monodroid Enable runtime support for Monodroid (Xamarin.Android)], enable_monodroid=$enableval, enable_monodroid=no)
  1044. AM_CONDITIONAL(ENABLE_MONODROID, test x$enable_monodroid = xyes)
  1045. AC_ARG_ENABLE(monotouch, [ --enable-monotouch Enable runtime support for Monotouch (Xamarin.iOS and Xamarin.Mac)], enable_monotouch=$enableval, enable_monotouch=no)
  1046. AM_CONDITIONAL(ENABLE_MONOTOUCH, test x$enable_monotouch = xyes)
  1047. if test x$enable_monodroid = xyes; then
  1048. AC_DEFINE(ENABLE_MONODROID, 1, [Enable runtime support for Monodroid (Xamarin.Android)])
  1049. fi
  1050. if test x$enable_monotouch = xyes; then
  1051. AC_DEFINE(ENABLE_MONOTOUCH, 1, [Enable runtime support for Monotouch (Xamarin.iOS and Xamarin.Mac)])
  1052. fi
  1053. AC_ARG_ENABLE(cxx, [ --enable-cxx compile some code as C++])
  1054. # mono/corefx/native has a lot of invalid C++98 in its headers
  1055. # dotnet/corefx/native looks a lot better, i.e. 44e5bdafb8d989a220c9cf1b94f31a64a6e4f052
  1056. #CXXFLAGS_COMMON=' -std=gnu++98 -fno-exceptions -fno-rtti '
  1057. CXXFLAGS_COMMON=' -std=gnu++0x -fno-exceptions -fno-rtti '
  1058. # "c++0x" instead of C++11, for compat with Centos6/gcc4.4
  1059. # -stdlib=libc++ is needed by clang for iOS 6.0 (-miphoneos-version-min=6.0)
  1060. # to support C++11 headers but it does not seem to harm elsewhere, so over-approximate
  1061. # and add it whenever we're running clang on Darwin.
  1062. if test "x$mono_cv_clang" = xyes -a x$host_darwin = xyes; then
  1063. CXXFLAGS_COMMON="$CXXFLAGS_COMMON -stdlib=libc++"
  1064. fi
  1065. AC_SUBST(CXXFLAGS_COMMON)
  1066. if test "x$enable_cxx" = "xyes"; then
  1067. CXX_ADD_CFLAGS=" -xc++ $CXXFLAGS_COMMON "
  1068. # -std=gnu99 -xc++ is not allowed and errors.
  1069. CXX_REMOVE_CFLAGS=-std=gnu99
  1070. # These give warnings and should be removed. They are C-only.
  1071. # i.e. C++ never allows these, they are always errors and their warningness is not controllable.
  1072. CXX_REMOVE_CFLAGS="$CXX_REMOVE_CFLAGS -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs"
  1073. # Likewise with CentOS 6 gcc 4.4.
  1074. CXX_REMOVE_CFLAGS="$CXX_REMOVE_CFLAGS -Werror-implicit-function-declaration"
  1075. # The C-only-ness of -Wno-format-zero-length varies with gcc version.
  1076. # It is C-only prior to 4.7. Using it with C++ prior to 4.7
  1077. # generates a warning every time we run gcc which is very unsightly.
  1078. # The warning is for e.g. sprintf(foo, "") which can just be
  1079. # foo[0] = 0 but Mono's use is more elaborate, not as easy to "fix",
  1080. # and completely legal and valid.
  1081. # We have to switch to C++ and not just use -xc++ because of -std=gnu99 (error when combined with -xc++).
  1082. # Alternatively, just run $CXX -xc++ -c /dev/null.
  1083. AC_LANG_PUSH(C++)
  1084. ORIG_CXXFLAGS=$CXXFLAGS
  1085. CXXFLAGS="$CXXFLAGS -Werror -Wno-format-zero-length -xc++ "
  1086. AC_MSG_CHECKING(or C-only-ness of -Wno-format-zero-length)
  1087. AC_TRY_COMPILE([ ], [ ], [ AC_MSG_RESULT(yes) ],
  1088. [ AC_MSG_RESULT(no)
  1089. CXX_REMOVE_CFLAGS="$CXX_REMOVE_CFLAGS -Wno-format-zero-length" ])
  1090. CXXFLAGS=$ORIG_CXXFLAGS
  1091. AC_LANG_POP(C++)
  1092. fi
  1093. AC_SUBST(CXX_ADD_CFLAGS)
  1094. AC_SUBST(CXX_REMOVE_CFLAGS)
  1095. #
  1096. # Set the build profiles and options before things which use them
  1097. #
  1098. 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])
  1099. AC_ARG_WITH(monodroid, [ --with-monodroid=yes,no If you want to build the MonoDroid assemblies (defaults to no)], [], [with_monodroid=default])
  1100. AC_ARG_WITH(monotouch, [ --with-monotouch=yes,no If you want to build the Xamarin.iOS assemblies (defaults to no)], [], [with_monotouch=default])
  1101. 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])
  1102. 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])
  1103. AC_ARG_WITH(bitcode, [ --with-bitcode=yes,no If bitcode is enabled (defaults to no)], [], [with_bitcode=default])
  1104. AC_ARG_WITH(xammac, [ --with-xammac=yes,no If you want to build the Xamarin.Mac assemblies (defaults to no)], [], [with_xammac=default])
  1105. AC_ARG_WITH(testing_aot_full_interp, [ --with-testing_aot_full_interp=yes,no If you want to build the testing_aot_full_interp assemblies (defaults to no)], [], [with_testing_aot_full_interp=default])
  1106. 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])
  1107. 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])
  1108. AC_ARG_WITH(winaot, [ --with-winaot=yes,no If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
  1109. AC_ARG_WITH(testing_winaot_interp, [ --with-testing_winaot_interp=yes,no If you want to build the Windows friendly AOT + Interpreter testing assemblies (defaults to no)], [], [with_testing_winaot_interp=default])
  1110. AC_ARG_WITH(orbis, [ --with-orbis=yes,no If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
  1111. AC_ARG_WITH(unreal, [ --with-unreal=yes,no If you want to build the Unreal assemblies (defaults to no)], [], [with_unreal=default])
  1112. AC_ARG_WITH(wasm, [ --with-wasm=yes,no If you want to build the WebAssembly (defaults to no)], [], [with_wasm=default])
  1113. AC_ARG_WITH(runtime-preset, [ --with-runtime-preset=net_4_x,all,aot,aot_llvm,hybridaot,hybridaot_llvm,fullaot,fullaot_llvm,winaot,winaotinterp,winaot_llvm,winaotinterp_llvm,bitcode,bitcodeinterp,unreal,fullaotinterp,fullaotinterp_llvm Which default profile to build (defaults to net_4_x)], [], [with_runtime_preset=net_4_x])
  1114. AC_ARG_WITH(spectre-mitigation, [ --with-spectre-mitigation=yes,no If you want to build the runtime with compiler flags that enable Spectre mitigation (defaults to no)], [], [with_spectre_mitigation=default])
  1115. AC_ARG_WITH(spectre-indirect-branch-choice, [ --with-spectre-indirect-branch-choice=keep,thunk,inline,extern Convert indirect branches to the specified kind of thunk (defaults to inline)], [], [with_spectre_indirect_branch_choice=inline])
  1116. AC_ARG_WITH(spectre-function-return-choice, [ --with-spectre-function-return-choice=keep,thunk,inline,extern Convert function return instructions to the specified kind of thunk (defaults to inline)], [], [with_spectre_function_return_choice=inline])
  1117. dnl
  1118. dnl Spectre compiler mitigation flag checks
  1119. dnl
  1120. if test "x$with_spectre_mitigation" = "xyes"; then
  1121. AC_MSG_NOTICE([Compiler Spectre mitigation support checks])
  1122. SPECTRE_CFLAGS=
  1123. SPECTRE_INDIRECT_BRANCH_KIND=
  1124. case "x$with_spectre_indirect_branch_choice" in
  1125. xkeep) SPECTRE_INDIRECT_BRANCH_KIND=keep ;;
  1126. xthunk) SPECTRE_INDIRECT_BRANCH_KIND=thunk ;;
  1127. xinline) SPECTRE_INDIRECT_BRANCH_KIND=thunk-inline ;;
  1128. xextern) SPECTRE_INDIRECT_BRANCH_KIND=thunk-extern ;;
  1129. *) AC_MSG_ERROR([Invalid indirect jump thunk kind ($with_spectre_indirect_branch_choice)]) ;;
  1130. esac
  1131. SPECTRE_FUNCTION_RETURN_KIND=""
  1132. case "x$with_spectre_function_return_choice" in
  1133. xkeep) SPECTRE_FUNCTION_RETURN_KIND=keep ;;
  1134. xthunk) SPECTRE_FUNCTION_RETURN_KIND=thunk ;;
  1135. xinline) SPECTRE_FUNCTION_RETURN_KIND=thunk-inline ;;
  1136. xextern) SPECTRE_FUNCTION_RETURN_KIND=thunk-extern ;;
  1137. *) AC_MSG_ERROR([Invalid function return thunk kind ($with_spectre_function_return_choice)]) ;;
  1138. esac
  1139. AX_CHECK_COMPILE_FLAG(
  1140. [ -mindirect-branch=$SPECTRE_INDIRECT_BRANCH_KIND ],
  1141. [ SPECTRE_CFLAGS="$SPECTRE_CFLAGS -mindirect-branch=$SPECTRE_INDIRECT_BRANCH_KIND" ]
  1142. )
  1143. AX_CHECK_COMPILE_FLAG(
  1144. [ -mfunction-return=$SPECTRE_FUNCTION_RETURN_KIND ],
  1145. [ SPECTRE_CFLAGS="$SPECTRE_CFLAGS -mfunction-return=$SPECTRE_FUNCTION_RETURN_KIND" ]
  1146. )
  1147. if test "x$SPECTRE_CFLAGS" != "x" ; then
  1148. CFLAGS="$CFLAGS $SPECTRE_CFLAGS"
  1149. CXXFLAGS="$CXXFLAGS $SPECTRE_CFLAGS"
  1150. spectre_mitigation_status="mitigation enabled"
  1151. fi
  1152. else
  1153. spectre_mitigation_status="no mitigation"
  1154. fi
  1155. dnl
  1156. dnl Profile defaults
  1157. dnl
  1158. TEST_PROFILE=default
  1159. enable_llvm_default=no
  1160. with_profile4_x_default=no
  1161. with_monodroid_default=no
  1162. with_monotouch_default=no
  1163. with_monotouch_watch_default=no
  1164. with_monotouch_tv_default=no
  1165. with_xammac_default=no
  1166. with_testing_aot_full_interp_default=no
  1167. with_testing_aot_hybrid_default=no
  1168. with_testing_aot_full_default=no
  1169. with_winaot_default=no
  1170. with_testing_winaot_interp_default=no
  1171. with_orbis_default=no
  1172. with_unreal_default=no
  1173. with_wasm_default=no
  1174. with_bitcode_default=no
  1175. enable_cooperative_suspend_default=no
  1176. enable_hybrid_suspend_default=no
  1177. # For the sake of clearer error messages, these numbers should all be different from each other.
  1178. INVARIANT_AOT_OPTIONS=nimt-trampolines=2000,ntrampolines=10000,nrgctx-fetch-trampolines=256,ngsharedvt-trampolines=4400,nftnptr-arg-trampolines=4000,nrgctx-trampolines=21000
  1179. AOT_BUILD_ATTRS=$INVARIANT_AOT_OPTIONS
  1180. MONO_LLVM_PATH_OPTION=llvm-path="`pwd`/llvm/usr/bin"
  1181. if test x$cross_compiling = xyes -o x$enable_mcs_build = xno; then
  1182. DISABLE_MCS_DOCS_default=yes
  1183. elif test x$with_runtime_preset = xnetcore; then
  1184. DISABLE_MCS_DOCS_default=yes
  1185. BTLS_SUPPORTED=no
  1186. enable_mcs_build=no
  1187. enable_support_build=no
  1188. mono_feature_disable_remoting='yes'
  1189. mono_feature_disable_reflection_emit_save='yes'
  1190. mono_feature_disable_appdomains='yes'
  1191. mono_feature_disable_cleanup='yes'
  1192. mono_feature_disable_assembly_remapping='yes'
  1193. mono_feature_disable_security='yes'
  1194. mono_feature_disable_mdb='yes'
  1195. mono_feature_disable_com='yes'
  1196. mono_feature_disable_gac='yes'
  1197. disable_mono_native=yes
  1198. support_boehm=no
  1199. elif test x$with_runtime_preset = xnet_4_x; then
  1200. with_profile4_x_default=yes
  1201. TEST_PROFILE=net_4_x
  1202. elif test x$with_runtime_preset = xall; then
  1203. with_profile4_x_default=yes
  1204. with_monodroid_default=yes
  1205. with_monotouch_default=yes
  1206. with_monotouch_watch_default=yes
  1207. with_monotouch_tv_default=yes
  1208. with_xammac_default=yes
  1209. with_winaot_default=yes
  1210. with_testing_winaot_interp_default=yes
  1211. with_orbis_default=yes
  1212. with_unreal_default=yes
  1213. with_wasm_default=yes
  1214. with_testing_aot_full_interp_default=yes
  1215. with_testing_aot_hybrid_default=yes
  1216. with_testing_aot_full_default=yes
  1217. TEST_PROFILE=net_4_x
  1218. elif test x$with_runtime_preset = xbitcode; then
  1219. DISABLE_MCS_DOCS_default=yes
  1220. with_testing_aot_full_default=yes
  1221. with_bitcode_default=yes
  1222. enable_cooperative_suspend_default=yes
  1223. # FIXME: use TEST_PROFILE=testing_aot_full
  1224. TEST_PROFILE=testing_aot_bitcode
  1225. PLATFORM_TEST_HARNESS_EXCLUDES=BitcodeNotSupported
  1226. enable_llvm_default=yes
  1227. mono_feature_disable_com='yes'
  1228. mono_feature_disable_remoting='yes'
  1229. mono_feature_disable_reflection_emit_save='yes'
  1230. mono_feature_disable_reflection_emit='yes'
  1231. mono_feature_disable_appdomains='yes'
  1232. # We need at least clang++-6.0 to read the LLVM IR produced by the runtime
  1233. AOT_BUILD_FLAGS="--runtime=mobile --aot=llvmonly,clangxx=clang++-6.0,$INVARIANT_AOT_OPTIONS"
  1234. AOT_RUN_FLAGS="--runtime=mobile --llvmonly"
  1235. AOT_MODE="llvmonly"
  1236. elif test x$with_runtime_preset = xbitcodeinterp; then
  1237. with_testing_aot_full_interp_default=yes
  1238. with_bitcode_default=yes
  1239. enable_cooperative_suspend_default=yes
  1240. # FIXME: use TEST_PROFILE=testing_aot_full_interp
  1241. TEST_PROFILE=testing_aot_bitcode_interp
  1242. PLATFORM_TEST_HARNESS_EXCLUDES=BitcodeNotSupported
  1243. enable_llvm_default=yes
  1244. # mscorlib.dll aot compilation crashes
  1245. mono_feature_disable_com='yes'
  1246. # We need at least clang++-6.0 to read the LLVM IR produced by the runtime
  1247. AOT_BUILD_FLAGS="--aot=llvmonly,interp,clangxx=clang++-6.0,$INVARIANT_AOT_OPTIONS"
  1248. AOT_RUN_FLAGS="--llvmonly-interp"
  1249. elif test x$with_runtime_preset = xfullaot; then
  1250. DISABLE_MCS_DOCS_default=yes
  1251. with_testing_aot_full_default=yes
  1252. TEST_PROFILE=testing_aot_full
  1253. mono_feature_disable_com='yes'
  1254. mono_feature_disable_remoting='yes'
  1255. mono_feature_disable_reflection_emit_save='yes'
  1256. mono_feature_disable_reflection_emit='yes'
  1257. mono_feature_disable_appdomains='yes'
  1258. AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
  1259. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  1260. AOT_MODE="full"
  1261. elif test x$with_runtime_preset = xfullaot_llvm; then
  1262. DISABLE_MCS_DOCS_default=yes
  1263. with_testing_aot_full_default=yes
  1264. TEST_PROFILE=testing_aot_full
  1265. mono_feature_disable_com='yes'
  1266. mono_feature_disable_remoting='yes'
  1267. mono_feature_disable_reflection_emit_save='yes'
  1268. mono_feature_disable_reflection_emit='yes'
  1269. mono_feature_disable_appdomains='yes'
  1270. AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --llvm --aot=full,$INVARIANT_AOT_OPTIONS"
  1271. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  1272. AOT_MODE="full"
  1273. elif test x$with_runtime_preset = xhybridaot; then
  1274. DISABLE_MCS_DOCS_default=yes
  1275. with_testing_aot_hybrid_default=yes
  1276. TEST_PROFILE=testing_aot_hybrid
  1277. AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
  1278. AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
  1279. elif test x$with_runtime_preset = xhybridaot_llvm; then
  1280. DISABLE_MCS_DOCS_default=yes
  1281. with_testing_aot_hybrid_default=yes
  1282. TEST_PROFILE=testing_aot_hybrid
  1283. AOT_BUILD_FLAGS="--runtime=mobile --llvm --aot=hybrid,$INVARIANT_AOT_OPTIONS"
  1284. AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
  1285. elif test x$with_runtime_preset = xfullaotinterp; then
  1286. with_testing_aot_full_interp_default=yes
  1287. TEST_PROFILE=testing_aot_full_interp
  1288. # mscorlib.dll aot compilation crashes
  1289. mono_feature_disable_com='yes'
  1290. AOT_BUILD_FLAGS="--aot=full,interp,$INVARIANT_AOT_OPTIONS"
  1291. AOT_RUN_FLAGS="--full-aot-interp"
  1292. elif test x$with_runtime_preset = xfullaotinterp_llvm; then
  1293. with_testing_aot_full_interp_default=yes
  1294. TEST_PROFILE=testing_aot_full_interp
  1295. # mscorlib.dll aot compilation crashes
  1296. mono_feature_disable_com='yes'
  1297. AOT_BUILD_FLAGS="-O=gsharedvt --llvm --aot=full,interp,$INVARIANT_AOT_OPTIONS"
  1298. AOT_RUN_FLAGS="--full-aot-interp"
  1299. elif test x$with_runtime_preset = xaot; then
  1300. with_profile4_x_default=yes
  1301. AOT_BUILD_FLAGS="--aot=$INVARIANT_AOT_OPTIONS"
  1302. AOT_RUN_FLAGS=""
  1303. DISABLE_MCS_DOCS_default=yes
  1304. elif test x$with_runtime_preset = xaot_llvm; then
  1305. with_profile4_x_default=yes
  1306. AOT_BUILD_FLAGS="--llvm --aot=$INVARIANT_AOT_OPTIONS"
  1307. AOT_RUN_FLAGS=""
  1308. DISABLE_MCS_DOCS_default=yes
  1309. elif test x$with_runtime_preset = xwinaot; then
  1310. DISABLE_MCS_DOCS_default=yes
  1311. with_winaot_default=yes
  1312. TEST_PROFILE=winaot
  1313. mono_feature_disable_com='yes'
  1314. mono_feature_disable_remoting='yes'
  1315. mono_feature_disable_reflection_emit_save='yes'
  1316. mono_feature_disable_reflection_emit='yes'
  1317. mono_feature_disable_appdomains='yes'
  1318. AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --aot=full,$INVARIANT_AOT_OPTIONS"
  1319. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  1320. AOT_MODE="full"
  1321. elif test x$with_runtime_preset = xwinaotinterp; then
  1322. DISABLE_MCS_DOCS_default=yes
  1323. with_testing_winaot_interp_default=yes
  1324. TEST_PROFILE=testing_winaot_interp
  1325. mono_feature_disable_com='yes'
  1326. mono_feature_disable_remoting='yes'
  1327. mono_feature_disable_appdomains='yes'
  1328. AOT_BUILD_FLAGS="--aot=full,interp,$INVARIANT_AOT_OPTIONS"
  1329. AOT_RUN_FLAGS="--full-aot-interp"
  1330. elif test x$with_runtime_preset = xwinaotinterp_llvm; then
  1331. DISABLE_MCS_DOCS_default=yes
  1332. with_testing_winaot_interp_default=yes
  1333. TEST_PROFILE=testing_winaot_interp
  1334. mono_feature_disable_com='yes'
  1335. mono_feature_disable_remoting='yes'
  1336. mono_feature_disable_appdomains='yes'
  1337. INVARIANT_AOT_OPTIONS="llvmllc=-mattr=sse4.1,$INVARIANT_AOT_OPTIONS"
  1338. AOT_BUILD_FLAGS="-O=gsharedvt --llvm --aot=full,interp,$INVARIANT_AOT_OPTIONS"
  1339. AOT_RUN_FLAGS="--full-aot-interp"
  1340. elif test x$with_runtime_preset = xwinaot_llvm; then
  1341. DISABLE_MCS_DOCS_default=yes
  1342. with_winaot_default=yes
  1343. TEST_PROFILE=winaot
  1344. mono_feature_disable_com='yes'
  1345. mono_feature_disable_remoting='yes'
  1346. mono_feature_disable_reflection_emit_save='yes'
  1347. mono_feature_disable_reflection_emit='yes'
  1348. mono_feature_disable_appdomains='yes'
  1349. INVARIANT_AOT_OPTIONS="llvmllc=-mattr=sse4.1,$INVARIANT_AOT_OPTIONS"
  1350. AOT_BUILD_FLAGS="--runtime=mobile -O=gsharedvt --llvm --aot=full,$INVARIANT_AOT_OPTIONS"
  1351. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  1352. AOT_MODE="full"
  1353. elif test x$with_runtime_preset = xorbis; then
  1354. DISABLE_MCS_DOCS_default=yes
  1355. with_orbis_default=yes
  1356. TEST_PROFILE=orbis
  1357. mono_feature_disable_com='yes'
  1358. mono_feature_disable_remoting='yes'
  1359. mono_feature_disable_reflection_emit_save='yes'
  1360. mono_feature_disable_reflection_emit='yes'
  1361. mono_feature_disable_appdomains='yes'
  1362. AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
  1363. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  1364. AOT_MODE="full"
  1365. elif test x$with_runtime_preset = xunreal; then
  1366. DISABLE_MCS_DOCS_default=yes
  1367. with_unreal_default=yes
  1368. TEST_PROFILE=unreal
  1369. mono_feature_disable_com='yes'
  1370. mono_feature_disable_remoting='yes'
  1371. mono_feature_disable_appdomains='no'
  1372. AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
  1373. AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
  1374. elif test x$with_runtime_preset = xwasm; then
  1375. DISABLE_MCS_DOCS_default=yes
  1376. with_wasm_default=yes
  1377. TEST_PROFILE=wasm
  1378. mono_feature_disable_com='yes'
  1379. mono_feature_disable_remoting='yes'
  1380. mono_feature_disable_reflection_emit_save='yes'
  1381. mono_feature_disable_reflection_emit='yes'
  1382. mono_feature_disable_appdomains='yes'
  1383. AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
  1384. AOT_RUN_FLAGS="--runtime=mobile --full-aot"
  1385. else
  1386. TEST_PROFILE=net_4_x
  1387. with_profile4_x_default=yes
  1388. fi
  1389. if test "x$AOT_BUILD_FLAGS" != "x"; then :
  1390. AC_SUBST(AOT_BUILD_FLAGS)
  1391. AC_SUBST(AOT_RUN_FLAGS)
  1392. # For llvmonlycheck + fullaotcheck
  1393. AC_SUBST(INVARIANT_AOT_OPTIONS)
  1394. fi
  1395. AC_SUBST(TEST_PROFILE)
  1396. if test "x$with_profile4_x" = "xdefault"; then
  1397. with_profile4_x=$with_profile4_x_default
  1398. fi
  1399. if test "x$with_monodroid" = "xdefault"; then
  1400. with_monodroid=$with_monodroid_default
  1401. fi
  1402. if test "x$with_monotouch" = "xdefault"; then
  1403. with_monotouch=$with_monotouch_default
  1404. fi
  1405. if test "x$with_monotouch_watch" = "xdefault"; then
  1406. with_monotouch_watch=$with_monotouch_watch_default
  1407. fi
  1408. if test "x$with_monotouch_tv" = "xdefault"; then
  1409. with_monotouch_tv=$with_monotouch_tv_default
  1410. fi
  1411. if test "x$with_bitcode" = "xdefault"; then
  1412. with_bitcode=$with_bitcode_default
  1413. fi
  1414. if test "x$with_xammac" = "xdefault"; then
  1415. with_xammac=$with_xammac_default
  1416. fi
  1417. if test "x$with_testing_aot_full_interp" = "xdefault"; then
  1418. with_testing_aot_full_interp=$with_testing_aot_full_interp_default
  1419. fi
  1420. if test "x$with_testing_aot_hybrid" = "xdefault"; then
  1421. with_testing_aot_hybrid=$with_testing_aot_hybrid_default
  1422. fi
  1423. if test "x$with_testing_aot_full" = "xdefault"; then
  1424. with_testing_aot_full=$with_testing_aot_full_default
  1425. fi
  1426. if test "x$with_winaot" = "xdefault"; then
  1427. with_winaot=$with_winaot_default
  1428. fi
  1429. if test "x$with_testing_winaot_interp" = "xdefault"; then
  1430. with_testing_winaot_interp=$with_testing_winaot_interp_default
  1431. fi
  1432. if test "x$with_orbis" = "xdefault"; then
  1433. with_orbis=$with_orbis_default
  1434. fi
  1435. if test "x$with_unreal" = "xdefault"; then
  1436. with_unreal=$with_unreal_default
  1437. fi
  1438. if test "x$with_wasm" = "xdefault"; then
  1439. with_wasm=$with_wasm_default
  1440. fi
  1441. AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = "xyes"])
  1442. AM_CONDITIONAL(INSTALL_MONODROID, [test "x$with_monodroid" != "xno"])
  1443. AM_CONDITIONAL(INSTALL_MONOTOUCH, [test "x$with_monotouch" != "xno"])
  1444. AM_CONDITIONAL(INSTALL_MONOTOUCH_WATCH, [test "x$with_monotouch_watch" != "xno"])
  1445. AM_CONDITIONAL(INSTALL_MONOTOUCH_TV, [test "x$with_monotouch_tv" != "xno"])
  1446. AM_CONDITIONAL(BITCODE, test "x$with_bitcode" = "xyes")
  1447. AM_CONDITIONAL(INSTALL_XAMMAC, [test "x$with_xammac" != "xno"])
  1448. AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL_INTERP, [test "x$with_testing_aot_full_interp" != "xno"])
  1449. AM_CONDITIONAL(INSTALL_TESTING_AOT_HYBRID, [test "x$with_testing_aot_hybrid" != "xno"])
  1450. AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL, [test "x$with_testing_aot_full" != "xno"])
  1451. AM_CONDITIONAL(INSTALL_WINAOT, [test "x$with_winaot" != "xno"])
  1452. AM_CONDITIONAL(INSTALL_TESTING_WINAOT_INTERP, [test "x$with_testing_winaot_interp" != "xno"])
  1453. AM_CONDITIONAL(INSTALL_ORBIS, [test "x$with_orbis" != "xno"])
  1454. AM_CONDITIONAL(INSTALL_UNREAL, [test "x$with_unreal" != "xno"])
  1455. AM_CONDITIONAL(INSTALL_WASM, [test "x$with_wasm" != "xno"])
  1456. AM_CONDITIONAL(INSTALL_NETCORE, [test "x$with_core" != "xno"])
  1457. AM_CONDITIONAL(HYBRID_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_hybrid"] || [test "x$TEST_PROFILE" = "xunreal"])
  1458. AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xtesting_aot_bitcode"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"] || [test "x$TEST_PROFILE" = "xwasm"])
  1459. AM_CONDITIONAL(FULL_AOT_INTERP_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full_interp"] || [test "x$TEST_PROFILE" = "xtesting_aot_bitcode_interp"] || [test "x$TEST_PROFILE" = "xtesting_winaot_interp"])
  1460. AM_CONDITIONAL(DEFAULT_TESTS, [test "x$TEST_PROFILE" = "xnet_4_x"])
  1461. default_profile=net_4_x
  1462. if test -z "$INSTALL_MONODROID_TRUE"; then :
  1463. default_profile=monodroid
  1464. fi
  1465. if test -z "$INSTALL_MONOTOUCH_TRUE"; then :
  1466. default_profile=monotouch
  1467. fi
  1468. if test -z "$INSTALL_XAMMAC_TRUE"; then :
  1469. default_profile=xammac
  1470. fi
  1471. if test -z "$INSTALL_TESTING_AOT_FULL_INTERP_TRUE"; then :
  1472. default_profile=testing_aot_full_interp
  1473. fi
  1474. if test -z "$INSTALL_TESTING_AOT_HYBRID_TRUE"; then :
  1475. default_profile=testing_aot_hybrid
  1476. fi
  1477. if test -z "$INSTALL_TESTING_AOT_FULL_TRUE"; then :
  1478. default_profile=testing_aot_full
  1479. fi
  1480. if test -z "$INSTALL_WINAOT_TRUE"; then :
  1481. default_profile=winaot
  1482. fi
  1483. if test -z "$INSTALL_TESTING_WINAOT_INTERP_TRUE"; then :
  1484. default_profile=testing_winaot_interp
  1485. fi
  1486. if test -z "$INSTALL_ORBIS_TRUE"; then :
  1487. default_profile=orbis
  1488. fi
  1489. if test -z "$INSTALL_UNREAL_TRUE"; then :
  1490. default_profile=unreal
  1491. fi
  1492. if test -z "$INSTALL_WASM_TRUE"; then :
  1493. default_profile=wasm
  1494. fi
  1495. if test -z "$INSTALL_4_x_TRUE"; then :
  1496. default_profile=net_4_x
  1497. fi
  1498. DEFAULT_PROFILE=$default_profile
  1499. AC_SUBST(DEFAULT_PROFILE)
  1500. #
  1501. # End build profile configuration
  1502. #
  1503. if test x$USE_NLS = xprofile_default; then
  1504. AC_MSG_CHECKING([NLS used])
  1505. # We make the default value for USE_NLS
  1506. # "no" on OSX because it isn't available on most
  1507. # default OSX installs. The most common configurations will
  1508. # all disable it, so this saves us typing.
  1509. if test x$host_darwin = xyes; then
  1510. USE_NLS=no;
  1511. else
  1512. USE_NLS=yes;
  1513. fi
  1514. AC_SUBST([USE_NLS])
  1515. AC_MSG_RESULT([$USE_NLS])
  1516. fi
  1517. AC_ARG_ENABLE(static-gcc-libs, [ --enable-static-gcc-libs Statically link GCC support libs (for MinGW32)])
  1518. if test "x$enable_static_gcc_libs" = "xyes"; then
  1519. # llvm/build.mk doesn't use automake, so make a regular make variable for it.
  1520. AC_SUBST(STATIC_GCC_LIBS,1)
  1521. fi
  1522. AM_CONDITIONAL(ENABLE_STATIC_GCC_LIBS, test "x$enable_static_gcc_libs" = "xyes")
  1523. AC_ARG_ENABLE(minimal, [ --enable-minimal=LIST drop support for LIST subsystems.
  1524. LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug, appdomains, verifier,
  1525. reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, interpreter, simd, soft_debug, perfcounters, normalization, desktop_loader, shared_perfcounters, remoting,
  1526. security, lldb, mdb, assert_messages, cleanup, sgen_marksweep_conc, sgen_split_nursery, sgen_gc_bridge, sgen_debug_helpers, sockets, gac.],
  1527. [
  1528. for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
  1529. eval "mono_feature_disable_$feature='yes'"
  1530. done
  1531. DISABLED_FEATURES=$enable_minimal
  1532. disabled="Disabled: $enable_minimal"
  1533. ],[])
  1534. AC_DEFINE_UNQUOTED(DISABLED_FEATURES, "$DISABLED_FEATURES", [String of disabled features])
  1535. if test "x$mono_feature_disable_aot" = "xyes"; then
  1536. AC_DEFINE(DISABLE_AOT, 1, [Disable AOT Compiler])
  1537. enable_system_aot=no
  1538. AC_MSG_NOTICE([Disabled AOT compiler])
  1539. fi
  1540. if test "x$mono_feature_disable_profiler" = "xyes"; then
  1541. AC_DEFINE(DISABLE_PROFILER, 1, [Disable default profiler support])
  1542. AC_MSG_NOTICE([Disabled support for the profiler])
  1543. fi
  1544. AM_CONDITIONAL(DISABLE_PROFILER, test x$mono_feature_disable_profiler = xyes)
  1545. if test "x$mono_feature_disable_decimal" = "xyes"; then
  1546. AC_DEFINE(DISABLE_DECIMAL, 1, [Disable System.Decimal support])
  1547. AC_MSG_NOTICE([Disabled support for decimal])
  1548. fi
  1549. if test "x$mono_feature_disable_pinvoke" = "xyes"; then
  1550. AC_DEFINE(DISABLE_PINVOKE, 1, [Disable P/Invoke support])
  1551. AC_MSG_NOTICE([Disabled support for P/Invoke])
  1552. fi
  1553. if test "x$mono_feature_disable_debug" = "xyes"; then
  1554. AC_DEFINE(DISABLE_DEBUG, 1, [Disable runtime debugging support])
  1555. AC_MSG_NOTICE([Disabled support for runtime debugging])
  1556. fi
  1557. if test "x$mono_feature_disable_reflection_emit" = "xyes"; then
  1558. AC_DEFINE(DISABLE_REFLECTION_EMIT, 1, [Disable reflection emit support])
  1559. mono_feature_disable_reflection_emit_save=yes
  1560. AC_MSG_NOTICE([Disabled support for Reflection.Emit])
  1561. fi
  1562. if test "x$mono_feature_disable_reflection_emit_save" = "xyes"; then
  1563. AC_DEFINE(DISABLE_REFLECTION_EMIT_SAVE, 1, [Disable assembly saving support in reflection emit])
  1564. AC_MSG_NOTICE([Disabled support for Reflection.Emit.Save])
  1565. fi
  1566. if test "x$mono_feature_disable_large_code" = "xyes"; then
  1567. AC_DEFINE(DISABLE_LARGE_CODE, 1, [Disable support for huge assemblies])
  1568. AC_MSG_NOTICE([Disabled support for large assemblies])
  1569. fi
  1570. if test "x$mono_feature_disable_logging" = "xyes"; then
  1571. AC_DEFINE(DISABLE_LOGGING, 1, [Disable support debug logging])
  1572. AC_MSG_NOTICE([Disabled support for logging])
  1573. fi
  1574. if test "x$mono_feature_disable_com" = "xyes"; then
  1575. AC_DEFINE(DISABLE_COM, 1, [Disable COM support])
  1576. AC_MSG_NOTICE([Disabled COM support])
  1577. fi
  1578. if test "x$mono_feature_disable_ssa" = "xyes"; then
  1579. AC_DEFINE(DISABLE_SSA, 1, [Disable advanced SSA JIT optimizations])
  1580. AC_MSG_NOTICE([Disabled SSA JIT optimizations])
  1581. fi
  1582. if test "x$mono_feature_disable_generics" = "xyes"; then
  1583. AC_DEFINE(DISABLE_GENERICS, 1, [Disable generics support])
  1584. AC_MSG_NOTICE([Disabled Generics Support])
  1585. fi
  1586. if test "x$mono_feature_disable_shadowcopy" = "xyes"; then
  1587. AC_DEFINE(DISABLE_SHADOW_COPY, 1, [Disable Shadow Copy for AppDomains])
  1588. AC_MSG_NOTICE([Disabled Shadow copy for AppDomains])
  1589. fi
  1590. if test "x$mono_feature_disable_portability" = "xyes"; then
  1591. AC_DEFINE(DISABLE_PORTABILITY, 1, [Disables the IO portability layer])
  1592. AC_MSG_NOTICE([Disabled IO Portability layer])
  1593. fi
  1594. if test "x$mono_feature_disable_attach" = "xyes"; then
  1595. AC_DEFINE(DISABLE_ATTACH, 1, [Disable agent attach support])
  1596. AC_MSG_NOTICE([Disabled agent attach])
  1597. fi
  1598. if test "x$mono_feature_disable_verifier" = "xyes"; then
  1599. AC_DEFINE(DISABLE_VERIFIER, 1, [Disables the verifier])
  1600. AC_MSG_NOTICE([Disabled the metadata and IL verifiers])
  1601. fi
  1602. if test "x$mono_feature_disable_jit" = "xyes"; then
  1603. AC_DEFINE(DISABLE_JIT, 1, [Disable the JIT, only full-aot mode or interpreter will be supported by the runtime.])
  1604. AC_MSG_NOTICE([Disabled the JIT engine, only full AOT or interpreter will be supported])
  1605. fi
  1606. AM_CONDITIONAL(DISABLE_JIT, test x$mono_feature_disable_jit = xyes)
  1607. if test "x$mono_feature_disable_interpreter" = "xyes"; then
  1608. AC_DEFINE(DISABLE_INTERPRETER, 1, [Disable the interpreter.])
  1609. AC_MSG_NOTICE([Disabled the interpreter])
  1610. fi
  1611. AM_CONDITIONAL(DISABLE_INTERPRETER, test x$mono_feature_disable_interpreter = xyes)
  1612. if test "x$mono_feature_disable_interpreter" != "xyes" -o "x$mono_feature_disable_jit" != "xyes"; then
  1613. AC_DEFINE(ENABLE_ILGEN, 1, [Some VES is available at runtime])
  1614. fi
  1615. AM_CONDITIONAL(ENABLE_ILGEN, test x$mono_feature_disable_interpreter != xyes -o x$mono_feature_disable_jit != xyes)
  1616. if test "x$mono_feature_disable_simd" = "xyes"; then
  1617. AC_DEFINE(DISABLE_SIMD, 1, [Disable SIMD intrinsics related optimizations.])
  1618. AC_MSG_NOTICE([Disabled SIMD support])
  1619. fi
  1620. if test "x$mono_feature_disable_soft_debug" = "xyes"; then
  1621. AC_DEFINE(DISABLE_DEBUGGER_AGENT, 1, [Disable Soft Debugger Agent.])
  1622. AC_MSG_NOTICE([Disabled Soft Debugger.])
  1623. fi
  1624. AM_CONDITIONAL(DISABLE_DEBUGGER_AGENT, test x$mono_feature_disable_debugger_agent = xyes)
  1625. if test "x$mono_feature_disable_perfcounters" = "xyes"; then
  1626. AC_DEFINE(DISABLE_PERFCOUNTERS, 1, [Disable Performance Counters.])
  1627. AC_MSG_NOTICE([Disabled Performance Counters.])
  1628. fi
  1629. if test "x$mono_feature_disable_normalization" = "xyes"; then
  1630. AC_DEFINE(DISABLE_NORMALIZATION, 1, [Disable String normalization support.])
  1631. AC_MSG_NOTICE([Disabled String normalization support.])
  1632. fi
  1633. #TODO: remove assembly_remapping feature name once everyone is using desktop_loader
  1634. if test "x$mono_feature_disable_assembly_remapping" = "xyes" || test "x$mono_feature_disable_desktop_loader" = "xyes"; then
  1635. AC_DEFINE(DISABLE_DESKTOP_LOADER, 1, [Disable desktop assembly loader semantics.])
  1636. AC_MSG_NOTICE([Disabled desktop assembly loader semantics.])
  1637. fi
  1638. if test "x$mono_feature_disable_shared_perfcounters" = "xyes"; then
  1639. AC_DEFINE(DISABLE_SHARED_PERFCOUNTERS, 1, [Disable shared perfcounters.])
  1640. AC_MSG_NOTICE([Disabled Shared perfcounters.])
  1641. fi
  1642. if test "x$mono_feature_disable_appdomains" = "xyes"; then
  1643. AC_DEFINE(DISABLE_APPDOMAINS, 1, [Disable support for multiple appdomains.])
  1644. AC_MSG_NOTICE([Disabled support for multiple appdomains.])
  1645. fi
  1646. if test "x$mono_feature_disable_remoting" = "xyes"; then
  1647. AC_DEFINE(DISABLE_REMOTING, 1, [Disable remoting support (This disables type proxies and make com non-functional)])
  1648. AC_MSG_NOTICE([Disabled remoting])
  1649. fi
  1650. if test "x$mono_feature_disable_security" = "xyes"; then
  1651. AC_DEFINE(DISABLE_SECURITY, 1, [Disable CAS/CoreCLR security])
  1652. AC_MSG_NOTICE([Disabled CAS/CoreCLR security manager (used e.g. for Moonlight)])
  1653. fi
  1654. if test "x$mono_feature_disable_lldb" = "xyes"; then
  1655. AC_DEFINE(DISABLE_LLDB, 1, [Disable support code for the LLDB plugin.])
  1656. AC_MSG_NOTICE([Disabled LLDB plugin support code.])
  1657. fi
  1658. if test "x$mono_feature_disable_mdb" = "xyes"; then
  1659. AC_DEFINE(DISABLE_MDB, 1, [Disable support for .mdb symbol files.])
  1660. AC_MSG_NOTICE([Disabled support for .mdb symbol files.])
  1661. fi
  1662. if test "x$mono_feature_disable_assert_messages" = "xyes"; then
  1663. AC_DEFINE(DISABLE_ASSERT_MESSAGES, 1, [Disable assertion messages.])
  1664. AC_MSG_NOTICE([Disabled assertion messages.])
  1665. fi
  1666. if test "x$mono_feature_disable_cleanup" = "xyes"; then
  1667. AC_DEFINE(DISABLE_CLEANUP, 1, [Disable runtime cleanup.])
  1668. AC_MSG_NOTICE([Disabled runtime cleanup.])
  1669. fi
  1670. if test "x$mono_feature_disable_sgen_marksweep_conc" = "xyes"; then
  1671. AC_DEFINE(DISABLE_SGEN_MAJOR_MARKSWEEP_CONC, 1, [Disable concurrent gc support in SGEN.])
  1672. AC_MSG_NOTICE([Disabled concurrent gc support in SGEN.])
  1673. fi
  1674. if test "x$mono_feature_disable_sgen_split_nursery" = "xyes"; then
  1675. AC_DEFINE(DISABLE_SGEN_SPLIT_NURSERY, 1, [Disable minor=split support in SGEN.])
  1676. AC_MSG_NOTICE([Disabled minor=split support in SGEN.])
  1677. fi
  1678. if test "x$mono_feature_disable_sgen_gc_bridge" = "xyes"; then
  1679. AC_DEFINE(DISABLE_SGEN_GC_BRIDGE, 1, [Disable gc bridge support in SGEN.])
  1680. AC_MSG_NOTICE([Disabled gc bridge support in SGEN.])
  1681. fi
  1682. if test "x$mono_feature_disable_sgen_debug_helpers" = "xyes"; then
  1683. AC_DEFINE(DISABLE_SGEN_DEBUG_HELPERS, 1, [Disable debug helpers in SGEN.])
  1684. AC_MSG_NOTICE([Disabled debug helpers in SGEN.])
  1685. fi
  1686. if test "x$mono_feature_disable_sockets" = "xyes"; then
  1687. AC_DEFINE(DISABLE_SOCKETS, 1, [Disable sockets])
  1688. AC_MSG_NOTICE([Disabled sockets])
  1689. fi
  1690. if test "x$mono_feature_disable_gac" = "xyes"; then
  1691. AC_DEFINE(DISABLE_GAC, 1, [Disable GAC])
  1692. AC_MSG_NOTICE([Disabled GAC support])
  1693. fi
  1694. AC_ARG_ENABLE(executables, [ --disable-executables disable the build of the runtime executables], enable_executables=$enableval, enable_executables=yes)
  1695. AM_CONDITIONAL(DISABLE_EXECUTABLES, test x$enable_executables = xno)
  1696. has_extension_module=no
  1697. AC_ARG_ENABLE(extension-module, [ --enable-extension-module=LIST enable the core-extensions from LIST],
  1698. [
  1699. for extension in `echo "$enable_extension_module" | sed -e "s/,/ /g"`; do
  1700. if test x$extension = xdefault ; then
  1701. has_extension_module=yes;
  1702. fi
  1703. done
  1704. if test x$enable_extension_module = xyes; then
  1705. has_extension_module=yes;
  1706. fi
  1707. ], [])
  1708. AM_CONDITIONAL([HAS_EXTENSION_MODULE], [test x$has_extension_module != xno])
  1709. if test x$has_extension_module != xno ; then
  1710. AC_DEFINE([ENABLE_EXTENSION_MODULE], 1, [Extension module enabled])
  1711. AC_MSG_NOTICE([Enabling mono extension module.])
  1712. fi
  1713. # Deprecated
  1714. AC_ARG_ENABLE(gsharedvt, [ --enable-gsharedvt Enable generic valuetype sharing (Deprecated)], enable_gsharedvt=$enableval, enable_gsharedvt=no)
  1715. AC_MSG_CHECKING(for visibility __attribute__)
  1716. AC_COMPILE_IFELSE([
  1717. AC_LANG_SOURCE([[
  1718. void __attribute__ ((visibility ("hidden"))) doit (void) {}
  1719. int main () { doit (); return 0; }
  1720. ]])
  1721. ], [
  1722. have_visibility_hidden=yes
  1723. AC_MSG_RESULT(yes)
  1724. ], [
  1725. have_visibility_hidden=no
  1726. AC_MSG_RESULT(no)
  1727. ])
  1728. dnl
  1729. dnl Boehm GC configuration
  1730. dnl
  1731. AC_ARG_WITH(libgc, [ --with-libgc=included,none Controls the Boehm GC config, default=included],[libgc=$with_libgc],[libgc=included])
  1732. AC_ARG_ENABLE(boehm, [ --disable-boehm Disable the Boehm GC.], support_boehm=$enableval,support_boehm=${support_boehm:-yes})
  1733. AM_CONDITIONAL(SUPPORT_BOEHM, test x$support_boehm = xyes)
  1734. if test "x$support_boehm" = "xyes"; then
  1735. AC_ARG_ENABLE(parallel-mark, [ --enable-parallel-mark Enables Boehm GC Parallel Marking], enable_parallel_mark=$enableval, enable_parallel_mark=$parallel_mark)
  1736. if test x$enable_parallel_mark = xyes; then
  1737. libgc_configure_args="$libgc_configure_args --enable-parallel-mark"
  1738. fi
  1739. gc_msg=""
  1740. LIBGC_CPPFLAGS=
  1741. LIBGC_LIBS=
  1742. LIBGC_STATIC_LIBS=
  1743. libgc_dir=
  1744. case "x$libgc" in
  1745. xincluded)
  1746. if test "x$support_boehm" = "xyes"; then
  1747. libgc_dir=libgc
  1748. fi
  1749. LIBGC_CPPFLAGS='-I$(top_srcdir)/libgc/include'
  1750. LIBGC_LIBS='$(top_builddir)/libgc/libmonogc.la'
  1751. LIBGC_STATIC_LIBS='$(top_builddir)/libgc/libmonogc-static.la'
  1752. BOEHM_DEFINES="-DHAVE_BOEHM_GC"
  1753. if test x$target_win32 = xyes; then
  1754. BOEHM_DEFINES="$BOEHM_DEFINES -DGC_NOT_DLL"
  1755. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DGC_BUILD -DGC_NOT_DLL"
  1756. fi
  1757. gc_msg="Included Boehm GC with typed GC"
  1758. if test x$enable_parallel_mark = xyes; then
  1759. AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC and Parallel Mark)", [GC description])
  1760. gc_msg="$gc_msg and parallel mark"
  1761. else
  1762. AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "Included Boehm (with typed GC)", [GC description])
  1763. fi
  1764. ;;
  1765. xboehm|xbohem|xyes)
  1766. AC_MSG_WARN("External Boehm is no longer supported")
  1767. ;;
  1768. xsgen)
  1769. AC_MSG_WARN("Use --with-sgen instead, --with-libgc= controls Boehm configuration")
  1770. ;;
  1771. xnone)
  1772. AC_MSG_WARN("Compiling mono without GC.")
  1773. AC_DEFINE_UNQUOTED(DEFAULT_GC_NAME, "none", [GC description])
  1774. AC_DEFINE(HAVE_NULL_GC,1,[No GC support.])
  1775. gc_msg="none"
  1776. ;;
  1777. *)
  1778. AC_MSG_ERROR([Invalid argument $libgc to --with-libgc.])
  1779. ;;
  1780. esac
  1781. 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])
  1782. if test "x$large_heap" = "xyes"; then
  1783. CPPFLAGS="$CPPFLAGS -DLARGE_CONFIG"
  1784. fi
  1785. AC_SUBST(LIBGC_CPPFLAGS)
  1786. AC_SUBST(LIBGC_LIBS)
  1787. AC_SUBST(LIBGC_STATIC_LIBS)
  1788. AC_SUBST(libgc_dir)
  1789. AC_SUBST(BOEHM_DEFINES)
  1790. fi
  1791. AM_CONDITIONAL(SUPPORT_NULLGC, test "x$libgc" = "xnone")
  1792. dnl
  1793. dnl End of Boehm GC Configuration
  1794. dnl
  1795. dnl *************************************
  1796. dnl *** Checks for zero length arrays ***
  1797. dnl *************************************
  1798. AC_MSG_CHECKING(whether $CC supports zero length arrays)
  1799. AC_TRY_COMPILE([
  1800. struct s {
  1801. int length;
  1802. char data [0];
  1803. };
  1804. ], [], [
  1805. AC_MSG_RESULT(yes)
  1806. AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 0, [Length of zero length arrays])
  1807. ], [
  1808. AC_MSG_RESULT(no)
  1809. AC_DEFINE_UNQUOTED(MONO_ZERO_LEN_ARRAY, 1, [Length of zero length arrays])
  1810. ])
  1811. dnl ***********************************
  1812. dnl *** Checks for signals
  1813. dnl ***********************************
  1814. AC_CHECK_HEADERS(signal.h)
  1815. AC_CHECK_FUNCS(sigaction)
  1816. AC_CHECK_FUNCS(kill)
  1817. AC_CHECK_FUNCS(signal)
  1818. # signal() is declared inline in Android headers
  1819. # so we need to workaround it by overriding the check.
  1820. if test x$platform_android = xyes; then
  1821. AC_DEFINE(HAVE_SIGNAL,1)
  1822. fi
  1823. # `target_ios=yes` does not detect watch devices and fails when cross-compiling
  1824. AC_MONO_APPLE_TARGET(TARGET_OS_IPHONE, [mono_native_platform_ios=yes])
  1825. if test x$host_win32 = xno; then
  1826. dnl *************************************
  1827. dnl *** Checks for time capabilities ***
  1828. dnl *************************************
  1829. AC_MSG_CHECKING(for CLOCK_MONOTONIC)
  1830. AC_TRY_COMPILE([#include <time.h>], [
  1831. const int foo = CLOCK_MONOTONIC;
  1832. ],[
  1833. AC_MSG_RESULT(yes)
  1834. AC_DEFINE(HAVE_CLOCK_MONOTONIC, 1, [CLOCK_MONOTONIC])
  1835. ], [
  1836. AC_MSG_RESULT(no)
  1837. ])
  1838. AC_MSG_CHECKING(for CLOCK_MONOTONIC_COARSE)
  1839. AC_TRY_COMPILE([#include <time.h>], [
  1840. const int foo = CLOCK_MONOTONIC_COARSE;
  1841. ],[
  1842. AC_MSG_RESULT(yes)
  1843. AC_DEFINE(HAVE_CLOCK_MONOTONIC_COARSE, 1, [CLOCK_MONOTONIC_COARSE])
  1844. ], [
  1845. AC_MSG_RESULT(no)
  1846. ])
  1847. AC_MSG_CHECKING(for CLOCK_REALTIME)
  1848. AC_TRY_COMPILE([#include <time.h>], [
  1849. const int foo = CLOCK_REALTIME;
  1850. ],[
  1851. AC_MSG_RESULT(yes)
  1852. AC_DEFINE(HAVE_CLOCK_REALTIME, 1, [CLOCK_REALTIME])
  1853. ], [
  1854. AC_MSG_RESULT(no)
  1855. ])
  1856. AC_CHECK_FUNC(mach_absolute_time, [AC_DEFINE(HAVE_MACH_ABSOLUTE_TIME, 1, [mach_absolute_time])])
  1857. AC_CHECK_FUNC(gethrtime, [AC_DEFINE(HAVE_GETHRTIME, 1, [gethrtime])])
  1858. AC_CHECK_FUNC(read_real_time, [AC_DEFINE(HAVE_READ_REAL_TIME, 1, [read_real_time])])
  1859. AC_CHECK_FUNC(mach_timebase_info, [AC_DEFINE(HAVE_MACH_TIMEBASE_INFO, 1, [mach_timebase_info])])
  1860. AC_CHECK_FUNC(futimes, [AC_DEFINE(HAVE_FUTIMES, 1, [futimes])])
  1861. AC_CHECK_FUNC(futimens, [AC_DEFINE(HAVE_FUTIMENS, 1, [futimens])])
  1862. dnl hires monotonic clock support
  1863. AC_SEARCH_LIBS(clock_gettime, rt)
  1864. AC_CHECK_FUNCS(clock_nanosleep)
  1865. dnl dynamic loader support
  1866. AC_CHECK_FUNC(dlopen, DL_LIB="",
  1867. AC_CHECK_LIB(dl, dlopen, DL_LIB="-ldl", dl_support=no)
  1868. )
  1869. if test x$dl_support = xno; then
  1870. AC_MSG_WARN([No dynamic loading support available])
  1871. else
  1872. LIBS="$LIBS $DL_LIB"
  1873. dnl from glib's configure.ac
  1874. if test "x$cross_compiling" = "xyes"; then
  1875. AC_MSG_RESULT(cross compiling, assuming no)
  1876. mono_cv_uscore=no
  1877. else
  1878. AC_CACHE_CHECK([for preceeding underscore in symbols],
  1879. mono_cv_uscore,[
  1880. AC_TRY_RUN([#include <dlfcn.h>
  1881. int mono_underscore_test (void) { return 42; }
  1882. int main() {
  1883. void *f1 = (void*)0, *f2 = (void*)0, *handle;
  1884. handle = dlopen ((void*)0, 0);
  1885. if (handle) {
  1886. f1 = dlsym (handle, "mono_underscore_test");
  1887. f2 = dlsym (handle, "_mono_underscore_test");
  1888. } return (!f2 || f1);
  1889. }],
  1890. [mono_cv_uscore=yes],
  1891. [mono_cv_uscore=no],
  1892. [])
  1893. ])
  1894. fi
  1895. if test "x$mono_cv_uscore" = "xyes"; then
  1896. AC_DEFINE(MONO_DL_NEED_USCORE, 1, [Does dlsym require leading underscore.])
  1897. fi
  1898. AC_CHECK_FUNC(dlerror)
  1899. fi
  1900. dnl ******************************************************************
  1901. dnl *** Checks for the IKVM JNI interface library ***
  1902. dnl ******************************************************************
  1903. 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])
  1904. ikvm_native_dir=
  1905. if test x$with_ikvm_native = xyes; then
  1906. ikvm_native_dir=ikvm-native
  1907. jdk_headers_found="IKVM Native"
  1908. fi
  1909. AC_SUBST(ikvm_native_dir)
  1910. AC_CHECK_HEADERS(execinfo.h)
  1911. AC_CHECK_HEADERS(sys/auxv.h sys/resource.h)
  1912. AC_CHECK_FUNCS(getgrgid_r)
  1913. AC_CHECK_FUNCS(getgrnam_r)
  1914. AC_CHECK_FUNCS(getresuid)
  1915. AC_CHECK_FUNCS(setresuid)
  1916. AC_CHECK_FUNCS(kqueue)
  1917. AC_CHECK_FUNCS(backtrace_symbols)
  1918. AC_CHECK_FUNCS(mkstemp)
  1919. AC_CHECK_FUNCS(mmap)
  1920. AC_CHECK_FUNCS(madvise)
  1921. AC_CHECK_FUNCS(getrusage)
  1922. AC_CHECK_FUNCS(getpriority)
  1923. AC_CHECK_FUNCS(setpriority)
  1924. AC_CHECK_FUNCS(dl_iterate_phdr)
  1925. AC_CHECK_FUNCS(dladdr)
  1926. AC_CHECK_FUNCS(sysconf)
  1927. AC_CHECK_FUNCS(getrlimit)
  1928. AC_CHECK_FUNCS(prctl)
  1929. AC_CHECK_FUNCS(arc4random)
  1930. AC_CHECK_FUNCS(nl_langinfo)
  1931. AC_CHECK_FUNCS(sched_getaffinity)
  1932. AC_CHECK_FUNCS(sched_setaffinity)
  1933. AC_CHECK_FUNCS(sched_getcpu)
  1934. if test x$platform_android != xyes; then
  1935. AC_CHECK_FUNCS(getpwnam_r)
  1936. AC_CHECK_FUNCS(getpwuid_r)
  1937. fi
  1938. AC_CHECK_FUNCS(readlink)
  1939. AC_CHECK_FUNCS(chmod)
  1940. AC_CHECK_FUNCS(lstat)
  1941. AC_CHECK_FUNCS(getdtablesize)
  1942. AC_CHECK_FUNCS(ftruncate)
  1943. AC_CHECK_FUNCS(msync)
  1944. AC_CHECK_FUNCS(gethostname getpeername)
  1945. AC_CHECK_FUNCS(utime utimes)
  1946. AC_CHECK_FUNCS(openlog closelog)
  1947. AC_CHECK_FUNCS(atexit)
  1948. AC_CHECK_FUNCS(popen)
  1949. AC_FUNC_STRERROR_R()
  1950. dnl ****************************************************************
  1951. dnl *** Check for sched_setaffinity from glibc versions before ***
  1952. dnl *** 2.3.4. The older versions of the function only take 2 ***
  1953. dnl *** parameters, not 3. ***
  1954. dnl *** ***
  1955. dnl *** Because the interface change was not made in a minor ***
  1956. dnl *** version rev, the __GLIBC__ and __GLIBC_MINOR__ macros ***
  1957. dnl *** won't always indicate the interface sched_affinity has. ***
  1958. dnl ****************************************************************
  1959. AC_MSG_CHECKING(for sched_setaffinity from glibc < 2.3.4)
  1960. AC_TRY_COMPILE([#include <sched.h>], [
  1961. int mask = 1;
  1962. sched_setaffinity(0, &mask);
  1963. ], [
  1964. # Yes, we have it...
  1965. AC_MSG_RESULT(yes)
  1966. AC_DEFINE(GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY, 1, [Have GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY])
  1967. ], [
  1968. # We have the new, three-parameter version
  1969. AC_MSG_RESULT(no)
  1970. ])
  1971. AC_TRY_COMPILE([#include <sched.h>], [
  1972. CPU_COUNT((void *) 0);
  1973. ], [
  1974. AC_MSG_RESULT(yes)
  1975. AC_DEFINE(GLIBC_HAS_CPU_COUNT, 1, [GLIBC has CPU_COUNT macro in sched.h])
  1976. ], [
  1977. # We have the new, three-parameter version
  1978. AC_MSG_RESULT(no)
  1979. ])
  1980. dnl ******************************************************************
  1981. dnl *** Check for large file support ***
  1982. dnl *** (If we were using autoconf 2.50 we'd use AC_SYS_LARGEFILE) ***
  1983. dnl ******************************************************************
  1984. # Check that off_t can represent 2**63 - 1 correctly, working around
  1985. # potential compiler bugs. Defines LARGE_FILE_SUPPORT, adds $1 to
  1986. # CPPFLAGS and sets $large_offt to yes if the test succeeds
  1987. large_offt=no
  1988. AC_DEFUN([LARGE_FILES], [
  1989. large_CPPFLAGS=$CPPFLAGS
  1990. CPPFLAGS="$CPPFLAGS $1"
  1991. AC_TRY_COMPILE([
  1992. #include <sys/types.h>
  1993. #include <limits.h>
  1994. ], [
  1995. /* Lifted this compile time assert method from: http://www.jaggersoft.com/pubs/CVu11_3.html */
  1996. #define COMPILE_TIME_ASSERT(pred) \
  1997. switch(0){case 0:case pred:;}
  1998. COMPILE_TIME_ASSERT(sizeof(off_t) * CHAR_BIT == 64);
  1999. ], [
  2000. AC_MSG_RESULT(ok)
  2001. AC_DEFINE(HAVE_LARGE_FILE_SUPPORT, 1, [Have large file support])
  2002. large_CPPFLAGS="$large_CPPFLAGS $1"
  2003. large_offt=yes
  2004. ], [
  2005. AC_MSG_RESULT(no)
  2006. ])
  2007. CPPFLAGS=$large_CPPFLAGS
  2008. ])
  2009. AC_MSG_CHECKING(if off_t is 64 bits wide)
  2010. LARGE_FILES("")
  2011. if test $large_offt = no; then
  2012. AC_MSG_CHECKING(if _FILE_OFFSET_BITS=64 gives 64 bit off_t)
  2013. LARGE_FILES("-D_FILE_OFFSET_BITS=64")
  2014. fi
  2015. if test $large_offt = no; then
  2016. AC_MSG_WARN([No 64 bit file size support available])
  2017. fi
  2018. dnl *****************************
  2019. dnl *** Checks for libsocket ***
  2020. dnl *****************************
  2021. AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
  2022. case "$host" in
  2023. *-*-*freebsd*)
  2024. dnl *****************************
  2025. dnl *** Checks for libinotify ***
  2026. dnl *****************************
  2027. AC_CHECK_LIB(inotify, inotify_init, LIBS="$LIBS -linotify")
  2028. esac
  2029. dnl *******************************
  2030. dnl *** Checks for MSG_NOSIGNAL ***
  2031. dnl *******************************
  2032. AC_MSG_CHECKING(for MSG_NOSIGNAL)
  2033. AC_TRY_COMPILE([#include <sys/socket.h>], [
  2034. int f = MSG_NOSIGNAL;
  2035. ], [
  2036. # Yes, we have it...
  2037. AC_MSG_RESULT(yes)
  2038. AC_DEFINE(HAVE_MSG_NOSIGNAL, 1, [Have MSG_NOSIGNAL])
  2039. ], [
  2040. # We'll have to use signals
  2041. AC_MSG_RESULT(no)
  2042. ])
  2043. dnl *****************************
  2044. dnl *** Checks for IPPROTO_IP ***
  2045. dnl *****************************
  2046. AC_MSG_CHECKING(for IPPROTO_IP)
  2047. AC_TRY_COMPILE([#include <netinet/in.h>], [
  2048. int level = IPPROTO_IP;
  2049. ], [
  2050. # Yes, we have it...
  2051. AC_MSG_RESULT(yes)
  2052. AC_DEFINE(HAVE_IPPROTO_IP, 1, [Have IPPROTO_IP])
  2053. ], [
  2054. # We'll have to use getprotobyname
  2055. AC_MSG_RESULT(no)
  2056. ])
  2057. dnl *******************************
  2058. dnl *** Checks for IPPROTO_IPV6 ***
  2059. dnl *******************************
  2060. AC_MSG_CHECKING(for IPPROTO_IPV6)
  2061. AC_TRY_COMPILE([#include <netinet/in.h>], [
  2062. int level = IPPROTO_IPV6;
  2063. ], [
  2064. # Yes, we have it...
  2065. AC_MSG_RESULT(yes)
  2066. AC_DEFINE(HAVE_IPPROTO_IPV6, 1, [Have IPPROTO_IPV6])
  2067. ], [
  2068. # We'll have to use getprotobyname
  2069. AC_MSG_RESULT(no)
  2070. ])
  2071. dnl ******************************
  2072. dnl *** Checks for IPPROTO_TCP ***
  2073. dnl ******************************
  2074. AC_MSG_CHECKING(for IPPROTO_TCP)
  2075. AC_TRY_COMPILE([#include <netinet/in.h>], [
  2076. int level = IPPROTO_TCP;
  2077. ], [
  2078. # Yes, we have it...
  2079. AC_MSG_RESULT(yes)
  2080. AC_DEFINE(HAVE_IPPROTO_TCP, 1, [Have IPPROTO_TCP])
  2081. ], [
  2082. # We'll have to use getprotobyname
  2083. AC_MSG_RESULT(no)
  2084. ])
  2085. dnl *****************************
  2086. dnl *** Checks for SOL_IP ***
  2087. dnl *****************************
  2088. AC_MSG_CHECKING(for SOL_IP)
  2089. AC_TRY_COMPILE([#include <netdb.h>], [
  2090. int level = SOL_IP;
  2091. ], [
  2092. # Yes, we have it...
  2093. AC_MSG_RESULT(yes)
  2094. AC_DEFINE(HAVE_SOL_IP, 1, [Have SOL_IP])
  2095. ], [
  2096. # We'll have to use getprotobyname
  2097. AC_MSG_RESULT(no)
  2098. ])
  2099. dnl *****************************
  2100. dnl *** Checks for SOL_IPV6 ***
  2101. dnl *****************************
  2102. AC_MSG_CHECKING(for SOL_IPV6)
  2103. AC_TRY_COMPILE([#include <netdb.h>], [
  2104. int level = SOL_IPV6;
  2105. ], [
  2106. # Yes, we have it...
  2107. AC_MSG_RESULT(yes)
  2108. AC_DEFINE(HAVE_SOL_IPV6, 1, [Have SOL_IPV6])
  2109. ], [
  2110. # We'll have to use getprotobyname
  2111. AC_MSG_RESULT(no)
  2112. ])
  2113. dnl *****************************
  2114. dnl *** Checks for SOL_TCP ***
  2115. dnl *****************************
  2116. AC_MSG_CHECKING(for SOL_TCP)
  2117. AC_TRY_COMPILE([#include <netdb.h>], [
  2118. int level = SOL_TCP;
  2119. ], [
  2120. # Yes, we have it...
  2121. AC_MSG_RESULT(yes)
  2122. AC_DEFINE(HAVE_SOL_TCP, 1, [Have SOL_TCP])
  2123. ], [
  2124. # We'll have to use getprotobyname
  2125. AC_MSG_RESULT(no)
  2126. ])
  2127. dnl *****************************
  2128. dnl *** Checks for IP_PKTINFO ***
  2129. dnl *****************************
  2130. AC_MSG_CHECKING(for IP_PKTINFO)
  2131. AC_TRY_COMPILE([#include <linux/in.h>], [
  2132. int level = IP_PKTINFO;
  2133. ], [
  2134. # Yes, we have it...
  2135. AC_MSG_RESULT(yes)
  2136. AC_DEFINE(HAVE_IP_PKTINFO, 1, [Have IP_PKTINFO])
  2137. ], [
  2138. AC_MSG_RESULT(no)
  2139. ])
  2140. dnl *****************************
  2141. dnl *** Checks for IPV6_PKTINFO ***
  2142. dnl *****************************
  2143. AC_MSG_CHECKING(for IPV6_PKTINFO)
  2144. AC_TRY_COMPILE([#include <netdb.h>], [
  2145. int level = IPV6_PKTINFO;
  2146. ], [
  2147. # Yes, we have it...
  2148. AC_MSG_RESULT(yes)
  2149. AC_DEFINE(HAVE_IPV6_PKTINFO, 1, [Have IPV6_PKTINFO])
  2150. ], [
  2151. AC_MSG_RESULT(no)
  2152. ])
  2153. dnl **********************************
  2154. dnl *** Checks for IP_DONTFRAG ***
  2155. dnl **********************************
  2156. AC_MSG_CHECKING(for IP_DONTFRAG)
  2157. AC_TRY_COMPILE([#include <netinet/in.h>], [
  2158. int level = IP_DONTFRAG;
  2159. ], [
  2160. # Yes, we have it...
  2161. AC_MSG_RESULT(yes)
  2162. AC_DEFINE(HAVE_IP_DONTFRAG, 1, [Have IP_DONTFRAG])
  2163. ], [
  2164. AC_MSG_RESULT(no)
  2165. ])
  2166. dnl **********************************
  2167. dnl *** Checks for IP_DONTFRAGMENT ***
  2168. dnl **********************************
  2169. AC_MSG_CHECKING(for IP_DONTFRAGMENT)
  2170. AC_TRY_COMPILE([#include <Ws2ipdef.h>], [
  2171. int level = IP_DONTFRAGMENT;
  2172. ], [
  2173. # Yes, we have it...
  2174. AC_MSG_RESULT(yes)
  2175. AC_DEFINE(HAVE_IP_DONTFRAGMENT, 1, [Have IP_DONTFRAGMENT])
  2176. ], [
  2177. AC_MSG_RESULT(no)
  2178. ])
  2179. dnl **********************************
  2180. dnl *** Checks for IP_MTU_DISCOVER ***
  2181. dnl **********************************
  2182. AC_MSG_CHECKING(for IP_MTU_DISCOVER)
  2183. AC_TRY_COMPILE([#include <linux/in.h>], [
  2184. int level = IP_MTU_DISCOVER;
  2185. ], [
  2186. # Yes, we have it...
  2187. AC_MSG_RESULT(yes)
  2188. AC_DEFINE(HAVE_IP_MTU_DISCOVER, 1, [Have IP_MTU_DISCOVER])
  2189. ], [
  2190. AC_MSG_RESULT(no)
  2191. ])
  2192. dnl **********************************
  2193. dnl *** Checks for IP_PMTUDISC_DO ***
  2194. dnl **********************************
  2195. AC_MSG_CHECKING(for IP_PMTUDISC_DO)
  2196. AC_TRY_COMPILE([#include <linux/in.h>], [
  2197. int level = IP_PMTUDISC_DO;
  2198. ], [
  2199. # Yes, we have it...
  2200. AC_MSG_RESULT(yes)
  2201. AC_DEFINE(HAVE_IP_PMTUDISC_DO, 1, [Have IP_PMTUDISC_DO])
  2202. ], [
  2203. AC_MSG_RESULT(no)
  2204. ])
  2205. dnl *********************************
  2206. dnl *** Check for struct ip_mreqn ***
  2207. dnl *********************************
  2208. AC_MSG_CHECKING(for struct ip_mreqn)
  2209. AC_TRY_COMPILE([#include <netinet/in.h>], [
  2210. struct ip_mreqn mreq;
  2211. mreq.imr_address.s_addr = 0;
  2212. ], [
  2213. # Yes, we have it...
  2214. AC_MSG_RESULT(yes)
  2215. AC_DEFINE(HAVE_STRUCT_IP_MREQN, 1, [Have struct ip_mreqn])
  2216. ], [
  2217. # We'll just have to try and use struct ip_mreq
  2218. AC_MSG_RESULT(no)
  2219. AC_MSG_CHECKING(for struct ip_mreq)
  2220. AC_TRY_COMPILE([#include <netinet/in.h>], [
  2221. struct ip_mreq mreq;
  2222. mreq.imr_interface.s_addr = 0;
  2223. ], [
  2224. # Yes, we have it...
  2225. AC_MSG_RESULT(yes)
  2226. AC_DEFINE(HAVE_STRUCT_IP_MREQ, 1, [Have struct ip_mreq])
  2227. ], [
  2228. # No multicast support
  2229. AC_MSG_RESULT(no)
  2230. ])
  2231. ])
  2232. dnl **********************************
  2233. dnl *** Check for getaddrinfo ***
  2234. dnl **********************************
  2235. AC_MSG_CHECKING(for getaddrinfo)
  2236. AC_TRY_LINK([
  2237. #include <stdio.h>
  2238. #include <netdb.h>
  2239. ], [
  2240. getaddrinfo(NULL,NULL,NULL,NULL);
  2241. ], [
  2242. # Yes, we have it...
  2243. AC_MSG_RESULT(yes)
  2244. AC_DEFINE(HAVE_GETADDRINFO, 1, [Have getaddrinfo])
  2245. ], [
  2246. AC_MSG_RESULT(no)
  2247. ])
  2248. dnl **********************************
  2249. dnl *** Check for gethostbyname2_r ***
  2250. dnl **********************************
  2251. AC_MSG_CHECKING(for gethostbyname2_r)
  2252. AC_TRY_LINK([
  2253. #include <stdio.h>
  2254. #include <netdb.h>
  2255. ], [
  2256. gethostbyname2_r(NULL,0,NULL,NULL,0,NULL,NULL);
  2257. ], [
  2258. # Yes, we have it...
  2259. AC_MSG_RESULT(yes)
  2260. AC_DEFINE(HAVE_GETHOSTBYNAME2_R, 1, [Have gethostbyname2_r])
  2261. ], [
  2262. AC_MSG_RESULT(no)
  2263. ])
  2264. dnl **********************************
  2265. dnl *** Check for gethostbyname2 ***
  2266. dnl **********************************
  2267. AC_MSG_CHECKING(for gethostbyname2)
  2268. AC_TRY_LINK([
  2269. #include <stdio.h>
  2270. #include <netdb.h>
  2271. ], [
  2272. gethostbyname2(NULL,0);
  2273. ], [
  2274. # Yes, we have it...
  2275. AC_MSG_RESULT(yes)
  2276. AC_DEFINE(HAVE_GETHOSTBYNAME2, 1, [Have gethostbyname2])
  2277. ], [
  2278. AC_MSG_RESULT(no)
  2279. ])
  2280. dnl **********************************
  2281. dnl *** Check for gethostbyname ***
  2282. dnl **********************************
  2283. AC_MSG_CHECKING(for gethostbyname)
  2284. AC_TRY_LINK([
  2285. #include <stdio.h>
  2286. #include <netdb.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 <netdb.h>
  2303. ], [
  2304. getprotobyname(NULL);
  2305. ], [
  2306. # Yes, we have it...
  2307. AC_MSG_RESULT(yes)
  2308. AC_DEFINE(HAVE_GETPROTOBYNAME, 1, [Have getprotobyname])
  2309. ], [
  2310. AC_MSG_RESULT(no)
  2311. ])
  2312. dnl **********************************
  2313. dnl *** Check for getprotobyname_r ***
  2314. dnl **********************************
  2315. AC_MSG_CHECKING(for getprotobyname_r)
  2316. AC_TRY_LINK([
  2317. #include <stdio.h>
  2318. #include <netdb.h>
  2319. ], [
  2320. getprotobyname_r(NULL, NULL, NULL, 0, NULL);
  2321. ], [
  2322. # Yes, we have it...
  2323. AC_MSG_RESULT(yes)
  2324. AC_DEFINE(HAVE_GETPROTOBYNAME_R, 1, [Have getprotobyname_r])
  2325. ], [
  2326. AC_MSG_RESULT(no)
  2327. ])
  2328. dnl **********************************
  2329. dnl *** Check for getnameinfo ***
  2330. dnl **********************************
  2331. AC_MSG_CHECKING(for getnameinfo)
  2332. AC_TRY_LINK([
  2333. #include <stdio.h>
  2334. #include <netdb.h>
  2335. ], [
  2336. getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);
  2337. ], [
  2338. # Yes, we have it...
  2339. AC_MSG_RESULT(yes)
  2340. AC_DEFINE(HAVE_GETNAMEINFO, 1, [Have getnameinfo])
  2341. ], [
  2342. AC_MSG_RESULT(no)
  2343. ])
  2344. dnl **********************************
  2345. dnl *** Check for inet_ntop ***
  2346. dnl **********************************
  2347. AC_MSG_CHECKING(for inet_ntop)
  2348. AC_TRY_LINK([
  2349. #include <stdio.h>
  2350. #include <arpa/inet.h>
  2351. ], [
  2352. inet_ntop (0, NULL, NULL, 0);
  2353. ], [
  2354. # Yes, we have it...
  2355. AC_MSG_RESULT(yes)
  2356. AC_DEFINE(HAVE_INET_NTOP, 1, [Have inet_ntop])
  2357. ], [
  2358. AC_MSG_RESULT(no)
  2359. ])
  2360. dnl *****************************
  2361. dnl *** Checks for libnsl ***
  2362. dnl *****************************
  2363. AC_CHECK_FUNC(gethostbyaddr, , AC_CHECK_LIB(nsl, gethostbyaddr, LIBS="$LIBS -lnsl"))
  2364. AC_CHECK_FUNCS(inet_pton inet_aton)
  2365. dnl *****************************
  2366. dnl *** Checks for libxnet ***
  2367. dnl *****************************
  2368. case "${host}" in
  2369. *solaris* )
  2370. AC_MSG_CHECKING(for Solaris XPG4 support)
  2371. if test -f /usr/lib/libxnet.so; then
  2372. CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=500"
  2373. CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__"
  2374. CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED=1"
  2375. LIBS="$LIBS -lxnet"
  2376. AC_MSG_RESULT(yes)
  2377. else
  2378. AC_MSG_RESULT(no)
  2379. fi
  2380. if test "$GCC" = "yes"; then
  2381. CFLAGS="$CFLAGS -Wno-char-subscripts"
  2382. fi
  2383. ;;
  2384. esac
  2385. dnl *****************************
  2386. dnl *** Checks for libpthread ***
  2387. dnl *****************************
  2388. # on FreeBSD -STABLE, the pthreads functions all reside in libc_r
  2389. # and libpthread does not exist
  2390. #
  2391. case "${host}" in
  2392. *-*-*haiku*)
  2393. dnl Haiku has pthread in libroot (libc equiv)
  2394. AC_CHECK_LIB(pthread, main, LIBS="$LIBS")
  2395. ;;
  2396. *-*-*freebsd*)
  2397. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
  2398. ;;
  2399. *-*-*openbsd*)
  2400. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -pthread")
  2401. ;;
  2402. *)
  2403. AC_CHECK_LIB(pthread, main, LIBS="$LIBS -lpthread")
  2404. ;;
  2405. esac
  2406. AC_CHECK_HEADERS(pthread.h)
  2407. AC_CHECK_HEADERS(pthread_np.h)
  2408. AC_CHECK_FUNCS(pthread_mutex_timedlock)
  2409. AC_CHECK_FUNCS(pthread_getattr_np pthread_attr_get_np pthread_getname_np pthread_setname_np pthread_cond_timedwait_relative_np)
  2410. AC_CHECK_FUNCS(pthread_kill)
  2411. AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE)
  2412. AC_TRY_COMPILE([ #include <pthread.h>], [
  2413. pthread_mutexattr_t attr;
  2414. pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
  2415. ], [
  2416. AC_MSG_RESULT(ok)
  2417. ], [
  2418. AC_MSG_RESULT(no)
  2419. AC_ERROR(Posix system lacks support for recursive mutexes)
  2420. ])
  2421. AC_CHECK_FUNCS(pthread_attr_setstacksize)
  2422. AC_CHECK_FUNCS(pthread_attr_getstack pthread_attr_getstacksize)
  2423. AC_CHECK_FUNCS(pthread_get_stacksize_np pthread_get_stackaddr_np)
  2424. dnl check that pthread_mutexattr_setprotocol is declared
  2425. AC_CHECK_DECLS([pthread_mutexattr_setprotocol], [], [], [[#include <pthread.h>]])
  2426. AC_CHECK_FUNCS(mincore mlock munlock)
  2427. dnl ***********************************
  2428. dnl *** Checks for working __thread ***
  2429. dnl ***********************************
  2430. AC_MSG_CHECKING(for working __thread)
  2431. if test "x$with_tls" != "x__thread"; then
  2432. AC_MSG_RESULT(disabled)
  2433. elif test "x$cross_compiling" = "xyes"; then
  2434. AC_MSG_RESULT(cross compiling, assuming yes)
  2435. else
  2436. AC_TRY_RUN([
  2437. #if defined(__APPLE__) && defined(__clang__)
  2438. #error "__thread does not currently work with clang on Mac OS X"
  2439. #endif
  2440. #include <unistd.h>
  2441. #include <pthread.h>
  2442. __thread int i;
  2443. static int res1, res2;
  2444. void thread_main (void *arg)
  2445. {
  2446. i = arg;
  2447. sleep (1);
  2448. if (arg == 1)
  2449. res1 = (i == arg);
  2450. else
  2451. res2 = (i == arg);
  2452. }
  2453. int main () {
  2454. pthread_t t1, t2;
  2455. i = 5;
  2456. pthread_create (&t1, NULL, thread_main, 1);
  2457. pthread_create (&t2, NULL, thread_main, 2);
  2458. pthread_join (t1, NULL);
  2459. pthread_join (t2, NULL);
  2460. return !(res1 + res2 == 2);
  2461. }
  2462. ], [
  2463. AC_MSG_RESULT(yes)
  2464. ], [
  2465. AC_MSG_RESULT(no)
  2466. with_tls=pthread
  2467. ])
  2468. fi
  2469. dnl **************************************
  2470. dnl *** Checks for working sigaltstack ***
  2471. dnl **************************************
  2472. AC_MSG_CHECKING(for working sigaltstack)
  2473. if test "x$with_sigaltstack" != "xyes"; then
  2474. AC_MSG_RESULT(disabled)
  2475. elif test "x$cross_compiling" = "xyes"; then
  2476. AC_MSG_RESULT(cross compiling, assuming no)
  2477. with_sigaltstack=no
  2478. else
  2479. AC_TRY_RUN([
  2480. #include <stdio.h>
  2481. #include <stdlib.h>
  2482. #include <unistd.h>
  2483. #include <signal.h>
  2484. #include <pthread.h>
  2485. #include <sys/wait.h>
  2486. #if defined(__FreeBSD__) || defined(__NetBSD__)
  2487. #define SA_STACK SA_ONSTACK
  2488. #endif
  2489. static void
  2490. sigsegv_signal_handler (int _dummy, siginfo_t *info, void *context)
  2491. {
  2492. exit (0);
  2493. }
  2494. volatile char*__ptr = NULL;
  2495. static void *
  2496. loop (void *ignored)
  2497. {
  2498. *__ptr = 0;
  2499. return NULL;
  2500. }
  2501. static void
  2502. child ()
  2503. {
  2504. struct sigaction sa;
  2505. stack_t sas;
  2506. pthread_t id;
  2507. pthread_attr_t attr;
  2508. sa.sa_sigaction = sigsegv_signal_handler;
  2509. sigemptyset (&sa.sa_mask);
  2510. sa.sa_flags = SA_SIGINFO | SA_ONSTACK;
  2511. if (sigaction (SIGSEGV, &sa, NULL) == -1) {
  2512. perror ("sigaction");
  2513. return;
  2514. }
  2515. /* x86 darwin deliver segfaults using SIGBUS */
  2516. if (sigaction (SIGBUS, &sa, NULL) == -1) {
  2517. perror ("sigaction");
  2518. return;
  2519. }
  2520. sas.ss_sp = malloc (SIGSTKSZ);
  2521. sas.ss_size = SIGSTKSZ;
  2522. sas.ss_flags = 0;
  2523. if (sigaltstack (&sas, NULL) == -1) {
  2524. perror ("sigaltstack");
  2525. return;
  2526. }
  2527. pthread_attr_init (&attr);
  2528. if (pthread_create(&id, &attr, loop, &attr) != 0) {
  2529. printf ("pthread_create\n");
  2530. return;
  2531. }
  2532. sleep (100);
  2533. }
  2534. int
  2535. main ()
  2536. {
  2537. pid_t son;
  2538. int status;
  2539. int i;
  2540. son = fork ();
  2541. if (son == -1) {
  2542. return 1;
  2543. }
  2544. if (son == 0) {
  2545. child ();
  2546. return 0;
  2547. }
  2548. for (i = 0; i < 300; ++i) {
  2549. waitpid (son, &status, WNOHANG);
  2550. if (WIFEXITED (status) && WEXITSTATUS (status) == 0)
  2551. return 0;
  2552. usleep (10000);
  2553. }
  2554. kill (son, SIGKILL);
  2555. return 1;
  2556. }
  2557. ], [
  2558. AC_MSG_RESULT(yes)
  2559. AC_DEFINE(HAVE_WORKING_SIGALTSTACK, 1, [Have a working sigaltstack])
  2560. ], [
  2561. with_sigaltstack=no
  2562. AC_MSG_RESULT(no)
  2563. ])
  2564. fi
  2565. dnl ********************************
  2566. dnl *** Checks for semaphore lib ***
  2567. dnl ********************************
  2568. # 'Real Time' functions on Solaris
  2569. # posix4 on Solaris 2.6
  2570. # pthread (first!) on Linux
  2571. AC_SEARCH_LIBS(sem_init, pthread rt posix4)
  2572. AC_SEARCH_LIBS(shm_open, pthread rt posix4)
  2573. AC_CHECK_FUNCS(shm_open)
  2574. dnl ********************************
  2575. dnl *** Checks for gettext lib ***
  2576. dnl ********************************
  2577. # This is needed for some hackery for AIX;
  2578. # Mono itself doesn't use it, but DllMap includes it
  2579. AC_SEARCH_LIBS([gettext], [intl])
  2580. dnl ********************************
  2581. dnl *** Checks for timezone stuff **
  2582. dnl ********************************
  2583. AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff,
  2584. AC_TRY_COMPILE([
  2585. #include <time.h>
  2586. ], [
  2587. struct tm tm;
  2588. tm.tm_gmtoff = 1;
  2589. ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no))
  2590. if test $ac_cv_struct_tm_gmtoff = yes; then
  2591. AC_DEFINE(HAVE_TM_GMTOFF, 1, [Have tm_gmtoff])
  2592. else
  2593. AC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone,
  2594. AC_TRY_COMPILE([
  2595. #include <time.h>
  2596. ], [
  2597. timezone = 1;
  2598. ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))
  2599. if test $ac_cv_var_timezone = yes; then
  2600. AC_DEFINE(HAVE_TIMEZONE, 1, [Have timezone variable])
  2601. else
  2602. AC_ERROR(unable to find a way to determine timezone)
  2603. fi
  2604. fi
  2605. dnl *********************************
  2606. dnl *** Checks for math functions ***
  2607. dnl *********************************
  2608. AC_SEARCH_LIBS(sqrtf, m)
  2609. dnl ****************************************************************
  2610. dnl *** Checks for working poll() (macosx defines it but doesn't ***
  2611. dnl *** have it in the library (duh)) ***
  2612. dnl ****************************************************************
  2613. AC_CHECK_FUNCS(poll)
  2614. dnl **********************************
  2615. dnl *** epoll ***
  2616. dnl **********************************
  2617. AC_CHECK_HEADERS(sys/epoll.h)
  2618. haveepoll=no
  2619. AC_CHECK_FUNCS(epoll_ctl, [haveepoll=yes], )
  2620. if test "x$haveepoll" = "xyes" -a "x$ac_cv_header_sys_epoll_h" = "xyes"; then
  2621. AC_DEFINE(HAVE_EPOLL, 1, [epoll supported])
  2622. fi
  2623. havekqueue=no
  2624. AC_CHECK_HEADERS(sys/event.h)
  2625. AC_CHECK_FUNCS(kqueue, [havekqueue=yes], )
  2626. dnl **************************************
  2627. dnl * Darwin has a race that prevents us from using reliably:
  2628. dnl * http://lists.apple.com/archives/darwin-dev/2011/Jun/msg00016.html
  2629. dnl * Since kqueue is mostly used for scaling large web servers,
  2630. dnl * and very few folks run Mono on large web servers on OSX, falling
  2631. dnl * back
  2632. dnl **************************************
  2633. if test "x$havekqueue" = "xyes" -a "x$ac_cv_header_sys_event_h" = "xyes"; then
  2634. if test "x$host_darwin" = "xno"; then
  2635. AC_DEFINE(USE_KQUEUE_FOR_THREADPOOL, 1, [Use kqueue for the threadpool])
  2636. fi
  2637. fi
  2638. dnl ******************************
  2639. dnl *** Checks for SIOCGIFCONF ***
  2640. dnl ******************************
  2641. AC_CHECK_HEADERS(sys/ioctl.h)
  2642. AC_CHECK_HEADERS(net/if.h, [], [],
  2643. [
  2644. #ifdef HAVE_SYS_TYPES_H
  2645. # include <sys/types.h>
  2646. #endif
  2647. #ifdef HAVE_SYS_SOCKET_H
  2648. # include <sys/socket.h>
  2649. #endif
  2650. ])
  2651. AC_MSG_CHECKING(for ifreq)
  2652. AC_TRY_COMPILE([
  2653. #include <stdio.h>
  2654. #include <sys/ioctl.h>
  2655. #include <net/if.h>
  2656. ], [
  2657. struct ifconf ifc;
  2658. struct ifreq *ifr;
  2659. void *x;
  2660. ifc.ifc_len = 0;
  2661. ifc.ifc_buf = NULL;
  2662. x = (void *) &ifr->ifr_addr;
  2663. ],[
  2664. AC_MSG_RESULT(yes)
  2665. AC_DEFINE(HAVE_SIOCGIFCONF, 1, [Can get interface list])
  2666. ], [
  2667. AC_MSG_RESULT(no)
  2668. ])
  2669. dnl **********************************
  2670. dnl *** Checks for sin_len ***
  2671. dnl **********************************
  2672. AC_MSG_CHECKING(for sockaddr_in.sin_len)
  2673. AC_TRY_COMPILE([
  2674. #include <netinet/in.h>
  2675. ], [
  2676. struct sockaddr_in saddr;
  2677. saddr.sin_len = sizeof (saddr);
  2678. ],[
  2679. AC_MSG_RESULT(yes)
  2680. AC_DEFINE(HAVE_SOCKADDR_IN_SIN_LEN, 1, [sockaddr_in has sin_len])
  2681. ], [
  2682. AC_MSG_RESULT(no)
  2683. ])
  2684. dnl **********************************
  2685. dnl *** Checks for sin6_len ***
  2686. dnl **********************************
  2687. AC_MSG_CHECKING(for sockaddr_in6.sin6_len)
  2688. AC_TRY_COMPILE([
  2689. #include <netinet/in.h>
  2690. ], [
  2691. struct sockaddr_in6 saddr6;
  2692. saddr6.sin6_len = sizeof (saddr6);
  2693. ],[
  2694. AC_MSG_RESULT(yes)
  2695. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN_LEN, 1, [sockaddr_in6 has sin6_len])
  2696. ], [
  2697. AC_MSG_RESULT(no)
  2698. ])
  2699. dnl **********************************
  2700. dnl *** Check for getifaddrs ***
  2701. dnl **********************************
  2702. AC_MSG_CHECKING(for getifaddrs)
  2703. AC_TRY_LINK([
  2704. #include <stdio.h>
  2705. #include <sys/types.h>
  2706. #include <sys/socket.h>
  2707. #ifdef HAVE_NET_IF_H
  2708. #include <net/if.h>
  2709. #endif
  2710. #include <ifaddrs.h>
  2711. ], [
  2712. getifaddrs(NULL);
  2713. ], [
  2714. # Yes, we have it...
  2715. AC_MSG_RESULT(yes)
  2716. AC_DEFINE(HAVE_GETIFADDRS, 1, [Have getifaddrs])
  2717. ], [
  2718. AC_MSG_RESULT(no)
  2719. ])
  2720. dnl **********************************
  2721. dnl *** Check for if_nametoindex ***
  2722. dnl **********************************
  2723. AC_MSG_CHECKING(for if_nametoindex)
  2724. AC_TRY_LINK([
  2725. #include <stdio.h>
  2726. #include <sys/types.h>
  2727. #include <sys/socket.h>
  2728. #include <net/if.h>
  2729. ], [
  2730. if_nametoindex(NULL);
  2731. ], [
  2732. # Yes, we have it...
  2733. AC_MSG_RESULT(yes)
  2734. AC_DEFINE(HAVE_IF_NAMETOINDEX, 1, [Have if_nametoindex])
  2735. ], [
  2736. AC_MSG_RESULT(no)
  2737. ])
  2738. dnl **********************************
  2739. dnl *** Check for access ***
  2740. dnl **********************************
  2741. AC_MSG_CHECKING(for access)
  2742. AC_TRY_LINK([
  2743. #include <unistd.h>
  2744. ], [
  2745. access(NULL,0);
  2746. ], [
  2747. # Yes, we have it...
  2748. AC_MSG_RESULT(yes)
  2749. AC_DEFINE(HAVE_ACCESS, 1, [Have access])
  2750. ], [
  2751. AC_MSG_RESULT(no)
  2752. ])
  2753. dnl **********************************
  2754. dnl *** Checks for proclib ***
  2755. dnl **********************************
  2756. 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.)])
  2757. dnl **********************************
  2758. dnl *** Checks for MonoPosixHelper ***
  2759. dnl **********************************
  2760. AC_CHECK_HEADERS(checklist.h)
  2761. AC_CHECK_HEADERS(pathconf.h)
  2762. AC_CHECK_HEADERS(fstab.h)
  2763. AC_CHECK_HEADERS(attr/xattr.h)
  2764. AC_CHECK_HEADERS(sys/extattr.h)
  2765. AC_CHECK_HEADERS(sys/sendfile.h)
  2766. AC_CHECK_HEADERS(sys/statvfs.h)
  2767. AC_CHECK_HEADERS(sys/statfs.h)
  2768. AC_CHECK_HEADERS(sys/vfstab.h)
  2769. AC_CHECK_HEADERS(sys/xattr.h)
  2770. AC_CHECK_HEADERS(sys/mman.h)
  2771. AC_CHECK_HEADERS(sys/param.h)
  2772. AC_CHECK_HEADERS(sys/mount.h, [], [],
  2773. [
  2774. #ifdef HAVE_SYS_PARAM_H
  2775. # include <sys/param.h>
  2776. #endif
  2777. ])
  2778. AC_CHECK_HEADERS(sys/mount.h)
  2779. AC_CHECK_FUNCS(confstr)
  2780. AC_CHECK_FUNCS(seekdir telldir)
  2781. AC_CHECK_FUNCS(getdomainname)
  2782. AC_CHECK_FUNCS(setdomainname)
  2783. AC_CHECK_FUNCS(endgrent getgrent fgetgrent setgrent)
  2784. AC_CHECK_FUNCS(setgroups)
  2785. AC_CHECK_FUNCS(endpwent getpwent fgetpwent setpwent)
  2786. AC_CHECK_FUNCS(getfsstat)
  2787. AC_CHECK_FUNCS(lutimes futimes)
  2788. AC_CHECK_FUNCS(mremap)
  2789. AC_CHECK_FUNCS(remap_file_pages)
  2790. AC_CHECK_FUNCS(posix_fadvise)
  2791. AC_CHECK_FUNCS(posix_fallocate)
  2792. AC_CHECK_FUNCS(posix_madvise)
  2793. AC_CHECK_FUNCS(vsnprintf)
  2794. AC_CHECK_FUNCS(sendfile)
  2795. AC_CHECK_FUNCS(gethostid sethostid)
  2796. AC_CHECK_FUNCS(sethostname)
  2797. AC_CHECK_FUNCS(statfs)
  2798. AC_CHECK_FUNCS(fstatfs)
  2799. AC_CHECK_FUNCS(statvfs)
  2800. AC_CHECK_FUNCS(fstatvfs)
  2801. AC_CHECK_FUNCS(stime)
  2802. AC_CHECK_FUNCS(ttyname_r)
  2803. AC_CHECK_FUNCS(psignal)
  2804. AC_CHECK_FUNCS(getlogin_r)
  2805. AC_CHECK_FUNCS(lockf)
  2806. AC_CHECK_FUNCS(swab)
  2807. AC_CHECK_FUNCS(setusershell endusershell)
  2808. AC_CHECK_FUNCS(futimens utimensat)
  2809. AC_CHECK_FUNCS(fstatat mknodat readlinkat)
  2810. AC_CHECK_FUNCS(readv writev preadv pwritev)
  2811. AC_CHECK_FUNCS(setpgid)
  2812. AC_CHECK_FUNCS(system)
  2813. AC_CHECK_FUNCS(fork execv execve)
  2814. AC_CHECK_FUNCS(waitpid)
  2815. AC_CHECK_FUNCS(accept4)
  2816. AC_CHECK_FUNCS(localtime_r)
  2817. AC_CHECK_FUNCS(mkdtemp)
  2818. AC_CHECK_SIZEOF(size_t)
  2819. AC_CHECK_TYPES([blksize_t], [AC_DEFINE(HAVE_BLKSIZE_T)], ,
  2820. [#include <sys/types.h>
  2821. #include <sys/stat.h>
  2822. #include <unistd.h>])
  2823. AC_CHECK_TYPES([blkcnt_t], [AC_DEFINE(HAVE_BLKCNT_T)], ,
  2824. [#include <sys/types.h>
  2825. #include <sys/stat.h>
  2826. #include <unistd.h>])
  2827. AC_CHECK_TYPES([suseconds_t], [AC_DEFINE(HAVE_SUSECONDS_T)], ,
  2828. [#include <sys/time.h>])
  2829. AC_CHECK_TYPES([struct cmsghdr], [AC_DEFINE(HAVE_STRUCT_CMSGHDR)], ,
  2830. [#include <sys/socket.h>])
  2831. AC_CHECK_TYPES([struct flock], [AC_DEFINE(HAVE_STRUCT_FLOCK)], ,
  2832. [#include <unistd.h>
  2833. #include <fcntl.h>])
  2834. AC_CHECK_TYPES([struct iovec], [AC_DEFINE(HAVE_STRUCT_IOVEC)], ,
  2835. [#include <sys/uio.h>])
  2836. AC_CHECK_TYPES([struct linger], [AC_DEFINE(HAVE_STRUCT_LINGER)], ,
  2837. [#include <sys/socket.h>])
  2838. AC_CHECK_TYPES([struct pollfd], [AC_DEFINE(HAVE_STRUCT_POLLFD)], ,
  2839. [#include <sys/poll.h>])
  2840. AC_CHECK_TYPES([struct sockaddr], [AC_DEFINE(HAVE_STRUCT_SOCKADDR)], ,
  2841. [#include <sys/socket.h>])
  2842. AC_CHECK_TYPES([struct sockaddr_storage], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)], ,
  2843. [#include <sys/socket.h>])
  2844. AC_CHECK_TYPES([struct sockaddr_in], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN)], ,
  2845. [#include <netinet/in.h>])
  2846. AC_CHECK_TYPES([struct sockaddr_in6], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)], ,
  2847. [#include <netinet/in.h>])
  2848. AC_CHECK_TYPES([struct sockaddr_un], [AC_DEFINE(HAVE_STRUCT_SOCKADDR_UN)], ,
  2849. [#include <sys/un.h>])
  2850. AC_CHECK_TYPES([struct stat], [AC_DEFINE(HAVE_STRUCT_STAT)], ,
  2851. [#include <sys/types.h>
  2852. #include <sys/stat.h>
  2853. #include <unistd.h>])
  2854. AC_CHECK_TYPES([struct timespec], [AC_DEFINE(HAVE_STRUCT_TIMESPEC)], ,
  2855. [#include <time.h>])
  2856. AC_CHECK_TYPES([struct timeval], [AC_DEFINE(HAVE_STRUCT_TIMEVAL)], ,
  2857. [#include <sys/time.h>
  2858. #include <sys/types.h>
  2859. #include <utime.h>])
  2860. AC_CHECK_TYPES([struct timezone], [AC_DEFINE(HAVE_STRUCT_TIMEZONE)], ,
  2861. [#include <sys/time.h>])
  2862. AC_CHECK_TYPES([struct utimbuf], [AC_DEFINE(HAVE_STRUCT_UTIMBUF)], ,
  2863. [#include <sys/types.h>
  2864. #include <utime.h>])
  2865. AC_CHECK_MEMBERS(
  2866. [struct dirent.d_off, struct dirent.d_reclen, struct dirent.d_type],,,
  2867. [#include <sys/types.h>
  2868. #include <dirent.h>])
  2869. AC_CHECK_MEMBERS(
  2870. [struct passwd.pw_gecos],,,
  2871. [#include <sys/types.h>
  2872. #include <pwd.h>])
  2873. AC_CHECK_MEMBERS(
  2874. [struct statfs.f_flags],,,
  2875. [#include <sys/types.h>
  2876. #include <sys/vfs.h>])
  2877. AC_CHECK_MEMBERS(
  2878. [struct stat.st_atim, struct stat.st_mtim, struct stat.st_atimespec, struct stat.st_ctim],,,
  2879. [#include <sys/types.h>
  2880. #include <sys/stat.h>
  2881. #include <unistd.h>])
  2882. dnl Favour xattr through glibc, but use libattr if we have to
  2883. AC_CHECK_FUNC(lsetxattr, ,
  2884. AC_CHECK_LIB(attr, lsetxattr, XATTR_LIB="-lattr",)
  2885. )
  2886. AC_SUBST(XATTR_LIB)
  2887. dnl kinfo_proc.kp_proc works on darwin but fails on other simil-bsds
  2888. AC_CHECK_MEMBERS(
  2889. [struct kinfo_proc.kp_proc],,,
  2890. [#include <sys/types.h>
  2891. #include <sys/param.h>
  2892. #include <sys/sysctl.h>
  2893. #include <sys/proc.h>
  2894. ])
  2895. dnl *********************************
  2896. dnl *** Checks for Windows compilation ***
  2897. dnl *********************************
  2898. AC_CHECK_HEADERS(sys/time.h)
  2899. AC_CHECK_HEADERS(sys/param.h)
  2900. AC_CHECK_HEADERS(dirent.h)
  2901. dnl ******************************************
  2902. dnl *** Checks for OSX and iOS compilation ***
  2903. dnl ******************************************
  2904. AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
  2905. dnl *********************************
  2906. dnl *** Check for Console 2.0 I/O ***
  2907. dnl *********************************
  2908. AC_CHECK_HEADERS([curses.h])
  2909. AC_CHECK_HEADERS([term.h], [], [],
  2910. [#if HAVE_CURSES_H
  2911. #include <curses.h>
  2912. #endif
  2913. ])
  2914. AC_CHECK_HEADERS([termios.h])
  2915. dnl *********************************
  2916. dnl *** Checks for random ***
  2917. dnl *********************************
  2918. if test x$host_darwin = xno; then
  2919. AC_CHECK_HEADERS(sys/random.h)
  2920. AC_CHECK_FUNCS(getrandom getentropy)
  2921. fi
  2922. dnl *********************************
  2923. dnl *** Checks for Mono.Native ***
  2924. dnl *********************************
  2925. # Translated from CMake in external/corefx/src/Native/Unix/configure.cmake, keep in sync!
  2926. # Note: check_c_source_compiles in CMake is AC_TRY_LINK in autoconf
  2927. AC_MSG_CHECKING(for linux/in.h)
  2928. AC_TRY_COMPILE([
  2929. #include <sys/socket.h>
  2930. #include <linux/in.h>
  2931. ], [
  2932. ],[
  2933. AC_MSG_RESULT(yes)
  2934. AC_DEFINE(HAVE_LINUX_IN_H, 1, [linux/in.h])
  2935. ], [
  2936. AC_MSG_RESULT(no)
  2937. ])
  2938. AC_CHECK_HEADERS([linux/if_packet.h])
  2939. AC_MSG_CHECKING(for struct in_pktinfo)
  2940. AC_TRY_COMPILE([
  2941. #ifdef HAVE_LINUX_IN_H
  2942. #include <sys/socket.h>
  2943. #include <linux/in.h>
  2944. #else
  2945. #include <netinet/in.h>
  2946. #endif
  2947. ], [
  2948. struct in_pktinfo pktinfo;
  2949. ],[
  2950. AC_MSG_RESULT(yes)
  2951. AC_DEFINE(HAVE_IN_PKTINFO, 1, [struct in_pktinfo])
  2952. ], [
  2953. AC_MSG_RESULT(no)
  2954. ])
  2955. AC_MSG_CHECKING(for struct ip_mreqn)
  2956. AC_TRY_COMPILE([
  2957. #if HAVE_LINUX_IN_H
  2958. #include <sys/socket.h>
  2959. #include <linux/in.h>
  2960. #else
  2961. #include <netinet/in.h>
  2962. #endif
  2963. ], [
  2964. struct ip_mreqn mreqn;
  2965. ],[
  2966. AC_MSG_RESULT(yes)
  2967. AC_DEFINE(HAVE_IP_MREQN, 1, struct ip_mreqn)
  2968. ], [
  2969. AC_MSG_RESULT(no)
  2970. ])
  2971. if test x$host_darwin = xno; then
  2972. AC_CHECK_TYPES([struct flock64], [AC_DEFINE(HAVE_FLOCK64, 1, struct flock64)], , [#include <fcntl.h>])
  2973. fi
  2974. AC_CHECK_DECL(O_CLOEXEC, [AC_DEFINE(HAVE_O_CLOEXEC, 1, [O_CLOEXEC])], [], [[#include <fcntl.h>]])
  2975. AC_CHECK_DECL(F_DUPFD_CLOEXEC, [AC_DEFINE(HAVE_F_DUPFD_CLOEXEC, 1, [F_DUPFD_CLOEXEC])], [], [[#include <fcntl.h>]])
  2976. # AC_CHECK_FUNC(getifaddrs, [AC_DEFINE(HAVE_GETIFADDRS, 1, [getifaddrs])]) # already done above
  2977. AC_CHECK_FUNC(Qp2getifaddrs, [AC_DEFINE(HAVE_QP2GETIFADDRS, 1, [Qp2getifaddrs])])
  2978. AC_CHECK_FUNC(lseek64, [AC_DEFINE(HAVE_LSEEK64, 1, [lseek64])])
  2979. AC_CHECK_FUNC(mmap64, [AC_DEFINE(HAVE_MMAP64, 1, [mmap64])])
  2980. AC_CHECK_FUNC(ftruncate64, [AC_DEFINE(HAVE_FTRUNCATE64, 1, [ftruncate64])])
  2981. AC_CHECK_FUNC(posix_fadvise64, [AC_DEFINE(HAVE_POSIX_FADVISE64, 1, [posix_fadvise64])])
  2982. if test "x$mono_native_platform_ios" = "xno"; then
  2983. # On iOS, `stat64()` is deprecated and there is no `struct stat64` and `stat()`
  2984. # is either 32-bit or 64-bit based on the device / simulator that you're running on.
  2985. AC_CHECK_FUNC(stat64, [AC_DEFINE(HAVE_STAT64, 1, [stat64])])
  2986. fi
  2987. AC_CHECK_DECL(pipe2, [AC_DEFINE(HAVE_PIPE2, 1, [pipe2])])
  2988. AC_CHECK_FUNC(getmntinfo, [AC_DEFINE(HAVE_GETMNTINFO, 1, [getmntinfo])], [], [[#include <unistd.h>]])
  2989. AC_CHECK_FUNC(strcpy_s, [AC_DEFINE(HAVE_STRCPY_S, 1, [strcpy_s])])
  2990. AC_CHECK_FUNC(strlcpy, [AC_DEFINE(HAVE_STRLCPY, 1, [strlcpy])])
  2991. AC_CHECK_FUNC(posix_fadvise, [AC_DEFINE(HAVE_POSIX_ADVISE, 1, [posix_fadvise])]) # the define is called HAVE_POSIX_ADVISE in corefx, not a typo
  2992. AC_CHECK_FUNC(ioctl, [AC_DEFINE(HAVE_IOCTL, 1, [ioctl])])
  2993. AC_CHECK_FUNC(sched_getaffinity, [AC_DEFINE(HAVE_SCHED_GETAFFINITY, 1, [sched_getaffinity])])
  2994. AC_CHECK_FUNC(sched_setaffinity, [AC_DEFINE(HAVE_SCHED_SETAFFINITY, 1, [sched_setaffinity])])
  2995. if test "x$platform_android" != "xyes"; then
  2996. AC_CHECK_FUNC(arc4random_buf, [AC_DEFINE(HAVE_ARC4RANDOM_BUF, 1, [arc4random_buf])])
  2997. fi
  2998. AC_CHECK_DECL(TIOCGWINSZ, [AC_DEFINE(HAVE_TIOCGWINSZ, 1, [TIOCGWINSZ])], [], [[#include <sys/ioctl.h>]])
  2999. AC_CHECK_FUNC(tcgetattr, [AC_DEFINE(HAVE_TCGETATTR, 1, [tcgetattr])])
  3000. AC_CHECK_FUNC(tcsetattr, [AC_DEFINE(HAVE_TCSETATTR, 1, [tcsetattr])])
  3001. AC_CHECK_DECL(ECHO, [AC_DEFINE(HAVE_ECHO, 1, [ECHO])], [], [[#include <termios.h>]])
  3002. AC_CHECK_DECL(ICANON, [AC_DEFINE(HAVE_ICANON, 1, [ICANON])], [], [[#include <termios.h>]])
  3003. AC_CHECK_DECL(TCSANOW, [AC_DEFINE(HAVE_TCSANOW, 1, [TCSANOW])], [], [[#include <termios.h>]])
  3004. AC_CHECK_MEMBER(struct stat.st_birthtimespec,
  3005. [AC_DEFINE(HAVE_STAT_BIRTHTIME, 1, [struct stat.st_birthtimespec])],
  3006. [],
  3007. [#include <sys/types.h>
  3008. #include <sys/stat.h>])
  3009. AC_CHECK_MEMBER(struct stat.st_atimespec,
  3010. [AC_DEFINE(HAVE_STAT_TIMESPEC, 1, [struct stat.st_atimespec])],
  3011. [],
  3012. [#include <sys/types.h>
  3013. #include <sys/stat.h>])
  3014. AC_CHECK_MEMBER(struct stat.st_atim,
  3015. [AC_DEFINE(HAVE_STAT_TIM, 1, [struct stat.st_atim])],
  3016. [],
  3017. [#include <sys/types.h>
  3018. #include <sys/stat.h>])
  3019. AC_CHECK_MEMBER(struct stat.st_atimensec,
  3020. [AC_DEFINE(HAVE_STAT_NSEC, 1, [struct stat.st_atimensec])],
  3021. [],
  3022. [#include <sys/types.h>
  3023. #include <sys/stat.h>])
  3024. AC_CHECK_MEMBER(struct dirent.d_namlen, [AC_DEFINE(HAVE_DIRENT_NAME_LEN, 1, [struct dirent.d_namlen])], [], [#include <dirent.h>])
  3025. AC_CHECK_MEMBER(struct statfs.f_fstypename, [AC_DEFINE(HAVE_STATFS_FSTYPENAME, 1, [struct statfs.f_fstypename])], [], [#include <sys/mount.h>])
  3026. AC_CHECK_MEMBER(struct statvfs.f_fstypename, [AC_DEFINE(HAVE_STATVFS_FSTYPENAME, 1, [struct statvfs.f_fstypename])], [], [#include <sys/mount.h>])
  3027. AC_MSG_CHECKING(for struct statfs)
  3028. AC_TRY_COMPILE([
  3029. #if defined(HAVE_STATFS_FSTYPENAME) || defined(HAVE_STATVFS_FSTYPENAME)
  3030. #include <sys/mount.h>
  3031. #else
  3032. #include <sys/statfs.h>
  3033. #endif
  3034. ], [
  3035. struct statfs;
  3036. ],[
  3037. AC_MSG_RESULT(yes)
  3038. AC_DEFINE(HAVE_STATFS, 1, [struct statfs])
  3039. ], [
  3040. AC_MSG_RESULT(no)
  3041. ])
  3042. if test "x$ac_cv_func_strerror_r_char_p" = "xyes" ; then
  3043. AC_DEFINE(HAVE_GNU_STRERROR_R, 1, [char* strerror(int errnum, char *buf, size_t buflen)])
  3044. fi
  3045. AC_MSG_CHECKING(for readdir_r)
  3046. AC_TRY_LINK([
  3047. #include <dirent.h>
  3048. ], [
  3049. DIR* dir;
  3050. struct dirent* entry;
  3051. struct dirent* result;
  3052. readdir_r(dir, entry, &result);
  3053. ],[
  3054. AC_MSG_RESULT(yes)
  3055. AC_DEFINE(HAVE_READDIR_R, 1, [readdir_r])
  3056. ], [
  3057. AC_MSG_RESULT(no)
  3058. ])
  3059. AC_MSG_CHECKING(for kevent with void *data)
  3060. AC_TRY_LINK([
  3061. #include <sys/types.h>
  3062. #include <sys/event.h>
  3063. ], [
  3064. struct kevent event;
  3065. void* data;
  3066. EV_SET(&event, 0, EVFILT_READ, 0, 0, 0, data);
  3067. ],[
  3068. AC_MSG_RESULT(yes)
  3069. AC_DEFINE(KEVENT_HAS_VOID_UDATA, 1, [kevent with void *data])
  3070. ], [
  3071. AC_MSG_RESULT(no)
  3072. ])
  3073. AC_CHECK_MEMBER(struct fd_set.fds_bits, [AC_DEFINE(HAVE_FDS_BITS, 1, [struct fd_set.fds_bits])], [], [[#include <sys/select.h>]])
  3074. AC_CHECK_MEMBER(struct fd_set.__fds_bits, [AC_DEFINE(HAVE_PRIVATE_FDS_BITS, 1, [struct fd_set.__fds_bits])], [], [[#include <sys/select.h>]])
  3075. AC_MSG_CHECKING(for sendfile with 4 arguments)
  3076. AC_TRY_LINK([
  3077. #include <sys/sendfile.h>
  3078. ], [
  3079. #if defined(TARGET_ANDROID)
  3080. #if !defined(__ANDROID_API__)
  3081. #error No definition for __ANDROID_API__ even though we're targeting TARGET_ANDROID
  3082. #elif __ANDROID_API__ < 21
  3083. #error sendfile is not supported on this Android API level
  3084. #endif
  3085. #endif
  3086. int result = sendfile(0, 0, 0, 0);
  3087. ],[
  3088. AC_MSG_RESULT(yes)
  3089. AC_DEFINE(HAVE_SENDFILE_4, 1, [sendfile with 4 arguments])
  3090. ], [
  3091. AC_MSG_RESULT(no)
  3092. ])
  3093. ORIG_CFLAGS="$CFLAGS"
  3094. CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
  3095. AC_MSG_CHECKING(for sendfile with 6 arguments)
  3096. AC_TRY_LINK([
  3097. #include <stdlib.h>
  3098. #include <sys/types.h>
  3099. #include <sys/socket.h>
  3100. #include <sys/uio.h>
  3101. ], [
  3102. int result = sendfile(0, 0, 0, NULL, NULL, 0);
  3103. ],[
  3104. AC_MSG_RESULT(yes)
  3105. AC_DEFINE(HAVE_SENDFILE_6, 1, [sendfile with 6 arguments])
  3106. ], [
  3107. AC_MSG_RESULT(no)
  3108. ])
  3109. CFLAGS="$ORIG_CFLAGS"
  3110. AC_CHECK_FUNC(fcopyfile, [AC_DEFINE(HAVE_FCOPYFILE, 1, [fcopyfile])])
  3111. AC_CHECK_FUNC(epoll_create1, [AC_DEFINE(HAVE_EPOLL, 1, [epoll_create1])])
  3112. AC_CHECK_FUNC(accept4, [AC_DEFINE(HAVE_ACCEPT4, 1, [accept4])])
  3113. AC_CHECK_FUNC(kqueue, [AC_DEFINE(HAVE_KQUEUE, 1, [kqueue])])
  3114. ORIG_CFLAGS="$CFLAGS"
  3115. CFLAGS="$CFLAGS -Werror=sign-conversion"
  3116. AC_MSG_CHECKING(for getnameinfo with signed flags)
  3117. AC_TRY_LINK([
  3118. #include <sys/types.h>
  3119. #include <netdb.h>
  3120. ], [
  3121. const struct sockaddr *addr;
  3122. socklen_t addrlen;
  3123. char *host;
  3124. socklen_t hostlen;
  3125. char *serv;
  3126. socklen_t servlen;
  3127. int flags;
  3128. int result = getnameinfo(addr, addrlen, host, hostlen, serv, servlen, flags);
  3129. ],[
  3130. AC_MSG_RESULT(yes)
  3131. AC_DEFINE(HAVE_GETNAMEINFO_SIGNED_FLAGS, 1, [getnameinfo with signed flags])
  3132. ], [
  3133. AC_MSG_RESULT(no)
  3134. ])
  3135. CFLAGS="$ORIG_CFLAGS"
  3136. if test "x$host_linux" = "xyes"; then
  3137. AC_DEFINE(HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO, 1, [HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO])
  3138. else
  3139. AC_DEFINE(HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO, 0, [HAVE_SUPPORT_FOR_DUAL_MODE_IPV4_PACKET_INFO])
  3140. fi
  3141. # HAVE_CLOCK_MONOTONIC check already done above
  3142. # HAVE_CLOCK_REALTIME check already done above
  3143. # HAVE_MACH_ABSOLUTE_TIME check already done above
  3144. # HAVE_MACH_TIMEBASE_INFO check already done above
  3145. # HAVE_FUTIMES check already done above
  3146. # HAVE_FUTIMENS check already done above
  3147. ORIG_CFLAGS="$CFLAGS"
  3148. CFLAGS="$CFLAGS -Werror=sign-conversion"
  3149. AC_MSG_CHECKING(for bind with unsigned addrlen)
  3150. AC_TRY_LINK([
  3151. #include <sys/socket.h>
  3152. ], [
  3153. int fd;
  3154. struct sockaddr* addr;
  3155. socklen_t addrLen;
  3156. bind(fd, addr, addrLen);
  3157. ],[
  3158. AC_MSG_RESULT(yes)
  3159. AC_DEFINE(BIND_ADDRLEN_UNSIGNED, 1, [bind with unsigned addrlen])
  3160. ], [
  3161. AC_MSG_RESULT(no)
  3162. ])
  3163. AC_MSG_CHECKING(for struct ipv6_mreq with unsigned ipv6mr_interface)
  3164. AC_TRY_LINK([
  3165. #include <netinet/in.h>
  3166. #include <netinet/tcp.h>
  3167. ], [
  3168. struct ipv6_mreq opt;
  3169. unsigned int index = 0;
  3170. opt.ipv6mr_interface = index;
  3171. ],[
  3172. AC_MSG_RESULT(yes)
  3173. AC_DEFINE(IPV6MR_INTERFACE_UNSIGNED, 1, [struct ipv6_mreq with unsigned ipv6mr_interface])
  3174. ], [
  3175. AC_MSG_RESULT(no)
  3176. ])
  3177. AC_MSG_CHECKING(for inotify_rm_watch with unsigned wd)
  3178. AC_TRY_LINK([
  3179. #include <sys/inotify.h>
  3180. ], [
  3181. intptr_t fd;
  3182. uint32_t wd;
  3183. int result = inotify_rm_watch(fd, wd);
  3184. ],[
  3185. AC_MSG_RESULT(yes)
  3186. AC_DEFINE(INOTIFY_RM_WATCH_WD_UNSIGNED, 1, [inotify_rm_watch with unsigned wd])
  3187. ], [
  3188. AC_MSG_RESULT(no)
  3189. ])
  3190. CFLAGS="$ORIG_CFLAGS"
  3191. AC_MSG_CHECKING(for shm_open that works well enough with mmap)
  3192. if test "x$ac_cv_func_shm_open" = "xno" -o "x$ac_cv_func_shm_open_working_with_mmap" = "xno" ; then
  3193. AC_MSG_RESULT(no)
  3194. elif test "x$cross_compiling" = "xyes"; then
  3195. AC_MSG_RESULT(cross compiling, assuming yes)
  3196. AC_DEFINE(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP, 1, [shm_open that works well enough with mmap])
  3197. else
  3198. AC_TRY_RUN([
  3199. #include <sys/mman.h>
  3200. #include <fcntl.h>
  3201. #include <unistd.h>
  3202. int main ()
  3203. {
  3204. #ifdef __PASE__
  3205. /* IBM i doesn't implement this and returns SIGILL */
  3206. return -1;
  3207. #endif
  3208. int fd = shm_open("/mono_configure_shm_open", O_CREAT | O_RDWR, 0777);
  3209. if (fd == -1)
  3210. return -1;
  3211. shm_unlink("/mono_configure_shm_open");
  3212. // NOTE: PROT_EXEC and MAP_PRIVATE don't work well with shm_open
  3213. // on at least the current version of Mac OS X
  3214. if (mmap(NULL, 1, PROT_EXEC, MAP_PRIVATE, fd, 0) == MAP_FAILED)
  3215. return -1;
  3216. return 0;
  3217. }
  3218. ],[
  3219. AC_MSG_RESULT(yes)
  3220. AC_DEFINE(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP, 1, [shm_open that works well enough with mmap])
  3221. ], [
  3222. AC_MSG_RESULT(no)
  3223. ])
  3224. fi
  3225. AC_MSG_CHECKING(for getpriority with int who)
  3226. AC_TRY_LINK([
  3227. #include <sys/resource.h>
  3228. ], [
  3229. int which;
  3230. int who;
  3231. int result = getpriority(which, who);
  3232. ],[
  3233. AC_MSG_RESULT(yes)
  3234. AC_DEFINE(PRIORITY_REQUIRES_INT_WHO, 1, [getpriority with int who])
  3235. ], [
  3236. AC_MSG_RESULT(no)
  3237. ])
  3238. AC_MSG_CHECKING(for kevent with int parameters)
  3239. AC_TRY_LINK([
  3240. #include <sys/types.h>
  3241. #include <sys/event.h>
  3242. ], [
  3243. int kg;
  3244. const struct kevent* chagelist;
  3245. int nchanges;
  3246. struct kevent* eventlist;
  3247. int nevents;
  3248. const struct timespec* timeout;
  3249. int result = kevent(kg, chagelist, nchanges, eventlist, nevents, timeout);
  3250. ],[
  3251. AC_MSG_RESULT(yes)
  3252. AC_DEFINE(KEVENT_REQUIRES_INT_PARAMS, 1, [kevent with int parameters])
  3253. ], [
  3254. AC_MSG_RESULT(no)
  3255. ])
  3256. AC_CHECK_FUNCS(mkstemps)
  3257. # AC_CHECK_FUNCS(mkstemp) # already done above
  3258. if test "x$ac_cv_func_mkstemps" != "xyes" -a "x$ac_cv_func_mkstemp" != "xyes"; then
  3259. AC_MSG_ERROR([Cannot find mkstemps or mkstemp on this platform])
  3260. fi
  3261. AC_MSG_CHECKING(for tcp/var.h)
  3262. AC_TRY_LINK([
  3263. #include <sys/types.h>
  3264. #include <sys/socketvar.h>
  3265. #include <netinet/ip.h>
  3266. #include <netinet/tcp.h>
  3267. #include <netinet/tcp_var.h>
  3268. ], [
  3269. ],[
  3270. AC_MSG_RESULT(yes)
  3271. AC_DEFINE(HAVE_TCP_VAR_H, 1, [tcp/var.h])
  3272. ], [
  3273. AC_MSG_RESULT(no)
  3274. ])
  3275. AC_CHECK_HEADERS([sys/cdefs.h])
  3276. AC_MSG_CHECKING(for TCPSTATE enum in netinet/tcp.h)
  3277. AC_TRY_LINK([
  3278. #ifdef HAVE_SYS_CDEFS_H
  3279. #include <sys/cdefs.h>
  3280. #endif
  3281. #include <netinet/tcp.h>
  3282. ], [
  3283. int result = TCP_ESTABLISHED;
  3284. ],[
  3285. AC_MSG_RESULT(yes)
  3286. AC_DEFINE(HAVE_TCP_H_TCPSTATE_ENUM, 1, [TCPSTATE enum in netinet/tcp.h])
  3287. ], [
  3288. AC_MSG_RESULT(no)
  3289. ])
  3290. AC_CHECK_DECL(TCPS_ESTABLISHED, [AC_DEFINE(HAVE_TCP_FSM_H, 1, [HAVE_TCP_FSM_H])], [], [[#include <netinet/tcp_fsm.h>]])
  3291. AC_MSG_CHECKING(for struct rt_msghdr)
  3292. AC_TRY_COMPILE([
  3293. #include <sys/types.h>
  3294. #include <net/route.h>
  3295. ], [
  3296. struct rt_msghdr;
  3297. ],[
  3298. AC_MSG_RESULT(yes)
  3299. AC_DEFINE(HAVE_RT_MSGHDR, 1, [struct rt_msghdr])
  3300. ], [
  3301. AC_MSG_RESULT(no)
  3302. ])
  3303. AC_CHECK_HEADERS([sys/sysctl.h])
  3304. AC_CHECK_HEADERS([linux/rtnetlink.h])
  3305. AC_CHECK_FUNC(getpeereid, [AC_DEFINE(HAVE_GETPEEREID, 1, [getpeereid])])
  3306. #AC_CHECK_FUNC(getdomainname, [AC_DEFINE(HAVE_GETDOMAINNAME, 1, [getdomainname])]) # already done above
  3307. AC_CHECK_FUNC(uname, [AC_DEFINE(HAVE_UNAME, 1, [uname])])
  3308. ORIG_CFLAGS="$CFLAGS"
  3309. CFLAGS="$CFLAGS -Werror=shorten-64-to-32"
  3310. AC_MSG_CHECKING(for getdomainname with size_t namelen)
  3311. AC_TRY_LINK([
  3312. #include <unistd.h>
  3313. ], [
  3314. size_t namelen = 20;
  3315. char name[20];
  3316. int result = getdomainname(name, namelen);
  3317. ],[
  3318. AC_MSG_RESULT(yes)
  3319. AC_DEFINE(HAVE_GETDOMAINNAME_SIZET, 1, [getdomainname with size_t namelen])
  3320. ], [
  3321. AC_MSG_RESULT(no)
  3322. ])
  3323. CFLAGS="$ORIG_CFLAGS"
  3324. AC_CHECK_FUNC(inotify_init, [AC_DEFINE(HAVE_INOTIFY_INIT, 1, [inotify_init])])
  3325. AC_CHECK_FUNC(inotify_add_watch, [AC_DEFINE(HAVE_INOTIFY_ADD_WATCH, 1, [inotify_add_watch])])
  3326. AC_CHECK_FUNC(inotify_rm_watch, [AC_DEFINE(HAVE_INOTIFY_RM_WATCH, 1, [inotify_rm_watch])])
  3327. if test "x$ac_cv_func_inotify_init" = "xyes" -a "x$ac_cv_func_inotify_add_watch" = "xyes" -a "x$ac_cv_func_inotify_rm_watch" = "xyes"; then
  3328. AC_DEFINE(HAVE_INOTIFY, 1, [HAVE_INOTIFY])
  3329. elif test "x$host_linux" = "xyes"; then
  3330. AC_MSG_ERROR([Cannot find inotify functions on a Linux platform.])
  3331. fi
  3332. # HAVE_CURLM_ADDED_ALREADY check skipped because we don't use libcurl in mono
  3333. # HAVE_CURL_HTTP_VERSION_2TLS check skipped because we don't use libcurl in mono
  3334. # HAVE_CURLPIPE_MULTIPLEX check skipped because we don't use libcurl in mono
  3335. # HAVE_CURL_SSLVERSION_TLSv1_012 check skipped because we don't use libcurl in mono
  3336. enable_gss=no;
  3337. AC_MSG_CHECKING(for GSS/GSS.h)
  3338. AC_TRY_COMPILE([
  3339. #include <GSS/GSS.h>
  3340. ], [
  3341. ],[
  3342. AC_MSG_RESULT(yes)
  3343. AC_DEFINE(HAVE_GSSFW_HEADERS, 1, [GSS/GSS.h])
  3344. AC_DEFINE(HAVE_GSS_SPNEGO_MECHANISM, 1, [GSS_SPNEGO_MECHANISM])
  3345. enable_gss=yes
  3346. AC_DEFINE(ENABLE_GSS, 1, [ENABLE_GSS])
  3347. ], [
  3348. AC_MSG_RESULT(no)
  3349. ])
  3350. AC_MSG_CHECKING(for gssapi/gssapi_ext.h)
  3351. AC_TRY_COMPILE([
  3352. #include <gssapi/gssapi_ext.h>
  3353. ], [
  3354. ],[
  3355. AC_MSG_RESULT(yes)
  3356. enable_gss=yes
  3357. AC_DEFINE(ENABLE_GSS, 1, [ENABLE_GSS])
  3358. ], [
  3359. AC_MSG_RESULT(no)
  3360. ])
  3361. AC_MSG_CHECKING(for GSS_SPNEGO_MECHANISM)
  3362. AC_TRY_COMPILE([
  3363. #include <gssapi/gssapi_ext.h>
  3364. #include <gssapi/gssapi_krb5.h>
  3365. gss_OID_set_desc gss_mech_spnego_OID_set_desc = {.count = 1, .elements = GSS_SPNEGO_MECHANISM};
  3366. ], [
  3367. ],[
  3368. AC_MSG_RESULT(yes)
  3369. AC_DEFINE(HAVE_GSS_SPNEGO_MECHANISM, 1, [GSS_SPNEGO_MECHANISM])
  3370. ], [
  3371. AC_MSG_RESULT(no)
  3372. ])
  3373. AM_CONDITIONAL(ENABLE_GSS, test x$enable_gss = xyes)
  3374. AC_CHECK_HEADERS([crt_externs.h])
  3375. AC_MSG_CHECKING(for _NSGetEnviron)
  3376. AC_TRY_LINK([
  3377. #include <crt_externs.h>
  3378. ], [
  3379. char **result = *(_NSGetEnviron());
  3380. ],[
  3381. AC_MSG_RESULT(yes)
  3382. AC_DEFINE(HAVE_NSGETENVIRON, 1, [_NSGetEnviron])
  3383. ], [
  3384. AC_MSG_RESULT(no)
  3385. ])
  3386. AC_CHECK_DECL(IN_EXCL_UNLINK, [AC_DEFINE(HAVE_IN_EXCL_UNLINK, 1, [IN_EXCL_UNLINK])], [], [[#include <sys/inotify.h>]])
  3387. # *** End of Mono.Native checks ***
  3388. else
  3389. AM_CONDITIONAL(ENABLE_GSS, false)
  3390. dnl *********************************
  3391. dnl *** Checks for Windows compilation ***
  3392. dnl *********************************
  3393. AC_CHECK_HEADERS(winternl.h)
  3394. jdk_headers_found=no
  3395. AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32", AC_ERROR(bad mingw install?))
  3396. AC_CHECK_LIB(psapi, main, LIBS="$LIBS -lpsapi", AC_ERROR(bad mingw install?))
  3397. AC_CHECK_LIB(ole32, main, LIBS="$LIBS -lole32", AC_ERROR(bad mingw install?))
  3398. AC_CHECK_LIB(winmm, main, LIBS="$LIBS -lwinmm", AC_ERROR(bad mingw install?))
  3399. AC_CHECK_LIB(oleaut32, main, LIBS="$LIBS -loleaut32", AC_ERROR(bad mingw install?))
  3400. AC_CHECK_LIB(advapi32, main, LIBS="$LIBS -ladvapi32", AC_ERROR(bad mingw install?))
  3401. AC_CHECK_LIB(version, main, LIBS="$LIBS -lversion", AC_ERROR(bad mingw install?))
  3402. dnl *********************************
  3403. dnl *** Check for struct ip_mreqn ***
  3404. dnl *********************************
  3405. AC_MSG_CHECKING(for struct ip_mreqn)
  3406. AC_TRY_COMPILE([#include <ws2tcpip.h>], [
  3407. struct ip_mreqn mreq;
  3408. mreq.imr_address.s_addr = 0;
  3409. ], [
  3410. # Yes, we have it...
  3411. AC_MSG_RESULT(yes)
  3412. AC_DEFINE(HAVE_STRUCT_IP_MREQN)
  3413. ], [
  3414. # We'll just have to try and use struct ip_mreq
  3415. AC_MSG_RESULT(no)
  3416. AC_MSG_CHECKING(for struct ip_mreq)
  3417. AC_TRY_COMPILE([#include <ws2tcpip.h>], [
  3418. struct ip_mreq mreq;
  3419. mreq.imr_interface.s_addr = 0;
  3420. ], [
  3421. # Yes, we have it...
  3422. AC_MSG_RESULT(yes)
  3423. AC_DEFINE(HAVE_STRUCT_IP_MREQ)
  3424. ], [
  3425. # No multicast support
  3426. AC_MSG_RESULT(no)
  3427. ])
  3428. ])
  3429. dnl **********************************
  3430. dnl *** Check for getaddrinfo ***
  3431. dnl **********************************
  3432. AC_MSG_CHECKING(for getaddrinfo)
  3433. AC_TRY_LINK([
  3434. #include <stdio.h>
  3435. #include <winsock2.h>
  3436. #include <ws2tcpip.h>
  3437. ], [
  3438. getaddrinfo(NULL,NULL,NULL,NULL);
  3439. ], [
  3440. # Yes, we have it...
  3441. AC_MSG_RESULT(yes)
  3442. AC_DEFINE(HAVE_GETADDRINFO, 1, [Have getaddrinfo])
  3443. ], [
  3444. AC_MSG_RESULT(no)
  3445. ])
  3446. dnl **********************************
  3447. dnl *** Check for gethostbyname ***
  3448. dnl **********************************
  3449. AC_MSG_CHECKING(for gethostbyname)
  3450. AC_TRY_LINK([
  3451. #include <stdio.h>
  3452. #include <winsock2.h>
  3453. #include <ws2tcpip.h>
  3454. ], [
  3455. gethostbyname(NULL);
  3456. ], [
  3457. # Yes, we have it...
  3458. AC_MSG_RESULT(yes)
  3459. AC_DEFINE(HAVE_GETHOSTBYNAME, 1, [Have gethostbyname])
  3460. ], [
  3461. AC_MSG_RESULT(no)
  3462. ])
  3463. dnl **********************************
  3464. dnl *** Check for getprotobyname ***
  3465. dnl **********************************
  3466. AC_MSG_CHECKING(for getprotobyname)
  3467. AC_TRY_LINK([
  3468. #include <stdio.h>
  3469. #include <winsock2.h>
  3470. #include <ws2tcpip.h>
  3471. ], [
  3472. getprotobyname(NULL);
  3473. ], [
  3474. # Yes, we have it...
  3475. AC_MSG_RESULT(yes)
  3476. AC_DEFINE(HAVE_GETPROTOBYNAME, 1, [Have getprotobyname])
  3477. ], [
  3478. AC_MSG_RESULT(no)
  3479. ])
  3480. dnl **********************************
  3481. dnl *** Check for getnameinfo ***
  3482. dnl **********************************
  3483. AC_MSG_CHECKING(for getnameinfo)
  3484. AC_TRY_LINK([
  3485. #include <stdio.h>
  3486. #include <winsock2.h>
  3487. #include <ws2tcpip.h>
  3488. ], [
  3489. getnameinfo (NULL, 0, NULL, 0, NULL, 0, 0);
  3490. ], [
  3491. # Yes, we have it...
  3492. AC_MSG_RESULT(yes)
  3493. AC_DEFINE(HAVE_GETNAMEINFO, 1, [Have getnameinfo])
  3494. ], [
  3495. AC_MSG_RESULT(no)
  3496. ])
  3497. dnl **********************************
  3498. dnl *** Check for inet_ntop ***
  3499. dnl **********************************
  3500. AC_MSG_CHECKING(for inet_ntop)
  3501. AC_TRY_LINK([
  3502. #include <stdio.h>
  3503. #include <winsock2.h>
  3504. #include <ws2tcpip.h>
  3505. ], [
  3506. inet_ntop (0, NULL, NULL, 0);
  3507. ], [
  3508. # Yes, we have it...
  3509. AC_MSG_RESULT(yes)
  3510. AC_DEFINE(HAVE_INET_NTOP, 1, [Have inet_ntop])
  3511. ], [
  3512. AC_MSG_RESULT(no)
  3513. ])
  3514. dnl **********************************
  3515. dnl *** Check for inet_pton ***
  3516. dnl **********************************
  3517. AC_MSG_CHECKING(for inet_pton)
  3518. AC_TRY_LINK([
  3519. #include <stdio.h>
  3520. #include <winsock2.h>
  3521. #include <ws2tcpip.h>
  3522. ], [
  3523. #ifndef inet_pton
  3524. (void) inet_pton;
  3525. #endif
  3526. inet_pton (0, NULL, NULL);
  3527. ], [
  3528. # Yes, we have it...
  3529. AC_MSG_RESULT(yes)
  3530. AC_DEFINE(HAVE_INET_PTON, 1, [Have inet_pton])
  3531. ], [
  3532. AC_MSG_RESULT(no)
  3533. ])
  3534. fi
  3535. dnl socklen_t check
  3536. AC_MSG_CHECKING(for socklen_t)
  3537. AC_TRY_COMPILE([
  3538. #include <sys/types.h>
  3539. #include <sys/socket.h>
  3540. ],[
  3541. socklen_t foo;
  3542. ],[
  3543. ac_cv_c_socklen_t=yes
  3544. AC_DEFINE(HAVE_SOCKLEN_T, 1, [Have socklen_t])
  3545. AC_MSG_RESULT(yes)
  3546. ],[
  3547. AC_MSG_RESULT(no)
  3548. ])
  3549. AC_CHECK_FUNCS(execvp)
  3550. dnl ****************************
  3551. dnl *** Look for /dev/random ***
  3552. dnl ****************************
  3553. AC_MSG_CHECKING([if usage of random device is requested])
  3554. AC_ARG_ENABLE(dev-random,
  3555. [ --disable-dev-random disable the use of the random device (enabled by default)],
  3556. try_dev_random=$enableval, try_dev_random=yes)
  3557. AC_MSG_RESULT($try_dev_random)
  3558. case "{$build}" in
  3559. dnl IBM i does not have /dev/random, use unblocking only
  3560. *-*-os400*)
  3561. NAME_DEV_RANDOM="/dev/urandom"
  3562. ;;
  3563. dnl Win32 does not have /dev/random, they have their own method...
  3564. *-mingw*|*-*-cygwin*)
  3565. ac_cv_have_dev_random=no
  3566. ;;
  3567. dnl Everywhere else, it's /dev/random
  3568. *)
  3569. NAME_DEV_RANDOM="/dev/random"
  3570. ;;
  3571. esac
  3572. AC_DEFINE_UNQUOTED(NAME_DEV_RANDOM, "$NAME_DEV_RANDOM", [Name of /dev/random])
  3573. dnl Now check if the device actually exists
  3574. if test "x$try_dev_random" = "xyes"; then
  3575. AC_CACHE_CHECK(for random device, ac_cv_have_dev_random,
  3576. [if test -r "$NAME_DEV_RANDOM" ; then
  3577. ac_cv_have_dev_random=yes; else ac_cv_have_dev_random=no; fi])
  3578. if test "x$ac_cv_have_dev_random" = "xyes"; then
  3579. AC_DEFINE(HAVE_CRYPT_RNG, 1, [Have /dev/random])
  3580. fi
  3581. else
  3582. AC_MSG_CHECKING(for random device)
  3583. ac_cv_have_dev_random=no
  3584. AC_MSG_RESULT(has been disabled)
  3585. fi
  3586. if test "x$host_win32" = "xyes"; then
  3587. AC_DEFINE(HAVE_CRYPT_RNG)
  3588. fi
  3589. if test "x$ac_cv_have_dev_random" = "xno" \
  3590. && test "x$host_win32" = "xno"; then
  3591. AC_MSG_WARN([[
  3592. ***
  3593. *** A system-provided entropy source was not found on this system.
  3594. *** Because of this, the System.Security.Cryptography random number generator
  3595. *** will throw a NotImplemented exception.
  3596. ***
  3597. *** If you are seeing this message, and you know your system DOES have an
  3598. *** entropy collection in place, please report an issue on GitHub and
  3599. *** provide information about the system and how to access the random device.
  3600. ***
  3601. *** Otherwise you can install either egd or prngd and set the environment
  3602. *** variable MONO_EGD_SOCKET to point to the daemon's socket to use that.
  3603. ***]])
  3604. fi
  3605. 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)
  3606. AC_MSG_CHECKING([if big-arrays are to be enabled])
  3607. 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)
  3608. if test "x$enable_big_arrays" = "xyes" ; then
  3609. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  3610. AC_DEFINE(MONO_BIG_ARRAYS,1,[Enable the allocation and indexing of arrays greater than Int32.MaxValue])
  3611. else
  3612. AC_MSG_ERROR([The allocation and indexing of arrays greater than Int32.MaxValue is not supported on this platform.])
  3613. fi
  3614. fi
  3615. AC_MSG_RESULT($enable_big_arrays)
  3616. dnl **************
  3617. dnl *** DTRACE ***
  3618. dnl **************
  3619. AC_ARG_ENABLE(dtrace,[ --enable-dtrace Enable DTrace probes], enable_dtrace=$enableval, enable_dtrace=$has_dtrace)
  3620. if test "x$enable_dtrace" = "xyes"; then
  3621. if test "x$has_dtrace" = "xno"; then
  3622. AC_MSG_ERROR([DTrace probes are not supported on this platform.])
  3623. fi
  3624. AC_PATH_PROG(DTRACE, [dtrace], [no], [$PATH:/usr/sbin])
  3625. if test "x$DTRACE" = "xno"; then
  3626. AC_MSG_RESULT([dtrace utility not found, dtrace support disabled.])
  3627. enable_dtrace=no
  3628. elif ! $DTRACE -h -s $srcdir/data/mono.d > /dev/null 2>&1; then
  3629. AC_MSG_RESULT([dtrace doesn't support -h option, dtrace support disabled.])
  3630. enable_dtrace=no
  3631. fi
  3632. fi
  3633. dtrace_g=no
  3634. if test "x$enable_dtrace" = "xyes"; then
  3635. AC_DEFINE(ENABLE_DTRACE, 1, [Enable DTrace probes])
  3636. DTRACEFLAGS=
  3637. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  3638. case "$host" in
  3639. powerpc-*-darwin*)
  3640. DTRACEFLAGS="-arch ppc64"
  3641. ;;
  3642. i*86-*-darwin*)
  3643. DTRACEFLAGS="-arch x86_64"
  3644. ;;
  3645. *)
  3646. DTRACEFLAGS=-64
  3647. ;;
  3648. esac
  3649. else
  3650. case "$host" in
  3651. powerpc-*-darwin*)
  3652. DTRACEFLAGS="-arch ppc"
  3653. ;;
  3654. i*86-*-darwin*)
  3655. DTRACEFLAGS="-arch i386"
  3656. ;;
  3657. *)
  3658. DTRACEFLAGS=-32
  3659. ;;
  3660. esac
  3661. fi
  3662. AC_SUBST(DTRACEFLAGS)
  3663. case "$host" in
  3664. *-*-solaris*)
  3665. dtrace_g=yes
  3666. ;;
  3667. esac
  3668. AC_CHECK_HEADERS([sys/sdt.h])
  3669. fi
  3670. AM_CONDITIONAL(ENABLE_DTRACE, [test x$enable_dtrace = xyes])
  3671. AM_CONDITIONAL(DTRACE_G_REQUIRED, [test x$dtrace_g = xyes])
  3672. dnl **************************
  3673. dnl *** AOT cross offsets ***
  3674. dnl **************************
  3675. AC_ARG_WITH(cross-offsets, [ --with-cross-offsets=<offsets file path> Explicit AOT cross offsets file],
  3676. AC_DEFINE_UNQUOTED(MONO_OFFSETS_FILE, "$withval", [AOT cross offsets file]))
  3677. dnl **************
  3678. dnl *** LLVM ***
  3679. dnl **************
  3680. AC_ARG_ENABLE(llvm,[ --enable-llvm Enable the LLVM back-end], enable_llvm=$enableval, enable_llvm=default)
  3681. AC_ARG_ENABLE(loadedllvm,[ --enable-loadedllvm Load the LLVM back-end dynamically], enable_llvm=$enableval && enable_loadedllvm=$enableval, enable_loadedllvm=no)
  3682. 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)
  3683. AC_ARG_ENABLE(llvm-runtime,[ --enable-llvm-runtime Enable runtime support for llvmonly code], enable_llvm_runtime=$enableval, enable_llvm_runtime=no)
  3684. AC_ARG_ENABLE(llvm-asserts,[ --enable-llvm-asserts Enable llvm asserts (option to LLVM in CMake)], enable_llvm_asserts=$enableval, enable_llvm_asserts=no)
  3685. AC_ARG_WITH(llvm, [ --with-llvm=<llvm prefix> Enable the LLVM back-end], enable_llvm=yes,)
  3686. if test "x$enable_llvm" = "xdefault"; then
  3687. enable_llvm=$enable_llvm_default
  3688. fi
  3689. enable_llvm_msvc_only="no"
  3690. if test "x$enable_llvm" = "xyes"; then
  3691. if test "x$host_win32" = "xyes"; then
  3692. if test "x$cross_compiling" = "xno"; then
  3693. case "$target" in
  3694. x86_64*)
  3695. AC_MSG_WARN("LLVM for host=Windows and target=Windows is only supported on x64 MSVC builds. Disabling LLVM for GCC build.")
  3696. enable_llvm_msvc_only="yes"
  3697. ;;
  3698. i686*)
  3699. AC_MSG_ERROR("LLVM for host=Windows and target=Windows is only supported for x64 builds.")
  3700. ;;
  3701. esac
  3702. fi
  3703. if test "x$enable_loadedllvm" = "xyes"; then
  3704. AC_MSG_WARN("Loadable LLVM currently not supported on Windows. Disabling feature.")
  3705. enable_loadedllvm=no
  3706. fi
  3707. fi
  3708. fi
  3709. internal_llvm="no"
  3710. if test "x$enable_llvm" = "xyes"; then
  3711. if test "x$with_llvm" != "x"; then
  3712. EXTERNAL_LLVM_CONFIG=$with_llvm/bin/llvm-config
  3713. if test x$host_win32 = xyes; then
  3714. EXTERNAL_LLVM_CONFIG=$EXTERNAL_LLVM_CONFIG.exe
  3715. fi
  3716. if test ! -x $EXTERNAL_LLVM_CONFIG; then
  3717. AC_MSG_ERROR([LLVM executable $EXTERNAL_LLVM_CONFIG not found.])
  3718. fi
  3719. else
  3720. if test x$host_win32 = xyes; then
  3721. AC_PATH_PROG(EXTERNAL_LLVM_CONFIG, llvm-config.exe, no)
  3722. else
  3723. AC_PATH_PROG(EXTERNAL_LLVM_CONFIG, llvm-config, no)
  3724. fi
  3725. if test "x$EXTERNAL_LLVM_CONFIG" = "xno"; then
  3726. internal_llvm=yes
  3727. fi
  3728. fi
  3729. LLVM_CODEGEN_LIBS="x86codegen"
  3730. case "$target" in
  3731. arm*)
  3732. LLVM_CODEGEN_LIBS="armcodegen"
  3733. ;;
  3734. aarch64*)
  3735. LLVM_CODEGEN_LIBS="aarch64codegen"
  3736. ;;
  3737. powerpc*)
  3738. LLVM_CODEGEN_LIBS="powerpccodegen"
  3739. ;;
  3740. esac
  3741. if test "x$host" != "x$target"; then
  3742. # No need for jit libs
  3743. LLVM_CODEGEN_LIBS=
  3744. fi
  3745. AC_SUBST(LLVM_CODEGEN_LIBS)
  3746. AC_SUBST(EXTERNAL_LLVM_CONFIG)
  3747. if test "x$host_win32" = "xyes" && test "x$cross_compiling" = "xno" && test "x$internal_llvm" = "xno"; then
  3748. EXTERNAL_LLVM_CONFIG_WIN32=$(cygpath -m $EXTERNAL_LLVM_CONFIG)
  3749. AC_SUBST(EXTERNAL_LLVM_CONFIG_WIN32)
  3750. fi
  3751. if test "x$enable_llvm_msvc_only" != "xyes"; then
  3752. AC_DEFINE(ENABLE_LLVM, 1, [Enable the LLVM back end])
  3753. else
  3754. AC_DEFINE(ENABLE_LLVM_MSVC_ONLY, 1, [Enable the LLVM back end])
  3755. fi
  3756. fi # ENABLE_LLVM
  3757. # AC_DEFINE necessary for correct restore behavior on Linux
  3758. AM_CONDITIONAL(INTERNAL_LLVM, [test "x$internal_llvm" != "xno" && test "x$enable_llvm_msvc_only" != "xyes"])
  3759. if test "x$internal_llvm" != "xno"; then
  3760. if test "x$enable_llvm_msvc_only" != "xyes"; then
  3761. AC_DEFINE(INTERNAL_LLVM, 1, [LLVM used is being build during mono build])
  3762. else
  3763. AC_DEFINE(INTERNAL_LLVM_MSVC_ONLY, 1, [LLVM used is being build during mono build])
  3764. fi
  3765. fi
  3766. AM_CONDITIONAL(INTERNAL_LLVM_ASSERTS, [test "x$enable_llvm_asserts" != "xno" && test "x$enable_llvm_msvc_only" != "xyes"])
  3767. if test "x$enable_llvm_asserts" != "xno"; then
  3768. if test "x$enable_llvm_msvc_only" != "xyes"; then
  3769. AC_DEFINE(INTERNAL_LLVM_ASSERTS, 1, [Build LLVM with assertions])
  3770. else
  3771. AC_DEFINE(INTERNAL_LLVM_ASSERTS_MSVC_ONLY, 1, [Build LLVM with assertions])
  3772. fi
  3773. fi
  3774. AM_CONDITIONAL(ENABLE_LLVM, [test x$enable_llvm = xyes && test x$enable_llvm_msvc_only != xyes])
  3775. AM_CONDITIONAL(LOADED_LLVM, [test x$enable_loadedllvm = xyes && test x$enable_llvm_msvc_only != xyes])
  3776. if test "x$enable_loadedllvm" = "xyes"; then
  3777. if test "x$enable_llvm_msvc_only" != "xyes"; then
  3778. AC_DEFINE(MONO_LLVM_LOADED, 1, [The LLVM back end is dynamically loaded])
  3779. fi
  3780. fi
  3781. if test "x$enable_llvm" = "xyes"; then
  3782. enable_llvm_runtime=yes
  3783. fi
  3784. AM_CONDITIONAL(ENABLE_LLVM_RUNTIME, [test x$enable_llvm_runtime = xyes && test x$enable_llvm_msvc_only != xyes])
  3785. if test "x$enable_llvm_runtime" = "xyes"; then
  3786. if test "x$enable_llvm_msvc_only" != "xyes"; then
  3787. AC_DEFINE(ENABLE_LLVM_RUNTIME, 1, [Runtime support code for llvm enabled])
  3788. else
  3789. AC_DEFINE(ENABLE_LLVM_RUNTIME_MSVC_ONLY, 1, [Runtime support code for llvm enabled])
  3790. fi
  3791. fi
  3792. TARGET="unknown"
  3793. ACCESS_UNALIGNED="yes"
  3794. LIBC="libc.so.6"
  3795. INTL="libc.so.6"
  3796. SQLITE="libsqlite.so.0"
  3797. SQLITE3="libsqlite3.so.0"
  3798. ODBC="libodbc.so.2"
  3799. X11="libX11.so"
  3800. GDKX11="libgdk-x11-2.0.so.0"
  3801. GTKX11="libgtk-x11-2.0.so.0"
  3802. XINERAMA="libXinerama.so.1"
  3803. sizeof_register="SIZEOF_VOID_P"
  3804. jit_wanted=true
  3805. boehm_supported=true
  3806. BTLS_SUPPORTED=no
  3807. BTLS_PLATFORM=
  3808. case "$host" in
  3809. wasm32*)
  3810. TARGET=WASM
  3811. arch_target=wasm
  3812. BTLS_SUPPORTED=no
  3813. ACCESS_UNALIGNED="no"
  3814. with_tls=pthread
  3815. target_wasm=yes
  3816. ;;
  3817. mips*)
  3818. TARGET=MIPS;
  3819. arch_target=mips;
  3820. with_tls=pthread;
  3821. ACCESS_UNALIGNED="no"
  3822. AC_MSG_CHECKING(for mips n32)
  3823. AC_TRY_COMPILE([],[
  3824. #if _MIPS_SIM != _ABIN32
  3825. #error Not mips n32
  3826. #endif
  3827. ],[
  3828. AC_MSG_RESULT(yes)
  3829. sizeof_register=8
  3830. ],[
  3831. AC_MSG_RESULT(no)
  3832. ])
  3833. ;;
  3834. i*86-*-*)
  3835. TARGET=X86;
  3836. arch_target=x86;
  3837. case $host_os in
  3838. solaris*)
  3839. LIBC="libc.so"
  3840. INTL="libintl.so"
  3841. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  3842. TARGET=AMD64
  3843. arch_target=amd64
  3844. fi
  3845. # On solaris 10 x86, gcc prints a warning saying 'visibility attribute not supported on this configuration; ignored', but linking fails. A test case:
  3846. # int astruct __attribute__ ((visibility ("hidden")));
  3847. # void foo ()
  3848. # {
  3849. # void *p = &astruct;
  3850. # }
  3851. # gcc -fPIC --shared -o libfoo.so foo.c
  3852. # yields:
  3853. # foo.c:6: warning: visibility attribute not supported in this configuration; ignored
  3854. # ld: fatal: relocation error: R_386_GOTOFF: file /var/tmp//ccxYR96k.o: symbol astruct: relocation must bind locally
  3855. have_visibility_hidden=no
  3856. ;;
  3857. mingw*|cygwin*)
  3858. have_visibility_hidden=no
  3859. BTLS_SUPPORTED=no
  3860. BTLS_PLATFORM=i386
  3861. ;;
  3862. haiku*)
  3863. LIBC=libroot.so
  3864. ;;
  3865. linux*)
  3866. AOT_SUPPORTED="yes"
  3867. BTLS_SUPPORTED=yes
  3868. BTLS_PLATFORM=i386
  3869. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  3870. ;;
  3871. darwin*)
  3872. AOT_SUPPORTED="yes"
  3873. BTLS_SUPPORTED=yes
  3874. BTLS_PLATFORM=i386
  3875. ;;
  3876. openbsd*|freebsd*|kfreebsd-gnu*)
  3877. AOT_SUPPORTED="yes"
  3878. BTLS_SUPPORTED=yes
  3879. BTLS_PLATFORM=i386
  3880. ;;
  3881. esac
  3882. ;;
  3883. x86_64-*-* | amd64-*-*)
  3884. TARGET=AMD64;
  3885. arch_target=amd64;
  3886. if test "x$ac_cv_sizeof_void_p" = "x4"; then
  3887. AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
  3888. sizeof_register=8
  3889. fi
  3890. case $host_os in
  3891. linux*)
  3892. AOT_SUPPORTED="yes"
  3893. BTLS_SUPPORTED=yes
  3894. BTLS_PLATFORM=x86_64
  3895. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  3896. ;;
  3897. darwin*)
  3898. AOT_SUPPORTED="yes"
  3899. BTLS_SUPPORTED=yes
  3900. BTLS_PLATFORM=x86_64
  3901. boehm_supported=false
  3902. ;;
  3903. openbsd*|freebsd*|kfreebsd-gnu*)
  3904. AOT_SUPPORTED="yes"
  3905. BTLS_SUPPORTED=yes
  3906. BTLS_PLATFORM=x86_64
  3907. ;;
  3908. mingw*|cygwin*)
  3909. BTLS_SUPPORTED=no
  3910. BTLS_PLATFORM=x86_64
  3911. ;;
  3912. esac
  3913. ;;
  3914. sparc*-*-*)
  3915. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  3916. TARGET=SPARC64
  3917. else
  3918. TARGET=SPARC
  3919. fi
  3920. arch_target=sparc;
  3921. ACCESS_UNALIGNED="no"
  3922. case $host_os in
  3923. linux*) ;;
  3924. *)
  3925. LIBC="libc.so"
  3926. INTL="libintl.so"
  3927. esac
  3928. if test x"$GCC" = xyes; then
  3929. # We don't support v8 cpus
  3930. CFLAGS="$CFLAGS -Wno-cast-align -mcpu=v9"
  3931. fi
  3932. if test x"$AR" = xfalse; then
  3933. AC_MSG_ERROR([The required utility 'ar' is not found in your PATH. Usually it can be found in /usr/ccs/bin.])
  3934. fi
  3935. ;;
  3936. *-mingw*|*-*-cygwin*)
  3937. # When this is enabled, it leads to very strange crashes at runtime (gcc-3.4.4)
  3938. have_visibility_hidden=no
  3939. INTL="intl"
  3940. case "$host" in
  3941. x86_64*mingw*)
  3942. # Old Boehm fails to compile for x86_64-mingw.
  3943. # It is trivial to fix, but just silently drop it.
  3944. boehm_supported=false
  3945. ;;
  3946. esac
  3947. ;;
  3948. macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
  3949. powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | \
  3950. powerpc-*-freebsd* | powerpc*-*-aix* | powerpc*-*-os400* )
  3951. if test "x$ac_cv_sizeof_void_p" = "x8"; then
  3952. TARGET=POWERPC64;
  3953. CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
  3954. if ! (echo $CC | grep -q -- 'clang'); then
  3955. CFLAGS="$CFLAGS -mminimal-toc"
  3956. fi
  3957. else
  3958. TARGET=POWERPC;
  3959. CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
  3960. fi
  3961. arch_target=ppc;
  3962. case $host_os in
  3963. aix*|os400*)
  3964. BTLS_SUPPORTED=yes
  3965. BTLS_PLATFORM=powerpc
  3966. ;;
  3967. linux*)
  3968. BTLS_SUPPORTED=yes
  3969. BTLS_PLATFORM=powerpc
  3970. ;;
  3971. esac
  3972. ;;
  3973. armv7k-*-darwin*)
  3974. TARGET=ARM;
  3975. TARGET_SYS=WATCHOS
  3976. arch_target=arm;
  3977. arm_fpu=VFP_HARD
  3978. ACCESS_UNALIGNED="no"
  3979. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  3980. ;;
  3981. arm*-darwin*)
  3982. TARGET=ARM;
  3983. arch_target=arm;
  3984. ACCESS_UNALIGNED="no"
  3985. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  3986. ;;
  3987. arm*-linux*)
  3988. TARGET=ARM;
  3989. arch_target=arm;
  3990. ACCESS_UNALIGNED="no"
  3991. AOT_SUPPORTED="yes"
  3992. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  3993. BTLS_SUPPORTED=yes
  3994. BTLS_PLATFORM=arm
  3995. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  3996. case "$target" in
  3997. arm*-linux*-gnueabi)
  3998. BTLS_PLATFORM=armsoft
  3999. ;;
  4000. esac
  4001. ;;
  4002. arm*-netbsd*-eabi*)
  4003. TARGET=ARM;
  4004. arch_target=arm;
  4005. ACCESS_UNALIGNED="no"
  4006. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  4007. ;;
  4008. aarch64-*darwin*ilp32)
  4009. TARGET=ARM6432
  4010. arch_target=arm64
  4011. AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
  4012. sizeof_register=8
  4013. # assuming no other target other than watchOS is using aarch64*darwin triple
  4014. TARGET_SYS=WATCHOS
  4015. ;;
  4016. aarch64-*)
  4017. # https://lkml.org/lkml/2012/7/15/133
  4018. TARGET=ARM64
  4019. arch_target=arm64
  4020. boehm_supported=false
  4021. AOT_SUPPORTED="yes"
  4022. BTLS_SUPPORTED=yes
  4023. BTLS_PLATFORM=aarch64
  4024. AC_CHECK_HEADER(stdalign.h,[],[BTLS_SUPPORTED=no])
  4025. ;;
  4026. s390x-*-linux*)
  4027. TARGET=S390X;
  4028. arch_target=s390x;
  4029. ACCESS_UNALIGNED="yes"
  4030. BTLS_SUPPORTED=yes
  4031. BTLS_PLATFORM=s390x
  4032. CFLAGS="$CFLAGS -mbackchain -D__USE_STRING_INLINES"
  4033. ;;
  4034. riscv32-*)
  4035. TARGET=RISCV32
  4036. ACCESS_UNALIGNED=no
  4037. AOT_SUPPORTED=no
  4038. BTLS_SUPPORTED=yes
  4039. BTLS_PLATFORM=riscv32
  4040. arch_target=riscv32
  4041. boehm_supported=false
  4042. ;;
  4043. riscv64*)
  4044. TARGET=RISCV64
  4045. ACCESS_UNALIGNED=no
  4046. AOT_SUPPORTED=no
  4047. BTLS_SUPPORTED=yes
  4048. BTLS_PLATFORM=riscv64
  4049. arch_target=riscv64
  4050. boehm_supported=false
  4051. ;;
  4052. esac
  4053. HOST=$TARGET
  4054. if test "x$host" != "x$target"; then
  4055. AC_DEFINE(MONO_CROSS_COMPILE,1,[The runtime is compiled for cross-compiling mode])
  4056. enable_mcs_build=no
  4057. enable_support_build=no
  4058. BTLS_SUPPORTED=no
  4059. # Can't use tls, since it depends on the runtime detection of tls offsets
  4060. # in mono-compiler.h
  4061. with_tls=pthread
  4062. target_mach=no
  4063. case "$target" in
  4064. wasm32*)
  4065. TARGET=WASM
  4066. arch_target=wasm
  4067. AC_DEFINE(TARGET_WASM, 1, [Target wasm])
  4068. ;;
  4069. arm*-darwin*)
  4070. TARGET=ARM;
  4071. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  4072. case "$target" in
  4073. armv7k-*)
  4074. arm_fpu=VFP_HARD
  4075. AC_DEFINE(TARGET_WATCHOS, 1, [...])
  4076. ;;
  4077. esac
  4078. ;;
  4079. powerpc64-ps3-linux-gnu)
  4080. TARGET=POWERPC64
  4081. arch_target=powerpc64
  4082. AC_DEFINE(TARGET_PS3, 1, [...])
  4083. # It would be better to just use TARGET_POWERPC64, but lots of code already
  4084. # uses this define
  4085. AC_DEFINE(__mono_ppc64__, 1, [...])
  4086. AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
  4087. sizeof_register=8
  4088. target_byte_order=G_BIG_ENDIAN
  4089. ;;
  4090. powerpc64-xbox360-linux-gnu)
  4091. TARGET=POWERPC64
  4092. arch_target=powerpc64
  4093. AC_DEFINE(TARGET_XBOX360, 1, [...])
  4094. # It would be better to just use TARGET_POWERPC64, but lots of code already
  4095. # uses this define
  4096. sizeof_register=8
  4097. target_byte_order=G_BIG_ENDIAN
  4098. ;;
  4099. arm*-linux-*)
  4100. TARGET=ARM;
  4101. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  4102. ;;
  4103. arm*-netbsd*-eabi*)
  4104. TARGET=ARM;
  4105. CPPFLAGS="$CPPFLAGS -D__ARM_EABI__"
  4106. ;;
  4107. i686*-linux-*)
  4108. TARGET=X86;
  4109. ;;
  4110. i*86-apple-*)
  4111. TARGET=X86;
  4112. ;;
  4113. x86_64*-linux-*)
  4114. TARGET=AMD64;
  4115. ;;
  4116. x86_64-ps4-freebsd)
  4117. TARGET=AMD64;
  4118. AC_DEFINE(TARGET_PS4, 1, [...])
  4119. AC_DEFINE(DISABLE_HW_TRAPS, 1, [...])
  4120. CPPFLAGS="$CPPFLAGS"
  4121. target_win32=no
  4122. ;;
  4123. aarch64*darwin*_ilp32)
  4124. TARGET=ARM6432;
  4125. AC_DEFINE(MONO_ARCH_ILP32, 1, [64 bit mode with 4 byte longs and pointers])
  4126. sizeof_register=8
  4127. AC_DEFINE(TARGET_WATCHOS, 1, [...])
  4128. ;;
  4129. aarch64-*)
  4130. TARGET=ARM64
  4131. ;;
  4132. riscv32*)
  4133. TARGET=RISCV32
  4134. AC_DEFINE([TARGET_RISCV], [1], [Target is RISC-V])
  4135. AC_DEFINE([TARGET_RISCV32], [1], [Target is 32-bit RISC-V])
  4136. arch_target=riscv32
  4137. target_mach=no
  4138. with_tls=pthread
  4139. ;;
  4140. riscv64*)
  4141. TARGET=RISCV64
  4142. AC_DEFINE([TARGET_RISCV], [1], [Target is RISC-V])
  4143. AC_DEFINE([TARGET_RISCV64], [1], [Target is 64-bit RISC-V])
  4144. arch_target=riscv64
  4145. target_mach=no
  4146. with_tls=pthread
  4147. ;;
  4148. x86_64-google-fuchsia)
  4149. TARGET=AMD64
  4150. target_win32=nop
  4151. AC_DEFINE(HOST_FUCHSIA,1,[Targeting the Fuchsia platform])
  4152. ;;
  4153. *)
  4154. AC_MSG_ERROR([Cross compiling is not supported for target $target])
  4155. esac
  4156. case "$target" in
  4157. *-darwin*)
  4158. target_mach=yes
  4159. ;;
  4160. *-linux-android*)
  4161. AC_DEFINE(TARGET_ANDROID, 1, [...])
  4162. ;;
  4163. esac
  4164. fi
  4165. case "$TARGET" in
  4166. WASM)
  4167. AC_DEFINE(TARGET_WASM, 1, [...])
  4168. arch_target=wasm
  4169. ;;
  4170. X86)
  4171. AC_DEFINE(TARGET_X86, 1, [...])
  4172. arch_target=x86
  4173. ;;
  4174. AMD64)
  4175. AC_DEFINE(TARGET_AMD64, 1, [...])
  4176. arch_target=amd64
  4177. ;;
  4178. ARM)
  4179. AC_DEFINE(TARGET_ARM, 1, [...])
  4180. arch_target=arm
  4181. ACCESS_UNALIGNED="no"
  4182. ;;
  4183. ARM64|ARM6432)
  4184. AC_DEFINE(TARGET_ARM64, 1, [...])
  4185. arch_target=arm64
  4186. ;;
  4187. POWERPC)
  4188. AC_DEFINE(TARGET_POWERPC, 1, [...])
  4189. ;;
  4190. POWERPC64)
  4191. AC_DEFINE(TARGET_POWERPC, 1, [...])
  4192. AC_DEFINE(TARGET_POWERPC64, 1, [...])
  4193. ;;
  4194. S390X)
  4195. AC_DEFINE(TARGET_S390X, 1, [...])
  4196. ;;
  4197. MIPS)
  4198. AC_DEFINE(TARGET_MIPS, 1, [...])
  4199. ;;
  4200. SPARC)
  4201. AC_DEFINE(TARGET_SPARC, 1, [...])
  4202. ;;
  4203. SPARC64)
  4204. AC_DEFINE(TARGET_SPARC64, 1, [...])
  4205. ;;
  4206. RISCV32)
  4207. AC_DEFINE([TARGET_RISCV], [1], [Target is RISC-V])
  4208. AC_DEFINE([TARGET_RISCV32], [1], [Target is 32-bit RISC-V])
  4209. ;;
  4210. RISCV64)
  4211. AC_DEFINE([TARGET_RISCV], [1], [Target is RISC-V])
  4212. AC_DEFINE([TARGET_RISCV64], [1], [Target is 64-bit RISC-V])
  4213. ;;
  4214. esac
  4215. case "$TARGET" in
  4216. *32* | ARM | X86 | POWERPC | MIPS | SPARC | WASM | ARM6432)
  4217. target_sizeof_void_p=4
  4218. ;;
  4219. *64* | S390X)
  4220. target_sizeof_void_p=8
  4221. ;;
  4222. *)
  4223. AC_MSG_ERROR([unknown target])
  4224. ;;
  4225. esac
  4226. case "$HOST" in
  4227. WASM)
  4228. AC_DEFINE(HOST_WASM, 1, [...])
  4229. ;;
  4230. X86)
  4231. AC_DEFINE(HOST_X86, 1, [...])
  4232. ;;
  4233. AMD64)
  4234. AC_DEFINE(HOST_AMD64, 1, [...])
  4235. ;;
  4236. ARM)
  4237. AC_DEFINE(HOST_ARM, 1, [...])
  4238. ;;
  4239. ARM64)
  4240. AC_DEFINE(HOST_ARM64, 1, [...])
  4241. ;;
  4242. POWERPC)
  4243. AC_DEFINE(HOST_POWERPC, 1, [...])
  4244. ;;
  4245. POWERPC64)
  4246. AC_DEFINE(HOST_POWERPC, 1, [...])
  4247. AC_DEFINE(HOST_POWERPC64, 1, [...])
  4248. ;;
  4249. S390X)
  4250. AC_DEFINE(HOST_S390X, 1, [...])
  4251. ;;
  4252. MIPS)
  4253. AC_DEFINE(HOST_MIPS, 1, [...])
  4254. ;;
  4255. SPARC)
  4256. AC_DEFINE(HOST_SPARC, 1, [...])
  4257. ;;
  4258. SPARC64)
  4259. AC_DEFINE(HOST_SPARC64, 1, [...])
  4260. ;;
  4261. RISCV32)
  4262. AC_DEFINE([HOST_RISCV], [1], [Host is RISC-V])
  4263. AC_DEFINE([HOST_RISCV32], [1], [Host is 32-bit RISC-V])
  4264. ;;
  4265. RISCV64)
  4266. AC_DEFINE([HOST_RISCV], [1], [Host is RISC-V])
  4267. AC_DEFINE([HOST_RISCV64], [1], [Host is 64-bit RISC-V])
  4268. ;;
  4269. esac
  4270. MONO_ARCH_GSHAREDVT_SUPPORTED=0
  4271. case "$HOST" in
  4272. X86 | AMD64 | ARM | ARM64)
  4273. MONO_ARCH_GSHAREDVT_SUPPORTED=1 # keep in sync with mini-{x86,amd64,arm,arm64}.h
  4274. ;;
  4275. esac
  4276. AM_CONDITIONAL(MONO_ARCH_GSHAREDVT_SUPPORTED, test $MONO_ARCH_GSHAREDVT_SUPPORTED = 1)
  4277. AM_CONDITIONAL(TARGET_WASM, test $arch_target = wasm)
  4278. dnl *************
  4279. dnl *** VTUNE ***
  4280. dnl *************
  4281. AC_ARG_ENABLE(vtune,[ --enable-vtune Enable the VTUNE back-end], enable_vtune=$enableval, enable_vtune=no)
  4282. AC_ARG_WITH(vtune, [ --with-vtune=<vtune prefix> Enable jit vtune profiling], enable_vtune=yes,)
  4283. AM_CONDITIONAL(HAVE_VTUNE, test x$enable_vtune = xyes)
  4284. if test "x$enable_vtune" = "xyes"; then
  4285. if test "x$with_vtune" = "x"; then
  4286. VTUNE_PATH=/opt/intel/vtune_amplifier_xe
  4287. else
  4288. VTUNE_PATH=$with_vtune
  4289. fi
  4290. VTUNE_INCLUDE=$VTUNE_PATH/include
  4291. case "$TARGET" in
  4292. X86)
  4293. VTUNE_LIB=$VTUNE_PATH/lib32
  4294. ;;
  4295. AMD64)
  4296. VTUNE_LIB=$VTUNE_PATH/lib64
  4297. ;;
  4298. *)
  4299. AC_MSG_ERROR([Unsupported target $TARGET for VTUNE.])
  4300. ;;
  4301. esac
  4302. if test ! -f $VTUNE_INCLUDE/jitprofiling.h; then
  4303. AC_MSG_ERROR([VTUNE $VTUNE_INCLUDE/jitprofiling.h not found.])
  4304. fi
  4305. if test ! -f $VTUNE_LIB/libjitprofiling.a; then
  4306. AC_MSG_ERROR([VTUNE $VTUNE_LIB/libjitprofiling.a not found.])
  4307. fi
  4308. VTUNE_CFLAGS=-I$VTUNE_INCLUDE
  4309. VTUNE_LIBS="-L/$VTUNE_LIB/ -ljitprofiling"
  4310. AC_SUBST(VTUNE_LIBS)
  4311. AC_SUBST(VTUNE_CFLAGS)
  4312. fi
  4313. dnl Use GCC atomic ops if they work on the target.
  4314. if test x$GCC = "xyes"; then
  4315. case $TARGET in
  4316. X86 | AMD64 | ARM | ARM64 | ARM6432 | POWERPC | POWERPC64 | MIPS | S390X | SPARC | SPARC64 | RISCV32 | RISCV64)
  4317. AC_DEFINE(USE_GCC_ATOMIC_OPS, 1, [...])
  4318. ;;
  4319. esac
  4320. fi
  4321. if test "x$target_mach" = "xyes"; then
  4322. if test "x$TARGET_SYS" = "xWATCHOS"; then
  4323. AC_DEFINE(TARGET_WATCHOS,1,[The JIT/AOT targets WatchOS])
  4324. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
  4325. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_WATCHOS"
  4326. BTLS_SUPPORTED=no
  4327. elif test "x$TARGET" = "xARM" -o "x$TARGET" = "xARM64" -o "x$TARGET" = "xARM6432"; then
  4328. AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
  4329. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
  4330. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
  4331. BTLS_SUPPORTED=no
  4332. target_ios=yes
  4333. else
  4334. AC_TRY_COMPILE([#include "TargetConditionals.h"],[
  4335. #if TARGET_IPHONE_SIMULATOR == 1 || TARGET_OS_IPHONE == 1
  4336. #error fail this for ios
  4337. #endif
  4338. ], [
  4339. AC_DEFINE(TARGET_OSX,1,[The JIT/AOT targets OSX])
  4340. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_OSX"
  4341. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_OSX"
  4342. target_osx=yes
  4343. ], [
  4344. AC_DEFINE(TARGET_IOS,1,[The JIT/AOT targets iOS])
  4345. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DTARGET_IOS"
  4346. CFLAGS_FOR_LIBGC="$CFLAGS_FOR_LIBGC -DTARGET_IOS"
  4347. BTLS_SUPPORTED=no
  4348. target_ios=yes
  4349. ])
  4350. fi
  4351. AC_DEFINE(TARGET_MACH,1,[The JIT/AOT targets Apple platforms])
  4352. fi
  4353. AM_CONDITIONAL(TARGET_OSX, test x$target_osx = xyes)
  4354. AC_SUBST(SIZEOF_VOID_P,[$ac_cv_sizeof_void_p])
  4355. if test "x$target_byte_order" = "xG_BIG_ENDIAN"; then
  4356. AC_DEFINE(TARGET_BYTE_ORDER,G_BIG_ENDIAN,[byte order of target])
  4357. elif test "x$target_byte_order" = "xG_LITTLE_ENDIAN"; then
  4358. AC_DEFINE(TARGET_BYTE_ORDER,G_LITTLE_ENDIAN,[byte order of target])
  4359. else
  4360. AC_DEFINE(TARGET_BYTE_ORDER,G_BYTE_ORDER,[byte order of target])
  4361. fi
  4362. AC_DEFINE_UNQUOTED(TARGET_SIZEOF_VOID_P,${target_sizeof_void_p},[wordsize of target])
  4363. if test "x$sizeof_register" = "x4"; then
  4364. AC_DEFINE(SIZEOF_REGISTER,4,[size of target machine integer registers])
  4365. elif test "x$sizeof_register" = "x8"; then
  4366. AC_DEFINE(SIZEOF_REGISTER,8,[size of target machine integer registers])
  4367. else
  4368. AC_DEFINE_UNQUOTED(SIZEOF_REGISTER,${target_sizeof_void_p},[size of target machine integer registers])
  4369. fi
  4370. # zlib/configure detects visibility support similarly and defines HAVE_HIDDEN
  4371. # on the compiler command line (not config.h).
  4372. if test "x$have_visibility_hidden" = "xyes"; then
  4373. AC_DEFINE(HAVE_VISIBILITY_HIDDEN, 1, [Support for the visibility ("hidden") attribute])
  4374. ZLIB_CFLAGS="$ZLIB_CFLAGS -DHAVE_HIDDEN"
  4375. fi
  4376. if test "x$have_deprecated" = "xyes"; then
  4377. AC_DEFINE(HAVE_DEPRECATED, 1, [Support for the deprecated attribute])
  4378. fi
  4379. dnl
  4380. dnl Simple Generational checks (sgen)
  4381. dnl
  4382. SGEN_DEFINES=
  4383. AC_ARG_WITH(sgen, [ --with-sgen=yes,no Extra Generational GC, default=yes],[buildsgen=$with_sgen],[buildsgen=yes])
  4384. AC_ARG_WITH(sgen-default-concurrent, [ --with-sgen-default-concurrent=yes,no Use Concurrent GC, default=no],[],[with_sgen_default_concurrent=no])
  4385. if test x$buildsgen = xyes; then
  4386. AC_DEFINE(HAVE_MOVING_COLLECTOR, 1, [Moving collector])
  4387. SGEN_DEFINES="-DHAVE_SGEN_GC"
  4388. conc_gc_msg=""
  4389. if test x$with_sgen_default_concurrent != xno; then
  4390. AC_DEFINE(HAVE_CONC_GC_AS_DEFAULT, 1, [Defaults to concurrent GC])
  4391. conc_gc_msg=" (concurrent by default)"
  4392. fi
  4393. if test "x$gc_msg" = "x"; then
  4394. gc_msg="sgen$conc_gc_msg"
  4395. else
  4396. gc_msg="sgen$conc_gc_msg and $gc_msg"
  4397. fi
  4398. fi
  4399. AC_SUBST(SGEN_DEFINES)
  4400. AM_CONDITIONAL(SUPPORT_SGEN, test x$buildsgen = xyes)
  4401. jit_status="Building and using the JIT"
  4402. libsuffix=".so"
  4403. case "$host" in
  4404. *-*-aix*)
  4405. dnl on AIX/PASE, shared libraries can be and usually are inside archives
  4406. dnl so, we specify them by libfoo.a(libfoo.so.0) for libtool's conventions,
  4407. dnl or libfoo.a(shr[_64].o) for the AIX system convention,
  4408. dnl or lib.so[.0](shr[_64].o) for libtool's hybrid convention
  4409. dnl we may hardcode 64-bit names at times, but we don't do 32-bit AIX
  4410. LIBC="libc.a(shr_64.o)"
  4411. # Thanks, I hate it! This is crumbly, especially the one-liner.
  4412. AC_MSG_CHECKING([how to dlopen libintl])
  4413. AC_LINK_IFELSE([AC_LANG_SOURCE([
  4414. /* XXX: Check for libintl header/gettext func better? */
  4415. #include <libintl.h>
  4416. int main (void) {
  4417. gettext("Dummy for autoconf");
  4418. return 1;
  4419. }
  4420. ])],
  4421. [
  4422. INTL="$(dump -X64 -Hp conftest$EXEEXT | grep libintl | cut -c 38- | tr -s " " | awk '{print $1"("$2")"}')"
  4423. AC_MSG_RESULT([yes, $INTL])
  4424. ],
  4425. [
  4426. INTL="libintl.a(libintl.so.8)"
  4427. AC_MSG_RESULT([no, falling back to $INTL])
  4428. ])
  4429. SQLITE3="libsqlite3.a(libsqlite3.so.0)"
  4430. # it's very tempting to set a libsuffix, but it depends on the soname value
  4431. ;;
  4432. *-*-os400*)
  4433. dnl However, IBM's packages for i try to be more "normal" than the AIX world, naming wise.
  4434. dnl The library archives has "normal" .so names, but they're members with predictable "shr" names for fat libraries.
  4435. LIBC="libc.a(shr_64.o)"
  4436. INTL="libintl.so(shr_64.o)"
  4437. SQLITE3="libsqlite3.so(shr_64.o)"
  4438. # likewise, it's safer to assume ".so(shr_64.o)" due to official IBM packages being built this way, but as with AIX, others may not be guaranteed
  4439. # it may be worth revisiting this in the future
  4440. ;;
  4441. *-*-darwin*)
  4442. libsuffix=".dylib"
  4443. LIBC="libc.dylib"
  4444. INTL="libintl.dylib"
  4445. SQLITE="libsqlite.0.dylib"
  4446. SQLITE3="libsqlite3.0.dylib"
  4447. X11="libX11.dylib"
  4448. GDKX11="libgdk-x11-2.0.dylib"
  4449. GTKX11="libgtk-x11-2.0.dylib"
  4450. ;;
  4451. *-*-*netbsd*)
  4452. LIBC="libc.so"
  4453. INTL="libintl.so"
  4454. SQLITE="libsqlite.so"
  4455. SQLITE3="libsqlite3.so"
  4456. ;;
  4457. *-*-kfreebsd*-gnu)
  4458. LIBC="libc.so.0.1"
  4459. INTL="libc.so.0.1"
  4460. X11="libX11.so.6"
  4461. ;;
  4462. *-*-*freebsd*)
  4463. LIBC="libc.so.7"
  4464. INTL="libintl.so"
  4465. SQLITE="libsqlite.so"
  4466. SQLITE3="libsqlite3.so"
  4467. ;;
  4468. *-*-*openbsd*)
  4469. LIBC="libc.so"
  4470. INTL="libintl.so"
  4471. SQLITE="libsqlite.so"
  4472. SQLITE3="libsqlite3.so"
  4473. ;;
  4474. *-*-*linux*)
  4475. AC_PATH_X
  4476. dlsearch_path=`(libtool --config ; echo eval echo \\$sys_lib_dlsearch_path_spec) | sh`
  4477. AC_MSG_CHECKING(for the soname of libX11.so)
  4478. for i in $x_libraries $dlsearch_path; do
  4479. for r in 4 5 6; do
  4480. if test -f $i/libX11.so.$r; then
  4481. X11=libX11.so.$r
  4482. AC_MSG_RESULT($X11)
  4483. fi
  4484. done
  4485. done
  4486. if test "x$X11" = "xlibX11.so"; then
  4487. AC_MSG_WARN([Could not find libX11.so. Do you have X.org or XFree86 installed? Assuming libX11.so.6...]);
  4488. X11=libX11.so.6
  4489. fi
  4490. ;;
  4491. esac
  4492. AC_SUBST(libsuffix)
  4493. ######################################
  4494. # EGLIB CHECKS
  4495. ######################################
  4496. GNUC_PRETTY=
  4497. GNUC_UNUSED=
  4498. BREAKPOINT="G_STMT_START { raise (SIGTRAP); } G_STMT_END"
  4499. if test x$GCC = xyes; then
  4500. GNUC_UNUSED='__attribute__((__unused__))'
  4501. GNUC_NORETURN='__attribute__((__noreturn__))'
  4502. case $host_cpu in
  4503. i*86|x86_64) BREAKPOINT="G_STMT_START { __asm__ (\"int \$03\"); } G_STMT_END" ;;
  4504. esac
  4505. fi
  4506. AC_SUBST(GNUC_PRETTY)
  4507. AC_SUBST(GNUC_UNUSED)
  4508. AC_SUBST(GNUC_NORETURN)
  4509. AC_SUBST(BREAKPOINT)
  4510. AC_C_BIGENDIAN([ORDER=G_BIG_ENDIAN],[ORDER=G_LITTLE_ENDIAN])
  4511. case $host in
  4512. *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*)
  4513. PATHSEP='\\'
  4514. SEARCHSEP=';'
  4515. OS="WIN32"
  4516. PIDTYPE='void *'
  4517. ;;
  4518. *)
  4519. PATHSEP='/'
  4520. SEARCHSEP=':'
  4521. OS="UNIX"
  4522. PIDTYPE='int'
  4523. ;;
  4524. esac
  4525. case $host in
  4526. *-*-solaris*)
  4527. CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS"
  4528. ;;
  4529. esac
  4530. case $target in
  4531. arm*-darwin*|aarch64*-*|riscv*)
  4532. CFLAGS="$CFLAGS -U_FORTIFY_SOURCE"
  4533. ;;
  4534. i*86-*-darwin*)
  4535. ORDER=G_LITTLE_ENDIAN
  4536. ;;
  4537. *-*-haiku*)
  4538. LDFLAGS="$LDFLAGS -ltextencoding"
  4539. ;;
  4540. *-*-openbsd*)
  4541. CFLAGS="$CFLAGS -pthread"
  4542. LDFLAGS="$LDFLAGS -pthread"
  4543. ;;
  4544. esac
  4545. AC_SUBST(ORDER)
  4546. AC_SUBST(PATHSEP)
  4547. AC_SUBST(SEARCHSEP)
  4548. AC_SUBST(OS)
  4549. AC_SUBST(PIDTYPE)
  4550. # Defined for all targets/platforms using classic Windows API support.
  4551. AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
  4552. AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
  4553. AC_CHECK_FUNCS(strlcpy stpcpy strtok_r rewinddir vasprintf)
  4554. AC_CHECK_FUNCS(getrlimit)
  4555. AC_CHECK_FUNCS(fork execv execve)
  4556. AC_CHECK_FUNCS(waitpid)
  4557. AC_ARG_WITH([overridable-allocators], [ --with-overridable-allocators allow g_*alloc/g_free to call custom allocators set via g_mem_set_vtable])
  4558. if test x$with_overridable_allocators = xyes; then
  4559. AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
  4560. AC_MSG_NOTICE([Overridable allocator support enabled])
  4561. else
  4562. AC_MSG_NOTICE([Overridable allocator support disabled])
  4563. fi
  4564. #
  4565. # Mono currently supports 10.6, but strndup is not available prior to 10.7; avoiding
  4566. # the detection of strndup on OS X so Mono built on 10.7+ still runs on 10.6. This can be
  4567. # removed once support for 10.6 is dropped.
  4568. #
  4569. # iOS detection of strndup and getpwuid_r is faulty for some reason so let's simply avoid it
  4570. #
  4571. if test x$target_osx = xyes; then
  4572. AC_CHECK_FUNCS(getpwuid_r)
  4573. elif test x$target_ios = xno; then
  4574. AC_CHECK_FUNCS(strndup getpwuid_r)
  4575. fi
  4576. AC_SEARCH_LIBS(sqrtf, m)
  4577. # nanosleep may not be part of libc, also search it in other libraries
  4578. AC_SEARCH_LIBS(nanosleep, rt)
  4579. AC_SEARCH_LIBS(dlopen, dl)
  4580. # AIX/OS400 -bsymbolic
  4581. # Apple -bind_at_load
  4582. # The rest GNU.
  4583. #
  4584. AX_APPEND_LINK_FLAGS([-Wl,--export-dynamic -Wl,-Bsymbolic -bsymbolic -Wl,-z,now -Wl,-bind_at_load])
  4585. AC_CHECK_HEADERS(getopt.h sys/select.h sys/time.h sys/wait.h pwd.h iconv.h sys/types.h sys/resource.h)
  4586. dnl giconv.c will check on HAVE_ICONV_H but we need this for link time
  4587. AC_CHECK_LIB(iconv, iconv_open)
  4588. AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
  4589. AC_SUBST(HAVE_ALLOCA_H)
  4590. # Get the exact type of size_t, not just its size.
  4591. # This is so we can find an exact printf format among u, lu, llu, I64u.
  4592. # To avoid warnings about slight mismatches.
  4593. # C99 runtime "zu" dependency is being avoided here.
  4594. #
  4595. # We have to compile as C++ because C is too lenient
  4596. # and lets the wrong thing compile, with warnings.
  4597. #
  4598. # Note: "zu" or ifdef <something> have the advantage
  4599. # of producing installable "biarch" headers. i.e. one Mac header
  4600. # for Mac/x86 and Mac/amd64.
  4601. AC_LANG_PUSH(C++)
  4602. # Check long before int because it is the overwhelming Unix answer,
  4603. # across 32bit and 64bit systems -- fewer compiler invocations in autoconf.
  4604. #
  4605. # long ahead of int also tends to produce biarch-compatible headers except Windows.
  4606. #
  4607. AC_MSG_CHECKING(if size_t is unsigned long)
  4608. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  4609. #include <stddef.h>
  4610. unsigned long *a = (size_t*)0;
  4611. ])], [
  4612. AC_MSG_RESULT(yes)
  4613. AC_SUBST(GSIZE_FORMAT, '"lu"')
  4614. ], [
  4615. AC_MSG_RESULT(no)
  4616. AC_MSG_CHECKING(if size_t is unsigned int)
  4617. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  4618. #include <stddef.h>
  4619. unsigned *a = (size_t*)0;
  4620. ])], [
  4621. AC_MSG_RESULT(yes)
  4622. AC_SUBST(GSIZE_FORMAT, '"u"')
  4623. ], [
  4624. # At this point the majority of systems have their answer,
  4625. # and we descend into non-standard or new-standard territory.
  4626. #
  4627. # Check __int64 first because I64 on some systems predates ll, enabling
  4628. # new compiler/old runtime interop, and the types always have the same size.
  4629. AC_MSG_RESULT(no)
  4630. AC_MSG_CHECKING(if size_t is unsigned __int64)
  4631. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  4632. #include <stddef.h>
  4633. unsigned __int64 *a = (size_t*)0;
  4634. ])], [
  4635. AC_MSG_RESULT(yes)
  4636. AC_SUBST(GSIZE_FORMAT, '"I64u"')
  4637. ], [
  4638. AC_MSG_RESULT(no)
  4639. AC_MSG_CHECKING(if size_t is unsigned long long)
  4640. AC_COMPILE_IFELSE([AC_LANG_SOURCE([
  4641. #include <stddef.h>
  4642. unsigned long long *a = (size_t*)0;
  4643. ])], [
  4644. AC_MSG_RESULT(yes)
  4645. AC_SUBST(GSIZE_FORMAT, '"llu"')
  4646. ], [
  4647. AC_MSG_RESULT(no)
  4648. AC_MSG_ERROR(Unable to determine size_t among unsigned long, int, __int64, long long)
  4649. ] )
  4650. ] )
  4651. ] )
  4652. ] )
  4653. AC_LANG_POP
  4654. # If size_t/ptrdiff_t is correct, use it. Otherwise C99 [u]intptr_t.
  4655. # This provides for an exact match with functions that
  4656. # take size_t like malloc and pthread_attr_getstacksize, avoiding warnings.
  4657. # uintptr_t is not necessarily the same.
  4658. #
  4659. # ptrdiff_t is preferred over ssize_t as it is C89 vs. new Posix.
  4660. # ssize_t looks nicer but ptrdiff_t is wrapped up as gssize anyway.
  4661. if test $ac_cv_sizeof_void_p = $ac_cv_sizeof_size_t; then
  4662. GSIZE="size_t"
  4663. GSSIZE="ptrdiff_t"
  4664. else
  4665. GSIZE="uintptr_t"
  4666. GSSIZE="intptr_t"
  4667. fi
  4668. AC_SUBST(GSIZE)
  4669. AC_SUBST(GSSIZE)
  4670. AC_SUBST(GSIZE_FORMAT)
  4671. #
  4672. # END OF EGLIB CHECKS
  4673. #
  4674. AC_ARG_WITH([libgdiplus],
  4675. [ --with-libgdiplus=installed|sibling|<path> Override the libgdiplus used for System.Drawing tests (defaults to installed)],
  4676. [], [with_libgdiplus=installed])
  4677. # default install location
  4678. libgdiplus_install_loc=libgdiplus${libsuffix}
  4679. case "$host" in
  4680. *-*-*linux*)
  4681. libgdiplus_install_loc=libgdiplus${libsuffix}.0
  4682. ;;
  4683. esac
  4684. case $with_libgdiplus in
  4685. no)
  4686. libgdiplus_loc=
  4687. ;;
  4688. installed)
  4689. libgdiplus_loc=
  4690. if test x$cross_compiling = xno; then
  4691. if test x$host_darwin = xyes; then
  4692. a=/Library/Frameworks/Mono.framework/Versions/Current/lib/$libgdiplus_install_loc
  4693. if test -x $a; then
  4694. libgdiplus_install_loc=$a
  4695. libgdiplus_loc=$a
  4696. fi
  4697. fi
  4698. fi
  4699. ;;
  4700. yes|sibling)
  4701. libgdiplus_loc=`cd ../libgdiplus && pwd`/src/libgdiplus.la
  4702. ;;
  4703. /*) # absolute path, assume it is an install location
  4704. libgdiplus_loc=$with_libgdiplus
  4705. libgdiplus_install_loc=$with_libgdiplus
  4706. ;;
  4707. *)
  4708. libgdiplus_loc=`pwd`/$with_libgdiplus
  4709. ;;
  4710. esac
  4711. AC_SUBST(libgdiplus_loc)
  4712. AC_SUBST(libgdiplus_install_loc)
  4713. 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)
  4714. if test "x$icall_symbol_map" = "xyes"; then
  4715. AC_DEFINE(ENABLE_ICALL_SYMBOL_MAP, 1, [Icall symbol map enabled])
  4716. fi
  4717. AC_ARG_ENABLE(icall-export,[ --enable-icall-export Export icall functions], icall_export=$enableval, icall_export=no)
  4718. if test "x$icall_export" = "xyes"; then
  4719. AC_DEFINE(ENABLE_ICALL_EXPORT, 1, [Icall export enabled])
  4720. fi
  4721. AC_ARG_ENABLE(icall-tables,[ --disable-icall-tables Disable the runtime lookup of icalls], icall_tables=$enableval, icall_tables=yes)
  4722. if test "x$icall_tables" = "xno"; then
  4723. AC_DEFINE(DISABLE_ICALL_TABLES, 1, [Icall tables disabled])
  4724. fi
  4725. AM_CONDITIONAL(DISABLE_ICALL_TABLES, test x$icall_tables = xno)
  4726. if test "x$with_tls" = "x__thread"; then
  4727. AC_DEFINE(MONO_KEYWORD_THREAD, __thread, [Have __thread keyword])
  4728. # Pass the information to libgc
  4729. CPPFLAGS="$CPPFLAGS -DUSE_COMPILER_TLS"
  4730. AC_MSG_CHECKING(if the tls_model attribute is supported)
  4731. AC_TRY_COMPILE([static __thread int foo __attribute__((tls_model("initial-exec")));], [
  4732. ], [
  4733. AC_MSG_RESULT(yes)
  4734. AC_DEFINE(HAVE_TLS_MODEL_ATTR, 1, [tls_model available])
  4735. ], [
  4736. AC_MSG_RESULT(no)
  4737. ])
  4738. fi
  4739. if test ${TARGET} = ARM; then
  4740. dnl ******************************************
  4741. dnl *** Check to see what FPU is available ***
  4742. dnl ******************************************
  4743. AC_MSG_CHECKING(which FPU to use)
  4744. #
  4745. # This is a bit tricky:
  4746. #
  4747. # if (__ARM_PCS_VFP) {
  4748. # /* mfloat-abi=hard == VFP with hard ABI */
  4749. # } elif (!__SOFTFP__) {
  4750. # /* mfloat-abi=softfp == VFP with soft ABI */
  4751. # } else {
  4752. # /* mfloat-abi=soft == no VFP */
  4753. # }
  4754. #
  4755. # The exception is iOS (w/ GCC) where none of the above
  4756. # are defined (but iOS always uses the 'softfp' ABI).
  4757. #
  4758. # No support for FPA.
  4759. #
  4760. fpu=NONE
  4761. # iOS GCC always uses the 'softfp' ABI.
  4762. if test x"$GCC" = xyes && test x$host_darwin = xyes; then
  4763. fpu=VFP
  4764. fi
  4765. # Are we using the 'hard' ABI?
  4766. if test x$fpu = xNONE; then
  4767. AC_TRY_COMPILE([], [
  4768. #ifndef __ARM_PCS_VFP
  4769. #error "Float ABI is not 'hard'"
  4770. #endif
  4771. ], [
  4772. fpu=VFP_HARD
  4773. ], [
  4774. fpu=NONE
  4775. ])
  4776. fi
  4777. # No 'hard' ABI. 'soft' or 'softfp'?
  4778. if test x$fpu = xNONE; then
  4779. AC_TRY_COMPILE([], [
  4780. #ifdef __SOFTFP__
  4781. #error "Float ABI is not 'softfp'"
  4782. #endif
  4783. ], [
  4784. fpu=VFP
  4785. ], [
  4786. fpu=NONE
  4787. ])
  4788. fi
  4789. if test x$arm_fpu != x; then
  4790. fpu=$arm_fpu
  4791. fi
  4792. AC_MSG_RESULT($fpu)
  4793. CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
  4794. unset fpu
  4795. dnl *********************************************
  4796. dnl *** Check which ARM version(s) we can use ***
  4797. dnl *********************************************
  4798. AC_MSG_CHECKING(which ARM version to use)
  4799. AC_TRY_COMPILE([], [
  4800. #if !defined(__ARM_ARCH_5T__) && !defined(__ARM_ARCH_5TE__) && !defined(__ARM_ARCH_5TEJ__)
  4801. #error Not on ARM v5.
  4802. #endif
  4803. ], [
  4804. arm_v5=yes
  4805. arm_ver=ARMv5
  4806. ], [])
  4807. AC_TRY_COMPILE([], [
  4808. #if !defined(__ARM_ARCH_6J__) && !defined(__ARM_ARCH_6ZK__) && !defined(__ARM_ARCH_6K__) && !defined(__ARM_ARCH_6T2__) && !defined(__ARM_ARCH_6M__)
  4809. #error Not on ARM v6.
  4810. #endif
  4811. ], [
  4812. arm_v5=yes
  4813. arm_v6=yes
  4814. arm_ver=ARMv6
  4815. ], [])
  4816. AC_TRY_COMPILE([], [
  4817. #if !defined(__ARM_ARCH_7A__) && !defined(__ARM_ARCH_7R__) && !defined(__ARM_ARCH_7EM__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7S__)
  4818. #error Not on ARM v7.
  4819. #endif
  4820. ], [
  4821. arm_v5=yes
  4822. arm_v6=yes
  4823. arm_v7=yes
  4824. arm_ver=ARMv7
  4825. ], [])
  4826. AC_MSG_RESULT($arm_ver)
  4827. if test x$arm_v5 = xyes; then
  4828. AC_DEFINE(HAVE_ARMV5, 1, [ARM v5])
  4829. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV5=1"
  4830. fi
  4831. if test x$arm_v6 = xyes; then
  4832. AC_DEFINE(HAVE_ARMV6, 1, [ARM v6])
  4833. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV6=1"
  4834. fi
  4835. if test x$arm_v7 = xyes; then
  4836. AC_DEFINE(HAVE_ARMV7, 1, [ARM v7])
  4837. CPPFLAGS_FOR_LIBGC="$CPPFLAGS_FOR_LIBGC -DHAVE_ARMV7=1"
  4838. fi
  4839. if test x$host_linux = xyes; then
  4840. RID="linux-arm"
  4841. COREARCH="arm"
  4842. if test x$fpu = xNONE; then
  4843. RID="linux-armel"
  4844. COREARCH="armel"
  4845. fi
  4846. fi
  4847. fi
  4848. AC_SUBST(RID)
  4849. AC_SUBST(COREARCH)
  4850. AC_SUBST(CORETARGETS)
  4851. if test ${TARGET} = RISCV32 -o ${TARGET} = RISCV64; then
  4852. AC_ARG_WITH([riscv-fpabi], [ --with-riscv-fpabi=auto,double,soft Select RISC-V floating point ABI (auto)], [fpabi=$withval], [fpabi=double])
  4853. AC_MSG_CHECKING([which RISC-V floating point ABI to use])
  4854. if test x$fpabi = xauto; then
  4855. AC_TRY_COMPILE([], [
  4856. #ifdef __riscv_float_abi_double
  4857. #error "double"
  4858. #endif
  4859. ], [
  4860. fpabi=auto
  4861. ], [
  4862. fpabi=double
  4863. ])
  4864. fi
  4865. if test x$fpabi = xauto; then
  4866. AC_TRY_COMPILE([], [
  4867. #ifdef __riscv_float_abi_single
  4868. #error "single"
  4869. #endif
  4870. ], [
  4871. fpabi=auto
  4872. ], [
  4873. fpabi=single
  4874. ])
  4875. fi
  4876. if test x$fpabi = xauto; then
  4877. AC_TRY_COMPILE([], [
  4878. #ifdef __riscv_float_abi_soft
  4879. #error "soft"
  4880. #endif
  4881. ], [
  4882. fpabi=auto
  4883. ], [
  4884. fpabi=soft
  4885. ])
  4886. fi
  4887. case $fpabi in
  4888. double)
  4889. AC_DEFINE([RISCV_FPABI_DOUBLE], [1], [RISC-V FPABI is double-precision])
  4890. AC_MSG_RESULT([double-precision])
  4891. ;;
  4892. single)
  4893. AC_DEFINE([RISCV_FPABI_SINGLE], [1], [RISC-V FPABI is single-precision])
  4894. AC_MSG_ERROR([single-precision, not supported])
  4895. ;;
  4896. soft)
  4897. AC_DEFINE([RISCV_FPABI_SOFT], [1], [RISC-V FPABI is soft float])
  4898. AC_MSG_RESULT([soft float])
  4899. ;;
  4900. auto)
  4901. AC_MSG_ERROR([unknown])
  4902. ;;
  4903. *)
  4904. AC_MSG_ERROR([invalid option: $fpabi])
  4905. ;;
  4906. esac
  4907. fi
  4908. if test ${TARGET} = unknown; then
  4909. CPPFLAGS="$CPPFLAGS -DNO_PORT"
  4910. AC_MSG_WARN("mono has not been ported to $host: some things may not work.")
  4911. fi
  4912. if test "x$platform_android" = "xyes"; then
  4913. case "x${TARGET}" in
  4914. xARM)
  4915. case "x$arm_ver" in
  4916. xARMv5)
  4917. BTLS_SUPPORTED=yes
  4918. BTLS_PLATFORM=android-armv5
  4919. ;;
  4920. xARMv6)
  4921. BTLS_SUPPORTED=yes
  4922. BTLS_PLATFORM=android-armv6
  4923. ;;
  4924. xARMv7)
  4925. BTLS_SUPPORTED=yes
  4926. BTLS_PLATFORM=android-armv7
  4927. ;;
  4928. *)
  4929. BTLS_SUPPORTED=no
  4930. ;;
  4931. esac
  4932. ;;
  4933. xARM64)
  4934. BTLS_SUPPORTED=yes
  4935. BTLS_PLATFORM=android-v8a
  4936. ;;
  4937. xX86)
  4938. BTLS_SUPPORTED=yes
  4939. BTLS_PLATFORM=android-x86
  4940. ;;
  4941. xAMD64)
  4942. BTLS_SUPPORTED=yes
  4943. BTLS_PLATFORM=android-x64
  4944. ;;
  4945. *)
  4946. BTLS_SUPPORTED=no
  4947. ;;
  4948. esac
  4949. fi
  4950. if test ${ACCESS_UNALIGNED} = no; then
  4951. CPPFLAGS="$CPPFLAGS -DNO_UNALIGNED_ACCESS"
  4952. fi
  4953. if test x$host_darwin = xyes; then
  4954. AC_MSG_CHECKING([for ranlib that supports -no_warning_for_no_symbols option])
  4955. AS_IF(
  4956. [$RANLIB -no_warning_for_no_symbols 2>&1 | grep -q "unknown option"],
  4957. [AC_MSG_RESULT([no])],
  4958. [
  4959. # avoid AR calling ranlib, libtool calls it anyway. suppress no symbols warning.
  4960. AR_FLAGS="Scru"
  4961. RANLIB="$RANLIB -no_warning_for_no_symbols"
  4962. AC_MSG_RESULT([yes])
  4963. ]
  4964. )
  4965. fi
  4966. case "x$libgc" in
  4967. xincluded)
  4968. # Pass CPPFLAGS to libgc configure
  4969. # We should use a separate variable for this to avoid passing useless and
  4970. # potentially problematic defines to libgc (like -D_FILE_OFFSET_BITS=64)
  4971. # This should be executed late so we pick up the final version of CPPFLAGS
  4972. # The problem with this approach, is that during a reconfigure, the main
  4973. # configure scripts gets invoked with these arguments, so we use separate
  4974. # variables understood by libgc's configure to pass CPPFLAGS and CFLAGS.
  4975. TMP_CPPFLAGS="$CPPFLAGS $CPPFLAGS_FOR_LIBGC"
  4976. if test x$TARGET = xSPARC -o x$TARGET = xSPARC64; then
  4977. TMP_CPPFLAGS=`echo $TMP_CPPFLAGS | sed -e 's/-D_FILE_OFFSET_BITS=64//g'`
  4978. fi
  4979. # Don't pass -finstrument-for-thread-suspension in,
  4980. # if these are instrumented it will be very bad news
  4981. # (infinite recursion, undefined parking behavior, etc)
  4982. TMP_CPPFLAGS=`echo $TMP_CPPFLAGS | sed -e 's/-finstrument-for-thread-suspension//g'`
  4983. 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\""
  4984. if test "x$support_boehm" = "xyes"; then
  4985. AC_CONFIG_SUBDIRS(libgc)
  4986. fi
  4987. ;;
  4988. esac
  4989. MALLOC_MEMPOOLS=no
  4990. AC_ARG_WITH(malloc_mempools,[ --with-malloc-mempools=yes,no Use malloc for each single mempool allocation (only for runtime debugging, defaults to no)],[
  4991. if test x$with_malloc_mempools = xyes; then
  4992. MALLOC_MEMPOOLS=yes
  4993. AC_DEFINE(USE_MALLOC_FOR_MEMPOOLS,1,[Use malloc for each single mempool allocation])
  4994. fi
  4995. ])
  4996. DISABLE_MCS_DOCS=default
  4997. AC_ARG_WITH(mcs_docs,[ --with-mcs-docs=yes,no If you want to build the documentation under mcs (defaults to yes)],[
  4998. if test x$with_mcs_docs != xyes; then
  4999. DISABLE_MCS_DOCS=yes
  5000. fi
  5001. ])
  5002. if test -n "$INSTALL_4_x_TRUE"; then :
  5003. DISABLE_MCS_DOCS=yes
  5004. fi
  5005. if test "x$DISABLE_MCS_DOCS" = "xdefault"; then
  5006. DISABLE_MCS_DOCS=$DISABLE_MCS_DOCS_default
  5007. fi
  5008. 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)],[
  5009. if test x$with_lazy_gc_thread_creation != xno ; then
  5010. AC_DEFINE(LAZY_GC_THREAD_CREATION,1,[Enable lazy gc thread creation by the embedding host.])
  5011. fi
  5012. ], [with_lazy_gc_thread_creation=no])
  5013. dnl *****************************
  5014. dnl *** Thread suspend policy ***
  5015. dnl *****************************
  5016. dnl Set a default hybrid or cooperative suspend on some platforms
  5017. dnl Coop default is set by the bitcode preset.
  5018. dnl If coop isn't on by default, maybe hybrid should be?
  5019. if test x$enable_cooperative_suspend_default != xyes; then
  5020. case $HOST in
  5021. X86 | AMD64)
  5022. dnl Some host/target confusion, there's no host_osx (and
  5023. dnl host_darwin would be true on iOS not just macOS).
  5024. if test x$target_osx = xyes; then
  5025. enable_hybrid_suspend_default=yes
  5026. elif test x$host_linux = xyes -o x$host_win32 = xyes; then
  5027. enable_hybrid_suspend_default=yes
  5028. fi
  5029. ;;
  5030. esac
  5031. fi
  5032. dnl Now check if there were flags overriding the defaults
  5033. AC_ARG_WITH(cooperative_gc, [ --with-cooperative-gc=yes|no Enable cooperative stop-the-world garbage collection (sgen only) (defaults to no)], [AC_MSG_WARN([--with-cooperative-gc is deprecated, use --enable-cooperative-suspend instead])], [with_cooperative_gc=default])
  5034. AC_ARG_ENABLE(cooperative_suspend, [ --enable-cooperative-suspend Enable cooperative stop-the-world garbage collection (sgen only) (defaults to no)], [], [enable_cooperative_suspend=default])
  5035. if test x$enable_cooperative_suspend = xdefault -a x$with_cooperative_gc != xdefault; then
  5036. enable_cooperative_suspend=$with_cooperative_gc
  5037. fi
  5038. if test x$enable_cooperative_suspend = xdefault; then
  5039. enable_cooperative_suspend=$enable_cooperative_suspend_default
  5040. fi
  5041. if test x$enable_cooperative_suspend != xno; then
  5042. AC_DEFINE(ENABLE_COOP_SUSPEND,1,[Enable cooperative stop-the-world garbage collection.])
  5043. fi
  5044. AM_CONDITIONAL([ENABLE_COOP_SUSPEND], [test x$enable_cooperative_suspend != xno])
  5045. AC_ARG_ENABLE(hybrid_suspend, [ --enable-hybrid-suspend Enable hybrid stop-the-world garbage collection (sgen only) - cooperative suspend for threads running managed and runtime code, and preemptive suspend for threads running native and P/Invoke code (defaults to no)], [], [enable_hybrid_suspend=default])
  5046. if test x$enable_hybrid_suspend = xdefault; then
  5047. enable_hybrid_suspend=$enable_hybrid_suspend_default
  5048. fi
  5049. if test x$enable_hybrid_suspend != xno -a x$enable_cooperative_suspend != xno ; then
  5050. AC_MSG_ERROR([Hybrid suspend and Cooperative suspend cannot be both enabled.])
  5051. fi
  5052. if test x$enable_hybrid_suspend != xno ; then
  5053. AC_DEFINE(ENABLE_HYBRID_SUSPEND,1,[Enable hybrid suspend for GC stop-the-world])
  5054. fi
  5055. AM_CONDITIONAL([ENABLE_HYBRID_SUSPEND], [test x$enable_hybrid_suspend != xno])
  5056. dnl End of thread suspend policy
  5057. dnl ***************************
  5058. dnl *** feature experiments ***
  5059. dnl ***************************
  5060. dnl When adding experiments, also add to mono/utils/mono-experiments.def
  5061. AC_ARG_ENABLE(experiment, [ --enable-experiment=LIST Enable experimental fatures from the comma-separate LIST. Available experiments: null],[
  5062. if test x$enable_experiment != x ; then
  5063. AC_DEFINE(ENABLE_EXPERIMENTS,1,[Enable feature experiments])
  5064. fi
  5065. for feature in `echo "$enable_experiment" | sed -e "s/,/ /g"`; do
  5066. eval "mono_experiment_test_enable_$feature='yes'"
  5067. done
  5068. if test "x$mono_experiment_test_enable_all" = "xyes"; then
  5069. eval "mono_experiment_test_enable_null='yes'"
  5070. true
  5071. fi
  5072. if test "x$mono_experiment_test_enable_null" = "xyes"; then
  5073. AC_DEFINE(ENABLE_EXPERIMENT_null, 1, [Enable experiment 'null'])
  5074. fi
  5075. ],[])
  5076. dnl **********************
  5077. dnl *** checked builds ***
  5078. dnl **********************
  5079. 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, private_types, crash_reporting],[
  5080. if test x$enable_checked_build != x ; then
  5081. AC_DEFINE(ENABLE_CHECKED_BUILD,1,[Enable checked build])
  5082. fi
  5083. for feature in `echo "$enable_checked_build" | sed -e "s/,/ /g"`; do
  5084. eval "mono_checked_build_test_enable_$feature='yes'"
  5085. done
  5086. if test "x$mono_checked_build_test_enable_all" = "xyes"; then
  5087. eval "mono_checked_build_test_enable_gc='yes'"
  5088. eval "mono_checked_build_test_enable_metadata='yes'"
  5089. eval "mono_checked_build_test_enable_thread='yes'"
  5090. eval "mono_checked_build_test_enable_private_types='yes'"
  5091. eval "mono_checked_build_test_enable_crash_reporting='yes'"
  5092. fi
  5093. if test "x$mono_checked_build_test_enable_gc" = "xyes"; then
  5094. AC_DEFINE(ENABLE_CHECKED_BUILD_GC, 1, [Enable GC checked build])
  5095. fi
  5096. if test "x$mono_checked_build_test_enable_metadata" = "xyes"; then
  5097. AC_DEFINE(ENABLE_CHECKED_BUILD_METADATA, 1, [Enable metadata checked build])
  5098. fi
  5099. if test "x$mono_checked_build_test_enable_thread" = "xyes"; then
  5100. AC_DEFINE(ENABLE_CHECKED_BUILD_THREAD, 1, [Enable thread checked build])
  5101. fi
  5102. if test "x$mono_checked_build_test_enable_private_types" = "xyes"; then
  5103. AC_DEFINE(ENABLE_CHECKED_BUILD_PRIVATE_TYPES, 1, [Enable private types checked build])
  5104. fi
  5105. if test "x$mono_checked_build_test_enable_crash_reporting" = "xyes"; then
  5106. # Required
  5107. with_overridable_allocators=yes
  5108. AC_DEFINE(ENABLE_OVERRIDABLE_ALLOCATORS,1,[Overridable allocator support enabled])
  5109. AC_DEFINE(ENABLE_CHECKED_BUILD_CRASH_REPORTING, 1, [Enable private types checked build])
  5110. fi
  5111. ], [])
  5112. dnl End of checked builds
  5113. AM_CONDITIONAL(NEED_VASPRINTF, test x$ac_cv_func_vasprintf = xno || test x$with_overridable_allocators = xyes)
  5114. AC_CHECK_HEADER([malloc.h],
  5115. [AC_DEFINE([HAVE_USR_INCLUDE_MALLOC_H], [1],
  5116. [Define to 1 if you have /usr/include/malloc.h.])],,)
  5117. # When --disable-shared is used, libtool transforms libmono-2.0.la into libmono-2.0.so
  5118. # instead of libmono-static.a
  5119. if test "x$enable_shared" = "xno" -a "x$enable_executables" = "xyes"; then
  5120. LIBMONO_LA=libmini-static.la
  5121. else
  5122. if test x$buildsgen = xyes; then
  5123. LIBMONO_LA=libmonosgen-$API_VER.la
  5124. else
  5125. LIBMONO_LA=libmonoboehm-$API_VER.la
  5126. fi
  5127. fi
  5128. AC_SUBST(LIBMONO_LA)
  5129. dnl **************
  5130. dnl *** Btls ***
  5131. dnl **************
  5132. AC_ARG_ENABLE(btls, [ --disable-btls Disable the BoringTls provider], enable_btls=$enableval, enable_btls=$BTLS_SUPPORTED)
  5133. AC_ARG_ENABLE(btls-lib, [ --disable-btls-lib Disable building the BTLS native library], enable_btls_lib=$enableval, enable_btls_lib=$BTLS_SUPPORTED)
  5134. AC_ARG_WITH(btls_android_ndk, [ --with-btls-android-ndk Android NDK for BoringTls])
  5135. AC_ARG_WITH(btls_android_api, [ --with-btls-android-api Android NDK API level for BTLS build])
  5136. AC_ARG_WITH(btls_android_cmake_toolchain, [ --with-btls-android-cmake-toolchain Path to the cmake toolchain file for Android])
  5137. AC_ARG_WITH(btls_android_ndk_asm_workaround, [ --with-btls-android-ndk-asm-workaround Work around a problem with NDK r18+ clang compiler when compiling some AES assembly for ARM])
  5138. if test "x$with_btls_android_api" = "x" ; then
  5139. case "$BTLS_PLATFORM" in
  5140. android-armv5)
  5141. with_btls_android_api=16" ;;
  5142. android-armv6)
  5143. with_btls_android_api=16" ;;
  5144. android-armv7)
  5145. with_btls_android_api=16 ;;
  5146. android-v8a)
  5147. with_btls_android_api=21 ;;
  5148. android-x86)
  5149. with_btls_android_api=16 ;;
  5150. android-x64)
  5151. with_btls_android_api=21 ;;
  5152. esac
  5153. fi
  5154. if test "x$enable_btls" = "xno"; then
  5155. enable_btls_lib=no
  5156. fi
  5157. AM_CONDITIONAL(BTLS, test x$enable_btls_lib = xyes)
  5158. btls_android=no
  5159. if test "x$enable_btls" = "xyes"; then
  5160. AC_PATH_PROG(CMAKE, [cmake], [no], [$PATH:/Applications/CMake.app/Contents/bin:/usr/local/bin])
  5161. if test "x$CMAKE" = "xno"; then
  5162. AC_MSG_ERROR("cmake not found")
  5163. fi
  5164. BTLS_ROOT=`cd $srcdir && pwd`/external/boringssl
  5165. AC_SUBST(BTLS_ROOT)
  5166. btls_arch=
  5167. btls_cflags=
  5168. BTLS_CMAKE_ARGS=
  5169. if test "x$host_win32" = "xyes"; then
  5170. AC_CHECK_PROG(HAVE_YASM, yasm, yes, no)
  5171. fi
  5172. case "$BTLS_PLATFORM" in
  5173. i386)
  5174. btls_arch=i386
  5175. btls_cflags="-m32"
  5176. case $host_os in
  5177. darwin*)
  5178. btls_cflags="$btls_cflags -arch i386"
  5179. ;;
  5180. mingw*|cygwin*)
  5181. btls_cflags="-DNOCRYPT $WIN32_CPPFLAGS"
  5182. if test "x$HAVE_YASM" != "xyes"; then
  5183. BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
  5184. fi
  5185. ;;
  5186. esac
  5187. ;;
  5188. x86_64)
  5189. btls_arch=x86_64
  5190. case $host_os in
  5191. mingw*|cygwin*)
  5192. btls_cflags="-DNOCRYPT $WIN32_CPPFLAGS"
  5193. if test "x$HAVE_YASM" != "xyes"; then
  5194. BTLS_CMAKE_ARGS="-DOPENSSL_NO_ASM=1"
  5195. fi
  5196. ;;
  5197. esac
  5198. ;;
  5199. arm)
  5200. btls_arch=arm
  5201. btls_cflags="-DOPENSSL_NO_ASM=1"
  5202. ;;
  5203. armsoft)
  5204. btls_arch=arm
  5205. btls_cflags="-DOPENSSL_NO_ASM=1"
  5206. ;;
  5207. aarch64)
  5208. btls_arch=aarch64
  5209. btls_cflags="-march=armv8-a+crypto"
  5210. ;;
  5211. s390x)
  5212. btls_arch=s390x
  5213. ;;
  5214. powerpc)
  5215. btls_arch=powerpc
  5216. case $host_os in
  5217. aix*|os400*)
  5218. btls_cflags="$btls_cflags -maix64 -mminimal-toc -pthread -D_ALL_SOURCE -D_THREAD_SAFE -D_REENTRANT"
  5219. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_AR=/usr/bin/ar -DCMAKE_C_ARCHIVE_CREATE=\"<CMAKE_AR> -X64 cr <TARGET> <LINK_FLAGS> <OBJECTS>\""
  5220. esac
  5221. ;;
  5222. android-armv5)
  5223. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
  5224. ;;
  5225. android-armv6)
  5226. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
  5227. ;;
  5228. android-armv7)
  5229. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"armeabi-v7a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
  5230. ;;
  5231. android-v8a)
  5232. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"arm64-v8a\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
  5233. ;;
  5234. android-x86)
  5235. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
  5236. ;;
  5237. android-x64)
  5238. BTLS_CMAKE_ARGS="-DANDROID_ABI=\"x86_64\" -DANDROID_NATIVE_API_LEVEL=$with_btls_android_api"
  5239. ;;
  5240. riscv32)
  5241. btls_arch=riscv32
  5242. ;;
  5243. riscv64)
  5244. btls_arch=riscv64
  5245. ;;
  5246. *)
  5247. AC_MSG_ERROR(Invalid BTLS platform)
  5248. esac
  5249. if test "x$platform_android" = "xyes"; then
  5250. if test "x$with_btls_android_cmake_toolchain" = "x"; then
  5251. with_btls_android_cmake_toolchain="$BTLS_ROOT/util/android-cmake/android.toolchain.cmake"
  5252. fi
  5253. if test "x$with_btls_android_ndk_asm_workaround" != "x"; then
  5254. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DENABLE_NDK_ARM_WORKAROUND=ON"
  5255. fi
  5256. btls_android=yes
  5257. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=$with_btls_android_cmake_toolchain"
  5258. if test "x$with_btls_android_ndk" != "x"; then
  5259. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DANDROID_NDK=\"$with_btls_android_ndk\""
  5260. else
  5261. AC_MSG_ERROR([Need to pass the --with-btls-android-ndk argument when building with BTLS support on Android.])
  5262. fi
  5263. fi
  5264. if test "x$btls_arch" != "x"; then
  5265. BTLS_CMAKE_ARGS="$BTLS_CMAKE_ARGS -DBTLS_ARCH=\"$btls_arch\""
  5266. fi
  5267. BTLS_CFLAGS="$CPPFLAGS_FOR_BTLS $btls_cflags"
  5268. AC_SUBST(BTLS_ARCH)
  5269. AC_SUBST(BTLS_CFLAGS)
  5270. AC_SUBST(BTLS_PLATFORM)
  5271. AC_SUBST(BTLS_CMAKE_ARGS)
  5272. AC_DEFINE(HAVE_BTLS, 1, [BoringTls is supported])
  5273. else
  5274. enable_btls=no
  5275. fi
  5276. AM_CONDITIONAL(BTLS_ANDROID, test x$btls_android = xyes)
  5277. if test x$DISABLE_MCS_DOCS = xyes; then
  5278. docs_dir=""
  5279. else
  5280. docs_dir=docs
  5281. fi
  5282. AC_SUBST(docs_dir)
  5283. ## Maybe should also disable if mcsdir is invalid. Let's punt the issue for now.
  5284. AM_CONDITIONAL(BUILD_MCS, [test x$cross_compiling = xno && test x$enable_mcs_build != xno])
  5285. AM_CONDITIONAL(BUILD_SUPPORT, [test x$enable_support_build != xno])
  5286. libmono_ldflags="$libmono_ldflags $LIBS"
  5287. AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes)
  5288. AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno)
  5289. AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC)
  5290. AM_CONDITIONAL(SPARC64, test x$TARGET = xSPARC64)
  5291. AM_CONDITIONAL(X86, test x$TARGET = xX86)
  5292. AM_CONDITIONAL(AMD64, test x$TARGET = xAMD64)
  5293. AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS)
  5294. AM_CONDITIONAL(POWERPC, test x$TARGET = xPOWERPC)
  5295. AM_CONDITIONAL(POWERPC64, test x$TARGET = xPOWERPC64)
  5296. AM_CONDITIONAL(ARM, test x$TARGET = xARM)
  5297. AM_CONDITIONAL(ARM64, test x$TARGET = xARM64 -o x$TARGET = xARM6432)
  5298. AM_CONDITIONAL(S390X, test x$TARGET = xS390X)
  5299. AM_CONDITIONAL([RISCV], [test x$TARGET = xRISCV32 -o x$TARGET = xRISCV64])
  5300. AM_CONDITIONAL([RISCV32], [test x$TARGET = xRISCV32])
  5301. AM_CONDITIONAL([RISCV64], [test x$TARGET = xRISCV64])
  5302. AM_CONDITIONAL(WASM, test x$TARGET = xWASM)
  5303. AM_CONDITIONAL(HOST_X86, test x$HOST = xX86)
  5304. AM_CONDITIONAL(HOST_AMD64, test x$HOST = xAMD64)
  5305. AM_CONDITIONAL(HOST_ARM, test x$HOST = xARM)
  5306. AM_CONDITIONAL(HOST_ARM64, test x$HOST = xARM64)
  5307. AM_CONDITIONAL([HOST_RISCV], [test x$HOST = xRISCV32 -o x$HOST = xRISCV64])
  5308. AM_CONDITIONAL([HOST_RISCV32], [test x$HOST = xRISCV32])
  5309. AM_CONDITIONAL([HOST_RISCV64], [test x$HOST = xRISCV64])
  5310. AM_CONDITIONAL(HOST_WASM, test x$HOST = xWASM)
  5311. AM_CONDITIONAL(CROSS_COMPILE, test "x$host" != "x$target")
  5312. AC_SUBST(LIBC)
  5313. AC_SUBST(INTL)
  5314. AC_SUBST(SQLITE)
  5315. AC_SUBST(SQLITE3)
  5316. AC_SUBST(ODBC)
  5317. AC_SUBST(X11)
  5318. AC_SUBST(GDKX11)
  5319. AC_SUBST(GTKX11)
  5320. AC_SUBST(XINERAMA)
  5321. AC_DEFINE_UNQUOTED(MONO_ARCHITECTURE,"$arch_target",[The architecture this is running on])
  5322. AC_SUBST(arch_target)
  5323. #This must always be defined when building the runtime
  5324. AC_DEFINE(MONO_INSIDE_RUNTIME,1, [Disable banned functions from being used by the runtime])
  5325. mono_build_root=`pwd`
  5326. AC_SUBST(mono_build_root)
  5327. AC_ARG_ENABLE(msvc,[ --enable-msvc Build with Visual Studio (msvc) (defaults to no)], enable_msvc=$enableval, enable_msvc=no)
  5328. if test x$host_win32 = xno; then
  5329. if test x$enable_msvc = xyes; then
  5330. echo "Error, --enable-msvc only supported for Windows builds."
  5331. exit 1
  5332. fi
  5333. fi
  5334. AM_CONDITIONAL(ENABLE_MSVC, test x$enable_msvc = xyes)
  5335. if test "x$enable_msvc" = "xyes"; then
  5336. if test "x$support_boehm" = "xyes"; then
  5337. echo "Error, Boehm GC is not supported when using --enable-msvc."
  5338. exit 1
  5339. fi
  5340. mono_msvc_build_dir='$(top_srcdir)'/msvc/build/sgen
  5341. if test "x$host_cpu" = "xi686"; then
  5342. mono_msvc_build_lib_dir='$(mono_msvc_build_dir)'/Win32/lib/Release
  5343. mono_msvc_build_bin_dir='$(mono_msvc_build_dir)'/Win32/bin/Release
  5344. mono_runtime=msvc/build/sgen/Win32/bin/Release/mono-sgen.exe
  5345. mono_runtime_wrapper=$mono_runtime
  5346. else
  5347. mono_msvc_build_lib_dir='$(mono_msvc_build_dir)'/x64/lib/Release
  5348. mono_msvc_build_bin_dir='$(mono_msvc_build_dir)'/x64/bin/Release
  5349. mono_runtime=msvc/build/sgen/x64/bin/Release/mono-sgen.exe
  5350. mono_runtime_wrapper=msvc/build/sgen/x64/bin/Release/mono-sgen-msvc.sh
  5351. fi
  5352. AC_SUBST(mono_msvc_build_dir)
  5353. AC_SUBST(mono_msvc_build_lib_dir)
  5354. AC_SUBST(mono_msvc_build_bin_dir)
  5355. else
  5356. mono_runtime=mono/mini/mono
  5357. mono_runtime_wrapper=$mono_runtime
  5358. fi
  5359. AC_SUBST(mono_runtime)
  5360. AC_SUBST(mono_runtime_wrapper)
  5361. CSC_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/csc.exe
  5362. VBCS_LOCATION=`cd $srcdir && pwd`/external/roslyn-binaries/Microsoft.Net.Compilers/3.4.0/VBCSCompiler.exe
  5363. if test $csc_compiler = mcs; then
  5364. CSC=$mcs_topdir/class/lib/build/mcs.exe
  5365. else
  5366. CSC=$CSC_LOCATION
  5367. fi
  5368. AM_CONDITIONAL([CSC_IS_ROSLYN], [test x$csc_compiler != xmcs])
  5369. mono_cfg_root=$mono_build_root/runtime
  5370. if test x$host_win32 = xyes; then
  5371. if test "x$cross_compiling" = "xno"; then
  5372. mono_cfg_dir=`cygpath -w -a $mono_cfg_root`\\etc
  5373. CSC=`cygpath -m -a $CSC`
  5374. CSC_LOCATION=`cygpath -m -a $CSC_LOCATION`
  5375. VBCS_LOCATION=`cygpath -m -a $VBCS_LOCATION`
  5376. else
  5377. mono_cfg_dir=`echo $mono_cfg_root | tr '/' '\\'`\\etc
  5378. fi
  5379. else
  5380. mono_cfg_dir=$mono_cfg_root/etc
  5381. fi
  5382. if test "x$platform_android" = "xyes"; then
  5383. mono_cfg_dir=
  5384. fi
  5385. AC_SUBST(mono_cfg_dir)
  5386. AC_SUBST(CSC)
  5387. AC_CONFIG_FILES([po/mcs/Makefile.in])
  5388. AC_CONFIG_FILES([acceptance-tests/microbench-perf.sh],[chmod +x acceptance-tests/microbench-perf.sh])
  5389. AC_CONFIG_FILES([runtime/mono-wrapper],[chmod +x runtime/mono-wrapper])
  5390. AC_CONFIG_FILES([runtime/monodis-wrapper],[chmod +x runtime/monodis-wrapper])
  5391. AC_CONFIG_FILES([runtime/bin/mono-hang-watchdog],[chmod +x runtime/bin/mono-hang-watchdog])
  5392. AC_CONFIG_COMMANDS([runtime/etc/mono/1.0/machine.config],
  5393. [ depth=../../../..
  5394. case $srcdir in
  5395. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5396. .) reldir=$depth ;;
  5397. *) reldir=$depth/$srcdir ;;
  5398. esac
  5399. $ac_aux_dir/install-sh -d runtime/etc/mono/1.0
  5400. cd runtime/etc/mono/1.0
  5401. rm -f machine.config
  5402. $LN_S $reldir/data/net_1_1/machine.config machine.config
  5403. cd $depth
  5404. ],[LN_S='$LN_S'])
  5405. AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/machine.config],
  5406. [ depth=../../../..
  5407. case $srcdir in
  5408. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5409. .) reldir=$depth ;;
  5410. *) reldir=$depth/$srcdir ;;
  5411. esac
  5412. $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
  5413. cd runtime/etc/mono/2.0
  5414. rm -f machine.config
  5415. $LN_S $reldir/data/net_2_0/machine.config machine.config
  5416. cd $depth
  5417. ],[LN_S='$LN_S'])
  5418. AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/web.config],
  5419. [ depth=../../../..
  5420. case $srcdir in
  5421. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5422. .) reldir=$depth ;;
  5423. *) reldir=$depth/$srcdir ;;
  5424. esac
  5425. $ac_aux_dir/install-sh -d runtime/etc/mono/2.0
  5426. cd runtime/etc/mono/2.0
  5427. rm -f web.config
  5428. $LN_S $reldir/data/net_2_0/web.config web.config
  5429. cd $depth
  5430. ],[LN_S='$LN_S'])
  5431. AC_CONFIG_COMMANDS([runtime/etc/mono/browscap.ini],
  5432. [ depth=../../..
  5433. case $srcdir in
  5434. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5435. .) reldir=$depth ;;
  5436. *) reldir=$depth/$srcdir ;;
  5437. esac
  5438. $ac_aux_dir/install-sh -d runtime/etc/mono/
  5439. cd runtime/etc/mono/
  5440. rm -f browscap.ini
  5441. $LN_S $reldir/data/browscap.ini browscap.ini
  5442. cd $depth
  5443. ],[LN_S='$LN_S'])
  5444. AC_CONFIG_COMMANDS([runtime/etc/mono/2.0/Browsers/Compat.browser],
  5445. [ depth=../../../../..
  5446. case $srcdir in
  5447. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5448. .) reldir=$depth ;;
  5449. *) reldir=$depth/$srcdir ;;
  5450. esac
  5451. $ac_aux_dir/install-sh -d runtime/etc/mono/2.0/Browsers/
  5452. cd runtime/etc/mono/2.0/Browsers
  5453. rm -f Compat.browser
  5454. $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
  5455. cd $depth
  5456. ],[LN_S='$LN_S'])
  5457. AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/Browsers/Compat.browser],
  5458. [ depth=../../../../..
  5459. case $srcdir in
  5460. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5461. .) reldir=$depth ;;
  5462. *) reldir=$depth/$srcdir ;;
  5463. esac
  5464. $ac_aux_dir/install-sh -d runtime/etc/mono/4.0/Browsers/
  5465. cd runtime/etc/mono/4.0/Browsers
  5466. rm -f Compat.browser
  5467. $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
  5468. cd $depth
  5469. ],[LN_S='$LN_S'])
  5470. AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/Browsers/Compat.browser],
  5471. [ depth=../../../../..
  5472. case $srcdir in
  5473. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5474. .) reldir=$depth ;;
  5475. *) reldir=$depth/$srcdir ;;
  5476. esac
  5477. $ac_aux_dir/install-sh -d runtime/etc/mono/4.5/Browsers/
  5478. cd runtime/etc/mono/4.5/Browsers
  5479. rm -f Compat.browser
  5480. $LN_S $reldir/data/Browsers/Compat.browser Compat.browser
  5481. cd $depth
  5482. ],[LN_S='$LN_S'])
  5483. AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/machine.config],
  5484. [ depth=../../../..
  5485. case $srcdir in
  5486. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5487. .) reldir=$depth ;;
  5488. *) reldir=$depth/$srcdir ;;
  5489. esac
  5490. $ac_aux_dir/install-sh -d runtime/etc/mono/4.0
  5491. cd runtime/etc/mono/4.0
  5492. rm -f machine.config
  5493. $LN_S $reldir/data/net_4_0/machine.config machine.config
  5494. cd $depth
  5495. ],[LN_S='$LN_S'])
  5496. AC_CONFIG_COMMANDS([runtime/etc/mono/4.0/web.config],
  5497. [ depth=../../../..
  5498. case $srcdir in
  5499. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5500. .) reldir=$depth ;;
  5501. *) reldir=$depth/$srcdir ;;
  5502. esac
  5503. $ac_aux_dir/install-sh -d runtime/etc/mono/4.0
  5504. cd runtime/etc/mono/4.0
  5505. rm -f web.config
  5506. $LN_S $reldir/data/net_4_0/web.config web.config
  5507. cd $depth
  5508. ],[LN_S='$LN_S'])
  5509. AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/machine.config],
  5510. [ depth=../../../..
  5511. case $srcdir in
  5512. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5513. .) reldir=$depth ;;
  5514. *) reldir=$depth/$srcdir ;;
  5515. esac
  5516. $ac_aux_dir/install-sh -d runtime/etc/mono/4.5
  5517. cd runtime/etc/mono/4.5
  5518. rm -f machine.config
  5519. $LN_S $reldir/data/net_4_5/machine.config machine.config
  5520. cd $depth
  5521. ],[LN_S='$LN_S'])
  5522. AC_CONFIG_COMMANDS([runtime/etc/mono/4.5/web.config],
  5523. [ depth=../../../..
  5524. case $srcdir in
  5525. [[\\/$]]* | ?:[[\\/]]* ) reldir=$srcdir ;;
  5526. .) reldir=$depth ;;
  5527. *) reldir=$depth/$srcdir ;;
  5528. esac
  5529. $ac_aux_dir/install-sh -d runtime/etc/mono/4.5
  5530. cd runtime/etc/mono/4.5
  5531. rm -f web.config
  5532. $LN_S $reldir/data/net_4_5/web.config web.config
  5533. cd $depth
  5534. ],[LN_S='$LN_S'])
  5535. 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])
  5536. 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])
  5537. AC_CONFIG_COMMANDS([clean-llvm], [rm -f llvm/llvm_config.mk])
  5538. #
  5539. # Mono.Native Support
  5540. # -------------------
  5541. # Mono.Native is the new name for both System.Native and System.Security.Cryptography.Apple.
  5542. # It is built as a stand-alone shared library and not bundled with the runtime because we
  5543. # may need to build two different versions of it.
  5544. #
  5545. # Starting with macOS 10.12+ and iOS 10+, Apple introduced a new Unified API for some of the
  5546. # crypto primitives that we're using as part of System.Security.Cryptography.Apple.
  5547. #
  5548. # On Desktop, we can check at runtime whether the OS version is recent enough and switch
  5549. # implementation accordingly. We build a single `libmono-native` shared library.
  5550. #
  5551. # However, on Mobile we cannot have any undefined symbols as this would break Bitcode.
  5552. #
  5553. # During the mobile build, we are called with `CFLAGS` containing an explicit minium version flag,
  5554. # which is eiter `-mmacosx-version-min=`, `-mios-simulator-version-min=` or `-miphoneos-version-min=`
  5555. # depending on platform.
  5556. #
  5557. # We build two versions of the shared library:
  5558. # - `libmono-native-compat` is built with whichever minimum version is passed to us via `CFLAGS`.
  5559. # - `libmono-native-unifed` is built with the minimum version set to macOS 10.12+ / iOS 10+.
  5560. #
  5561. # For testing purpuses, there is a function called `mono_native_get_platform_type ()`
  5562. # (see mono/native/mono-native-platform.c), which returns a `MonoNativePlatformType` enum value.
  5563. # There is also `Mono.MonoNativePlatform.GetPlatformType ()` (see mcs/class/corlib/Test/Mono/MonoNativePlatform.cs).
  5564. #
  5565. # This can be called by automated tests both to ensure that the library has been correctly installed and also
  5566. # to verify that it's the correct version of it.
  5567. #
  5568. AC_MSG_CHECKING([Mono.Native support])
  5569. sed_version_pattern='[[0-9]]\{1,2\}\(\.[[0-9]]\{1,2\}\)'
  5570. if test x$disable_mono_native = xyes; then
  5571. mono_native=no
  5572. elif test x$target_osx = xyes; then
  5573. MONO_NATIVE_CC=$CC
  5574. MONO_NATIVE_CXX=$CXX
  5575. MONO_NATIVE_CCASFLAGS=$CCASFLAGS
  5576. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5577. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5578. MONO_NATIVE_CFLAGS=$CFLAGS
  5579. MONO_NATIVE_LDFLAGS=$LDFLAGS
  5580. mono_native=yes
  5581. MONO_NATIVE_PLATFORM=macos
  5582. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_MACOS"
  5583. if test x$enable_gss = xyes; then
  5584. MONO_NATIVE_LDFLAGS="$MONO_NATIVE_LDFLAGS -framework GSS"
  5585. fi
  5586. AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer],
  5587. [!(MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_12)])
  5588. if test x$mono_native_compat = xyes; then
  5589. mono_native_compat=yes
  5590. mono_native_text="Mac OSX (compat + unified v10.12)"
  5591. MONO_NATIVE_COMPAT_CCASFLAGS=$MONO_NATIVE_CCASFLAGS
  5592. MONO_NATIVE_COMPAT_CPPFLAGS=$MONO_NATIVE_CPPFLAGS
  5593. MONO_NATIVE_COMPAT_CXXFLAGS=$MONO_NATIVE_CXXFLAGS
  5594. MONO_NATIVE_COMPAT_CFLAGS=$MONO_NATIVE_CFLAGS
  5595. MONO_NATIVE_COMPAT_LDFLAGS=$MONO_NATIVE_LDFLAGS
  5596. sed_remove_mac_version_pattern="s/-mmacosx-version-min=$sed_version_pattern//g"
  5597. MONO_NATIVE_UNIFIED_CCASFLAGS="`echo $CCASFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
  5598. MONO_NATIVE_UNIFIED_CPPFLAGS="`echo $CPPFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
  5599. MONO_NATIVE_UNIFIED_CXXFLAGS="`echo $CXXFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
  5600. MONO_NATIVE_UNIFIED_CFLAGS="`echo $CFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
  5601. MONO_NATIVE_UNIFIED_LDFLAGS="`echo $LDFLAGS | sed -e $sed_remove_mac_version_pattern` -mmacosx-version-min=10.12"
  5602. else
  5603. mono_native_compat=no
  5604. mono_native_text="Mac OSX"
  5605. fi
  5606. elif test x$mono_native_platform_ios = xyes; then
  5607. AC_MONO_APPLE_TARGET(TARGET_OS_SIMULATOR, [mono_native_ios_sim=yes], [mono_native_ios_sim=no])
  5608. AC_MONO_APPLE_TARGET(TARGET_OS_IOS, [
  5609. if test x$mono_native_ios_sim = xyes; then
  5610. mono_native_ios_target=ios-simulator
  5611. mono_native_text="iOS Simulator"
  5612. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_IPHONE | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR"
  5613. else
  5614. mono_native_ios_target=iphoneos
  5615. mono_native_text="iOS Device"
  5616. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_IPHONE | MONO_NATIVE_PLATFORM_TYPE_DEVICE"
  5617. fi
  5618. mono_native_unified_version="10.0"
  5619. mono_native_compat_check="__IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_10_0"
  5620. ], [
  5621. AC_MONO_APPLE_TARGET(TARGET_OS_TV, [
  5622. if test x$mono_native_ios_sim = xyes; then
  5623. mono_native_ios_target=tvos-simulator
  5624. mono_native_text="AppleTV Simulator"
  5625. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_TV | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR"
  5626. else
  5627. mono_native_ios_target=tvos
  5628. mono_native_text="AppleTV Device"
  5629. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_TV | MONO_NATIVE_PLATFORM_TYPE_DEVICE"
  5630. fi
  5631. mono_native_unified_version="10.0"
  5632. mono_native_compat_check="__TV_OS_VERSION_MIN_REQUIRED >= __TVOS_10_0"
  5633. ], [
  5634. AC_MONO_APPLE_TARGET(TARGET_OS_WATCH, [
  5635. if test x$mono_native_ios_sim = xyes; then
  5636. mono_native_ios_target=watchos-simulator
  5637. mono_native_text="Apple Watch Simulator"
  5638. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_WATCH | MONO_NATIVE_PLATFORM_TYPE_SIMULATOR"
  5639. else
  5640. mono_native_ios_target=watchos
  5641. mono_native_text="Apple Watch Device"
  5642. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_IOS | MONO_NATIVE_PLATFORM_TYPE_WATCH | MONO_NATIVE_PLATFORM_TYPE_DEVICE"
  5643. fi
  5644. mono_native_unified_version="5.0"
  5645. mono_native_compat_check="__WATCH_OS_VERSION_MIN_REQUIRED >= __WATCHOS_5_0"
  5646. ], [
  5647. AC_MSG_ERROR([Unknown iOS Target])
  5648. ])
  5649. ])
  5650. ])
  5651. AC_MONO_APPLE_AVAILABLE(mono_native_compat, [whether we need the compatibility layer], [!($mono_native_compat_check)])
  5652. if test x$with_bitcode = xyes; then
  5653. mono_native_ldflags="-framework CoreFoundation -framework Foundation -no-undefined -fatal_warnings"
  5654. MONO_NATIVE_LIBADD="../mini/$LIBMONO_LA"
  5655. else
  5656. mono_native_ldflags="-framework CoreFoundation -framework Foundation -fatal_warnings"
  5657. fi
  5658. if test x$enable_gss = xyes; then
  5659. mono_native_ldflags="$mono_native_ldflags -framework GSS"
  5660. fi
  5661. MONO_NATIVE_CC=$CC
  5662. MONO_NATIVE_CXX=$CXX
  5663. MONO_NATIVE_CCASFLAGS=$CCASFLAGS
  5664. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5665. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5666. MONO_NATIVE_CFLAGS=$CFLAGS
  5667. MONO_NATIVE_LDFLAGS="$LDFLAGS $mono_native_ldflags"
  5668. if test x$mono_native_compat = xyes; then
  5669. mono_native_text="$mono_native_text (compat + unified v$mono_native_unified_version)"
  5670. MONO_NATIVE_COMPAT_CCASFLAGS=$MONO_NATIVE_CCASFLAGS
  5671. MONO_NATIVE_COMPAT_CPPFLAGS=$MONO_NATIVE_CPPFLAGS
  5672. MONO_NATIVE_COMPAT_CXXFLAGS=$MONO_NATIVE_CXXFLAGS
  5673. MONO_NATIVE_COMPAT_CFLAGS=$MONO_NATIVE_CFLAGS
  5674. MONO_NATIVE_COMPAT_LDFLAGS=$MONO_NATIVE_LDFLAGS
  5675. sed_remove_ios_version_pattern="s/-m\(.*\)-version-min=$sed_version_pattern//g"
  5676. MONO_NATIVE_UNIFIED_CCASFLAGS="`echo $CCASFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
  5677. MONO_NATIVE_UNIFIED_CPPFLAGS="`echo $CPPFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
  5678. MONO_NATIVE_UNIFIED_CXXFLAGS="`echo $CXXFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
  5679. MONO_NATIVE_UNIFIED_CFLAGS="`echo $CFLAGS | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
  5680. MONO_NATIVE_UNIFIED_LDFLAGS="`echo $LDFLAGS $mono_native_ldflags | sed -e $sed_remove_ios_version_pattern` -m$mono_native_ios_target-version-min=$mono_native_unified_version"
  5681. fi
  5682. mono_native=yes
  5683. MONO_NATIVE_PLATFORM=ios
  5684. elif test x$host_linux = xyes; then
  5685. mono_native_text="Linux"
  5686. MONO_NATIVE_CC=$CC
  5687. MONO_NATIVE_CXX=$CXX
  5688. MONO_NATIVE_CCASFLAGS=$CCASFLAGS
  5689. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5690. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5691. MONO_NATIVE_CFLAGS=$CFLAGS
  5692. MONO_NATIVE_LDFLAGS=$LDFLAGS
  5693. if test x$enable_gss = xyes; then
  5694. MONO_NATIVE_LDFLAGS="$MONO_NATIVE_LDFLAGS -lgssapi_krb5"
  5695. else
  5696. AC_MSG_WARN([GSS is not enabled, it requires libkrb5-dev package])
  5697. fi
  5698. mono_native=yes
  5699. mono_native_compat=no
  5700. MONO_NATIVE_PLATFORM=linux
  5701. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_LINUX"
  5702. elif test x$target_wasm = xyes; then
  5703. mono_native_text="wasm"
  5704. MONO_NATIVE_CC=$CC
  5705. MONO_NATIVE_CXX=$CXX
  5706. MONO_NATIVE_CCASFLAGS=$CCASFLAGS
  5707. # The system.native code uses _WASM_ to check for wasm
  5708. MONO_NATIVE_CPPFLAGS="$CPPFLAGS -D_WASM_"
  5709. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5710. MONO_NATIVE_CFLAGS=$CFLAGS
  5711. MONO_NATIVE_LDFLAGS=$LDFLAGS
  5712. mono_native=yes
  5713. mono_native_compat=no
  5714. MONO_NATIVE_PLATFORM=linux
  5715. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_LINUX"
  5716. elif case $host_os in aix*|os400*) true;; *) false;; esac; then
  5717. mono_native_text="AIX"
  5718. MONO_NATIVE_CC=$CC
  5719. MONO_NATIVE_CXX=$CXX
  5720. MONO_NATIVE_CCASFLAGS=$CCASFLAGS
  5721. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5722. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5723. MONO_NATIVE_CFLAGS=$CFLAGS
  5724. dnl nosymbolic- is a hack in case -G for linking is used, as -G seems
  5725. dnl to change the way unresolved symbols work on library load in an
  5726. dnl incompatible manner. (as references to runtime functions are
  5727. dnl resolved later) Default params otherwise are that, so seems OK.
  5728. dnl Likewise, we don't seem to need to cover the entire runtime with
  5729. dnl it either, on both AIX and PASE. -brtl from -G does seem to spew
  5730. dnl Big Scary TOC Warnings (tm) from the linker, but it doesn't seem
  5731. dnl problematic with gcc's -mminimal-toc.
  5732. dnl ----
  5733. dnl flock in AIX exists in libbsd (not the same as freedesktop.org
  5734. dnl libbsd) which Mono.Native needs.
  5735. dnl Because of the way that the library is built by default, unresolved
  5736. dnl references are kept and resolved at runtime. Often, the dependency
  5737. dnl chain means libbsd is loaded anyways, but not necessarily. It's
  5738. dnl better to explicitly link it, even though it has it shadows libc's
  5739. dnl ioctl with its own. (As for the other unresolved imports, those
  5740. dnl should be provided by the Mono runtime loaded.)
  5741. MONO_NATIVE_LDFLAGS="$LDFLAGS -lbsd -Wl,-bnosymbolic-"
  5742. mono_native=yes
  5743. mono_native_compat=no
  5744. MONO_NATIVE_PLATFORM=aix
  5745. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_AIX"
  5746. elif case $host_os in freebsd*) true;; *) false;; esac; then
  5747. mono_native_text="FreeBSD"
  5748. MONO_NATIVE_CC=$CC
  5749. MONO_NATIVE_CXX=$CXX
  5750. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5751. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5752. MONO_NATIVE_CFLAGS=$CFLAGS
  5753. MONO_NATIVE_LDFLAGS=$LDFLAGS
  5754. mono_native=yes
  5755. mono_native_compat=no
  5756. MONO_NATIVE_PLATFORM=freebsd
  5757. AC_MSG_CHECKING([Mono.Native support])
  5758. AC_MSG_RESULT(freebsd)
  5759. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_FREEBSD"
  5760. elif case $host_os in haiku*) true;; *) false;; esac; then
  5761. mono_native_text="Haiku"
  5762. MONO_NATIVE_CC=$CC
  5763. MONO_NATIVE_CXX=$CXX
  5764. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5765. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5766. MONO_NATIVE_CFLAGS=$CFLAGS
  5767. MONO_NATIVE_LDFLAGS=$LDFLAGS
  5768. mono_native=yes
  5769. mono_native_compat=no
  5770. MONO_NATIVE_PLATFORM=haiku
  5771. AC_MSG_CHECKING([Mono.Native support])
  5772. AC_MSG_RESULT(haiku)
  5773. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_HAIKU"
  5774. elif test x$platform_android = xyes; then
  5775. mono_native_text="Android"
  5776. MONO_NATIVE_CC=$CC
  5777. MONO_NATIVE_CXX=$CXX
  5778. MONO_NATIVE_CPPFLAGS=$CPPFLAGS
  5779. MONO_NATIVE_CXXFLAGS=$CXXFLAGS
  5780. MONO_NATIVE_CFLAGS=$CFLAGS
  5781. MONO_NATIVE_LDFLAGS=$LDFLAGS
  5782. MONO_NATIVE_LIBADD="../mini/$LIBMONO_LA"
  5783. mono_native=yes
  5784. mono_native_compat=no
  5785. MONO_NATIVE_PLATFORM=android
  5786. MONO_NATIVE_PLATFORM_TYPE="MONO_NATIVE_PLATFORM_TYPE_ANDROID"
  5787. else
  5788. mono_native=no
  5789. mono_native_text="no"
  5790. fi
  5791. AC_MSG_RESULT($mono_native_text)
  5792. if test x$mono_native_compat = xyes; then
  5793. MONO_NATIVE_LIBRARY_NAME=libmono-native-compat
  5794. else
  5795. MONO_NATIVE_LIBRARY_NAME=libmono-native
  5796. fi
  5797. AC_SUBST(MONO_NATIVE_PLATFORM)
  5798. AC_SUBST(MONO_NATIVE_CC)
  5799. AC_SUBST(MONO_NATIVE_CXX)
  5800. AC_SUBST(MONO_NATIVE_CCASFLAGS)
  5801. AC_SUBST(MONO_NATIVE_COMPAT_CCASFLAGS)
  5802. AC_SUBST(MONO_NATIVE_UNIFIED_CCASFLAGS)
  5803. AC_SUBST(MONO_NATIVE_CPPFLAGS)
  5804. AC_SUBST(MONO_NATIVE_COMPAT_CPPFLAGS)
  5805. AC_SUBST(MONO_NATIVE_UNIFIED_CPPFLAGS)
  5806. AC_SUBST(MONO_NATIVE_CXXFLAGS)
  5807. AC_SUBST(MONO_NATIVE_COMPAT_CXXFLAGS)
  5808. AC_SUBST(MONO_NATIVE_UNIFIED_CXXFLAGS)
  5809. AC_SUBST(MONO_NATIVE_CFLAGS)
  5810. AC_SUBST(MONO_NATIVE_COMPAT_CFLAGS)
  5811. AC_SUBST(MONO_NATIVE_UNIFIED_CFLAGS)
  5812. AC_SUBST(MONO_NATIVE_LDFLAGS)
  5813. AC_SUBST(MONO_NATIVE_COMPAT_LDFLAGS)
  5814. AC_SUBST(MONO_NATIVE_UNIFIED_LDFLAGS)
  5815. AC_SUBST(MONO_NATIVE_LIBRARY_NAME)
  5816. AC_SUBST(MONO_NATIVE_LIBADD)
  5817. AM_CONDITIONAL(MONO_NATIVE, test x$mono_native = xyes)
  5818. AM_CONDITIONAL(MONO_NATIVE_COMPAT, test x$mono_native_compat = xyes)
  5819. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_MACOS, test x$MONO_NATIVE_PLATFORM = xmacos)
  5820. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_IOS, test x$MONO_NATIVE_PLATFORM = xios)
  5821. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_LINUX, test x$MONO_NATIVE_PLATFORM = xlinux)
  5822. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_AIX, test x$MONO_NATIVE_PLATFORM = xaix)
  5823. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_ANDROID, test x$MONO_NATIVE_PLATFORM = xandroid)
  5824. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_FREEBSD, test x$MONO_NATIVE_PLATFORM = xfreebsd)
  5825. AM_CONDITIONAL(MONO_NATIVE_PLATFORM_HAIKU, test x$MONO_NATIVE_PLATFORM = xhaiku)
  5826. MONO_NATIVE_PLATFORM_TYPE_COMPAT="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_COMPAT"
  5827. MONO_NATIVE_PLATFORM_TYPE_UNIFIED="$MONO_NATIVE_PLATFORM_TYPE | MONO_NATIVE_PLATFORM_TYPE_UNIFIED"
  5828. AC_SUBST(MONO_NATIVE_PLATFORM_TYPE)
  5829. AC_SUBST(MONO_NATIVE_PLATFORM_TYPE_COMPAT)
  5830. AC_SUBST(MONO_NATIVE_PLATFORM_TYPE_UNIFIED)
  5831. ### C++ Linker selection
  5832. #
  5833. # We have to lie to autotools, sometimes.
  5834. #
  5835. # If we're building with llvm compiled into Mono, set MONO_CXXLD to CXX,
  5836. # otherwise to CC. We want C linking even if we're compiling with C++ enabled
  5837. # because we do not want to link inthe C++ runtime library (-lstdc++ or -lc++),
  5838. # except if we're linking with LLVM which relies on it.
  5839. #
  5840. # Explanation of the hack:
  5841. #
  5842. # According to
  5843. # https://www.gnu.org/software/automake/manual/html_node/How-the-Linker-is-Chosen.html,
  5844. # automake chooses the linker that it used to compile a target based on the
  5845. # _SOURCES for that target. If the target is comprised of only C code, it
  5846. # chooses the C linker (on Linux and OSX this is just gcc or clang called with
  5847. # linker arguments and a -o). If the target _SOURCES include at least one C++ file,
  5848. # then automake chooses the C++ linker (usually g++ or clang++ called with linker arguments and -o).
  5849. #
  5850. # The problem for Mono is that we don't want the C++ runtime library (libstdc++
  5851. # or libc++) linked in - even when Mono is written in C++, we take care not to
  5852. # require the runtime library. As a result, we don't want g++ or clang++ to do
  5853. # the linking. On the other hand if LLVM is enabled, then we _must_ use the
  5854. # C++ linker - LLVM doesn't have the same restrictions.
  5855. #
  5856. # So the trick is we set MONO_CXXLD here to $CXX or $CC and in
  5857. # mono/mini/Makefile.am.in we have CCLD=$MONO_CXXLD and CXXLD=$MONO_CXXLD which bypasses
  5858. # automake's autodetection and lets us use the linker that we want.
  5859. #
  5860. if test "x$enable_llvm_runtime" = "xyes"; then
  5861. AC_SUBST(MONO_CXXLD, [$CXX])
  5862. else
  5863. AC_SUBST(MONO_CXXLD, [$CC])
  5864. fi
  5865. ### Set -Werror options
  5866. #
  5867. # Anything involving -Werror must be done late because autoconf depends on compiling with warnings to be success.
  5868. #
  5869. if test x"$GCC" = xyes; then
  5870. if test "x$with_jemalloc" != "xyes"; then
  5871. # incompatible-pointer-types requires gcc circa 5.x
  5872. ORIG_CFLAGS=$CFLAGS
  5873. CFLAGS="$CFLAGS -Wincompatible-pointer-types -Werror"
  5874. AC_MSG_CHECKING(for -Wincompatible-pointer-types option to gcc)
  5875. AC_TRY_COMPILE([],[
  5876. ], [
  5877. AC_MSG_RESULT(yes)
  5878. CFLAGS="$ORIG_CFLAGS -Werror=incompatible-pointer-types"
  5879. ], [
  5880. AC_MSG_RESULT(no)
  5881. CFLAGS=$ORIG_CFLAGS
  5882. ])
  5883. CFLAGS="$CFLAGS -Werror=return-type"
  5884. fi
  5885. # Implicit function declarations are not 64 bit safe
  5886. # Do this late, since this causes lots of configure tests to fail
  5887. CFLAGS="$CFLAGS -Werror-implicit-function-declaration"
  5888. # jay has a lot of implicit declarations
  5889. JAY_CFLAGS="-Wno-implicit-function-declaration"
  5890. fi
  5891. # zlib/configure checks if this program compiles and if so
  5892. # defines _LARGEFILE64_SOURCE on the compiler command line (not config.h).
  5893. #
  5894. AC_MSG_CHECKING([for large file support])
  5895. AC_COMPILE_IFELSE(
  5896. [
  5897. #include <sys/types.h>
  5898. off64_t dummy = 0;
  5899. ], [
  5900. AC_MSG_RESULT(yes)
  5901. # FIXME The ramifications of _LARGEFILE64_SOURCE are not understood.
  5902. # ZLIB_CFLAGS="$ZLIB_CFLAGS -D_LARGEFILE64_SOURCE=1"
  5903. ], [
  5904. AC_MSG_RESULT(no)
  5905. ])
  5906. AC_SUBST(CFLAGS)
  5907. AC_SUBST(CPPFLAGS)
  5908. AC_SUBST(LDFLAGS)
  5909. AC_SUBST(ZLIB_CFLAGS)
  5910. # Update all submodules recursively to ensure everything is checked out
  5911. if test "x$with_core" != "xonly"; then
  5912. (cd $srcdir && scripts/update_submodules.sh)
  5913. fi
  5914. AC_OUTPUT([
  5915. Makefile
  5916. mono-uninstalled.pc
  5917. acceptance-tests/Makefile
  5918. llvm/Makefile
  5919. scripts/mono-find-provides
  5920. scripts/mono-find-requires
  5921. mk/Makefile
  5922. mono/Makefile
  5923. mono/btls/Makefile
  5924. mono/native/Makefile
  5925. mono/utils/Makefile
  5926. mono/utils/jemalloc/Makefile
  5927. mono/metadata/Makefile
  5928. mono/dis/Makefile
  5929. mono/cil/Makefile
  5930. mono/arch/Makefile
  5931. mono/arch/x86/Makefile
  5932. mono/arch/amd64/Makefile
  5933. mono/arch/ppc/Makefile
  5934. mono/arch/sparc/Makefile
  5935. mono/arch/s390x/Makefile
  5936. mono/arch/arm/Makefile
  5937. mono/arch/arm64/Makefile
  5938. mono/arch/mips/Makefile
  5939. mono/arch/riscv/Makefile
  5940. mono/sgen/Makefile
  5941. mono/native/platform-type.c
  5942. mono/native/platform-type-compat.c
  5943. mono/native/platform-type-unified.c
  5944. mono/tests/Makefile
  5945. mono/tests/assembly-load-reference/Makefile
  5946. mono/tests/tests-config
  5947. mono/tests/gc-descriptors/Makefile
  5948. mono/tests/testing_gac/Makefile
  5949. mono/tests/fullaot-mixed/Makefile
  5950. mono/tests/llvmonly-mixed/Makefile
  5951. mono/unit-tests/Makefile
  5952. mono/benchmark/Makefile
  5953. mono/mini/Makefile
  5954. mono/profiler/Makefile
  5955. mono/eglib/Makefile
  5956. mono/eglib/eglib-config.h
  5957. mono/eglib/test/Makefile
  5958. m4/Makefile
  5959. ikvm-native/Makefile
  5960. scripts/Makefile
  5961. man/Makefile
  5962. docs/Makefile
  5963. data/Makefile
  5964. data/net_2_0/Makefile
  5965. data/net_4_0/Makefile
  5966. data/net_4_5/Makefile
  5967. data/net_2_0/Browsers/Makefile
  5968. data/net_4_0/Browsers/Makefile
  5969. data/net_4_5/Browsers/Makefile
  5970. data/mint.pc
  5971. data/mono-2.pc
  5972. data/monosgen-2.pc
  5973. data/mono.pc
  5974. data/mono-cairo.pc
  5975. data/mono-options.pc
  5976. data/mono-lineeditor.pc
  5977. data/monodoc.pc
  5978. data/dotnet.pc
  5979. data/dotnet35.pc
  5980. data/wcf.pc
  5981. data/cecil.pc
  5982. data/system.web.extensions_1.0.pc
  5983. data/system.web.extensions.design_1.0.pc
  5984. data/system.web.mvc.pc
  5985. data/system.web.mvc2.pc
  5986. data/system.web.mvc3.pc
  5987. data/aspnetwebstack.pc
  5988. data/reactive.pc
  5989. samples/Makefile
  5990. support/Makefile
  5991. data/config
  5992. tools/Makefile
  5993. tools/locale-builder/Makefile
  5994. tools/sgen/Makefile
  5995. tools/pedump/Makefile
  5996. tools/mono-hang-watchdog/Makefile
  5997. runtime/Makefile
  5998. msvc/Makefile
  5999. po/Makefile
  6000. ])
  6001. if test x$host_win32 = xyes; then
  6002. # Get rid of 'cyg' prefixes in library names
  6003. sed -e "s/\/cyg\//\/\//" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
  6004. # libtool seems to inherit -mno-cygwin from our CFLAGS, and uses it to compile its executable
  6005. # wrapper scripts which use exec(). gcc has no problem compiling+linking this, but the resulting
  6006. # executable doesn't work...
  6007. sed -e "s,-mno-cygwin,,g" libtool > libtool.new; mv libtool.new libtool; chmod 755 libtool
  6008. fi
  6009. if test x$host_darwin = xyes; then
  6010. # This doesn't seem to be required and it slows down parallel builds
  6011. sed -e 's,lock_old_archive_extraction=yes,lock_old_archive_extraction=no,g' < libtool > libtool.new && mv libtool.new libtool && chmod +x libtool
  6012. fi
  6013. force_enable_compiler_server=no;
  6014. AC_MSG_CHECKING([compiler server])
  6015. AC_ARG_WITH(compiler-server, [ --with-compiler-server=yes,no,default,force Enables or disables compiler server],[
  6016. if test x$withval = xyes; then
  6017. enable_compiler_server=yes;
  6018. # force will bypass any automatic disables to allow you to test the compiler server
  6019. # in scenarios where it is disabled
  6020. elif test x$withval = xforce; then
  6021. enable_compiler_server=yes;
  6022. force_enable_compiler_server=yes;
  6023. elif test x$withval = xno; then
  6024. enable_compiler_server=no;
  6025. elif test x$withval = xdefault; then
  6026. enable_compiler_server=yes;
  6027. else
  6028. AC_MSG_ERROR([You must supply one of "yes", "no", "default" or "force" to the --with-compiler-server option])
  6029. fi
  6030. ],[enable_compiler_server=yes])
  6031. AC_MSG_RESULT($enable_compiler_server)
  6032. if test x$enable_compiler_server = xyes; then
  6033. if test x$force_enable_compiler_server = xyes; then
  6034. AC_MSG_WARN([forcing compiler server to stay enabled])
  6035. elif test x$host_darwin = xyes; then
  6036. AC_MSG_WARN([compiler server temporarily disabled on darwin])
  6037. enable_compiler_server=no;
  6038. elif test x$csc_compiler = xmcs; then
  6039. AC_MSG_WARN([mcs does not support the compiler server])
  6040. enable_compiler_server=no;
  6041. fi
  6042. fi
  6043. (
  6044. case $prefix in
  6045. NONE) prefix=$ac_default_prefix ;;
  6046. esac
  6047. case $exec_prefix in
  6048. NONE) exec_prefix='${prefix}' ;;
  6049. esac
  6050. #
  6051. # If we are cross compiling, we don't build in the mcs/ tree. Let us not clobber
  6052. # any existing config.make. This allows people to share the same source tree
  6053. # with different build directories, one native and one cross
  6054. #
  6055. if test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
  6056. test -w $mcs_topdir/build || chmod +w $mcs_topdir/build
  6057. echo "prefix=$prefix" > $mcs_topdir/build/config.make
  6058. echo "exec_prefix=$exec_prefix" >> $mcs_topdir/build/config.make
  6059. echo "sysconfdir=$sysconfdir" >> $mcs_topdir/build/config.make
  6060. echo 'mono_libdir=${exec_prefix}/lib' >> $mcs_topdir/build/config.make
  6061. echo "mono_build_root=$mono_build_root" >> $mcs_topdir/build/config.make
  6062. echo 'IL_FLAGS = /debug' >> $mcs_topdir/build/config.make
  6063. echo "RUNTIME = $mono_build_root/runtime/mono-wrapper" >> $mcs_topdir/build/config.make
  6064. echo "ILDISASM = $mono_build_root/runtime/monodis-wrapper" >> $mcs_topdir/build/config.make
  6065. echo "JAY_CFLAGS = $JAY_CFLAGS" >> $mcs_topdir/build/config.make
  6066. echo "VERSION = $VERSION" >> $mcs_topdir/build/config.make
  6067. case $INSTALL in
  6068. [[\\/$]]* | ?:[[\\/]]* ) mcs_INSTALL=$INSTALL ;;
  6069. *) mcs_INSTALL=$mono_build_root/$INSTALL ;;
  6070. esac
  6071. echo "INSTALL = $mcs_INSTALL" >> $mcs_topdir/build/config.make
  6072. export VERSION
  6073. [myver=$($AWK 'BEGIN {
  6074. split (ENVIRON["VERSION"] ".0.0.0", vsplit, ".")
  6075. if(length(vsplit [1]) > 4) {
  6076. split (substr(ENVIRON["VERSION"], 0, 4) "." substr(ENVIRON["VERSION"], 5) ".0.0", vsplit, ".")
  6077. }
  6078. print vsplit [1] "." vsplit [2] "." vsplit [3] "." vsplit [4]
  6079. }')]
  6080. echo "MONO_VERSION = $myver" >> $mcs_topdir/build/config.make
  6081. echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> $mcs_topdir/build/config.make
  6082. if test x$host_darwin = xyes; then
  6083. echo "BUILD_PLATFORM = macos" >> $mcs_topdir/build/config.make
  6084. echo "HOST_PLATFORM ?= macos" >> $mcs_topdir/build/config.make
  6085. echo "XTEST_PLATFORM ?= osx" >> $mcs_topdir/build/config.make
  6086. elif test x$host_win32 = xyes; then
  6087. echo "BUILD_PLATFORM = win32" >> $mcs_topdir/build/config.make
  6088. echo "HOST_PLATFORM ?= win32" >> $mcs_topdir/build/config.make
  6089. echo "XTEST_PLATFORM ?= windows" >> $mcs_topdir/build/config.make
  6090. elif test x$host_linux = xyes; then
  6091. echo "BUILD_PLATFORM = linux" >> $mcs_topdir/build/config.make
  6092. echo "HOST_PLATFORM ?= linux" >> $mcs_topdir/build/config.make
  6093. echo "XTEST_PLATFORM ?= linux" >> $mcs_topdir/build/config.make
  6094. else
  6095. echo "BUILD_PLATFORM = unix" >> $mcs_topdir/build/config.make
  6096. echo "HOST_PLATFORM ?= unix" >> $mcs_topdir/build/config.make
  6097. echo "XTEST_PLATFORM ?= unix" >> $mcs_topdir/build/config.make
  6098. fi
  6099. echo "PLATFORM_AOT_PREFIX = $PLATFORM_AOT_PREFIX" >> $mcs_topdir/build/config.make
  6100. if test "x$PLATFORM_AOT_SUFFIX" != "x"; then
  6101. echo "PLATFORM_AOT_SUFFIX = $PLATFORM_AOT_SUFFIX" >> $mcs_topdir/build/config.make
  6102. fi
  6103. if test x$AOT_SUPPORTED = xyes -a x$enable_system_aot = xdefault; then
  6104. enable_system_aot=yes
  6105. fi
  6106. if test x$host_win32 = xno -a x$enable_system_aot = xyes; then
  6107. echo "ENABLE_AOT = 1" >> $mcs_topdir/build/config.make
  6108. fi
  6109. if test x$DISABLE_MCS_DOCS = xyes; then
  6110. echo "DISABLE_MCS_DOCS = yes" >> $mcs_topdir/build/config.make
  6111. fi
  6112. if test x$has_extension_module != xno; then
  6113. echo "EXTENSION_MODULE = 1" >> $srcdir/$mcsdir/build/config.make
  6114. fi
  6115. echo "DEFAULT_PROFILE = $default_profile" >> $srcdir/$mcsdir/build/config.make
  6116. if test "x$test_bcl_opt" = "xyes"; then
  6117. echo "BCL_OPTIMIZE = 1" >> $srcdir/$mcsdir/build/config.make
  6118. fi
  6119. echo "STANDALONE_CSC_LOCATION=$CSC_LOCATION" >> $srcdir/$mcsdir/build/config.make
  6120. echo "SERVER_CSC_LOCATION?=$CSC_LOCATION" >> $srcdir/$mcsdir/build/config.make
  6121. echo "VBCS_LOCATION?=$VBCS_LOCATION" >> $srcdir/$mcsdir/build/config.make
  6122. if test $csc_compiler = mcs; then
  6123. echo "MCS_MODE = 1" >> $srcdir/$mcsdir/build/config.make
  6124. fi
  6125. if test "x$AOT_BUILD_FLAGS" != "x" ; then
  6126. echo "AOT_RUN_FLAGS=$AOT_RUN_FLAGS" >> $srcdir/$mcsdir/build/config.make
  6127. echo "AOT_BUILD_ATTRS=$AOT_BUILD_ATTRS" >> $srcdir/$mcsdir/build/config.make
  6128. if test "x$internal_llvm" != "xno" && test "x$enable_llvm_msvc_only" = "xno"; then
  6129. echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS,$MONO_LLVM_PATH_OPTION" >> $srcdir/$mcsdir/build/config.make
  6130. else
  6131. echo "AOT_BUILD_FLAGS=$AOT_BUILD_FLAGS" >> $srcdir/$mcsdir/build/config.make
  6132. fi
  6133. fi
  6134. if test "x$AOT_MODE" != "x" ; then
  6135. echo "AOT_MODE=$AOT_MODE" >> $srcdir/$mcsdir/build/config.make
  6136. fi
  6137. if test "x$enable_btls" = "xyes"; then
  6138. echo "HAVE_BTLS=1" >> $srcdir/$mcsdir/build/config.make
  6139. fi
  6140. if test "x$mono_native" = "xyes"; then
  6141. echo "MONO_NATIVE_SUPPORTED=true" >> $srcdir/$mcsdir/build/config.make
  6142. else
  6143. echo "MONO_NATIVE_SUPPORTED=false" >> $srcdir/$mcsdir/build/config.make
  6144. fi
  6145. if test x$mono_native_compat = xyes; then
  6146. echo "MONO_NATIVE_USING_COMPAT=true" >> $srcdir/$mcsdir/build/config.make
  6147. else
  6148. echo "MONO_NATIVE_USING_COMPAT=false" >> $srcdir/$mcsdir/build/config.make
  6149. fi
  6150. echo "MONO_NATIVE_PLATFORM_TYPE=$MONO_NATIVE_PLATFORM_TYPE" >> $srcdir/$mcsdir/build/config.make
  6151. echo "MONO_NATIVE_PLATFORM=$MONO_NATIVE_PLATFORM" >> $srcdir/$mcsdir/build/config.make
  6152. if test x$enable_compiler_server = xyes; then
  6153. echo "ENABLE_COMPILER_SERVER?=1" >> $srcdir/$mcsdir/build/config.make
  6154. else
  6155. echo "ENABLE_COMPILER_SERVER?=0" >> $srcdir/$mcsdir/build/config.make
  6156. fi
  6157. echo "COMPILER_SERVER_PIPENAME?=monomake" >> $srcdir/$mcsdir/build/config.make
  6158. fi
  6159. )
  6160. libgdiplus_msg=${libgdiplus_loc:-assumed to be installed}
  6161. btls_platform_string=
  6162. if test x$enable_btls = xyes; then
  6163. if test x$btls_android = xyes; then
  6164. btls_platform_string=" (android:$BTLS_PLATFORM)"
  6165. else
  6166. btls_platform_string=" ($BTLS_PLATFORM)"
  6167. fi
  6168. fi
  6169. thread_suspend_msg=
  6170. if test x$buildsgen = xyes; then
  6171. if test x$enable_cooperative_suspend != xno; then
  6172. thread_suspend_msg="Suspend: Cooperative"
  6173. elif test x$enable_hybrid_suspend != xno; then
  6174. thread_suspend_msg="Suspend: Hybrid"
  6175. else
  6176. thread_suspend_msg="Suspend: Preemptive"
  6177. fi
  6178. fi
  6179. if test "x$with_core" = "xonly"; then
  6180. echo "VERSION = $VERSION" > netcore/config.make
  6181. echo "RID = $RID" >> netcore/config.make
  6182. echo "COREARCH = $COREARCH" >> netcore/config.make
  6183. echo "CORETARGETS = $CORETARGETS" >> netcore/config.make
  6184. echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> netcore/config.make
  6185. if test x$host_darwin = xyes; then
  6186. echo "HOST_PLATFORM ?= macos" >> netcore/config.make
  6187. elif test x$host_win32 = xyes; then
  6188. echo "HOST_PLATFORM ?= win32" >> netcore/config.make
  6189. elif test x$host_linux = xyes; then
  6190. echo "HOST_PLATFORM ?= linux" >> netcore/config.make
  6191. else
  6192. echo "HOST_PLATFORM ?= unix" >> netcore/config.make
  6193. fi
  6194. fi
  6195. echo "
  6196. mcs source: $mcsdir
  6197. C# Compiler: $csc_compiler
  6198. CompilerServer:$enable_compiler_server
  6199. Engine:
  6200. Host: $host
  6201. Target: $target
  6202. GC: $gc_msg
  6203. $thread_suspend_msg
  6204. TLS: $with_tls
  6205. SIGALTSTACK: $with_sigaltstack
  6206. Engine: $jit_status
  6207. BigArrays: $enable_big_arrays
  6208. DTrace: $enable_dtrace
  6209. LLVM Back End: $enable_llvm (dynamically loaded: $enable_loadedllvm, built in-tree: $internal_llvm, assertions: $enable_llvm_asserts, msvc only: $enable_llvm_msvc_only)
  6210. Spectre: $spectre_mitigation_status
  6211. Mono.Native: $mono_native_text
  6212. Libraries:
  6213. .NET 4.x: $with_profile4_x
  6214. Xamarin.Android: $with_monodroid
  6215. Xamarin.iOS: $with_monotouch
  6216. Xamarin.WatchOS: $with_monotouch_watch
  6217. Xamarin.TVOS: $with_monotouch_tv
  6218. Xamarin.Mac: $with_xammac
  6219. Windows AOT: $with_winaot
  6220. Orbis: $with_orbis
  6221. Unreal: $with_unreal
  6222. WebAssembly: $with_wasm
  6223. Test profiles: AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid), AOT Full Interp ($with_testing_aot_full_interp), Windows Full AOT Interp ($with_testing_winaot_interp)
  6224. JNI support: $jdk_headers_found
  6225. libgdiplus: $libgdiplus_msg
  6226. zlib: $zlib_msg
  6227. BTLS: $enable_btls$btls_platform_string
  6228. jemalloc: $with_jemalloc (always use: $with_jemalloc_always)
  6229. crash reporting: $crash_reporting (private crashes: $with_crash_privacy)
  6230. .NET Core: $with_core
  6231. $disabled
  6232. "
  6233. if test x$with_static_mono = xno -a "x$host_win32" != "xyes"; then
  6234. AC_MSG_WARN([Turning off static Mono is a risk, you might run into unexpected bugs])
  6235. fi