curl-functions.m4 186 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.haxx.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. #***************************************************************************
  22. # File version for 'aclocal' use. Keep it a single number.
  23. # serial 73
  24. dnl CURL_INCLUDES_ARPA_INET
  25. dnl -------------------------------------------------
  26. dnl Set up variable with list of headers that must be
  27. dnl included when arpa/inet.h is to be included.
  28. AC_DEFUN([CURL_INCLUDES_ARPA_INET], [
  29. curl_includes_arpa_inet="\
  30. /* includes start */
  31. #ifdef HAVE_SYS_TYPES_H
  32. # include <sys/types.h>
  33. #endif
  34. #ifdef HAVE_SYS_SOCKET_H
  35. # include <sys/socket.h>
  36. #endif
  37. #ifdef HAVE_NETINET_IN_H
  38. # include <netinet/in.h>
  39. #endif
  40. #ifdef HAVE_ARPA_INET_H
  41. # include <arpa/inet.h>
  42. #endif
  43. #ifdef HAVE_WINSOCK2_H
  44. #include <winsock2.h>
  45. #include <ws2tcpip.h>
  46. #endif
  47. /* includes end */"
  48. AC_CHECK_HEADERS(
  49. sys/types.h sys/socket.h netinet/in.h arpa/inet.h,
  50. [], [], [$curl_includes_arpa_inet])
  51. ])
  52. dnl CURL_INCLUDES_FCNTL
  53. dnl -------------------------------------------------
  54. dnl Set up variable with list of headers that must be
  55. dnl included when fcntl.h is to be included.
  56. AC_DEFUN([CURL_INCLUDES_FCNTL], [
  57. curl_includes_fcntl="\
  58. /* includes start */
  59. #ifdef HAVE_SYS_TYPES_H
  60. # include <sys/types.h>
  61. #endif
  62. #ifdef HAVE_UNISTD_H
  63. # include <unistd.h>
  64. #endif
  65. #ifdef HAVE_FCNTL_H
  66. # include <fcntl.h>
  67. #endif
  68. /* includes end */"
  69. AC_CHECK_HEADERS(
  70. sys/types.h unistd.h fcntl.h,
  71. [], [], [$curl_includes_fcntl])
  72. ])
  73. dnl CURL_INCLUDES_IFADDRS
  74. dnl -------------------------------------------------
  75. dnl Set up variable with list of headers that must be
  76. dnl included when ifaddrs.h is to be included.
  77. AC_DEFUN([CURL_INCLUDES_IFADDRS], [
  78. curl_includes_ifaddrs="\
  79. /* includes start */
  80. #ifdef HAVE_SYS_TYPES_H
  81. # include <sys/types.h>
  82. #endif
  83. #ifdef HAVE_SYS_SOCKET_H
  84. # include <sys/socket.h>
  85. #endif
  86. #ifdef HAVE_NETINET_IN_H
  87. # include <netinet/in.h>
  88. #endif
  89. #ifdef HAVE_IFADDRS_H
  90. # include <ifaddrs.h>
  91. #endif
  92. /* includes end */"
  93. AC_CHECK_HEADERS(
  94. sys/types.h sys/socket.h netinet/in.h ifaddrs.h,
  95. [], [], [$curl_includes_ifaddrs])
  96. ])
  97. dnl CURL_INCLUDES_INTTYPES
  98. dnl -------------------------------------------------
  99. dnl Set up variable with list of headers that must be
  100. dnl included when inttypes.h is to be included.
  101. AC_DEFUN([CURL_INCLUDES_INTTYPES], [
  102. curl_includes_inttypes="\
  103. /* includes start */
  104. #ifdef HAVE_SYS_TYPES_H
  105. # include <sys/types.h>
  106. #endif
  107. #ifdef HAVE_STDINT_H
  108. # include <stdint.h>
  109. #endif
  110. #ifdef HAVE_INTTYPES_H
  111. # include <inttypes.h>
  112. #endif
  113. /* includes end */"
  114. case $host_os in
  115. irix*)
  116. ac_cv_header_stdint_h="no"
  117. ;;
  118. esac
  119. AC_CHECK_HEADERS(
  120. sys/types.h stdint.h inttypes.h,
  121. [], [], [$curl_includes_inttypes])
  122. ])
  123. dnl CURL_INCLUDES_LIBGEN
  124. dnl -------------------------------------------------
  125. dnl Set up variable with list of headers that must be
  126. dnl included when libgen.h is to be included.
  127. AC_DEFUN([CURL_INCLUDES_LIBGEN], [
  128. curl_includes_libgen="\
  129. /* includes start */
  130. #ifdef HAVE_SYS_TYPES_H
  131. # include <sys/types.h>
  132. #endif
  133. #ifdef HAVE_LIBGEN_H
  134. # include <libgen.h>
  135. #endif
  136. /* includes end */"
  137. AC_CHECK_HEADERS(
  138. sys/types.h libgen.h,
  139. [], [], [$curl_includes_libgen])
  140. ])
  141. dnl CURL_INCLUDES_NETDB
  142. dnl -------------------------------------------------
  143. dnl Set up variable with list of headers that must be
  144. dnl included when netdb.h is to be included.
  145. AC_DEFUN([CURL_INCLUDES_NETDB], [
  146. curl_includes_netdb="\
  147. /* includes start */
  148. #ifdef HAVE_SYS_TYPES_H
  149. # include <sys/types.h>
  150. #endif
  151. #ifdef HAVE_NETDB_H
  152. # include <netdb.h>
  153. #endif
  154. /* includes end */"
  155. AC_CHECK_HEADERS(
  156. sys/types.h netdb.h,
  157. [], [], [$curl_includes_netdb])
  158. ])
  159. dnl CURL_INCLUDES_POLL
  160. dnl -------------------------------------------------
  161. dnl Set up variable with list of headers that must be
  162. dnl included when poll.h is to be included.
  163. AC_DEFUN([CURL_INCLUDES_POLL], [
  164. curl_includes_poll="\
  165. /* includes start */
  166. #ifdef HAVE_SYS_TYPES_H
  167. # include <sys/types.h>
  168. #endif
  169. #ifdef HAVE_POLL_H
  170. # include <poll.h>
  171. #endif
  172. #ifdef HAVE_SYS_POLL_H
  173. # include <sys/poll.h>
  174. #endif
  175. /* includes end */"
  176. AC_CHECK_HEADERS(
  177. sys/types.h poll.h sys/poll.h,
  178. [], [], [$curl_includes_poll])
  179. ])
  180. dnl CURL_INCLUDES_SETJMP
  181. dnl -------------------------------------------------
  182. dnl Set up variable with list of headers that must be
  183. dnl included when setjmp.h is to be included.
  184. AC_DEFUN([CURL_INCLUDES_SETJMP], [
  185. curl_includes_setjmp="\
  186. /* includes start */
  187. #ifdef HAVE_SYS_TYPES_H
  188. # include <sys/types.h>
  189. #endif
  190. #ifdef HAVE_SETJMP_H
  191. # include <setjmp.h>
  192. #endif
  193. /* includes end */"
  194. AC_CHECK_HEADERS(
  195. sys/types.h setjmp.h,
  196. [], [], [$curl_includes_setjmp])
  197. ])
  198. dnl CURL_INCLUDES_SIGNAL
  199. dnl -------------------------------------------------
  200. dnl Set up variable with list of headers that must be
  201. dnl included when signal.h is to be included.
  202. AC_DEFUN([CURL_INCLUDES_SIGNAL], [
  203. curl_includes_signal="\
  204. /* includes start */
  205. #ifdef HAVE_SYS_TYPES_H
  206. # include <sys/types.h>
  207. #endif
  208. #ifdef HAVE_SIGNAL_H
  209. # include <signal.h>
  210. #endif
  211. /* includes end */"
  212. AC_CHECK_HEADERS(
  213. sys/types.h signal.h,
  214. [], [], [$curl_includes_signal])
  215. ])
  216. dnl CURL_INCLUDES_SOCKET
  217. dnl -------------------------------------------------
  218. dnl Set up variable with list of headers that must be
  219. dnl included when socket.h is to be included.
  220. AC_DEFUN([CURL_INCLUDES_SOCKET], [
  221. curl_includes_socket="\
  222. /* includes start */
  223. #ifdef HAVE_SYS_TYPES_H
  224. # include <sys/types.h>
  225. #endif
  226. #ifdef HAVE_SOCKET_H
  227. # include <socket.h>
  228. #endif
  229. /* includes end */"
  230. AC_CHECK_HEADERS(
  231. sys/types.h socket.h,
  232. [], [], [$curl_includes_socket])
  233. ])
  234. dnl CURL_INCLUDES_STDIO
  235. dnl -------------------------------------------------
  236. dnl Set up variable with list of headers that must be
  237. dnl included when stdio.h is to be included.
  238. AC_DEFUN([CURL_INCLUDES_STDIO], [
  239. curl_includes_stdio="\
  240. /* includes start */
  241. #ifdef HAVE_SYS_TYPES_H
  242. # include <sys/types.h>
  243. #endif
  244. #ifdef HAVE_STDIO_H
  245. # include <stdio.h>
  246. #endif
  247. /* includes end */"
  248. AC_CHECK_HEADERS(
  249. sys/types.h stdio.h,
  250. [], [], [$curl_includes_stdio])
  251. ])
  252. dnl CURL_INCLUDES_STDLIB
  253. dnl -------------------------------------------------
  254. dnl Set up variable with list of headers that must be
  255. dnl included when stdlib.h is to be included.
  256. AC_DEFUN([CURL_INCLUDES_STDLIB], [
  257. curl_includes_stdlib="\
  258. /* includes start */
  259. #ifdef HAVE_SYS_TYPES_H
  260. # include <sys/types.h>
  261. #endif
  262. #ifdef HAVE_STDLIB_H
  263. # include <stdlib.h>
  264. #endif
  265. /* includes end */"
  266. AC_CHECK_HEADERS(
  267. sys/types.h stdlib.h,
  268. [], [], [$curl_includes_stdlib])
  269. ])
  270. dnl CURL_INCLUDES_STRING
  271. dnl -------------------------------------------------
  272. dnl Set up variable with list of headers that must be
  273. dnl included when string(s).h is to be included.
  274. AC_DEFUN([CURL_INCLUDES_STRING], [
  275. curl_includes_string="\
  276. /* includes start */
  277. #ifdef HAVE_SYS_TYPES_H
  278. # include <sys/types.h>
  279. #endif
  280. #ifdef HAVE_STRING_H
  281. # include <string.h>
  282. #endif
  283. #ifdef HAVE_STRINGS_H
  284. # include <strings.h>
  285. #endif
  286. /* includes end */"
  287. AC_CHECK_HEADERS(
  288. sys/types.h string.h strings.h,
  289. [], [], [$curl_includes_string])
  290. ])
  291. dnl CURL_INCLUDES_STROPTS
  292. dnl -------------------------------------------------
  293. dnl Set up variable with list of headers that must be
  294. dnl included when stropts.h is to be included.
  295. AC_DEFUN([CURL_INCLUDES_STROPTS], [
  296. curl_includes_stropts="\
  297. /* includes start */
  298. #ifdef HAVE_SYS_TYPES_H
  299. # include <sys/types.h>
  300. #endif
  301. #ifdef HAVE_UNISTD_H
  302. # include <unistd.h>
  303. #endif
  304. #ifdef HAVE_SYS_SOCKET_H
  305. # include <sys/socket.h>
  306. #endif
  307. #ifdef HAVE_SYS_IOCTL_H
  308. # include <sys/ioctl.h>
  309. #endif
  310. #ifdef HAVE_STROPTS_H
  311. # include <stropts.h>
  312. #endif
  313. /* includes end */"
  314. AC_CHECK_HEADERS(
  315. sys/types.h unistd.h sys/socket.h sys/ioctl.h stropts.h,
  316. [], [], [$curl_includes_stropts])
  317. ])
  318. dnl CURL_INCLUDES_SYS_SOCKET
  319. dnl -------------------------------------------------
  320. dnl Set up variable with list of headers that must be
  321. dnl included when sys/socket.h is to be included.
  322. AC_DEFUN([CURL_INCLUDES_SYS_SOCKET], [
  323. curl_includes_sys_socket="\
  324. /* includes start */
  325. #ifdef HAVE_SYS_TYPES_H
  326. # include <sys/types.h>
  327. #endif
  328. #ifdef HAVE_SYS_SOCKET_H
  329. # include <sys/socket.h>
  330. #endif
  331. /* includes end */"
  332. AC_CHECK_HEADERS(
  333. sys/types.h sys/socket.h,
  334. [], [], [$curl_includes_sys_socket])
  335. ])
  336. dnl CURL_INCLUDES_SYS_TYPES
  337. dnl -------------------------------------------------
  338. dnl Set up variable with list of headers that must be
  339. dnl included when sys/types.h is to be included.
  340. AC_DEFUN([CURL_INCLUDES_SYS_TYPES], [
  341. curl_includes_sys_types="\
  342. /* includes start */
  343. #ifdef HAVE_SYS_TYPES_H
  344. # include <sys/types.h>
  345. #endif
  346. /* includes end */"
  347. AC_CHECK_HEADERS(
  348. sys/types.h,
  349. [], [], [$curl_includes_sys_types])
  350. ])
  351. dnl CURL_INCLUDES_SYS_UIO
  352. dnl -------------------------------------------------
  353. dnl Set up variable with list of headers that must be
  354. dnl included when sys/uio.h is to be included.
  355. AC_DEFUN([CURL_INCLUDES_SYS_UIO], [
  356. curl_includes_sys_uio="\
  357. /* includes start */
  358. #ifdef HAVE_SYS_TYPES_H
  359. # include <sys/types.h>
  360. #endif
  361. #ifdef HAVE_SYS_UIO_H
  362. # include <sys/uio.h>
  363. #endif
  364. /* includes end */"
  365. AC_CHECK_HEADERS(
  366. sys/types.h sys/uio.h,
  367. [], [], [$curl_includes_sys_uio])
  368. ])
  369. dnl CURL_INCLUDES_SYS_XATTR
  370. dnl -------------------------------------------------
  371. dnl Set up variable with list of headers that must be
  372. dnl included when sys/xattr.h is to be included.
  373. AC_DEFUN([CURL_INCLUDES_SYS_XATTR], [
  374. curl_includes_sys_xattr="\
  375. /* includes start */
  376. #ifdef HAVE_SYS_TYPES_H
  377. # include <sys/types.h>
  378. #endif
  379. #ifdef HAVE_SYS_XATTR_H
  380. # include <sys/xattr.h>
  381. #endif
  382. /* includes end */"
  383. AC_CHECK_HEADERS(
  384. sys/types.h sys/xattr.h,
  385. [], [], [$curl_includes_sys_xattr])
  386. ])
  387. dnl CURL_INCLUDES_TIME
  388. dnl -------------------------------------------------
  389. dnl Set up variable with list of headers that must be
  390. dnl included when time.h is to be included.
  391. AC_DEFUN([CURL_INCLUDES_TIME], [
  392. AC_REQUIRE([AC_HEADER_TIME])dnl
  393. curl_includes_time="\
  394. /* includes start */
  395. #ifdef HAVE_SYS_TYPES_H
  396. # include <sys/types.h>
  397. #endif
  398. #ifdef HAVE_SYS_TIME_H
  399. # include <sys/time.h>
  400. # ifdef TIME_WITH_SYS_TIME
  401. # include <time.h>
  402. # endif
  403. #else
  404. # ifdef HAVE_TIME_H
  405. # include <time.h>
  406. # endif
  407. #endif
  408. /* includes end */"
  409. AC_CHECK_HEADERS(
  410. sys/types.h sys/time.h time.h,
  411. [], [], [$curl_includes_time])
  412. ])
  413. dnl CURL_INCLUDES_UNISTD
  414. dnl -------------------------------------------------
  415. dnl Set up variable with list of headers that must be
  416. dnl included when unistd.h is to be included.
  417. AC_DEFUN([CURL_INCLUDES_UNISTD], [
  418. curl_includes_unistd="\
  419. /* includes start */
  420. #ifdef HAVE_SYS_TYPES_H
  421. # include <sys/types.h>
  422. #endif
  423. #ifdef HAVE_UNISTD_H
  424. # include <unistd.h>
  425. #endif
  426. /* includes end */"
  427. AC_CHECK_HEADERS(
  428. sys/types.h unistd.h,
  429. [], [], [$curl_includes_unistd])
  430. ])
  431. dnl CURL_INCLUDES_WINSOCK2
  432. dnl -------------------------------------------------
  433. dnl Set up variable with list of headers that must be
  434. dnl included when winsock(2).h is to be included.
  435. AC_DEFUN([CURL_INCLUDES_WINSOCK2], [
  436. curl_includes_winsock2="\
  437. /* includes start */
  438. #ifdef HAVE_WINDOWS_H
  439. # ifndef WIN32_LEAN_AND_MEAN
  440. # define WIN32_LEAN_AND_MEAN
  441. # endif
  442. # include <windows.h>
  443. # ifdef HAVE_WINSOCK2_H
  444. # include <winsock2.h>
  445. # else
  446. # ifdef HAVE_WINSOCK_H
  447. # include <winsock.h>
  448. # endif
  449. # endif
  450. #endif
  451. /* includes end */"
  452. CURL_CHECK_HEADER_WINDOWS
  453. CURL_CHECK_HEADER_WINSOCK
  454. CURL_CHECK_HEADER_WINSOCK2
  455. ])
  456. dnl CURL_INCLUDES_WS2TCPIP
  457. dnl -------------------------------------------------
  458. dnl Set up variable with list of headers that must be
  459. dnl included when ws2tcpip.h is to be included.
  460. AC_DEFUN([CURL_INCLUDES_WS2TCPIP], [
  461. curl_includes_ws2tcpip="\
  462. /* includes start */
  463. #ifdef HAVE_WINDOWS_H
  464. # ifndef WIN32_LEAN_AND_MEAN
  465. # define WIN32_LEAN_AND_MEAN
  466. # endif
  467. # include <windows.h>
  468. # ifdef HAVE_WINSOCK2_H
  469. # include <winsock2.h>
  470. # ifdef HAVE_WS2TCPIP_H
  471. # include <ws2tcpip.h>
  472. # endif
  473. # endif
  474. #endif
  475. /* includes end */"
  476. CURL_CHECK_HEADER_WINDOWS
  477. CURL_CHECK_HEADER_WINSOCK2
  478. CURL_CHECK_HEADER_WS2TCPIP
  479. ])
  480. dnl CURL_PREPROCESS_CALLCONV
  481. dnl -------------------------------------------------
  482. dnl Set up variable with a preprocessor block which
  483. dnl defines function calling convention.
  484. AC_DEFUN([CURL_PREPROCESS_CALLCONV], [
  485. curl_preprocess_callconv="\
  486. /* preprocess start */
  487. #ifdef HAVE_WINDOWS_H
  488. # define FUNCALLCONV __stdcall
  489. #else
  490. # define FUNCALLCONV
  491. #endif
  492. /* preprocess end */"
  493. ])
  494. dnl CURL_CHECK_FUNC_ALARM
  495. dnl -------------------------------------------------
  496. dnl Verify if alarm is available, prototyped, and
  497. dnl can be compiled. If all of these are true, and
  498. dnl usage has not been previously disallowed with
  499. dnl shell variable curl_disallow_alarm, then
  500. dnl HAVE_ALARM will be defined.
  501. AC_DEFUN([CURL_CHECK_FUNC_ALARM], [
  502. AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
  503. #
  504. tst_links_alarm="unknown"
  505. tst_proto_alarm="unknown"
  506. tst_compi_alarm="unknown"
  507. tst_allow_alarm="unknown"
  508. #
  509. AC_MSG_CHECKING([if alarm can be linked])
  510. AC_LINK_IFELSE([
  511. AC_LANG_FUNC_LINK_TRY([alarm])
  512. ],[
  513. AC_MSG_RESULT([yes])
  514. tst_links_alarm="yes"
  515. ],[
  516. AC_MSG_RESULT([no])
  517. tst_links_alarm="no"
  518. ])
  519. #
  520. if test "$tst_links_alarm" = "yes"; then
  521. AC_MSG_CHECKING([if alarm is prototyped])
  522. AC_EGREP_CPP([alarm],[
  523. $curl_includes_unistd
  524. ],[
  525. AC_MSG_RESULT([yes])
  526. tst_proto_alarm="yes"
  527. ],[
  528. AC_MSG_RESULT([no])
  529. tst_proto_alarm="no"
  530. ])
  531. fi
  532. #
  533. if test "$tst_proto_alarm" = "yes"; then
  534. AC_MSG_CHECKING([if alarm is compilable])
  535. AC_COMPILE_IFELSE([
  536. AC_LANG_PROGRAM([[
  537. $curl_includes_unistd
  538. ]],[[
  539. if(0 != alarm(0))
  540. return 1;
  541. ]])
  542. ],[
  543. AC_MSG_RESULT([yes])
  544. tst_compi_alarm="yes"
  545. ],[
  546. AC_MSG_RESULT([no])
  547. tst_compi_alarm="no"
  548. ])
  549. fi
  550. #
  551. if test "$tst_compi_alarm" = "yes"; then
  552. AC_MSG_CHECKING([if alarm usage allowed])
  553. if test "x$curl_disallow_alarm" != "xyes"; then
  554. AC_MSG_RESULT([yes])
  555. tst_allow_alarm="yes"
  556. else
  557. AC_MSG_RESULT([no])
  558. tst_allow_alarm="no"
  559. fi
  560. fi
  561. #
  562. AC_MSG_CHECKING([if alarm might be used])
  563. if test "$tst_links_alarm" = "yes" &&
  564. test "$tst_proto_alarm" = "yes" &&
  565. test "$tst_compi_alarm" = "yes" &&
  566. test "$tst_allow_alarm" = "yes"; then
  567. AC_MSG_RESULT([yes])
  568. AC_DEFINE_UNQUOTED(HAVE_ALARM, 1,
  569. [Define to 1 if you have the alarm function.])
  570. curl_cv_func_alarm="yes"
  571. else
  572. AC_MSG_RESULT([no])
  573. curl_cv_func_alarm="no"
  574. fi
  575. ])
  576. dnl CURL_CHECK_FUNC_BASENAME
  577. dnl -------------------------------------------------
  578. dnl Verify if basename is available, prototyped, and
  579. dnl can be compiled. If all of these are true, and
  580. dnl usage has not been previously disallowed with
  581. dnl shell variable curl_disallow_basename, then
  582. dnl HAVE_BASENAME will be defined.
  583. AC_DEFUN([CURL_CHECK_FUNC_BASENAME], [
  584. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  585. AC_REQUIRE([CURL_INCLUDES_LIBGEN])dnl
  586. AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
  587. #
  588. tst_links_basename="unknown"
  589. tst_proto_basename="unknown"
  590. tst_compi_basename="unknown"
  591. tst_allow_basename="unknown"
  592. #
  593. AC_MSG_CHECKING([if basename can be linked])
  594. AC_LINK_IFELSE([
  595. AC_LANG_FUNC_LINK_TRY([basename])
  596. ],[
  597. AC_MSG_RESULT([yes])
  598. tst_links_basename="yes"
  599. ],[
  600. AC_MSG_RESULT([no])
  601. tst_links_basename="no"
  602. ])
  603. #
  604. if test "$tst_links_basename" = "yes"; then
  605. AC_MSG_CHECKING([if basename is prototyped])
  606. AC_EGREP_CPP([basename],[
  607. $curl_includes_string
  608. $curl_includes_libgen
  609. $curl_includes_unistd
  610. ],[
  611. AC_MSG_RESULT([yes])
  612. tst_proto_basename="yes"
  613. ],[
  614. AC_MSG_RESULT([no])
  615. tst_proto_basename="no"
  616. ])
  617. fi
  618. #
  619. if test "$tst_proto_basename" = "yes"; then
  620. AC_MSG_CHECKING([if basename is compilable])
  621. AC_COMPILE_IFELSE([
  622. AC_LANG_PROGRAM([[
  623. $curl_includes_string
  624. $curl_includes_libgen
  625. $curl_includes_unistd
  626. ]],[[
  627. if(0 != basename(0))
  628. return 1;
  629. ]])
  630. ],[
  631. AC_MSG_RESULT([yes])
  632. tst_compi_basename="yes"
  633. ],[
  634. AC_MSG_RESULT([no])
  635. tst_compi_basename="no"
  636. ])
  637. fi
  638. #
  639. if test "$tst_compi_basename" = "yes"; then
  640. AC_MSG_CHECKING([if basename usage allowed])
  641. if test "x$curl_disallow_basename" != "xyes"; then
  642. AC_MSG_RESULT([yes])
  643. tst_allow_basename="yes"
  644. else
  645. AC_MSG_RESULT([no])
  646. tst_allow_basename="no"
  647. fi
  648. fi
  649. #
  650. AC_MSG_CHECKING([if basename might be used])
  651. if test "$tst_links_basename" = "yes" &&
  652. test "$tst_proto_basename" = "yes" &&
  653. test "$tst_compi_basename" = "yes" &&
  654. test "$tst_allow_basename" = "yes"; then
  655. AC_MSG_RESULT([yes])
  656. AC_DEFINE_UNQUOTED(HAVE_BASENAME, 1,
  657. [Define to 1 if you have the basename function.])
  658. curl_cv_func_basename="yes"
  659. else
  660. AC_MSG_RESULT([no])
  661. curl_cv_func_basename="no"
  662. fi
  663. ])
  664. dnl CURL_CHECK_FUNC_CLOSESOCKET
  665. dnl -------------------------------------------------
  666. dnl Verify if closesocket is available, prototyped, and
  667. dnl can be compiled. If all of these are true, and
  668. dnl usage has not been previously disallowed with
  669. dnl shell variable curl_disallow_closesocket, then
  670. dnl HAVE_CLOSESOCKET will be defined.
  671. AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET], [
  672. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  673. AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
  674. #
  675. tst_links_closesocket="unknown"
  676. tst_proto_closesocket="unknown"
  677. tst_compi_closesocket="unknown"
  678. tst_allow_closesocket="unknown"
  679. #
  680. AC_MSG_CHECKING([if closesocket can be linked])
  681. AC_LINK_IFELSE([
  682. AC_LANG_PROGRAM([[
  683. $curl_includes_winsock2
  684. $curl_includes_socket
  685. ]],[[
  686. if(0 != closesocket(0))
  687. return 1;
  688. ]])
  689. ],[
  690. AC_MSG_RESULT([yes])
  691. tst_links_closesocket="yes"
  692. ],[
  693. AC_MSG_RESULT([no])
  694. tst_links_closesocket="no"
  695. ])
  696. #
  697. if test "$tst_links_closesocket" = "yes"; then
  698. AC_MSG_CHECKING([if closesocket is prototyped])
  699. AC_EGREP_CPP([closesocket],[
  700. $curl_includes_winsock2
  701. $curl_includes_socket
  702. ],[
  703. AC_MSG_RESULT([yes])
  704. tst_proto_closesocket="yes"
  705. ],[
  706. AC_MSG_RESULT([no])
  707. tst_proto_closesocket="no"
  708. ])
  709. fi
  710. #
  711. if test "$tst_proto_closesocket" = "yes"; then
  712. AC_MSG_CHECKING([if closesocket is compilable])
  713. AC_COMPILE_IFELSE([
  714. AC_LANG_PROGRAM([[
  715. $curl_includes_winsock2
  716. $curl_includes_socket
  717. ]],[[
  718. if(0 != closesocket(0))
  719. return 1;
  720. ]])
  721. ],[
  722. AC_MSG_RESULT([yes])
  723. tst_compi_closesocket="yes"
  724. ],[
  725. AC_MSG_RESULT([no])
  726. tst_compi_closesocket="no"
  727. ])
  728. fi
  729. #
  730. if test "$tst_compi_closesocket" = "yes"; then
  731. AC_MSG_CHECKING([if closesocket usage allowed])
  732. if test "x$curl_disallow_closesocket" != "xyes"; then
  733. AC_MSG_RESULT([yes])
  734. tst_allow_closesocket="yes"
  735. else
  736. AC_MSG_RESULT([no])
  737. tst_allow_closesocket="no"
  738. fi
  739. fi
  740. #
  741. AC_MSG_CHECKING([if closesocket might be used])
  742. if test "$tst_links_closesocket" = "yes" &&
  743. test "$tst_proto_closesocket" = "yes" &&
  744. test "$tst_compi_closesocket" = "yes" &&
  745. test "$tst_allow_closesocket" = "yes"; then
  746. AC_MSG_RESULT([yes])
  747. AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET, 1,
  748. [Define to 1 if you have the closesocket function.])
  749. curl_cv_func_closesocket="yes"
  750. else
  751. AC_MSG_RESULT([no])
  752. curl_cv_func_closesocket="no"
  753. fi
  754. ])
  755. dnl CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  756. dnl -------------------------------------------------
  757. dnl Verify if CloseSocket is available, prototyped, and
  758. dnl can be compiled. If all of these are true, and
  759. dnl usage has not been previously disallowed with
  760. dnl shell variable curl_disallow_closesocket_camel,
  761. dnl then HAVE_CLOSESOCKET_CAMEL will be defined.
  762. AC_DEFUN([CURL_CHECK_FUNC_CLOSESOCKET_CAMEL], [
  763. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  764. #
  765. tst_links_closesocket_camel="unknown"
  766. tst_proto_closesocket_camel="unknown"
  767. tst_compi_closesocket_camel="unknown"
  768. tst_allow_closesocket_camel="unknown"
  769. #
  770. AC_MSG_CHECKING([if CloseSocket can be linked])
  771. AC_LINK_IFELSE([
  772. AC_LANG_PROGRAM([[
  773. $curl_includes_sys_socket
  774. ]],[[
  775. if(0 != CloseSocket(0))
  776. return 1;
  777. ]])
  778. ],[
  779. AC_MSG_RESULT([yes])
  780. tst_links_closesocket_camel="yes"
  781. ],[
  782. AC_MSG_RESULT([no])
  783. tst_links_closesocket_camel="no"
  784. ])
  785. #
  786. if test "$tst_links_closesocket_camel" = "yes"; then
  787. AC_MSG_CHECKING([if CloseSocket is prototyped])
  788. AC_EGREP_CPP([CloseSocket],[
  789. $curl_includes_sys_socket
  790. ],[
  791. AC_MSG_RESULT([yes])
  792. tst_proto_closesocket_camel="yes"
  793. ],[
  794. AC_MSG_RESULT([no])
  795. tst_proto_closesocket_camel="no"
  796. ])
  797. fi
  798. #
  799. if test "$tst_proto_closesocket_camel" = "yes"; then
  800. AC_MSG_CHECKING([if CloseSocket is compilable])
  801. AC_COMPILE_IFELSE([
  802. AC_LANG_PROGRAM([[
  803. $curl_includes_sys_socket
  804. ]],[[
  805. if(0 != CloseSocket(0))
  806. return 1;
  807. ]])
  808. ],[
  809. AC_MSG_RESULT([yes])
  810. tst_compi_closesocket_camel="yes"
  811. ],[
  812. AC_MSG_RESULT([no])
  813. tst_compi_closesocket_camel="no"
  814. ])
  815. fi
  816. #
  817. if test "$tst_compi_closesocket_camel" = "yes"; then
  818. AC_MSG_CHECKING([if CloseSocket usage allowed])
  819. if test "x$curl_disallow_closesocket_camel" != "xyes"; then
  820. AC_MSG_RESULT([yes])
  821. tst_allow_closesocket_camel="yes"
  822. else
  823. AC_MSG_RESULT([no])
  824. tst_allow_closesocket_camel="no"
  825. fi
  826. fi
  827. #
  828. AC_MSG_CHECKING([if CloseSocket might be used])
  829. if test "$tst_links_closesocket_camel" = "yes" &&
  830. test "$tst_proto_closesocket_camel" = "yes" &&
  831. test "$tst_compi_closesocket_camel" = "yes" &&
  832. test "$tst_allow_closesocket_camel" = "yes"; then
  833. AC_MSG_RESULT([yes])
  834. AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1,
  835. [Define to 1 if you have the CloseSocket camel case function.])
  836. curl_cv_func_closesocket_camel="yes"
  837. else
  838. AC_MSG_RESULT([no])
  839. curl_cv_func_closesocket_camel="no"
  840. fi
  841. ])
  842. dnl CURL_CHECK_FUNC_CONNECT
  843. dnl -------------------------------------------------
  844. dnl Verify if connect is available, prototyped, and
  845. dnl can be compiled. If all of these are true, and
  846. dnl usage has not been previously disallowed with
  847. dnl shell variable curl_disallow_connect, then
  848. dnl HAVE_CONNECT will be defined.
  849. AC_DEFUN([CURL_CHECK_FUNC_CONNECT], [
  850. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  851. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  852. AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
  853. #
  854. tst_links_connect="unknown"
  855. tst_proto_connect="unknown"
  856. tst_compi_connect="unknown"
  857. tst_allow_connect="unknown"
  858. #
  859. AC_MSG_CHECKING([if connect can be linked])
  860. AC_LINK_IFELSE([
  861. AC_LANG_PROGRAM([[
  862. $curl_includes_winsock2
  863. $curl_includes_sys_socket
  864. $curl_includes_socket
  865. ]],[[
  866. if(0 != connect(0, 0, 0))
  867. return 1;
  868. ]])
  869. ],[
  870. AC_MSG_RESULT([yes])
  871. tst_links_connect="yes"
  872. ],[
  873. AC_MSG_RESULT([no])
  874. tst_links_connect="no"
  875. ])
  876. #
  877. if test "$tst_links_connect" = "yes"; then
  878. AC_MSG_CHECKING([if connect is prototyped])
  879. AC_EGREP_CPP([connect],[
  880. $curl_includes_winsock2
  881. $curl_includes_sys_socket
  882. $curl_includes_socket
  883. ],[
  884. AC_MSG_RESULT([yes])
  885. tst_proto_connect="yes"
  886. ],[
  887. AC_MSG_RESULT([no])
  888. tst_proto_connect="no"
  889. ])
  890. fi
  891. #
  892. if test "$tst_proto_connect" = "yes"; then
  893. AC_MSG_CHECKING([if connect is compilable])
  894. AC_COMPILE_IFELSE([
  895. AC_LANG_PROGRAM([[
  896. $curl_includes_winsock2
  897. $curl_includes_sys_socket
  898. $curl_includes_socket
  899. ]],[[
  900. if(0 != connect(0, 0, 0))
  901. return 1;
  902. ]])
  903. ],[
  904. AC_MSG_RESULT([yes])
  905. tst_compi_connect="yes"
  906. ],[
  907. AC_MSG_RESULT([no])
  908. tst_compi_connect="no"
  909. ])
  910. fi
  911. #
  912. if test "$tst_compi_connect" = "yes"; then
  913. AC_MSG_CHECKING([if connect usage allowed])
  914. if test "x$curl_disallow_connect" != "xyes"; then
  915. AC_MSG_RESULT([yes])
  916. tst_allow_connect="yes"
  917. else
  918. AC_MSG_RESULT([no])
  919. tst_allow_connect="no"
  920. fi
  921. fi
  922. #
  923. AC_MSG_CHECKING([if connect might be used])
  924. if test "$tst_links_connect" = "yes" &&
  925. test "$tst_proto_connect" = "yes" &&
  926. test "$tst_compi_connect" = "yes" &&
  927. test "$tst_allow_connect" = "yes"; then
  928. AC_MSG_RESULT([yes])
  929. AC_DEFINE_UNQUOTED(HAVE_CONNECT, 1,
  930. [Define to 1 if you have the connect function.])
  931. curl_cv_func_connect="yes"
  932. else
  933. AC_MSG_RESULT([no])
  934. curl_cv_func_connect="no"
  935. fi
  936. ])
  937. dnl CURL_CHECK_FUNC_FCNTL
  938. dnl -------------------------------------------------
  939. dnl Verify if fcntl is available, prototyped, and
  940. dnl can be compiled. If all of these are true, and
  941. dnl usage has not been previously disallowed with
  942. dnl shell variable curl_disallow_fcntl, then
  943. dnl HAVE_FCNTL will be defined.
  944. AC_DEFUN([CURL_CHECK_FUNC_FCNTL], [
  945. AC_REQUIRE([CURL_INCLUDES_FCNTL])dnl
  946. #
  947. tst_links_fcntl="unknown"
  948. tst_proto_fcntl="unknown"
  949. tst_compi_fcntl="unknown"
  950. tst_allow_fcntl="unknown"
  951. #
  952. AC_MSG_CHECKING([if fcntl can be linked])
  953. AC_LINK_IFELSE([
  954. AC_LANG_FUNC_LINK_TRY([fcntl])
  955. ],[
  956. AC_MSG_RESULT([yes])
  957. tst_links_fcntl="yes"
  958. ],[
  959. AC_MSG_RESULT([no])
  960. tst_links_fcntl="no"
  961. ])
  962. #
  963. if test "$tst_links_fcntl" = "yes"; then
  964. AC_MSG_CHECKING([if fcntl is prototyped])
  965. AC_EGREP_CPP([fcntl],[
  966. $curl_includes_fcntl
  967. ],[
  968. AC_MSG_RESULT([yes])
  969. tst_proto_fcntl="yes"
  970. ],[
  971. AC_MSG_RESULT([no])
  972. tst_proto_fcntl="no"
  973. ])
  974. fi
  975. #
  976. if test "$tst_proto_fcntl" = "yes"; then
  977. AC_MSG_CHECKING([if fcntl is compilable])
  978. AC_COMPILE_IFELSE([
  979. AC_LANG_PROGRAM([[
  980. $curl_includes_fcntl
  981. ]],[[
  982. if(0 != fcntl(0, 0, 0))
  983. return 1;
  984. ]])
  985. ],[
  986. AC_MSG_RESULT([yes])
  987. tst_compi_fcntl="yes"
  988. ],[
  989. AC_MSG_RESULT([no])
  990. tst_compi_fcntl="no"
  991. ])
  992. fi
  993. #
  994. if test "$tst_compi_fcntl" = "yes"; then
  995. AC_MSG_CHECKING([if fcntl usage allowed])
  996. if test "x$curl_disallow_fcntl" != "xyes"; then
  997. AC_MSG_RESULT([yes])
  998. tst_allow_fcntl="yes"
  999. else
  1000. AC_MSG_RESULT([no])
  1001. tst_allow_fcntl="no"
  1002. fi
  1003. fi
  1004. #
  1005. AC_MSG_CHECKING([if fcntl might be used])
  1006. if test "$tst_links_fcntl" = "yes" &&
  1007. test "$tst_proto_fcntl" = "yes" &&
  1008. test "$tst_compi_fcntl" = "yes" &&
  1009. test "$tst_allow_fcntl" = "yes"; then
  1010. AC_MSG_RESULT([yes])
  1011. AC_DEFINE_UNQUOTED(HAVE_FCNTL, 1,
  1012. [Define to 1 if you have the fcntl function.])
  1013. curl_cv_func_fcntl="yes"
  1014. CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
  1015. else
  1016. AC_MSG_RESULT([no])
  1017. curl_cv_func_fcntl="no"
  1018. fi
  1019. ])
  1020. dnl CURL_CHECK_FUNC_FCNTL_O_NONBLOCK
  1021. dnl -------------------------------------------------
  1022. dnl Verify if fcntl with status flag O_NONBLOCK is
  1023. dnl available, can be compiled, and seems to work. If
  1024. dnl all of these are true, then HAVE_FCNTL_O_NONBLOCK
  1025. dnl will be defined.
  1026. AC_DEFUN([CURL_CHECK_FUNC_FCNTL_O_NONBLOCK], [
  1027. #
  1028. tst_compi_fcntl_o_nonblock="unknown"
  1029. tst_allow_fcntl_o_nonblock="unknown"
  1030. #
  1031. case $host_os in
  1032. sunos4* | aix3* | beos*)
  1033. dnl O_NONBLOCK does not work on these platforms
  1034. curl_disallow_fcntl_o_nonblock="yes"
  1035. ;;
  1036. esac
  1037. #
  1038. if test "$curl_cv_func_fcntl" = "yes"; then
  1039. AC_MSG_CHECKING([if fcntl O_NONBLOCK is compilable])
  1040. AC_COMPILE_IFELSE([
  1041. AC_LANG_PROGRAM([[
  1042. $curl_includes_fcntl
  1043. ]],[[
  1044. int flags = 0;
  1045. if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
  1046. return 1;
  1047. ]])
  1048. ],[
  1049. AC_MSG_RESULT([yes])
  1050. tst_compi_fcntl_o_nonblock="yes"
  1051. ],[
  1052. AC_MSG_RESULT([no])
  1053. tst_compi_fcntl_o_nonblock="no"
  1054. ])
  1055. fi
  1056. #
  1057. if test "$tst_compi_fcntl_o_nonblock" = "yes"; then
  1058. AC_MSG_CHECKING([if fcntl O_NONBLOCK usage allowed])
  1059. if test "x$curl_disallow_fcntl_o_nonblock" != "xyes"; then
  1060. AC_MSG_RESULT([yes])
  1061. tst_allow_fcntl_o_nonblock="yes"
  1062. else
  1063. AC_MSG_RESULT([no])
  1064. tst_allow_fcntl_o_nonblock="no"
  1065. fi
  1066. fi
  1067. #
  1068. AC_MSG_CHECKING([if fcntl O_NONBLOCK might be used])
  1069. if test "$tst_compi_fcntl_o_nonblock" = "yes" &&
  1070. test "$tst_allow_fcntl_o_nonblock" = "yes"; then
  1071. AC_MSG_RESULT([yes])
  1072. AC_DEFINE_UNQUOTED(HAVE_FCNTL_O_NONBLOCK, 1,
  1073. [Define to 1 if you have a working fcntl O_NONBLOCK function.])
  1074. curl_cv_func_fcntl_o_nonblock="yes"
  1075. else
  1076. AC_MSG_RESULT([no])
  1077. curl_cv_func_fcntl_o_nonblock="no"
  1078. fi
  1079. ])
  1080. dnl CURL_CHECK_FUNC_FDOPEN
  1081. dnl -------------------------------------------------
  1082. dnl Verify if fdopen is available, prototyped, and
  1083. dnl can be compiled. If all of these are true, and
  1084. dnl usage has not been previously disallowed with
  1085. dnl shell variable curl_disallow_fdopen, then
  1086. dnl HAVE_FDOPEN will be defined.
  1087. AC_DEFUN([CURL_CHECK_FUNC_FDOPEN], [
  1088. AC_REQUIRE([CURL_INCLUDES_STDIO])dnl
  1089. #
  1090. tst_links_fdopen="unknown"
  1091. tst_proto_fdopen="unknown"
  1092. tst_compi_fdopen="unknown"
  1093. tst_allow_fdopen="unknown"
  1094. #
  1095. AC_MSG_CHECKING([if fdopen can be linked])
  1096. AC_LINK_IFELSE([
  1097. AC_LANG_FUNC_LINK_TRY([fdopen])
  1098. ],[
  1099. AC_MSG_RESULT([yes])
  1100. tst_links_fdopen="yes"
  1101. ],[
  1102. AC_MSG_RESULT([no])
  1103. tst_links_fdopen="no"
  1104. ])
  1105. #
  1106. if test "$tst_links_fdopen" = "yes"; then
  1107. AC_MSG_CHECKING([if fdopen is prototyped])
  1108. AC_EGREP_CPP([fdopen],[
  1109. $curl_includes_stdio
  1110. ],[
  1111. AC_MSG_RESULT([yes])
  1112. tst_proto_fdopen="yes"
  1113. ],[
  1114. AC_MSG_RESULT([no])
  1115. tst_proto_fdopen="no"
  1116. ])
  1117. fi
  1118. #
  1119. if test "$tst_proto_fdopen" = "yes"; then
  1120. AC_MSG_CHECKING([if fdopen is compilable])
  1121. AC_COMPILE_IFELSE([
  1122. AC_LANG_PROGRAM([[
  1123. $curl_includes_stdio
  1124. ]],[[
  1125. if(0 != fdopen(0, 0))
  1126. return 1;
  1127. ]])
  1128. ],[
  1129. AC_MSG_RESULT([yes])
  1130. tst_compi_fdopen="yes"
  1131. ],[
  1132. AC_MSG_RESULT([no])
  1133. tst_compi_fdopen="no"
  1134. ])
  1135. fi
  1136. #
  1137. if test "$tst_compi_fdopen" = "yes"; then
  1138. AC_MSG_CHECKING([if fdopen usage allowed])
  1139. if test "x$curl_disallow_fdopen" != "xyes"; then
  1140. AC_MSG_RESULT([yes])
  1141. tst_allow_fdopen="yes"
  1142. else
  1143. AC_MSG_RESULT([no])
  1144. tst_allow_fdopen="no"
  1145. fi
  1146. fi
  1147. #
  1148. AC_MSG_CHECKING([if fdopen might be used])
  1149. if test "$tst_links_fdopen" = "yes" &&
  1150. test "$tst_proto_fdopen" = "yes" &&
  1151. test "$tst_compi_fdopen" = "yes" &&
  1152. test "$tst_allow_fdopen" = "yes"; then
  1153. AC_MSG_RESULT([yes])
  1154. AC_DEFINE_UNQUOTED(HAVE_FDOPEN, 1,
  1155. [Define to 1 if you have the fdopen function.])
  1156. curl_cv_func_fdopen="yes"
  1157. else
  1158. AC_MSG_RESULT([no])
  1159. curl_cv_func_fdopen="no"
  1160. fi
  1161. ])
  1162. dnl CURL_CHECK_FUNC_FGETXATTR
  1163. dnl -------------------------------------------------
  1164. dnl Verify if fgetxattr is available, prototyped, and
  1165. dnl can be compiled. If all of these are true, and
  1166. dnl usage has not been previously disallowed with
  1167. dnl shell variable curl_disallow_fgetxattr, then
  1168. dnl HAVE_FGETXATTR will be defined.
  1169. AC_DEFUN([CURL_CHECK_FUNC_FGETXATTR], [
  1170. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  1171. #
  1172. tst_links_fgetxattr="unknown"
  1173. tst_proto_fgetxattr="unknown"
  1174. tst_compi_fgetxattr="unknown"
  1175. tst_allow_fgetxattr="unknown"
  1176. tst_nargs_fgetxattr="unknown"
  1177. #
  1178. AC_MSG_CHECKING([if fgetxattr can be linked])
  1179. AC_LINK_IFELSE([
  1180. AC_LANG_FUNC_LINK_TRY([fgetxattr])
  1181. ],[
  1182. AC_MSG_RESULT([yes])
  1183. tst_links_fgetxattr="yes"
  1184. ],[
  1185. AC_MSG_RESULT([no])
  1186. tst_links_fgetxattr="no"
  1187. ])
  1188. #
  1189. if test "$tst_links_fgetxattr" = "yes"; then
  1190. AC_MSG_CHECKING([if fgetxattr is prototyped])
  1191. AC_EGREP_CPP([fgetxattr],[
  1192. $curl_includes_sys_xattr
  1193. ],[
  1194. AC_MSG_RESULT([yes])
  1195. tst_proto_fgetxattr="yes"
  1196. ],[
  1197. AC_MSG_RESULT([no])
  1198. tst_proto_fgetxattr="no"
  1199. ])
  1200. fi
  1201. #
  1202. if test "$tst_proto_fgetxattr" = "yes"; then
  1203. if test "$tst_nargs_fgetxattr" = "unknown"; then
  1204. AC_MSG_CHECKING([if fgetxattr takes 4 args.])
  1205. AC_COMPILE_IFELSE([
  1206. AC_LANG_PROGRAM([[
  1207. $curl_includes_sys_xattr
  1208. ]],[[
  1209. if(0 != fgetxattr(0, 0, 0, 0))
  1210. return 1;
  1211. ]])
  1212. ],[
  1213. AC_MSG_RESULT([yes])
  1214. tst_compi_fgetxattr="yes"
  1215. tst_nargs_fgetxattr="4"
  1216. ],[
  1217. AC_MSG_RESULT([no])
  1218. tst_compi_fgetxattr="no"
  1219. ])
  1220. fi
  1221. if test "$tst_nargs_fgetxattr" = "unknown"; then
  1222. AC_MSG_CHECKING([if fgetxattr takes 6 args.])
  1223. AC_COMPILE_IFELSE([
  1224. AC_LANG_PROGRAM([[
  1225. $curl_includes_sys_xattr
  1226. ]],[[
  1227. if(0 != fgetxattr(0, 0, 0, 0, 0, 0))
  1228. return 1;
  1229. ]])
  1230. ],[
  1231. AC_MSG_RESULT([yes])
  1232. tst_compi_fgetxattr="yes"
  1233. tst_nargs_fgetxattr="6"
  1234. ],[
  1235. AC_MSG_RESULT([no])
  1236. tst_compi_fgetxattr="no"
  1237. ])
  1238. fi
  1239. AC_MSG_CHECKING([if fgetxattr is compilable])
  1240. if test "$tst_compi_fgetxattr" = "yes"; then
  1241. AC_MSG_RESULT([yes])
  1242. else
  1243. AC_MSG_RESULT([no])
  1244. fi
  1245. fi
  1246. #
  1247. if test "$tst_compi_fgetxattr" = "yes"; then
  1248. AC_MSG_CHECKING([if fgetxattr usage allowed])
  1249. if test "x$curl_disallow_fgetxattr" != "xyes"; then
  1250. AC_MSG_RESULT([yes])
  1251. tst_allow_fgetxattr="yes"
  1252. else
  1253. AC_MSG_RESULT([no])
  1254. tst_allow_fgetxattr="no"
  1255. fi
  1256. fi
  1257. #
  1258. AC_MSG_CHECKING([if fgetxattr might be used])
  1259. if test "$tst_links_fgetxattr" = "yes" &&
  1260. test "$tst_proto_fgetxattr" = "yes" &&
  1261. test "$tst_compi_fgetxattr" = "yes" &&
  1262. test "$tst_allow_fgetxattr" = "yes"; then
  1263. AC_MSG_RESULT([yes])
  1264. AC_DEFINE_UNQUOTED(HAVE_FGETXATTR, 1,
  1265. [Define to 1 if you have the fgetxattr function.])
  1266. dnl AC_DEFINE_UNQUOTED(FGETXATTR_ARGS, $tst_nargs_fgetxattr,
  1267. dnl [Specifies the number of arguments to fgetxattr])
  1268. #
  1269. if test "$tst_nargs_fgetxattr" -eq "4"; then
  1270. AC_DEFINE(HAVE_FGETXATTR_4, 1, [fgetxattr() takes 4 args])
  1271. elif test "$tst_nargs_fgetxattr" -eq "6"; then
  1272. AC_DEFINE(HAVE_FGETXATTR_6, 1, [fgetxattr() takes 6 args])
  1273. fi
  1274. #
  1275. curl_cv_func_fgetxattr="yes"
  1276. else
  1277. AC_MSG_RESULT([no])
  1278. curl_cv_func_fgetxattr="no"
  1279. fi
  1280. ])
  1281. dnl CURL_CHECK_FUNC_FLISTXATTR
  1282. dnl -------------------------------------------------
  1283. dnl Verify if flistxattr is available, prototyped, and
  1284. dnl can be compiled. If all of these are true, and
  1285. dnl usage has not been previously disallowed with
  1286. dnl shell variable curl_disallow_flistxattr, then
  1287. dnl HAVE_FLISTXATTR will be defined.
  1288. AC_DEFUN([CURL_CHECK_FUNC_FLISTXATTR], [
  1289. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  1290. #
  1291. tst_links_flistxattr="unknown"
  1292. tst_proto_flistxattr="unknown"
  1293. tst_compi_flistxattr="unknown"
  1294. tst_allow_flistxattr="unknown"
  1295. tst_nargs_flistxattr="unknown"
  1296. #
  1297. AC_MSG_CHECKING([if flistxattr can be linked])
  1298. AC_LINK_IFELSE([
  1299. AC_LANG_FUNC_LINK_TRY([flistxattr])
  1300. ],[
  1301. AC_MSG_RESULT([yes])
  1302. tst_links_flistxattr="yes"
  1303. ],[
  1304. AC_MSG_RESULT([no])
  1305. tst_links_flistxattr="no"
  1306. ])
  1307. #
  1308. if test "$tst_links_flistxattr" = "yes"; then
  1309. AC_MSG_CHECKING([if flistxattr is prototyped])
  1310. AC_EGREP_CPP([flistxattr],[
  1311. $curl_includes_sys_xattr
  1312. ],[
  1313. AC_MSG_RESULT([yes])
  1314. tst_proto_flistxattr="yes"
  1315. ],[
  1316. AC_MSG_RESULT([no])
  1317. tst_proto_flistxattr="no"
  1318. ])
  1319. fi
  1320. #
  1321. if test "$tst_proto_flistxattr" = "yes"; then
  1322. if test "$tst_nargs_flistxattr" = "unknown"; then
  1323. AC_MSG_CHECKING([if flistxattr takes 3 args.])
  1324. AC_COMPILE_IFELSE([
  1325. AC_LANG_PROGRAM([[
  1326. $curl_includes_sys_xattr
  1327. ]],[[
  1328. if(0 != flistxattr(0, 0, 0))
  1329. return 1;
  1330. ]])
  1331. ],[
  1332. AC_MSG_RESULT([yes])
  1333. tst_compi_flistxattr="yes"
  1334. tst_nargs_flistxattr="3"
  1335. ],[
  1336. AC_MSG_RESULT([no])
  1337. tst_compi_flistxattr="no"
  1338. ])
  1339. fi
  1340. if test "$tst_nargs_flistxattr" = "unknown"; then
  1341. AC_MSG_CHECKING([if flistxattr takes 4 args.])
  1342. AC_COMPILE_IFELSE([
  1343. AC_LANG_PROGRAM([[
  1344. $curl_includes_sys_xattr
  1345. ]],[[
  1346. if(0 != flistxattr(0, 0, 0, 0))
  1347. return 1;
  1348. ]])
  1349. ],[
  1350. AC_MSG_RESULT([yes])
  1351. tst_compi_flistxattr="yes"
  1352. tst_nargs_flistxattr="4"
  1353. ],[
  1354. AC_MSG_RESULT([no])
  1355. tst_compi_flistxattr="no"
  1356. ])
  1357. fi
  1358. AC_MSG_CHECKING([if flistxattr is compilable])
  1359. if test "$tst_compi_flistxattr" = "yes"; then
  1360. AC_MSG_RESULT([yes])
  1361. else
  1362. AC_MSG_RESULT([no])
  1363. fi
  1364. fi
  1365. #
  1366. if test "$tst_compi_flistxattr" = "yes"; then
  1367. AC_MSG_CHECKING([if flistxattr usage allowed])
  1368. if test "x$curl_disallow_flistxattr" != "xyes"; then
  1369. AC_MSG_RESULT([yes])
  1370. tst_allow_flistxattr="yes"
  1371. else
  1372. AC_MSG_RESULT([no])
  1373. tst_allow_flistxattr="no"
  1374. fi
  1375. fi
  1376. #
  1377. AC_MSG_CHECKING([if flistxattr might be used])
  1378. if test "$tst_links_flistxattr" = "yes" &&
  1379. test "$tst_proto_flistxattr" = "yes" &&
  1380. test "$tst_compi_flistxattr" = "yes" &&
  1381. test "$tst_allow_flistxattr" = "yes"; then
  1382. AC_MSG_RESULT([yes])
  1383. AC_DEFINE_UNQUOTED(HAVE_FLISTXATTR, 1,
  1384. [Define to 1 if you have the flistxattr function.])
  1385. dnl AC_DEFINE_UNQUOTED(FLISTXATTR_ARGS, $tst_nargs_flistxattr,
  1386. dnl [Specifies the number of arguments to flistxattr])
  1387. #
  1388. if test "$tst_nargs_flistxattr" -eq "3"; then
  1389. AC_DEFINE(HAVE_FLISTXATTR_3, 1, [flistxattr() takes 3 args])
  1390. elif test "$tst_nargs_flistxattr" -eq "4"; then
  1391. AC_DEFINE(HAVE_FLISTXATTR_4, 1, [flistxattr() takes 4 args])
  1392. fi
  1393. #
  1394. curl_cv_func_flistxattr="yes"
  1395. else
  1396. AC_MSG_RESULT([no])
  1397. curl_cv_func_flistxattr="no"
  1398. fi
  1399. ])
  1400. dnl CURL_CHECK_FUNC_FREEADDRINFO
  1401. dnl -------------------------------------------------
  1402. dnl Verify if freeaddrinfo is available, prototyped,
  1403. dnl and can be compiled. If all of these are true,
  1404. dnl and usage has not been previously disallowed with
  1405. dnl shell variable curl_disallow_freeaddrinfo, then
  1406. dnl HAVE_FREEADDRINFO will be defined.
  1407. AC_DEFUN([CURL_CHECK_FUNC_FREEADDRINFO], [
  1408. AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
  1409. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  1410. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  1411. #
  1412. tst_links_freeaddrinfo="unknown"
  1413. tst_proto_freeaddrinfo="unknown"
  1414. tst_compi_freeaddrinfo="unknown"
  1415. tst_allow_freeaddrinfo="unknown"
  1416. #
  1417. AC_MSG_CHECKING([if freeaddrinfo can be linked])
  1418. AC_LINK_IFELSE([
  1419. AC_LANG_PROGRAM([[
  1420. $curl_includes_ws2tcpip
  1421. $curl_includes_sys_socket
  1422. $curl_includes_netdb
  1423. ]],[[
  1424. freeaddrinfo(0);
  1425. ]])
  1426. ],[
  1427. AC_MSG_RESULT([yes])
  1428. tst_links_freeaddrinfo="yes"
  1429. ],[
  1430. AC_MSG_RESULT([no])
  1431. tst_links_freeaddrinfo="no"
  1432. ])
  1433. #
  1434. if test "$tst_links_freeaddrinfo" = "yes"; then
  1435. AC_MSG_CHECKING([if freeaddrinfo is prototyped])
  1436. AC_EGREP_CPP([freeaddrinfo],[
  1437. $curl_includes_ws2tcpip
  1438. $curl_includes_sys_socket
  1439. $curl_includes_netdb
  1440. ],[
  1441. AC_MSG_RESULT([yes])
  1442. tst_proto_freeaddrinfo="yes"
  1443. ],[
  1444. AC_MSG_RESULT([no])
  1445. tst_proto_freeaddrinfo="no"
  1446. ])
  1447. fi
  1448. #
  1449. if test "$tst_proto_freeaddrinfo" = "yes"; then
  1450. AC_MSG_CHECKING([if freeaddrinfo is compilable])
  1451. AC_COMPILE_IFELSE([
  1452. AC_LANG_PROGRAM([[
  1453. $curl_includes_ws2tcpip
  1454. $curl_includes_sys_socket
  1455. $curl_includes_netdb
  1456. ]],[[
  1457. freeaddrinfo(0);
  1458. ]])
  1459. ],[
  1460. AC_MSG_RESULT([yes])
  1461. tst_compi_freeaddrinfo="yes"
  1462. ],[
  1463. AC_MSG_RESULT([no])
  1464. tst_compi_freeaddrinfo="no"
  1465. ])
  1466. fi
  1467. #
  1468. if test "$tst_compi_freeaddrinfo" = "yes"; then
  1469. AC_MSG_CHECKING([if freeaddrinfo usage allowed])
  1470. if test "x$curl_disallow_freeaddrinfo" != "xyes"; then
  1471. AC_MSG_RESULT([yes])
  1472. tst_allow_freeaddrinfo="yes"
  1473. else
  1474. AC_MSG_RESULT([no])
  1475. tst_allow_freeaddrinfo="no"
  1476. fi
  1477. fi
  1478. #
  1479. AC_MSG_CHECKING([if freeaddrinfo might be used])
  1480. if test "$tst_links_freeaddrinfo" = "yes" &&
  1481. test "$tst_proto_freeaddrinfo" = "yes" &&
  1482. test "$tst_compi_freeaddrinfo" = "yes" &&
  1483. test "$tst_allow_freeaddrinfo" = "yes"; then
  1484. AC_MSG_RESULT([yes])
  1485. AC_DEFINE_UNQUOTED(HAVE_FREEADDRINFO, 1,
  1486. [Define to 1 if you have the freeaddrinfo function.])
  1487. curl_cv_func_freeaddrinfo="yes"
  1488. else
  1489. AC_MSG_RESULT([no])
  1490. curl_cv_func_freeaddrinfo="no"
  1491. fi
  1492. ])
  1493. dnl CURL_CHECK_FUNC_FREEIFADDRS
  1494. dnl -------------------------------------------------
  1495. dnl Verify if freeifaddrs is available, prototyped, and
  1496. dnl can be compiled. If all of these are true, and
  1497. dnl usage has not been previously disallowed with
  1498. dnl shell variable curl_disallow_freeifaddrs, then
  1499. dnl HAVE_FREEIFADDRS will be defined.
  1500. AC_DEFUN([CURL_CHECK_FUNC_FREEIFADDRS], [
  1501. AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
  1502. #
  1503. tst_links_freeifaddrs="unknown"
  1504. tst_proto_freeifaddrs="unknown"
  1505. tst_compi_freeifaddrs="unknown"
  1506. tst_allow_freeifaddrs="unknown"
  1507. #
  1508. AC_MSG_CHECKING([if freeifaddrs can be linked])
  1509. AC_LINK_IFELSE([
  1510. AC_LANG_FUNC_LINK_TRY([freeifaddrs])
  1511. ],[
  1512. AC_MSG_RESULT([yes])
  1513. tst_links_freeifaddrs="yes"
  1514. ],[
  1515. AC_MSG_RESULT([no])
  1516. tst_links_freeifaddrs="no"
  1517. ])
  1518. #
  1519. if test "$tst_links_freeifaddrs" = "yes"; then
  1520. AC_MSG_CHECKING([if freeifaddrs is prototyped])
  1521. AC_EGREP_CPP([freeifaddrs],[
  1522. $curl_includes_ifaddrs
  1523. ],[
  1524. AC_MSG_RESULT([yes])
  1525. tst_proto_freeifaddrs="yes"
  1526. ],[
  1527. AC_MSG_RESULT([no])
  1528. tst_proto_freeifaddrs="no"
  1529. ])
  1530. fi
  1531. #
  1532. if test "$tst_proto_freeifaddrs" = "yes"; then
  1533. AC_MSG_CHECKING([if freeifaddrs is compilable])
  1534. AC_COMPILE_IFELSE([
  1535. AC_LANG_PROGRAM([[
  1536. $curl_includes_ifaddrs
  1537. ]],[[
  1538. freeifaddrs(0);
  1539. ]])
  1540. ],[
  1541. AC_MSG_RESULT([yes])
  1542. tst_compi_freeifaddrs="yes"
  1543. ],[
  1544. AC_MSG_RESULT([no])
  1545. tst_compi_freeifaddrs="no"
  1546. ])
  1547. fi
  1548. #
  1549. if test "$tst_compi_freeifaddrs" = "yes"; then
  1550. AC_MSG_CHECKING([if freeifaddrs usage allowed])
  1551. if test "x$curl_disallow_freeifaddrs" != "xyes"; then
  1552. AC_MSG_RESULT([yes])
  1553. tst_allow_freeifaddrs="yes"
  1554. else
  1555. AC_MSG_RESULT([no])
  1556. tst_allow_freeifaddrs="no"
  1557. fi
  1558. fi
  1559. #
  1560. AC_MSG_CHECKING([if freeifaddrs might be used])
  1561. if test "$tst_links_freeifaddrs" = "yes" &&
  1562. test "$tst_proto_freeifaddrs" = "yes" &&
  1563. test "$tst_compi_freeifaddrs" = "yes" &&
  1564. test "$tst_allow_freeifaddrs" = "yes"; then
  1565. AC_MSG_RESULT([yes])
  1566. AC_DEFINE_UNQUOTED(HAVE_FREEIFADDRS, 1,
  1567. [Define to 1 if you have the freeifaddrs function.])
  1568. curl_cv_func_freeifaddrs="yes"
  1569. else
  1570. AC_MSG_RESULT([no])
  1571. curl_cv_func_freeifaddrs="no"
  1572. fi
  1573. ])
  1574. dnl CURL_CHECK_FUNC_FREMOVEXATTR
  1575. dnl -------------------------------------------------
  1576. dnl Verify if fremovexattr is available, prototyped, and
  1577. dnl can be compiled. If all of these are true, and
  1578. dnl usage has not been previously disallowed with
  1579. dnl shell variable curl_disallow_fremovexattr, then
  1580. dnl HAVE_FREMOVEXATTR will be defined.
  1581. AC_DEFUN([CURL_CHECK_FUNC_FREMOVEXATTR], [
  1582. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  1583. #
  1584. tst_links_fremovexattr="unknown"
  1585. tst_proto_fremovexattr="unknown"
  1586. tst_compi_fremovexattr="unknown"
  1587. tst_allow_fremovexattr="unknown"
  1588. tst_nargs_fremovexattr="unknown"
  1589. #
  1590. AC_MSG_CHECKING([if fremovexattr can be linked])
  1591. AC_LINK_IFELSE([
  1592. AC_LANG_FUNC_LINK_TRY([fremovexattr])
  1593. ],[
  1594. AC_MSG_RESULT([yes])
  1595. tst_links_fremovexattr="yes"
  1596. ],[
  1597. AC_MSG_RESULT([no])
  1598. tst_links_fremovexattr="no"
  1599. ])
  1600. #
  1601. if test "$tst_links_fremovexattr" = "yes"; then
  1602. AC_MSG_CHECKING([if fremovexattr is prototyped])
  1603. AC_EGREP_CPP([fremovexattr],[
  1604. $curl_includes_sys_xattr
  1605. ],[
  1606. AC_MSG_RESULT([yes])
  1607. tst_proto_fremovexattr="yes"
  1608. ],[
  1609. AC_MSG_RESULT([no])
  1610. tst_proto_fremovexattr="no"
  1611. ])
  1612. fi
  1613. #
  1614. if test "$tst_proto_fremovexattr" = "yes"; then
  1615. if test "$tst_nargs_fremovexattr" = "unknown"; then
  1616. AC_MSG_CHECKING([if fremovexattr takes 2 args.])
  1617. AC_COMPILE_IFELSE([
  1618. AC_LANG_PROGRAM([[
  1619. $curl_includes_sys_xattr
  1620. ]],[[
  1621. if(0 != fremovexattr(0, 0))
  1622. return 1;
  1623. ]])
  1624. ],[
  1625. AC_MSG_RESULT([yes])
  1626. tst_compi_fremovexattr="yes"
  1627. tst_nargs_fremovexattr="2"
  1628. ],[
  1629. AC_MSG_RESULT([no])
  1630. tst_compi_fremovexattr="no"
  1631. ])
  1632. fi
  1633. if test "$tst_nargs_fremovexattr" = "unknown"; then
  1634. AC_MSG_CHECKING([if fremovexattr takes 3 args.])
  1635. AC_COMPILE_IFELSE([
  1636. AC_LANG_PROGRAM([[
  1637. $curl_includes_sys_xattr
  1638. ]],[[
  1639. if(0 != fremovexattr(0, 0, 0))
  1640. return 1;
  1641. ]])
  1642. ],[
  1643. AC_MSG_RESULT([yes])
  1644. tst_compi_fremovexattr="yes"
  1645. tst_nargs_fremovexattr="3"
  1646. ],[
  1647. AC_MSG_RESULT([no])
  1648. tst_compi_fremovexattr="no"
  1649. ])
  1650. fi
  1651. AC_MSG_CHECKING([if fremovexattr is compilable])
  1652. if test "$tst_compi_fremovexattr" = "yes"; then
  1653. AC_MSG_RESULT([yes])
  1654. else
  1655. AC_MSG_RESULT([no])
  1656. fi
  1657. fi
  1658. #
  1659. if test "$tst_compi_fremovexattr" = "yes"; then
  1660. AC_MSG_CHECKING([if fremovexattr usage allowed])
  1661. if test "x$curl_disallow_fremovexattr" != "xyes"; then
  1662. AC_MSG_RESULT([yes])
  1663. tst_allow_fremovexattr="yes"
  1664. else
  1665. AC_MSG_RESULT([no])
  1666. tst_allow_fremovexattr="no"
  1667. fi
  1668. fi
  1669. #
  1670. AC_MSG_CHECKING([if fremovexattr might be used])
  1671. if test "$tst_links_fremovexattr" = "yes" &&
  1672. test "$tst_proto_fremovexattr" = "yes" &&
  1673. test "$tst_compi_fremovexattr" = "yes" &&
  1674. test "$tst_allow_fremovexattr" = "yes"; then
  1675. AC_MSG_RESULT([yes])
  1676. AC_DEFINE_UNQUOTED(HAVE_FREMOVEXATTR, 1,
  1677. [Define to 1 if you have the fremovexattr function.])
  1678. dnl AC_DEFINE_UNQUOTED(FREMOVEXATTR_ARGS, $tst_nargs_fremovexattr,
  1679. dnl [Specifies the number of arguments to fremovexattr])
  1680. #
  1681. if test "$tst_nargs_fremovexattr" -eq "2"; then
  1682. AC_DEFINE(HAVE_FREMOVEXATTR_2, 1, [fremovexattr() takes 2 args])
  1683. elif test "$tst_nargs_fremovexattr" -eq "3"; then
  1684. AC_DEFINE(HAVE_FREMOVEXATTR_3, 1, [fremovexattr() takes 3 args])
  1685. fi
  1686. #
  1687. curl_cv_func_fremovexattr="yes"
  1688. else
  1689. AC_MSG_RESULT([no])
  1690. curl_cv_func_fremovexattr="no"
  1691. fi
  1692. ])
  1693. dnl CURL_CHECK_FUNC_FSETXATTR
  1694. dnl -------------------------------------------------
  1695. dnl Verify if fsetxattr is available, prototyped, and
  1696. dnl can be compiled. If all of these are true, and
  1697. dnl usage has not been previously disallowed with
  1698. dnl shell variable curl_disallow_fsetxattr, then
  1699. dnl HAVE_FSETXATTR will be defined.
  1700. AC_DEFUN([CURL_CHECK_FUNC_FSETXATTR], [
  1701. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  1702. #
  1703. tst_links_fsetxattr="unknown"
  1704. tst_proto_fsetxattr="unknown"
  1705. tst_compi_fsetxattr="unknown"
  1706. tst_allow_fsetxattr="unknown"
  1707. tst_nargs_fsetxattr="unknown"
  1708. #
  1709. AC_MSG_CHECKING([if fsetxattr can be linked])
  1710. AC_LINK_IFELSE([
  1711. AC_LANG_FUNC_LINK_TRY([fsetxattr])
  1712. ],[
  1713. AC_MSG_RESULT([yes])
  1714. tst_links_fsetxattr="yes"
  1715. ],[
  1716. AC_MSG_RESULT([no])
  1717. tst_links_fsetxattr="no"
  1718. ])
  1719. #
  1720. if test "$tst_links_fsetxattr" = "yes"; then
  1721. AC_MSG_CHECKING([if fsetxattr is prototyped])
  1722. AC_EGREP_CPP([fsetxattr],[
  1723. $curl_includes_sys_xattr
  1724. ],[
  1725. AC_MSG_RESULT([yes])
  1726. tst_proto_fsetxattr="yes"
  1727. ],[
  1728. AC_MSG_RESULT([no])
  1729. tst_proto_fsetxattr="no"
  1730. ])
  1731. fi
  1732. #
  1733. if test "$tst_proto_fsetxattr" = "yes"; then
  1734. if test "$tst_nargs_fsetxattr" = "unknown"; then
  1735. AC_MSG_CHECKING([if fsetxattr takes 5 args.])
  1736. AC_COMPILE_IFELSE([
  1737. AC_LANG_PROGRAM([[
  1738. $curl_includes_sys_xattr
  1739. ]],[[
  1740. if(0 != fsetxattr(0, 0, 0, 0, 0))
  1741. return 1;
  1742. ]])
  1743. ],[
  1744. AC_MSG_RESULT([yes])
  1745. tst_compi_fsetxattr="yes"
  1746. tst_nargs_fsetxattr="5"
  1747. ],[
  1748. AC_MSG_RESULT([no])
  1749. tst_compi_fsetxattr="no"
  1750. ])
  1751. fi
  1752. if test "$tst_nargs_fsetxattr" = "unknown"; then
  1753. AC_MSG_CHECKING([if fsetxattr takes 6 args.])
  1754. AC_COMPILE_IFELSE([
  1755. AC_LANG_PROGRAM([[
  1756. $curl_includes_sys_xattr
  1757. ]],[[
  1758. if(0 != fsetxattr(0, 0, 0, 0, 0, 0))
  1759. return 1;
  1760. ]])
  1761. ],[
  1762. AC_MSG_RESULT([yes])
  1763. tst_compi_fsetxattr="yes"
  1764. tst_nargs_fsetxattr="6"
  1765. ],[
  1766. AC_MSG_RESULT([no])
  1767. tst_compi_fsetxattr="no"
  1768. ])
  1769. fi
  1770. AC_MSG_CHECKING([if fsetxattr is compilable])
  1771. if test "$tst_compi_fsetxattr" = "yes"; then
  1772. AC_MSG_RESULT([yes])
  1773. else
  1774. AC_MSG_RESULT([no])
  1775. fi
  1776. fi
  1777. #
  1778. if test "$tst_compi_fsetxattr" = "yes"; then
  1779. AC_MSG_CHECKING([if fsetxattr usage allowed])
  1780. if test "x$curl_disallow_fsetxattr" != "xyes"; then
  1781. AC_MSG_RESULT([yes])
  1782. tst_allow_fsetxattr="yes"
  1783. else
  1784. AC_MSG_RESULT([no])
  1785. tst_allow_fsetxattr="no"
  1786. fi
  1787. fi
  1788. #
  1789. AC_MSG_CHECKING([if fsetxattr might be used])
  1790. if test "$tst_links_fsetxattr" = "yes" &&
  1791. test "$tst_proto_fsetxattr" = "yes" &&
  1792. test "$tst_compi_fsetxattr" = "yes" &&
  1793. test "$tst_allow_fsetxattr" = "yes"; then
  1794. AC_MSG_RESULT([yes])
  1795. AC_DEFINE_UNQUOTED(HAVE_FSETXATTR, 1,
  1796. [Define to 1 if you have the fsetxattr function.])
  1797. dnl AC_DEFINE_UNQUOTED(FSETXATTR_ARGS, $tst_nargs_fsetxattr,
  1798. dnl [Specifies the number of arguments to fsetxattr])
  1799. #
  1800. if test "$tst_nargs_fsetxattr" -eq "5"; then
  1801. AC_DEFINE(HAVE_FSETXATTR_5, 1, [fsetxattr() takes 5 args])
  1802. elif test "$tst_nargs_fsetxattr" -eq "6"; then
  1803. AC_DEFINE(HAVE_FSETXATTR_6, 1, [fsetxattr() takes 6 args])
  1804. fi
  1805. #
  1806. curl_cv_func_fsetxattr="yes"
  1807. else
  1808. AC_MSG_RESULT([no])
  1809. curl_cv_func_fsetxattr="no"
  1810. fi
  1811. ])
  1812. dnl CURL_CHECK_FUNC_FTRUNCATE
  1813. dnl -------------------------------------------------
  1814. dnl Verify if ftruncate is available, prototyped, and
  1815. dnl can be compiled. If all of these are true, and
  1816. dnl usage has not been previously disallowed with
  1817. dnl shell variable curl_disallow_ftruncate, then
  1818. dnl HAVE_FTRUNCATE will be defined.
  1819. AC_DEFUN([CURL_CHECK_FUNC_FTRUNCATE], [
  1820. AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
  1821. #
  1822. tst_links_ftruncate="unknown"
  1823. tst_proto_ftruncate="unknown"
  1824. tst_compi_ftruncate="unknown"
  1825. tst_allow_ftruncate="unknown"
  1826. #
  1827. AC_MSG_CHECKING([if ftruncate can be linked])
  1828. AC_LINK_IFELSE([
  1829. AC_LANG_FUNC_LINK_TRY([ftruncate])
  1830. ],[
  1831. AC_MSG_RESULT([yes])
  1832. tst_links_ftruncate="yes"
  1833. ],[
  1834. AC_MSG_RESULT([no])
  1835. tst_links_ftruncate="no"
  1836. ])
  1837. #
  1838. if test "$tst_links_ftruncate" = "yes"; then
  1839. AC_MSG_CHECKING([if ftruncate is prototyped])
  1840. AC_EGREP_CPP([ftruncate],[
  1841. $curl_includes_unistd
  1842. ],[
  1843. AC_MSG_RESULT([yes])
  1844. tst_proto_ftruncate="yes"
  1845. ],[
  1846. AC_MSG_RESULT([no])
  1847. tst_proto_ftruncate="no"
  1848. ])
  1849. fi
  1850. #
  1851. if test "$tst_proto_ftruncate" = "yes"; then
  1852. AC_MSG_CHECKING([if ftruncate is compilable])
  1853. AC_COMPILE_IFELSE([
  1854. AC_LANG_PROGRAM([[
  1855. $curl_includes_unistd
  1856. ]],[[
  1857. if(0 != ftruncate(0, 0))
  1858. return 1;
  1859. ]])
  1860. ],[
  1861. AC_MSG_RESULT([yes])
  1862. tst_compi_ftruncate="yes"
  1863. ],[
  1864. AC_MSG_RESULT([no])
  1865. tst_compi_ftruncate="no"
  1866. ])
  1867. fi
  1868. #
  1869. if test "$tst_compi_ftruncate" = "yes"; then
  1870. AC_MSG_CHECKING([if ftruncate usage allowed])
  1871. if test "x$curl_disallow_ftruncate" != "xyes"; then
  1872. AC_MSG_RESULT([yes])
  1873. tst_allow_ftruncate="yes"
  1874. else
  1875. AC_MSG_RESULT([no])
  1876. tst_allow_ftruncate="no"
  1877. fi
  1878. fi
  1879. #
  1880. AC_MSG_CHECKING([if ftruncate might be used])
  1881. if test "$tst_links_ftruncate" = "yes" &&
  1882. test "$tst_proto_ftruncate" = "yes" &&
  1883. test "$tst_compi_ftruncate" = "yes" &&
  1884. test "$tst_allow_ftruncate" = "yes"; then
  1885. AC_MSG_RESULT([yes])
  1886. AC_DEFINE_UNQUOTED(HAVE_FTRUNCATE, 1,
  1887. [Define to 1 if you have the ftruncate function.])
  1888. curl_cv_func_ftruncate="yes"
  1889. else
  1890. AC_MSG_RESULT([no])
  1891. curl_cv_func_ftruncate="no"
  1892. fi
  1893. ])
  1894. dnl CURL_CHECK_FUNC_GETADDRINFO
  1895. dnl -------------------------------------------------
  1896. dnl Verify if getaddrinfo is available, prototyped, can
  1897. dnl be compiled and seems to work. If all of these are
  1898. dnl true, and usage has not been previously disallowed
  1899. dnl with shell variable curl_disallow_getaddrinfo, then
  1900. dnl HAVE_GETADDRINFO will be defined. Additionally when
  1901. dnl HAVE_GETADDRINFO gets defined this will also attempt
  1902. dnl to find out if getaddrinfo happens to be threadsafe,
  1903. dnl defining HAVE_GETADDRINFO_THREADSAFE when true.
  1904. AC_DEFUN([CURL_CHECK_FUNC_GETADDRINFO], [
  1905. AC_REQUIRE([CURL_INCLUDES_WS2TCPIP])dnl
  1906. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  1907. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  1908. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  1909. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  1910. AC_REQUIRE([CURL_CHECK_NATIVE_WINDOWS])dnl
  1911. #
  1912. tst_links_getaddrinfo="unknown"
  1913. tst_proto_getaddrinfo="unknown"
  1914. tst_compi_getaddrinfo="unknown"
  1915. tst_works_getaddrinfo="unknown"
  1916. tst_allow_getaddrinfo="unknown"
  1917. tst_tsafe_getaddrinfo="unknown"
  1918. #
  1919. AC_MSG_CHECKING([if getaddrinfo can be linked])
  1920. AC_LINK_IFELSE([
  1921. AC_LANG_PROGRAM([[
  1922. $curl_includes_ws2tcpip
  1923. $curl_includes_sys_socket
  1924. $curl_includes_netdb
  1925. ]],[[
  1926. if(0 != getaddrinfo(0, 0, 0, 0))
  1927. return 1;
  1928. ]])
  1929. ],[
  1930. AC_MSG_RESULT([yes])
  1931. tst_links_getaddrinfo="yes"
  1932. ],[
  1933. AC_MSG_RESULT([no])
  1934. tst_links_getaddrinfo="no"
  1935. ])
  1936. #
  1937. if test "$tst_links_getaddrinfo" = "yes"; then
  1938. AC_MSG_CHECKING([if getaddrinfo is prototyped])
  1939. AC_EGREP_CPP([getaddrinfo],[
  1940. $curl_includes_ws2tcpip
  1941. $curl_includes_sys_socket
  1942. $curl_includes_netdb
  1943. ],[
  1944. AC_MSG_RESULT([yes])
  1945. tst_proto_getaddrinfo="yes"
  1946. ],[
  1947. AC_MSG_RESULT([no])
  1948. tst_proto_getaddrinfo="no"
  1949. ])
  1950. fi
  1951. #
  1952. if test "$tst_proto_getaddrinfo" = "yes"; then
  1953. AC_MSG_CHECKING([if getaddrinfo is compilable])
  1954. AC_COMPILE_IFELSE([
  1955. AC_LANG_PROGRAM([[
  1956. $curl_includes_ws2tcpip
  1957. $curl_includes_sys_socket
  1958. $curl_includes_netdb
  1959. ]],[[
  1960. if(0 != getaddrinfo(0, 0, 0, 0))
  1961. return 1;
  1962. ]])
  1963. ],[
  1964. AC_MSG_RESULT([yes])
  1965. tst_compi_getaddrinfo="yes"
  1966. ],[
  1967. AC_MSG_RESULT([no])
  1968. tst_compi_getaddrinfo="no"
  1969. ])
  1970. fi
  1971. #
  1972. dnl only do runtime verification when not cross-compiling
  1973. if test "x$cross_compiling" != "xyes" &&
  1974. test "$tst_compi_getaddrinfo" = "yes"; then
  1975. AC_MSG_CHECKING([if getaddrinfo seems to work])
  1976. AC_RUN_IFELSE([
  1977. AC_LANG_PROGRAM([[
  1978. $curl_includes_ws2tcpip
  1979. $curl_includes_stdlib
  1980. $curl_includes_string
  1981. $curl_includes_sys_socket
  1982. $curl_includes_netdb
  1983. ]],[[
  1984. struct addrinfo hints;
  1985. struct addrinfo *ai = 0;
  1986. int error;
  1987. #ifdef HAVE_WINSOCK2_H
  1988. WSADATA wsa;
  1989. if (WSAStartup(MAKEWORD(2,2), &wsa))
  1990. exit(2);
  1991. #endif
  1992. memset(&hints, 0, sizeof(hints));
  1993. hints.ai_flags = AI_NUMERICHOST;
  1994. hints.ai_family = AF_UNSPEC;
  1995. hints.ai_socktype = SOCK_STREAM;
  1996. error = getaddrinfo("127.0.0.1", 0, &hints, &ai);
  1997. if(error || !ai)
  1998. exit(1); /* fail */
  1999. else
  2000. exit(0);
  2001. ]])
  2002. ],[
  2003. AC_MSG_RESULT([yes])
  2004. tst_works_getaddrinfo="yes"
  2005. ],[
  2006. AC_MSG_RESULT([no])
  2007. tst_works_getaddrinfo="no"
  2008. ])
  2009. fi
  2010. #
  2011. if test "$tst_compi_getaddrinfo" = "yes" &&
  2012. test "$tst_works_getaddrinfo" != "no"; then
  2013. AC_MSG_CHECKING([if getaddrinfo usage allowed])
  2014. if test "x$curl_disallow_getaddrinfo" != "xyes"; then
  2015. AC_MSG_RESULT([yes])
  2016. tst_allow_getaddrinfo="yes"
  2017. else
  2018. AC_MSG_RESULT([no])
  2019. tst_allow_getaddrinfo="no"
  2020. fi
  2021. fi
  2022. #
  2023. AC_MSG_CHECKING([if getaddrinfo might be used])
  2024. if test "$tst_links_getaddrinfo" = "yes" &&
  2025. test "$tst_proto_getaddrinfo" = "yes" &&
  2026. test "$tst_compi_getaddrinfo" = "yes" &&
  2027. test "$tst_allow_getaddrinfo" = "yes" &&
  2028. test "$tst_works_getaddrinfo" != "no"; then
  2029. AC_MSG_RESULT([yes])
  2030. AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO, 1,
  2031. [Define to 1 if you have a working getaddrinfo function.])
  2032. curl_cv_func_getaddrinfo="yes"
  2033. else
  2034. AC_MSG_RESULT([no])
  2035. curl_cv_func_getaddrinfo="no"
  2036. curl_cv_func_getaddrinfo_threadsafe="no"
  2037. fi
  2038. #
  2039. if test "$curl_cv_func_getaddrinfo" = "yes"; then
  2040. AC_MSG_CHECKING([if getaddrinfo is threadsafe])
  2041. case $host_os in
  2042. aix[[1234]].* | aix5.[[01]].*)
  2043. dnl aix 5.1 and older
  2044. tst_tsafe_getaddrinfo="no"
  2045. ;;
  2046. aix*)
  2047. dnl aix 5.2 and newer
  2048. tst_tsafe_getaddrinfo="yes"
  2049. ;;
  2050. darwin[[12345]].*)
  2051. dnl darwin 5.0 and mac os x 10.1.X and older
  2052. tst_tsafe_getaddrinfo="no"
  2053. ;;
  2054. darwin*)
  2055. dnl darwin 6.0 and mac os x 10.2.X and newer
  2056. tst_tsafe_getaddrinfo="yes"
  2057. ;;
  2058. freebsd[[1234]].* | freebsd5.[[1234]]*)
  2059. dnl freebsd 5.4 and older
  2060. tst_tsafe_getaddrinfo="no"
  2061. ;;
  2062. freebsd*)
  2063. dnl freebsd 5.5 and newer
  2064. tst_tsafe_getaddrinfo="yes"
  2065. ;;
  2066. hpux[[123456789]].* | hpux10.* | hpux11.0* | hpux11.10*)
  2067. dnl hpux 11.10 and older
  2068. tst_tsafe_getaddrinfo="no"
  2069. ;;
  2070. hpux*)
  2071. dnl hpux 11.11 and newer
  2072. tst_tsafe_getaddrinfo="yes"
  2073. ;;
  2074. netbsd[[123]].*)
  2075. dnl netbsd 3.X and older
  2076. tst_tsafe_getaddrinfo="no"
  2077. ;;
  2078. netbsd*)
  2079. dnl netbsd 4.X and newer
  2080. tst_tsafe_getaddrinfo="yes"
  2081. ;;
  2082. *bsd*)
  2083. dnl All other bsd's
  2084. tst_tsafe_getaddrinfo="no"
  2085. ;;
  2086. solaris2*)
  2087. dnl solaris which have it
  2088. tst_tsafe_getaddrinfo="yes"
  2089. ;;
  2090. esac
  2091. if test "$tst_tsafe_getaddrinfo" = "unknown" &&
  2092. test "$curl_cv_native_windows" = "yes"; then
  2093. tst_tsafe_getaddrinfo="yes"
  2094. fi
  2095. if test "$tst_tsafe_getaddrinfo" = "unknown"; then
  2096. CURL_CHECK_DEF_CC([h_errno], [
  2097. $curl_includes_sys_socket
  2098. $curl_includes_netdb
  2099. ], [silent])
  2100. if test "$curl_cv_have_def_h_errno" = "yes"; then
  2101. tst_h_errno_macro="yes"
  2102. else
  2103. tst_h_errno_macro="no"
  2104. fi
  2105. AC_COMPILE_IFELSE([
  2106. AC_LANG_PROGRAM([[
  2107. $curl_includes_sys_socket
  2108. $curl_includes_netdb
  2109. ]],[[
  2110. h_errno = 2;
  2111. if(0 != h_errno)
  2112. return 1;
  2113. ]])
  2114. ],[
  2115. tst_h_errno_modifiable_lvalue="yes"
  2116. ],[
  2117. tst_h_errno_modifiable_lvalue="no"
  2118. ])
  2119. AC_COMPILE_IFELSE([
  2120. AC_LANG_PROGRAM([[
  2121. ]],[[
  2122. #if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
  2123. return 0;
  2124. #elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
  2125. return 0;
  2126. #else
  2127. force compilation error
  2128. #endif
  2129. ]])
  2130. ],[
  2131. tst_h_errno_sbs_issue_7="yes"
  2132. ],[
  2133. tst_h_errno_sbs_issue_7="no"
  2134. ])
  2135. if test "$tst_h_errno_macro" = "no" &&
  2136. test "$tst_h_errno_modifiable_lvalue" = "no" &&
  2137. test "$tst_h_errno_sbs_issue_7" = "no"; then
  2138. tst_tsafe_getaddrinfo="no"
  2139. else
  2140. tst_tsafe_getaddrinfo="yes"
  2141. fi
  2142. fi
  2143. AC_MSG_RESULT([$tst_tsafe_getaddrinfo])
  2144. if test "$tst_tsafe_getaddrinfo" = "yes"; then
  2145. AC_DEFINE_UNQUOTED(HAVE_GETADDRINFO_THREADSAFE, 1,
  2146. [Define to 1 if the getaddrinfo function is threadsafe.])
  2147. curl_cv_func_getaddrinfo_threadsafe="yes"
  2148. else
  2149. curl_cv_func_getaddrinfo_threadsafe="no"
  2150. fi
  2151. fi
  2152. ])
  2153. dnl CURL_CHECK_FUNC_GETHOSTBYADDR
  2154. dnl -------------------------------------------------
  2155. dnl Verify if gethostbyaddr is available, prototyped,
  2156. dnl and can be compiled. If all of these are true,
  2157. dnl and usage has not been previously disallowed with
  2158. dnl shell variable curl_disallow_gethostbyaddr, then
  2159. dnl HAVE_GETHOSTBYADDR will be defined.
  2160. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR], [
  2161. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  2162. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  2163. #
  2164. tst_links_gethostbyaddr="unknown"
  2165. tst_proto_gethostbyaddr="unknown"
  2166. tst_compi_gethostbyaddr="unknown"
  2167. tst_allow_gethostbyaddr="unknown"
  2168. #
  2169. AC_MSG_CHECKING([if gethostbyaddr can be linked])
  2170. AC_LINK_IFELSE([
  2171. AC_LANG_PROGRAM([[
  2172. $curl_includes_winsock2
  2173. $curl_includes_netdb
  2174. ]],[[
  2175. if(0 != gethostbyaddr(0, 0, 0))
  2176. return 1;
  2177. ]])
  2178. ],[
  2179. AC_MSG_RESULT([yes])
  2180. tst_links_gethostbyaddr="yes"
  2181. ],[
  2182. AC_MSG_RESULT([no])
  2183. tst_links_gethostbyaddr="no"
  2184. ])
  2185. #
  2186. if test "$tst_links_gethostbyaddr" = "yes"; then
  2187. AC_MSG_CHECKING([if gethostbyaddr is prototyped])
  2188. AC_EGREP_CPP([gethostbyaddr],[
  2189. $curl_includes_winsock2
  2190. $curl_includes_netdb
  2191. ],[
  2192. AC_MSG_RESULT([yes])
  2193. tst_proto_gethostbyaddr="yes"
  2194. ],[
  2195. AC_MSG_RESULT([no])
  2196. tst_proto_gethostbyaddr="no"
  2197. ])
  2198. fi
  2199. #
  2200. if test "$tst_proto_gethostbyaddr" = "yes"; then
  2201. AC_MSG_CHECKING([if gethostbyaddr is compilable])
  2202. AC_COMPILE_IFELSE([
  2203. AC_LANG_PROGRAM([[
  2204. $curl_includes_winsock2
  2205. $curl_includes_netdb
  2206. ]],[[
  2207. if(0 != gethostbyaddr(0, 0, 0))
  2208. return 1;
  2209. ]])
  2210. ],[
  2211. AC_MSG_RESULT([yes])
  2212. tst_compi_gethostbyaddr="yes"
  2213. ],[
  2214. AC_MSG_RESULT([no])
  2215. tst_compi_gethostbyaddr="no"
  2216. ])
  2217. fi
  2218. #
  2219. if test "$tst_compi_gethostbyaddr" = "yes"; then
  2220. AC_MSG_CHECKING([if gethostbyaddr usage allowed])
  2221. if test "x$curl_disallow_gethostbyaddr" != "xyes"; then
  2222. AC_MSG_RESULT([yes])
  2223. tst_allow_gethostbyaddr="yes"
  2224. else
  2225. AC_MSG_RESULT([no])
  2226. tst_allow_gethostbyaddr="no"
  2227. fi
  2228. fi
  2229. #
  2230. AC_MSG_CHECKING([if gethostbyaddr might be used])
  2231. if test "$tst_links_gethostbyaddr" = "yes" &&
  2232. test "$tst_proto_gethostbyaddr" = "yes" &&
  2233. test "$tst_compi_gethostbyaddr" = "yes" &&
  2234. test "$tst_allow_gethostbyaddr" = "yes"; then
  2235. AC_MSG_RESULT([yes])
  2236. AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR, 1,
  2237. [Define to 1 if you have the gethostbyaddr function.])
  2238. curl_cv_func_gethostbyaddr="yes"
  2239. else
  2240. AC_MSG_RESULT([no])
  2241. curl_cv_func_gethostbyaddr="no"
  2242. fi
  2243. ])
  2244. dnl CURL_CHECK_FUNC_GAI_STRERROR
  2245. dnl -------------------------------------------------
  2246. dnl Verify if gai_strerror is available, prototyped,
  2247. dnl and can be compiled. If all of these are true,
  2248. dnl and usage has not been previously disallowed with
  2249. dnl shell variable curl_disallow_gai_strerror, then
  2250. dnl HAVE_GAI_STRERROR will be defined.
  2251. AC_DEFUN([CURL_CHECK_FUNC_GAI_STRERROR], [
  2252. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  2253. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  2254. #
  2255. tst_links_gai_strerror="unknown"
  2256. tst_proto_gai_strerror="unknown"
  2257. tst_compi_gai_strerror="unknown"
  2258. tst_allow_gai_strerror="unknown"
  2259. #
  2260. AC_MSG_CHECKING([if gai_strerror can be linked])
  2261. AC_LINK_IFELSE([
  2262. AC_LANG_PROGRAM([[
  2263. $curl_includes_winsock2
  2264. $curl_includes_netdb
  2265. ]],[[
  2266. if(0 != gai_strerror(0))
  2267. return 1;
  2268. ]])
  2269. ],[
  2270. AC_MSG_RESULT([yes])
  2271. tst_links_gai_strerror="yes"
  2272. ],[
  2273. AC_MSG_RESULT([no])
  2274. tst_links_gai_strerror="no"
  2275. ])
  2276. #
  2277. if test "$tst_links_gai_strerror" = "yes"; then
  2278. AC_MSG_CHECKING([if gai_strerror is prototyped])
  2279. AC_EGREP_CPP([gai_strerror],[
  2280. $curl_includes_winsock2
  2281. $curl_includes_netdb
  2282. ],[
  2283. AC_MSG_RESULT([yes])
  2284. tst_proto_gai_strerror="yes"
  2285. ],[
  2286. AC_MSG_RESULT([no])
  2287. tst_proto_gai_strerror="no"
  2288. ])
  2289. fi
  2290. #
  2291. if test "$tst_proto_gai_strerror" = "yes"; then
  2292. AC_MSG_CHECKING([if gai_strerror is compilable])
  2293. AC_COMPILE_IFELSE([
  2294. AC_LANG_PROGRAM([[
  2295. $curl_includes_winsock2
  2296. $curl_includes_netdb
  2297. ]],[[
  2298. if(0 != gai_strerror(0))
  2299. return 1;
  2300. ]])
  2301. ],[
  2302. AC_MSG_RESULT([yes])
  2303. tst_compi_gai_strerror="yes"
  2304. ],[
  2305. AC_MSG_RESULT([no])
  2306. tst_compi_gai_strerror="no"
  2307. ])
  2308. fi
  2309. #
  2310. if test "$tst_compi_gai_strerror" = "yes"; then
  2311. AC_MSG_CHECKING([if gai_strerror usage allowed])
  2312. if test "x$curl_disallow_gai_strerror" != "xyes"; then
  2313. AC_MSG_RESULT([yes])
  2314. tst_allow_gai_strerror="yes"
  2315. else
  2316. AC_MSG_RESULT([no])
  2317. tst_allow_gai_strerror="no"
  2318. fi
  2319. fi
  2320. #
  2321. AC_MSG_CHECKING([if gai_strerror might be used])
  2322. if test "$tst_links_gai_strerror" = "yes" &&
  2323. test "$tst_proto_gai_strerror" = "yes" &&
  2324. test "$tst_compi_gai_strerror" = "yes" &&
  2325. test "$tst_allow_gai_strerror" = "yes"; then
  2326. AC_MSG_RESULT([yes])
  2327. AC_DEFINE_UNQUOTED(HAVE_GAI_STRERROR, 1,
  2328. [Define to 1 if you have the gai_strerror function.])
  2329. curl_cv_func_gai_strerror="yes"
  2330. else
  2331. AC_MSG_RESULT([no])
  2332. curl_cv_func_gai_strerror="no"
  2333. fi
  2334. ])
  2335. dnl CURL_CHECK_FUNC_GETHOSTBYADDR_R
  2336. dnl -------------------------------------------------
  2337. dnl Verify if gethostbyaddr_r is available, prototyped,
  2338. dnl and can be compiled. If all of these are true, and
  2339. dnl usage has not been previously disallowed with
  2340. dnl shell variable curl_disallow_gethostbyaddr_r, then
  2341. dnl HAVE_GETHOSTBYADDR_R will be defined.
  2342. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYADDR_R], [
  2343. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  2344. #
  2345. tst_links_gethostbyaddr_r="unknown"
  2346. tst_proto_gethostbyaddr_r="unknown"
  2347. tst_compi_gethostbyaddr_r="unknown"
  2348. tst_allow_gethostbyaddr_r="unknown"
  2349. tst_nargs_gethostbyaddr_r="unknown"
  2350. #
  2351. AC_MSG_CHECKING([if gethostbyaddr_r can be linked])
  2352. AC_LINK_IFELSE([
  2353. AC_LANG_FUNC_LINK_TRY([gethostbyaddr_r])
  2354. ],[
  2355. AC_MSG_RESULT([yes])
  2356. tst_links_gethostbyaddr_r="yes"
  2357. ],[
  2358. AC_MSG_RESULT([no])
  2359. tst_links_gethostbyaddr_r="no"
  2360. ])
  2361. #
  2362. if test "$tst_links_gethostbyaddr_r" = "yes"; then
  2363. AC_MSG_CHECKING([if gethostbyaddr_r is prototyped])
  2364. AC_EGREP_CPP([gethostbyaddr_r],[
  2365. $curl_includes_netdb
  2366. ],[
  2367. AC_MSG_RESULT([yes])
  2368. tst_proto_gethostbyaddr_r="yes"
  2369. ],[
  2370. AC_MSG_RESULT([no])
  2371. tst_proto_gethostbyaddr_r="no"
  2372. ])
  2373. fi
  2374. #
  2375. if test "$tst_proto_gethostbyaddr_r" = "yes"; then
  2376. if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
  2377. AC_MSG_CHECKING([if gethostbyaddr_r takes 5 args.])
  2378. AC_COMPILE_IFELSE([
  2379. AC_LANG_PROGRAM([[
  2380. $curl_includes_netdb
  2381. ]],[[
  2382. if(0 != gethostbyaddr_r(0, 0, 0, 0, 0))
  2383. return 1;
  2384. ]])
  2385. ],[
  2386. AC_MSG_RESULT([yes])
  2387. tst_compi_gethostbyaddr_r="yes"
  2388. tst_nargs_gethostbyaddr_r="5"
  2389. ],[
  2390. AC_MSG_RESULT([no])
  2391. tst_compi_gethostbyaddr_r="no"
  2392. ])
  2393. fi
  2394. if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
  2395. AC_MSG_CHECKING([if gethostbyaddr_r takes 7 args.])
  2396. AC_COMPILE_IFELSE([
  2397. AC_LANG_PROGRAM([[
  2398. $curl_includes_netdb
  2399. ]],[[
  2400. if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0))
  2401. return 1;
  2402. ]])
  2403. ],[
  2404. AC_MSG_RESULT([yes])
  2405. tst_compi_gethostbyaddr_r="yes"
  2406. tst_nargs_gethostbyaddr_r="7"
  2407. ],[
  2408. AC_MSG_RESULT([no])
  2409. tst_compi_gethostbyaddr_r="no"
  2410. ])
  2411. fi
  2412. if test "$tst_nargs_gethostbyaddr_r" = "unknown"; then
  2413. AC_MSG_CHECKING([if gethostbyaddr_r takes 8 args.])
  2414. AC_COMPILE_IFELSE([
  2415. AC_LANG_PROGRAM([[
  2416. $curl_includes_netdb
  2417. ]],[[
  2418. if(0 != gethostbyaddr_r(0, 0, 0, 0, 0, 0, 0, 0))
  2419. return 1;
  2420. ]])
  2421. ],[
  2422. AC_MSG_RESULT([yes])
  2423. tst_compi_gethostbyaddr_r="yes"
  2424. tst_nargs_gethostbyaddr_r="8"
  2425. ],[
  2426. AC_MSG_RESULT([no])
  2427. tst_compi_gethostbyaddr_r="no"
  2428. ])
  2429. fi
  2430. AC_MSG_CHECKING([if gethostbyaddr_r is compilable])
  2431. if test "$tst_compi_gethostbyaddr_r" = "yes"; then
  2432. AC_MSG_RESULT([yes])
  2433. else
  2434. AC_MSG_RESULT([no])
  2435. fi
  2436. fi
  2437. #
  2438. if test "$tst_compi_gethostbyaddr_r" = "yes"; then
  2439. AC_MSG_CHECKING([if gethostbyaddr_r usage allowed])
  2440. if test "x$curl_disallow_gethostbyaddr_r" != "xyes"; then
  2441. AC_MSG_RESULT([yes])
  2442. tst_allow_gethostbyaddr_r="yes"
  2443. else
  2444. AC_MSG_RESULT([no])
  2445. tst_allow_gethostbyaddr_r="no"
  2446. fi
  2447. fi
  2448. #
  2449. AC_MSG_CHECKING([if gethostbyaddr_r might be used])
  2450. if test "$tst_links_gethostbyaddr_r" = "yes" &&
  2451. test "$tst_proto_gethostbyaddr_r" = "yes" &&
  2452. test "$tst_compi_gethostbyaddr_r" = "yes" &&
  2453. test "$tst_allow_gethostbyaddr_r" = "yes"; then
  2454. AC_MSG_RESULT([yes])
  2455. AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYADDR_R, 1,
  2456. [Define to 1 if you have the gethostbyaddr_r function.])
  2457. dnl AC_DEFINE_UNQUOTED(GETHOSTBYADDR_R_ARGS, $tst_nargs_gethostbyaddr_r,
  2458. dnl [Specifies the number of arguments to gethostbyaddr_r])
  2459. #
  2460. if test "$tst_nargs_gethostbyaddr_r" -eq "5"; then
  2461. AC_DEFINE(HAVE_GETHOSTBYADDR_R_5, 1, [gethostbyaddr_r() takes 5 args])
  2462. elif test "$tst_nargs_gethostbyaddr_r" -eq "7"; then
  2463. AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1, [gethostbyaddr_r() takes 7 args])
  2464. elif test "$tst_nargs_gethostbyaddr_r" -eq "8"; then
  2465. AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1, [gethostbyaddr_r() takes 8 args])
  2466. fi
  2467. #
  2468. curl_cv_func_gethostbyaddr_r="yes"
  2469. else
  2470. AC_MSG_RESULT([no])
  2471. curl_cv_func_gethostbyaddr_r="no"
  2472. fi
  2473. ])
  2474. dnl CURL_CHECK_FUNC_GETHOSTBYNAME
  2475. dnl -------------------------------------------------
  2476. dnl Verify if gethostbyname is available, prototyped,
  2477. dnl and can be compiled. If all of these are true,
  2478. dnl and usage has not been previously disallowed with
  2479. dnl shell variable curl_disallow_gethostbyname, then
  2480. dnl HAVE_GETHOSTBYNAME will be defined.
  2481. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME], [
  2482. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  2483. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  2484. #
  2485. tst_links_gethostbyname="unknown"
  2486. tst_proto_gethostbyname="unknown"
  2487. tst_compi_gethostbyname="unknown"
  2488. tst_allow_gethostbyname="unknown"
  2489. #
  2490. AC_MSG_CHECKING([if gethostbyname can be linked])
  2491. AC_LINK_IFELSE([
  2492. AC_LANG_PROGRAM([[
  2493. $curl_includes_winsock2
  2494. $curl_includes_netdb
  2495. ]],[[
  2496. if(0 != gethostbyname(0))
  2497. return 1;
  2498. ]])
  2499. ],[
  2500. AC_MSG_RESULT([yes])
  2501. tst_links_gethostbyname="yes"
  2502. ],[
  2503. AC_MSG_RESULT([no])
  2504. tst_links_gethostbyname="no"
  2505. ])
  2506. #
  2507. if test "$tst_links_gethostbyname" = "yes"; then
  2508. AC_MSG_CHECKING([if gethostbyname is prototyped])
  2509. AC_EGREP_CPP([gethostbyname],[
  2510. $curl_includes_winsock2
  2511. $curl_includes_netdb
  2512. ],[
  2513. AC_MSG_RESULT([yes])
  2514. tst_proto_gethostbyname="yes"
  2515. ],[
  2516. AC_MSG_RESULT([no])
  2517. tst_proto_gethostbyname="no"
  2518. ])
  2519. fi
  2520. #
  2521. if test "$tst_proto_gethostbyname" = "yes"; then
  2522. AC_MSG_CHECKING([if gethostbyname is compilable])
  2523. AC_COMPILE_IFELSE([
  2524. AC_LANG_PROGRAM([[
  2525. $curl_includes_winsock2
  2526. $curl_includes_netdb
  2527. ]],[[
  2528. if(0 != gethostbyname(0))
  2529. return 1;
  2530. ]])
  2531. ],[
  2532. AC_MSG_RESULT([yes])
  2533. tst_compi_gethostbyname="yes"
  2534. ],[
  2535. AC_MSG_RESULT([no])
  2536. tst_compi_gethostbyname="no"
  2537. ])
  2538. fi
  2539. #
  2540. if test "$tst_compi_gethostbyname" = "yes"; then
  2541. AC_MSG_CHECKING([if gethostbyname usage allowed])
  2542. if test "x$curl_disallow_gethostbyname" != "xyes"; then
  2543. AC_MSG_RESULT([yes])
  2544. tst_allow_gethostbyname="yes"
  2545. else
  2546. AC_MSG_RESULT([no])
  2547. tst_allow_gethostbyname="no"
  2548. fi
  2549. fi
  2550. #
  2551. AC_MSG_CHECKING([if gethostbyname might be used])
  2552. if test "$tst_links_gethostbyname" = "yes" &&
  2553. test "$tst_proto_gethostbyname" = "yes" &&
  2554. test "$tst_compi_gethostbyname" = "yes" &&
  2555. test "$tst_allow_gethostbyname" = "yes"; then
  2556. AC_MSG_RESULT([yes])
  2557. AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME, 1,
  2558. [Define to 1 if you have the gethostbyname function.])
  2559. curl_cv_func_gethostbyname="yes"
  2560. else
  2561. AC_MSG_RESULT([no])
  2562. curl_cv_func_gethostbyname="no"
  2563. fi
  2564. ])
  2565. dnl CURL_CHECK_FUNC_GETHOSTBYNAME_R
  2566. dnl -------------------------------------------------
  2567. dnl Verify if gethostbyname_r is available, prototyped,
  2568. dnl and can be compiled. If all of these are true, and
  2569. dnl usage has not been previously disallowed with
  2570. dnl shell variable curl_disallow_gethostbyname_r, then
  2571. dnl HAVE_GETHOSTBYNAME_R will be defined.
  2572. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTBYNAME_R], [
  2573. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  2574. #
  2575. tst_links_gethostbyname_r="unknown"
  2576. tst_proto_gethostbyname_r="unknown"
  2577. tst_compi_gethostbyname_r="unknown"
  2578. tst_allow_gethostbyname_r="unknown"
  2579. tst_nargs_gethostbyname_r="unknown"
  2580. #
  2581. AC_MSG_CHECKING([if gethostbyname_r can be linked])
  2582. AC_LINK_IFELSE([
  2583. AC_LANG_FUNC_LINK_TRY([gethostbyname_r])
  2584. ],[
  2585. AC_MSG_RESULT([yes])
  2586. tst_links_gethostbyname_r="yes"
  2587. ],[
  2588. AC_MSG_RESULT([no])
  2589. tst_links_gethostbyname_r="no"
  2590. ])
  2591. #
  2592. if test "$tst_links_gethostbyname_r" = "yes"; then
  2593. AC_MSG_CHECKING([if gethostbyname_r is prototyped])
  2594. AC_EGREP_CPP([gethostbyname_r],[
  2595. $curl_includes_netdb
  2596. ],[
  2597. AC_MSG_RESULT([yes])
  2598. tst_proto_gethostbyname_r="yes"
  2599. ],[
  2600. AC_MSG_RESULT([no])
  2601. tst_proto_gethostbyname_r="no"
  2602. ])
  2603. fi
  2604. #
  2605. if test "$tst_proto_gethostbyname_r" = "yes"; then
  2606. if test "$tst_nargs_gethostbyname_r" = "unknown"; then
  2607. AC_MSG_CHECKING([if gethostbyname_r takes 3 args.])
  2608. AC_COMPILE_IFELSE([
  2609. AC_LANG_PROGRAM([[
  2610. $curl_includes_netdb
  2611. ]],[[
  2612. if(0 != gethostbyname_r(0, 0, 0))
  2613. return 1;
  2614. ]])
  2615. ],[
  2616. AC_MSG_RESULT([yes])
  2617. tst_compi_gethostbyname_r="yes"
  2618. tst_nargs_gethostbyname_r="3"
  2619. ],[
  2620. AC_MSG_RESULT([no])
  2621. tst_compi_gethostbyname_r="no"
  2622. ])
  2623. fi
  2624. if test "$tst_nargs_gethostbyname_r" = "unknown"; then
  2625. AC_MSG_CHECKING([if gethostbyname_r takes 5 args.])
  2626. AC_COMPILE_IFELSE([
  2627. AC_LANG_PROGRAM([[
  2628. $curl_includes_netdb
  2629. ]],[[
  2630. if(0 != gethostbyname_r(0, 0, 0, 0, 0))
  2631. return 1;
  2632. ]])
  2633. ],[
  2634. AC_MSG_RESULT([yes])
  2635. tst_compi_gethostbyname_r="yes"
  2636. tst_nargs_gethostbyname_r="5"
  2637. ],[
  2638. AC_MSG_RESULT([no])
  2639. tst_compi_gethostbyname_r="no"
  2640. ])
  2641. fi
  2642. if test "$tst_nargs_gethostbyname_r" = "unknown"; then
  2643. AC_MSG_CHECKING([if gethostbyname_r takes 6 args.])
  2644. AC_COMPILE_IFELSE([
  2645. AC_LANG_PROGRAM([[
  2646. $curl_includes_netdb
  2647. ]],[[
  2648. if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0))
  2649. return 1;
  2650. ]])
  2651. ],[
  2652. AC_MSG_RESULT([yes])
  2653. tst_compi_gethostbyname_r="yes"
  2654. tst_nargs_gethostbyname_r="6"
  2655. ],[
  2656. AC_MSG_RESULT([no])
  2657. tst_compi_gethostbyname_r="no"
  2658. ])
  2659. fi
  2660. AC_MSG_CHECKING([if gethostbyname_r is compilable])
  2661. if test "$tst_compi_gethostbyname_r" = "yes"; then
  2662. AC_MSG_RESULT([yes])
  2663. else
  2664. AC_MSG_RESULT([no])
  2665. fi
  2666. fi
  2667. #
  2668. if test "$tst_compi_gethostbyname_r" = "yes"; then
  2669. AC_MSG_CHECKING([if gethostbyname_r usage allowed])
  2670. if test "x$curl_disallow_gethostbyname_r" != "xyes"; then
  2671. AC_MSG_RESULT([yes])
  2672. tst_allow_gethostbyname_r="yes"
  2673. else
  2674. AC_MSG_RESULT([no])
  2675. tst_allow_gethostbyname_r="no"
  2676. fi
  2677. fi
  2678. #
  2679. AC_MSG_CHECKING([if gethostbyname_r might be used])
  2680. if test "$tst_links_gethostbyname_r" = "yes" &&
  2681. test "$tst_proto_gethostbyname_r" = "yes" &&
  2682. test "$tst_compi_gethostbyname_r" = "yes" &&
  2683. test "$tst_allow_gethostbyname_r" = "yes"; then
  2684. AC_MSG_RESULT([yes])
  2685. AC_DEFINE_UNQUOTED(HAVE_GETHOSTBYNAME_R, 1,
  2686. [Define to 1 if you have the gethostbyname_r function.])
  2687. dnl AC_DEFINE_UNQUOTED(GETHOSTBYNAME_R_ARGS, $tst_nargs_gethostbyname_r,
  2688. dnl [Specifies the number of arguments to gethostbyname_r])
  2689. #
  2690. if test "$tst_nargs_gethostbyname_r" -eq "3"; then
  2691. AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1, [gethostbyname_r() takes 3 args])
  2692. elif test "$tst_nargs_gethostbyname_r" -eq "5"; then
  2693. AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1, [gethostbyname_r() takes 5 args])
  2694. elif test "$tst_nargs_gethostbyname_r" -eq "6"; then
  2695. AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1, [gethostbyname_r() takes 6 args])
  2696. fi
  2697. #
  2698. curl_cv_func_gethostbyname_r="yes"
  2699. else
  2700. AC_MSG_RESULT([no])
  2701. curl_cv_func_gethostbyname_r="no"
  2702. fi
  2703. ])
  2704. dnl CURL_CHECK_FUNC_GETHOSTNAME
  2705. dnl -------------------------------------------------
  2706. dnl Verify if gethostname is available, prototyped, and
  2707. dnl can be compiled. If all of these are true, and
  2708. dnl usage has not been previously disallowed with
  2709. dnl shell variable curl_disallow_gethostname, then
  2710. dnl HAVE_GETHOSTNAME will be defined.
  2711. AC_DEFUN([CURL_CHECK_FUNC_GETHOSTNAME], [
  2712. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  2713. AC_REQUIRE([CURL_INCLUDES_UNISTD])dnl
  2714. AC_REQUIRE([CURL_PREPROCESS_CALLCONV])dnl
  2715. #
  2716. tst_links_gethostname="unknown"
  2717. tst_proto_gethostname="unknown"
  2718. tst_compi_gethostname="unknown"
  2719. tst_allow_gethostname="unknown"
  2720. #
  2721. AC_MSG_CHECKING([if gethostname can be linked])
  2722. AC_LINK_IFELSE([
  2723. AC_LANG_PROGRAM([[
  2724. $curl_includes_winsock2
  2725. $curl_includes_unistd
  2726. ]],[[
  2727. if(0 != gethostname(0, 0))
  2728. return 1;
  2729. ]])
  2730. ],[
  2731. AC_MSG_RESULT([yes])
  2732. tst_links_gethostname="yes"
  2733. ],[
  2734. AC_MSG_RESULT([no])
  2735. tst_links_gethostname="no"
  2736. ])
  2737. #
  2738. if test "$tst_links_gethostname" = "yes"; then
  2739. AC_MSG_CHECKING([if gethostname is prototyped])
  2740. AC_EGREP_CPP([gethostname],[
  2741. $curl_includes_winsock2
  2742. $curl_includes_unistd
  2743. ],[
  2744. AC_MSG_RESULT([yes])
  2745. tst_proto_gethostname="yes"
  2746. ],[
  2747. AC_MSG_RESULT([no])
  2748. tst_proto_gethostname="no"
  2749. ])
  2750. fi
  2751. #
  2752. if test "$tst_proto_gethostname" = "yes"; then
  2753. AC_MSG_CHECKING([if gethostname is compilable])
  2754. AC_COMPILE_IFELSE([
  2755. AC_LANG_PROGRAM([[
  2756. $curl_includes_winsock2
  2757. $curl_includes_unistd
  2758. ]],[[
  2759. if(0 != gethostname(0, 0))
  2760. return 1;
  2761. ]])
  2762. ],[
  2763. AC_MSG_RESULT([yes])
  2764. tst_compi_gethostname="yes"
  2765. ],[
  2766. AC_MSG_RESULT([no])
  2767. tst_compi_gethostname="no"
  2768. ])
  2769. fi
  2770. #
  2771. if test "$tst_compi_gethostname" = "yes"; then
  2772. AC_MSG_CHECKING([for gethostname arg 2 data type])
  2773. tst_gethostname_type_arg2="unknown"
  2774. for tst_arg1 in 'char *' 'unsigned char *' 'void *'; do
  2775. for tst_arg2 in 'int' 'unsigned int' 'size_t'; do
  2776. if test "$tst_gethostname_type_arg2" = "unknown"; then
  2777. AC_COMPILE_IFELSE([
  2778. AC_LANG_PROGRAM([[
  2779. $curl_includes_winsock2
  2780. $curl_includes_unistd
  2781. $curl_preprocess_callconv
  2782. extern int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
  2783. ]],[[
  2784. if(0 != gethostname(0, 0))
  2785. return 1;
  2786. ]])
  2787. ],[
  2788. tst_gethostname_type_arg2="$tst_arg2"
  2789. ])
  2790. fi
  2791. done
  2792. done
  2793. AC_MSG_RESULT([$tst_gethostname_type_arg2])
  2794. if test "$tst_gethostname_type_arg2" != "unknown"; then
  2795. AC_DEFINE_UNQUOTED(GETHOSTNAME_TYPE_ARG2, $tst_gethostname_type_arg2,
  2796. [Define to the type of arg 2 for gethostname.])
  2797. fi
  2798. fi
  2799. #
  2800. if test "$tst_compi_gethostname" = "yes"; then
  2801. AC_MSG_CHECKING([if gethostname usage allowed])
  2802. if test "x$curl_disallow_gethostname" != "xyes"; then
  2803. AC_MSG_RESULT([yes])
  2804. tst_allow_gethostname="yes"
  2805. else
  2806. AC_MSG_RESULT([no])
  2807. tst_allow_gethostname="no"
  2808. fi
  2809. fi
  2810. #
  2811. AC_MSG_CHECKING([if gethostname might be used])
  2812. if test "$tst_links_gethostname" = "yes" &&
  2813. test "$tst_proto_gethostname" = "yes" &&
  2814. test "$tst_compi_gethostname" = "yes" &&
  2815. test "$tst_allow_gethostname" = "yes"; then
  2816. AC_MSG_RESULT([yes])
  2817. AC_DEFINE_UNQUOTED(HAVE_GETHOSTNAME, 1,
  2818. [Define to 1 if you have the gethostname function.])
  2819. curl_cv_func_gethostname="yes"
  2820. else
  2821. AC_MSG_RESULT([no])
  2822. curl_cv_func_gethostname="no"
  2823. fi
  2824. ])
  2825. dnl CURL_CHECK_FUNC_GETIFADDRS
  2826. dnl -------------------------------------------------
  2827. dnl Verify if getifaddrs is available, prototyped, can
  2828. dnl be compiled and seems to work. If all of these are
  2829. dnl true, and usage has not been previously disallowed
  2830. dnl with shell variable curl_disallow_getifaddrs, then
  2831. dnl HAVE_GETIFADDRS will be defined.
  2832. AC_DEFUN([CURL_CHECK_FUNC_GETIFADDRS], [
  2833. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  2834. AC_REQUIRE([CURL_INCLUDES_IFADDRS])dnl
  2835. #
  2836. tst_links_getifaddrs="unknown"
  2837. tst_proto_getifaddrs="unknown"
  2838. tst_compi_getifaddrs="unknown"
  2839. tst_works_getifaddrs="unknown"
  2840. tst_allow_getifaddrs="unknown"
  2841. #
  2842. AC_MSG_CHECKING([if getifaddrs can be linked])
  2843. AC_LINK_IFELSE([
  2844. AC_LANG_FUNC_LINK_TRY([getifaddrs])
  2845. ],[
  2846. AC_MSG_RESULT([yes])
  2847. tst_links_getifaddrs="yes"
  2848. ],[
  2849. AC_MSG_RESULT([no])
  2850. tst_links_getifaddrs="no"
  2851. ])
  2852. #
  2853. if test "$tst_links_getifaddrs" = "yes"; then
  2854. AC_MSG_CHECKING([if getifaddrs is prototyped])
  2855. AC_EGREP_CPP([getifaddrs],[
  2856. $curl_includes_ifaddrs
  2857. ],[
  2858. AC_MSG_RESULT([yes])
  2859. tst_proto_getifaddrs="yes"
  2860. ],[
  2861. AC_MSG_RESULT([no])
  2862. tst_proto_getifaddrs="no"
  2863. ])
  2864. fi
  2865. #
  2866. if test "$tst_proto_getifaddrs" = "yes"; then
  2867. AC_MSG_CHECKING([if getifaddrs is compilable])
  2868. AC_COMPILE_IFELSE([
  2869. AC_LANG_PROGRAM([[
  2870. $curl_includes_ifaddrs
  2871. ]],[[
  2872. if(0 != getifaddrs(0))
  2873. return 1;
  2874. ]])
  2875. ],[
  2876. AC_MSG_RESULT([yes])
  2877. tst_compi_getifaddrs="yes"
  2878. ],[
  2879. AC_MSG_RESULT([no])
  2880. tst_compi_getifaddrs="no"
  2881. ])
  2882. fi
  2883. #
  2884. dnl only do runtime verification when not cross-compiling
  2885. if test "x$cross_compiling" != "xyes" &&
  2886. test "$tst_compi_getifaddrs" = "yes"; then
  2887. AC_MSG_CHECKING([if getifaddrs seems to work])
  2888. AC_RUN_IFELSE([
  2889. AC_LANG_PROGRAM([[
  2890. $curl_includes_stdlib
  2891. $curl_includes_ifaddrs
  2892. ]],[[
  2893. struct ifaddrs *ifa = 0;
  2894. int error;
  2895. error = getifaddrs(&ifa);
  2896. if(error || !ifa)
  2897. exit(1); /* fail */
  2898. else
  2899. exit(0);
  2900. ]])
  2901. ],[
  2902. AC_MSG_RESULT([yes])
  2903. tst_works_getifaddrs="yes"
  2904. ],[
  2905. AC_MSG_RESULT([no])
  2906. tst_works_getifaddrs="no"
  2907. ])
  2908. fi
  2909. #
  2910. if test "$tst_compi_getifaddrs" = "yes" &&
  2911. test "$tst_works_getifaddrs" != "no"; then
  2912. AC_MSG_CHECKING([if getifaddrs usage allowed])
  2913. if test "x$curl_disallow_getifaddrs" != "xyes"; then
  2914. AC_MSG_RESULT([yes])
  2915. tst_allow_getifaddrs="yes"
  2916. else
  2917. AC_MSG_RESULT([no])
  2918. tst_allow_getifaddrs="no"
  2919. fi
  2920. fi
  2921. #
  2922. AC_MSG_CHECKING([if getifaddrs might be used])
  2923. if test "$tst_links_getifaddrs" = "yes" &&
  2924. test "$tst_proto_getifaddrs" = "yes" &&
  2925. test "$tst_compi_getifaddrs" = "yes" &&
  2926. test "$tst_allow_getifaddrs" = "yes" &&
  2927. test "$tst_works_getifaddrs" != "no"; then
  2928. AC_MSG_RESULT([yes])
  2929. AC_DEFINE_UNQUOTED(HAVE_GETIFADDRS, 1,
  2930. [Define to 1 if you have a working getifaddrs function.])
  2931. curl_cv_func_getifaddrs="yes"
  2932. else
  2933. AC_MSG_RESULT([no])
  2934. curl_cv_func_getifaddrs="no"
  2935. fi
  2936. ])
  2937. dnl CURL_CHECK_FUNC_GETSERVBYPORT_R
  2938. dnl -------------------------------------------------
  2939. dnl Verify if getservbyport_r is available, prototyped,
  2940. dnl and can be compiled. If all of these are true, and
  2941. dnl usage has not been previously disallowed with
  2942. dnl shell variable curl_disallow_getservbyport_r, then
  2943. dnl HAVE_GETSERVBYPORT_R will be defined.
  2944. AC_DEFUN([CURL_CHECK_FUNC_GETSERVBYPORT_R], [
  2945. AC_REQUIRE([CURL_INCLUDES_NETDB])dnl
  2946. #
  2947. tst_links_getservbyport_r="unknown"
  2948. tst_proto_getservbyport_r="unknown"
  2949. tst_compi_getservbyport_r="unknown"
  2950. tst_allow_getservbyport_r="unknown"
  2951. tst_nargs_getservbyport_r="unknown"
  2952. #
  2953. AC_MSG_CHECKING([if getservbyport_r can be linked])
  2954. AC_LINK_IFELSE([
  2955. AC_LANG_FUNC_LINK_TRY([getservbyport_r])
  2956. ],[
  2957. AC_MSG_RESULT([yes])
  2958. tst_links_getservbyport_r="yes"
  2959. ],[
  2960. AC_MSG_RESULT([no])
  2961. tst_links_getservbyport_r="no"
  2962. ])
  2963. #
  2964. if test "$tst_links_getservbyport_r" = "yes"; then
  2965. AC_MSG_CHECKING([if getservbyport_r is prototyped])
  2966. AC_EGREP_CPP([getservbyport_r],[
  2967. $curl_includes_netdb
  2968. ],[
  2969. AC_MSG_RESULT([yes])
  2970. tst_proto_getservbyport_r="yes"
  2971. ],[
  2972. AC_MSG_RESULT([no])
  2973. tst_proto_getservbyport_r="no"
  2974. ])
  2975. fi
  2976. #
  2977. if test "$tst_proto_getservbyport_r" = "yes"; then
  2978. if test "$tst_nargs_getservbyport_r" = "unknown"; then
  2979. AC_MSG_CHECKING([if getservbyport_r takes 4 args.])
  2980. AC_COMPILE_IFELSE([
  2981. AC_LANG_PROGRAM([[
  2982. $curl_includes_netdb
  2983. ]],[[
  2984. if(0 != getservbyport_r(0, 0, 0, 0))
  2985. return 1;
  2986. ]])
  2987. ],[
  2988. AC_MSG_RESULT([yes])
  2989. tst_compi_getservbyport_r="yes"
  2990. tst_nargs_getservbyport_r="4"
  2991. ],[
  2992. AC_MSG_RESULT([no])
  2993. tst_compi_getservbyport_r="no"
  2994. ])
  2995. fi
  2996. if test "$tst_nargs_getservbyport_r" = "unknown"; then
  2997. AC_MSG_CHECKING([if getservbyport_r takes 5 args.])
  2998. AC_COMPILE_IFELSE([
  2999. AC_LANG_PROGRAM([[
  3000. $curl_includes_netdb
  3001. ]],[[
  3002. if(0 != getservbyport_r(0, 0, 0, 0, 0))
  3003. return 1;
  3004. ]])
  3005. ],[
  3006. AC_MSG_RESULT([yes])
  3007. tst_compi_getservbyport_r="yes"
  3008. tst_nargs_getservbyport_r="5"
  3009. ],[
  3010. AC_MSG_RESULT([no])
  3011. tst_compi_getservbyport_r="no"
  3012. ])
  3013. fi
  3014. if test "$tst_nargs_getservbyport_r" = "unknown"; then
  3015. AC_MSG_CHECKING([if getservbyport_r takes 6 args.])
  3016. AC_COMPILE_IFELSE([
  3017. AC_LANG_PROGRAM([[
  3018. $curl_includes_netdb
  3019. ]],[[
  3020. if(0 != getservbyport_r(0, 0, 0, 0, 0, 0))
  3021. return 1;
  3022. ]])
  3023. ],[
  3024. AC_MSG_RESULT([yes])
  3025. tst_compi_getservbyport_r="yes"
  3026. tst_nargs_getservbyport_r="6"
  3027. ],[
  3028. AC_MSG_RESULT([no])
  3029. tst_compi_getservbyport_r="no"
  3030. ])
  3031. fi
  3032. AC_MSG_CHECKING([if getservbyport_r is compilable])
  3033. if test "$tst_compi_getservbyport_r" = "yes"; then
  3034. AC_MSG_RESULT([yes])
  3035. else
  3036. AC_MSG_RESULT([no])
  3037. fi
  3038. fi
  3039. #
  3040. if test "$tst_compi_getservbyport_r" = "yes"; then
  3041. AC_MSG_CHECKING([if getservbyport_r usage allowed])
  3042. if test "x$curl_disallow_getservbyport_r" != "xyes"; then
  3043. AC_MSG_RESULT([yes])
  3044. tst_allow_getservbyport_r="yes"
  3045. else
  3046. AC_MSG_RESULT([no])
  3047. tst_allow_getservbyport_r="no"
  3048. fi
  3049. fi
  3050. #
  3051. AC_MSG_CHECKING([if getservbyport_r might be used])
  3052. if test "$tst_links_getservbyport_r" = "yes" &&
  3053. test "$tst_proto_getservbyport_r" = "yes" &&
  3054. test "$tst_compi_getservbyport_r" = "yes" &&
  3055. test "$tst_allow_getservbyport_r" = "yes"; then
  3056. AC_MSG_RESULT([yes])
  3057. AC_DEFINE_UNQUOTED(HAVE_GETSERVBYPORT_R, 1,
  3058. [Define to 1 if you have the getservbyport_r function.])
  3059. AC_DEFINE_UNQUOTED(GETSERVBYPORT_R_ARGS, $tst_nargs_getservbyport_r,
  3060. [Specifies the number of arguments to getservbyport_r])
  3061. if test "$tst_nargs_getservbyport_r" -eq "4"; then
  3062. AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, sizeof(struct servent_data),
  3063. [Specifies the size of the buffer to pass to getservbyport_r])
  3064. else
  3065. AC_DEFINE(GETSERVBYPORT_R_BUFSIZE, 4096,
  3066. [Specifies the size of the buffer to pass to getservbyport_r])
  3067. fi
  3068. curl_cv_func_getservbyport_r="yes"
  3069. else
  3070. AC_MSG_RESULT([no])
  3071. curl_cv_func_getservbyport_r="no"
  3072. fi
  3073. ])
  3074. dnl CURL_CHECK_FUNC_GETXATTR
  3075. dnl -------------------------------------------------
  3076. dnl Verify if getxattr is available, prototyped, and
  3077. dnl can be compiled. If all of these are true, and
  3078. dnl usage has not been previously disallowed with
  3079. dnl shell variable curl_disallow_getxattr, then
  3080. dnl HAVE_GETXATTR will be defined.
  3081. AC_DEFUN([CURL_CHECK_FUNC_GETXATTR], [
  3082. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  3083. #
  3084. tst_links_getxattr="unknown"
  3085. tst_proto_getxattr="unknown"
  3086. tst_compi_getxattr="unknown"
  3087. tst_allow_getxattr="unknown"
  3088. tst_nargs_getxattr="unknown"
  3089. #
  3090. AC_MSG_CHECKING([if getxattr can be linked])
  3091. AC_LINK_IFELSE([
  3092. AC_LANG_FUNC_LINK_TRY([getxattr])
  3093. ],[
  3094. AC_MSG_RESULT([yes])
  3095. tst_links_getxattr="yes"
  3096. ],[
  3097. AC_MSG_RESULT([no])
  3098. tst_links_getxattr="no"
  3099. ])
  3100. #
  3101. if test "$tst_links_getxattr" = "yes"; then
  3102. AC_MSG_CHECKING([if getxattr is prototyped])
  3103. AC_EGREP_CPP([getxattr],[
  3104. $curl_includes_sys_xattr
  3105. ],[
  3106. AC_MSG_RESULT([yes])
  3107. tst_proto_getxattr="yes"
  3108. ],[
  3109. AC_MSG_RESULT([no])
  3110. tst_proto_getxattr="no"
  3111. ])
  3112. fi
  3113. #
  3114. if test "$tst_proto_getxattr" = "yes"; then
  3115. if test "$tst_nargs_getxattr" = "unknown"; then
  3116. AC_MSG_CHECKING([if getxattr takes 4 args.])
  3117. AC_COMPILE_IFELSE([
  3118. AC_LANG_PROGRAM([[
  3119. $curl_includes_sys_xattr
  3120. ]],[[
  3121. if(0 != getxattr(0, 0, 0, 0))
  3122. return 1;
  3123. ]])
  3124. ],[
  3125. AC_MSG_RESULT([yes])
  3126. tst_compi_getxattr="yes"
  3127. tst_nargs_getxattr="4"
  3128. ],[
  3129. AC_MSG_RESULT([no])
  3130. tst_compi_getxattr="no"
  3131. ])
  3132. fi
  3133. if test "$tst_nargs_getxattr" = "unknown"; then
  3134. AC_MSG_CHECKING([if getxattr takes 6 args.])
  3135. AC_COMPILE_IFELSE([
  3136. AC_LANG_PROGRAM([[
  3137. $curl_includes_sys_xattr
  3138. ]],[[
  3139. if(0 != getxattr(0, 0, 0, 0, 0, 0))
  3140. return 1;
  3141. ]])
  3142. ],[
  3143. AC_MSG_RESULT([yes])
  3144. tst_compi_getxattr="yes"
  3145. tst_nargs_getxattr="6"
  3146. ],[
  3147. AC_MSG_RESULT([no])
  3148. tst_compi_getxattr="no"
  3149. ])
  3150. fi
  3151. AC_MSG_CHECKING([if getxattr is compilable])
  3152. if test "$tst_compi_getxattr" = "yes"; then
  3153. AC_MSG_RESULT([yes])
  3154. else
  3155. AC_MSG_RESULT([no])
  3156. fi
  3157. fi
  3158. #
  3159. if test "$tst_compi_getxattr" = "yes"; then
  3160. AC_MSG_CHECKING([if getxattr usage allowed])
  3161. if test "x$curl_disallow_getxattr" != "xyes"; then
  3162. AC_MSG_RESULT([yes])
  3163. tst_allow_getxattr="yes"
  3164. else
  3165. AC_MSG_RESULT([no])
  3166. tst_allow_getxattr="no"
  3167. fi
  3168. fi
  3169. #
  3170. AC_MSG_CHECKING([if getxattr might be used])
  3171. if test "$tst_links_getxattr" = "yes" &&
  3172. test "$tst_proto_getxattr" = "yes" &&
  3173. test "$tst_compi_getxattr" = "yes" &&
  3174. test "$tst_allow_getxattr" = "yes"; then
  3175. AC_MSG_RESULT([yes])
  3176. AC_DEFINE_UNQUOTED(HAVE_GETXATTR, 1,
  3177. [Define to 1 if you have the getxattr function.])
  3178. dnl AC_DEFINE_UNQUOTED(GETXATTR_ARGS, $tst_nargs_getxattr,
  3179. dnl [Specifies the number of arguments to getxattr])
  3180. #
  3181. if test "$tst_nargs_getxattr" -eq "4"; then
  3182. AC_DEFINE(HAVE_GETXATTR_4, 1, [getxattr() takes 4 args])
  3183. elif test "$tst_nargs_getxattr" -eq "6"; then
  3184. AC_DEFINE(HAVE_GETXATTR_6, 1, [getxattr() takes 6 args])
  3185. fi
  3186. #
  3187. curl_cv_func_getxattr="yes"
  3188. else
  3189. AC_MSG_RESULT([no])
  3190. curl_cv_func_getxattr="no"
  3191. fi
  3192. ])
  3193. dnl CURL_CHECK_FUNC_GMTIME_R
  3194. dnl -------------------------------------------------
  3195. dnl Verify if gmtime_r is available, prototyped, can
  3196. dnl be compiled and seems to work. If all of these are
  3197. dnl true, and usage has not been previously disallowed
  3198. dnl with shell variable curl_disallow_gmtime_r, then
  3199. dnl HAVE_GMTIME_R will be defined.
  3200. AC_DEFUN([CURL_CHECK_FUNC_GMTIME_R], [
  3201. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  3202. AC_REQUIRE([CURL_INCLUDES_TIME])dnl
  3203. #
  3204. tst_links_gmtime_r="unknown"
  3205. tst_proto_gmtime_r="unknown"
  3206. tst_compi_gmtime_r="unknown"
  3207. tst_works_gmtime_r="unknown"
  3208. tst_allow_gmtime_r="unknown"
  3209. #
  3210. AC_MSG_CHECKING([if gmtime_r can be linked])
  3211. AC_LINK_IFELSE([
  3212. AC_LANG_FUNC_LINK_TRY([gmtime_r])
  3213. ],[
  3214. AC_MSG_RESULT([yes])
  3215. tst_links_gmtime_r="yes"
  3216. ],[
  3217. AC_MSG_RESULT([no])
  3218. tst_links_gmtime_r="no"
  3219. ])
  3220. #
  3221. if test "$tst_links_gmtime_r" = "yes"; then
  3222. AC_MSG_CHECKING([if gmtime_r is prototyped])
  3223. AC_EGREP_CPP([gmtime_r],[
  3224. $curl_includes_time
  3225. ],[
  3226. AC_MSG_RESULT([yes])
  3227. tst_proto_gmtime_r="yes"
  3228. ],[
  3229. AC_MSG_RESULT([no])
  3230. tst_proto_gmtime_r="no"
  3231. ])
  3232. fi
  3233. #
  3234. if test "$tst_proto_gmtime_r" = "yes"; then
  3235. AC_MSG_CHECKING([if gmtime_r is compilable])
  3236. AC_COMPILE_IFELSE([
  3237. AC_LANG_PROGRAM([[
  3238. $curl_includes_time
  3239. ]],[[
  3240. if(0 != gmtime_r(0, 0))
  3241. return 1;
  3242. ]])
  3243. ],[
  3244. AC_MSG_RESULT([yes])
  3245. tst_compi_gmtime_r="yes"
  3246. ],[
  3247. AC_MSG_RESULT([no])
  3248. tst_compi_gmtime_r="no"
  3249. ])
  3250. fi
  3251. #
  3252. dnl only do runtime verification when not cross-compiling
  3253. if test "x$cross_compiling" != "xyes" &&
  3254. test "$tst_compi_gmtime_r" = "yes"; then
  3255. AC_MSG_CHECKING([if gmtime_r seems to work])
  3256. AC_RUN_IFELSE([
  3257. AC_LANG_PROGRAM([[
  3258. $curl_includes_stdlib
  3259. $curl_includes_time
  3260. ]],[[
  3261. time_t local = 1170352587;
  3262. struct tm *gmt = 0;
  3263. struct tm result;
  3264. gmt = gmtime_r(&local, &result);
  3265. if(gmt)
  3266. exit(0);
  3267. else
  3268. exit(1);
  3269. ]])
  3270. ],[
  3271. AC_MSG_RESULT([yes])
  3272. tst_works_gmtime_r="yes"
  3273. ],[
  3274. AC_MSG_RESULT([no])
  3275. tst_works_gmtime_r="no"
  3276. ])
  3277. fi
  3278. #
  3279. if test "$tst_compi_gmtime_r" = "yes" &&
  3280. test "$tst_works_gmtime_r" != "no"; then
  3281. AC_MSG_CHECKING([if gmtime_r usage allowed])
  3282. if test "x$curl_disallow_gmtime_r" != "xyes"; then
  3283. AC_MSG_RESULT([yes])
  3284. tst_allow_gmtime_r="yes"
  3285. else
  3286. AC_MSG_RESULT([no])
  3287. tst_allow_gmtime_r="no"
  3288. fi
  3289. fi
  3290. #
  3291. AC_MSG_CHECKING([if gmtime_r might be used])
  3292. if test "$tst_links_gmtime_r" = "yes" &&
  3293. test "$tst_proto_gmtime_r" = "yes" &&
  3294. test "$tst_compi_gmtime_r" = "yes" &&
  3295. test "$tst_allow_gmtime_r" = "yes" &&
  3296. test "$tst_works_gmtime_r" != "no"; then
  3297. AC_MSG_RESULT([yes])
  3298. AC_DEFINE_UNQUOTED(HAVE_GMTIME_R, 1,
  3299. [Define to 1 if you have a working gmtime_r function.])
  3300. curl_cv_func_gmtime_r="yes"
  3301. else
  3302. AC_MSG_RESULT([no])
  3303. curl_cv_func_gmtime_r="no"
  3304. fi
  3305. ])
  3306. dnl CURL_CHECK_FUNC_INET_NTOA_R
  3307. dnl -------------------------------------------------
  3308. dnl Verify if inet_ntoa_r is available, prototyped,
  3309. dnl and can be compiled. If all of these are true, and
  3310. dnl usage has not been previously disallowed with
  3311. dnl shell variable curl_disallow_inet_ntoa_r, then
  3312. dnl HAVE_INET_NTOA_R will be defined.
  3313. AC_DEFUN([CURL_CHECK_FUNC_INET_NTOA_R], [
  3314. AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
  3315. #
  3316. tst_links_inet_ntoa_r="unknown"
  3317. tst_proto_inet_ntoa_r="unknown"
  3318. tst_compi_inet_ntoa_r="unknown"
  3319. tst_allow_inet_ntoa_r="unknown"
  3320. tst_nargs_inet_ntoa_r="unknown"
  3321. #
  3322. AC_MSG_CHECKING([if inet_ntoa_r can be linked])
  3323. AC_LINK_IFELSE([
  3324. AC_LANG_FUNC_LINK_TRY([inet_ntoa_r])
  3325. ],[
  3326. AC_MSG_RESULT([yes])
  3327. tst_links_inet_ntoa_r="yes"
  3328. ],[
  3329. AC_MSG_RESULT([no])
  3330. tst_links_inet_ntoa_r="no"
  3331. ])
  3332. #
  3333. if test "$tst_links_inet_ntoa_r" = "yes"; then
  3334. AC_MSG_CHECKING([if inet_ntoa_r is prototyped])
  3335. AC_EGREP_CPP([inet_ntoa_r],[
  3336. $curl_includes_arpa_inet
  3337. ],[
  3338. AC_MSG_RESULT([yes])
  3339. tst_proto_inet_ntoa_r="yes"
  3340. ],[
  3341. AC_MSG_RESULT([no])
  3342. tst_proto_inet_ntoa_r="no"
  3343. ])
  3344. fi
  3345. #
  3346. if test "$tst_proto_inet_ntoa_r" = "yes"; then
  3347. if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
  3348. AC_MSG_CHECKING([if inet_ntoa_r takes 2 args.])
  3349. AC_COMPILE_IFELSE([
  3350. AC_LANG_PROGRAM([[
  3351. $curl_includes_arpa_inet
  3352. ]],[[
  3353. struct in_addr addr;
  3354. if(0 != inet_ntoa_r(addr, 0))
  3355. return 1;
  3356. ]])
  3357. ],[
  3358. AC_MSG_RESULT([yes])
  3359. tst_compi_inet_ntoa_r="yes"
  3360. tst_nargs_inet_ntoa_r="2"
  3361. ],[
  3362. AC_MSG_RESULT([no])
  3363. tst_compi_inet_ntoa_r="no"
  3364. ])
  3365. fi
  3366. if test "$tst_nargs_inet_ntoa_r" = "unknown"; then
  3367. AC_MSG_CHECKING([if inet_ntoa_r takes 3 args.])
  3368. AC_COMPILE_IFELSE([
  3369. AC_LANG_PROGRAM([[
  3370. $curl_includes_arpa_inet
  3371. ]],[[
  3372. struct in_addr addr;
  3373. if(0 != inet_ntoa_r(addr, 0, 0))
  3374. return 1;
  3375. ]])
  3376. ],[
  3377. AC_MSG_RESULT([yes])
  3378. tst_compi_inet_ntoa_r="yes"
  3379. tst_nargs_inet_ntoa_r="3"
  3380. ],[
  3381. AC_MSG_RESULT([no])
  3382. tst_compi_inet_ntoa_r="no"
  3383. ])
  3384. fi
  3385. AC_MSG_CHECKING([if inet_ntoa_r is compilable])
  3386. if test "$tst_compi_inet_ntoa_r" = "yes"; then
  3387. AC_MSG_RESULT([yes])
  3388. else
  3389. AC_MSG_RESULT([no])
  3390. fi
  3391. fi
  3392. #
  3393. if test "$tst_compi_inet_ntoa_r" = "yes"; then
  3394. AC_MSG_CHECKING([if inet_ntoa_r usage allowed])
  3395. if test "x$curl_disallow_inet_ntoa_r" != "xyes"; then
  3396. AC_MSG_RESULT([yes])
  3397. tst_allow_inet_ntoa_r="yes"
  3398. else
  3399. AC_MSG_RESULT([no])
  3400. tst_allow_inet_ntoa_r="no"
  3401. fi
  3402. fi
  3403. #
  3404. AC_MSG_CHECKING([if inet_ntoa_r might be used])
  3405. if test "$tst_links_inet_ntoa_r" = "yes" &&
  3406. test "$tst_proto_inet_ntoa_r" = "yes" &&
  3407. test "$tst_compi_inet_ntoa_r" = "yes" &&
  3408. test "$tst_allow_inet_ntoa_r" = "yes"; then
  3409. AC_MSG_RESULT([yes])
  3410. AC_DEFINE_UNQUOTED(HAVE_INET_NTOA_R, 1,
  3411. [Define to 1 if you have the inet_ntoa_r function.])
  3412. dnl AC_DEFINE_UNQUOTED(INET_NTOA_R_ARGS, $tst_nargs_inet_ntoa_r,
  3413. dnl [Specifies the number of arguments to inet_ntoa_r])
  3414. #
  3415. if test "$tst_nargs_inet_ntoa_r" -eq "2"; then
  3416. AC_DEFINE(HAVE_INET_NTOA_R_2, 1, [inet_ntoa_r() takes 2 args])
  3417. elif test "$tst_nargs_inet_ntoa_r" -eq "3"; then
  3418. AC_DEFINE(HAVE_INET_NTOA_R_3, 1, [inet_ntoa_r() takes 3 args])
  3419. fi
  3420. #
  3421. curl_cv_func_inet_ntoa_r="yes"
  3422. else
  3423. AC_MSG_RESULT([no])
  3424. curl_cv_func_inet_ntoa_r="no"
  3425. fi
  3426. ])
  3427. dnl CURL_CHECK_FUNC_INET_NTOP
  3428. dnl -------------------------------------------------
  3429. dnl Verify if inet_ntop is available, prototyped, can
  3430. dnl be compiled and seems to work. If all of these are
  3431. dnl true, and usage has not been previously disallowed
  3432. dnl with shell variable curl_disallow_inet_ntop, then
  3433. dnl HAVE_INET_NTOP will be defined.
  3434. AC_DEFUN([CURL_CHECK_FUNC_INET_NTOP], [
  3435. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  3436. AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
  3437. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  3438. #
  3439. tst_links_inet_ntop="unknown"
  3440. tst_proto_inet_ntop="unknown"
  3441. tst_compi_inet_ntop="unknown"
  3442. tst_works_inet_ntop="unknown"
  3443. tst_allow_inet_ntop="unknown"
  3444. #
  3445. AC_MSG_CHECKING([if inet_ntop can be linked])
  3446. AC_LINK_IFELSE([
  3447. AC_LANG_FUNC_LINK_TRY([inet_ntop])
  3448. ],[
  3449. AC_MSG_RESULT([yes])
  3450. tst_links_inet_ntop="yes"
  3451. ],[
  3452. AC_MSG_RESULT([no])
  3453. tst_links_inet_ntop="no"
  3454. ])
  3455. #
  3456. if test "$tst_links_inet_ntop" = "yes"; then
  3457. AC_MSG_CHECKING([if inet_ntop is prototyped])
  3458. AC_EGREP_CPP([inet_ntop],[
  3459. $curl_includes_arpa_inet
  3460. ],[
  3461. AC_MSG_RESULT([yes])
  3462. tst_proto_inet_ntop="yes"
  3463. ],[
  3464. AC_MSG_RESULT([no])
  3465. tst_proto_inet_ntop="no"
  3466. ])
  3467. fi
  3468. #
  3469. if test "$tst_proto_inet_ntop" = "yes"; then
  3470. AC_MSG_CHECKING([if inet_ntop is compilable])
  3471. AC_COMPILE_IFELSE([
  3472. AC_LANG_PROGRAM([[
  3473. $curl_includes_arpa_inet
  3474. ]],[[
  3475. if(0 != inet_ntop(0, 0, 0, 0))
  3476. return 1;
  3477. ]])
  3478. ],[
  3479. AC_MSG_RESULT([yes])
  3480. tst_compi_inet_ntop="yes"
  3481. ],[
  3482. AC_MSG_RESULT([no])
  3483. tst_compi_inet_ntop="no"
  3484. ])
  3485. fi
  3486. #
  3487. dnl only do runtime verification when not cross-compiling
  3488. if test "x$cross_compiling" != "xyes" &&
  3489. test "$tst_compi_inet_ntop" = "yes"; then
  3490. AC_MSG_CHECKING([if inet_ntop seems to work])
  3491. AC_RUN_IFELSE([
  3492. AC_LANG_PROGRAM([[
  3493. $curl_includes_stdlib
  3494. $curl_includes_arpa_inet
  3495. $curl_includes_string
  3496. ]],[[
  3497. char ipv6res[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
  3498. char ipv4res[sizeof "255.255.255.255"];
  3499. unsigned char ipv6a[26];
  3500. unsigned char ipv4a[5];
  3501. char *ipv6ptr = 0;
  3502. char *ipv4ptr = 0;
  3503. /* - */
  3504. ipv4res[0] = '\0';
  3505. ipv4a[0] = 0xc0;
  3506. ipv4a[1] = 0xa8;
  3507. ipv4a[2] = 0x64;
  3508. ipv4a[3] = 0x01;
  3509. ipv4a[4] = 0x01;
  3510. /* - */
  3511. ipv4ptr = inet_ntop(AF_INET, ipv4a, ipv4res, sizeof(ipv4res));
  3512. if(!ipv4ptr)
  3513. exit(1); /* fail */
  3514. if(ipv4ptr != ipv4res)
  3515. exit(1); /* fail */
  3516. if(!ipv4ptr[0])
  3517. exit(1); /* fail */
  3518. if(memcmp(ipv4res, "192.168.100.1", 13) != 0)
  3519. exit(1); /* fail */
  3520. /* - */
  3521. ipv6res[0] = '\0';
  3522. memset(ipv6a, 0, sizeof(ipv6a));
  3523. ipv6a[0] = 0xfe;
  3524. ipv6a[1] = 0x80;
  3525. ipv6a[8] = 0x02;
  3526. ipv6a[9] = 0x14;
  3527. ipv6a[10] = 0x4f;
  3528. ipv6a[11] = 0xff;
  3529. ipv6a[12] = 0xfe;
  3530. ipv6a[13] = 0x0b;
  3531. ipv6a[14] = 0x76;
  3532. ipv6a[15] = 0xc8;
  3533. ipv6a[25] = 0x01;
  3534. /* - */
  3535. ipv6ptr = inet_ntop(AF_INET6, ipv6a, ipv6res, sizeof(ipv6res));
  3536. if(!ipv6ptr)
  3537. exit(1); /* fail */
  3538. if(ipv6ptr != ipv6res)
  3539. exit(1); /* fail */
  3540. if(!ipv6ptr[0])
  3541. exit(1); /* fail */
  3542. if(memcmp(ipv6res, "fe80::214:4fff:fe0b:76c8", 24) != 0)
  3543. exit(1); /* fail */
  3544. /* - */
  3545. exit(0);
  3546. ]])
  3547. ],[
  3548. AC_MSG_RESULT([yes])
  3549. tst_works_inet_ntop="yes"
  3550. ],[
  3551. AC_MSG_RESULT([no])
  3552. tst_works_inet_ntop="no"
  3553. ])
  3554. fi
  3555. #
  3556. if test "$tst_compi_inet_ntop" = "yes" &&
  3557. test "$tst_works_inet_ntop" != "no"; then
  3558. AC_MSG_CHECKING([if inet_ntop usage allowed])
  3559. if test "x$curl_disallow_inet_ntop" != "xyes"; then
  3560. AC_MSG_RESULT([yes])
  3561. tst_allow_inet_ntop="yes"
  3562. else
  3563. AC_MSG_RESULT([no])
  3564. tst_allow_inet_ntop="no"
  3565. fi
  3566. fi
  3567. #
  3568. AC_MSG_CHECKING([if inet_ntop might be used])
  3569. if test "$tst_links_inet_ntop" = "yes" &&
  3570. test "$tst_proto_inet_ntop" = "yes" &&
  3571. test "$tst_compi_inet_ntop" = "yes" &&
  3572. test "$tst_allow_inet_ntop" = "yes" &&
  3573. test "$tst_works_inet_ntop" != "no"; then
  3574. AC_MSG_RESULT([yes])
  3575. AC_DEFINE_UNQUOTED(HAVE_INET_NTOP, 1,
  3576. [Define to 1 if you have a IPv6 capable working inet_ntop function.])
  3577. curl_cv_func_inet_ntop="yes"
  3578. else
  3579. AC_MSG_RESULT([no])
  3580. curl_cv_func_inet_ntop="no"
  3581. fi
  3582. ])
  3583. dnl CURL_CHECK_FUNC_INET_PTON
  3584. dnl -------------------------------------------------
  3585. dnl Verify if inet_pton is available, prototyped, can
  3586. dnl be compiled and seems to work. If all of these are
  3587. dnl true, and usage has not been previously disallowed
  3588. dnl with shell variable curl_disallow_inet_pton, then
  3589. dnl HAVE_INET_PTON will be defined.
  3590. AC_DEFUN([CURL_CHECK_FUNC_INET_PTON], [
  3591. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  3592. AC_REQUIRE([CURL_INCLUDES_ARPA_INET])dnl
  3593. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  3594. #
  3595. tst_links_inet_pton="unknown"
  3596. tst_proto_inet_pton="unknown"
  3597. tst_compi_inet_pton="unknown"
  3598. tst_works_inet_pton="unknown"
  3599. tst_allow_inet_pton="unknown"
  3600. #
  3601. AC_MSG_CHECKING([if inet_pton can be linked])
  3602. AC_LINK_IFELSE([
  3603. AC_LANG_FUNC_LINK_TRY([inet_pton])
  3604. ],[
  3605. AC_MSG_RESULT([yes])
  3606. tst_links_inet_pton="yes"
  3607. ],[
  3608. AC_MSG_RESULT([no])
  3609. tst_links_inet_pton="no"
  3610. ])
  3611. #
  3612. if test "$tst_links_inet_pton" = "yes"; then
  3613. AC_MSG_CHECKING([if inet_pton is prototyped])
  3614. AC_EGREP_CPP([inet_pton],[
  3615. $curl_includes_arpa_inet
  3616. ],[
  3617. AC_MSG_RESULT([yes])
  3618. tst_proto_inet_pton="yes"
  3619. ],[
  3620. AC_MSG_RESULT([no])
  3621. tst_proto_inet_pton="no"
  3622. ])
  3623. fi
  3624. #
  3625. if test "$tst_proto_inet_pton" = "yes"; then
  3626. AC_MSG_CHECKING([if inet_pton is compilable])
  3627. AC_COMPILE_IFELSE([
  3628. AC_LANG_PROGRAM([[
  3629. $curl_includes_arpa_inet
  3630. ]],[[
  3631. if(0 != inet_pton(0, 0, 0))
  3632. return 1;
  3633. ]])
  3634. ],[
  3635. AC_MSG_RESULT([yes])
  3636. tst_compi_inet_pton="yes"
  3637. ],[
  3638. AC_MSG_RESULT([no])
  3639. tst_compi_inet_pton="no"
  3640. ])
  3641. fi
  3642. #
  3643. dnl only do runtime verification when not cross-compiling
  3644. if test "x$cross_compiling" != "xyes" &&
  3645. test "$tst_compi_inet_pton" = "yes"; then
  3646. AC_MSG_CHECKING([if inet_pton seems to work])
  3647. AC_RUN_IFELSE([
  3648. AC_LANG_PROGRAM([[
  3649. $curl_includes_stdlib
  3650. $curl_includes_arpa_inet
  3651. $curl_includes_string
  3652. ]],[[
  3653. unsigned char ipv6a[16+1];
  3654. unsigned char ipv4a[4+1];
  3655. const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
  3656. const char *ipv4src = "192.168.100.1";
  3657. /* - */
  3658. memset(ipv4a, 1, sizeof(ipv4a));
  3659. if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
  3660. exit(1); /* fail */
  3661. /* - */
  3662. if( (ipv4a[0] != 0xc0) ||
  3663. (ipv4a[1] != 0xa8) ||
  3664. (ipv4a[2] != 0x64) ||
  3665. (ipv4a[3] != 0x01) ||
  3666. (ipv4a[4] != 0x01) )
  3667. exit(1); /* fail */
  3668. /* - */
  3669. memset(ipv6a, 1, sizeof(ipv6a));
  3670. if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
  3671. exit(1); /* fail */
  3672. /* - */
  3673. if( (ipv6a[0] != 0xfe) ||
  3674. (ipv6a[1] != 0x80) ||
  3675. (ipv6a[8] != 0x02) ||
  3676. (ipv6a[9] != 0x14) ||
  3677. (ipv6a[10] != 0x4f) ||
  3678. (ipv6a[11] != 0xff) ||
  3679. (ipv6a[12] != 0xfe) ||
  3680. (ipv6a[13] != 0x0b) ||
  3681. (ipv6a[14] != 0x76) ||
  3682. (ipv6a[15] != 0xc8) ||
  3683. (ipv6a[16] != 0x01) )
  3684. exit(1); /* fail */
  3685. /* - */
  3686. if( (ipv6a[2] != 0x0) ||
  3687. (ipv6a[3] != 0x0) ||
  3688. (ipv6a[4] != 0x0) ||
  3689. (ipv6a[5] != 0x0) ||
  3690. (ipv6a[6] != 0x0) ||
  3691. (ipv6a[7] != 0x0) )
  3692. exit(1); /* fail */
  3693. /* - */
  3694. exit(0);
  3695. ]])
  3696. ],[
  3697. AC_MSG_RESULT([yes])
  3698. tst_works_inet_pton="yes"
  3699. ],[
  3700. AC_MSG_RESULT([no])
  3701. tst_works_inet_pton="no"
  3702. ])
  3703. fi
  3704. #
  3705. if test "$tst_compi_inet_pton" = "yes" &&
  3706. test "$tst_works_inet_pton" != "no"; then
  3707. AC_MSG_CHECKING([if inet_pton usage allowed])
  3708. if test "x$curl_disallow_inet_pton" != "xyes"; then
  3709. AC_MSG_RESULT([yes])
  3710. tst_allow_inet_pton="yes"
  3711. else
  3712. AC_MSG_RESULT([no])
  3713. tst_allow_inet_pton="no"
  3714. fi
  3715. fi
  3716. #
  3717. AC_MSG_CHECKING([if inet_pton might be used])
  3718. if test "$tst_links_inet_pton" = "yes" &&
  3719. test "$tst_proto_inet_pton" = "yes" &&
  3720. test "$tst_compi_inet_pton" = "yes" &&
  3721. test "$tst_allow_inet_pton" = "yes" &&
  3722. test "$tst_works_inet_pton" != "no"; then
  3723. AC_MSG_RESULT([yes])
  3724. AC_DEFINE_UNQUOTED(HAVE_INET_PTON, 1,
  3725. [Define to 1 if you have a IPv6 capable working inet_pton function.])
  3726. curl_cv_func_inet_pton="yes"
  3727. else
  3728. AC_MSG_RESULT([no])
  3729. curl_cv_func_inet_pton="no"
  3730. fi
  3731. ])
  3732. dnl CURL_CHECK_FUNC_IOCTL
  3733. dnl -------------------------------------------------
  3734. dnl Verify if ioctl is available, prototyped, and
  3735. dnl can be compiled. If all of these are true, and
  3736. dnl usage has not been previously disallowed with
  3737. dnl shell variable curl_disallow_ioctl, then
  3738. dnl HAVE_IOCTL will be defined.
  3739. AC_DEFUN([CURL_CHECK_FUNC_IOCTL], [
  3740. AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
  3741. #
  3742. tst_links_ioctl="unknown"
  3743. tst_proto_ioctl="unknown"
  3744. tst_compi_ioctl="unknown"
  3745. tst_allow_ioctl="unknown"
  3746. #
  3747. AC_MSG_CHECKING([if ioctl can be linked])
  3748. AC_LINK_IFELSE([
  3749. AC_LANG_FUNC_LINK_TRY([ioctl])
  3750. ],[
  3751. AC_MSG_RESULT([yes])
  3752. tst_links_ioctl="yes"
  3753. ],[
  3754. AC_MSG_RESULT([no])
  3755. tst_links_ioctl="no"
  3756. ])
  3757. #
  3758. if test "$tst_links_ioctl" = "yes"; then
  3759. AC_MSG_CHECKING([if ioctl is prototyped])
  3760. AC_EGREP_CPP([ioctl],[
  3761. $curl_includes_stropts
  3762. ],[
  3763. AC_MSG_RESULT([yes])
  3764. tst_proto_ioctl="yes"
  3765. ],[
  3766. AC_MSG_RESULT([no])
  3767. tst_proto_ioctl="no"
  3768. ])
  3769. fi
  3770. #
  3771. if test "$tst_proto_ioctl" = "yes"; then
  3772. AC_MSG_CHECKING([if ioctl is compilable])
  3773. AC_COMPILE_IFELSE([
  3774. AC_LANG_PROGRAM([[
  3775. $curl_includes_stropts
  3776. ]],[[
  3777. if(0 != ioctl(0, 0, 0))
  3778. return 1;
  3779. ]])
  3780. ],[
  3781. AC_MSG_RESULT([yes])
  3782. tst_compi_ioctl="yes"
  3783. ],[
  3784. AC_MSG_RESULT([no])
  3785. tst_compi_ioctl="no"
  3786. ])
  3787. fi
  3788. #
  3789. if test "$tst_compi_ioctl" = "yes"; then
  3790. AC_MSG_CHECKING([if ioctl usage allowed])
  3791. if test "x$curl_disallow_ioctl" != "xyes"; then
  3792. AC_MSG_RESULT([yes])
  3793. tst_allow_ioctl="yes"
  3794. else
  3795. AC_MSG_RESULT([no])
  3796. tst_allow_ioctl="no"
  3797. fi
  3798. fi
  3799. #
  3800. AC_MSG_CHECKING([if ioctl might be used])
  3801. if test "$tst_links_ioctl" = "yes" &&
  3802. test "$tst_proto_ioctl" = "yes" &&
  3803. test "$tst_compi_ioctl" = "yes" &&
  3804. test "$tst_allow_ioctl" = "yes"; then
  3805. AC_MSG_RESULT([yes])
  3806. AC_DEFINE_UNQUOTED(HAVE_IOCTL, 1,
  3807. [Define to 1 if you have the ioctl function.])
  3808. curl_cv_func_ioctl="yes"
  3809. CURL_CHECK_FUNC_IOCTL_FIONBIO
  3810. CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
  3811. else
  3812. AC_MSG_RESULT([no])
  3813. curl_cv_func_ioctl="no"
  3814. fi
  3815. ])
  3816. dnl CURL_CHECK_FUNC_IOCTL_FIONBIO
  3817. dnl -------------------------------------------------
  3818. dnl Verify if ioctl with the FIONBIO command is
  3819. dnl available, can be compiled, and seems to work. If
  3820. dnl all of these are true, then HAVE_IOCTL_FIONBIO
  3821. dnl will be defined.
  3822. AC_DEFUN([CURL_CHECK_FUNC_IOCTL_FIONBIO], [
  3823. #
  3824. tst_compi_ioctl_fionbio="unknown"
  3825. tst_allow_ioctl_fionbio="unknown"
  3826. #
  3827. if test "$curl_cv_func_ioctl" = "yes"; then
  3828. AC_MSG_CHECKING([if ioctl FIONBIO is compilable])
  3829. AC_COMPILE_IFELSE([
  3830. AC_LANG_PROGRAM([[
  3831. $curl_includes_stropts
  3832. ]],[[
  3833. int flags = 0;
  3834. if(0 != ioctl(0, FIONBIO, &flags))
  3835. return 1;
  3836. ]])
  3837. ],[
  3838. AC_MSG_RESULT([yes])
  3839. tst_compi_ioctl_fionbio="yes"
  3840. ],[
  3841. AC_MSG_RESULT([no])
  3842. tst_compi_ioctl_fionbio="no"
  3843. ])
  3844. fi
  3845. #
  3846. if test "$tst_compi_ioctl_fionbio" = "yes"; then
  3847. AC_MSG_CHECKING([if ioctl FIONBIO usage allowed])
  3848. if test "x$curl_disallow_ioctl_fionbio" != "xyes"; then
  3849. AC_MSG_RESULT([yes])
  3850. tst_allow_ioctl_fionbio="yes"
  3851. else
  3852. AC_MSG_RESULT([no])
  3853. tst_allow_ioctl_fionbio="no"
  3854. fi
  3855. fi
  3856. #
  3857. AC_MSG_CHECKING([if ioctl FIONBIO might be used])
  3858. if test "$tst_compi_ioctl_fionbio" = "yes" &&
  3859. test "$tst_allow_ioctl_fionbio" = "yes"; then
  3860. AC_MSG_RESULT([yes])
  3861. AC_DEFINE_UNQUOTED(HAVE_IOCTL_FIONBIO, 1,
  3862. [Define to 1 if you have a working ioctl FIONBIO function.])
  3863. curl_cv_func_ioctl_fionbio="yes"
  3864. else
  3865. AC_MSG_RESULT([no])
  3866. curl_cv_func_ioctl_fionbio="no"
  3867. fi
  3868. ])
  3869. dnl CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR
  3870. dnl -------------------------------------------------
  3871. dnl Verify if ioctl with the SIOCGIFADDR command is available,
  3872. dnl struct ifreq is defined, they can be compiled, and seem to
  3873. dnl work. If all of these are true, then HAVE_IOCTL_SIOCGIFADDR
  3874. dnl will be defined.
  3875. AC_DEFUN([CURL_CHECK_FUNC_IOCTL_SIOCGIFADDR], [
  3876. #
  3877. tst_compi_ioctl_siocgifaddr="unknown"
  3878. tst_allow_ioctl_siocgifaddr="unknown"
  3879. #
  3880. if test "$curl_cv_func_ioctl" = "yes"; then
  3881. AC_MSG_CHECKING([if ioctl SIOCGIFADDR is compilable])
  3882. AC_COMPILE_IFELSE([
  3883. AC_LANG_PROGRAM([[
  3884. $curl_includes_stropts
  3885. #include <net/if.h>
  3886. ]],[[
  3887. struct ifreq ifr;
  3888. if(0 != ioctl(0, SIOCGIFADDR, &ifr))
  3889. return 1;
  3890. ]])
  3891. ],[
  3892. AC_MSG_RESULT([yes])
  3893. tst_compi_ioctl_siocgifaddr="yes"
  3894. ],[
  3895. AC_MSG_RESULT([no])
  3896. tst_compi_ioctl_siocgifaddr="no"
  3897. ])
  3898. fi
  3899. #
  3900. if test "$tst_compi_ioctl_siocgifaddr" = "yes"; then
  3901. AC_MSG_CHECKING([if ioctl SIOCGIFADDR usage allowed])
  3902. if test "x$curl_disallow_ioctl_siocgifaddr" != "xyes"; then
  3903. AC_MSG_RESULT([yes])
  3904. tst_allow_ioctl_siocgifaddr="yes"
  3905. else
  3906. AC_MSG_RESULT([no])
  3907. tst_allow_ioctl_siocgifaddr="no"
  3908. fi
  3909. fi
  3910. #
  3911. AC_MSG_CHECKING([if ioctl SIOCGIFADDR might be used])
  3912. if test "$tst_compi_ioctl_siocgifaddr" = "yes" &&
  3913. test "$tst_allow_ioctl_siocgifaddr" = "yes"; then
  3914. AC_MSG_RESULT([yes])
  3915. AC_DEFINE_UNQUOTED(HAVE_IOCTL_SIOCGIFADDR, 1,
  3916. [Define to 1 if you have a working ioctl SIOCGIFADDR function.])
  3917. curl_cv_func_ioctl_siocgifaddr="yes"
  3918. else
  3919. AC_MSG_RESULT([no])
  3920. curl_cv_func_ioctl_siocgifaddr="no"
  3921. fi
  3922. ])
  3923. dnl CURL_CHECK_FUNC_IOCTLSOCKET
  3924. dnl -------------------------------------------------
  3925. dnl Verify if ioctlsocket is available, prototyped, and
  3926. dnl can be compiled. If all of these are true, and
  3927. dnl usage has not been previously disallowed with
  3928. dnl shell variable curl_disallow_ioctlsocket, then
  3929. dnl HAVE_IOCTLSOCKET will be defined.
  3930. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET], [
  3931. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  3932. #
  3933. tst_links_ioctlsocket="unknown"
  3934. tst_proto_ioctlsocket="unknown"
  3935. tst_compi_ioctlsocket="unknown"
  3936. tst_allow_ioctlsocket="unknown"
  3937. #
  3938. AC_MSG_CHECKING([if ioctlsocket can be linked])
  3939. AC_LINK_IFELSE([
  3940. AC_LANG_PROGRAM([[
  3941. $curl_includes_winsock2
  3942. ]],[[
  3943. if(0 != ioctlsocket(0, 0, 0))
  3944. return 1;
  3945. ]])
  3946. ],[
  3947. AC_MSG_RESULT([yes])
  3948. tst_links_ioctlsocket="yes"
  3949. ],[
  3950. AC_MSG_RESULT([no])
  3951. tst_links_ioctlsocket="no"
  3952. ])
  3953. #
  3954. if test "$tst_links_ioctlsocket" = "yes"; then
  3955. AC_MSG_CHECKING([if ioctlsocket is prototyped])
  3956. AC_EGREP_CPP([ioctlsocket],[
  3957. $curl_includes_winsock2
  3958. ],[
  3959. AC_MSG_RESULT([yes])
  3960. tst_proto_ioctlsocket="yes"
  3961. ],[
  3962. AC_MSG_RESULT([no])
  3963. tst_proto_ioctlsocket="no"
  3964. ])
  3965. fi
  3966. #
  3967. if test "$tst_proto_ioctlsocket" = "yes"; then
  3968. AC_MSG_CHECKING([if ioctlsocket is compilable])
  3969. AC_COMPILE_IFELSE([
  3970. AC_LANG_PROGRAM([[
  3971. $curl_includes_winsock2
  3972. ]],[[
  3973. if(0 != ioctlsocket(0, 0, 0))
  3974. return 1;
  3975. ]])
  3976. ],[
  3977. AC_MSG_RESULT([yes])
  3978. tst_compi_ioctlsocket="yes"
  3979. ],[
  3980. AC_MSG_RESULT([no])
  3981. tst_compi_ioctlsocket="no"
  3982. ])
  3983. fi
  3984. #
  3985. if test "$tst_compi_ioctlsocket" = "yes"; then
  3986. AC_MSG_CHECKING([if ioctlsocket usage allowed])
  3987. if test "x$curl_disallow_ioctlsocket" != "xyes"; then
  3988. AC_MSG_RESULT([yes])
  3989. tst_allow_ioctlsocket="yes"
  3990. else
  3991. AC_MSG_RESULT([no])
  3992. tst_allow_ioctlsocket="no"
  3993. fi
  3994. fi
  3995. #
  3996. AC_MSG_CHECKING([if ioctlsocket might be used])
  3997. if test "$tst_links_ioctlsocket" = "yes" &&
  3998. test "$tst_proto_ioctlsocket" = "yes" &&
  3999. test "$tst_compi_ioctlsocket" = "yes" &&
  4000. test "$tst_allow_ioctlsocket" = "yes"; then
  4001. AC_MSG_RESULT([yes])
  4002. AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET, 1,
  4003. [Define to 1 if you have the ioctlsocket function.])
  4004. curl_cv_func_ioctlsocket="yes"
  4005. CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
  4006. else
  4007. AC_MSG_RESULT([no])
  4008. curl_cv_func_ioctlsocket="no"
  4009. fi
  4010. ])
  4011. dnl CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO
  4012. dnl -------------------------------------------------
  4013. dnl Verify if ioctlsocket with the FIONBIO command is
  4014. dnl available, can be compiled, and seems to work. If
  4015. dnl all of these are true, then HAVE_IOCTLSOCKET_FIONBIO
  4016. dnl will be defined.
  4017. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_FIONBIO], [
  4018. #
  4019. tst_compi_ioctlsocket_fionbio="unknown"
  4020. tst_allow_ioctlsocket_fionbio="unknown"
  4021. #
  4022. if test "$curl_cv_func_ioctlsocket" = "yes"; then
  4023. AC_MSG_CHECKING([if ioctlsocket FIONBIO is compilable])
  4024. AC_COMPILE_IFELSE([
  4025. AC_LANG_PROGRAM([[
  4026. $curl_includes_winsock2
  4027. ]],[[
  4028. int flags = 0;
  4029. if(0 != ioctlsocket(0, FIONBIO, &flags))
  4030. return 1;
  4031. ]])
  4032. ],[
  4033. AC_MSG_RESULT([yes])
  4034. tst_compi_ioctlsocket_fionbio="yes"
  4035. ],[
  4036. AC_MSG_RESULT([no])
  4037. tst_compi_ioctlsocket_fionbio="no"
  4038. ])
  4039. fi
  4040. #
  4041. if test "$tst_compi_ioctlsocket_fionbio" = "yes"; then
  4042. AC_MSG_CHECKING([if ioctlsocket FIONBIO usage allowed])
  4043. if test "x$curl_disallow_ioctlsocket_fionbio" != "xyes"; then
  4044. AC_MSG_RESULT([yes])
  4045. tst_allow_ioctlsocket_fionbio="yes"
  4046. else
  4047. AC_MSG_RESULT([no])
  4048. tst_allow_ioctlsocket_fionbio="no"
  4049. fi
  4050. fi
  4051. #
  4052. AC_MSG_CHECKING([if ioctlsocket FIONBIO might be used])
  4053. if test "$tst_compi_ioctlsocket_fionbio" = "yes" &&
  4054. test "$tst_allow_ioctlsocket_fionbio" = "yes"; then
  4055. AC_MSG_RESULT([yes])
  4056. AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_FIONBIO, 1,
  4057. [Define to 1 if you have a working ioctlsocket FIONBIO function.])
  4058. curl_cv_func_ioctlsocket_fionbio="yes"
  4059. else
  4060. AC_MSG_RESULT([no])
  4061. curl_cv_func_ioctlsocket_fionbio="no"
  4062. fi
  4063. ])
  4064. dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  4065. dnl -------------------------------------------------
  4066. dnl Verify if IoctlSocket is available, prototyped, and
  4067. dnl can be compiled. If all of these are true, and
  4068. dnl usage has not been previously disallowed with
  4069. dnl shell variable curl_disallow_ioctlsocket_camel,
  4070. dnl then HAVE_IOCTLSOCKET_CAMEL will be defined.
  4071. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL], [
  4072. AC_REQUIRE([CURL_INCLUDES_STROPTS])dnl
  4073. #
  4074. tst_links_ioctlsocket_camel="unknown"
  4075. tst_proto_ioctlsocket_camel="unknown"
  4076. tst_compi_ioctlsocket_camel="unknown"
  4077. tst_allow_ioctlsocket_camel="unknown"
  4078. #
  4079. AC_MSG_CHECKING([if IoctlSocket can be linked])
  4080. AC_LINK_IFELSE([
  4081. AC_LANG_FUNC_LINK_TRY([IoctlSocket])
  4082. ],[
  4083. AC_MSG_RESULT([yes])
  4084. tst_links_ioctlsocket_camel="yes"
  4085. ],[
  4086. AC_MSG_RESULT([no])
  4087. tst_links_ioctlsocket_camel="no"
  4088. ])
  4089. #
  4090. if test "$tst_links_ioctlsocket_camel" = "yes"; then
  4091. AC_MSG_CHECKING([if IoctlSocket is prototyped])
  4092. AC_EGREP_CPP([IoctlSocket],[
  4093. $curl_includes_stropts
  4094. ],[
  4095. AC_MSG_RESULT([yes])
  4096. tst_proto_ioctlsocket_camel="yes"
  4097. ],[
  4098. AC_MSG_RESULT([no])
  4099. tst_proto_ioctlsocket_camel="no"
  4100. ])
  4101. fi
  4102. #
  4103. if test "$tst_proto_ioctlsocket_camel" = "yes"; then
  4104. AC_MSG_CHECKING([if IoctlSocket is compilable])
  4105. AC_COMPILE_IFELSE([
  4106. AC_LANG_PROGRAM([[
  4107. $curl_includes_stropts
  4108. ]],[[
  4109. if(0 != IoctlSocket(0, 0, 0))
  4110. return 1;
  4111. ]])
  4112. ],[
  4113. AC_MSG_RESULT([yes])
  4114. tst_compi_ioctlsocket_camel="yes"
  4115. ],[
  4116. AC_MSG_RESULT([no])
  4117. tst_compi_ioctlsocket_camel="no"
  4118. ])
  4119. fi
  4120. #
  4121. if test "$tst_compi_ioctlsocket_camel" = "yes"; then
  4122. AC_MSG_CHECKING([if IoctlSocket usage allowed])
  4123. if test "x$curl_disallow_ioctlsocket_camel" != "xyes"; then
  4124. AC_MSG_RESULT([yes])
  4125. tst_allow_ioctlsocket_camel="yes"
  4126. else
  4127. AC_MSG_RESULT([no])
  4128. tst_allow_ioctlsocket_camel="no"
  4129. fi
  4130. fi
  4131. #
  4132. AC_MSG_CHECKING([if IoctlSocket might be used])
  4133. if test "$tst_links_ioctlsocket_camel" = "yes" &&
  4134. test "$tst_proto_ioctlsocket_camel" = "yes" &&
  4135. test "$tst_compi_ioctlsocket_camel" = "yes" &&
  4136. test "$tst_allow_ioctlsocket_camel" = "yes"; then
  4137. AC_MSG_RESULT([yes])
  4138. AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL, 1,
  4139. [Define to 1 if you have the IoctlSocket camel case function.])
  4140. curl_cv_func_ioctlsocket_camel="yes"
  4141. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
  4142. else
  4143. AC_MSG_RESULT([no])
  4144. curl_cv_func_ioctlsocket_camel="no"
  4145. fi
  4146. ])
  4147. dnl CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO
  4148. dnl -------------------------------------------------
  4149. dnl Verify if IoctlSocket with FIONBIO command is available,
  4150. dnl can be compiled, and seems to work. If all of these are
  4151. dnl true, then HAVE_IOCTLSOCKET_CAMEL_FIONBIO will be defined.
  4152. AC_DEFUN([CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL_FIONBIO], [
  4153. #
  4154. tst_compi_ioctlsocket_camel_fionbio="unknown"
  4155. tst_allow_ioctlsocket_camel_fionbio="unknown"
  4156. #
  4157. if test "$curl_cv_func_ioctlsocket_camel" = "yes"; then
  4158. AC_MSG_CHECKING([if IoctlSocket FIONBIO is compilable])
  4159. AC_COMPILE_IFELSE([
  4160. AC_LANG_PROGRAM([[
  4161. $curl_includes_stropts
  4162. ]],[[
  4163. long flags = 0;
  4164. if(0 != ioctlsocket(0, FIONBIO, &flags))
  4165. return 1;
  4166. ]])
  4167. ],[
  4168. AC_MSG_RESULT([yes])
  4169. tst_compi_ioctlsocket_camel_fionbio="yes"
  4170. ],[
  4171. AC_MSG_RESULT([no])
  4172. tst_compi_ioctlsocket_camel_fionbio="no"
  4173. ])
  4174. fi
  4175. #
  4176. if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes"; then
  4177. AC_MSG_CHECKING([if IoctlSocket FIONBIO usage allowed])
  4178. if test "x$curl_disallow_ioctlsocket_camel_fionbio" != "xyes"; then
  4179. AC_MSG_RESULT([yes])
  4180. tst_allow_ioctlsocket_camel_fionbio="yes"
  4181. else
  4182. AC_MSG_RESULT([no])
  4183. tst_allow_ioctlsocket_camel_fionbio="no"
  4184. fi
  4185. fi
  4186. #
  4187. AC_MSG_CHECKING([if IoctlSocket FIONBIO might be used])
  4188. if test "$tst_compi_ioctlsocket_camel_fionbio" = "yes" &&
  4189. test "$tst_allow_ioctlsocket_camel_fionbio" = "yes"; then
  4190. AC_MSG_RESULT([yes])
  4191. AC_DEFINE_UNQUOTED(HAVE_IOCTLSOCKET_CAMEL_FIONBIO, 1,
  4192. [Define to 1 if you have a working IoctlSocket camel case FIONBIO function.])
  4193. curl_cv_func_ioctlsocket_camel_fionbio="yes"
  4194. else
  4195. AC_MSG_RESULT([no])
  4196. curl_cv_func_ioctlsocket_camel_fionbio="no"
  4197. fi
  4198. ])
  4199. dnl CURL_CHECK_FUNC_LISTXATTR
  4200. dnl -------------------------------------------------
  4201. dnl Verify if listxattr is available, prototyped, and
  4202. dnl can be compiled. If all of these are true, and
  4203. dnl usage has not been previously disallowed with
  4204. dnl shell variable curl_disallow_listxattr, then
  4205. dnl HAVE_LISTXATTR will be defined.
  4206. AC_DEFUN([CURL_CHECK_FUNC_LISTXATTR], [
  4207. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  4208. #
  4209. tst_links_listxattr="unknown"
  4210. tst_proto_listxattr="unknown"
  4211. tst_compi_listxattr="unknown"
  4212. tst_allow_listxattr="unknown"
  4213. tst_nargs_listxattr="unknown"
  4214. #
  4215. AC_MSG_CHECKING([if listxattr can be linked])
  4216. AC_LINK_IFELSE([
  4217. AC_LANG_FUNC_LINK_TRY([listxattr])
  4218. ],[
  4219. AC_MSG_RESULT([yes])
  4220. tst_links_listxattr="yes"
  4221. ],[
  4222. AC_MSG_RESULT([no])
  4223. tst_links_listxattr="no"
  4224. ])
  4225. #
  4226. if test "$tst_links_listxattr" = "yes"; then
  4227. AC_MSG_CHECKING([if listxattr is prototyped])
  4228. AC_EGREP_CPP([listxattr],[
  4229. $curl_includes_sys_xattr
  4230. ],[
  4231. AC_MSG_RESULT([yes])
  4232. tst_proto_listxattr="yes"
  4233. ],[
  4234. AC_MSG_RESULT([no])
  4235. tst_proto_listxattr="no"
  4236. ])
  4237. fi
  4238. #
  4239. if test "$tst_proto_listxattr" = "yes"; then
  4240. if test "$tst_nargs_listxattr" = "unknown"; then
  4241. AC_MSG_CHECKING([if listxattr takes 3 args.])
  4242. AC_COMPILE_IFELSE([
  4243. AC_LANG_PROGRAM([[
  4244. $curl_includes_sys_xattr
  4245. ]],[[
  4246. if(0 != listxattr(0, 0, 0))
  4247. return 1;
  4248. ]])
  4249. ],[
  4250. AC_MSG_RESULT([yes])
  4251. tst_compi_listxattr="yes"
  4252. tst_nargs_listxattr="3"
  4253. ],[
  4254. AC_MSG_RESULT([no])
  4255. tst_compi_listxattr="no"
  4256. ])
  4257. fi
  4258. if test "$tst_nargs_listxattr" = "unknown"; then
  4259. AC_MSG_CHECKING([if listxattr takes 4 args.])
  4260. AC_COMPILE_IFELSE([
  4261. AC_LANG_PROGRAM([[
  4262. $curl_includes_sys_xattr
  4263. ]],[[
  4264. if(0 != listxattr(0, 0, 0, 0))
  4265. return 1;
  4266. ]])
  4267. ],[
  4268. AC_MSG_RESULT([yes])
  4269. tst_compi_listxattr="yes"
  4270. tst_nargs_listxattr="4"
  4271. ],[
  4272. AC_MSG_RESULT([no])
  4273. tst_compi_listxattr="no"
  4274. ])
  4275. fi
  4276. AC_MSG_CHECKING([if listxattr is compilable])
  4277. if test "$tst_compi_listxattr" = "yes"; then
  4278. AC_MSG_RESULT([yes])
  4279. else
  4280. AC_MSG_RESULT([no])
  4281. fi
  4282. fi
  4283. #
  4284. if test "$tst_compi_listxattr" = "yes"; then
  4285. AC_MSG_CHECKING([if listxattr usage allowed])
  4286. if test "x$curl_disallow_listxattr" != "xyes"; then
  4287. AC_MSG_RESULT([yes])
  4288. tst_allow_listxattr="yes"
  4289. else
  4290. AC_MSG_RESULT([no])
  4291. tst_allow_listxattr="no"
  4292. fi
  4293. fi
  4294. #
  4295. AC_MSG_CHECKING([if listxattr might be used])
  4296. if test "$tst_links_listxattr" = "yes" &&
  4297. test "$tst_proto_listxattr" = "yes" &&
  4298. test "$tst_compi_listxattr" = "yes" &&
  4299. test "$tst_allow_listxattr" = "yes"; then
  4300. AC_MSG_RESULT([yes])
  4301. AC_DEFINE_UNQUOTED(HAVE_LISTXATTR, 1,
  4302. [Define to 1 if you have the listxattr function.])
  4303. dnl AC_DEFINE_UNQUOTED(LISTXATTR_ARGS, $tst_nargs_listxattr,
  4304. dnl [Specifies the number of arguments to listxattr])
  4305. #
  4306. if test "$tst_nargs_listxattr" -eq "3"; then
  4307. AC_DEFINE(HAVE_LISTXATTR_3, 1, [listxattr() takes 3 args])
  4308. elif test "$tst_nargs_listxattr" -eq "4"; then
  4309. AC_DEFINE(HAVE_LISTXATTR_4, 1, [listxattr() takes 4 args])
  4310. fi
  4311. #
  4312. curl_cv_func_listxattr="yes"
  4313. else
  4314. AC_MSG_RESULT([no])
  4315. curl_cv_func_listxattr="no"
  4316. fi
  4317. ])
  4318. dnl CURL_CHECK_FUNC_LOCALTIME_R
  4319. dnl -------------------------------------------------
  4320. dnl Verify if localtime_r is available, prototyped, can
  4321. dnl be compiled and seems to work. If all of these are
  4322. dnl true, and usage has not been previously disallowed
  4323. dnl with shell variable curl_disallow_localtime_r, then
  4324. dnl HAVE_LOCALTIME_R will be defined.
  4325. AC_DEFUN([CURL_CHECK_FUNC_LOCALTIME_R], [
  4326. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  4327. AC_REQUIRE([CURL_INCLUDES_TIME])dnl
  4328. #
  4329. tst_links_localtime_r="unknown"
  4330. tst_proto_localtime_r="unknown"
  4331. tst_compi_localtime_r="unknown"
  4332. tst_works_localtime_r="unknown"
  4333. tst_allow_localtime_r="unknown"
  4334. #
  4335. AC_MSG_CHECKING([if localtime_r can be linked])
  4336. AC_LINK_IFELSE([
  4337. AC_LANG_FUNC_LINK_TRY([localtime_r])
  4338. ],[
  4339. AC_MSG_RESULT([yes])
  4340. tst_links_localtime_r="yes"
  4341. ],[
  4342. AC_MSG_RESULT([no])
  4343. tst_links_localtime_r="no"
  4344. ])
  4345. #
  4346. if test "$tst_links_localtime_r" = "yes"; then
  4347. AC_MSG_CHECKING([if localtime_r is prototyped])
  4348. AC_EGREP_CPP([localtime_r],[
  4349. $curl_includes_time
  4350. ],[
  4351. AC_MSG_RESULT([yes])
  4352. tst_proto_localtime_r="yes"
  4353. ],[
  4354. AC_MSG_RESULT([no])
  4355. tst_proto_localtime_r="no"
  4356. ])
  4357. fi
  4358. #
  4359. if test "$tst_proto_localtime_r" = "yes"; then
  4360. AC_MSG_CHECKING([if localtime_r is compilable])
  4361. AC_COMPILE_IFELSE([
  4362. AC_LANG_PROGRAM([[
  4363. $curl_includes_time
  4364. ]],[[
  4365. if(0 != localtime_r(0, 0))
  4366. return 1;
  4367. ]])
  4368. ],[
  4369. AC_MSG_RESULT([yes])
  4370. tst_compi_localtime_r="yes"
  4371. ],[
  4372. AC_MSG_RESULT([no])
  4373. tst_compi_localtime_r="no"
  4374. ])
  4375. fi
  4376. #
  4377. dnl only do runtime verification when not cross-compiling
  4378. if test "x$cross_compiling" != "xyes" &&
  4379. test "$tst_compi_localtime_r" = "yes"; then
  4380. AC_MSG_CHECKING([if localtime_r seems to work])
  4381. AC_RUN_IFELSE([
  4382. AC_LANG_PROGRAM([[
  4383. $curl_includes_stdlib
  4384. $curl_includes_time
  4385. ]],[[
  4386. time_t clock = 1170352587;
  4387. struct tm *tmp = 0;
  4388. struct tm result;
  4389. tmp = localtime_r(&clock, &result);
  4390. if(tmp)
  4391. exit(0);
  4392. else
  4393. exit(1);
  4394. ]])
  4395. ],[
  4396. AC_MSG_RESULT([yes])
  4397. tst_works_localtime_r="yes"
  4398. ],[
  4399. AC_MSG_RESULT([no])
  4400. tst_works_localtime_r="no"
  4401. ])
  4402. fi
  4403. #
  4404. if test "$tst_compi_localtime_r" = "yes" &&
  4405. test "$tst_works_localtime_r" != "no"; then
  4406. AC_MSG_CHECKING([if localtime_r usage allowed])
  4407. if test "x$curl_disallow_localtime_r" != "xyes"; then
  4408. AC_MSG_RESULT([yes])
  4409. tst_allow_localtime_r="yes"
  4410. else
  4411. AC_MSG_RESULT([no])
  4412. tst_allow_localtime_r="no"
  4413. fi
  4414. fi
  4415. #
  4416. AC_MSG_CHECKING([if localtime_r might be used])
  4417. if test "$tst_links_localtime_r" = "yes" &&
  4418. test "$tst_proto_localtime_r" = "yes" &&
  4419. test "$tst_compi_localtime_r" = "yes" &&
  4420. test "$tst_allow_localtime_r" = "yes" &&
  4421. test "$tst_works_localtime_r" != "no"; then
  4422. AC_MSG_RESULT([yes])
  4423. AC_DEFINE_UNQUOTED(HAVE_LOCALTIME_R, 1,
  4424. [Define to 1 if you have a working localtime_r function.])
  4425. curl_cv_func_localtime_r="yes"
  4426. else
  4427. AC_MSG_RESULT([no])
  4428. curl_cv_func_localtime_r="no"
  4429. fi
  4430. ])
  4431. dnl CURL_CHECK_FUNC_MEMRCHR
  4432. dnl -------------------------------------------------
  4433. dnl Verify if memrchr is available, prototyped, and
  4434. dnl can be compiled. If all of these are true, and
  4435. dnl usage has not been previously disallowed with
  4436. dnl shell variable curl_disallow_memrchr, then
  4437. dnl HAVE_MEMRCHR will be defined.
  4438. AC_DEFUN([CURL_CHECK_FUNC_MEMRCHR], [
  4439. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  4440. #
  4441. tst_links_memrchr="unknown"
  4442. tst_macro_memrchr="unknown"
  4443. tst_proto_memrchr="unknown"
  4444. tst_compi_memrchr="unknown"
  4445. tst_allow_memrchr="unknown"
  4446. #
  4447. AC_MSG_CHECKING([if memrchr can be linked])
  4448. AC_LINK_IFELSE([
  4449. AC_LANG_FUNC_LINK_TRY([memrchr])
  4450. ],[
  4451. AC_MSG_RESULT([yes])
  4452. tst_links_memrchr="yes"
  4453. ],[
  4454. AC_MSG_RESULT([no])
  4455. tst_links_memrchr="no"
  4456. ])
  4457. #
  4458. if test "$tst_links_memrchr" = "no"; then
  4459. AC_MSG_CHECKING([if memrchr seems a macro])
  4460. AC_LINK_IFELSE([
  4461. AC_LANG_PROGRAM([[
  4462. $curl_includes_string
  4463. ]],[[
  4464. if(0 != memrchr(0, 0, 0))
  4465. return 1;
  4466. ]])
  4467. ],[
  4468. AC_MSG_RESULT([yes])
  4469. tst_macro_memrchr="yes"
  4470. ],[
  4471. AC_MSG_RESULT([no])
  4472. tst_macro_memrchr="no"
  4473. ])
  4474. fi
  4475. #
  4476. if test "$tst_links_memrchr" = "yes"; then
  4477. AC_MSG_CHECKING([if memrchr is prototyped])
  4478. AC_EGREP_CPP([memrchr],[
  4479. $curl_includes_string
  4480. ],[
  4481. AC_MSG_RESULT([yes])
  4482. tst_proto_memrchr="yes"
  4483. ],[
  4484. AC_MSG_RESULT([no])
  4485. tst_proto_memrchr="no"
  4486. ])
  4487. fi
  4488. #
  4489. if test "$tst_proto_memrchr" = "yes" ||
  4490. test "$tst_macro_memrchr" = "yes"; then
  4491. AC_MSG_CHECKING([if memrchr is compilable])
  4492. AC_COMPILE_IFELSE([
  4493. AC_LANG_PROGRAM([[
  4494. $curl_includes_string
  4495. ]],[[
  4496. if(0 != memrchr(0, 0, 0))
  4497. return 1;
  4498. ]])
  4499. ],[
  4500. AC_MSG_RESULT([yes])
  4501. tst_compi_memrchr="yes"
  4502. ],[
  4503. AC_MSG_RESULT([no])
  4504. tst_compi_memrchr="no"
  4505. ])
  4506. fi
  4507. #
  4508. if test "$tst_compi_memrchr" = "yes"; then
  4509. AC_MSG_CHECKING([if memrchr usage allowed])
  4510. if test "x$curl_disallow_memrchr" != "xyes"; then
  4511. AC_MSG_RESULT([yes])
  4512. tst_allow_memrchr="yes"
  4513. else
  4514. AC_MSG_RESULT([no])
  4515. tst_allow_memrchr="no"
  4516. fi
  4517. fi
  4518. #
  4519. AC_MSG_CHECKING([if memrchr might be used])
  4520. if (test "$tst_proto_memrchr" = "yes" ||
  4521. test "$tst_macro_memrchr" = "yes") &&
  4522. test "$tst_compi_memrchr" = "yes" &&
  4523. test "$tst_allow_memrchr" = "yes"; then
  4524. AC_MSG_RESULT([yes])
  4525. AC_DEFINE_UNQUOTED(HAVE_MEMRCHR, 1,
  4526. [Define to 1 if you have the memrchr function or macro.])
  4527. curl_cv_func_memrchr="yes"
  4528. else
  4529. AC_MSG_RESULT([no])
  4530. curl_cv_func_memrchr="no"
  4531. fi
  4532. ])
  4533. dnl CURL_CHECK_FUNC_POLL
  4534. dnl -------------------------------------------------
  4535. dnl Verify if poll is available, prototyped, can
  4536. dnl be compiled and seems to work. If all of these are
  4537. dnl true, and usage has not been previously disallowed
  4538. dnl with shell variable curl_disallow_poll, then
  4539. dnl HAVE_POLL will be defined.
  4540. AC_DEFUN([CURL_CHECK_FUNC_POLL], [
  4541. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  4542. AC_REQUIRE([CURL_INCLUDES_POLL])dnl
  4543. #
  4544. tst_links_poll="unknown"
  4545. tst_proto_poll="unknown"
  4546. tst_compi_poll="unknown"
  4547. tst_works_poll="unknown"
  4548. tst_allow_poll="unknown"
  4549. #
  4550. case $host_os in
  4551. darwin*|interix*)
  4552. dnl poll() does not work on these platforms
  4553. dnl Interix: "does provide poll(), but the implementing developer must
  4554. dnl have been in a bad mood, because poll() only works on the /proc
  4555. dnl filesystem here"
  4556. dnl macOS: poll() first didn't exist, then was broken until fixed in 10.9
  4557. dnl only to break again in 10.12.
  4558. curl_disallow_poll="yes"
  4559. tst_compi_poll="no"
  4560. ;;
  4561. esac
  4562. #
  4563. AC_MSG_CHECKING([if poll can be linked])
  4564. AC_LINK_IFELSE([
  4565. AC_LANG_PROGRAM([[
  4566. $curl_includes_poll
  4567. ]],[[
  4568. if(0 != poll(0, 0, 0))
  4569. return 1;
  4570. ]])
  4571. ],[
  4572. AC_MSG_RESULT([yes])
  4573. tst_links_poll="yes"
  4574. ],[
  4575. AC_MSG_RESULT([no])
  4576. tst_links_poll="no"
  4577. ])
  4578. #
  4579. if test "$tst_links_poll" = "yes"; then
  4580. AC_MSG_CHECKING([if poll is prototyped])
  4581. AC_EGREP_CPP([poll],[
  4582. $curl_includes_poll
  4583. ],[
  4584. AC_MSG_RESULT([yes])
  4585. tst_proto_poll="yes"
  4586. ],[
  4587. AC_MSG_RESULT([no])
  4588. tst_proto_poll="no"
  4589. ])
  4590. fi
  4591. #
  4592. if test "$tst_proto_poll" = "yes"; then
  4593. AC_MSG_CHECKING([if poll is compilable])
  4594. AC_COMPILE_IFELSE([
  4595. AC_LANG_PROGRAM([[
  4596. $curl_includes_poll
  4597. ]],[[
  4598. if(0 != poll(0, 0, 0))
  4599. return 1;
  4600. ]])
  4601. ],[
  4602. AC_MSG_RESULT([yes])
  4603. tst_compi_poll="yes"
  4604. ],[
  4605. AC_MSG_RESULT([no])
  4606. tst_compi_poll="no"
  4607. ])
  4608. fi
  4609. #
  4610. dnl only do runtime verification when not cross-compiling
  4611. if test "x$cross_compiling" != "xyes" &&
  4612. test "$tst_compi_poll" = "yes"; then
  4613. AC_MSG_CHECKING([if poll seems to work])
  4614. AC_RUN_IFELSE([
  4615. AC_LANG_PROGRAM([[
  4616. $curl_includes_stdlib
  4617. $curl_includes_poll
  4618. $curl_includes_time
  4619. ]],[[
  4620. /* detect the original poll() breakage */
  4621. if(0 != poll(0, 0, 10))
  4622. exit(1); /* fail */
  4623. else {
  4624. /* detect the 10.12 poll() breakage */
  4625. struct timeval before, after;
  4626. int rc;
  4627. size_t us;
  4628. gettimeofday(&before, NULL);
  4629. rc = poll(NULL, 0, 500);
  4630. gettimeofday(&after, NULL);
  4631. us = (after.tv_sec - before.tv_sec) * 1000000 +
  4632. (after.tv_usec - before.tv_usec);
  4633. if(us < 400000)
  4634. exit(1);
  4635. }
  4636. ]])
  4637. ],[
  4638. AC_MSG_RESULT([yes])
  4639. tst_works_poll="yes"
  4640. ],[
  4641. AC_MSG_RESULT([no])
  4642. tst_works_poll="no"
  4643. ])
  4644. fi
  4645. #
  4646. if test "$tst_compi_poll" = "yes" &&
  4647. test "$tst_works_poll" != "no"; then
  4648. AC_MSG_CHECKING([if poll usage allowed])
  4649. if test "x$curl_disallow_poll" != "xyes"; then
  4650. AC_MSG_RESULT([yes])
  4651. tst_allow_poll="yes"
  4652. else
  4653. AC_MSG_RESULT([no])
  4654. tst_allow_poll="no"
  4655. fi
  4656. fi
  4657. #
  4658. AC_MSG_CHECKING([if poll might be used])
  4659. if test "$tst_links_poll" = "yes" &&
  4660. test "$tst_proto_poll" = "yes" &&
  4661. test "$tst_compi_poll" = "yes" &&
  4662. test "$tst_allow_poll" = "yes" &&
  4663. test "$tst_works_poll" != "no"; then
  4664. AC_MSG_RESULT([yes])
  4665. AC_DEFINE_UNQUOTED(HAVE_POLL, 1,
  4666. [Define to 1 if you have a working poll function.])
  4667. AC_DEFINE_UNQUOTED(HAVE_POLL_FINE, 1,
  4668. [If you have a fine poll])
  4669. curl_cv_func_poll="yes"
  4670. else
  4671. AC_MSG_RESULT([no])
  4672. curl_cv_func_poll="no"
  4673. fi
  4674. ])
  4675. dnl CURL_CHECK_FUNC_REMOVEXATTR
  4676. dnl -------------------------------------------------
  4677. dnl Verify if removexattr is available, prototyped, and
  4678. dnl can be compiled. If all of these are true, and
  4679. dnl usage has not been previously disallowed with
  4680. dnl shell variable curl_disallow_removexattr, then
  4681. dnl HAVE_REMOVEXATTR will be defined.
  4682. AC_DEFUN([CURL_CHECK_FUNC_REMOVEXATTR], [
  4683. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  4684. #
  4685. tst_links_removexattr="unknown"
  4686. tst_proto_removexattr="unknown"
  4687. tst_compi_removexattr="unknown"
  4688. tst_allow_removexattr="unknown"
  4689. tst_nargs_removexattr="unknown"
  4690. #
  4691. AC_MSG_CHECKING([if removexattr can be linked])
  4692. AC_LINK_IFELSE([
  4693. AC_LANG_FUNC_LINK_TRY([removexattr])
  4694. ],[
  4695. AC_MSG_RESULT([yes])
  4696. tst_links_removexattr="yes"
  4697. ],[
  4698. AC_MSG_RESULT([no])
  4699. tst_links_removexattr="no"
  4700. ])
  4701. #
  4702. if test "$tst_links_removexattr" = "yes"; then
  4703. AC_MSG_CHECKING([if removexattr is prototyped])
  4704. AC_EGREP_CPP([removexattr],[
  4705. $curl_includes_sys_xattr
  4706. ],[
  4707. AC_MSG_RESULT([yes])
  4708. tst_proto_removexattr="yes"
  4709. ],[
  4710. AC_MSG_RESULT([no])
  4711. tst_proto_removexattr="no"
  4712. ])
  4713. fi
  4714. #
  4715. if test "$tst_proto_removexattr" = "yes"; then
  4716. if test "$tst_nargs_removexattr" = "unknown"; then
  4717. AC_MSG_CHECKING([if removexattr takes 2 args.])
  4718. AC_COMPILE_IFELSE([
  4719. AC_LANG_PROGRAM([[
  4720. $curl_includes_sys_xattr
  4721. ]],[[
  4722. if(0 != removexattr(0, 0))
  4723. return 1;
  4724. ]])
  4725. ],[
  4726. AC_MSG_RESULT([yes])
  4727. tst_compi_removexattr="yes"
  4728. tst_nargs_removexattr="2"
  4729. ],[
  4730. AC_MSG_RESULT([no])
  4731. tst_compi_removexattr="no"
  4732. ])
  4733. fi
  4734. if test "$tst_nargs_removexattr" = "unknown"; then
  4735. AC_MSG_CHECKING([if removexattr takes 3 args.])
  4736. AC_COMPILE_IFELSE([
  4737. AC_LANG_PROGRAM([[
  4738. $curl_includes_sys_xattr
  4739. ]],[[
  4740. if(0 != removexattr(0, 0, 0))
  4741. return 1;
  4742. ]])
  4743. ],[
  4744. AC_MSG_RESULT([yes])
  4745. tst_compi_removexattr="yes"
  4746. tst_nargs_removexattr="3"
  4747. ],[
  4748. AC_MSG_RESULT([no])
  4749. tst_compi_removexattr="no"
  4750. ])
  4751. fi
  4752. AC_MSG_CHECKING([if removexattr is compilable])
  4753. if test "$tst_compi_removexattr" = "yes"; then
  4754. AC_MSG_RESULT([yes])
  4755. else
  4756. AC_MSG_RESULT([no])
  4757. fi
  4758. fi
  4759. #
  4760. if test "$tst_compi_removexattr" = "yes"; then
  4761. AC_MSG_CHECKING([if removexattr usage allowed])
  4762. if test "x$curl_disallow_removexattr" != "xyes"; then
  4763. AC_MSG_RESULT([yes])
  4764. tst_allow_removexattr="yes"
  4765. else
  4766. AC_MSG_RESULT([no])
  4767. tst_allow_removexattr="no"
  4768. fi
  4769. fi
  4770. #
  4771. AC_MSG_CHECKING([if removexattr might be used])
  4772. if test "$tst_links_removexattr" = "yes" &&
  4773. test "$tst_proto_removexattr" = "yes" &&
  4774. test "$tst_compi_removexattr" = "yes" &&
  4775. test "$tst_allow_removexattr" = "yes"; then
  4776. AC_MSG_RESULT([yes])
  4777. AC_DEFINE_UNQUOTED(HAVE_REMOVEXATTR, 1,
  4778. [Define to 1 if you have the removexattr function.])
  4779. dnl AC_DEFINE_UNQUOTED(REMOVEXATTR_ARGS, $tst_nargs_removexattr,
  4780. dnl [Specifies the number of arguments to removexattr])
  4781. #
  4782. if test "$tst_nargs_removexattr" -eq "2"; then
  4783. AC_DEFINE(HAVE_REMOVEXATTR_2, 1, [removexattr() takes 2 args])
  4784. elif test "$tst_nargs_removexattr" -eq "3"; then
  4785. AC_DEFINE(HAVE_REMOVEXATTR_3, 1, [removexattr() takes 3 args])
  4786. fi
  4787. #
  4788. curl_cv_func_removexattr="yes"
  4789. else
  4790. AC_MSG_RESULT([no])
  4791. curl_cv_func_removexattr="no"
  4792. fi
  4793. ])
  4794. dnl CURL_CHECK_FUNC_SETSOCKOPT
  4795. dnl -------------------------------------------------
  4796. dnl Verify if setsockopt is available, prototyped, and
  4797. dnl can be compiled. If all of these are true, and
  4798. dnl usage has not been previously disallowed with
  4799. dnl shell variable curl_disallow_setsockopt, then
  4800. dnl HAVE_SETSOCKOPT will be defined.
  4801. AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT], [
  4802. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  4803. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  4804. #
  4805. tst_links_setsockopt="unknown"
  4806. tst_proto_setsockopt="unknown"
  4807. tst_compi_setsockopt="unknown"
  4808. tst_allow_setsockopt="unknown"
  4809. #
  4810. AC_MSG_CHECKING([if setsockopt can be linked])
  4811. AC_LINK_IFELSE([
  4812. AC_LANG_PROGRAM([[
  4813. $curl_includes_winsock2
  4814. $curl_includes_sys_socket
  4815. ]],[[
  4816. if(0 != setsockopt(0, 0, 0, 0, 0))
  4817. return 1;
  4818. ]])
  4819. ],[
  4820. AC_MSG_RESULT([yes])
  4821. tst_links_setsockopt="yes"
  4822. ],[
  4823. AC_MSG_RESULT([no])
  4824. tst_links_setsockopt="no"
  4825. ])
  4826. #
  4827. if test "$tst_links_setsockopt" = "yes"; then
  4828. AC_MSG_CHECKING([if setsockopt is prototyped])
  4829. AC_EGREP_CPP([setsockopt],[
  4830. $curl_includes_winsock2
  4831. $curl_includes_sys_socket
  4832. ],[
  4833. AC_MSG_RESULT([yes])
  4834. tst_proto_setsockopt="yes"
  4835. ],[
  4836. AC_MSG_RESULT([no])
  4837. tst_proto_setsockopt="no"
  4838. ])
  4839. fi
  4840. #
  4841. if test "$tst_proto_setsockopt" = "yes"; then
  4842. AC_MSG_CHECKING([if setsockopt is compilable])
  4843. AC_COMPILE_IFELSE([
  4844. AC_LANG_PROGRAM([[
  4845. $curl_includes_winsock2
  4846. $curl_includes_sys_socket
  4847. ]],[[
  4848. if(0 != setsockopt(0, 0, 0, 0, 0))
  4849. return 1;
  4850. ]])
  4851. ],[
  4852. AC_MSG_RESULT([yes])
  4853. tst_compi_setsockopt="yes"
  4854. ],[
  4855. AC_MSG_RESULT([no])
  4856. tst_compi_setsockopt="no"
  4857. ])
  4858. fi
  4859. #
  4860. if test "$tst_compi_setsockopt" = "yes"; then
  4861. AC_MSG_CHECKING([if setsockopt usage allowed])
  4862. if test "x$curl_disallow_setsockopt" != "xyes"; then
  4863. AC_MSG_RESULT([yes])
  4864. tst_allow_setsockopt="yes"
  4865. else
  4866. AC_MSG_RESULT([no])
  4867. tst_allow_setsockopt="no"
  4868. fi
  4869. fi
  4870. #
  4871. AC_MSG_CHECKING([if setsockopt might be used])
  4872. if test "$tst_links_setsockopt" = "yes" &&
  4873. test "$tst_proto_setsockopt" = "yes" &&
  4874. test "$tst_compi_setsockopt" = "yes" &&
  4875. test "$tst_allow_setsockopt" = "yes"; then
  4876. AC_MSG_RESULT([yes])
  4877. AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT, 1,
  4878. [Define to 1 if you have the setsockopt function.])
  4879. curl_cv_func_setsockopt="yes"
  4880. CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
  4881. else
  4882. AC_MSG_RESULT([no])
  4883. curl_cv_func_setsockopt="no"
  4884. fi
  4885. ])
  4886. dnl CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK
  4887. dnl -------------------------------------------------
  4888. dnl Verify if setsockopt with the SO_NONBLOCK command is
  4889. dnl available, can be compiled, and seems to work. If
  4890. dnl all of these are true, then HAVE_SETSOCKOPT_SO_NONBLOCK
  4891. dnl will be defined.
  4892. AC_DEFUN([CURL_CHECK_FUNC_SETSOCKOPT_SO_NONBLOCK], [
  4893. #
  4894. tst_compi_setsockopt_so_nonblock="unknown"
  4895. tst_allow_setsockopt_so_nonblock="unknown"
  4896. #
  4897. if test "$curl_cv_func_setsockopt" = "yes"; then
  4898. AC_MSG_CHECKING([if setsockopt SO_NONBLOCK is compilable])
  4899. AC_COMPILE_IFELSE([
  4900. AC_LANG_PROGRAM([[
  4901. $curl_includes_winsock2
  4902. $curl_includes_sys_socket
  4903. ]],[[
  4904. if(0 != setsockopt(0, SOL_SOCKET, SO_NONBLOCK, 0, 0))
  4905. return 1;
  4906. ]])
  4907. ],[
  4908. AC_MSG_RESULT([yes])
  4909. tst_compi_setsockopt_so_nonblock="yes"
  4910. ],[
  4911. AC_MSG_RESULT([no])
  4912. tst_compi_setsockopt_so_nonblock="no"
  4913. ])
  4914. fi
  4915. #
  4916. if test "$tst_compi_setsockopt_so_nonblock" = "yes"; then
  4917. AC_MSG_CHECKING([if setsockopt SO_NONBLOCK usage allowed])
  4918. if test "x$curl_disallow_setsockopt_so_nonblock" != "xyes"; then
  4919. AC_MSG_RESULT([yes])
  4920. tst_allow_setsockopt_so_nonblock="yes"
  4921. else
  4922. AC_MSG_RESULT([no])
  4923. tst_allow_setsockopt_so_nonblock="no"
  4924. fi
  4925. fi
  4926. #
  4927. AC_MSG_CHECKING([if setsockopt SO_NONBLOCK might be used])
  4928. if test "$tst_compi_setsockopt_so_nonblock" = "yes" &&
  4929. test "$tst_allow_setsockopt_so_nonblock" = "yes"; then
  4930. AC_MSG_RESULT([yes])
  4931. AC_DEFINE_UNQUOTED(HAVE_SETSOCKOPT_SO_NONBLOCK, 1,
  4932. [Define to 1 if you have a working setsockopt SO_NONBLOCK function.])
  4933. curl_cv_func_setsockopt_so_nonblock="yes"
  4934. else
  4935. AC_MSG_RESULT([no])
  4936. curl_cv_func_setsockopt_so_nonblock="no"
  4937. fi
  4938. ])
  4939. dnl CURL_CHECK_FUNC_SETXATTR
  4940. dnl -------------------------------------------------
  4941. dnl Verify if setxattr is available, prototyped, and
  4942. dnl can be compiled. If all of these are true, and
  4943. dnl usage has not been previously disallowed with
  4944. dnl shell variable curl_disallow_setxattr, then
  4945. dnl HAVE_SETXATTR will be defined.
  4946. AC_DEFUN([CURL_CHECK_FUNC_SETXATTR], [
  4947. AC_REQUIRE([CURL_INCLUDES_SYS_XATTR])dnl
  4948. #
  4949. tst_links_setxattr="unknown"
  4950. tst_proto_setxattr="unknown"
  4951. tst_compi_setxattr="unknown"
  4952. tst_allow_setxattr="unknown"
  4953. tst_nargs_setxattr="unknown"
  4954. #
  4955. AC_MSG_CHECKING([if setxattr can be linked])
  4956. AC_LINK_IFELSE([
  4957. AC_LANG_FUNC_LINK_TRY([setxattr])
  4958. ],[
  4959. AC_MSG_RESULT([yes])
  4960. tst_links_setxattr="yes"
  4961. ],[
  4962. AC_MSG_RESULT([no])
  4963. tst_links_setxattr="no"
  4964. ])
  4965. #
  4966. if test "$tst_links_setxattr" = "yes"; then
  4967. AC_MSG_CHECKING([if setxattr is prototyped])
  4968. AC_EGREP_CPP([setxattr],[
  4969. $curl_includes_sys_xattr
  4970. ],[
  4971. AC_MSG_RESULT([yes])
  4972. tst_proto_setxattr="yes"
  4973. ],[
  4974. AC_MSG_RESULT([no])
  4975. tst_proto_setxattr="no"
  4976. ])
  4977. fi
  4978. #
  4979. if test "$tst_proto_setxattr" = "yes"; then
  4980. if test "$tst_nargs_setxattr" = "unknown"; then
  4981. AC_MSG_CHECKING([if setxattr takes 5 args.])
  4982. AC_COMPILE_IFELSE([
  4983. AC_LANG_PROGRAM([[
  4984. $curl_includes_sys_xattr
  4985. ]],[[
  4986. if(0 != setxattr(0, 0, 0, 0, 0))
  4987. return 1;
  4988. ]])
  4989. ],[
  4990. AC_MSG_RESULT([yes])
  4991. tst_compi_setxattr="yes"
  4992. tst_nargs_setxattr="5"
  4993. ],[
  4994. AC_MSG_RESULT([no])
  4995. tst_compi_setxattr="no"
  4996. ])
  4997. fi
  4998. if test "$tst_nargs_setxattr" = "unknown"; then
  4999. AC_MSG_CHECKING([if setxattr takes 6 args.])
  5000. AC_COMPILE_IFELSE([
  5001. AC_LANG_PROGRAM([[
  5002. $curl_includes_sys_xattr
  5003. ]],[[
  5004. if(0 != setxattr(0, 0, 0, 0, 0, 0))
  5005. return 1;
  5006. ]])
  5007. ],[
  5008. AC_MSG_RESULT([yes])
  5009. tst_compi_setxattr="yes"
  5010. tst_nargs_setxattr="6"
  5011. ],[
  5012. AC_MSG_RESULT([no])
  5013. tst_compi_setxattr="no"
  5014. ])
  5015. fi
  5016. AC_MSG_CHECKING([if setxattr is compilable])
  5017. if test "$tst_compi_setxattr" = "yes"; then
  5018. AC_MSG_RESULT([yes])
  5019. else
  5020. AC_MSG_RESULT([no])
  5021. fi
  5022. fi
  5023. #
  5024. if test "$tst_compi_setxattr" = "yes"; then
  5025. AC_MSG_CHECKING([if setxattr usage allowed])
  5026. if test "x$curl_disallow_setxattr" != "xyes"; then
  5027. AC_MSG_RESULT([yes])
  5028. tst_allow_setxattr="yes"
  5029. else
  5030. AC_MSG_RESULT([no])
  5031. tst_allow_setxattr="no"
  5032. fi
  5033. fi
  5034. #
  5035. AC_MSG_CHECKING([if setxattr might be used])
  5036. if test "$tst_links_setxattr" = "yes" &&
  5037. test "$tst_proto_setxattr" = "yes" &&
  5038. test "$tst_compi_setxattr" = "yes" &&
  5039. test "$tst_allow_setxattr" = "yes"; then
  5040. AC_MSG_RESULT([yes])
  5041. AC_DEFINE_UNQUOTED(HAVE_SETXATTR, 1,
  5042. [Define to 1 if you have the setxattr function.])
  5043. dnl AC_DEFINE_UNQUOTED(SETXATTR_ARGS, $tst_nargs_setxattr,
  5044. dnl [Specifies the number of arguments to setxattr])
  5045. #
  5046. if test "$tst_nargs_setxattr" -eq "5"; then
  5047. AC_DEFINE(HAVE_SETXATTR_5, 1, [setxattr() takes 5 args])
  5048. elif test "$tst_nargs_setxattr" -eq "6"; then
  5049. AC_DEFINE(HAVE_SETXATTR_6, 1, [setxattr() takes 6 args])
  5050. fi
  5051. #
  5052. curl_cv_func_setxattr="yes"
  5053. else
  5054. AC_MSG_RESULT([no])
  5055. curl_cv_func_setxattr="no"
  5056. fi
  5057. ])
  5058. dnl CURL_CHECK_FUNC_SIGACTION
  5059. dnl -------------------------------------------------
  5060. dnl Verify if sigaction is available, prototyped, and
  5061. dnl can be compiled. If all of these are true, and
  5062. dnl usage has not been previously disallowed with
  5063. dnl shell variable curl_disallow_sigaction, then
  5064. dnl HAVE_SIGACTION will be defined.
  5065. AC_DEFUN([CURL_CHECK_FUNC_SIGACTION], [
  5066. AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
  5067. #
  5068. tst_links_sigaction="unknown"
  5069. tst_proto_sigaction="unknown"
  5070. tst_compi_sigaction="unknown"
  5071. tst_allow_sigaction="unknown"
  5072. #
  5073. AC_MSG_CHECKING([if sigaction can be linked])
  5074. AC_LINK_IFELSE([
  5075. AC_LANG_FUNC_LINK_TRY([sigaction])
  5076. ],[
  5077. AC_MSG_RESULT([yes])
  5078. tst_links_sigaction="yes"
  5079. ],[
  5080. AC_MSG_RESULT([no])
  5081. tst_links_sigaction="no"
  5082. ])
  5083. #
  5084. if test "$tst_links_sigaction" = "yes"; then
  5085. AC_MSG_CHECKING([if sigaction is prototyped])
  5086. AC_EGREP_CPP([sigaction],[
  5087. $curl_includes_signal
  5088. ],[
  5089. AC_MSG_RESULT([yes])
  5090. tst_proto_sigaction="yes"
  5091. ],[
  5092. AC_MSG_RESULT([no])
  5093. tst_proto_sigaction="no"
  5094. ])
  5095. fi
  5096. #
  5097. if test "$tst_proto_sigaction" = "yes"; then
  5098. AC_MSG_CHECKING([if sigaction is compilable])
  5099. AC_COMPILE_IFELSE([
  5100. AC_LANG_PROGRAM([[
  5101. $curl_includes_signal
  5102. ]],[[
  5103. if(0 != sigaction(0, 0, 0))
  5104. return 1;
  5105. ]])
  5106. ],[
  5107. AC_MSG_RESULT([yes])
  5108. tst_compi_sigaction="yes"
  5109. ],[
  5110. AC_MSG_RESULT([no])
  5111. tst_compi_sigaction="no"
  5112. ])
  5113. fi
  5114. #
  5115. if test "$tst_compi_sigaction" = "yes"; then
  5116. AC_MSG_CHECKING([if sigaction usage allowed])
  5117. if test "x$curl_disallow_sigaction" != "xyes"; then
  5118. AC_MSG_RESULT([yes])
  5119. tst_allow_sigaction="yes"
  5120. else
  5121. AC_MSG_RESULT([no])
  5122. tst_allow_sigaction="no"
  5123. fi
  5124. fi
  5125. #
  5126. AC_MSG_CHECKING([if sigaction might be used])
  5127. if test "$tst_links_sigaction" = "yes" &&
  5128. test "$tst_proto_sigaction" = "yes" &&
  5129. test "$tst_compi_sigaction" = "yes" &&
  5130. test "$tst_allow_sigaction" = "yes"; then
  5131. AC_MSG_RESULT([yes])
  5132. AC_DEFINE_UNQUOTED(HAVE_SIGACTION, 1,
  5133. [Define to 1 if you have the sigaction function.])
  5134. curl_cv_func_sigaction="yes"
  5135. else
  5136. AC_MSG_RESULT([no])
  5137. curl_cv_func_sigaction="no"
  5138. fi
  5139. ])
  5140. dnl CURL_CHECK_FUNC_SIGINTERRUPT
  5141. dnl -------------------------------------------------
  5142. dnl Verify if siginterrupt is available, prototyped, and
  5143. dnl can be compiled. If all of these are true, and
  5144. dnl usage has not been previously disallowed with
  5145. dnl shell variable curl_disallow_siginterrupt, then
  5146. dnl HAVE_SIGINTERRUPT will be defined.
  5147. AC_DEFUN([CURL_CHECK_FUNC_SIGINTERRUPT], [
  5148. AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
  5149. #
  5150. tst_links_siginterrupt="unknown"
  5151. tst_proto_siginterrupt="unknown"
  5152. tst_compi_siginterrupt="unknown"
  5153. tst_allow_siginterrupt="unknown"
  5154. #
  5155. AC_MSG_CHECKING([if siginterrupt can be linked])
  5156. AC_LINK_IFELSE([
  5157. AC_LANG_FUNC_LINK_TRY([siginterrupt])
  5158. ],[
  5159. AC_MSG_RESULT([yes])
  5160. tst_links_siginterrupt="yes"
  5161. ],[
  5162. AC_MSG_RESULT([no])
  5163. tst_links_siginterrupt="no"
  5164. ])
  5165. #
  5166. if test "$tst_links_siginterrupt" = "yes"; then
  5167. AC_MSG_CHECKING([if siginterrupt is prototyped])
  5168. AC_EGREP_CPP([siginterrupt],[
  5169. $curl_includes_signal
  5170. ],[
  5171. AC_MSG_RESULT([yes])
  5172. tst_proto_siginterrupt="yes"
  5173. ],[
  5174. AC_MSG_RESULT([no])
  5175. tst_proto_siginterrupt="no"
  5176. ])
  5177. fi
  5178. #
  5179. if test "$tst_proto_siginterrupt" = "yes"; then
  5180. AC_MSG_CHECKING([if siginterrupt is compilable])
  5181. AC_COMPILE_IFELSE([
  5182. AC_LANG_PROGRAM([[
  5183. $curl_includes_signal
  5184. ]],[[
  5185. if(0 != siginterrupt(0, 0))
  5186. return 1;
  5187. ]])
  5188. ],[
  5189. AC_MSG_RESULT([yes])
  5190. tst_compi_siginterrupt="yes"
  5191. ],[
  5192. AC_MSG_RESULT([no])
  5193. tst_compi_siginterrupt="no"
  5194. ])
  5195. fi
  5196. #
  5197. if test "$tst_compi_siginterrupt" = "yes"; then
  5198. AC_MSG_CHECKING([if siginterrupt usage allowed])
  5199. if test "x$curl_disallow_siginterrupt" != "xyes"; then
  5200. AC_MSG_RESULT([yes])
  5201. tst_allow_siginterrupt="yes"
  5202. else
  5203. AC_MSG_RESULT([no])
  5204. tst_allow_siginterrupt="no"
  5205. fi
  5206. fi
  5207. #
  5208. AC_MSG_CHECKING([if siginterrupt might be used])
  5209. if test "$tst_links_siginterrupt" = "yes" &&
  5210. test "$tst_proto_siginterrupt" = "yes" &&
  5211. test "$tst_compi_siginterrupt" = "yes" &&
  5212. test "$tst_allow_siginterrupt" = "yes"; then
  5213. AC_MSG_RESULT([yes])
  5214. AC_DEFINE_UNQUOTED(HAVE_SIGINTERRUPT, 1,
  5215. [Define to 1 if you have the siginterrupt function.])
  5216. curl_cv_func_siginterrupt="yes"
  5217. else
  5218. AC_MSG_RESULT([no])
  5219. curl_cv_func_siginterrupt="no"
  5220. fi
  5221. ])
  5222. dnl CURL_CHECK_FUNC_SIGNAL
  5223. dnl -------------------------------------------------
  5224. dnl Verify if signal is available, prototyped, and
  5225. dnl can be compiled. If all of these are true, and
  5226. dnl usage has not been previously disallowed with
  5227. dnl shell variable curl_disallow_signal, then
  5228. dnl HAVE_SIGNAL will be defined.
  5229. AC_DEFUN([CURL_CHECK_FUNC_SIGNAL], [
  5230. AC_REQUIRE([CURL_INCLUDES_SIGNAL])dnl
  5231. #
  5232. tst_links_signal="unknown"
  5233. tst_proto_signal="unknown"
  5234. tst_compi_signal="unknown"
  5235. tst_allow_signal="unknown"
  5236. #
  5237. AC_MSG_CHECKING([if signal can be linked])
  5238. AC_LINK_IFELSE([
  5239. AC_LANG_FUNC_LINK_TRY([signal])
  5240. ],[
  5241. AC_MSG_RESULT([yes])
  5242. tst_links_signal="yes"
  5243. ],[
  5244. AC_MSG_RESULT([no])
  5245. tst_links_signal="no"
  5246. ])
  5247. #
  5248. if test "$tst_links_signal" = "yes"; then
  5249. AC_MSG_CHECKING([if signal is prototyped])
  5250. AC_EGREP_CPP([signal],[
  5251. $curl_includes_signal
  5252. ],[
  5253. AC_MSG_RESULT([yes])
  5254. tst_proto_signal="yes"
  5255. ],[
  5256. AC_MSG_RESULT([no])
  5257. tst_proto_signal="no"
  5258. ])
  5259. fi
  5260. #
  5261. if test "$tst_proto_signal" = "yes"; then
  5262. AC_MSG_CHECKING([if signal is compilable])
  5263. AC_COMPILE_IFELSE([
  5264. AC_LANG_PROGRAM([[
  5265. $curl_includes_signal
  5266. ]],[[
  5267. if(0 != signal(0, 0))
  5268. return 1;
  5269. ]])
  5270. ],[
  5271. AC_MSG_RESULT([yes])
  5272. tst_compi_signal="yes"
  5273. ],[
  5274. AC_MSG_RESULT([no])
  5275. tst_compi_signal="no"
  5276. ])
  5277. fi
  5278. #
  5279. if test "$tst_compi_signal" = "yes"; then
  5280. AC_MSG_CHECKING([if signal usage allowed])
  5281. if test "x$curl_disallow_signal" != "xyes"; then
  5282. AC_MSG_RESULT([yes])
  5283. tst_allow_signal="yes"
  5284. else
  5285. AC_MSG_RESULT([no])
  5286. tst_allow_signal="no"
  5287. fi
  5288. fi
  5289. #
  5290. AC_MSG_CHECKING([if signal might be used])
  5291. if test "$tst_links_signal" = "yes" &&
  5292. test "$tst_proto_signal" = "yes" &&
  5293. test "$tst_compi_signal" = "yes" &&
  5294. test "$tst_allow_signal" = "yes"; then
  5295. AC_MSG_RESULT([yes])
  5296. AC_DEFINE_UNQUOTED(HAVE_SIGNAL, 1,
  5297. [Define to 1 if you have the signal function.])
  5298. curl_cv_func_signal="yes"
  5299. else
  5300. AC_MSG_RESULT([no])
  5301. curl_cv_func_signal="no"
  5302. fi
  5303. ])
  5304. dnl CURL_CHECK_FUNC_SIGSETJMP
  5305. dnl -------------------------------------------------
  5306. dnl Verify if sigsetjmp is available, prototyped, and
  5307. dnl can be compiled. If all of these are true, and
  5308. dnl usage has not been previously disallowed with
  5309. dnl shell variable curl_disallow_sigsetjmp, then
  5310. dnl HAVE_SIGSETJMP will be defined.
  5311. AC_DEFUN([CURL_CHECK_FUNC_SIGSETJMP], [
  5312. AC_REQUIRE([CURL_INCLUDES_SETJMP])dnl
  5313. #
  5314. tst_links_sigsetjmp="unknown"
  5315. tst_macro_sigsetjmp="unknown"
  5316. tst_proto_sigsetjmp="unknown"
  5317. tst_compi_sigsetjmp="unknown"
  5318. tst_allow_sigsetjmp="unknown"
  5319. #
  5320. AC_MSG_CHECKING([if sigsetjmp can be linked])
  5321. AC_LINK_IFELSE([
  5322. AC_LANG_FUNC_LINK_TRY([sigsetjmp])
  5323. ],[
  5324. AC_MSG_RESULT([yes])
  5325. tst_links_sigsetjmp="yes"
  5326. ],[
  5327. AC_MSG_RESULT([no])
  5328. tst_links_sigsetjmp="no"
  5329. ])
  5330. #
  5331. if test "$tst_links_sigsetjmp" = "no"; then
  5332. AC_MSG_CHECKING([if sigsetjmp seems a macro])
  5333. AC_LINK_IFELSE([
  5334. AC_LANG_PROGRAM([[
  5335. $curl_includes_setjmp
  5336. ]],[[
  5337. sigjmp_buf env;
  5338. if(0 != sigsetjmp(env, 0))
  5339. return 1;
  5340. ]])
  5341. ],[
  5342. AC_MSG_RESULT([yes])
  5343. tst_macro_sigsetjmp="yes"
  5344. ],[
  5345. AC_MSG_RESULT([no])
  5346. tst_macro_sigsetjmp="no"
  5347. ])
  5348. fi
  5349. #
  5350. if test "$tst_links_sigsetjmp" = "yes"; then
  5351. AC_MSG_CHECKING([if sigsetjmp is prototyped])
  5352. AC_EGREP_CPP([sigsetjmp],[
  5353. $curl_includes_setjmp
  5354. ],[
  5355. AC_MSG_RESULT([yes])
  5356. tst_proto_sigsetjmp="yes"
  5357. ],[
  5358. AC_MSG_RESULT([no])
  5359. tst_proto_sigsetjmp="no"
  5360. ])
  5361. fi
  5362. #
  5363. if test "$tst_proto_sigsetjmp" = "yes" ||
  5364. test "$tst_macro_sigsetjmp" = "yes"; then
  5365. AC_MSG_CHECKING([if sigsetjmp is compilable])
  5366. AC_COMPILE_IFELSE([
  5367. AC_LANG_PROGRAM([[
  5368. $curl_includes_setjmp
  5369. ]],[[
  5370. sigjmp_buf env;
  5371. if(0 != sigsetjmp(env, 0))
  5372. return 1;
  5373. ]])
  5374. ],[
  5375. AC_MSG_RESULT([yes])
  5376. tst_compi_sigsetjmp="yes"
  5377. ],[
  5378. AC_MSG_RESULT([no])
  5379. tst_compi_sigsetjmp="no"
  5380. ])
  5381. fi
  5382. #
  5383. if test "$tst_compi_sigsetjmp" = "yes"; then
  5384. AC_MSG_CHECKING([if sigsetjmp usage allowed])
  5385. if test "x$curl_disallow_sigsetjmp" != "xyes"; then
  5386. AC_MSG_RESULT([yes])
  5387. tst_allow_sigsetjmp="yes"
  5388. else
  5389. AC_MSG_RESULT([no])
  5390. tst_allow_sigsetjmp="no"
  5391. fi
  5392. fi
  5393. #
  5394. AC_MSG_CHECKING([if sigsetjmp might be used])
  5395. if (test "$tst_proto_sigsetjmp" = "yes" ||
  5396. test "$tst_macro_sigsetjmp" = "yes") &&
  5397. test "$tst_compi_sigsetjmp" = "yes" &&
  5398. test "$tst_allow_sigsetjmp" = "yes"; then
  5399. AC_MSG_RESULT([yes])
  5400. AC_DEFINE_UNQUOTED(HAVE_SIGSETJMP, 1,
  5401. [Define to 1 if you have the sigsetjmp function or macro.])
  5402. curl_cv_func_sigsetjmp="yes"
  5403. else
  5404. AC_MSG_RESULT([no])
  5405. curl_cv_func_sigsetjmp="no"
  5406. fi
  5407. ])
  5408. dnl CURL_CHECK_FUNC_SOCKET
  5409. dnl -------------------------------------------------
  5410. dnl Verify if socket is available, prototyped, and
  5411. dnl can be compiled. If all of these are true, and
  5412. dnl usage has not been previously disallowed with
  5413. dnl shell variable curl_disallow_socket, then
  5414. dnl HAVE_SOCKET will be defined.
  5415. AC_DEFUN([CURL_CHECK_FUNC_SOCKET], [
  5416. AC_REQUIRE([CURL_INCLUDES_WINSOCK2])dnl
  5417. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  5418. AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
  5419. #
  5420. tst_links_socket="unknown"
  5421. tst_proto_socket="unknown"
  5422. tst_compi_socket="unknown"
  5423. tst_allow_socket="unknown"
  5424. #
  5425. AC_MSG_CHECKING([if socket can be linked])
  5426. AC_LINK_IFELSE([
  5427. AC_LANG_PROGRAM([[
  5428. $curl_includes_winsock2
  5429. $curl_includes_sys_socket
  5430. $curl_includes_socket
  5431. ]],[[
  5432. if(0 != socket(0, 0, 0))
  5433. return 1;
  5434. ]])
  5435. ],[
  5436. AC_MSG_RESULT([yes])
  5437. tst_links_socket="yes"
  5438. ],[
  5439. AC_MSG_RESULT([no])
  5440. tst_links_socket="no"
  5441. ])
  5442. #
  5443. if test "$tst_links_socket" = "yes"; then
  5444. AC_MSG_CHECKING([if socket is prototyped])
  5445. AC_EGREP_CPP([socket],[
  5446. $curl_includes_winsock2
  5447. $curl_includes_sys_socket
  5448. $curl_includes_socket
  5449. ],[
  5450. AC_MSG_RESULT([yes])
  5451. tst_proto_socket="yes"
  5452. ],[
  5453. AC_MSG_RESULT([no])
  5454. tst_proto_socket="no"
  5455. ])
  5456. fi
  5457. #
  5458. if test "$tst_proto_socket" = "yes"; then
  5459. AC_MSG_CHECKING([if socket is compilable])
  5460. AC_COMPILE_IFELSE([
  5461. AC_LANG_PROGRAM([[
  5462. $curl_includes_winsock2
  5463. $curl_includes_sys_socket
  5464. $curl_includes_socket
  5465. ]],[[
  5466. if(0 != socket(0, 0, 0))
  5467. return 1;
  5468. ]])
  5469. ],[
  5470. AC_MSG_RESULT([yes])
  5471. tst_compi_socket="yes"
  5472. ],[
  5473. AC_MSG_RESULT([no])
  5474. tst_compi_socket="no"
  5475. ])
  5476. fi
  5477. #
  5478. if test "$tst_compi_socket" = "yes"; then
  5479. AC_MSG_CHECKING([if socket usage allowed])
  5480. if test "x$curl_disallow_socket" != "xyes"; then
  5481. AC_MSG_RESULT([yes])
  5482. tst_allow_socket="yes"
  5483. else
  5484. AC_MSG_RESULT([no])
  5485. tst_allow_socket="no"
  5486. fi
  5487. fi
  5488. #
  5489. AC_MSG_CHECKING([if socket might be used])
  5490. if test "$tst_links_socket" = "yes" &&
  5491. test "$tst_proto_socket" = "yes" &&
  5492. test "$tst_compi_socket" = "yes" &&
  5493. test "$tst_allow_socket" = "yes"; then
  5494. AC_MSG_RESULT([yes])
  5495. AC_DEFINE_UNQUOTED(HAVE_SOCKET, 1,
  5496. [Define to 1 if you have the socket function.])
  5497. curl_cv_func_socket="yes"
  5498. else
  5499. AC_MSG_RESULT([no])
  5500. curl_cv_func_socket="no"
  5501. fi
  5502. ])
  5503. dnl CURL_CHECK_FUNC_SOCKETPAIR
  5504. dnl -------------------------------------------------
  5505. dnl Verify if socketpair is available, prototyped, and
  5506. dnl can be compiled. If all of these are true, and
  5507. dnl usage has not been previously disallowed with
  5508. dnl shell variable curl_disallow_socketpair, then
  5509. dnl HAVE_SOCKETPAIR will be defined.
  5510. AC_DEFUN([CURL_CHECK_FUNC_SOCKETPAIR], [
  5511. AC_REQUIRE([CURL_INCLUDES_SYS_SOCKET])dnl
  5512. AC_REQUIRE([CURL_INCLUDES_SOCKET])dnl
  5513. #
  5514. tst_links_socketpair="unknown"
  5515. tst_proto_socketpair="unknown"
  5516. tst_compi_socketpair="unknown"
  5517. tst_allow_socketpair="unknown"
  5518. #
  5519. AC_MSG_CHECKING([if socketpair can be linked])
  5520. AC_LINK_IFELSE([
  5521. AC_LANG_FUNC_LINK_TRY([socketpair])
  5522. ],[
  5523. AC_MSG_RESULT([yes])
  5524. tst_links_socketpair="yes"
  5525. ],[
  5526. AC_MSG_RESULT([no])
  5527. tst_links_socketpair="no"
  5528. ])
  5529. #
  5530. if test "$tst_links_socketpair" = "yes"; then
  5531. AC_MSG_CHECKING([if socketpair is prototyped])
  5532. AC_EGREP_CPP([socketpair],[
  5533. $curl_includes_sys_socket
  5534. $curl_includes_socket
  5535. ],[
  5536. AC_MSG_RESULT([yes])
  5537. tst_proto_socketpair="yes"
  5538. ],[
  5539. AC_MSG_RESULT([no])
  5540. tst_proto_socketpair="no"
  5541. ])
  5542. fi
  5543. #
  5544. if test "$tst_proto_socketpair" = "yes"; then
  5545. AC_MSG_CHECKING([if socketpair is compilable])
  5546. AC_COMPILE_IFELSE([
  5547. AC_LANG_PROGRAM([[
  5548. $curl_includes_sys_socket
  5549. $curl_includes_socket
  5550. ]],[[
  5551. int sv[2];
  5552. if(0 != socketpair(0, 0, 0, sv))
  5553. return 1;
  5554. ]])
  5555. ],[
  5556. AC_MSG_RESULT([yes])
  5557. tst_compi_socketpair="yes"
  5558. ],[
  5559. AC_MSG_RESULT([no])
  5560. tst_compi_socketpair="no"
  5561. ])
  5562. fi
  5563. #
  5564. if test "$tst_compi_socketpair" = "yes"; then
  5565. AC_MSG_CHECKING([if socketpair usage allowed])
  5566. if test "x$curl_disallow_socketpair" != "xyes"; then
  5567. AC_MSG_RESULT([yes])
  5568. tst_allow_socketpair="yes"
  5569. else
  5570. AC_MSG_RESULT([no])
  5571. tst_allow_socketpair="no"
  5572. fi
  5573. fi
  5574. #
  5575. AC_MSG_CHECKING([if socketpair might be used])
  5576. if test "$tst_links_socketpair" = "yes" &&
  5577. test "$tst_proto_socketpair" = "yes" &&
  5578. test "$tst_compi_socketpair" = "yes" &&
  5579. test "$tst_allow_socketpair" = "yes"; then
  5580. AC_MSG_RESULT([yes])
  5581. AC_DEFINE_UNQUOTED(HAVE_SOCKETPAIR, 1,
  5582. [Define to 1 if you have the socketpair function.])
  5583. curl_cv_func_socketpair="yes"
  5584. else
  5585. AC_MSG_RESULT([no])
  5586. curl_cv_func_socketpair="no"
  5587. fi
  5588. ])
  5589. dnl CURL_CHECK_FUNC_STRCASECMP
  5590. dnl -------------------------------------------------
  5591. dnl Verify if strcasecmp is available, prototyped, and
  5592. dnl can be compiled. If all of these are true, and
  5593. dnl usage has not been previously disallowed with
  5594. dnl shell variable curl_disallow_strcasecmp, then
  5595. dnl HAVE_STRCASECMP will be defined.
  5596. AC_DEFUN([CURL_CHECK_FUNC_STRCASECMP], [
  5597. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  5598. #
  5599. tst_links_strcasecmp="unknown"
  5600. tst_proto_strcasecmp="unknown"
  5601. tst_compi_strcasecmp="unknown"
  5602. tst_allow_strcasecmp="unknown"
  5603. #
  5604. AC_MSG_CHECKING([if strcasecmp can be linked])
  5605. AC_LINK_IFELSE([
  5606. AC_LANG_FUNC_LINK_TRY([strcasecmp])
  5607. ],[
  5608. AC_MSG_RESULT([yes])
  5609. tst_links_strcasecmp="yes"
  5610. ],[
  5611. AC_MSG_RESULT([no])
  5612. tst_links_strcasecmp="no"
  5613. ])
  5614. #
  5615. if test "$tst_links_strcasecmp" = "yes"; then
  5616. AC_MSG_CHECKING([if strcasecmp is prototyped])
  5617. AC_EGREP_CPP([strcasecmp],[
  5618. $curl_includes_string
  5619. ],[
  5620. AC_MSG_RESULT([yes])
  5621. tst_proto_strcasecmp="yes"
  5622. ],[
  5623. AC_MSG_RESULT([no])
  5624. tst_proto_strcasecmp="no"
  5625. ])
  5626. fi
  5627. #
  5628. if test "$tst_proto_strcasecmp" = "yes"; then
  5629. AC_MSG_CHECKING([if strcasecmp is compilable])
  5630. AC_COMPILE_IFELSE([
  5631. AC_LANG_PROGRAM([[
  5632. $curl_includes_string
  5633. ]],[[
  5634. if(0 != strcasecmp(0, 0))
  5635. return 1;
  5636. ]])
  5637. ],[
  5638. AC_MSG_RESULT([yes])
  5639. tst_compi_strcasecmp="yes"
  5640. ],[
  5641. AC_MSG_RESULT([no])
  5642. tst_compi_strcasecmp="no"
  5643. ])
  5644. fi
  5645. #
  5646. if test "$tst_compi_strcasecmp" = "yes"; then
  5647. AC_MSG_CHECKING([if strcasecmp usage allowed])
  5648. if test "x$curl_disallow_strcasecmp" != "xyes"; then
  5649. AC_MSG_RESULT([yes])
  5650. tst_allow_strcasecmp="yes"
  5651. else
  5652. AC_MSG_RESULT([no])
  5653. tst_allow_strcasecmp="no"
  5654. fi
  5655. fi
  5656. #
  5657. AC_MSG_CHECKING([if strcasecmp might be used])
  5658. if test "$tst_links_strcasecmp" = "yes" &&
  5659. test "$tst_proto_strcasecmp" = "yes" &&
  5660. test "$tst_compi_strcasecmp" = "yes" &&
  5661. test "$tst_allow_strcasecmp" = "yes"; then
  5662. AC_MSG_RESULT([yes])
  5663. AC_DEFINE_UNQUOTED(HAVE_STRCASECMP, 1,
  5664. [Define to 1 if you have the strcasecmp function.])
  5665. curl_cv_func_strcasecmp="yes"
  5666. else
  5667. AC_MSG_RESULT([no])
  5668. curl_cv_func_strcasecmp="no"
  5669. fi
  5670. ])
  5671. dnl CURL_CHECK_FUNC_STRCMPI
  5672. dnl -------------------------------------------------
  5673. dnl Verify if strcmpi is available, prototyped, and
  5674. dnl can be compiled. If all of these are true, and
  5675. dnl usage has not been previously disallowed with
  5676. dnl shell variable curl_disallow_strcmpi, then
  5677. dnl HAVE_STRCMPI will be defined.
  5678. AC_DEFUN([CURL_CHECK_FUNC_STRCMPI], [
  5679. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  5680. #
  5681. tst_links_strcmpi="unknown"
  5682. tst_proto_strcmpi="unknown"
  5683. tst_compi_strcmpi="unknown"
  5684. tst_allow_strcmpi="unknown"
  5685. #
  5686. AC_MSG_CHECKING([if strcmpi can be linked])
  5687. AC_LINK_IFELSE([
  5688. AC_LANG_FUNC_LINK_TRY([strcmpi])
  5689. ],[
  5690. AC_MSG_RESULT([yes])
  5691. tst_links_strcmpi="yes"
  5692. ],[
  5693. AC_MSG_RESULT([no])
  5694. tst_links_strcmpi="no"
  5695. ])
  5696. #
  5697. if test "$tst_links_strcmpi" = "yes"; then
  5698. AC_MSG_CHECKING([if strcmpi is prototyped])
  5699. AC_EGREP_CPP([strcmpi],[
  5700. $curl_includes_string
  5701. ],[
  5702. AC_MSG_RESULT([yes])
  5703. tst_proto_strcmpi="yes"
  5704. ],[
  5705. AC_MSG_RESULT([no])
  5706. tst_proto_strcmpi="no"
  5707. ])
  5708. fi
  5709. #
  5710. if test "$tst_proto_strcmpi" = "yes"; then
  5711. AC_MSG_CHECKING([if strcmpi is compilable])
  5712. AC_COMPILE_IFELSE([
  5713. AC_LANG_PROGRAM([[
  5714. $curl_includes_string
  5715. ]],[[
  5716. if(0 != strcmpi(0, 0))
  5717. return 1;
  5718. ]])
  5719. ],[
  5720. AC_MSG_RESULT([yes])
  5721. tst_compi_strcmpi="yes"
  5722. ],[
  5723. AC_MSG_RESULT([no])
  5724. tst_compi_strcmpi="no"
  5725. ])
  5726. fi
  5727. #
  5728. if test "$tst_compi_strcmpi" = "yes"; then
  5729. AC_MSG_CHECKING([if strcmpi usage allowed])
  5730. if test "x$curl_disallow_strcmpi" != "xyes"; then
  5731. AC_MSG_RESULT([yes])
  5732. tst_allow_strcmpi="yes"
  5733. else
  5734. AC_MSG_RESULT([no])
  5735. tst_allow_strcmpi="no"
  5736. fi
  5737. fi
  5738. #
  5739. AC_MSG_CHECKING([if strcmpi might be used])
  5740. if test "$tst_links_strcmpi" = "yes" &&
  5741. test "$tst_proto_strcmpi" = "yes" &&
  5742. test "$tst_compi_strcmpi" = "yes" &&
  5743. test "$tst_allow_strcmpi" = "yes"; then
  5744. AC_MSG_RESULT([yes])
  5745. AC_DEFINE_UNQUOTED(HAVE_STRCMPI, 1,
  5746. [Define to 1 if you have the strcmpi function.])
  5747. curl_cv_func_strcmpi="yes"
  5748. else
  5749. AC_MSG_RESULT([no])
  5750. curl_cv_func_strcmpi="no"
  5751. fi
  5752. ])
  5753. dnl CURL_CHECK_FUNC_STRDUP
  5754. dnl -------------------------------------------------
  5755. dnl Verify if strdup is available, prototyped, and
  5756. dnl can be compiled. If all of these are true, and
  5757. dnl usage has not been previously disallowed with
  5758. dnl shell variable curl_disallow_strdup, then
  5759. dnl HAVE_STRDUP will be defined.
  5760. AC_DEFUN([CURL_CHECK_FUNC_STRDUP], [
  5761. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  5762. #
  5763. tst_links_strdup="unknown"
  5764. tst_proto_strdup="unknown"
  5765. tst_compi_strdup="unknown"
  5766. tst_allow_strdup="unknown"
  5767. #
  5768. AC_MSG_CHECKING([if strdup can be linked])
  5769. AC_LINK_IFELSE([
  5770. AC_LANG_FUNC_LINK_TRY([strdup])
  5771. ],[
  5772. AC_MSG_RESULT([yes])
  5773. tst_links_strdup="yes"
  5774. ],[
  5775. AC_MSG_RESULT([no])
  5776. tst_links_strdup="no"
  5777. ])
  5778. #
  5779. if test "$tst_links_strdup" = "yes"; then
  5780. AC_MSG_CHECKING([if strdup is prototyped])
  5781. AC_EGREP_CPP([strdup],[
  5782. $curl_includes_string
  5783. ],[
  5784. AC_MSG_RESULT([yes])
  5785. tst_proto_strdup="yes"
  5786. ],[
  5787. AC_MSG_RESULT([no])
  5788. tst_proto_strdup="no"
  5789. ])
  5790. fi
  5791. #
  5792. if test "$tst_proto_strdup" = "yes"; then
  5793. AC_MSG_CHECKING([if strdup is compilable])
  5794. AC_COMPILE_IFELSE([
  5795. AC_LANG_PROGRAM([[
  5796. $curl_includes_string
  5797. ]],[[
  5798. if(0 != strdup(0))
  5799. return 1;
  5800. ]])
  5801. ],[
  5802. AC_MSG_RESULT([yes])
  5803. tst_compi_strdup="yes"
  5804. ],[
  5805. AC_MSG_RESULT([no])
  5806. tst_compi_strdup="no"
  5807. ])
  5808. fi
  5809. #
  5810. if test "$tst_compi_strdup" = "yes"; then
  5811. AC_MSG_CHECKING([if strdup usage allowed])
  5812. if test "x$curl_disallow_strdup" != "xyes"; then
  5813. AC_MSG_RESULT([yes])
  5814. tst_allow_strdup="yes"
  5815. else
  5816. AC_MSG_RESULT([no])
  5817. tst_allow_strdup="no"
  5818. fi
  5819. fi
  5820. #
  5821. AC_MSG_CHECKING([if strdup might be used])
  5822. if test "$tst_links_strdup" = "yes" &&
  5823. test "$tst_proto_strdup" = "yes" &&
  5824. test "$tst_compi_strdup" = "yes" &&
  5825. test "$tst_allow_strdup" = "yes"; then
  5826. AC_MSG_RESULT([yes])
  5827. AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
  5828. [Define to 1 if you have the strdup function.])
  5829. curl_cv_func_strdup="yes"
  5830. else
  5831. AC_MSG_RESULT([no])
  5832. curl_cv_func_strdup="no"
  5833. fi
  5834. ])
  5835. dnl CURL_CHECK_FUNC_STRERROR_R
  5836. dnl -------------------------------------------------
  5837. dnl Verify if strerror_r is available, prototyped, can be compiled and
  5838. dnl seems to work. If all of these are true, and usage has not been
  5839. dnl previously disallowed with shell variable curl_disallow_strerror_r,
  5840. dnl then HAVE_STRERROR_R and STRERROR_R_TYPE_ARG3 will be defined, as
  5841. dnl well as one of HAVE_GLIBC_STRERROR_R or HAVE_POSIX_STRERROR_R.
  5842. dnl
  5843. dnl glibc-style strerror_r:
  5844. dnl
  5845. dnl char *strerror_r(int errnum, char *workbuf, size_t bufsize);
  5846. dnl
  5847. dnl glibc-style strerror_r returns a pointer to the the error string,
  5848. dnl and might use the provided workbuf as a scratch area if needed. A
  5849. dnl quick test on a few systems shows that it's usually not used at all.
  5850. dnl
  5851. dnl POSIX-style strerror_r:
  5852. dnl
  5853. dnl int strerror_r(int errnum, char *resultbuf, size_t bufsize);
  5854. dnl
  5855. dnl POSIX-style strerror_r returns 0 upon successful completion and the
  5856. dnl error string in the provided resultbuf.
  5857. dnl
  5858. AC_DEFUN([CURL_CHECK_FUNC_STRERROR_R], [
  5859. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  5860. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  5861. #
  5862. tst_links_strerror_r="unknown"
  5863. tst_proto_strerror_r="unknown"
  5864. tst_compi_strerror_r="unknown"
  5865. tst_glibc_strerror_r="unknown"
  5866. tst_posix_strerror_r="unknown"
  5867. tst_allow_strerror_r="unknown"
  5868. tst_works_glibc_strerror_r="unknown"
  5869. tst_works_posix_strerror_r="unknown"
  5870. tst_glibc_strerror_r_type_arg3="unknown"
  5871. tst_posix_strerror_r_type_arg3="unknown"
  5872. #
  5873. AC_MSG_CHECKING([if strerror_r can be linked])
  5874. AC_LINK_IFELSE([
  5875. AC_LANG_FUNC_LINK_TRY([strerror_r])
  5876. ],[
  5877. AC_MSG_RESULT([yes])
  5878. tst_links_strerror_r="yes"
  5879. ],[
  5880. AC_MSG_RESULT([no])
  5881. tst_links_strerror_r="no"
  5882. ])
  5883. #
  5884. if test "$tst_links_strerror_r" = "yes"; then
  5885. AC_MSG_CHECKING([if strerror_r is prototyped])
  5886. AC_EGREP_CPP([strerror_r],[
  5887. $curl_includes_string
  5888. ],[
  5889. AC_MSG_RESULT([yes])
  5890. tst_proto_strerror_r="yes"
  5891. ],[
  5892. AC_MSG_RESULT([no])
  5893. tst_proto_strerror_r="no"
  5894. ])
  5895. fi
  5896. #
  5897. if test "$tst_proto_strerror_r" = "yes"; then
  5898. AC_MSG_CHECKING([if strerror_r is compilable])
  5899. AC_COMPILE_IFELSE([
  5900. AC_LANG_PROGRAM([[
  5901. $curl_includes_string
  5902. ]],[[
  5903. if(0 != strerror_r(0, 0, 0))
  5904. return 1;
  5905. ]])
  5906. ],[
  5907. AC_MSG_RESULT([yes])
  5908. tst_compi_strerror_r="yes"
  5909. ],[
  5910. AC_MSG_RESULT([no])
  5911. tst_compi_strerror_r="no"
  5912. ])
  5913. fi
  5914. #
  5915. if test "$tst_compi_strerror_r" = "yes"; then
  5916. AC_MSG_CHECKING([if strerror_r is glibc like])
  5917. tst_glibc_strerror_r_type_arg3="unknown"
  5918. for arg3 in 'size_t' 'int' 'unsigned int'; do
  5919. if test "$tst_glibc_strerror_r_type_arg3" = "unknown"; then
  5920. AC_COMPILE_IFELSE([
  5921. AC_LANG_PROGRAM([[
  5922. $curl_includes_string
  5923. char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
  5924. ]],[[
  5925. if(0 != strerror_r(0, 0, 0))
  5926. return 1;
  5927. ]])
  5928. ],[
  5929. tst_glibc_strerror_r_type_arg3="$arg3"
  5930. ])
  5931. fi
  5932. done
  5933. case "$tst_glibc_strerror_r_type_arg3" in
  5934. unknown)
  5935. AC_MSG_RESULT([no])
  5936. tst_glibc_strerror_r="no"
  5937. ;;
  5938. *)
  5939. AC_MSG_RESULT([yes])
  5940. tst_glibc_strerror_r="yes"
  5941. ;;
  5942. esac
  5943. fi
  5944. #
  5945. dnl only do runtime verification when not cross-compiling
  5946. if test "x$cross_compiling" != "xyes" &&
  5947. test "$tst_glibc_strerror_r" = "yes"; then
  5948. AC_MSG_CHECKING([if strerror_r seems to work])
  5949. AC_RUN_IFELSE([
  5950. AC_LANG_PROGRAM([[
  5951. $curl_includes_stdlib
  5952. $curl_includes_string
  5953. # include <errno.h>
  5954. ]],[[
  5955. char buffer[1024];
  5956. char *string = 0;
  5957. buffer[0] = '\0';
  5958. string = strerror_r(EACCES, buffer, sizeof(buffer));
  5959. if(!string)
  5960. exit(1); /* fail */
  5961. if(!string[0])
  5962. exit(1); /* fail */
  5963. else
  5964. exit(0);
  5965. ]])
  5966. ],[
  5967. AC_MSG_RESULT([yes])
  5968. tst_works_glibc_strerror_r="yes"
  5969. ],[
  5970. AC_MSG_RESULT([no])
  5971. tst_works_glibc_strerror_r="no"
  5972. ])
  5973. fi
  5974. #
  5975. if test "$tst_compi_strerror_r" = "yes" &&
  5976. test "$tst_works_glibc_strerror_r" != "yes"; then
  5977. AC_MSG_CHECKING([if strerror_r is POSIX like])
  5978. tst_posix_strerror_r_type_arg3="unknown"
  5979. for arg3 in 'size_t' 'int' 'unsigned int'; do
  5980. if test "$tst_posix_strerror_r_type_arg3" = "unknown"; then
  5981. AC_COMPILE_IFELSE([
  5982. AC_LANG_PROGRAM([[
  5983. $curl_includes_string
  5984. int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
  5985. ]],[[
  5986. if(0 != strerror_r(0, 0, 0))
  5987. return 1;
  5988. ]])
  5989. ],[
  5990. tst_posix_strerror_r_type_arg3="$arg3"
  5991. ])
  5992. fi
  5993. done
  5994. case "$tst_posix_strerror_r_type_arg3" in
  5995. unknown)
  5996. AC_MSG_RESULT([no])
  5997. tst_posix_strerror_r="no"
  5998. ;;
  5999. *)
  6000. AC_MSG_RESULT([yes])
  6001. tst_posix_strerror_r="yes"
  6002. ;;
  6003. esac
  6004. fi
  6005. #
  6006. dnl only do runtime verification when not cross-compiling
  6007. if test "x$cross_compiling" != "xyes" &&
  6008. test "$tst_posix_strerror_r" = "yes"; then
  6009. AC_MSG_CHECKING([if strerror_r seems to work])
  6010. AC_RUN_IFELSE([
  6011. AC_LANG_PROGRAM([[
  6012. $curl_includes_stdlib
  6013. $curl_includes_string
  6014. # include <errno.h>
  6015. ]],[[
  6016. char buffer[1024];
  6017. int error = 1;
  6018. buffer[0] = '\0';
  6019. error = strerror_r(EACCES, buffer, sizeof(buffer));
  6020. if(error)
  6021. exit(1); /* fail */
  6022. if(buffer[0] == '\0')
  6023. exit(1); /* fail */
  6024. else
  6025. exit(0);
  6026. ]])
  6027. ],[
  6028. AC_MSG_RESULT([yes])
  6029. tst_works_posix_strerror_r="yes"
  6030. ],[
  6031. AC_MSG_RESULT([no])
  6032. tst_works_posix_strerror_r="no"
  6033. ])
  6034. fi
  6035. #
  6036. if test "$tst_works_glibc_strerror_r" = "yes"; then
  6037. tst_posix_strerror_r="no"
  6038. fi
  6039. if test "$tst_works_posix_strerror_r" = "yes"; then
  6040. tst_glibc_strerror_r="no"
  6041. fi
  6042. if test "$tst_glibc_strerror_r" = "yes" &&
  6043. test "$tst_works_glibc_strerror_r" != "no" &&
  6044. test "$tst_posix_strerror_r" != "yes"; then
  6045. tst_allow_strerror_r="check"
  6046. fi
  6047. if test "$tst_posix_strerror_r" = "yes" &&
  6048. test "$tst_works_posix_strerror_r" != "no" &&
  6049. test "$tst_glibc_strerror_r" != "yes"; then
  6050. tst_allow_strerror_r="check"
  6051. fi
  6052. if test "$tst_allow_strerror_r" = "check"; then
  6053. AC_MSG_CHECKING([if strerror_r usage allowed])
  6054. if test "x$curl_disallow_strerror_r" != "xyes"; then
  6055. AC_MSG_RESULT([yes])
  6056. tst_allow_strerror_r="yes"
  6057. else
  6058. AC_MSG_RESULT([no])
  6059. tst_allow_strerror_r="no"
  6060. fi
  6061. fi
  6062. #
  6063. AC_MSG_CHECKING([if strerror_r might be used])
  6064. if test "$tst_links_strerror_r" = "yes" &&
  6065. test "$tst_proto_strerror_r" = "yes" &&
  6066. test "$tst_compi_strerror_r" = "yes" &&
  6067. test "$tst_allow_strerror_r" = "yes"; then
  6068. AC_MSG_RESULT([yes])
  6069. if test "$tst_glibc_strerror_r" = "yes"; then
  6070. AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
  6071. [Define to 1 if you have the strerror_r function.])
  6072. AC_DEFINE_UNQUOTED(HAVE_GLIBC_STRERROR_R, 1,
  6073. [Define to 1 if you have a working glibc-style strerror_r function.])
  6074. AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_glibc_strerror_r_type_arg3,
  6075. [Define to the type of arg 3 for strerror_r.])
  6076. fi
  6077. if test "$tst_posix_strerror_r" = "yes"; then
  6078. AC_DEFINE_UNQUOTED(HAVE_STRERROR_R, 1,
  6079. [Define to 1 if you have the strerror_r function.])
  6080. AC_DEFINE_UNQUOTED(HAVE_POSIX_STRERROR_R, 1,
  6081. [Define to 1 if you have a working POSIX-style strerror_r function.])
  6082. AC_DEFINE_UNQUOTED(STRERROR_R_TYPE_ARG3, $tst_posix_strerror_r_type_arg3,
  6083. [Define to the type of arg 3 for strerror_r.])
  6084. fi
  6085. curl_cv_func_strerror_r="yes"
  6086. else
  6087. AC_MSG_RESULT([no])
  6088. curl_cv_func_strerror_r="no"
  6089. fi
  6090. #
  6091. if test "$tst_compi_strerror_r" = "yes" &&
  6092. test "$tst_allow_strerror_r" = "unknown"; then
  6093. AC_MSG_WARN([cannot determine strerror_r() style: edit lib/curl_config.h manually.])
  6094. fi
  6095. #
  6096. ])
  6097. dnl CURL_CHECK_FUNC_STRICMP
  6098. dnl -------------------------------------------------
  6099. dnl Verify if stricmp is available, prototyped, and
  6100. dnl can be compiled. If all of these are true, and
  6101. dnl usage has not been previously disallowed with
  6102. dnl shell variable curl_disallow_stricmp, then
  6103. dnl HAVE_STRICMP will be defined.
  6104. AC_DEFUN([CURL_CHECK_FUNC_STRICMP], [
  6105. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  6106. #
  6107. tst_links_stricmp="unknown"
  6108. tst_proto_stricmp="unknown"
  6109. tst_compi_stricmp="unknown"
  6110. tst_allow_stricmp="unknown"
  6111. #
  6112. AC_MSG_CHECKING([if stricmp can be linked])
  6113. AC_LINK_IFELSE([
  6114. AC_LANG_FUNC_LINK_TRY([stricmp])
  6115. ],[
  6116. AC_MSG_RESULT([yes])
  6117. tst_links_stricmp="yes"
  6118. ],[
  6119. AC_MSG_RESULT([no])
  6120. tst_links_stricmp="no"
  6121. ])
  6122. #
  6123. if test "$tst_links_stricmp" = "yes"; then
  6124. AC_MSG_CHECKING([if stricmp is prototyped])
  6125. AC_EGREP_CPP([stricmp],[
  6126. $curl_includes_string
  6127. ],[
  6128. AC_MSG_RESULT([yes])
  6129. tst_proto_stricmp="yes"
  6130. ],[
  6131. AC_MSG_RESULT([no])
  6132. tst_proto_stricmp="no"
  6133. ])
  6134. fi
  6135. #
  6136. if test "$tst_proto_stricmp" = "yes"; then
  6137. AC_MSG_CHECKING([if stricmp is compilable])
  6138. AC_COMPILE_IFELSE([
  6139. AC_LANG_PROGRAM([[
  6140. $curl_includes_string
  6141. ]],[[
  6142. if(0 != stricmp(0, 0))
  6143. return 1;
  6144. ]])
  6145. ],[
  6146. AC_MSG_RESULT([yes])
  6147. tst_compi_stricmp="yes"
  6148. ],[
  6149. AC_MSG_RESULT([no])
  6150. tst_compi_stricmp="no"
  6151. ])
  6152. fi
  6153. #
  6154. if test "$tst_compi_stricmp" = "yes"; then
  6155. AC_MSG_CHECKING([if stricmp usage allowed])
  6156. if test "x$curl_disallow_stricmp" != "xyes"; then
  6157. AC_MSG_RESULT([yes])
  6158. tst_allow_stricmp="yes"
  6159. else
  6160. AC_MSG_RESULT([no])
  6161. tst_allow_stricmp="no"
  6162. fi
  6163. fi
  6164. #
  6165. AC_MSG_CHECKING([if stricmp might be used])
  6166. if test "$tst_links_stricmp" = "yes" &&
  6167. test "$tst_proto_stricmp" = "yes" &&
  6168. test "$tst_compi_stricmp" = "yes" &&
  6169. test "$tst_allow_stricmp" = "yes"; then
  6170. AC_MSG_RESULT([yes])
  6171. AC_DEFINE_UNQUOTED(HAVE_STRICMP, 1,
  6172. [Define to 1 if you have the stricmp function.])
  6173. curl_cv_func_stricmp="yes"
  6174. else
  6175. AC_MSG_RESULT([no])
  6176. curl_cv_func_stricmp="no"
  6177. fi
  6178. ])
  6179. dnl CURL_CHECK_FUNC_STRNCASECMP
  6180. dnl -------------------------------------------------
  6181. dnl Verify if strncasecmp is available, prototyped, and
  6182. dnl can be compiled. If all of these are true, and
  6183. dnl usage has not been previously disallowed with
  6184. dnl shell variable curl_disallow_strncasecmp, then
  6185. dnl HAVE_STRNCASECMP will be defined.
  6186. AC_DEFUN([CURL_CHECK_FUNC_STRNCASECMP], [
  6187. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  6188. #
  6189. tst_links_strncasecmp="unknown"
  6190. tst_proto_strncasecmp="unknown"
  6191. tst_compi_strncasecmp="unknown"
  6192. tst_allow_strncasecmp="unknown"
  6193. #
  6194. AC_MSG_CHECKING([if strncasecmp can be linked])
  6195. AC_LINK_IFELSE([
  6196. AC_LANG_FUNC_LINK_TRY([strncasecmp])
  6197. ],[
  6198. AC_MSG_RESULT([yes])
  6199. tst_links_strncasecmp="yes"
  6200. ],[
  6201. AC_MSG_RESULT([no])
  6202. tst_links_strncasecmp="no"
  6203. ])
  6204. #
  6205. if test "$tst_links_strncasecmp" = "yes"; then
  6206. AC_MSG_CHECKING([if strncasecmp is prototyped])
  6207. AC_EGREP_CPP([strncasecmp],[
  6208. $curl_includes_string
  6209. ],[
  6210. AC_MSG_RESULT([yes])
  6211. tst_proto_strncasecmp="yes"
  6212. ],[
  6213. AC_MSG_RESULT([no])
  6214. tst_proto_strncasecmp="no"
  6215. ])
  6216. fi
  6217. #
  6218. if test "$tst_proto_strncasecmp" = "yes"; then
  6219. AC_MSG_CHECKING([if strncasecmp is compilable])
  6220. AC_COMPILE_IFELSE([
  6221. AC_LANG_PROGRAM([[
  6222. $curl_includes_string
  6223. ]],[[
  6224. if(0 != strncasecmp(0, 0, 0))
  6225. return 1;
  6226. ]])
  6227. ],[
  6228. AC_MSG_RESULT([yes])
  6229. tst_compi_strncasecmp="yes"
  6230. ],[
  6231. AC_MSG_RESULT([no])
  6232. tst_compi_strncasecmp="no"
  6233. ])
  6234. fi
  6235. #
  6236. if test "$tst_compi_strncasecmp" = "yes"; then
  6237. AC_MSG_CHECKING([if strncasecmp usage allowed])
  6238. if test "x$curl_disallow_strncasecmp" != "xyes"; then
  6239. AC_MSG_RESULT([yes])
  6240. tst_allow_strncasecmp="yes"
  6241. else
  6242. AC_MSG_RESULT([no])
  6243. tst_allow_strncasecmp="no"
  6244. fi
  6245. fi
  6246. #
  6247. AC_MSG_CHECKING([if strncasecmp might be used])
  6248. if test "$tst_links_strncasecmp" = "yes" &&
  6249. test "$tst_proto_strncasecmp" = "yes" &&
  6250. test "$tst_compi_strncasecmp" = "yes" &&
  6251. test "$tst_allow_strncasecmp" = "yes"; then
  6252. AC_MSG_RESULT([yes])
  6253. AC_DEFINE_UNQUOTED(HAVE_STRNCASECMP, 1,
  6254. [Define to 1 if you have the strncasecmp function.])
  6255. curl_cv_func_strncasecmp="yes"
  6256. else
  6257. AC_MSG_RESULT([no])
  6258. curl_cv_func_strncasecmp="no"
  6259. fi
  6260. ])
  6261. dnl CURL_CHECK_FUNC_STRNCMPI
  6262. dnl -------------------------------------------------
  6263. dnl Verify if strncmpi is available, prototyped, and
  6264. dnl can be compiled. If all of these are true, and
  6265. dnl usage has not been previously disallowed with
  6266. dnl shell variable curl_disallow_strncmpi, then
  6267. dnl HAVE_STRNCMPI will be defined.
  6268. AC_DEFUN([CURL_CHECK_FUNC_STRNCMPI], [
  6269. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  6270. #
  6271. tst_links_strncmpi="unknown"
  6272. tst_proto_strncmpi="unknown"
  6273. tst_compi_strncmpi="unknown"
  6274. tst_allow_strncmpi="unknown"
  6275. #
  6276. AC_MSG_CHECKING([if strncmpi can be linked])
  6277. AC_LINK_IFELSE([
  6278. AC_LANG_FUNC_LINK_TRY([strncmpi])
  6279. ],[
  6280. AC_MSG_RESULT([yes])
  6281. tst_links_strncmpi="yes"
  6282. ],[
  6283. AC_MSG_RESULT([no])
  6284. tst_links_strncmpi="no"
  6285. ])
  6286. #
  6287. if test "$tst_links_strncmpi" = "yes"; then
  6288. AC_MSG_CHECKING([if strncmpi is prototyped])
  6289. AC_EGREP_CPP([strncmpi],[
  6290. $curl_includes_string
  6291. ],[
  6292. AC_MSG_RESULT([yes])
  6293. tst_proto_strncmpi="yes"
  6294. ],[
  6295. AC_MSG_RESULT([no])
  6296. tst_proto_strncmpi="no"
  6297. ])
  6298. fi
  6299. #
  6300. if test "$tst_proto_strncmpi" = "yes"; then
  6301. AC_MSG_CHECKING([if strncmpi is compilable])
  6302. AC_COMPILE_IFELSE([
  6303. AC_LANG_PROGRAM([[
  6304. $curl_includes_string
  6305. ]],[[
  6306. if(0 != strncmpi(0, 0))
  6307. return 1;
  6308. ]])
  6309. ],[
  6310. AC_MSG_RESULT([yes])
  6311. tst_compi_strncmpi="yes"
  6312. ],[
  6313. AC_MSG_RESULT([no])
  6314. tst_compi_strncmpi="no"
  6315. ])
  6316. fi
  6317. #
  6318. if test "$tst_compi_strncmpi" = "yes"; then
  6319. AC_MSG_CHECKING([if strncmpi usage allowed])
  6320. if test "x$curl_disallow_strncmpi" != "xyes"; then
  6321. AC_MSG_RESULT([yes])
  6322. tst_allow_strncmpi="yes"
  6323. else
  6324. AC_MSG_RESULT([no])
  6325. tst_allow_strncmpi="no"
  6326. fi
  6327. fi
  6328. #
  6329. AC_MSG_CHECKING([if strncmpi might be used])
  6330. if test "$tst_links_strncmpi" = "yes" &&
  6331. test "$tst_proto_strncmpi" = "yes" &&
  6332. test "$tst_compi_strncmpi" = "yes" &&
  6333. test "$tst_allow_strncmpi" = "yes"; then
  6334. AC_MSG_RESULT([yes])
  6335. AC_DEFINE_UNQUOTED(HAVE_STRNCMPI, 1,
  6336. [Define to 1 if you have the strncmpi function.])
  6337. curl_cv_func_strncmpi="yes"
  6338. else
  6339. AC_MSG_RESULT([no])
  6340. curl_cv_func_strncmpi="no"
  6341. fi
  6342. ])
  6343. dnl CURL_CHECK_FUNC_STRNICMP
  6344. dnl -------------------------------------------------
  6345. dnl Verify if strnicmp is available, prototyped, and
  6346. dnl can be compiled. If all of these are true, and
  6347. dnl usage has not been previously disallowed with
  6348. dnl shell variable curl_disallow_strnicmp, then
  6349. dnl HAVE_STRNICMP will be defined.
  6350. AC_DEFUN([CURL_CHECK_FUNC_STRNICMP], [
  6351. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  6352. #
  6353. tst_links_strnicmp="unknown"
  6354. tst_proto_strnicmp="unknown"
  6355. tst_compi_strnicmp="unknown"
  6356. tst_allow_strnicmp="unknown"
  6357. #
  6358. AC_MSG_CHECKING([if strnicmp can be linked])
  6359. AC_LINK_IFELSE([
  6360. AC_LANG_FUNC_LINK_TRY([strnicmp])
  6361. ],[
  6362. AC_MSG_RESULT([yes])
  6363. tst_links_strnicmp="yes"
  6364. ],[
  6365. AC_MSG_RESULT([no])
  6366. tst_links_strnicmp="no"
  6367. ])
  6368. #
  6369. if test "$tst_links_strnicmp" = "yes"; then
  6370. AC_MSG_CHECKING([if strnicmp is prototyped])
  6371. AC_EGREP_CPP([strnicmp],[
  6372. $curl_includes_string
  6373. ],[
  6374. AC_MSG_RESULT([yes])
  6375. tst_proto_strnicmp="yes"
  6376. ],[
  6377. AC_MSG_RESULT([no])
  6378. tst_proto_strnicmp="no"
  6379. ])
  6380. fi
  6381. #
  6382. if test "$tst_proto_strnicmp" = "yes"; then
  6383. AC_MSG_CHECKING([if strnicmp is compilable])
  6384. AC_COMPILE_IFELSE([
  6385. AC_LANG_PROGRAM([[
  6386. $curl_includes_string
  6387. ]],[[
  6388. if(0 != strnicmp(0, 0))
  6389. return 1;
  6390. ]])
  6391. ],[
  6392. AC_MSG_RESULT([yes])
  6393. tst_compi_strnicmp="yes"
  6394. ],[
  6395. AC_MSG_RESULT([no])
  6396. tst_compi_strnicmp="no"
  6397. ])
  6398. fi
  6399. #
  6400. if test "$tst_compi_strnicmp" = "yes"; then
  6401. AC_MSG_CHECKING([if strnicmp usage allowed])
  6402. if test "x$curl_disallow_strnicmp" != "xyes"; then
  6403. AC_MSG_RESULT([yes])
  6404. tst_allow_strnicmp="yes"
  6405. else
  6406. AC_MSG_RESULT([no])
  6407. tst_allow_strnicmp="no"
  6408. fi
  6409. fi
  6410. #
  6411. AC_MSG_CHECKING([if strnicmp might be used])
  6412. if test "$tst_links_strnicmp" = "yes" &&
  6413. test "$tst_proto_strnicmp" = "yes" &&
  6414. test "$tst_compi_strnicmp" = "yes" &&
  6415. test "$tst_allow_strnicmp" = "yes"; then
  6416. AC_MSG_RESULT([yes])
  6417. AC_DEFINE_UNQUOTED(HAVE_STRNICMP, 1,
  6418. [Define to 1 if you have the strnicmp function.])
  6419. curl_cv_func_strnicmp="yes"
  6420. else
  6421. AC_MSG_RESULT([no])
  6422. curl_cv_func_strnicmp="no"
  6423. fi
  6424. ])
  6425. dnl CURL_CHECK_FUNC_STRSTR
  6426. dnl -------------------------------------------------
  6427. dnl Verify if strstr is available, prototyped, and
  6428. dnl can be compiled. If all of these are true, and
  6429. dnl usage has not been previously disallowed with
  6430. dnl shell variable curl_disallow_strstr, then
  6431. dnl HAVE_STRSTR will be defined.
  6432. AC_DEFUN([CURL_CHECK_FUNC_STRSTR], [
  6433. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  6434. #
  6435. tst_links_strstr="unknown"
  6436. tst_proto_strstr="unknown"
  6437. tst_compi_strstr="unknown"
  6438. tst_allow_strstr="unknown"
  6439. #
  6440. AC_MSG_CHECKING([if strstr can be linked])
  6441. AC_LINK_IFELSE([
  6442. AC_LANG_FUNC_LINK_TRY([strstr])
  6443. ],[
  6444. AC_MSG_RESULT([yes])
  6445. tst_links_strstr="yes"
  6446. ],[
  6447. AC_MSG_RESULT([no])
  6448. tst_links_strstr="no"
  6449. ])
  6450. #
  6451. if test "$tst_links_strstr" = "yes"; then
  6452. AC_MSG_CHECKING([if strstr is prototyped])
  6453. AC_EGREP_CPP([strstr],[
  6454. $curl_includes_string
  6455. ],[
  6456. AC_MSG_RESULT([yes])
  6457. tst_proto_strstr="yes"
  6458. ],[
  6459. AC_MSG_RESULT([no])
  6460. tst_proto_strstr="no"
  6461. ])
  6462. fi
  6463. #
  6464. if test "$tst_proto_strstr" = "yes"; then
  6465. AC_MSG_CHECKING([if strstr is compilable])
  6466. AC_COMPILE_IFELSE([
  6467. AC_LANG_PROGRAM([[
  6468. $curl_includes_string
  6469. ]],[[
  6470. if(0 != strstr(0, 0))
  6471. return 1;
  6472. ]])
  6473. ],[
  6474. AC_MSG_RESULT([yes])
  6475. tst_compi_strstr="yes"
  6476. ],[
  6477. AC_MSG_RESULT([no])
  6478. tst_compi_strstr="no"
  6479. ])
  6480. fi
  6481. #
  6482. if test "$tst_compi_strstr" = "yes"; then
  6483. AC_MSG_CHECKING([if strstr usage allowed])
  6484. if test "x$curl_disallow_strstr" != "xyes"; then
  6485. AC_MSG_RESULT([yes])
  6486. tst_allow_strstr="yes"
  6487. else
  6488. AC_MSG_RESULT([no])
  6489. tst_allow_strstr="no"
  6490. fi
  6491. fi
  6492. #
  6493. AC_MSG_CHECKING([if strstr might be used])
  6494. if test "$tst_links_strstr" = "yes" &&
  6495. test "$tst_proto_strstr" = "yes" &&
  6496. test "$tst_compi_strstr" = "yes" &&
  6497. test "$tst_allow_strstr" = "yes"; then
  6498. AC_MSG_RESULT([yes])
  6499. AC_DEFINE_UNQUOTED(HAVE_STRSTR, 1,
  6500. [Define to 1 if you have the strstr function.])
  6501. curl_cv_func_strstr="yes"
  6502. else
  6503. AC_MSG_RESULT([no])
  6504. curl_cv_func_strstr="no"
  6505. fi
  6506. ])
  6507. dnl CURL_CHECK_FUNC_STRTOK_R
  6508. dnl -------------------------------------------------
  6509. dnl Verify if strtok_r is available, prototyped, and
  6510. dnl can be compiled. If all of these are true, and
  6511. dnl usage has not been previously disallowed with
  6512. dnl shell variable curl_disallow_strtok_r, then
  6513. dnl HAVE_STRTOK_R will be defined.
  6514. AC_DEFUN([CURL_CHECK_FUNC_STRTOK_R], [
  6515. AC_REQUIRE([CURL_INCLUDES_STRING])dnl
  6516. #
  6517. tst_links_strtok_r="unknown"
  6518. tst_proto_strtok_r="unknown"
  6519. tst_compi_strtok_r="unknown"
  6520. tst_allow_strtok_r="unknown"
  6521. #
  6522. AC_MSG_CHECKING([if strtok_r can be linked])
  6523. AC_LINK_IFELSE([
  6524. AC_LANG_FUNC_LINK_TRY([strtok_r])
  6525. ],[
  6526. AC_MSG_RESULT([yes])
  6527. tst_links_strtok_r="yes"
  6528. ],[
  6529. AC_MSG_RESULT([no])
  6530. tst_links_strtok_r="no"
  6531. ])
  6532. #
  6533. if test "$tst_links_strtok_r" = "yes"; then
  6534. AC_MSG_CHECKING([if strtok_r is prototyped])
  6535. AC_EGREP_CPP([strtok_r],[
  6536. $curl_includes_string
  6537. ],[
  6538. AC_MSG_RESULT([yes])
  6539. tst_proto_strtok_r="yes"
  6540. ],[
  6541. AC_MSG_RESULT([no])
  6542. tst_proto_strtok_r="no"
  6543. ])
  6544. fi
  6545. #
  6546. if test "$tst_proto_strtok_r" = "yes"; then
  6547. AC_MSG_CHECKING([if strtok_r is compilable])
  6548. AC_COMPILE_IFELSE([
  6549. AC_LANG_PROGRAM([[
  6550. $curl_includes_string
  6551. ]],[[
  6552. if(0 != strtok_r(0, 0, 0))
  6553. return 1;
  6554. ]])
  6555. ],[
  6556. AC_MSG_RESULT([yes])
  6557. tst_compi_strtok_r="yes"
  6558. ],[
  6559. AC_MSG_RESULT([no])
  6560. tst_compi_strtok_r="no"
  6561. ])
  6562. fi
  6563. #
  6564. if test "$tst_compi_strtok_r" = "yes"; then
  6565. AC_MSG_CHECKING([if strtok_r usage allowed])
  6566. if test "x$curl_disallow_strtok_r" != "xyes"; then
  6567. AC_MSG_RESULT([yes])
  6568. tst_allow_strtok_r="yes"
  6569. else
  6570. AC_MSG_RESULT([no])
  6571. tst_allow_strtok_r="no"
  6572. fi
  6573. fi
  6574. #
  6575. AC_MSG_CHECKING([if strtok_r might be used])
  6576. if test "$tst_links_strtok_r" = "yes" &&
  6577. test "$tst_proto_strtok_r" = "yes" &&
  6578. test "$tst_compi_strtok_r" = "yes" &&
  6579. test "$tst_allow_strtok_r" = "yes"; then
  6580. AC_MSG_RESULT([yes])
  6581. AC_DEFINE_UNQUOTED(HAVE_STRTOK_R, 1,
  6582. [Define to 1 if you have the strtok_r function.])
  6583. curl_cv_func_strtok_r="yes"
  6584. else
  6585. AC_MSG_RESULT([no])
  6586. curl_cv_func_strtok_r="no"
  6587. fi
  6588. ])
  6589. dnl CURL_CHECK_FUNC_STRTOLL
  6590. dnl -------------------------------------------------
  6591. dnl Verify if strtoll is available, prototyped, and
  6592. dnl can be compiled. If all of these are true, and
  6593. dnl usage has not been previously disallowed with
  6594. dnl shell variable curl_disallow_strtoll, then
  6595. dnl HAVE_STRTOLL will be defined.
  6596. AC_DEFUN([CURL_CHECK_FUNC_STRTOLL], [
  6597. AC_REQUIRE([CURL_INCLUDES_STDLIB])dnl
  6598. #
  6599. tst_links_strtoll="unknown"
  6600. tst_proto_strtoll="unknown"
  6601. tst_compi_strtoll="unknown"
  6602. tst_allow_strtoll="unknown"
  6603. #
  6604. AC_MSG_CHECKING([if strtoll can be linked])
  6605. AC_LINK_IFELSE([
  6606. AC_LANG_FUNC_LINK_TRY([strtoll])
  6607. ],[
  6608. AC_MSG_RESULT([yes])
  6609. tst_links_strtoll="yes"
  6610. ],[
  6611. AC_MSG_RESULT([no])
  6612. tst_links_strtoll="no"
  6613. ])
  6614. #
  6615. if test "$tst_links_strtoll" = "yes"; then
  6616. AC_MSG_CHECKING([if strtoll is prototyped])
  6617. AC_EGREP_CPP([strtoll],[
  6618. $curl_includes_stdlib
  6619. ],[
  6620. AC_MSG_RESULT([yes])
  6621. tst_proto_strtoll="yes"
  6622. ],[
  6623. AC_MSG_RESULT([no])
  6624. tst_proto_strtoll="no"
  6625. ])
  6626. fi
  6627. #
  6628. if test "$tst_proto_strtoll" = "yes"; then
  6629. AC_MSG_CHECKING([if strtoll is compilable])
  6630. AC_COMPILE_IFELSE([
  6631. AC_LANG_PROGRAM([[
  6632. $curl_includes_stdlib
  6633. ]],[[
  6634. if(0 != strtoll(0, 0, 0))
  6635. return 1;
  6636. ]])
  6637. ],[
  6638. AC_MSG_RESULT([yes])
  6639. tst_compi_strtoll="yes"
  6640. ],[
  6641. AC_MSG_RESULT([no])
  6642. tst_compi_strtoll="no"
  6643. ])
  6644. fi
  6645. #
  6646. if test "$tst_compi_strtoll" = "yes"; then
  6647. AC_MSG_CHECKING([if strtoll usage allowed])
  6648. if test "x$curl_disallow_strtoll" != "xyes"; then
  6649. AC_MSG_RESULT([yes])
  6650. tst_allow_strtoll="yes"
  6651. else
  6652. AC_MSG_RESULT([no])
  6653. tst_allow_strtoll="no"
  6654. fi
  6655. fi
  6656. #
  6657. AC_MSG_CHECKING([if strtoll might be used])
  6658. if test "$tst_links_strtoll" = "yes" &&
  6659. test "$tst_proto_strtoll" = "yes" &&
  6660. test "$tst_compi_strtoll" = "yes" &&
  6661. test "$tst_allow_strtoll" = "yes"; then
  6662. AC_MSG_RESULT([yes])
  6663. AC_DEFINE_UNQUOTED(HAVE_STRTOLL, 1,
  6664. [Define to 1 if you have the strtoll function.])
  6665. curl_cv_func_strtoll="yes"
  6666. else
  6667. AC_MSG_RESULT([no])
  6668. curl_cv_func_strtoll="no"
  6669. fi
  6670. ])
  6671. dnl CURL_CHECK_FUNC_WRITEV
  6672. dnl -------------------------------------------------
  6673. dnl Verify if writev is available, prototyped, and
  6674. dnl can be compiled. If all of these are true, and
  6675. dnl usage has not been previously disallowed with
  6676. dnl shell variable curl_disallow_writev, then
  6677. dnl HAVE_WRITEV will be defined.
  6678. AC_DEFUN([CURL_CHECK_FUNC_WRITEV], [
  6679. AC_REQUIRE([CURL_INCLUDES_SYS_UIO])dnl
  6680. #
  6681. tst_links_writev="unknown"
  6682. tst_proto_writev="unknown"
  6683. tst_compi_writev="unknown"
  6684. tst_allow_writev="unknown"
  6685. #
  6686. AC_MSG_CHECKING([if writev can be linked])
  6687. AC_LINK_IFELSE([
  6688. AC_LANG_FUNC_LINK_TRY([writev])
  6689. ],[
  6690. AC_MSG_RESULT([yes])
  6691. tst_links_writev="yes"
  6692. ],[
  6693. AC_MSG_RESULT([no])
  6694. tst_links_writev="no"
  6695. ])
  6696. #
  6697. if test "$tst_links_writev" = "yes"; then
  6698. AC_MSG_CHECKING([if writev is prototyped])
  6699. AC_EGREP_CPP([writev],[
  6700. $curl_includes_sys_uio
  6701. ],[
  6702. AC_MSG_RESULT([yes])
  6703. tst_proto_writev="yes"
  6704. ],[
  6705. AC_MSG_RESULT([no])
  6706. tst_proto_writev="no"
  6707. ])
  6708. fi
  6709. #
  6710. if test "$tst_proto_writev" = "yes"; then
  6711. AC_MSG_CHECKING([if writev is compilable])
  6712. AC_COMPILE_IFELSE([
  6713. AC_LANG_PROGRAM([[
  6714. $curl_includes_sys_uio
  6715. ]],[[
  6716. if(0 != writev(0, 0, 0))
  6717. return 1;
  6718. ]])
  6719. ],[
  6720. AC_MSG_RESULT([yes])
  6721. tst_compi_writev="yes"
  6722. ],[
  6723. AC_MSG_RESULT([no])
  6724. tst_compi_writev="no"
  6725. ])
  6726. fi
  6727. #
  6728. if test "$tst_compi_writev" = "yes"; then
  6729. AC_MSG_CHECKING([if writev usage allowed])
  6730. if test "x$curl_disallow_writev" != "xyes"; then
  6731. AC_MSG_RESULT([yes])
  6732. tst_allow_writev="yes"
  6733. else
  6734. AC_MSG_RESULT([no])
  6735. tst_allow_writev="no"
  6736. fi
  6737. fi
  6738. #
  6739. AC_MSG_CHECKING([if writev might be used])
  6740. if test "$tst_links_writev" = "yes" &&
  6741. test "$tst_proto_writev" = "yes" &&
  6742. test "$tst_compi_writev" = "yes" &&
  6743. test "$tst_allow_writev" = "yes"; then
  6744. AC_MSG_RESULT([yes])
  6745. AC_DEFINE_UNQUOTED(HAVE_WRITEV, 1,
  6746. [Define to 1 if you have the writev function.])
  6747. curl_cv_func_writev="yes"
  6748. else
  6749. AC_MSG_RESULT([no])
  6750. curl_cv_func_writev="no"
  6751. fi
  6752. ])