2
0

curl-functions.m4 188 KB

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