curl-functions.m4 187 KB

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