You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

curl-functions.m4 186KB

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