configure.ac 160 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at https://curl.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. dnl Process this file with autoconf to produce a configure script.
  23. AC_PREREQ(2.57)
  24. dnl We don't know the version number "statically" so we use a dash here
  25. AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.se/mail/])
  26. XC_OVR_ZZ50
  27. XC_OVR_ZZ60
  28. CURL_OVERRIDE_AUTOCONF
  29. dnl configure script copyright
  30. AC_COPYRIGHT([Copyright (c) 1998 - 2021 Daniel Stenberg, <daniel@haxx.se>
  31. This configure script may be copied, distributed and modified under the
  32. terms of the curl license; see COPYING for more details])
  33. AC_CONFIG_SRCDIR([lib/urldata.h])
  34. AC_CONFIG_HEADERS(lib/curl_config.h)
  35. AC_CONFIG_MACRO_DIR([m4])
  36. AM_MAINTAINER_MODE
  37. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  38. CURL_CHECK_OPTION_DEBUG
  39. CURL_CHECK_OPTION_OPTIMIZE
  40. CURL_CHECK_OPTION_WARNINGS
  41. CURL_CHECK_OPTION_WERROR
  42. CURL_CHECK_OPTION_CURLDEBUG
  43. CURL_CHECK_OPTION_SYMBOL_HIDING
  44. CURL_CHECK_OPTION_ARES
  45. CURL_CHECK_OPTION_RT
  46. CURL_CHECK_OPTION_ECH
  47. XC_CHECK_PATH_SEPARATOR
  48. #
  49. # save the configure arguments
  50. #
  51. CONFIGURE_OPTIONS="\"$ac_configure_args\""
  52. AC_SUBST(CONFIGURE_OPTIONS)
  53. dnl SED is mandatory for configure process and libtool.
  54. dnl Set it now, allowing it to be changed later.
  55. if test -z "$SED"; then
  56. dnl allow it to be overridden
  57. AC_PATH_PROG([SED], [sed], [not_found],
  58. [$PATH:/usr/bin:/usr/local/bin])
  59. if test -z "$SED" || test "$SED" = "not_found"; then
  60. AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
  61. fi
  62. fi
  63. AC_SUBST([SED])
  64. dnl GREP is mandatory for configure process and libtool.
  65. dnl Set it now, allowing it to be changed later.
  66. if test -z "$GREP"; then
  67. dnl allow it to be overridden
  68. AC_PATH_PROG([GREP], [grep], [not_found],
  69. [$PATH:/usr/bin:/usr/local/bin])
  70. if test -z "$GREP" || test "$GREP" = "not_found"; then
  71. AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
  72. fi
  73. fi
  74. AC_SUBST([GREP])
  75. dnl EGREP is mandatory for configure process and libtool.
  76. dnl Set it now, allowing it to be changed later.
  77. if test -z "$EGREP"; then
  78. dnl allow it to be overridden
  79. if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
  80. AC_MSG_CHECKING([for egrep])
  81. EGREP="$GREP -E"
  82. AC_MSG_RESULT([$EGREP])
  83. else
  84. AC_PATH_PROG([EGREP], [egrep], [not_found],
  85. [$PATH:/usr/bin:/usr/local/bin])
  86. fi
  87. fi
  88. if test -z "$EGREP" || test "$EGREP" = "not_found"; then
  89. AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
  90. fi
  91. AC_SUBST([EGREP])
  92. dnl AR is mandatory for configure process and libtool.
  93. dnl This is target dependent, so check it as a tool.
  94. if test -z "$AR"; then
  95. dnl allow it to be overridden
  96. AC_PATH_TOOL([AR], [ar], [not_found],
  97. [$PATH:/usr/bin:/usr/local/bin])
  98. if test -z "$AR" || test "$AR" = "not_found"; then
  99. AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
  100. fi
  101. fi
  102. AC_SUBST([AR])
  103. AC_SUBST(libext)
  104. dnl figure out the libcurl version
  105. CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
  106. XC_CHECK_PROG_CC
  107. dnl for --enable-code-coverage
  108. CURL_COVERAGE
  109. XC_AUTOMAKE
  110. AC_MSG_CHECKING([curl version])
  111. AC_MSG_RESULT($CURLVERSION)
  112. AC_SUBST(CURLVERSION)
  113. dnl
  114. dnl we extract the numerical version for curl-config only
  115. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
  116. AC_SUBST(VERSIONNUM)
  117. dnl Solaris pkgadd support definitions
  118. PKGADD_PKG="HAXXcurl"
  119. PKGADD_NAME="curl - a client that groks URLs"
  120. PKGADD_VENDOR="curl.se"
  121. AC_SUBST(PKGADD_PKG)
  122. AC_SUBST(PKGADD_NAME)
  123. AC_SUBST(PKGADD_VENDOR)
  124. dnl
  125. dnl initialize all the info variables
  126. curl_ssl_msg="no (--with-{ssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,mesalink,amissl,bearssl,rustls} )"
  127. curl_ssh_msg="no (--with-{libssh,libssh2})"
  128. curl_zlib_msg="no (--with-zlib)"
  129. curl_brotli_msg="no (--with-brotli)"
  130. curl_zstd_msg="no (--with-zstd)"
  131. curl_gss_msg="no (--with-gssapi)"
  132. curl_gsasl_msg="no (--with-gsasl)"
  133. curl_tls_srp_msg="no (--enable-tls-srp)"
  134. curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
  135. curl_ipv6_msg="no (--enable-ipv6)"
  136. curl_unix_sockets_msg="no (--enable-unix-sockets)"
  137. curl_idn_msg="no (--with-{libidn2,winidn})"
  138. curl_manual_msg="no (--enable-manual)"
  139. curl_libcurl_msg="enabled (--disable-libcurl-option)"
  140. curl_verbose_msg="enabled (--disable-verbose)"
  141. curl_sspi_msg="no (--enable-sspi)"
  142. curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
  143. curl_ldaps_msg="no (--enable-ldaps)"
  144. curl_rtsp_msg="no (--enable-rtsp)"
  145. curl_rtmp_msg="no (--with-librtmp)"
  146. curl_mtlnk_msg="no (--with-libmetalink)"
  147. curl_psl_msg="no (--with-libpsl)"
  148. curl_altsvc_msg="enabled";
  149. ssl_backends=
  150. curl_h1_msg="enabled (--with-hyper)"
  151. curl_h2_msg="no (--with-nghttp2)"
  152. curl_h3_msg="no (--with-ngtcp2, --with-quiche)"
  153. enable_altsvc="yes"
  154. dnl
  155. dnl Save some initial values the user might have provided
  156. dnl
  157. INITIAL_LDFLAGS=$LDFLAGS
  158. INITIAL_LIBS=$LIBS
  159. dnl
  160. dnl Detect the canonical host and target build environment
  161. dnl
  162. AC_CANONICAL_HOST
  163. dnl Get system canonical name
  164. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  165. # Silence warning: ar: 'u' modifier ignored since 'D' is the default
  166. AC_SUBST(AR_FLAGS, [cr])
  167. dnl This defines _ALL_SOURCE for AIX
  168. CURL_CHECK_AIX_ALL_SOURCE
  169. dnl Our configure and build reentrant settings
  170. CURL_CONFIGURE_THREAD_SAFE
  171. CURL_CONFIGURE_REENTRANT
  172. dnl check for how to do large files
  173. AC_SYS_LARGEFILE
  174. XC_LIBTOOL
  175. #
  176. # Automake conditionals based on libtool related checks
  177. #
  178. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
  179. [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
  180. AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
  181. [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
  182. AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
  183. [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
  184. #
  185. # Due to libtool and automake machinery limitations of not allowing
  186. # specifying separate CPPFLAGS or CFLAGS when compiling objects for
  187. # inclusion of these in shared or static libraries, we are forced to
  188. # build using separate configure runs for shared and static libraries
  189. # on systems where different CPPFLAGS or CFLAGS are mandatory in order
  190. # to compile objects for each kind of library. Notice that relying on
  191. # the '-DPIC' CFLAG that libtool provides is not valid given that the
  192. # user might for example choose to build static libraries with PIC.
  193. #
  194. #
  195. # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
  196. # targeting a static library and not building its shared counterpart.
  197. #
  198. AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
  199. [test "x$xc_lt_build_static_only" = 'xyes'])
  200. #
  201. # Make staticlib CPPFLAG variable and its definition visible in output
  202. # files unconditionally, providing an empty definition unless strictly
  203. # targeting a static library and not building its shared counterpart.
  204. #
  205. CPPFLAG_CURL_STATICLIB=
  206. if test "x$xc_lt_build_static_only" = 'xyes'; then
  207. CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
  208. fi
  209. AC_SUBST([CPPFLAG_CURL_STATICLIB])
  210. # Determine whether all dependent libraries must be specified when linking
  211. if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
  212. then
  213. REQUIRE_LIB_DEPS=no
  214. else
  215. REQUIRE_LIB_DEPS=yes
  216. fi
  217. AC_SUBST(REQUIRE_LIB_DEPS)
  218. AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
  219. dnl check if there's a way to force code inline
  220. AC_C_INLINE
  221. dnl **********************************************************************
  222. dnl platform/compiler/architecture specific checks/flags
  223. dnl **********************************************************************
  224. CURL_CHECK_COMPILER
  225. CURL_SET_COMPILER_BASIC_OPTS
  226. CURL_SET_COMPILER_DEBUG_OPTS
  227. CURL_SET_COMPILER_OPTIMIZE_OPTS
  228. CURL_SET_COMPILER_WARNING_OPTS
  229. if test "$compiler_id" = "INTEL_UNIX_C"; then
  230. #
  231. if test "$compiler_num" -ge "1000"; then
  232. dnl icc 10.X or later
  233. CFLAGS="$CFLAGS -shared-intel"
  234. elif test "$compiler_num" -ge "900"; then
  235. dnl icc 9.X specific
  236. CFLAGS="$CFLAGS -i-dynamic"
  237. fi
  238. #
  239. fi
  240. CURL_CFLAG_EXTRAS=""
  241. if test X"$want_werror" = Xyes; then
  242. CURL_CFLAG_EXTRAS="-Werror"
  243. if test "$compiler_id" = "GNU_C"; then
  244. dnl enable -pedantic-errors for GCC 5 and later,
  245. dnl as before that it was the same as -Werror=pedantic
  246. if test "$compiler_num" -ge "500"; then
  247. CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors"
  248. fi
  249. fi
  250. fi
  251. AC_SUBST(CURL_CFLAG_EXTRAS)
  252. CURL_CHECK_COMPILER_HALT_ON_ERROR
  253. CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
  254. CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
  255. CURL_CHECK_COMPILER_SYMBOL_HIDING
  256. CURL_CHECK_CURLDEBUG
  257. AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
  258. supports_unittests=yes
  259. # cross-compilation of unit tests static library/programs fails when
  260. # libcurl shared library is built. This might be due to a libtool or
  261. # automake issue. In this case we disable unit tests.
  262. if test "x$cross_compiling" != "xno" &&
  263. test "x$enable_shared" != "xno"; then
  264. supports_unittests=no
  265. fi
  266. # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
  267. # a problem related with OpenSSL headers and library versions not matching.
  268. # Disable unit tests while time to further investigate this is found.
  269. case $host in
  270. mips-sgi-irix6.5)
  271. if test "$compiler_id" = "GNU_C"; then
  272. supports_unittests=no
  273. fi
  274. ;;
  275. esac
  276. # All AIX autobuilds fails unit tests linking against unittests library
  277. # due to unittests library being built with no symbols or members. Libtool ?
  278. # Disable unit tests while time to further investigate this is found.
  279. case $host_os in
  280. aix*)
  281. supports_unittests=no
  282. ;;
  283. esac
  284. dnl Build unit tests when option --enable-debug is given.
  285. if test "x$want_debug" = "xyes" &&
  286. test "x$supports_unittests" = "xyes"; then
  287. want_unittests=yes
  288. else
  289. want_unittests=no
  290. fi
  291. AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
  292. dnl **********************************************************************
  293. dnl Compilation based checks should not be done before this point.
  294. dnl **********************************************************************
  295. dnl **********************************************************************
  296. dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
  297. dnl and ws2tcpip.h take precedence over any other further checks which
  298. dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
  299. dnl this specific header files. And do them before its results are used.
  300. dnl **********************************************************************
  301. CURL_CHECK_HEADER_WINDOWS
  302. CURL_CHECK_NATIVE_WINDOWS
  303. case X-"$curl_cv_native_windows" in
  304. X-yes)
  305. CURL_CHECK_HEADER_WINSOCK
  306. CURL_CHECK_HEADER_WINSOCK2
  307. CURL_CHECK_HEADER_WS2TCPIP
  308. CURL_CHECK_HEADER_WINLDAP
  309. CURL_CHECK_HEADER_WINBER
  310. ;;
  311. *)
  312. curl_cv_header_winsock_h="no"
  313. curl_cv_header_winsock2_h="no"
  314. curl_cv_header_ws2tcpip_h="no"
  315. curl_cv_header_winldap_h="no"
  316. curl_cv_header_winber_h="no"
  317. ;;
  318. esac
  319. CURL_CHECK_WIN32_LARGEFILE
  320. CURL_MAC_CFLAGS
  321. CURL_SUPPORTS_BUILTIN_AVAILABLE
  322. dnl ************************************************************
  323. dnl switch off particular protocols
  324. dnl
  325. AC_MSG_CHECKING([whether to support http])
  326. AC_ARG_ENABLE(http,
  327. AC_HELP_STRING([--enable-http],[Enable HTTP support])
  328. AC_HELP_STRING([--disable-http],[Disable HTTP support]),
  329. [ case "$enableval" in
  330. no)
  331. AC_MSG_RESULT(no)
  332. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  333. disable_http="yes"
  334. AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
  335. AC_SUBST(CURL_DISABLE_HTTP, [1])
  336. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  337. AC_SUBST(CURL_DISABLE_RTSP, [1])
  338. dnl toggle off alt-svc too when HTTP is disabled
  339. AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
  340. curl_h1_msg="no (--enable-http, --with-hyper)"
  341. curl_altsvc_msg="no";
  342. enable_altsvc="no"
  343. ;;
  344. *) AC_MSG_RESULT(yes)
  345. ;;
  346. esac ],
  347. AC_MSG_RESULT(yes)
  348. )
  349. AC_MSG_CHECKING([whether to support ftp])
  350. AC_ARG_ENABLE(ftp,
  351. AC_HELP_STRING([--enable-ftp],[Enable FTP support])
  352. AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
  353. [ case "$enableval" in
  354. no)
  355. AC_MSG_RESULT(no)
  356. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  357. AC_SUBST(CURL_DISABLE_FTP, [1])
  358. ;;
  359. *) AC_MSG_RESULT(yes)
  360. ;;
  361. esac ],
  362. AC_MSG_RESULT(yes)
  363. )
  364. AC_MSG_CHECKING([whether to support file])
  365. AC_ARG_ENABLE(file,
  366. AC_HELP_STRING([--enable-file],[Enable FILE support])
  367. AC_HELP_STRING([--disable-file],[Disable FILE support]),
  368. [ case "$enableval" in
  369. no)
  370. AC_MSG_RESULT(no)
  371. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  372. AC_SUBST(CURL_DISABLE_FILE, [1])
  373. ;;
  374. *) AC_MSG_RESULT(yes)
  375. ;;
  376. esac ],
  377. AC_MSG_RESULT(yes)
  378. )
  379. AC_MSG_CHECKING([whether to support ldap])
  380. AC_ARG_ENABLE(ldap,
  381. AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
  382. AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  383. [ case "$enableval" in
  384. no)
  385. AC_MSG_RESULT(no)
  386. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  387. AC_SUBST(CURL_DISABLE_LDAP, [1])
  388. ;;
  389. *)
  390. AC_MSG_RESULT(yes)
  391. ;;
  392. esac ],[
  393. AC_MSG_RESULT(yes) ]
  394. )
  395. AC_MSG_CHECKING([whether to support ldaps])
  396. AC_ARG_ENABLE(ldaps,
  397. AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
  398. AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
  399. [ case "$enableval" in
  400. no)
  401. AC_MSG_RESULT(no)
  402. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  403. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  404. ;;
  405. *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  406. AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
  407. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  408. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  409. else
  410. AC_MSG_RESULT(yes)
  411. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  412. AC_SUBST(HAVE_LDAP_SSL, [1])
  413. fi
  414. ;;
  415. esac ],[
  416. if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  417. AC_MSG_RESULT(no)
  418. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  419. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  420. else
  421. AC_MSG_RESULT(yes)
  422. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  423. AC_SUBST(HAVE_LDAP_SSL, [1])
  424. fi ]
  425. )
  426. AC_MSG_CHECKING([whether to support rtsp])
  427. AC_ARG_ENABLE(rtsp,
  428. AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
  429. AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
  430. [ case "$enableval" in
  431. no)
  432. AC_MSG_RESULT(no)
  433. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  434. AC_SUBST(CURL_DISABLE_RTSP, [1])
  435. ;;
  436. *) if test x$CURL_DISABLE_HTTP = x1 ; then
  437. AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
  438. else
  439. AC_MSG_RESULT(yes)
  440. curl_rtsp_msg="enabled"
  441. fi
  442. ;;
  443. esac ],
  444. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  445. AC_MSG_RESULT(yes)
  446. curl_rtsp_msg="enabled"
  447. else
  448. AC_MSG_RESULT(no)
  449. fi
  450. )
  451. AC_MSG_CHECKING([whether to support proxies])
  452. AC_ARG_ENABLE(proxy,
  453. AC_HELP_STRING([--enable-proxy],[Enable proxy support])
  454. AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
  455. [ case "$enableval" in
  456. no)
  457. AC_MSG_RESULT(no)
  458. AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
  459. AC_SUBST(CURL_DISABLE_PROXY, [1])
  460. https_proxy="no"
  461. ;;
  462. *) AC_MSG_RESULT(yes)
  463. ;;
  464. esac ],
  465. AC_MSG_RESULT(yes)
  466. )
  467. AC_MSG_CHECKING([whether to support dict])
  468. AC_ARG_ENABLE(dict,
  469. AC_HELP_STRING([--enable-dict],[Enable DICT support])
  470. AC_HELP_STRING([--disable-dict],[Disable DICT support]),
  471. [ case "$enableval" in
  472. no)
  473. AC_MSG_RESULT(no)
  474. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  475. AC_SUBST(CURL_DISABLE_DICT, [1])
  476. ;;
  477. *) AC_MSG_RESULT(yes)
  478. ;;
  479. esac ],
  480. AC_MSG_RESULT(yes)
  481. )
  482. AC_MSG_CHECKING([whether to support telnet])
  483. AC_ARG_ENABLE(telnet,
  484. AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
  485. AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  486. [ case "$enableval" in
  487. no)
  488. AC_MSG_RESULT(no)
  489. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  490. AC_SUBST(CURL_DISABLE_TELNET, [1])
  491. ;;
  492. *) AC_MSG_RESULT(yes)
  493. ;;
  494. esac ],
  495. AC_MSG_RESULT(yes)
  496. )
  497. AC_MSG_CHECKING([whether to support tftp])
  498. AC_ARG_ENABLE(tftp,
  499. AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
  500. AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
  501. [ case "$enableval" in
  502. no)
  503. AC_MSG_RESULT(no)
  504. AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
  505. AC_SUBST(CURL_DISABLE_TFTP, [1])
  506. ;;
  507. *) AC_MSG_RESULT(yes)
  508. ;;
  509. esac ],
  510. AC_MSG_RESULT(yes)
  511. )
  512. AC_MSG_CHECKING([whether to support pop3])
  513. AC_ARG_ENABLE(pop3,
  514. AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
  515. AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
  516. [ case "$enableval" in
  517. no)
  518. AC_MSG_RESULT(no)
  519. AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
  520. AC_SUBST(CURL_DISABLE_POP3, [1])
  521. ;;
  522. *) AC_MSG_RESULT(yes)
  523. ;;
  524. esac ],
  525. AC_MSG_RESULT(yes)
  526. )
  527. AC_MSG_CHECKING([whether to support imap])
  528. AC_ARG_ENABLE(imap,
  529. AC_HELP_STRING([--enable-imap],[Enable IMAP support])
  530. AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
  531. [ case "$enableval" in
  532. no)
  533. AC_MSG_RESULT(no)
  534. AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
  535. AC_SUBST(CURL_DISABLE_IMAP, [1])
  536. ;;
  537. *) AC_MSG_RESULT(yes)
  538. ;;
  539. esac ],
  540. AC_MSG_RESULT(yes)
  541. )
  542. AC_MSG_CHECKING([whether to support smb])
  543. AC_ARG_ENABLE(smb,
  544. AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support])
  545. AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]),
  546. [ case "$enableval" in
  547. no)
  548. AC_MSG_RESULT(no)
  549. AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS])
  550. AC_SUBST(CURL_DISABLE_SMB, [1])
  551. ;;
  552. *) AC_MSG_RESULT(yes)
  553. ;;
  554. esac ],
  555. AC_MSG_RESULT(yes)
  556. )
  557. AC_MSG_CHECKING([whether to support smtp])
  558. AC_ARG_ENABLE(smtp,
  559. AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
  560. AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
  561. [ case "$enableval" in
  562. no)
  563. AC_MSG_RESULT(no)
  564. AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
  565. AC_SUBST(CURL_DISABLE_SMTP, [1])
  566. ;;
  567. *) AC_MSG_RESULT(yes)
  568. ;;
  569. esac ],
  570. AC_MSG_RESULT(yes)
  571. )
  572. AC_MSG_CHECKING([whether to support gopher])
  573. AC_ARG_ENABLE(gopher,
  574. AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
  575. AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
  576. [ case "$enableval" in
  577. no)
  578. AC_MSG_RESULT(no)
  579. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
  580. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  581. ;;
  582. *) AC_MSG_RESULT(yes)
  583. ;;
  584. esac ],
  585. AC_MSG_RESULT(yes)
  586. )
  587. AC_MSG_CHECKING([whether to support mqtt])
  588. AC_ARG_ENABLE(mqtt,
  589. AC_HELP_STRING([--enable-mqtt],[Enable MQTT support])
  590. AC_HELP_STRING([--disable-mqtt],[Disable MQTT support]),
  591. [ case "$enableval" in
  592. no)
  593. AC_MSG_RESULT(no)
  594. AC_DEFINE(CURL_DISABLE_MQTT, 1, [to disable MQTT])
  595. AC_SUBST(CURL_DISABLE_MQTT, [1])
  596. ;;
  597. *) AC_MSG_RESULT(yes)
  598. ;;
  599. esac ],
  600. AC_MSG_RESULT(no)
  601. )
  602. dnl **********************************************************************
  603. dnl Check for built-in manual
  604. dnl **********************************************************************
  605. AC_MSG_CHECKING([whether to provide built-in manual])
  606. AC_ARG_ENABLE(manual,
  607. AC_HELP_STRING([--enable-manual],[Enable built-in manual])
  608. AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
  609. [ case "$enableval" in
  610. no)
  611. AC_MSG_RESULT(no)
  612. ;;
  613. *) AC_MSG_RESULT(yes)
  614. USE_MANUAL="1"
  615. ;;
  616. esac ],
  617. AC_MSG_RESULT(yes)
  618. USE_MANUAL="1"
  619. )
  620. dnl The actual use of the USE_MANUAL variable is done much later in this
  621. dnl script to allow other actions to disable it as well.
  622. dnl ************************************************************
  623. dnl disable C code generation support
  624. dnl
  625. AC_MSG_CHECKING([whether to enable generation of C code])
  626. AC_ARG_ENABLE(libcurl_option,
  627. AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
  628. AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
  629. [ case "$enableval" in
  630. no)
  631. AC_MSG_RESULT(no)
  632. AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
  633. curl_libcurl_msg="no"
  634. ;;
  635. *) AC_MSG_RESULT(yes)
  636. ;;
  637. esac ],
  638. AC_MSG_RESULT(yes)
  639. )
  640. dnl **********************************************************************
  641. dnl Checks for libraries.
  642. dnl **********************************************************************
  643. AC_MSG_CHECKING([whether to use libgcc])
  644. AC_ARG_ENABLE(libgcc,
  645. AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  646. [ case "$enableval" in
  647. yes)
  648. LIBS="-lgcc $LIBS"
  649. AC_MSG_RESULT(yes)
  650. ;;
  651. *) AC_MSG_RESULT(no)
  652. ;;
  653. esac ],
  654. AC_MSG_RESULT(no)
  655. )
  656. CURL_CHECK_LIB_XNET
  657. dnl gethostbyname without lib or in the nsl lib?
  658. AC_CHECK_FUNC(gethostbyname,
  659. [HAVE_GETHOSTBYNAME="1"
  660. ],
  661. [ AC_CHECK_LIB(nsl, gethostbyname,
  662. [HAVE_GETHOSTBYNAME="1"
  663. LIBS="-lnsl $LIBS"
  664. ])
  665. ])
  666. if test "$HAVE_GETHOSTBYNAME" != "1"
  667. then
  668. dnl gethostbyname in the socket lib?
  669. AC_CHECK_LIB(socket, gethostbyname,
  670. [HAVE_GETHOSTBYNAME="1"
  671. LIBS="-lsocket $LIBS"
  672. ])
  673. fi
  674. if test "$HAVE_GETHOSTBYNAME" != "1"
  675. then
  676. dnl gethostbyname in the watt lib?
  677. AC_CHECK_LIB(watt, gethostbyname,
  678. [HAVE_GETHOSTBYNAME="1"
  679. CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
  680. LDFLAGS="-L/dev/env/WATT_ROOT/lib"
  681. LIBS="-lwatt $LIBS"
  682. ])
  683. fi
  684. dnl At least one system has been identified to require BOTH nsl and socket
  685. dnl libs at the same time to link properly.
  686. if test "$HAVE_GETHOSTBYNAME" != "1"
  687. then
  688. AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
  689. my_ac_save_LIBS=$LIBS
  690. LIBS="-lnsl -lsocket $LIBS"
  691. AC_LINK_IFELSE([
  692. AC_LANG_PROGRAM([[
  693. ]],[[
  694. gethostbyname();
  695. ]])
  696. ],[
  697. AC_MSG_RESULT([yes])
  698. HAVE_GETHOSTBYNAME="1"
  699. ],[
  700. AC_MSG_RESULT([no])
  701. LIBS=$my_ac_save_LIBS
  702. ])
  703. fi
  704. if test "$HAVE_GETHOSTBYNAME" != "1"
  705. then
  706. dnl This is for winsock systems
  707. if test "$curl_cv_header_windows_h" = "yes"; then
  708. if test "$curl_cv_header_winsock_h" = "yes"; then
  709. case $host in
  710. *-*-mingw32ce*)
  711. winsock_LIB="-lwinsock"
  712. ;;
  713. *)
  714. winsock_LIB="-lwsock32"
  715. ;;
  716. esac
  717. fi
  718. if test "$curl_cv_header_winsock2_h" = "yes"; then
  719. winsock_LIB="-lws2_32"
  720. fi
  721. if test ! -z "$winsock_LIB"; then
  722. my_ac_save_LIBS=$LIBS
  723. LIBS="$winsock_LIB $LIBS"
  724. AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
  725. AC_LINK_IFELSE([
  726. AC_LANG_PROGRAM([[
  727. #ifdef HAVE_WINDOWS_H
  728. #ifndef WIN32_LEAN_AND_MEAN
  729. #define WIN32_LEAN_AND_MEAN
  730. #endif
  731. #include <windows.h>
  732. #ifdef HAVE_WINSOCK2_H
  733. #include <winsock2.h>
  734. #else
  735. #ifdef HAVE_WINSOCK_H
  736. #include <winsock.h>
  737. #endif
  738. #endif
  739. #endif
  740. ]],[[
  741. gethostbyname("www.dummysite.com");
  742. ]])
  743. ],[
  744. AC_MSG_RESULT([yes])
  745. HAVE_GETHOSTBYNAME="1"
  746. ],[
  747. AC_MSG_RESULT([no])
  748. winsock_LIB=""
  749. LIBS=$my_ac_save_LIBS
  750. ])
  751. fi
  752. fi
  753. fi
  754. if test "$HAVE_GETHOSTBYNAME" != "1"
  755. then
  756. dnl This is for Minix 3.1
  757. AC_MSG_CHECKING([for gethostbyname for Minix 3])
  758. AC_LINK_IFELSE([
  759. AC_LANG_PROGRAM([[
  760. /* Older Minix versions may need <net/gen/netdb.h> here instead */
  761. #include <netdb.h>
  762. ]],[[
  763. gethostbyname("www.dummysite.com");
  764. ]])
  765. ],[
  766. AC_MSG_RESULT([yes])
  767. HAVE_GETHOSTBYNAME="1"
  768. ],[
  769. AC_MSG_RESULT([no])
  770. ])
  771. fi
  772. if test "$HAVE_GETHOSTBYNAME" != "1"
  773. then
  774. dnl This is for eCos with a stubbed DNS implementation
  775. AC_MSG_CHECKING([for gethostbyname for eCos])
  776. AC_LINK_IFELSE([
  777. AC_LANG_PROGRAM([[
  778. #include <stdio.h>
  779. #include <netdb.h>
  780. ]],[[
  781. gethostbyname("www.dummysite.com");
  782. ]])
  783. ],[
  784. AC_MSG_RESULT([yes])
  785. HAVE_GETHOSTBYNAME="1"
  786. ],[
  787. AC_MSG_RESULT([no])
  788. ])
  789. fi
  790. if test "$HAVE_GETHOSTBYNAME" != "1" -o "${with_amissl+set}" = set
  791. then
  792. dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet
  793. AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library])
  794. AC_LINK_IFELSE([
  795. AC_LANG_PROGRAM([[
  796. #include <proto/bsdsocket.h>
  797. struct Library *SocketBase = NULL;
  798. ]],[[
  799. gethostbyname("www.dummysite.com");
  800. ]])
  801. ],[
  802. AC_MSG_RESULT([yes])
  803. HAVE_GETHOSTBYNAME="1"
  804. HAVE_PROTO_BSDSOCKET_H="1"
  805. AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use])
  806. AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1])
  807. ],[
  808. AC_MSG_RESULT([no])
  809. ])
  810. fi
  811. if test "$HAVE_GETHOSTBYNAME" != "1"
  812. then
  813. dnl gethostbyname in the network lib - for Haiku OS
  814. AC_CHECK_LIB(network, gethostbyname,
  815. [HAVE_GETHOSTBYNAME="1"
  816. LIBS="-lnetwork $LIBS"
  817. ])
  818. fi
  819. if test "$HAVE_GETHOSTBYNAME" != "1"
  820. then
  821. dnl gethostbyname in the net lib - for BeOS
  822. AC_CHECK_LIB(net, gethostbyname,
  823. [HAVE_GETHOSTBYNAME="1"
  824. LIBS="-lnet $LIBS"
  825. ])
  826. fi
  827. if test "$HAVE_GETHOSTBYNAME" != "1"; then
  828. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  829. fi
  830. CURL_CHECK_LIBS_CONNECT
  831. CURL_NETWORK_LIBS=$LIBS
  832. dnl **********************************************************************
  833. dnl In case that function clock_gettime with monotonic timer is available,
  834. dnl check for additional required libraries.
  835. dnl **********************************************************************
  836. CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
  837. dnl **********************************************************************
  838. dnl The preceding library checks are all potentially useful for test
  839. dnl servers and libtest cases which require networking and clock_gettime
  840. dnl support. Save the list of required libraries at this point for use
  841. dnl while linking those test servers and programs.
  842. dnl **********************************************************************
  843. CURL_NETWORK_AND_TIME_LIBS=$LIBS
  844. dnl **********************************************************************
  845. dnl Check for the presence of ZLIB libraries and headers
  846. dnl **********************************************************************
  847. dnl Check for & handle argument to --with-zlib.
  848. clean_CPPFLAGS=$CPPFLAGS
  849. clean_LDFLAGS=$LDFLAGS
  850. clean_LIBS=$LIBS
  851. ZLIB_LIBS=""
  852. AC_ARG_WITH(zlib,
  853. AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  854. AC_HELP_STRING([--without-zlib],[disable use of zlib]),
  855. [OPT_ZLIB="$withval"])
  856. if test "$OPT_ZLIB" = "no" ; then
  857. AC_MSG_WARN([zlib disabled])
  858. else
  859. if test "$OPT_ZLIB" = "yes" ; then
  860. OPT_ZLIB=""
  861. fi
  862. if test -z "$OPT_ZLIB" ; then
  863. CURL_CHECK_PKGCONFIG(zlib)
  864. if test "$PKGCONFIG" != "no" ; then
  865. LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS"
  866. LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`"
  867. CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`"
  868. OPT_ZLIB=""
  869. HAVE_LIBZ="1"
  870. fi
  871. if test -z "$HAVE_LIBZ"; then
  872. dnl Check for the lib without setting any new path, since many
  873. dnl people have it in the default path
  874. AC_CHECK_LIB(z, inflateEnd,
  875. dnl libz found, set the variable
  876. [HAVE_LIBZ="1"
  877. LIBS="-lz $LIBS"],
  878. dnl if no lib found, try /usr/local
  879. [OPT_ZLIB="/usr/local"])
  880. fi
  881. fi
  882. dnl Add a nonempty path to the compiler flags
  883. if test -n "$OPT_ZLIB"; then
  884. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  885. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  886. fi
  887. AC_CHECK_HEADER(zlib.h,
  888. [
  889. dnl zlib.h was found
  890. HAVE_ZLIB_H="1"
  891. dnl if the lib wasn't found already, try again with the new paths
  892. if test "$HAVE_LIBZ" != "1"; then
  893. AC_CHECK_LIB(z, gzread,
  894. [
  895. dnl the lib was found!
  896. HAVE_LIBZ="1"
  897. LIBS="-lz $LIBS"
  898. ],
  899. [ CPPFLAGS=$clean_CPPFLAGS
  900. LDFLAGS=$clean_LDFLAGS])
  901. fi
  902. ],
  903. [
  904. dnl zlib.h was not found, restore the flags
  905. CPPFLAGS=$clean_CPPFLAGS
  906. LDFLAGS=$clean_LDFLAGS]
  907. )
  908. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  909. then
  910. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  911. HAVE_LIBZ=""
  912. CPPFLAGS=$clean_CPPFLAGS
  913. LDFLAGS=$clean_LDFLAGS
  914. LIBS=$clean_LIBS
  915. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  916. then
  917. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  918. CPPFLAGS=$clean_CPPFLAGS
  919. LDFLAGS=$clean_LDFLAGS
  920. LIBS=$clean_LIBS
  921. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  922. then
  923. dnl both header and lib were found!
  924. AC_SUBST(HAVE_LIBZ)
  925. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  926. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  927. ZLIB_LIBS="-lz"
  928. LIBS="-lz $clean_LIBS"
  929. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  930. AMFIXLIB="1"
  931. AC_MSG_NOTICE([found both libz and libz.h header])
  932. curl_zlib_msg="enabled"
  933. fi
  934. fi
  935. dnl set variable for use in automakefile(s)
  936. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  937. AC_SUBST(ZLIB_LIBS)
  938. dnl **********************************************************************
  939. dnl Check for the presence of BROTLI decoder libraries and headers
  940. dnl **********************************************************************
  941. dnl Brotli project home page: https://github.com/google/brotli
  942. dnl Default to compiler & linker defaults for BROTLI files & libraries.
  943. OPT_BROTLI=off
  944. AC_ARG_WITH(brotli,dnl
  945. AC_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  946. AC_HELP_STRING([--without-brotli], [disable BROTLI]),
  947. OPT_BROTLI=$withval)
  948. if test X"$OPT_BROTLI" != Xno; then
  949. dnl backup the pre-brotli variables
  950. CLEANLDFLAGS="$LDFLAGS"
  951. CLEANCPPFLAGS="$CPPFLAGS"
  952. CLEANLIBS="$LIBS"
  953. case "$OPT_BROTLI" in
  954. yes)
  955. dnl --with-brotli (without path) used
  956. CURL_CHECK_PKGCONFIG(libbrotlidec)
  957. if test "$PKGCONFIG" != "no" ; then
  958. LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec`
  959. LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec`
  960. CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec`
  961. version=`$PKGCONFIG --modversion libbrotlidec`
  962. DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/^-L//'`
  963. fi
  964. ;;
  965. off)
  966. dnl no --with-brotli option given, just check default places
  967. ;;
  968. *)
  969. dnl use the given --with-brotli spot
  970. PREFIX_BROTLI=$OPT_BROTLI
  971. ;;
  972. esac
  973. dnl if given with a prefix, we set -L and -I based on that
  974. if test -n "$PREFIX_BROTLI"; then
  975. LIB_BROTLI="-lbrotlidec"
  976. LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff
  977. CPP_BROTLI=-I${PREFIX_BROTLI}/include
  978. DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff
  979. fi
  980. LDFLAGS="$LDFLAGS $LD_BROTLI"
  981. CPPFLAGS="$CPPFLAGS $CPP_BROTLI"
  982. LIBS="$LIB_BROTLI $LIBS"
  983. AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress)
  984. AC_CHECK_HEADERS(brotli/decode.h,
  985. curl_brotli_msg="enabled (libbrotlidec)"
  986. HAVE_BROTLI=1
  987. AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use])
  988. AC_SUBST(HAVE_BROTLI, [1])
  989. )
  990. if test X"$OPT_BROTLI" != Xoff &&
  991. test "$HAVE_BROTLI" != "1"; then
  992. AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!])
  993. fi
  994. if test "$HAVE_BROTLI" = "1"; then
  995. if test -n "$DIR_BROTLI"; then
  996. dnl when the brotli shared libs were found in a path that the run-time
  997. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  998. dnl to prevent further configure tests to fail due to this
  999. if test "x$cross_compiling" != "xyes"; then
  1000. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI"
  1001. export CURL_LIBRARY_PATH
  1002. AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH])
  1003. fi
  1004. fi
  1005. else
  1006. dnl no brotli, revert back to clean variables
  1007. LDFLAGS=$CLEANLDFLAGS
  1008. CPPFLAGS=$CLEANCPPFLAGS
  1009. LIBS=$CLEANLIBS
  1010. fi
  1011. fi
  1012. dnl **********************************************************************
  1013. dnl Check for libzstd
  1014. dnl **********************************************************************
  1015. dnl Default to compiler & linker defaults for libzstd
  1016. OPT_ZSTD=off
  1017. AC_ARG_WITH(zstd,dnl
  1018. AC_HELP_STRING([--with-zstd=PATH],[Where to look for libzstd, PATH points to the libzstd installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1019. AC_HELP_STRING([--without-zstd], [disable libzstd]),
  1020. OPT_ZSTD=$withval)
  1021. if test X"$OPT_ZSTD" != Xno; then
  1022. dnl backup the pre-zstd variables
  1023. CLEANLDFLAGS="$LDFLAGS"
  1024. CLEANCPPFLAGS="$CPPFLAGS"
  1025. CLEANLIBS="$LIBS"
  1026. case "$OPT_ZSTD" in
  1027. yes)
  1028. dnl --with-zstd (without path) used
  1029. CURL_CHECK_PKGCONFIG(libzstd)
  1030. if test "$PKGCONFIG" != "no" ; then
  1031. LIB_ZSTD=`$PKGCONFIG --libs-only-l libzstd`
  1032. LD_ZSTD=`$PKGCONFIG --libs-only-L libzstd`
  1033. CPP_ZSTD=`$PKGCONFIG --cflags-only-I libzstd`
  1034. version=`$PKGCONFIG --modversion libzstd`
  1035. DIR_ZSTD=`echo $LD_ZSTD | $SED -e 's/-L//'`
  1036. fi
  1037. ;;
  1038. off)
  1039. dnl no --with-zstd option given, just check default places
  1040. ;;
  1041. *)
  1042. dnl use the given --with-zstd spot
  1043. PREFIX_ZSTD=$OPT_ZSTD
  1044. ;;
  1045. esac
  1046. dnl if given with a prefix, we set -L and -I based on that
  1047. if test -n "$PREFIX_ZSTD"; then
  1048. LIB_ZSTD="-lzstd"
  1049. LD_ZSTD=-L${PREFIX_ZSTD}/lib$libsuff
  1050. CPP_ZSTD=-I${PREFIX_ZSTD}/include
  1051. DIR_ZSTD=${PREFIX_ZSTD}/lib$libsuff
  1052. fi
  1053. LDFLAGS="$LDFLAGS $LD_ZSTD"
  1054. CPPFLAGS="$CPPFLAGS $CPP_ZSTD"
  1055. LIBS="$LIB_ZSTD $LIBS"
  1056. AC_CHECK_LIB(zstd, ZSTD_createDStream)
  1057. AC_CHECK_HEADERS(zstd.h,
  1058. curl_zstd_msg="enabled (libzstd)"
  1059. HAVE_ZSTD=1
  1060. AC_DEFINE(HAVE_ZSTD, 1, [if libzstd is in use])
  1061. AC_SUBST(HAVE_ZSTD, [1])
  1062. )
  1063. if test X"$OPT_ZSTD" != Xoff &&
  1064. test "$HAVE_ZSTD" != "1"; then
  1065. AC_MSG_ERROR([libzstd was not found where specified!])
  1066. fi
  1067. if test "$HAVE_ZSTD" = "1"; then
  1068. if test -n "$DIR_ZSTD"; then
  1069. dnl when the zstd shared lib were found in a path that the run-time
  1070. dnl linker doesn't search through, we need to add it to
  1071. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail due to
  1072. dnl this
  1073. if test "x$cross_compiling" != "xyes"; then
  1074. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_ZSTD"
  1075. export CURL_LIBRARY_PATH
  1076. AC_MSG_NOTICE([Added $DIR_ZSTD to CURL_LIBRARY_PATH])
  1077. fi
  1078. fi
  1079. else
  1080. dnl no zstd, revert back to clean variables
  1081. LDFLAGS=$CLEANLDFLAGS
  1082. CPPFLAGS=$CLEANCPPFLAGS
  1083. LIBS=$CLEANLIBS
  1084. fi
  1085. fi
  1086. dnl **********************************************************************
  1087. dnl Check for LDAP
  1088. dnl **********************************************************************
  1089. LDAPLIBNAME=""
  1090. AC_ARG_WITH(ldap-lib,
  1091. AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
  1092. [LDAPLIBNAME="$withval"])
  1093. LBERLIBNAME=""
  1094. AC_ARG_WITH(lber-lib,
  1095. AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
  1096. [LBERLIBNAME="$withval"])
  1097. if test x$CURL_DISABLE_LDAP != x1 ; then
  1098. CURL_CHECK_HEADER_LBER
  1099. CURL_CHECK_HEADER_LDAP
  1100. CURL_CHECK_HEADER_LDAPSSL
  1101. CURL_CHECK_HEADER_LDAP_SSL
  1102. if test -z "$LDAPLIBNAME" ; then
  1103. if test "$curl_cv_native_windows" = "yes"; then
  1104. dnl Windows uses a single and unique LDAP library name
  1105. LDAPLIBNAME="wldap32"
  1106. LBERLIBNAME="no"
  1107. fi
  1108. fi
  1109. if test "$LDAPLIBNAME" ; then
  1110. AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
  1111. AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
  1112. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1113. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1114. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1115. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  1116. else
  1117. dnl Try to find the right ldap libraries for this system
  1118. CURL_CHECK_LIBS_LDAP
  1119. case X-"$curl_cv_ldap_LIBS" in
  1120. X-unknown)
  1121. AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
  1122. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1123. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1124. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1125. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  1126. ;;
  1127. esac
  1128. fi
  1129. fi
  1130. if test x$CURL_DISABLE_LDAP != x1 ; then
  1131. if test "$LBERLIBNAME" ; then
  1132. dnl If name is "no" then don't define this library at all
  1133. dnl (it's only needed if libldap.so's dependencies are broken).
  1134. if test "$LBERLIBNAME" != "no" ; then
  1135. AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
  1136. AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
  1137. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  1138. AC_SUBST(CURL_DISABLE_LDAP, [1])
  1139. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  1140. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  1141. fi
  1142. fi
  1143. fi
  1144. if test x$CURL_DISABLE_LDAP != x1 ; then
  1145. AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
  1146. if test "$LDAPLIBNAME" = "wldap32"; then
  1147. curl_ldap_msg="enabled (winldap)"
  1148. AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation])
  1149. else
  1150. curl_ldap_msg="enabled (OpenLDAP)"
  1151. if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
  1152. AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
  1153. AC_SUBST(USE_OPENLDAP, [1])
  1154. fi
  1155. fi
  1156. fi
  1157. if test x$CURL_DISABLE_LDAPS != x1 ; then
  1158. curl_ldaps_msg="enabled"
  1159. fi
  1160. dnl **********************************************************************
  1161. dnl Checks for IPv6
  1162. dnl **********************************************************************
  1163. AC_MSG_CHECKING([whether to enable IPv6])
  1164. AC_ARG_ENABLE(ipv6,
  1165. AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support])
  1166. AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]),
  1167. [ case "$enableval" in
  1168. no)
  1169. AC_MSG_RESULT(no)
  1170. ipv6=no
  1171. ;;
  1172. *) AC_MSG_RESULT(yes)
  1173. ipv6=yes
  1174. ;;
  1175. esac ],
  1176. AC_TRY_RUN([ /* are AF_INET6 and sockaddr_in6 available? */
  1177. #include <sys/types.h>
  1178. #ifdef HAVE_WINSOCK2_H
  1179. #include <winsock2.h>
  1180. #include <ws2tcpip.h>
  1181. #else
  1182. #include <sys/socket.h>
  1183. #include <netinet/in.h>
  1184. #if defined (__TANDEM)
  1185. # include <netinet/in6.h>
  1186. #endif
  1187. #endif
  1188. #include <stdlib.h> /* for exit() */
  1189. main()
  1190. {
  1191. struct sockaddr_in6 s;
  1192. (void)s;
  1193. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  1194. exit(1);
  1195. else
  1196. exit(0);
  1197. }
  1198. ],
  1199. AC_MSG_RESULT(yes)
  1200. ipv6=yes,
  1201. AC_MSG_RESULT(no)
  1202. ipv6=no,
  1203. AC_MSG_RESULT(yes)
  1204. ipv6=yes
  1205. ))
  1206. if test "$ipv6" = yes; then
  1207. curl_ipv6_msg="enabled"
  1208. AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
  1209. IPV6_ENABLED=1
  1210. AC_SUBST(IPV6_ENABLED)
  1211. AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
  1212. AC_TRY_COMPILE([
  1213. #include <sys/types.h>
  1214. #ifdef HAVE_WINSOCK2_H
  1215. #include <winsock2.h>
  1216. #include <ws2tcpip.h>
  1217. #else
  1218. #include <netinet/in.h>
  1219. #if defined (__TANDEM)
  1220. # include <netinet/in6.h>
  1221. #endif
  1222. #endif] ,
  1223. struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
  1224. if test "$have_sin6_scope_id" = yes; then
  1225. AC_MSG_RESULT([yes])
  1226. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
  1227. else
  1228. AC_MSG_RESULT([no])
  1229. fi
  1230. fi
  1231. dnl **********************************************************************
  1232. dnl Check if the operating system allows programs to write to their own argv[]
  1233. dnl **********************************************************************
  1234. AC_MSG_CHECKING([if argv can be written to])
  1235. CURL_RUN_IFELSE([[
  1236. int main(int argc, char **argv)
  1237. {
  1238. (void)argc;
  1239. argv[0][0] = ' ';
  1240. return (argv[0][0] == ' ')?0:1;
  1241. }
  1242. ]],[
  1243. curl_cv_writable_argv=yes
  1244. ],[
  1245. curl_cv_writable_argv=no
  1246. ],[
  1247. curl_cv_writable_argv=cross
  1248. ])
  1249. case $curl_cv_writable_argv in
  1250. yes)
  1251. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  1252. AC_MSG_RESULT(yes)
  1253. ;;
  1254. no)
  1255. AC_MSG_RESULT(no)
  1256. ;;
  1257. *)
  1258. AC_MSG_RESULT(no)
  1259. AC_MSG_WARN([the previous check could not be made default was used])
  1260. ;;
  1261. esac
  1262. dnl **********************************************************************
  1263. dnl Check for GSS-API libraries
  1264. dnl **********************************************************************
  1265. dnl check for GSS-API stuff in the /usr as default
  1266. GSSAPI_ROOT="/usr"
  1267. AC_ARG_WITH(gssapi-includes,
  1268. AC_HELP_STRING([--with-gssapi-includes=DIR],
  1269. [Specify location of GSS-API headers]),
  1270. [ GSSAPI_INCS="-I$withval"
  1271. want_gss="yes" ]
  1272. )
  1273. AC_ARG_WITH(gssapi-libs,
  1274. AC_HELP_STRING([--with-gssapi-libs=DIR],
  1275. [Specify location of GSS-API libs]),
  1276. [ GSSAPI_LIB_DIR="-L$withval"
  1277. want_gss="yes" ]
  1278. )
  1279. AC_ARG_WITH(gssapi,
  1280. AC_HELP_STRING([--with-gssapi=DIR],
  1281. [Where to look for GSS-API]), [
  1282. GSSAPI_ROOT="$withval"
  1283. if test x"$GSSAPI_ROOT" != xno; then
  1284. want_gss="yes"
  1285. if test x"$GSSAPI_ROOT" = xyes; then
  1286. dnl if yes, then use default root
  1287. GSSAPI_ROOT="/usr"
  1288. fi
  1289. fi
  1290. ])
  1291. : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}
  1292. save_CPPFLAGS="$CPPFLAGS"
  1293. AC_MSG_CHECKING([if GSS-API support is requested])
  1294. if test x"$want_gss" = xyes; then
  1295. AC_MSG_RESULT(yes)
  1296. if test -z "$GSSAPI_INCS"; then
  1297. if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
  1298. GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
  1299. elif test -f "$KRB5CONFIG"; then
  1300. GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
  1301. elif test "$GSSAPI_ROOT" != "yes"; then
  1302. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  1303. fi
  1304. fi
  1305. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  1306. AC_CHECK_HEADER(gss.h,
  1307. [
  1308. dnl found in the given dirs
  1309. AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS])
  1310. gnu_gss=yes
  1311. ],
  1312. [
  1313. dnl not found, check Heimdal or MIT
  1314. AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
  1315. AC_CHECK_HEADERS(
  1316. [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
  1317. [],
  1318. [not_mit=1],
  1319. [
  1320. AC_INCLUDES_DEFAULT
  1321. #ifdef HAVE_GSSAPI_GSSAPI_H
  1322. #include <gssapi/gssapi.h>
  1323. #endif
  1324. ])
  1325. if test "x$not_mit" = "x1"; then
  1326. dnl MIT not found, check for Heimdal
  1327. AC_CHECK_HEADER(gssapi.h,
  1328. [
  1329. dnl found
  1330. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal])
  1331. ],
  1332. [
  1333. dnl no header found, disabling GSS
  1334. want_gss=no
  1335. AC_MSG_WARN(disabling GSS-API support since no header files were found)
  1336. ]
  1337. )
  1338. else
  1339. dnl MIT found
  1340. AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos])
  1341. dnl check if we have a really old MIT Kerberos version (<= 1.2)
  1342. AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE])
  1343. AC_COMPILE_IFELSE([
  1344. AC_LANG_PROGRAM([[
  1345. #include <gssapi/gssapi.h>
  1346. #include <gssapi/gssapi_generic.h>
  1347. #include <gssapi/gssapi_krb5.h>
  1348. ]],[[
  1349. gss_import_name(
  1350. (OM_uint32 *)0,
  1351. (gss_buffer_t)0,
  1352. GSS_C_NT_HOSTBASED_SERVICE,
  1353. (gss_name_t *)0);
  1354. ]])
  1355. ],[
  1356. AC_MSG_RESULT([yes])
  1357. ],[
  1358. AC_MSG_RESULT([no])
  1359. AC_DEFINE(HAVE_OLD_GSSMIT, 1,
  1360. [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE])
  1361. ])
  1362. fi
  1363. ]
  1364. )
  1365. else
  1366. AC_MSG_RESULT(no)
  1367. fi
  1368. if test x"$want_gss" = xyes; then
  1369. AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries])
  1370. HAVE_GSSAPI=1
  1371. curl_gss_msg="enabled (MIT Kerberos/Heimdal)"
  1372. if test -n "$gnu_gss"; then
  1373. curl_gss_msg="enabled (GNU GSS)"
  1374. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1375. LIBS="-lgss $LIBS"
  1376. elif test -z "$GSSAPI_LIB_DIR"; then
  1377. case $host in
  1378. *-*-darwin*)
  1379. LIBS="-lgssapi_krb5 -lresolv $LIBS"
  1380. ;;
  1381. *)
  1382. if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
  1383. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1384. dnl into LIBS
  1385. gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
  1386. LIBS="$gss_libs $LIBS"
  1387. elif test -f "$KRB5CONFIG"; then
  1388. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1389. dnl into LIBS
  1390. gss_libs=`$KRB5CONFIG --libs gssapi`
  1391. LIBS="$gss_libs $LIBS"
  1392. else
  1393. case $host in
  1394. *-hp-hpux*)
  1395. gss_libname="gss"
  1396. ;;
  1397. *)
  1398. gss_libname="gssapi"
  1399. ;;
  1400. esac
  1401. if test "$GSSAPI_ROOT" != "yes"; then
  1402. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
  1403. LIBS="-l$gss_libname $LIBS"
  1404. else
  1405. LIBS="-l$gss_libname $LIBS"
  1406. fi
  1407. fi
  1408. ;;
  1409. esac
  1410. else
  1411. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1412. case $host in
  1413. *-hp-hpux*)
  1414. LIBS="-lgss $LIBS"
  1415. ;;
  1416. *)
  1417. LIBS="-lgssapi $LIBS"
  1418. ;;
  1419. esac
  1420. fi
  1421. else
  1422. CPPFLAGS="$save_CPPFLAGS"
  1423. fi
  1424. build_libstubgss=no
  1425. if test x"$want_gss" = "xyes"; then
  1426. build_libstubgss=yes
  1427. fi
  1428. AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes")
  1429. dnl -------------------------------------------------------------
  1430. dnl parse --with-default-ssl-backend so it can be validated below
  1431. dnl -------------------------------------------------------------
  1432. DEFAULT_SSL_BACKEND=no
  1433. VALID_DEFAULT_SSL_BACKEND=
  1434. AC_ARG_WITH(default-ssl-backend,
  1435. AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend])
  1436. AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]),
  1437. [DEFAULT_SSL_BACKEND=$withval])
  1438. case "$DEFAULT_SSL_BACKEND" in
  1439. no)
  1440. dnl --without-default-ssl-backend option used
  1441. ;;
  1442. default|yes)
  1443. dnl --with-default-ssl-backend option used without name
  1444. AC_MSG_ERROR([The name of the default SSL backend is required.])
  1445. ;;
  1446. *)
  1447. dnl --with-default-ssl-backend option used with name
  1448. AC_SUBST(DEFAULT_SSL_BACKEND)
  1449. dnl needs to be validated below
  1450. VALID_DEFAULT_SSL_BACKEND=no
  1451. ;;
  1452. esac
  1453. dnl **********************************************************************
  1454. dnl -------------------------------------------------
  1455. dnl check winssl option before other SSL libraries
  1456. dnl -------------------------------------------------
  1457. OPT_SCHANNEL=no
  1458. AC_ARG_WITH(winssl,dnl
  1459. AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
  1460. AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
  1461. OPT_SCHANNEL=$withval)
  1462. AC_ARG_WITH(schannel,dnl
  1463. AC_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS])
  1464. AC_HELP_STRING([--without-schannel], [disable Windows native SSL/TLS]),
  1465. OPT_SCHANNEL=$withval)
  1466. AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
  1467. if test -z "$ssl_backends" -o "x$OPT_SCHANNEL" != xno; then
  1468. ssl_msg=
  1469. if test "x$OPT_SCHANNEL" != "xno" &&
  1470. test "x$curl_cv_native_windows" = "xyes"; then
  1471. AC_MSG_RESULT(yes)
  1472. AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
  1473. AC_SUBST(USE_SCHANNEL, [1])
  1474. ssl_msg="Windows-native"
  1475. test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  1476. SCHANNEL_ENABLED=1
  1477. # --with-schannel implies --enable-sspi
  1478. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  1479. AC_SUBST(USE_WINDOWS_SSPI, [1])
  1480. curl_sspi_msg="enabled"
  1481. LIBS="-lcrypt32 $LIBS"
  1482. else
  1483. AC_MSG_RESULT(no)
  1484. fi
  1485. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  1486. else
  1487. AC_MSG_RESULT(no)
  1488. fi
  1489. OPT_SECURETRANSPORT=no
  1490. AC_ARG_WITH(darwinssl,dnl
  1491. AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS])
  1492. AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]),
  1493. OPT_SECURETRANSPORT=$withval)
  1494. AC_ARG_WITH(secure-transport,dnl
  1495. AC_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS])
  1496. AC_HELP_STRING([--without-secure-transport], [disable Apple OS native SSL/TLS]),
  1497. OPT_SECURETRANSPORT=$withval)
  1498. AC_MSG_CHECKING([whether to enable Secure Transport])
  1499. if test -z "$ssl_backends" -o "x$OPT_SECURETRANSPORT" != xno; then
  1500. if test "x$OPT_SECURETRANSPORT" != "xno" &&
  1501. (test "x$cross_compiling" != "xno" || test -d "/System/Library/Frameworks/Security.framework"); then
  1502. AC_MSG_RESULT(yes)
  1503. AC_DEFINE(USE_SECTRANSP, 1, [enable Secure Transport])
  1504. AC_SUBST(USE_SECTRANSP, [1])
  1505. ssl_msg="Secure Transport"
  1506. test secure-transport != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  1507. SECURETRANSPORT_ENABLED=1
  1508. LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
  1509. else
  1510. AC_MSG_RESULT(no)
  1511. fi
  1512. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  1513. else
  1514. AC_MSG_RESULT(no)
  1515. fi
  1516. OPT_AMISSL=no
  1517. AC_ARG_WITH(amissl,dnl
  1518. AC_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)])
  1519. AC_HELP_STRING([--without-amissl], [disable Amiga native SSL/TLS (AmiSSL)]),
  1520. OPT_AMISSL=$withval)
  1521. AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL)])
  1522. if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then
  1523. if test -z "$ssl_backends" -o "x$OPT_AMISSL" != xno; then
  1524. ssl_msg=
  1525. if test "x$OPT_AMISSL" != "xno"; then
  1526. AC_MSG_RESULT(yes)
  1527. ssl_msg="AmiSSL"
  1528. test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  1529. AMISSL_ENABLED=1
  1530. LIBS="-lamisslauto $LIBS"
  1531. AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use])
  1532. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])
  1533. else
  1534. AC_MSG_RESULT(no)
  1535. fi
  1536. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  1537. else
  1538. AC_MSG_RESULT(no)
  1539. fi
  1540. else
  1541. AC_MSG_RESULT(no)
  1542. fi
  1543. dnl **********************************************************************
  1544. dnl Check for the presence of SSL libraries and headers
  1545. dnl **********************************************************************
  1546. dnl Default to compiler & linker defaults for SSL files & libraries.
  1547. OPT_SSL=off
  1548. dnl Default to no CA bundle
  1549. ca="no"
  1550. AC_ARG_WITH(ssl,dnl
  1551. AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1552. AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
  1553. OPT_SSL=$withval)
  1554. if test -z "$ssl_backends" -o "x$OPT_SSL" != xno &&
  1555. test X"$OPT_SSL" != Xno; then
  1556. ssl_msg=
  1557. dnl backup the pre-ssl variables
  1558. CLEANLDFLAGS="$LDFLAGS"
  1559. CLEANCPPFLAGS="$CPPFLAGS"
  1560. CLEANLIBS="$LIBS"
  1561. dnl This is for Msys/Mingw
  1562. case $host in
  1563. *-*-msys* | *-*-mingw*)
  1564. AC_MSG_CHECKING([for gdi32])
  1565. my_ac_save_LIBS=$LIBS
  1566. LIBS="-lgdi32 $LIBS"
  1567. AC_TRY_LINK([#include <windef.h>
  1568. #include <wingdi.h>],
  1569. [GdiFlush();],
  1570. [ dnl worked!
  1571. AC_MSG_RESULT([yes])],
  1572. [ dnl failed, restore LIBS
  1573. LIBS=$my_ac_save_LIBS
  1574. AC_MSG_RESULT(no)]
  1575. )
  1576. ;;
  1577. esac
  1578. case "$OPT_SSL" in
  1579. yes)
  1580. dnl --with-ssl (without path) used
  1581. PKGTEST="yes"
  1582. PREFIX_OPENSSL=/usr/local/ssl
  1583. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1584. ;;
  1585. off)
  1586. dnl no --with-ssl option given, just check default places
  1587. PKGTEST="yes"
  1588. PREFIX_OPENSSL=
  1589. ;;
  1590. *)
  1591. dnl check the given --with-ssl spot
  1592. PKGTEST="no"
  1593. PREFIX_OPENSSL=$OPT_SSL
  1594. dnl Try pkg-config even when cross-compiling. Since we
  1595. dnl specify PKG_CONFIG_LIBDIR we're only looking where
  1596. dnl the user told us to look
  1597. OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
  1598. if test -f "$OPENSSL_PCDIR/openssl.pc"; then
  1599. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
  1600. PKGTEST="yes"
  1601. elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then
  1602. AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-ssl prefix!])
  1603. fi
  1604. dnl in case pkg-config comes up empty, use what we got
  1605. dnl via --with-ssl
  1606. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1607. if test "$PREFIX_OPENSSL" != "/usr" ; then
  1608. SSL_LDFLAGS="-L$LIB_OPENSSL"
  1609. SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
  1610. fi
  1611. SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
  1612. ;;
  1613. esac
  1614. if test "$PKGTEST" = "yes"; then
  1615. CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
  1616. if test "$PKGCONFIG" != "no" ; then
  1617. SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1618. $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null`
  1619. SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1620. $PKGCONFIG --libs-only-L openssl 2>/dev/null`
  1621. SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1622. $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
  1623. AC_SUBST(SSL_LIBS)
  1624. AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
  1625. AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
  1626. AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
  1627. LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/^-L//'`
  1628. dnl use the values pkg-config reported. This is here
  1629. dnl instead of below with CPPFLAGS and LDFLAGS because we only
  1630. dnl learn about this via pkg-config. If we only have
  1631. dnl the argument to --with-ssl we don't know what
  1632. dnl additional libs may be necessary. Hope that we
  1633. dnl don't need any.
  1634. LIBS="$SSL_LIBS $LIBS"
  1635. fi
  1636. fi
  1637. dnl finally, set flags to use SSL
  1638. CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
  1639. LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
  1640. AC_CHECK_LIB(crypto, HMAC_Update,[
  1641. HAVECRYPTO="yes"
  1642. LIBS="-lcrypto $LIBS"
  1643. ],[
  1644. LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
  1645. if test "$PKGCONFIG" = "no" ; then
  1646. # only set this if pkg-config wasn't used
  1647. CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
  1648. fi
  1649. # Linking previously failed, try extra paths from --with-ssl or pkg-config.
  1650. # Use a different function name to avoid reusing the earlier cached result.
  1651. AC_CHECK_LIB(crypto, HMAC_Init_ex,[
  1652. HAVECRYPTO="yes"
  1653. LIBS="-lcrypto $LIBS"], [
  1654. dnl still no, but what about with -ldl?
  1655. AC_MSG_CHECKING([OpenSSL linking with -ldl])
  1656. LIBS="$CLEANLIBS -lcrypto -ldl"
  1657. AC_TRY_LINK(
  1658. [
  1659. #include <openssl/err.h>
  1660. ],
  1661. [
  1662. ERR_clear_error();
  1663. ],
  1664. [
  1665. AC_MSG_RESULT(yes)
  1666. HAVECRYPTO="yes"
  1667. ],
  1668. [
  1669. AC_MSG_RESULT(no)
  1670. dnl ok, so what about both -ldl and -lpthread?
  1671. dnl This may be necessary for static libraries.
  1672. AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread])
  1673. LIBS="$CLEANLIBS -lcrypto -ldl -lpthread"
  1674. AC_TRY_LINK(
  1675. [
  1676. #include <openssl/err.h>
  1677. ],
  1678. [
  1679. ERR_clear_error();
  1680. ],
  1681. [
  1682. AC_MSG_RESULT(yes)
  1683. HAVECRYPTO="yes"
  1684. ],
  1685. [
  1686. AC_MSG_RESULT(no)
  1687. LDFLAGS="$CLEANLDFLAGS"
  1688. CPPFLAGS="$CLEANCPPFLAGS"
  1689. LIBS="$CLEANLIBS"
  1690. ])
  1691. ])
  1692. ])
  1693. ])
  1694. if test X"$HAVECRYPTO" = X"yes"; then
  1695. dnl This is only reasonable to do if crypto actually is there: check for
  1696. dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
  1697. AC_CHECK_LIB(ssl, SSL_connect)
  1698. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1699. dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
  1700. AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
  1701. OLIBS=$LIBS
  1702. LIBS="-lRSAglue -lrsaref $LIBS"
  1703. AC_CHECK_LIB(ssl, SSL_connect)
  1704. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1705. dnl still no SSL_connect
  1706. AC_MSG_RESULT(no)
  1707. LIBS=$OLIBS
  1708. else
  1709. AC_MSG_RESULT(yes)
  1710. fi
  1711. else
  1712. dnl Have the libraries--check for OpenSSL headers
  1713. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  1714. openssl/pem.h openssl/ssl.h openssl/err.h,
  1715. ssl_msg="OpenSSL"
  1716. test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  1717. OPENSSL_ENABLED=1
  1718. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
  1719. if test $ac_cv_header_openssl_x509_h = no; then
  1720. dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
  1721. dnl since 'err.h' might in fact find a krb4 header with the same
  1722. dnl name
  1723. AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
  1724. if test $ac_cv_header_x509_h = yes &&
  1725. test $ac_cv_header_crypto_h = yes &&
  1726. test $ac_cv_header_ssl_h = yes; then
  1727. dnl three matches
  1728. ssl_msg="OpenSSL"
  1729. OPENSSL_ENABLED=1
  1730. fi
  1731. fi
  1732. fi
  1733. if test X"$OPENSSL_ENABLED" != X"1"; then
  1734. LIBS="$CLEANLIBS"
  1735. fi
  1736. if test X"$OPT_SSL" != Xoff &&
  1737. test "$OPENSSL_ENABLED" != "1"; then
  1738. AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
  1739. fi
  1740. fi
  1741. if test X"$OPENSSL_ENABLED" = X"1"; then
  1742. dnl These can only exist if OpenSSL exists
  1743. dnl OpenSSL_version is introduced in 3.0.0
  1744. AC_CHECK_FUNCS( RAND_egd \
  1745. SSLv2_client_method \
  1746. OpenSSL_version )
  1747. AC_MSG_CHECKING([for BoringSSL])
  1748. AC_COMPILE_IFELSE([
  1749. AC_LANG_PROGRAM([[
  1750. #include <openssl/base.h>
  1751. ]],[[
  1752. #ifndef OPENSSL_IS_BORINGSSL
  1753. #error not boringssl
  1754. #endif
  1755. ]])
  1756. ],[
  1757. AC_MSG_RESULT([yes])
  1758. AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1,
  1759. [Define to 1 if using BoringSSL.])
  1760. ssl_msg="BoringSSL"
  1761. ],[
  1762. AC_MSG_RESULT([no])
  1763. ])
  1764. AC_MSG_CHECKING([for libressl])
  1765. AC_COMPILE_IFELSE([
  1766. AC_LANG_PROGRAM([[
  1767. #include <openssl/opensslv.h>
  1768. ]],[[
  1769. int dummy = LIBRESSL_VERSION_NUMBER;
  1770. ]])
  1771. ],[
  1772. AC_MSG_RESULT([yes])
  1773. AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1,
  1774. [Define to 1 if using libressl.])
  1775. ssl_msg="libressl"
  1776. ],[
  1777. AC_MSG_RESULT([no])
  1778. ])
  1779. AC_MSG_CHECKING([for OpenSSL >= v3])
  1780. AC_COMPILE_IFELSE([
  1781. AC_LANG_PROGRAM([[
  1782. #include <openssl/opensslv.h>
  1783. ]],[[
  1784. #if defined(OPENSSL_VERSION_MAJOR) && (OPENSSL_VERSION_MAJOR >= 3)
  1785. return 0;
  1786. #else
  1787. #error older than 3
  1788. #endif
  1789. ]])
  1790. ],[
  1791. AC_MSG_RESULT([yes])
  1792. AC_DEFINE_UNQUOTED(HAVE_OPENSSL3, 1,
  1793. [Define to 1 if using OpenSSL 3 or later.])
  1794. dnl OpenSSLv3 marks the DES functions deprecated but we have no
  1795. dnl replacements (yet) so tell the compiler to not warn for them
  1796. dnl
  1797. dnl Ask OpenSSL to suppress the warnings.
  1798. CPPFLAGS="$CPPFLAGS -DOPENSSL_SUPPRESS_DEPRECATED"
  1799. ssl_msg="OpenSSL v3+"
  1800. ],[
  1801. AC_MSG_RESULT([no])
  1802. ])
  1803. fi
  1804. if test "$OPENSSL_ENABLED" = "1"; then
  1805. if test -n "$LIB_OPENSSL"; then
  1806. dnl when the ssl shared libs were found in a path that the run-time
  1807. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  1808. dnl to prevent further configure tests to fail due to this
  1809. if test "x$cross_compiling" != "xyes"; then
  1810. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL"
  1811. export CURL_LIBRARY_PATH
  1812. AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH])
  1813. fi
  1814. fi
  1815. CURL_CHECK_OPENSSL_API
  1816. check_for_ca_bundle=1
  1817. fi
  1818. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  1819. fi
  1820. if test X"$OPT_SSL" != Xoff &&
  1821. test X"$OPT_SSL" != Xno &&
  1822. test "$OPENSSL_ENABLED" != "1"; then
  1823. AC_MSG_NOTICE([OPT_SSL: $OPT_SSL])
  1824. AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED])
  1825. AC_MSG_ERROR([--with-ssl was given but OpenSSL could not be detected])
  1826. fi
  1827. dnl **********************************************************************
  1828. dnl Check for the random seed preferences
  1829. dnl **********************************************************************
  1830. if test X"$OPENSSL_ENABLED" = X"1"; then
  1831. AC_ARG_WITH(egd-socket,
  1832. AC_HELP_STRING([--with-egd-socket=FILE],
  1833. [Entropy Gathering Daemon socket pathname]),
  1834. [ EGD_SOCKET="$withval" ]
  1835. )
  1836. if test -n "$EGD_SOCKET" ; then
  1837. AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
  1838. [your Entropy Gathering Daemon socket pathname] )
  1839. fi
  1840. dnl Check for user-specified random device
  1841. AC_ARG_WITH(random,
  1842. AC_HELP_STRING([--with-random=FILE],
  1843. [read randomness from FILE (default=/dev/urandom)]),
  1844. [ RANDOM_FILE="$withval" ],
  1845. [
  1846. if test x$cross_compiling != xyes; then
  1847. dnl Check for random device
  1848. AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
  1849. else
  1850. AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
  1851. fi
  1852. ]
  1853. )
  1854. if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
  1855. AC_SUBST(RANDOM_FILE)
  1856. AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
  1857. [a suitable file to read random data from])
  1858. fi
  1859. fi
  1860. dnl ---
  1861. dnl We require OpenSSL with SRP support.
  1862. dnl ---
  1863. if test "$OPENSSL_ENABLED" = "1"; then
  1864. AC_CHECK_LIB(crypto, SRP_Calc_client_key,
  1865. [
  1866. AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key])
  1867. AC_SUBST(HAVE_OPENSSL_SRP, [1])
  1868. ])
  1869. fi
  1870. dnl ---
  1871. dnl Whether the OpenSSL configuration will be loaded automatically
  1872. dnl ---
  1873. if test X"$OPENSSL_ENABLED" = X"1"; then
  1874. AC_ARG_ENABLE(openssl-auto-load-config,
  1875. AC_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration])
  1876. AC_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]),
  1877. [ if test X"$enableval" = X"no"; then
  1878. AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled])
  1879. AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically])
  1880. fi
  1881. ])
  1882. fi
  1883. dnl ----------------------------------------------------
  1884. dnl check for GnuTLS
  1885. dnl ----------------------------------------------------
  1886. dnl Default to compiler & linker defaults for GnuTLS files & libraries.
  1887. OPT_GNUTLS=no
  1888. AC_ARG_WITH(gnutls,dnl
  1889. AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
  1890. AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
  1891. OPT_GNUTLS=$withval)
  1892. if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then
  1893. ssl_msg=
  1894. if test X"$OPT_GNUTLS" != Xno; then
  1895. addld=""
  1896. addlib=""
  1897. gtlslib=""
  1898. version=""
  1899. addcflags=""
  1900. if test "x$OPT_GNUTLS" = "xyes"; then
  1901. dnl this is with no partiular path given
  1902. CURL_CHECK_PKGCONFIG(gnutls)
  1903. if test "$PKGCONFIG" != "no" ; then
  1904. addlib=`$PKGCONFIG --libs-only-l gnutls`
  1905. addld=`$PKGCONFIG --libs-only-L gnutls`
  1906. addcflags=`$PKGCONFIG --cflags-only-I gnutls`
  1907. version=`$PKGCONFIG --modversion gnutls`
  1908. gtlslib=`echo $addld | $SED -e 's/^-L//'`
  1909. else
  1910. dnl without pkg-config, we try libgnutls-config as that was how it
  1911. dnl used to be done
  1912. check=`libgnutls-config --version 2>/dev/null`
  1913. if test -n "$check"; then
  1914. addlib=`libgnutls-config --libs`
  1915. addcflags=`libgnutls-config --cflags`
  1916. version=`libgnutls-config --version`
  1917. gtlslib=`libgnutls-config --prefix`/lib$libsuff
  1918. fi
  1919. fi
  1920. else
  1921. dnl this is with a given path, first check if there's a libgnutls-config
  1922. dnl there and if not, make an educated guess
  1923. cfg=$OPT_GNUTLS/bin/libgnutls-config
  1924. check=`$cfg --version 2>/dev/null`
  1925. if test -n "$check"; then
  1926. addlib=`$cfg --libs`
  1927. addcflags=`$cfg --cflags`
  1928. version=`$cfg --version`
  1929. gtlslib=`$cfg --prefix`/lib$libsuff
  1930. else
  1931. dnl without pkg-config and libgnutls-config, we guess a lot!
  1932. addlib=-lgnutls
  1933. addld=-L$OPT_GNUTLS/lib$libsuff
  1934. addcflags=-I$OPT_GNUTLS/include
  1935. version="" # we just don't know
  1936. gtlslib=$OPT_GNUTLS/lib$libsuff
  1937. fi
  1938. fi
  1939. if test -z "$version"; then
  1940. dnl lots of efforts, still no go
  1941. version="unknown"
  1942. fi
  1943. if test -n "$addlib"; then
  1944. CLEANLIBS="$LIBS"
  1945. CLEANCPPFLAGS="$CPPFLAGS"
  1946. CLEANLDFLAGS="$LDFLAGS"
  1947. LIBS="$addlib $LIBS"
  1948. LDFLAGS="$LDFLAGS $addld"
  1949. if test "$addcflags" != "-I/usr/include"; then
  1950. CPPFLAGS="$CPPFLAGS $addcflags"
  1951. fi
  1952. dnl this function is selected since it was introduced in 3.1.10
  1953. AC_CHECK_LIB(gnutls, gnutls_x509_crt_get_dn2,
  1954. [
  1955. AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
  1956. AC_SUBST(USE_GNUTLS, [1])
  1957. GNUTLS_ENABLED=1
  1958. USE_GNUTLS="yes"
  1959. ssl_msg="GnuTLS"
  1960. test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  1961. ],
  1962. [
  1963. LIBS="$CLEANLIBS"
  1964. CPPFLAGS="$CLEANCPPFLAGS"
  1965. ])
  1966. if test "x$USE_GNUTLS" = "xyes"; then
  1967. AC_MSG_NOTICE([detected GnuTLS version $version])
  1968. check_for_ca_bundle=1
  1969. if test -n "$gtlslib"; then
  1970. dnl when shared libs were found in a path that the run-time
  1971. dnl linker doesn't search through, we need to add it to
  1972. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
  1973. dnl due to this
  1974. if test "x$cross_compiling" != "xyes"; then
  1975. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib"
  1976. export CURL_LIBRARY_PATH
  1977. AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH])
  1978. fi
  1979. fi
  1980. fi
  1981. fi
  1982. fi dnl GNUTLS not disabled
  1983. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  1984. fi
  1985. dnl ---
  1986. dnl Check which crypto backend GnuTLS uses
  1987. dnl ---
  1988. if test "$GNUTLS_ENABLED" = "1"; then
  1989. USE_GNUTLS_NETTLE=
  1990. # First check if we can detect either crypto library via transitive linking
  1991. AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
  1992. # If not, try linking directly to both of them to see if they are available
  1993. if test "$USE_GNUTLS_NETTLE" = ""; then
  1994. AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
  1995. fi
  1996. if test "$USE_GNUTLS_NETTLE" = ""; then
  1997. AC_MSG_ERROR([GnuTLS found, but nettle was not found])
  1998. fi
  1999. LIBS="-lnettle $LIBS"
  2000. fi
  2001. dnl ---
  2002. dnl We require GnuTLS with SRP support.
  2003. dnl ---
  2004. if test "$GNUTLS_ENABLED" = "1"; then
  2005. AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
  2006. [
  2007. AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
  2008. AC_SUBST(HAVE_GNUTLS_SRP, [1])
  2009. ])
  2010. fi
  2011. dnl ----------------------------------------------------
  2012. dnl check for mbedTLS
  2013. dnl ----------------------------------------------------
  2014. OPT_MBEDTLS=no
  2015. _cppflags=$CPPFLAGS
  2016. _ldflags=$LDFLAGS
  2017. AC_ARG_WITH(mbedtls,dnl
  2018. AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root])
  2019. AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]),
  2020. OPT_MBEDTLS=$withval)
  2021. if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then
  2022. ssl_msg=
  2023. if test X"$OPT_MBEDTLS" != Xno; then
  2024. if test "$OPT_MBEDTLS" = "yes"; then
  2025. OPT_MBEDTLS=""
  2026. fi
  2027. if test -z "$OPT_MBEDTLS" ; then
  2028. dnl check for lib first without setting any new path
  2029. AC_CHECK_LIB(mbedtls, mbedtls_havege_init,
  2030. dnl libmbedtls found, set the variable
  2031. [
  2032. AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
  2033. AC_SUBST(USE_MBEDTLS, [1])
  2034. MBEDTLS_ENABLED=1
  2035. USE_MBEDTLS="yes"
  2036. ssl_msg="mbedTLS"
  2037. test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2038. ], [], -lmbedx509 -lmbedcrypto)
  2039. fi
  2040. addld=""
  2041. addlib=""
  2042. addcflags=""
  2043. mbedtlslib=""
  2044. if test "x$USE_MBEDTLS" != "xyes"; then
  2045. dnl add the path and test again
  2046. addld=-L$OPT_MBEDTLS/lib$libsuff
  2047. addcflags=-I$OPT_MBEDTLS/include
  2048. mbedtlslib=$OPT_MBEDTLS/lib$libsuff
  2049. LDFLAGS="$LDFLAGS $addld"
  2050. if test "$addcflags" != "-I/usr/include"; then
  2051. CPPFLAGS="$CPPFLAGS $addcflags"
  2052. fi
  2053. AC_CHECK_LIB(mbedtls, mbedtls_ssl_init,
  2054. [
  2055. AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled])
  2056. AC_SUBST(USE_MBEDTLS, [1])
  2057. MBEDTLS_ENABLED=1
  2058. USE_MBEDTLS="yes"
  2059. ssl_msg="mbedTLS"
  2060. test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2061. ],
  2062. [
  2063. CPPFLAGS=$_cppflags
  2064. LDFLAGS=$_ldflags
  2065. ], -lmbedx509 -lmbedcrypto)
  2066. fi
  2067. if test "x$USE_MBEDTLS" = "xyes"; then
  2068. AC_MSG_NOTICE([detected mbedTLS])
  2069. check_for_ca_bundle=1
  2070. LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS"
  2071. if test -n "$mbedtlslib"; then
  2072. dnl when shared libs were found in a path that the run-time
  2073. dnl linker doesn't search through, we need to add it to
  2074. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
  2075. dnl due to this
  2076. if test "x$cross_compiling" != "xyes"; then
  2077. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib"
  2078. export CURL_LIBRARY_PATH
  2079. AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH])
  2080. fi
  2081. fi
  2082. fi
  2083. fi dnl mbedTLS not disabled
  2084. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  2085. fi
  2086. dnl ----------------------------------------------------
  2087. dnl check for wolfSSL
  2088. dnl ----------------------------------------------------
  2089. dnl Default to compiler & linker defaults for wolfSSL files & libraries.
  2090. OPT_WOLFSSL=no
  2091. _cppflags=$CPPFLAGS
  2092. _ldflags=$LDFLAGS
  2093. AC_ARG_WITH(wolfssl,dnl
  2094. AC_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)])
  2095. AC_HELP_STRING([--without-wolfssl], [disable WolfSSL detection]),
  2096. OPT_WOLFSSL=$withval)
  2097. case "$OPT_WOLFSSL" in
  2098. yes|no)
  2099. wolfpkg=""
  2100. ;;
  2101. *)
  2102. wolfpkg="$withval/lib/pkgconfig"
  2103. ;;
  2104. esac
  2105. if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then
  2106. ssl_msg=
  2107. if test X"$OPT_WOLFSSL" != Xno; then
  2108. if test "$OPT_WOLFSSL" = "yes"; then
  2109. OPT_WOLFSSL=""
  2110. fi
  2111. dnl try pkg-config magic
  2112. CURL_CHECK_PKGCONFIG(wolfssl, [$wolfpkg])
  2113. AC_MSG_NOTICE([Check dir $wolfpkg])
  2114. addld=""
  2115. addlib=""
  2116. addcflags=""
  2117. if test "$PKGCONFIG" != "no" ; then
  2118. addlib=`CURL_EXPORT_PCDIR([$wolfpkg])
  2119. $PKGCONFIG --libs-only-l wolfssl`
  2120. addld=`CURL_EXPORT_PCDIR([$wolfpkg])
  2121. $PKGCONFIG --libs-only-L wolfssl`
  2122. addcflags=`CURL_EXPORT_PCDIR([$wolfpkg])
  2123. $PKGCONFIG --cflags-only-I wolfssl`
  2124. version=`CURL_EXPORT_PCDIR([$wolfpkg])
  2125. $PKGCONFIG --modversion wolfssl`
  2126. wolfssllibpath=`echo $addld | $SED -e 's/^-L//'`
  2127. else
  2128. addlib=-lwolfssl
  2129. dnl use system defaults if user does not supply a path
  2130. if test -n "$OPT_WOLFSSL"; then
  2131. addld=-L$OPT_WOLFSSL/lib$libsuff
  2132. addcflags=-I$OPT_WOLFSSL/include
  2133. wolfssllibpath=$OPT_WOLFSSL/lib$libsuff
  2134. fi
  2135. fi
  2136. if test "x$USE_WOLFSSL" != "xyes"; then
  2137. LDFLAGS="$LDFLAGS $addld"
  2138. AC_MSG_NOTICE([Add $addld to LDFLAGS])
  2139. if test "$addcflags" != "-I/usr/include"; then
  2140. CPPFLAGS="$CPPFLAGS $addcflags"
  2141. AC_MSG_NOTICE([Add $addcflags to CPPFLAGS])
  2142. fi
  2143. my_ac_save_LIBS="$LIBS"
  2144. LIBS="$addlib $LIBS"
  2145. AC_MSG_NOTICE([Add $addlib to LIBS])
  2146. AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl])
  2147. AC_LINK_IFELSE([
  2148. AC_LANG_PROGRAM([[
  2149. /* These aren't needed for detection and confuse WolfSSL.
  2150. They are set up properly later if it is detected. */
  2151. #undef SIZEOF_LONG
  2152. #undef SIZEOF_LONG_LONG
  2153. #include <wolfssl/ssl.h>
  2154. ]],[[
  2155. return wolfSSL_Init();
  2156. ]])
  2157. ],[
  2158. AC_MSG_RESULT(yes)
  2159. AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled])
  2160. AC_SUBST(USE_WOLFSSL, [1])
  2161. WOLFSSL_ENABLED=1
  2162. USE_WOLFSSL="yes"
  2163. ssl_msg="WolfSSL"
  2164. test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2165. ],
  2166. [
  2167. AC_MSG_RESULT(no)
  2168. CPPFLAGS=$_cppflags
  2169. LDFLAGS=$_ldflags
  2170. wolfssllibpath=""
  2171. ])
  2172. LIBS="$my_ac_save_LIBS"
  2173. fi
  2174. if test "x$USE_WOLFSSL" = "xyes"; then
  2175. AC_MSG_NOTICE([detected wolfSSL])
  2176. check_for_ca_bundle=1
  2177. dnl wolfssl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined!
  2178. AX_COMPILE_CHECK_SIZEOF(long long)
  2179. LIBS="$addlib -lm $LIBS"
  2180. dnl Recent WolfSSL versions build without SSLv3 by default
  2181. dnl WolfSSL needs configure --enable-opensslextra to have *get_peer*
  2182. dnl DES* is needed for NTLM support and lives in the OpenSSL compatibility
  2183. dnl layer
  2184. AC_CHECK_FUNCS(wolfSSLv3_client_method \
  2185. wolfSSL_get_peer_certificate \
  2186. wolfSSL_UseALPN )
  2187. dnl if this symbol is present, we want the include path to include the
  2188. dnl OpenSSL API root as well
  2189. AC_CHECK_FUNC(wolfSSL_DES_ecb_encrypt,
  2190. [
  2191. AC_DEFINE(HAVE_WOLFSSL_DES_ECB_ENCRYPT, 1,
  2192. [if you have wolfSSL_DES_ecb_encrypt])
  2193. if test -n "$addcflags"; then
  2194. dnl use a for loop to strip off whitespace
  2195. for f in $addcflags; do
  2196. CPPFLAGS="$f/wolfssl $CPPFLAGS"
  2197. AC_MSG_NOTICE([Add $f/wolfssl to CPPFLAGS])
  2198. break
  2199. done
  2200. else
  2201. dnl user didn't give a path, so guess/hope they installed wolfssl
  2202. dnl headers to system default location
  2203. CPPFLAGS="-I$includedir/wolfssl $CPPFLAGS"
  2204. AC_MSG_NOTICE([Add $includedir/wolfssl to CPPFLAGS])
  2205. fi
  2206. WOLFSSL_NTLM=1
  2207. ]
  2208. )
  2209. if test -n "$wolfssllibpath"; then
  2210. dnl when shared libs were found in a path that the run-time
  2211. dnl linker doesn't search through, we need to add it to
  2212. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
  2213. dnl due to this
  2214. if test "x$cross_compiling" != "xyes"; then
  2215. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$wolfssllibpath"
  2216. export CURL_LIBRARY_PATH
  2217. AC_MSG_NOTICE([Added $wolfssllibpath to CURL_LIBRARY_PATH])
  2218. fi
  2219. fi
  2220. fi
  2221. fi dnl wolfSSL not disabled
  2222. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  2223. fi
  2224. dnl ----------------------------------------------------
  2225. dnl check for MesaLink
  2226. dnl ----------------------------------------------------
  2227. dnl Default to compiler & linker defaults for MesaLink files & libraries.
  2228. OPT_MESALINK=no
  2229. _cppflags=$CPPFLAGS
  2230. _ldflags=$LDFLAGS
  2231. AC_ARG_WITH(mesalink,dnl
  2232. AC_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root])
  2233. AC_HELP_STRING([--without-mesalink], [disable MesaLink detection]),
  2234. OPT_MESALINK=$withval)
  2235. if test -z "$ssl_backends" -o "x$OPT_MESALINK" != xno; then
  2236. ssl_msg=
  2237. if test X"$OPT_MESALINK" != Xno; then
  2238. if test "$OPT_MESALINK" = "yes"; then
  2239. OPT_MESALINK=""
  2240. fi
  2241. if test -z "$OPT_MESALINK" ; then
  2242. dnl check for lib first without setting any new path
  2243. AC_CHECK_LIB(mesalink, mesalink_library_init,
  2244. dnl libmesalink found, set the variable
  2245. [
  2246. AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
  2247. AC_SUBST(USE_MESALINK, [1])
  2248. MESALINK_ENABLED=1
  2249. USE_MESALINK="yes"
  2250. ssl_msg="MesaLink"
  2251. test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2252. ])
  2253. fi
  2254. addld=""
  2255. addlib=""
  2256. addcflags=""
  2257. mesalinklib=""
  2258. if test "x$USE_MESALINK" != "xyes"; then
  2259. dnl add the path and test again
  2260. addld=-L$OPT_MESALINK/lib$libsuff
  2261. addcflags=-I$OPT_MESALINK/include
  2262. mesalinklib=$OPT_MESALINK/lib$libsuff
  2263. LDFLAGS="$LDFLAGS $addld"
  2264. if test "$addcflags" != "-I/usr/include"; then
  2265. CPPFLAGS="$CPPFLAGS $addcflags"
  2266. fi
  2267. AC_CHECK_LIB(mesalink, mesalink_library_init,
  2268. [
  2269. AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled])
  2270. AC_SUBST(USE_MESALINK, [1])
  2271. MESALINK_ENABLED=1
  2272. USE_MESALINK="yes"
  2273. ssl_msg="MesaLink"
  2274. test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2275. ],
  2276. [
  2277. CPPFLAGS=$_cppflags
  2278. LDFLAGS=$_ldflags
  2279. ])
  2280. fi
  2281. if test "x$USE_MESALINK" = "xyes"; then
  2282. AC_MSG_NOTICE([detected MesaLink])
  2283. LIBS="-lmesalink $LIBS"
  2284. if test -n "$mesalinklib"; then
  2285. dnl when shared libs were found in a path that the run-time
  2286. dnl linker doesn't search through, we need to add it to
  2287. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  2288. dnl due to this
  2289. if test "x$cross_compiling" != "xyes"; then
  2290. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mesalinklib"
  2291. export LD_LIBRARY_PATH
  2292. AC_MSG_NOTICE([Added $mesalinklib to LD_LIBRARY_PATH])
  2293. fi
  2294. fi
  2295. fi
  2296. fi dnl MesaLink not disabled
  2297. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  2298. fi
  2299. dnl ----------------------------------------------------
  2300. dnl check for BearSSL
  2301. dnl ----------------------------------------------------
  2302. OPT_BEARSSL=no
  2303. _cppflags=$CPPFLAGS
  2304. _ldflags=$LDFLAGS
  2305. AC_ARG_WITH(bearssl,dnl
  2306. AC_HELP_STRING([--with-bearssl=PATH],[where to look for BearSSL, PATH points to the installation root])
  2307. AC_HELP_STRING([--without-bearssl], [disable BearSSL detection]),
  2308. OPT_BEARSSL=$withval)
  2309. if test -z "$ssl_backends" -o "x$OPT_BEARSSL" != xno; then
  2310. ssl_msg=
  2311. if test X"$OPT_BEARSSL" != Xno; then
  2312. if test "$OPT_BEARSSL" = "yes"; then
  2313. OPT_BEARSSL=""
  2314. fi
  2315. if test -z "$OPT_BEARSSL" ; then
  2316. dnl check for lib first without setting any new path
  2317. AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
  2318. dnl libbearssl found, set the variable
  2319. [
  2320. AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
  2321. AC_SUBST(USE_BEARSSL, [1])
  2322. BEARSSL_ENABLED=1
  2323. USE_BEARSSL="yes"
  2324. ssl_msg="BearSSL"
  2325. test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2326. ], [], -lbearssl)
  2327. fi
  2328. addld=""
  2329. addlib=""
  2330. addcflags=""
  2331. bearssllib=""
  2332. if test "x$USE_BEARSSL" != "xyes"; then
  2333. dnl add the path and test again
  2334. addld=-L$OPT_BEARSSL/lib$libsuff
  2335. addcflags=-I$OPT_BEARSSL/include
  2336. bearssllib=$OPT_BEARSSL/lib$libsuff
  2337. LDFLAGS="$LDFLAGS $addld"
  2338. if test "$addcflags" != "-I/usr/include"; then
  2339. CPPFLAGS="$CPPFLAGS $addcflags"
  2340. fi
  2341. AC_CHECK_LIB(bearssl, br_ssl_client_init_full,
  2342. [
  2343. AC_DEFINE(USE_BEARSSL, 1, [if BearSSL is enabled])
  2344. AC_SUBST(USE_BEARSSL, [1])
  2345. BEARSSL_ENABLED=1
  2346. USE_BEARSSL="yes"
  2347. ssl_msg="BearSSL"
  2348. test bearssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2349. ],
  2350. [
  2351. CPPFLAGS=$_cppflags
  2352. LDFLAGS=$_ldflags
  2353. ], -lbearssl)
  2354. fi
  2355. if test "x$USE_BEARSSL" = "xyes"; then
  2356. AC_MSG_NOTICE([detected BearSSL])
  2357. check_for_ca_bundle=1
  2358. LIBS="-lbearssl $LIBS"
  2359. if test -n "$bearssllib"; then
  2360. dnl when shared libs were found in a path that the run-time
  2361. dnl linker doesn't search through, we need to add it to
  2362. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
  2363. dnl due to this
  2364. if test "x$cross_compiling" != "xyes"; then
  2365. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$bearssllib"
  2366. export CURL_LIBRARY_PATH
  2367. AC_MSG_NOTICE([Added $bearssllib to CURL_LIBRARY_PATH])
  2368. fi
  2369. fi
  2370. fi
  2371. fi dnl BearSSL not disabled
  2372. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  2373. fi
  2374. dnl ----------------------------------------------------
  2375. dnl check for rustls
  2376. dnl ----------------------------------------------------
  2377. OPT_RUSTLS=no
  2378. _cppflags=$CPPFLAGS
  2379. _ldflags=$LDFLAGS
  2380. AC_ARG_WITH(rustls,dnl
  2381. AC_HELP_STRING([--with-rustls=PATH],[where to look for rustls, PATH points to the installation root])
  2382. AC_HELP_STRING([--without-rustls], [disable rustls detection]),
  2383. OPT_RUSTLS=$withval)
  2384. if test -z "$ssl_backends" -o "x$OPT_RUSTLS" != xno; then
  2385. ssl_msg=
  2386. if test X"$OPT_RUSTLS" != Xno; then
  2387. if test "$OPT_RUSTLS" = "yes"; then
  2388. OPT_RUSTLS=""
  2389. fi
  2390. if test -z "$OPT_RUSTLS" ; then
  2391. dnl check for lib first without setting any new path
  2392. AC_CHECK_LIB(crustls, rustls_client_session_read,
  2393. dnl libcrustls found, set the variable
  2394. [
  2395. AC_DEFINE(USE_RUSTLS, 1, [if rustls is enabled])
  2396. AC_SUBST(USE_RUSTLS, [1])
  2397. RUSTLS_ENABLED=1
  2398. USE_RUSTLS="yes"
  2399. ssl_msg="rustls"
  2400. test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2401. ], [], -lpthread -ldl)
  2402. fi
  2403. addld=""
  2404. addlib="-lpthread"
  2405. addcflags=""
  2406. bearssllib=""
  2407. if test "x$USE_RUSTLS" != "xyes"; then
  2408. dnl add the path and test again
  2409. addld=-L$OPT_RUSTLS/lib$libsuff
  2410. addcflags=-I$OPT_RUSTLS/include
  2411. rustlslib=$OPT_RUSTLS/lib$libsuff
  2412. LDFLAGS="$LDFLAGS $addld"
  2413. if test "$addcflags" != "-I/usr/include"; then
  2414. CPPFLAGS="$CPPFLAGS $addcflags"
  2415. fi
  2416. AC_CHECK_LIB(crustls, rustls_client_session_read,
  2417. [
  2418. AC_DEFINE(USE_RUSTLS, 1, [if rustls is enabled])
  2419. AC_SUBST(USE_RUSTLS, [1])
  2420. RUSTLS_ENABLED=1
  2421. USE_RUSTLS="yes"
  2422. ssl_msg="rustls"
  2423. test rustls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2424. ],
  2425. [
  2426. CPPFLAGS=$_cppflags
  2427. LDFLAGS=$_ldflags
  2428. ], -lpthread -ldl)
  2429. fi
  2430. if test "x$USE_RUSTLS" = "xyes"; then
  2431. AC_MSG_NOTICE([detected rustls])
  2432. check_for_ca_bundle=1
  2433. LIBS="-lcrustls -lpthread -ldl $LIBS"
  2434. if test -n "$rustlslib"; then
  2435. dnl when shared libs were found in a path that the run-time
  2436. dnl linker doesn't search through, we need to add it to
  2437. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
  2438. dnl due to this
  2439. if test "x$cross_compiling" != "xyes"; then
  2440. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$rustlslib"
  2441. export CURL_LIBRARY_PATH
  2442. AC_MSG_NOTICE([Added $rustlslib to CURL_LIBRARY_PATH])
  2443. fi
  2444. fi
  2445. fi
  2446. fi dnl rustls not disabled
  2447. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  2448. fi
  2449. dnl ----------------------------------------------------
  2450. dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
  2451. dnl ----------------------------------------------------
  2452. dnl Default to compiler & linker defaults for NSS files & libraries.
  2453. OPT_NSS=no
  2454. AC_ARG_WITH(nss,dnl
  2455. AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
  2456. AC_HELP_STRING([--without-nss], [disable NSS detection]),
  2457. OPT_NSS=$withval)
  2458. if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then
  2459. ssl_msg=
  2460. if test X"$OPT_NSS" != Xno; then
  2461. addld=""
  2462. addlib=""
  2463. addcflags=""
  2464. nssprefix=""
  2465. version=""
  2466. if test "x$OPT_NSS" = "xyes"; then
  2467. CURL_CHECK_PKGCONFIG(nss)
  2468. if test "$PKGCONFIG" != "no" ; then
  2469. addlib=`$PKGCONFIG --libs nss`
  2470. addcflags=`$PKGCONFIG --cflags nss`
  2471. version=`$PKGCONFIG --modversion nss`
  2472. nssprefix=`$PKGCONFIG --variable=prefix nss`
  2473. else
  2474. dnl Without pkg-config, we check for nss-config
  2475. check=`nss-config --version 2>/dev/null`
  2476. if test -n "$check"; then
  2477. addlib=`nss-config --libs`
  2478. addcflags=`nss-config --cflags`
  2479. version=`nss-config --version`
  2480. nssprefix=`nss-config --prefix`
  2481. else
  2482. addlib="-lnss3"
  2483. addcflags=""
  2484. version="unknown"
  2485. fi
  2486. fi
  2487. else
  2488. NSS_PCDIR="$OPT_NSS/lib/pkgconfig"
  2489. if test -f "$NSS_PCDIR/nss.pc"; then
  2490. CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR])
  2491. if test "$PKGCONFIG" != "no" ; then
  2492. addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss`
  2493. addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss`
  2494. addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss`
  2495. version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss`
  2496. nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss`
  2497. fi
  2498. fi
  2499. fi
  2500. if test -z "$addlib"; then
  2501. # Without pkg-config, we'll kludge in some defaults
  2502. AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.])
  2503. addld="-L$OPT_NSS/lib"
  2504. addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4"
  2505. addcflags="-I$OPT_NSS/include"
  2506. version="unknown"
  2507. nssprefix=$OPT_NSS
  2508. fi
  2509. CLEANLDFLAGS="$LDFLAGS"
  2510. CLEANLIBS="$LIBS"
  2511. CLEANCPPFLAGS="$CPPFLAGS"
  2512. LDFLAGS="$addld $LDFLAGS"
  2513. LIBS="$addlib $LIBS"
  2514. if test "$addcflags" != "-I/usr/include"; then
  2515. CPPFLAGS="$CPPFLAGS $addcflags"
  2516. fi
  2517. dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0
  2518. AC_CHECK_LIB(nss3, SSL_VersionRangeSet,
  2519. [
  2520. AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
  2521. AC_SUBST(USE_NSS, [1])
  2522. USE_NSS="yes"
  2523. NSS_ENABLED=1
  2524. ssl_msg="NSS"
  2525. test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes
  2526. ],
  2527. [
  2528. LDFLAGS="$CLEANLDFLAGS"
  2529. LIBS="$CLEANLIBS"
  2530. CPPFLAGS="$CLEANCPPFLAGS"
  2531. ])
  2532. if test "x$USE_NSS" = "xyes"; then
  2533. AC_MSG_NOTICE([detected NSS version $version])
  2534. dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because
  2535. dnl PK11_DestroyGenericObject() does not release resources allocated by
  2536. dnl PK11_CreateGenericObject() early enough.
  2537. AC_CHECK_FUNC(PK11_CreateManagedGenericObject,
  2538. [
  2539. AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1,
  2540. [if you have the PK11_CreateManagedGenericObject function])
  2541. ])
  2542. dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS
  2543. NSS_LIBS=$addlib
  2544. AC_SUBST([NSS_LIBS])
  2545. dnl when shared libs were found in a path that the run-time
  2546. dnl linker doesn't search through, we need to add it to
  2547. dnl CURL_LIBRARY_PATH to prevent further configure tests to fail
  2548. dnl due to this
  2549. if test "x$cross_compiling" != "xyes"; then
  2550. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$nssprefix/lib$libsuff"
  2551. export CURL_LIBRARY_PATH
  2552. AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to CURL_LIBRARY_PATH])
  2553. fi
  2554. fi dnl NSS found
  2555. fi dnl NSS not disabled
  2556. test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg"
  2557. fi
  2558. case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$SECURETRANSPORT_ENABLED$MESALINK_ENABLED$BEARSSL_ENABLED$AMISSL_ENABLED$RUSTLS_ENABLED"
  2559. in
  2560. x)
  2561. AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
  2562. AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-mesalink, --with-amissl or --with-bearssl to address this.])
  2563. ;;
  2564. x1)
  2565. # one SSL backend is enabled
  2566. AC_SUBST(SSL_ENABLED)
  2567. SSL_ENABLED="1"
  2568. AC_MSG_NOTICE([built with one SSL backend])
  2569. ;;
  2570. *)
  2571. # more than one SSL backend is enabled
  2572. AC_SUBST(SSL_ENABLED)
  2573. SSL_ENABLED="1"
  2574. AC_SUBST(CURL_WITH_MULTI_SSL)
  2575. CURL_WITH_MULTI_SSL="1"
  2576. AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends])
  2577. AC_MSG_NOTICE([built with multiple SSL backends])
  2578. ;;
  2579. esac
  2580. if test -n "$ssl_backends"; then
  2581. curl_ssl_msg="enabled ($ssl_backends)"
  2582. fi
  2583. if test no = "$VALID_DEFAULT_SSL_BACKEND"
  2584. then
  2585. if test -n "$SSL_ENABLED"
  2586. then
  2587. AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!])
  2588. else
  2589. AC_MSG_ERROR([Default SSL backend requires SSL!])
  2590. fi
  2591. elif test yes = "$VALID_DEFAULT_SSL_BACKEND"
  2592. then
  2593. AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend])
  2594. fi
  2595. dnl **********************************************************************
  2596. dnl Check for the CA bundle
  2597. dnl **********************************************************************
  2598. if test -n "$check_for_ca_bundle"; then
  2599. CURL_CHECK_CA_BUNDLE
  2600. fi
  2601. dnl **********************************************************************
  2602. dnl Check for libpsl
  2603. dnl **********************************************************************
  2604. AC_ARG_WITH(libpsl,
  2605. AS_HELP_STRING([--without-libpsl],
  2606. [disable support for libpsl cookie checking]),
  2607. with_libpsl=$withval,
  2608. with_libpsl=yes)
  2609. if test $with_libpsl != "no"; then
  2610. AC_SEARCH_LIBS(psl_builtin, psl,
  2611. [curl_psl_msg="enabled";
  2612. AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled])
  2613. ],
  2614. [curl_psl_msg="no (libpsl not found)";
  2615. AC_MSG_WARN([libpsl was not found])
  2616. ]
  2617. )
  2618. fi
  2619. AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
  2620. dnl **********************************************************************
  2621. dnl Check for libgsasl
  2622. dnl **********************************************************************
  2623. AC_ARG_WITH(libgsasl,
  2624. AS_HELP_STRING([--without-libgsasl],
  2625. [disable libgsasl support for SCRAM]),
  2626. with_libgsasl=$withval,
  2627. with_libgsasl=yes)
  2628. if test $with_libgsasl != "no"; then
  2629. AC_SEARCH_LIBS(gsasl_init, gsasl,
  2630. [curl_gsasl_msg="enabled";
  2631. AC_DEFINE([USE_GSASL], [1], [GSASL support enabled])
  2632. ],
  2633. [curl_gsasl_msg="no (libgsasl not found)";
  2634. AC_MSG_WARN([libgsasl was not found])
  2635. ]
  2636. )
  2637. fi
  2638. AM_CONDITIONAL([USE_GSASL], [test "$curl_gsasl_msg" = "enabled"])
  2639. dnl **********************************************************************
  2640. dnl Check for libmetalink
  2641. dnl **********************************************************************
  2642. OPT_LIBMETALINK=no
  2643. AC_ARG_WITH(libmetalink,dnl
  2644. AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
  2645. AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
  2646. OPT_LIBMETALINK=$withval)
  2647. if test X"$OPT_LIBMETALINK" != Xno; then
  2648. addld=""
  2649. addlib=""
  2650. addcflags=""
  2651. version=""
  2652. libmetalinklib=""
  2653. PKGTEST="no"
  2654. if test "x$OPT_LIBMETALINK" = "xyes"; then
  2655. dnl this is with no partiular path given
  2656. PKGTEST="yes"
  2657. CURL_CHECK_PKGCONFIG(libmetalink)
  2658. else
  2659. dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
  2660. LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
  2661. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
  2662. if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
  2663. PKGTEST="yes"
  2664. fi
  2665. if test "$PKGTEST" = "yes"; then
  2666. CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
  2667. fi
  2668. fi
  2669. if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
  2670. addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2671. $PKGCONFIG --libs-only-l libmetalink`
  2672. addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2673. $PKGCONFIG --libs-only-L libmetalink`
  2674. addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2675. $PKGCONFIG --cflags-only-I libmetalink`
  2676. version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2677. $PKGCONFIG --modversion libmetalink`
  2678. libmetalinklib=`echo $addld | $SED -e 's/^-L//'`
  2679. fi
  2680. if test -n "$addlib"; then
  2681. clean_CPPFLAGS="$CPPFLAGS"
  2682. clean_LDFLAGS="$LDFLAGS"
  2683. clean_LIBS="$LIBS"
  2684. CPPFLAGS="$clean_CPPFLAGS $addcflags"
  2685. LDFLAGS="$clean_LDFLAGS $addld"
  2686. LIBS="$addlib $clean_LIBS"
  2687. AC_MSG_CHECKING([if libmetalink is recent enough])
  2688. AC_LINK_IFELSE([
  2689. AC_LANG_PROGRAM([[
  2690. # include <metalink/metalink.h>
  2691. ]],[[
  2692. if(0 != metalink_strerror(0)) /* added in 0.1.0 */
  2693. return 1;
  2694. ]])
  2695. ],[
  2696. AC_MSG_RESULT([yes ($version)])
  2697. want_metalink="yes"
  2698. ],[
  2699. AC_MSG_RESULT([no ($version)])
  2700. AC_MSG_NOTICE([libmetalink library defective or too old])
  2701. want_metalink="no"
  2702. ])
  2703. if test "x$OPENSSL_ENABLED" != "x1" -a "x$USE_WINDOWS_SSPI" != "x1" \
  2704. -a "x$GNUTLS_ENABLED" != "x1" -a "x$NSS_ENABLED" != "x1" \
  2705. -a "x$SECURETRANSPORT_ENABLED" != "x1"; then
  2706. AC_MSG_WARN([metalink support requires a compatible SSL/TLS backend])
  2707. want_metalink="no"
  2708. fi
  2709. CPPFLAGS="$clean_CPPFLAGS"
  2710. LDFLAGS="$clean_LDFLAGS"
  2711. LIBS="$clean_LIBS"
  2712. if test "$want_metalink" = "yes"; then
  2713. dnl finally libmetalink will be used
  2714. AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
  2715. LIBMETALINK_LIBS=$addlib
  2716. LIBMETALINK_LDFLAGS=$addld
  2717. LIBMETALINK_CPPFLAGS=$addcflags
  2718. AC_SUBST([LIBMETALINK_LIBS])
  2719. AC_SUBST([LIBMETALINK_LDFLAGS])
  2720. AC_SUBST([LIBMETALINK_CPPFLAGS])
  2721. curl_mtlnk_msg="enabled"
  2722. fi
  2723. fi
  2724. fi
  2725. dnl **********************************************************************
  2726. dnl Check for the presence of LIBSSH2 libraries and headers
  2727. dnl **********************************************************************
  2728. dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
  2729. OPT_LIBSSH2=off
  2730. AC_ARG_WITH(libssh2,dnl
  2731. AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2732. AC_HELP_STRING([--with-libssh2], [enable libssh2]),
  2733. OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
  2734. OPT_LIBSSH=off
  2735. AC_ARG_WITH(libssh,dnl
  2736. AC_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2737. AC_HELP_STRING([--with-libssh], [enable libssh]),
  2738. OPT_LIBSSH=$withval, OPT_LIBSSH=no)
  2739. OPT_WOLFSSH=off
  2740. AC_ARG_WITH(wolfssh,dnl
  2741. AC_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2742. AC_HELP_STRING([--with-wolfssh], [enable wolfssh]),
  2743. OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)
  2744. if test X"$OPT_LIBSSH2" != Xno; then
  2745. dnl backup the pre-libssh2 variables
  2746. CLEANLDFLAGS="$LDFLAGS"
  2747. CLEANCPPFLAGS="$CPPFLAGS"
  2748. CLEANLIBS="$LIBS"
  2749. case "$OPT_LIBSSH2" in
  2750. yes)
  2751. dnl --with-libssh2 (without path) used
  2752. CURL_CHECK_PKGCONFIG(libssh2)
  2753. if test "$PKGCONFIG" != "no" ; then
  2754. LIB_SSH2=`$PKGCONFIG --libs libssh2`
  2755. LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
  2756. CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
  2757. version=`$PKGCONFIG --modversion libssh2`
  2758. DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/^-L//'`
  2759. fi
  2760. ;;
  2761. off)
  2762. dnl no --with-libssh2 option given, just check default places
  2763. ;;
  2764. *)
  2765. dnl use the given --with-libssh2 spot
  2766. PREFIX_SSH2=$OPT_LIBSSH2
  2767. ;;
  2768. esac
  2769. dnl if given with a prefix, we set -L and -I based on that
  2770. if test -n "$PREFIX_SSH2"; then
  2771. LIB_SSH2="-lssh2"
  2772. LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
  2773. CPP_SSH2=-I${PREFIX_SSH2}/include
  2774. DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
  2775. fi
  2776. LDFLAGS="$LDFLAGS $LD_SSH2"
  2777. CPPFLAGS="$CPPFLAGS $CPP_SSH2"
  2778. LIBS="$LIB_SSH2 $LIBS"
  2779. dnl check for function added in libssh2 version 1.0
  2780. AC_CHECK_LIB(ssh2, libssh2_session_block_directions)
  2781. AC_CHECK_HEADERS(libssh2.h,
  2782. curl_ssh_msg="enabled (libSSH2)"
  2783. LIBSSH2_ENABLED=1
  2784. AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
  2785. AC_SUBST(USE_LIBSSH2, [1])
  2786. )
  2787. if test X"$OPT_LIBSSH2" != Xoff &&
  2788. test "$LIBSSH2_ENABLED" != "1"; then
  2789. AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
  2790. fi
  2791. if test "$LIBSSH2_ENABLED" = "1"; then
  2792. if test -n "$DIR_SSH2"; then
  2793. dnl when the libssh2 shared libs were found in a path that the run-time
  2794. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  2795. dnl to prevent further configure tests to fail due to this
  2796. if test "x$cross_compiling" != "xyes"; then
  2797. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2"
  2798. export CURL_LIBRARY_PATH
  2799. AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH])
  2800. fi
  2801. fi
  2802. else
  2803. dnl no libssh2, revert back to clean variables
  2804. LDFLAGS=$CLEANLDFLAGS
  2805. CPPFLAGS=$CLEANCPPFLAGS
  2806. LIBS=$CLEANLIBS
  2807. fi
  2808. elif test X"$OPT_LIBSSH" != Xno; then
  2809. dnl backup the pre-libssh variables
  2810. CLEANLDFLAGS="$LDFLAGS"
  2811. CLEANCPPFLAGS="$CPPFLAGS"
  2812. CLEANLIBS="$LIBS"
  2813. case "$OPT_LIBSSH" in
  2814. yes)
  2815. dnl --with-libssh (without path) used
  2816. CURL_CHECK_PKGCONFIG(libssh)
  2817. if test "$PKGCONFIG" != "no" ; then
  2818. LIB_SSH=`$PKGCONFIG --libs-only-l libssh`
  2819. LD_SSH=`$PKGCONFIG --libs-only-L libssh`
  2820. CPP_SSH=`$PKGCONFIG --cflags-only-I libssh`
  2821. version=`$PKGCONFIG --modversion libssh`
  2822. DIR_SSH=`echo $LD_SSH | $SED -e 's/^-L//'`
  2823. fi
  2824. ;;
  2825. off)
  2826. dnl no --with-libssh option given, just check default places
  2827. ;;
  2828. *)
  2829. dnl use the given --with-libssh spot
  2830. PREFIX_SSH=$OPT_LIBSSH
  2831. ;;
  2832. esac
  2833. dnl if given with a prefix, we set -L and -I based on that
  2834. if test -n "$PREFIX_SSH"; then
  2835. LIB_SSH="-lssh"
  2836. LD_SSH=-L${PREFIX_SSH}/lib$libsuff
  2837. CPP_SSH=-I${PREFIX_SSH}/include
  2838. DIR_SSH=${PREFIX_SSH}/lib$libsuff
  2839. fi
  2840. LDFLAGS="$LDFLAGS $LD_SSH"
  2841. CPPFLAGS="$CPPFLAGS $CPP_SSH"
  2842. LIBS="$LIB_SSH $LIBS"
  2843. AC_CHECK_LIB(ssh, ssh_new)
  2844. AC_CHECK_HEADERS(libssh/libssh.h,
  2845. curl_ssh_msg="enabled (libSSH)"
  2846. LIBSSH_ENABLED=1
  2847. AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use])
  2848. AC_SUBST(USE_LIBSSH, [1])
  2849. )
  2850. if test X"$OPT_LIBSSH" != Xoff &&
  2851. test "$LIBSSH_ENABLED" != "1"; then
  2852. AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!])
  2853. fi
  2854. if test "$LIBSSH_ENABLED" = "1"; then
  2855. if test -n "$DIR_SSH"; then
  2856. dnl when the libssh shared libs were found in a path that the run-time
  2857. dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH
  2858. dnl to prevent further configure tests to fail due to this
  2859. if test "x$cross_compiling" != "xyes"; then
  2860. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH"
  2861. export CURL_LIBRARY_PATH
  2862. AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH])
  2863. fi
  2864. fi
  2865. else
  2866. dnl no libssh, revert back to clean variables
  2867. LDFLAGS=$CLEANLDFLAGS
  2868. CPPFLAGS=$CLEANCPPFLAGS
  2869. LIBS=$CLEANLIBS
  2870. fi
  2871. elif test X"$OPT_WOLFSSH" != Xno; then
  2872. dnl backup the pre-wolfssh variables
  2873. CLEANLDFLAGS="$LDFLAGS"
  2874. CLEANCPPFLAGS="$CPPFLAGS"
  2875. CLEANLIBS="$LIBS"
  2876. if test "$OPT_WOLFSSH" != yes; then
  2877. WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
  2878. LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
  2879. CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
  2880. fi
  2881. AC_CHECK_LIB(wolfssh, wolfSSH_Init)
  2882. AC_CHECK_HEADERS(wolfssh/ssh.h,
  2883. curl_ssh_msg="enabled (wolfSSH)"
  2884. WOLFSSH_ENABLED=1
  2885. AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
  2886. AC_SUBST(USE_WOLFSSH, [1])
  2887. )
  2888. fi
  2889. dnl **********************************************************************
  2890. dnl Check for the presence of LIBRTMP libraries and headers
  2891. dnl **********************************************************************
  2892. dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
  2893. OPT_LIBRTMP=off
  2894. AC_ARG_WITH(librtmp,dnl
  2895. AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2896. AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
  2897. OPT_LIBRTMP=$withval)
  2898. if test X"$OPT_LIBRTMP" != Xno; then
  2899. dnl backup the pre-librtmp variables
  2900. CLEANLDFLAGS="$LDFLAGS"
  2901. CLEANCPPFLAGS="$CPPFLAGS"
  2902. CLEANLIBS="$LIBS"
  2903. case "$OPT_LIBRTMP" in
  2904. yes)
  2905. dnl --with-librtmp (without path) used
  2906. CURL_CHECK_PKGCONFIG(librtmp)
  2907. if test "$PKGCONFIG" != "no" ; then
  2908. LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
  2909. LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
  2910. CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
  2911. version=`$PKGCONFIG --modversion librtmp`
  2912. DIR_RTMP=`echo $LD_RTMP | $SED -e 's/^-L//'`
  2913. else
  2914. dnl To avoid link errors, we do not allow --librtmp without
  2915. dnl a pkgconfig file
  2916. AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
  2917. fi
  2918. ;;
  2919. off)
  2920. dnl no --with-librtmp option given, just check default places
  2921. LIB_RTMP="-lrtmp"
  2922. ;;
  2923. *)
  2924. dnl use the given --with-librtmp spot
  2925. LIB_RTMP="-lrtmp"
  2926. PREFIX_RTMP=$OPT_LIBRTMP
  2927. ;;
  2928. esac
  2929. dnl if given with a prefix, we set -L and -I based on that
  2930. if test -n "$PREFIX_RTMP"; then
  2931. LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
  2932. CPP_RTMP=-I${PREFIX_RTMP}/include
  2933. DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
  2934. fi
  2935. LDFLAGS="$LDFLAGS $LD_RTMP"
  2936. CPPFLAGS="$CPPFLAGS $CPP_RTMP"
  2937. LIBS="$LIB_RTMP $LIBS"
  2938. AC_CHECK_LIB(rtmp, RTMP_Init,
  2939. [
  2940. AC_CHECK_HEADERS(librtmp/rtmp.h,
  2941. curl_rtmp_msg="enabled (librtmp)"
  2942. LIBRTMP_ENABLED=1
  2943. AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
  2944. AC_SUBST(USE_LIBRTMP, [1])
  2945. )
  2946. ],
  2947. dnl not found, revert back to clean variables
  2948. LDFLAGS=$CLEANLDFLAGS
  2949. CPPFLAGS=$CLEANCPPFLAGS
  2950. LIBS=$CLEANLIBS
  2951. )
  2952. if test X"$OPT_LIBRTMP" != Xoff &&
  2953. test "$LIBRTMP_ENABLED" != "1"; then
  2954. AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
  2955. fi
  2956. fi
  2957. dnl **********************************************************************
  2958. dnl Check for linker switch for versioned symbols
  2959. dnl **********************************************************************
  2960. versioned_symbols_flavour=
  2961. AC_MSG_CHECKING([whether versioned symbols are wanted])
  2962. AC_ARG_ENABLE(versioned-symbols,
  2963. AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
  2964. AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
  2965. [ case "$enableval" in
  2966. yes) AC_MSG_RESULT(yes)
  2967. AC_MSG_CHECKING([if libraries can be versioned])
  2968. GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
  2969. if test -z "$GLD"; then
  2970. AC_MSG_RESULT(no)
  2971. AC_MSG_WARN([You need an ld version supporting the --version-script option])
  2972. else
  2973. AC_MSG_RESULT(yes)
  2974. if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
  2975. versioned_symbols_flavour="MULTISSL_"
  2976. elif test "x$OPENSSL_ENABLED" = "x1"; then
  2977. versioned_symbols_flavour="OPENSSL_"
  2978. elif test "x$GNUTLS_ENABLED" = "x1"; then
  2979. versioned_symbols_flavour="GNUTLS_"
  2980. elif test "x$NSS_ENABLED" = "x1"; then
  2981. versioned_symbols_flavour="NSS_"
  2982. elif test "x$WOLFSSL_ENABLED" = "x1"; then
  2983. versioned_symbols_flavour="WOLFSSL_"
  2984. elif test "x$SCHANNEL_ENABLED" = "x1"; then
  2985. versioned_symbols_flavour="SCHANNEL_"
  2986. elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then
  2987. versioned_symbols_flavour="SECURE_TRANSPORT_"
  2988. else
  2989. versioned_symbols_flavour=""
  2990. fi
  2991. versioned_symbols="yes"
  2992. fi
  2993. ;;
  2994. *) AC_MSG_RESULT(no)
  2995. ;;
  2996. esac
  2997. ], [
  2998. AC_MSG_RESULT(no)
  2999. ]
  3000. )
  3001. AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
  3002. ["$versioned_symbols_flavour"])
  3003. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
  3004. [test "x$versioned_symbols" = 'xyes'])
  3005. dnl -------------------------------------------------
  3006. dnl check winidn option before other IDN libraries
  3007. dnl -------------------------------------------------
  3008. AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
  3009. OPT_WINIDN="default"
  3010. AC_ARG_WITH(winidn,
  3011. AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
  3012. AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
  3013. OPT_WINIDN=$withval)
  3014. case "$OPT_WINIDN" in
  3015. no|default)
  3016. dnl --without-winidn option used or configure option not specified
  3017. want_winidn="no"
  3018. AC_MSG_RESULT([no])
  3019. ;;
  3020. yes)
  3021. dnl --with-winidn option used without path
  3022. want_winidn="yes"
  3023. want_winidn_path="default"
  3024. AC_MSG_RESULT([yes])
  3025. ;;
  3026. *)
  3027. dnl --with-winidn option used with path
  3028. want_winidn="yes"
  3029. want_winidn_path="$withval"
  3030. AC_MSG_RESULT([yes ($withval)])
  3031. ;;
  3032. esac
  3033. if test "$want_winidn" = "yes"; then
  3034. dnl winidn library support has been requested
  3035. clean_CPPFLAGS="$CPPFLAGS"
  3036. clean_LDFLAGS="$LDFLAGS"
  3037. clean_LIBS="$LIBS"
  3038. WINIDN_LIBS="-lnormaliz"
  3039. WINIDN_CPPFLAGS="-DWINVER=0x0600"
  3040. #
  3041. if test "$want_winidn_path" != "default"; then
  3042. dnl path has been specified
  3043. dnl pkg-config not available or provides no info
  3044. WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
  3045. WINIDN_CPPFLAGS="-I$want_winidn_path/include"
  3046. WINIDN_DIR="$want_winidn_path/lib$libsuff"
  3047. fi
  3048. #
  3049. CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS"
  3050. LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS"
  3051. LIBS="$WINIDN_LIBS $LIBS"
  3052. #
  3053. AC_MSG_CHECKING([if IdnToUnicode can be linked])
  3054. AC_LINK_IFELSE([
  3055. AC_LANG_PROGRAM([[
  3056. #include <windows.h>
  3057. ]],[[
  3058. IdnToUnicode(0, NULL, 0, NULL, 0);
  3059. ]])
  3060. ],[
  3061. AC_MSG_RESULT([yes])
  3062. tst_links_winidn="yes"
  3063. ],[
  3064. AC_MSG_RESULT([no])
  3065. tst_links_winidn="no"
  3066. ])
  3067. #
  3068. if test "$tst_links_winidn" = "yes"; then
  3069. AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
  3070. AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
  3071. AC_SUBST([IDN_ENABLED], [1])
  3072. curl_idn_msg="enabled (Windows-native)"
  3073. else
  3074. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  3075. CPPFLAGS="$clean_CPPFLAGS"
  3076. LDFLAGS="$clean_LDFLAGS"
  3077. LIBS="$clean_LIBS"
  3078. fi
  3079. fi
  3080. dnl **********************************************************************
  3081. dnl Check for the presence of IDN libraries and headers
  3082. dnl **********************************************************************
  3083. AC_MSG_CHECKING([whether to build with libidn2])
  3084. OPT_IDN="default"
  3085. AC_ARG_WITH(libidn2,
  3086. AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage])
  3087. AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]),
  3088. [OPT_IDN=$withval])
  3089. case "$OPT_IDN" in
  3090. no)
  3091. dnl --without-libidn2 option used
  3092. want_idn="no"
  3093. AC_MSG_RESULT([no])
  3094. ;;
  3095. default)
  3096. dnl configure option not specified
  3097. want_idn="yes"
  3098. want_idn_path="default"
  3099. AC_MSG_RESULT([(assumed) yes])
  3100. ;;
  3101. yes)
  3102. dnl --with-libidn2 option used without path
  3103. want_idn="yes"
  3104. want_idn_path="default"
  3105. AC_MSG_RESULT([yes])
  3106. ;;
  3107. *)
  3108. dnl --with-libidn2 option used with path
  3109. want_idn="yes"
  3110. want_idn_path="$withval"
  3111. AC_MSG_RESULT([yes ($withval)])
  3112. ;;
  3113. esac
  3114. if test "$want_idn" = "yes"; then
  3115. dnl idn library support has been requested
  3116. clean_CPPFLAGS="$CPPFLAGS"
  3117. clean_LDFLAGS="$LDFLAGS"
  3118. clean_LIBS="$LIBS"
  3119. PKGCONFIG="no"
  3120. #
  3121. if test "$want_idn_path" != "default"; then
  3122. dnl path has been specified
  3123. IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
  3124. CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR])
  3125. if test "$PKGCONFIG" != "no"; then
  3126. IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  3127. $PKGCONFIG --libs-only-l libidn2 2>/dev/null`
  3128. IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  3129. $PKGCONFIG --libs-only-L libidn2 2>/dev/null`
  3130. IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  3131. $PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
  3132. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
  3133. else
  3134. dnl pkg-config not available or provides no info
  3135. IDN_LIBS="-lidn2"
  3136. IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
  3137. IDN_CPPFLAGS="-I$want_idn_path/include"
  3138. IDN_DIR="$want_idn_path/lib$libsuff"
  3139. fi
  3140. else
  3141. dnl path not specified
  3142. CURL_CHECK_PKGCONFIG(libidn2)
  3143. if test "$PKGCONFIG" != "no"; then
  3144. IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null`
  3145. IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null`
  3146. IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null`
  3147. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/^-L//'`
  3148. else
  3149. dnl pkg-config not available or provides no info
  3150. IDN_LIBS="-lidn2"
  3151. fi
  3152. fi
  3153. #
  3154. if test "$PKGCONFIG" != "no"; then
  3155. AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
  3156. AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
  3157. AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  3158. AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
  3159. else
  3160. AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
  3161. AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
  3162. AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  3163. AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
  3164. fi
  3165. #
  3166. CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS"
  3167. LDFLAGS="$LDFLAGS $IDN_LDFLAGS"
  3168. LIBS="$IDN_LIBS $LIBS"
  3169. #
  3170. AC_MSG_CHECKING([if idn2_lookup_ul can be linked])
  3171. AC_LINK_IFELSE([
  3172. AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul])
  3173. ],[
  3174. AC_MSG_RESULT([yes])
  3175. tst_links_libidn="yes"
  3176. ],[
  3177. AC_MSG_RESULT([no])
  3178. tst_links_libidn="no"
  3179. ])
  3180. #
  3181. AC_CHECK_HEADERS( idn2.h )
  3182. if test "$tst_links_libidn" = "yes"; then
  3183. AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).])
  3184. dnl different versions of libidn have different setups of these:
  3185. AC_SUBST([IDN_ENABLED], [1])
  3186. curl_idn_msg="enabled (libidn2)"
  3187. if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
  3188. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR"
  3189. export CURL_LIBRARY_PATH
  3190. AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH])
  3191. fi
  3192. else
  3193. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  3194. CPPFLAGS="$clean_CPPFLAGS"
  3195. LDFLAGS="$clean_LDFLAGS"
  3196. LIBS="$clean_LIBS"
  3197. fi
  3198. fi
  3199. dnl Let's hope this split URL remains working:
  3200. dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
  3201. dnl genprogc/thread_quick_ref.htm
  3202. dnl **********************************************************************
  3203. dnl Check for nghttp2
  3204. dnl **********************************************************************
  3205. OPT_H2="yes"
  3206. if test "x$disable_http" = "xyes"; then
  3207. # without HTTP, nghttp2 is no use
  3208. OPT_H2="no"
  3209. fi
  3210. AC_ARG_WITH(nghttp2,
  3211. AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage])
  3212. AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]),
  3213. [OPT_H2=$withval])
  3214. case "$OPT_H2" in
  3215. no)
  3216. dnl --without-nghttp2 option used
  3217. want_h2="no"
  3218. ;;
  3219. yes)
  3220. dnl --with-nghttp2 option used without path
  3221. want_h2="default"
  3222. want_h2_path=""
  3223. ;;
  3224. *)
  3225. dnl --with-nghttp2 option used with path
  3226. want_h2="yes"
  3227. want_h2_path="$withval/lib/pkgconfig"
  3228. ;;
  3229. esac
  3230. if test X"$want_h2" != Xno; then
  3231. dnl backup the pre-nghttp2 variables
  3232. CLEANLDFLAGS="$LDFLAGS"
  3233. CLEANCPPFLAGS="$CPPFLAGS"
  3234. CLEANLIBS="$LIBS"
  3235. CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path)
  3236. if test "$PKGCONFIG" != "no" ; then
  3237. LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
  3238. $PKGCONFIG --libs-only-l libnghttp2`
  3239. AC_MSG_NOTICE([-l is $LIB_H2])
  3240. CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl
  3241. $PKGCONFIG --cflags-only-I libnghttp2`
  3242. AC_MSG_NOTICE([-I is $CPP_H2])
  3243. LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path])
  3244. $PKGCONFIG --libs-only-L libnghttp2`
  3245. AC_MSG_NOTICE([-L is $LD_H2])
  3246. LDFLAGS="$LDFLAGS $LD_H2"
  3247. CPPFLAGS="$CPPFLAGS $CPP_H2"
  3248. LIBS="$LIB_H2 $LIBS"
  3249. # use nghttp2_session_set_local_window_size to require nghttp2
  3250. # >= 1.12.0
  3251. AC_CHECK_LIB(nghttp2, nghttp2_session_set_local_window_size,
  3252. [
  3253. AC_CHECK_HEADERS(nghttp2/nghttp2.h,
  3254. curl_h2_msg="enabled (nghttp2)"
  3255. NGHTTP2_ENABLED=1
  3256. AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use])
  3257. AC_SUBST(USE_NGHTTP2, [1])
  3258. )
  3259. ],
  3260. dnl not found, revert back to clean variables
  3261. LDFLAGS=$CLEANLDFLAGS
  3262. CPPFLAGS=$CLEANCPPFLAGS
  3263. LIBS=$CLEANLIBS
  3264. )
  3265. else
  3266. dnl no nghttp2 pkg-config found, deal with it
  3267. if test X"$want_h2" != Xdefault; then
  3268. dnl To avoid link errors, we do not allow --with-nghttp2 without
  3269. dnl a pkgconfig file
  3270. AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.])
  3271. fi
  3272. fi
  3273. fi
  3274. dnl **********************************************************************
  3275. dnl Check for ngtcp2 (QUIC)
  3276. dnl **********************************************************************
  3277. OPT_TCP2="yes"
  3278. if test "x$disable_http" = "xyes"; then
  3279. # without HTTP, ngtcp2 is no use
  3280. OPT_TCP2="no"
  3281. fi
  3282. AC_ARG_WITH(ngtcp2,
  3283. AC_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage])
  3284. AC_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]),
  3285. [OPT_TCP2=$withval])
  3286. case "$OPT_TCP2" in
  3287. no)
  3288. dnl --without-ngtcp2 option used
  3289. want_tcp2="no"
  3290. ;;
  3291. yes)
  3292. dnl --with-ngtcp2 option used without path
  3293. want_tcp2="default"
  3294. want_tcp2_path=""
  3295. ;;
  3296. *)
  3297. dnl --with-ngtcp2 option used with path
  3298. want_tcp2="yes"
  3299. want_tcp2_path="$withval/lib/pkgconfig"
  3300. ;;
  3301. esac
  3302. curl_tcp2_msg="no (--with-ngtcp2)"
  3303. if test X"$want_tcp2" != Xno; then
  3304. dnl backup the pre-ngtcp2 variables
  3305. CLEANLDFLAGS="$LDFLAGS"
  3306. CLEANCPPFLAGS="$CPPFLAGS"
  3307. CLEANLIBS="$LIBS"
  3308. CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path)
  3309. if test "$PKGCONFIG" != "no" ; then
  3310. LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  3311. $PKGCONFIG --libs-only-l libngtcp2`
  3312. AC_MSG_NOTICE([-l is $LIB_TCP2])
  3313. CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  3314. $PKGCONFIG --cflags-only-I libngtcp2`
  3315. AC_MSG_NOTICE([-I is $CPP_TCP2])
  3316. LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  3317. $PKGCONFIG --libs-only-L libngtcp2`
  3318. AC_MSG_NOTICE([-L is $LD_TCP2])
  3319. LDFLAGS="$LDFLAGS $LD_TCP2"
  3320. CPPFLAGS="$CPPFLAGS $CPP_TCP2"
  3321. LIBS="$LIB_TCP2 $LIBS"
  3322. if test "x$cross_compiling" != "xyes"; then
  3323. DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/^-L//'`
  3324. fi
  3325. AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new,
  3326. [
  3327. AC_CHECK_HEADERS(ngtcp2/ngtcp2.h,
  3328. NGTCP2_ENABLED=1
  3329. AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use])
  3330. AC_SUBST(USE_NGTCP2, [1])
  3331. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2"
  3332. export CURL_LIBRARY_PATH
  3333. AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH])
  3334. )
  3335. ],
  3336. dnl not found, revert back to clean variables
  3337. LDFLAGS=$CLEANLDFLAGS
  3338. CPPFLAGS=$CLEANCPPFLAGS
  3339. LIBS=$CLEANLIBS
  3340. )
  3341. else
  3342. dnl no ngtcp2 pkg-config found, deal with it
  3343. if test X"$want_tcp2" != Xdefault; then
  3344. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  3345. dnl a pkgconfig file
  3346. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.])
  3347. fi
  3348. fi
  3349. fi
  3350. if test "x$NGTCP2_ENABLED" = "x1" -a "x$OPENSSL_ENABLED" = "x1"; then
  3351. dnl backup the pre-ngtcp2_crypto_openssl variables
  3352. CLEANLDFLAGS="$LDFLAGS"
  3353. CLEANCPPFLAGS="$CPPFLAGS"
  3354. CLEANLIBS="$LIBS"
  3355. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path)
  3356. if test "$PKGCONFIG" != "no" ; then
  3357. LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  3358. $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl`
  3359. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL])
  3360. CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  3361. $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl`
  3362. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL])
  3363. LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  3364. $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl`
  3365. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL])
  3366. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL"
  3367. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL"
  3368. LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS"
  3369. if test "x$cross_compiling" != "xyes"; then
  3370. DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/^-L//'`
  3371. fi
  3372. AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial,
  3373. [
  3374. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  3375. NGTCP2_ENABLED=1
  3376. AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use])
  3377. AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1])
  3378. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL"
  3379. export CURL_LIBRARY_PATH
  3380. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH])
  3381. )
  3382. ],
  3383. dnl not found, revert back to clean variables
  3384. LDFLAGS=$CLEANLDFLAGS
  3385. CPPFLAGS=$CLEANCPPFLAGS
  3386. LIBS=$CLEANLIBS
  3387. )
  3388. else
  3389. dnl no ngtcp2_crypto_openssl pkg-config found, deal with it
  3390. if test X"$want_tcp2" != Xdefault; then
  3391. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  3392. dnl a pkgconfig file
  3393. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.])
  3394. fi
  3395. fi
  3396. fi
  3397. if test "x$NGTCP2_ENABLED" = "x1" -a "x$GNUTLS_ENABLED" = "x1"; then
  3398. dnl backup the pre-ngtcp2_crypto_gnutls variables
  3399. CLEANLDFLAGS="$LDFLAGS"
  3400. CLEANCPPFLAGS="$CPPFLAGS"
  3401. CLEANLIBS="$LIBS"
  3402. CURL_CHECK_PKGCONFIG(libngtcp2_crypto_gnutls, $want_tcp2_path)
  3403. if test "$PKGCONFIG" != "no" ; then
  3404. LIB_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  3405. $PKGCONFIG --libs-only-l libngtcp2_crypto_gnutls`
  3406. AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_GNUTLS])
  3407. CPP_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl
  3408. $PKGCONFIG --cflags-only-I libngtcp2_crypto_gnutls`
  3409. AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_GNUTLS])
  3410. LD_NGTCP2_CRYPTO_GNUTLS=`CURL_EXPORT_PCDIR([$want_tcp2_path])
  3411. $PKGCONFIG --libs-only-L libngtcp2_crypto_gnutls`
  3412. AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_GNUTLS])
  3413. LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_GNUTLS"
  3414. CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_GNUTLS"
  3415. LIBS="$LIB_NGTCP2_CRYPTO_GNUTLS $LIBS"
  3416. if test "x$cross_compiling" != "xyes"; then
  3417. DIR_NGTCP2_CRYPTO_GNUTLS=`echo $LD_NGTCP2_CRYPTO_GNUTLS | $SED -e 's/^-L//'`
  3418. fi
  3419. AC_CHECK_LIB(ngtcp2_crypto_gnutls, ngtcp2_crypto_ctx_initial,
  3420. [
  3421. AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h,
  3422. NGTCP2_ENABLED=1
  3423. AC_DEFINE(USE_NGTCP2_CRYPTO_GNUTLS, 1, [if ngtcp2_crypto_gnutls is in use])
  3424. AC_SUBST(USE_NGTCP2_CRYPTO_GNUTLS, [1])
  3425. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_GNUTLS"
  3426. export CURL_LIBRARY_PATH
  3427. AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_GNUTLS to CURL_LIBRARY_PATH])
  3428. )
  3429. ],
  3430. dnl not found, revert back to clean variables
  3431. LDFLAGS=$CLEANLDFLAGS
  3432. CPPFLAGS=$CLEANCPPFLAGS
  3433. LIBS=$CLEANLIBS
  3434. )
  3435. else
  3436. dnl no ngtcp2_crypto_gnutls pkg-config found, deal with it
  3437. if test X"$want_tcp2" != Xdefault; then
  3438. dnl To avoid link errors, we do not allow --with-ngtcp2 without
  3439. dnl a pkgconfig file
  3440. AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_gnutls pkg-config file.])
  3441. fi
  3442. fi
  3443. fi
  3444. dnl **********************************************************************
  3445. dnl Check for nghttp3 (HTTP/3 with ngtcp2)
  3446. dnl **********************************************************************
  3447. OPT_NGHTTP3="yes"
  3448. if test "x$NGTCP2_ENABLED" = "x"; then
  3449. # without ngtcp2, nghttp3 is of no use for us
  3450. OPT_NGHTTP3="no"
  3451. fi
  3452. AC_ARG_WITH(nghttp3,
  3453. AC_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage])
  3454. AC_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]),
  3455. [OPT_NGHTTP3=$withval])
  3456. case "$OPT_NGHTTP3" in
  3457. no)
  3458. dnl --without-nghttp3 option used
  3459. want_nghttp3="no"
  3460. ;;
  3461. yes)
  3462. dnl --with-nghttp3 option used without path
  3463. want_nghttp3="default"
  3464. want_nghttp3_path=""
  3465. ;;
  3466. *)
  3467. dnl --with-nghttp3 option used with path
  3468. want_nghttp3="yes"
  3469. want_nghttp3_path="$withval/lib/pkgconfig"
  3470. ;;
  3471. esac
  3472. curl_http3_msg="no (--with-nghttp3)"
  3473. if test X"$want_nghttp3" != Xno; then
  3474. dnl backup the pre-nghttp3 variables
  3475. CLEANLDFLAGS="$LDFLAGS"
  3476. CLEANCPPFLAGS="$CPPFLAGS"
  3477. CLEANLIBS="$LIBS"
  3478. CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path)
  3479. if test "$PKGCONFIG" != "no" ; then
  3480. LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
  3481. $PKGCONFIG --libs-only-l libnghttp3`
  3482. AC_MSG_NOTICE([-l is $LIB_NGHTTP3])
  3483. CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl
  3484. $PKGCONFIG --cflags-only-I libnghttp3`
  3485. AC_MSG_NOTICE([-I is $CPP_NGHTTP3])
  3486. LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path])
  3487. $PKGCONFIG --libs-only-L libnghttp3`
  3488. AC_MSG_NOTICE([-L is $LD_NGHTTP3])
  3489. LDFLAGS="$LDFLAGS $LD_NGHTTP3"
  3490. CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3"
  3491. LIBS="$LIB_NGHTTP3 $LIBS"
  3492. if test "x$cross_compiling" != "xyes"; then
  3493. DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/^-L//'`
  3494. fi
  3495. AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new,
  3496. [
  3497. AC_CHECK_HEADERS(nghttp3/nghttp3.h,
  3498. curl_h3_msg="enabled (ngtcp2 + nghttp3)"
  3499. NGHTTP3_ENABLED=1
  3500. AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use])
  3501. AC_SUBST(USE_NGHTTP3, [1])
  3502. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3"
  3503. export CURL_LIBRARY_PATH
  3504. AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH])
  3505. experimental="$experimental HTTP3"
  3506. )
  3507. ],
  3508. dnl not found, revert back to clean variables
  3509. LDFLAGS=$CLEANLDFLAGS
  3510. CPPFLAGS=$CLEANCPPFLAGS
  3511. LIBS=$CLEANLIBS
  3512. )
  3513. else
  3514. dnl no nghttp3 pkg-config found, deal with it
  3515. if test X"$want_nghttp3" != Xdefault; then
  3516. dnl To avoid link errors, we do not allow --with-nghttp3 without
  3517. dnl a pkgconfig file
  3518. AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.])
  3519. fi
  3520. fi
  3521. fi
  3522. dnl **********************************************************************
  3523. dnl Check for quiche (QUIC)
  3524. dnl **********************************************************************
  3525. OPT_QUICHE="yes"
  3526. if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then
  3527. # without HTTP or with ngtcp2, quiche is no use
  3528. OPT_QUICHE="no"
  3529. fi
  3530. AC_ARG_WITH(quiche,
  3531. AC_HELP_STRING([--with-quiche=PATH],[Enable quiche usage])
  3532. AC_HELP_STRING([--without-quiche],[Disable quiche usage]),
  3533. [OPT_QUICHE=$withval])
  3534. case "$OPT_QUICHE" in
  3535. no)
  3536. dnl --without-quiche option used
  3537. want_quiche="no"
  3538. ;;
  3539. yes)
  3540. dnl --with-quiche option used without path
  3541. want_quiche="default"
  3542. want_quiche_path=""
  3543. ;;
  3544. *)
  3545. dnl --with-quiche option used with path
  3546. want_quiche="yes"
  3547. want_quiche_path="$withval"
  3548. ;;
  3549. esac
  3550. if test X"$want_quiche" != Xno; then
  3551. dnl backup the pre-quiche variables
  3552. CLEANLDFLAGS="$LDFLAGS"
  3553. CLEANCPPFLAGS="$CPPFLAGS"
  3554. CLEANLIBS="$LIBS"
  3555. CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path)
  3556. if test "$PKGCONFIG" != "no" ; then
  3557. LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
  3558. $PKGCONFIG --libs-only-l quiche`
  3559. AC_MSG_NOTICE([-l is $LIB_QUICHE])
  3560. CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl
  3561. $PKGCONFIG --cflags-only-I quiche`
  3562. AC_MSG_NOTICE([-I is $CPP_QUICHE])
  3563. LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path])
  3564. $PKGCONFIG --libs-only-L quiche`
  3565. AC_MSG_NOTICE([-L is $LD_QUICHE])
  3566. LDFLAGS="$LDFLAGS $LD_QUICHE"
  3567. CPPFLAGS="$CPPFLAGS $CPP_QUICHE"
  3568. LIBS="$LIB_QUICHE $LIBS"
  3569. if test "x$cross_compiling" != "xyes"; then
  3570. DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/^-L//'`
  3571. fi
  3572. AC_CHECK_LIB(quiche, quiche_connect,
  3573. [
  3574. AC_CHECK_HEADERS(quiche.h,
  3575. experimental="$experimental HTTP3"
  3576. AC_MSG_NOTICE([HTTP3 support is experimental])
  3577. curl_h3_msg="enabled (quiche)"
  3578. QUICHE_ENABLED=1
  3579. AC_DEFINE(USE_QUICHE, 1, [if quiche is in use])
  3580. AC_SUBST(USE_QUICHE, [1])
  3581. AC_CHECK_FUNCS([quiche_conn_set_qlog_fd])
  3582. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE"
  3583. export CURL_LIBRARY_PATH
  3584. AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]),
  3585. )
  3586. ],
  3587. dnl not found, revert back to clean variables
  3588. LDFLAGS=$CLEANLDFLAGS
  3589. CPPFLAGS=$CLEANCPPFLAGS
  3590. LIBS=$CLEANLIBS
  3591. )
  3592. else
  3593. dnl no quiche pkg-config found, deal with it
  3594. if test X"$want_quiche" != Xdefault; then
  3595. dnl To avoid link errors, we do not allow --with-quiche without
  3596. dnl a pkgconfig file
  3597. AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.])
  3598. fi
  3599. fi
  3600. fi
  3601. dnl **********************************************************************
  3602. dnl Check for Hyper
  3603. dnl **********************************************************************
  3604. OPT_HYPER="yes"
  3605. if test "x$disable_http" = "xyes"; then
  3606. # without HTTP, hyper is of no use
  3607. OPT_HYPER="no"
  3608. fi
  3609. AC_ARG_WITH(hyper,
  3610. AC_HELP_STRING([--with-hyper=PATH],[Enable hyper usage])
  3611. AC_HELP_STRING([--without-hyper],[Disable hyper usage]),
  3612. [OPT_HYPER=$withval])
  3613. case "$OPT_HYPER" in
  3614. no)
  3615. dnl --without-hyper option used
  3616. want_hyper="no"
  3617. ;;
  3618. yes)
  3619. dnl --with-hyper option used without path
  3620. want_hyper="default"
  3621. want_hyper_path=""
  3622. ;;
  3623. *)
  3624. dnl --with-hyper option used with path
  3625. want_hyper="yes"
  3626. want_hyper_path="$withval"
  3627. ;;
  3628. esac
  3629. if test X"$want_hyper" != Xno; then
  3630. dnl backup the pre-hyper variables
  3631. CLEANLDFLAGS="$LDFLAGS"
  3632. CLEANCPPFLAGS="$CPPFLAGS"
  3633. CLEANLIBS="$LIBS"
  3634. CURL_CHECK_PKGCONFIG(hyper, $want_hyper_path)
  3635. if test "$PKGCONFIG" != "no" ; then
  3636. LIB_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
  3637. $PKGCONFIG --libs-only-l hyper`
  3638. CPP_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path]) dnl
  3639. $PKGCONFIG --cflags-only-I hyper`
  3640. LD_HYPER=`CURL_EXPORT_PCDIR([$want_hyper_path])
  3641. $PKGCONFIG --libs-only-L hyper`
  3642. else
  3643. dnl no hyper pkg-config found
  3644. LIB_HYPER="-lhyper"
  3645. if test X"$want_hyper" != Xdefault; then
  3646. CPP_HYPER=-I"$want_hyper_path/capi/include"
  3647. LD_HYPER="-L$want_hyper_path/target/debug"
  3648. fi
  3649. fi
  3650. if test -n "$LIB_HYPER"; then
  3651. AC_MSG_NOTICE([-l is $LIB_HYPER])
  3652. AC_MSG_NOTICE([-I is $CPP_HYPER])
  3653. AC_MSG_NOTICE([-L is $LD_HYPER])
  3654. LDFLAGS="$LDFLAGS $LD_HYPER"
  3655. CPPFLAGS="$CPPFLAGS $CPP_HYPER"
  3656. LIBS="$LIB_HYPER $LIBS"
  3657. if test "x$cross_compiling" != "xyes"; then
  3658. DIR_HYPER=`echo $LD_HYPER | $SED -e 's/^-L//'`
  3659. fi
  3660. AC_CHECK_LIB(hyper, hyper_io_new,
  3661. [
  3662. AC_CHECK_HEADERS(hyper.h,
  3663. experimental="$experimental Hyper"
  3664. AC_MSG_NOTICE([Hyper support is experimental])
  3665. curl_h1_msg="enabled (Hyper)"
  3666. curl_h2_msg=$curl_h1_msg
  3667. HYPER_ENABLED=1
  3668. AC_DEFINE(USE_HYPER, 1, [if hyper is in use])
  3669. AC_SUBST(USE_HYPER, [1])
  3670. CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_HYPER"
  3671. export CURL_LIBRARY_PATH
  3672. AC_MSG_NOTICE([Added $DIR_HYPER to CURL_LIBRARY_PATH]),
  3673. )
  3674. ],
  3675. dnl not found, revert back to clean variables
  3676. LDFLAGS=$CLEANLDFLAGS
  3677. CPPFLAGS=$CLEANCPPFLAGS
  3678. LIBS=$CLEANLIBS
  3679. )
  3680. fi
  3681. fi
  3682. dnl **********************************************************************
  3683. dnl Check for zsh completion path
  3684. dnl **********************************************************************
  3685. OPT_ZSH_FPATH=default
  3686. AC_ARG_WITH(zsh-functions-dir,
  3687. AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH])
  3688. AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]),
  3689. [OPT_ZSH_FPATH=$withval])
  3690. case "$OPT_ZSH_FPATH" in
  3691. no)
  3692. dnl --without-zsh-functions-dir option used
  3693. ;;
  3694. default|yes)
  3695. dnl --with-zsh-functions-dir option used without path
  3696. ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions"
  3697. AC_SUBST(ZSH_FUNCTIONS_DIR)
  3698. ;;
  3699. *)
  3700. dnl --with-zsh-functions-dir option used with path
  3701. ZSH_FUNCTIONS_DIR="$withval"
  3702. AC_SUBST(ZSH_FUNCTIONS_DIR)
  3703. ;;
  3704. esac
  3705. dnl **********************************************************************
  3706. dnl Check for fish completion path
  3707. dnl **********************************************************************
  3708. OPT_FISH_FPATH=default
  3709. AC_ARG_WITH(fish-functions-dir,
  3710. AC_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH])
  3711. AC_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]),
  3712. [OPT_FISH_FPATH=$withval])
  3713. case "$OPT_FISH_FPATH" in
  3714. no)
  3715. dnl --without-fish-functions-dir option used
  3716. ;;
  3717. default|yes)
  3718. dnl --with-fish-functions-dir option used without path
  3719. CURL_CHECK_PKGCONFIG(fish)
  3720. if test "$PKGCONFIG" != "no" ; then
  3721. FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)"
  3722. else
  3723. FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d"
  3724. fi
  3725. AC_SUBST(FISH_FUNCTIONS_DIR)
  3726. ;;
  3727. *)
  3728. dnl --with-fish-functions-dir option used with path
  3729. FISH_FUNCTIONS_DIR="$withval"
  3730. AC_SUBST(FISH_FUNCTIONS_DIR)
  3731. ;;
  3732. esac
  3733. dnl **********************************************************************
  3734. dnl Back to "normal" configuring
  3735. dnl **********************************************************************
  3736. dnl Checks for header files.
  3737. AC_HEADER_STDC
  3738. CURL_CHECK_HEADER_MALLOC
  3739. CURL_CHECK_HEADER_MEMORY
  3740. dnl Now check for the very most basic headers. Then we can use these
  3741. dnl ones as default-headers when checking for the rest!
  3742. AC_CHECK_HEADERS(
  3743. sys/types.h \
  3744. sys/time.h \
  3745. sys/select.h \
  3746. sys/socket.h \
  3747. sys/ioctl.h \
  3748. sys/uio.h \
  3749. assert.h \
  3750. unistd.h \
  3751. stdlib.h \
  3752. arpa/inet.h \
  3753. net/if.h \
  3754. netinet/in.h \
  3755. netinet/in6.h \
  3756. sys/un.h \
  3757. linux/tcp.h \
  3758. netinet/tcp.h \
  3759. netdb.h \
  3760. sys/sockio.h \
  3761. sys/stat.h \
  3762. sys/param.h \
  3763. termios.h \
  3764. termio.h \
  3765. sgtty.h \
  3766. fcntl.h \
  3767. alloca.h \
  3768. time.h \
  3769. io.h \
  3770. pwd.h \
  3771. utime.h \
  3772. sys/utime.h \
  3773. sys/poll.h \
  3774. poll.h \
  3775. socket.h \
  3776. sys/resource.h \
  3777. libgen.h \
  3778. locale.h \
  3779. errno.h \
  3780. stdbool.h \
  3781. arpa/tftp.h \
  3782. sys/filio.h \
  3783. sys/wait.h \
  3784. setjmp.h,
  3785. dnl to do if not found
  3786. [],
  3787. dnl to do if found
  3788. [],
  3789. dnl default includes
  3790. [
  3791. #ifdef HAVE_SYS_TYPES_H
  3792. #include <sys/types.h>
  3793. #endif
  3794. #ifdef HAVE_SYS_TIME_H
  3795. #include <sys/time.h>
  3796. #endif
  3797. #ifdef HAVE_SYS_SELECT_H
  3798. #include <sys/select.h>
  3799. #elif defined(HAVE_UNISTD_H)
  3800. #include <unistd.h>
  3801. #endif
  3802. #ifdef HAVE_SYS_SOCKET_H
  3803. #include <sys/socket.h>
  3804. #endif
  3805. #ifdef HAVE_NETINET_IN_H
  3806. #include <netinet/in.h>
  3807. #endif
  3808. #ifdef HAVE_NETINET_IN6_H
  3809. #include <netinet/in6.h>
  3810. #endif
  3811. #ifdef HAVE_SYS_UN_H
  3812. #include <sys/un.h>
  3813. #endif
  3814. ]
  3815. )
  3816. dnl Checks for typedefs, structures, and compiler characteristics.
  3817. AC_C_CONST
  3818. CURL_CHECK_VARIADIC_MACROS
  3819. AC_TYPE_SIZE_T
  3820. AC_HEADER_TIME
  3821. CURL_CHECK_STRUCT_TIMEVAL
  3822. CURL_VERIFY_RUNTIMELIBS
  3823. AX_COMPILE_CHECK_SIZEOF(size_t)
  3824. AX_COMPILE_CHECK_SIZEOF(long)
  3825. AX_COMPILE_CHECK_SIZEOF(int)
  3826. AX_COMPILE_CHECK_SIZEOF(short)
  3827. AX_COMPILE_CHECK_SIZEOF(time_t)
  3828. AX_COMPILE_CHECK_SIZEOF(off_t)
  3829. o=$CPPFLAGS
  3830. CPPFLAGS="-I$srcdir/include $CPPFLAGS"
  3831. AX_COMPILE_CHECK_SIZEOF(curl_off_t, [
  3832. #include <curl/system.h>
  3833. ])
  3834. CPPFLAGS=$o
  3835. AC_CHECK_TYPE(long long,
  3836. [AC_DEFINE(HAVE_LONGLONG, 1,
  3837. [Define to 1 if the compiler supports the 'long long' data type.])]
  3838. longlong="yes"
  3839. )
  3840. if test "xyes" = "x$longlong"; then
  3841. AC_MSG_CHECKING([if numberLL works])
  3842. AC_COMPILE_IFELSE([
  3843. AC_LANG_PROGRAM([[
  3844. ]],[[
  3845. long long val = 1000LL;
  3846. ]])
  3847. ],[
  3848. AC_MSG_RESULT([yes])
  3849. AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
  3850. ],[
  3851. AC_MSG_RESULT([no])
  3852. ])
  3853. fi
  3854. # check for ssize_t
  3855. AC_CHECK_TYPE(ssize_t, ,
  3856. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  3857. # check for bool type
  3858. AC_CHECK_TYPE([bool],[
  3859. AC_DEFINE(HAVE_BOOL_T, 1,
  3860. [Define to 1 if bool is an available type.])
  3861. ], ,[
  3862. #ifdef HAVE_SYS_TYPES_H
  3863. #include <sys/types.h>
  3864. #endif
  3865. #ifdef HAVE_STDBOOL_H
  3866. #include <stdbool.h>
  3867. #endif
  3868. ])
  3869. # check for sa_family_t
  3870. AC_CHECK_TYPE(sa_family_t,
  3871. AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]),
  3872. [
  3873. # The windows name?
  3874. AC_CHECK_TYPE(ADDRESS_FAMILY,
  3875. AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]),
  3876. AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]),
  3877. [
  3878. #ifdef HAVE_SYS_SOCKET_H
  3879. #include <sys/socket.h>
  3880. #endif
  3881. ])
  3882. ],
  3883. [
  3884. #ifdef HAVE_SYS_SOCKET_H
  3885. #include <sys/socket.h>
  3886. #endif
  3887. ])
  3888. # check for suseconds_t
  3889. AC_CHECK_TYPE([suseconds_t],[
  3890. AC_DEFINE(HAVE_SUSECONDS_T, 1,
  3891. [Define to 1 if suseconds_t is an available type.])
  3892. ], ,[
  3893. #ifdef HAVE_SYS_TYPES_H
  3894. #include <sys/types.h>
  3895. #endif
  3896. #ifdef HAVE_SYS_TIME_H
  3897. #include <sys/time.h>
  3898. #endif
  3899. ])
  3900. AC_MSG_CHECKING([if time_t is unsigned])
  3901. CURL_RUN_IFELSE(
  3902. [
  3903. #include <time.h>
  3904. #include <limits.h>
  3905. time_t t = -1;
  3906. return (t > 0);
  3907. ],[
  3908. AC_MSG_RESULT([yes])
  3909. AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned])
  3910. ],[
  3911. AC_MSG_RESULT([no])
  3912. ],[
  3913. dnl cross-compiling, most systems are unsigned
  3914. AC_MSG_RESULT([no])
  3915. ])
  3916. CURL_CONFIGURE_PULL_SYS_POLL
  3917. TYPE_IN_ADDR_T
  3918. TYPE_SOCKADDR_STORAGE
  3919. TYPE_SIG_ATOMIC_T
  3920. AC_TYPE_SIGNAL
  3921. CURL_CHECK_FUNC_SELECT
  3922. CURL_CHECK_FUNC_RECV
  3923. CURL_CHECK_FUNC_SEND
  3924. CURL_CHECK_MSG_NOSIGNAL
  3925. CURL_CHECK_FUNC_ALARM
  3926. CURL_CHECK_FUNC_BASENAME
  3927. CURL_CHECK_FUNC_CLOSESOCKET
  3928. CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  3929. CURL_CHECK_FUNC_CONNECT
  3930. CURL_CHECK_FUNC_FCNTL
  3931. CURL_CHECK_FUNC_FREEADDRINFO
  3932. CURL_CHECK_FUNC_FREEIFADDRS
  3933. CURL_CHECK_FUNC_FSETXATTR
  3934. CURL_CHECK_FUNC_FTRUNCATE
  3935. CURL_CHECK_FUNC_GETADDRINFO
  3936. CURL_CHECK_FUNC_GAI_STRERROR
  3937. CURL_CHECK_FUNC_GETHOSTBYADDR
  3938. CURL_CHECK_FUNC_GETHOSTBYADDR_R
  3939. CURL_CHECK_FUNC_GETHOSTBYNAME
  3940. CURL_CHECK_FUNC_GETHOSTBYNAME_R
  3941. CURL_CHECK_FUNC_GETHOSTNAME
  3942. CURL_CHECK_FUNC_GETPEERNAME
  3943. CURL_CHECK_FUNC_GETSOCKNAME
  3944. CURL_CHECK_FUNC_IF_NAMETOINDEX
  3945. CURL_CHECK_FUNC_GETIFADDRS
  3946. CURL_CHECK_FUNC_GETSERVBYPORT_R
  3947. CURL_CHECK_FUNC_GMTIME_R
  3948. CURL_CHECK_FUNC_INET_NTOA_R
  3949. CURL_CHECK_FUNC_INET_NTOP
  3950. CURL_CHECK_FUNC_INET_PTON
  3951. CURL_CHECK_FUNC_IOCTL
  3952. CURL_CHECK_FUNC_IOCTLSOCKET
  3953. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  3954. CURL_CHECK_FUNC_LOCALTIME_R
  3955. CURL_CHECK_FUNC_MEMRCHR
  3956. CURL_CHECK_FUNC_POLL
  3957. CURL_CHECK_FUNC_SETSOCKOPT
  3958. CURL_CHECK_FUNC_SIGACTION
  3959. CURL_CHECK_FUNC_SIGINTERRUPT
  3960. CURL_CHECK_FUNC_SIGNAL
  3961. CURL_CHECK_FUNC_SIGSETJMP
  3962. CURL_CHECK_FUNC_SOCKET
  3963. CURL_CHECK_FUNC_SOCKETPAIR
  3964. CURL_CHECK_FUNC_STRCASECMP
  3965. CURL_CHECK_FUNC_STRCMPI
  3966. CURL_CHECK_FUNC_STRDUP
  3967. CURL_CHECK_FUNC_STRERROR_R
  3968. CURL_CHECK_FUNC_STRICMP
  3969. CURL_CHECK_FUNC_STRNCASECMP
  3970. CURL_CHECK_FUNC_STRNCMPI
  3971. CURL_CHECK_FUNC_STRNICMP
  3972. CURL_CHECK_FUNC_STRSTR
  3973. CURL_CHECK_FUNC_STRTOK_R
  3974. CURL_CHECK_FUNC_STRTOLL
  3975. CURL_CHECK_FUNC_WRITEV
  3976. case $host in
  3977. *msdosdjgpp)
  3978. ac_cv_func_pipe=no
  3979. skipcheck_pipe=yes
  3980. AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
  3981. ;;
  3982. esac
  3983. AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")],
  3984. [[#include <pwd.h>
  3985. #include <sys/types.h>]])
  3986. AC_CHECK_FUNCS([fnmatch \
  3987. geteuid \
  3988. getpass_r \
  3989. getppid \
  3990. getpwuid \
  3991. getpwuid_r \
  3992. getrlimit \
  3993. gettimeofday \
  3994. if_nametoindex \
  3995. mach_absolute_time \
  3996. pipe \
  3997. setlocale \
  3998. setmode \
  3999. setrlimit \
  4000. usleep \
  4001. utime \
  4002. utimes
  4003. ],[
  4004. ],[
  4005. func="$ac_func"
  4006. eval skipcheck=\$skipcheck_$func
  4007. if test "x$skipcheck" != "xyes"; then
  4008. AC_MSG_CHECKING([deeper for $func])
  4009. AC_LINK_IFELSE([
  4010. AC_LANG_PROGRAM([[
  4011. ]],[[
  4012. $func ();
  4013. ]])
  4014. ],[
  4015. AC_MSG_RESULT([yes])
  4016. eval "ac_cv_func_$func=yes"
  4017. AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
  4018. [Define to 1 if you have the $func function.])
  4019. ],[
  4020. AC_MSG_RESULT([but still no])
  4021. ])
  4022. fi
  4023. ])
  4024. CURL_CHECK_NONBLOCKING_SOCKET
  4025. dnl ************************************************************
  4026. dnl nroff tool stuff
  4027. dnl
  4028. AC_PATH_PROG( PERL, perl, ,
  4029. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  4030. AC_SUBST(PERL)
  4031. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  4032. $PATH:/usr/bin/:/usr/local/bin )
  4033. AC_SUBST(NROFF)
  4034. if test -n "$NROFF"; then
  4035. dnl only check for nroff options if an nroff command was found
  4036. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  4037. MANOPT="-man"
  4038. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  4039. if test -z "$mancheck"; then
  4040. MANOPT="-mandoc"
  4041. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  4042. if test -z "$mancheck"; then
  4043. MANOPT=""
  4044. AC_MSG_RESULT([failed])
  4045. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  4046. else
  4047. AC_MSG_RESULT([$MANOPT])
  4048. fi
  4049. else
  4050. AC_MSG_RESULT([$MANOPT])
  4051. fi
  4052. AC_SUBST(MANOPT)
  4053. fi
  4054. if test -z "$MANOPT"
  4055. then
  4056. dnl if no nroff tool was found, or no option that could convert man pages
  4057. dnl was found, then disable the built-in manual stuff
  4058. AC_MSG_WARN([disabling built-in manual])
  4059. USE_MANUAL="no";
  4060. fi
  4061. dnl *************************************************************************
  4062. dnl If the manual variable still is set, then we go with providing a built-in
  4063. dnl manual
  4064. if test "$USE_MANUAL" = "1"; then
  4065. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  4066. curl_manual_msg="enabled"
  4067. fi
  4068. dnl set variable for use in automakefile(s)
  4069. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  4070. CURL_CHECK_LIB_ARES
  4071. AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
  4072. if test "x$curl_cv_native_windows" != "xyes" &&
  4073. test "x$enable_shared" = "xyes"; then
  4074. build_libhostname=yes
  4075. else
  4076. build_libhostname=no
  4077. fi
  4078. AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
  4079. if test "x$want_ares" != xyes; then
  4080. CURL_CHECK_OPTION_THREADED_RESOLVER
  4081. fi
  4082. dnl ************************************************************
  4083. dnl disable POSIX threads
  4084. dnl
  4085. AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver])
  4086. AC_ARG_ENABLE(pthreads,
  4087. AC_HELP_STRING([--enable-pthreads],
  4088. [Enable POSIX threads (default for threaded resolver)])
  4089. AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]),
  4090. [ case "$enableval" in
  4091. no) AC_MSG_RESULT(no)
  4092. want_pthreads=no
  4093. ;;
  4094. *) AC_MSG_RESULT(yes)
  4095. want_pthreads=yes
  4096. ;;
  4097. esac ], [
  4098. AC_MSG_RESULT(auto)
  4099. want_pthreads=auto
  4100. ]
  4101. )
  4102. dnl turn off pthreads if rt is disabled
  4103. if test "$want_pthreads" != "no"; then
  4104. if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then
  4105. AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive])
  4106. fi
  4107. if test "$dontwant_rt" != "no"; then
  4108. dnl if --enable-pthreads was explicit then warn it's being ignored
  4109. if test "$want_pthreads" = "yes"; then
  4110. AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.])
  4111. fi
  4112. want_pthreads=no
  4113. fi
  4114. fi
  4115. dnl turn off pthreads if no threaded resolver
  4116. if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then
  4117. want_pthreads=no
  4118. fi
  4119. dnl detect pthreads
  4120. if test "$want_pthreads" != "no"; then
  4121. AC_CHECK_HEADER(pthread.h,
  4122. [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
  4123. save_CFLAGS="$CFLAGS"
  4124. dnl When statically linking against boringssl, -lpthread is added to LIBS.
  4125. dnl Make sure to that this does not pass the check below, we really want
  4126. dnl -pthread in CFLAGS as recommended for GCC. This also ensures that
  4127. dnl lib1541 and lib1565 tests are built with these options. Otherwise
  4128. dnl they fail the build since tests/libtest/Makefile.am clears LIBS.
  4129. save_LIBS="$LIBS"
  4130. LIBS=
  4131. dnl Check for libc variants without a separate pthread lib like bionic
  4132. AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
  4133. LIBS="$save_LIBS"
  4134. dnl on HPUX, life is more complicated...
  4135. case $host in
  4136. *-hp-hpux*)
  4137. dnl it doesn't actually work without -lpthread
  4138. USE_THREADS_POSIX=""
  4139. ;;
  4140. *)
  4141. ;;
  4142. esac
  4143. dnl if it wasn't found without lib, search for it in pthread lib
  4144. if test "$USE_THREADS_POSIX" != "1"
  4145. then
  4146. CFLAGS="$CFLAGS -pthread"
  4147. # assign PTHREAD for pkg-config use
  4148. PTHREAD=" -pthread"
  4149. AC_CHECK_LIB(pthread, pthread_create,
  4150. [USE_THREADS_POSIX=1],
  4151. [ CFLAGS="$save_CFLAGS"])
  4152. fi
  4153. if test "x$USE_THREADS_POSIX" = "x1"
  4154. then
  4155. AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
  4156. curl_res_msg="POSIX threaded"
  4157. fi
  4158. ])
  4159. fi
  4160. dnl threaded resolver check
  4161. if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then
  4162. if test "$want_pthreads" = "yes"; then
  4163. AC_MSG_ERROR([--enable-pthreads but pthreads was not found])
  4164. fi
  4165. dnl If native Windows fallback on Win32 threads since no POSIX threads
  4166. if test "$curl_cv_native_windows" = "yes"; then
  4167. USE_THREADS_WIN32=1
  4168. AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup])
  4169. curl_res_msg="Win32 threaded"
  4170. else
  4171. AC_MSG_ERROR([Threaded resolver enabled but no thread library found])
  4172. fi
  4173. fi
  4174. CURL_CONVERT_INCLUDE_TO_ISYSTEM
  4175. dnl ************************************************************
  4176. dnl disable verbose text strings
  4177. dnl
  4178. AC_MSG_CHECKING([whether to enable verbose strings])
  4179. AC_ARG_ENABLE(verbose,
  4180. AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
  4181. AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  4182. [ case "$enableval" in
  4183. no)
  4184. AC_MSG_RESULT(no)
  4185. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  4186. curl_verbose_msg="no"
  4187. ;;
  4188. *) AC_MSG_RESULT(yes)
  4189. ;;
  4190. esac ],
  4191. AC_MSG_RESULT(yes)
  4192. )
  4193. dnl ************************************************************
  4194. dnl enable SSPI support
  4195. dnl
  4196. AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
  4197. AC_ARG_ENABLE(sspi,
  4198. AC_HELP_STRING([--enable-sspi],[Enable SSPI])
  4199. AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
  4200. [ case "$enableval" in
  4201. yes)
  4202. if test "$curl_cv_native_windows" = "yes"; then
  4203. AC_MSG_RESULT(yes)
  4204. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  4205. AC_SUBST(USE_WINDOWS_SSPI, [1])
  4206. curl_sspi_msg="enabled"
  4207. else
  4208. AC_MSG_RESULT(no)
  4209. AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
  4210. fi
  4211. ;;
  4212. *)
  4213. if test "x$SCHANNEL_ENABLED" = "x1"; then
  4214. # --with-schannel implies --enable-sspi
  4215. AC_MSG_RESULT(yes)
  4216. else
  4217. AC_MSG_RESULT(no)
  4218. fi
  4219. ;;
  4220. esac ],
  4221. if test "x$SCHANNEL_ENABLED" = "x1"; then
  4222. # --with-schannel implies --enable-sspi
  4223. AC_MSG_RESULT(yes)
  4224. else
  4225. AC_MSG_RESULT(no)
  4226. fi
  4227. )
  4228. dnl ************************************************************
  4229. dnl disable cryptographic authentication
  4230. dnl
  4231. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  4232. AC_ARG_ENABLE(crypto-auth,
  4233. AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  4234. AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  4235. [ case "$enableval" in
  4236. no)
  4237. AC_MSG_RESULT(no)
  4238. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  4239. CURL_DISABLE_CRYPTO_AUTH=1
  4240. ;;
  4241. *) AC_MSG_RESULT(yes)
  4242. ;;
  4243. esac ],
  4244. AC_MSG_RESULT(yes)
  4245. )
  4246. CURL_CHECK_OPTION_NTLM_WB
  4247. CURL_CHECK_NTLM_WB
  4248. dnl ************************************************************
  4249. dnl disable TLS-SRP authentication
  4250. dnl
  4251. AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
  4252. AC_ARG_ENABLE(tls-srp,
  4253. AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
  4254. AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
  4255. [ case "$enableval" in
  4256. no)
  4257. AC_MSG_RESULT(no)
  4258. want_tls_srp=no
  4259. ;;
  4260. *) AC_MSG_RESULT(yes)
  4261. want_tls_srp=yes
  4262. ;;
  4263. esac ],
  4264. AC_MSG_RESULT(yes)
  4265. want_tls_srp=yes
  4266. )
  4267. if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then
  4268. AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
  4269. USE_TLS_SRP=1
  4270. curl_tls_srp_msg="enabled"
  4271. fi
  4272. dnl ************************************************************
  4273. dnl disable Unix domain sockets support
  4274. dnl
  4275. AC_MSG_CHECKING([whether to enable Unix domain sockets])
  4276. AC_ARG_ENABLE(unix-sockets,
  4277. AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets])
  4278. AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]),
  4279. [ case "$enableval" in
  4280. no) AC_MSG_RESULT(no)
  4281. want_unix_sockets=no
  4282. ;;
  4283. *) AC_MSG_RESULT(yes)
  4284. want_unix_sockets=yes
  4285. ;;
  4286. esac ], [
  4287. AC_MSG_RESULT(auto)
  4288. want_unix_sockets=auto
  4289. ]
  4290. )
  4291. if test "x$want_unix_sockets" != "xno"; then
  4292. AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [
  4293. AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets])
  4294. AC_SUBST(USE_UNIX_SOCKETS, [1])
  4295. curl_unix_sockets_msg="enabled"
  4296. ], [
  4297. if test "x$want_unix_sockets" = "xyes"; then
  4298. AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!])
  4299. fi
  4300. ], [
  4301. #include <sys/un.h>
  4302. ])
  4303. fi
  4304. dnl ************************************************************
  4305. dnl disable cookies support
  4306. dnl
  4307. AC_MSG_CHECKING([whether to support cookies])
  4308. AC_ARG_ENABLE(cookies,
  4309. AC_HELP_STRING([--enable-cookies],[Enable cookies support])
  4310. AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
  4311. [ case "$enableval" in
  4312. no)
  4313. AC_MSG_RESULT(no)
  4314. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  4315. ;;
  4316. *) AC_MSG_RESULT(yes)
  4317. ;;
  4318. esac ],
  4319. AC_MSG_RESULT(yes)
  4320. )
  4321. dnl ************************************************************
  4322. dnl disable socketpair
  4323. dnl
  4324. AC_MSG_CHECKING([whether to support socketpair])
  4325. AC_ARG_ENABLE(socketpair,
  4326. AC_HELP_STRING([--enable-socketpair],[Enable socketpair support])
  4327. AC_HELP_STRING([--disable-socketpair],[Disable socketpair support]),
  4328. [ case "$enableval" in
  4329. no)
  4330. AC_MSG_RESULT(no)
  4331. AC_DEFINE(CURL_DISABLE_SOCKETPAIR, 1, [to disable socketpair support])
  4332. ;;
  4333. *) AC_MSG_RESULT(yes)
  4334. ;;
  4335. esac ],
  4336. AC_MSG_RESULT(yes)
  4337. )
  4338. dnl ************************************************************
  4339. dnl disable HTTP authentication support
  4340. dnl
  4341. AC_MSG_CHECKING([whether to support HTTP authentication])
  4342. AC_ARG_ENABLE(http-auth,
  4343. AC_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support])
  4344. AC_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]),
  4345. [ case "$enableval" in
  4346. no)
  4347. AC_MSG_RESULT(no)
  4348. AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication])
  4349. ;;
  4350. *) AC_MSG_RESULT(yes)
  4351. ;;
  4352. esac ],
  4353. AC_MSG_RESULT(yes)
  4354. )
  4355. dnl ************************************************************
  4356. dnl disable DoH support
  4357. dnl
  4358. AC_MSG_CHECKING([whether to support DoH])
  4359. AC_ARG_ENABLE(doh,
  4360. AC_HELP_STRING([--enable-doh],[Enable DoH support])
  4361. AC_HELP_STRING([--disable-doh],[Disable DoH support]),
  4362. [ case "$enableval" in
  4363. no)
  4364. AC_MSG_RESULT(no)
  4365. AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH])
  4366. ;;
  4367. *) AC_MSG_RESULT(yes)
  4368. ;;
  4369. esac ],
  4370. AC_MSG_RESULT(yes)
  4371. )
  4372. dnl ************************************************************
  4373. dnl disable mime API support
  4374. dnl
  4375. AC_MSG_CHECKING([whether to support the MIME API])
  4376. AC_ARG_ENABLE(mime,
  4377. AC_HELP_STRING([--enable-mime],[Enable mime API support])
  4378. AC_HELP_STRING([--disable-mime],[Disable mime API support]),
  4379. [ case "$enableval" in
  4380. no)
  4381. AC_MSG_RESULT(no)
  4382. AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API])
  4383. ;;
  4384. *) AC_MSG_RESULT(yes)
  4385. ;;
  4386. esac ],
  4387. AC_MSG_RESULT(yes)
  4388. )
  4389. dnl ************************************************************
  4390. dnl disable date parsing
  4391. dnl
  4392. AC_MSG_CHECKING([whether to support date parsing])
  4393. AC_ARG_ENABLE(dateparse,
  4394. AC_HELP_STRING([--enable-dateparse],[Enable date parsing])
  4395. AC_HELP_STRING([--disable-dateparse],[Disable date parsing]),
  4396. [ case "$enableval" in
  4397. no)
  4398. AC_MSG_RESULT(no)
  4399. AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing])
  4400. ;;
  4401. *) AC_MSG_RESULT(yes)
  4402. ;;
  4403. esac ],
  4404. AC_MSG_RESULT(yes)
  4405. )
  4406. dnl ************************************************************
  4407. dnl disable netrc
  4408. dnl
  4409. AC_MSG_CHECKING([whether to support netrc parsing])
  4410. AC_ARG_ENABLE(netrc,
  4411. AC_HELP_STRING([--enable-netrc],[Enable netrc parsing])
  4412. AC_HELP_STRING([--disable-netrc],[Disable netrc parsing]),
  4413. [ case "$enableval" in
  4414. no)
  4415. AC_MSG_RESULT(no)
  4416. AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing])
  4417. ;;
  4418. *) AC_MSG_RESULT(yes)
  4419. ;;
  4420. esac ],
  4421. AC_MSG_RESULT(yes)
  4422. )
  4423. dnl ************************************************************
  4424. dnl disable progress-meter
  4425. dnl
  4426. AC_MSG_CHECKING([whether to support progress-meter])
  4427. AC_ARG_ENABLE(progress-meter,
  4428. AC_HELP_STRING([--enable-progress-meter],[Enable progress-meter])
  4429. AC_HELP_STRING([--disable-progress-meter],[Disable progress-meter]),
  4430. [ case "$enableval" in
  4431. no)
  4432. AC_MSG_RESULT(no)
  4433. AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter])
  4434. ;;
  4435. *) AC_MSG_RESULT(yes)
  4436. ;;
  4437. esac ],
  4438. AC_MSG_RESULT(yes)
  4439. )
  4440. dnl ************************************************************
  4441. dnl disable shuffle DNS support
  4442. dnl
  4443. AC_MSG_CHECKING([whether to support DNS shuffling])
  4444. AC_ARG_ENABLE(dnsshuffle,
  4445. AC_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling])
  4446. AC_HELP_STRING([--disable-dnsshuffle],[Disable DNS shuffling]),
  4447. [ case "$enableval" in
  4448. no)
  4449. AC_MSG_RESULT(no)
  4450. AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling])
  4451. ;;
  4452. *) AC_MSG_RESULT(yes)
  4453. ;;
  4454. esac ],
  4455. AC_MSG_RESULT(yes)
  4456. )
  4457. dnl ************************************************************
  4458. dnl disable the curl_easy_options API
  4459. dnl
  4460. AC_MSG_CHECKING([whether to support curl_easy_option*])
  4461. AC_ARG_ENABLE(get-easy-option,
  4462. AC_HELP_STRING([--enable-get-easy-options],[Enable curl_easy_options])
  4463. AC_HELP_STRING([--disable-get-easy-options],[Disable curl_easy_options]),
  4464. [ case "$enableval" in
  4465. no)
  4466. AC_MSG_RESULT(no)
  4467. AC_DEFINE(CURL_DISABLE_GETOPTIONS, 1, [to disable curl_easy_options])
  4468. ;;
  4469. *) AC_MSG_RESULT(yes)
  4470. ;;
  4471. esac ],
  4472. AC_MSG_RESULT(yes)
  4473. )
  4474. dnl ************************************************************
  4475. dnl switch on/off alt-svc
  4476. dnl
  4477. AC_MSG_CHECKING([whether to support alt-svc])
  4478. AC_ARG_ENABLE(alt-svc,
  4479. AC_HELP_STRING([--enable-alt-svc],[Enable alt-svc support])
  4480. AC_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]),
  4481. [ case "$enableval" in
  4482. no)
  4483. AC_MSG_RESULT(no)
  4484. AC_DEFINE(CURL_DISABLE_ALTSVC, 1, [disable alt-svc])
  4485. curl_altsvc_msg="no";
  4486. enable_altsvc="no"
  4487. ;;
  4488. *) AC_MSG_RESULT(yes)
  4489. ;;
  4490. esac ],
  4491. AC_MSG_RESULT(no)
  4492. )
  4493. dnl ************************************************************
  4494. dnl switch on/off hsts
  4495. dnl
  4496. curl_hsts_msg="no (--enable-hsts)";
  4497. AC_MSG_CHECKING([whether to support HSTS])
  4498. AC_ARG_ENABLE(hsts,
  4499. AC_HELP_STRING([--enable-hsts],[Enable HSTS support])
  4500. AC_HELP_STRING([--disable-hsts],[Disable HSTS support]),
  4501. [ case "$enableval" in
  4502. no)
  4503. AC_MSG_RESULT(no)
  4504. ;;
  4505. *) AC_MSG_RESULT(yes)
  4506. curl_hsts_msg="enabled";
  4507. enable_hsts="yes"
  4508. ;;
  4509. esac ],
  4510. AC_MSG_RESULT(no)
  4511. )
  4512. if test "$enable_hsts" = "yes"; then
  4513. AC_DEFINE(USE_HSTS, 1, [to enable HSTS])
  4514. experimental="$experimental HSTS"
  4515. fi
  4516. dnl *************************************************************
  4517. dnl check whether ECH support, if desired, is actually available
  4518. dnl
  4519. if test "x$want_ech" != "xno"; then
  4520. AC_MSG_CHECKING([whether ECH support is available])
  4521. dnl assume NOT and look for sufficient condition
  4522. ECH_ENABLED=0
  4523. ECH_SUPPORT=''
  4524. dnl OpenSSL with a chosen ECH function should be enough
  4525. dnl so more exhaustive checking seems unnecessary for now
  4526. if test "x$OPENSSL_ENABLED" = "x1"; then
  4527. AC_CHECK_FUNCS(SSL_get_ech_status,
  4528. ECH_SUPPORT="ECH support available (OpenSSL with SSL_get_ech_status)"
  4529. ECH_ENABLED=1)
  4530. dnl add 'elif' chain here for additional implementations
  4531. fi
  4532. dnl now deal with whatever we found
  4533. if test "x$ECH_ENABLED" = "x1"; then
  4534. AC_DEFINE(USE_ECH, 1, [if ECH support is available])
  4535. AC_MSG_RESULT($ECH_SUPPORT)
  4536. experimental="$experimental ECH"
  4537. else
  4538. AC_MSG_ERROR([--enable-ech ignored: No ECH support found])
  4539. fi
  4540. fi
  4541. dnl ************************************************************
  4542. dnl hiding of library internal symbols
  4543. dnl
  4544. CURL_CONFIGURE_SYMBOL_HIDING
  4545. dnl
  4546. dnl All the library dependencies put into $LIB apply to libcurl only.
  4547. dnl
  4548. LIBCURL_LIBS="$LIBS$PTHREAD"
  4549. AC_SUBST(LIBCURL_LIBS)
  4550. AC_SUBST(CURL_NETWORK_LIBS)
  4551. AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
  4552. dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
  4553. dnl LIBS variable used in generated makefile at makefile processing
  4554. dnl time. Doing this functionally prevents LIBS from being used for
  4555. dnl all link targets in given makefile.
  4556. BLANK_AT_MAKETIME=
  4557. AC_SUBST(BLANK_AT_MAKETIME)
  4558. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  4559. dnl yes or no
  4560. ENABLE_SHARED="$enable_shared"
  4561. AC_SUBST(ENABLE_SHARED)
  4562. dnl to let curl-config output the static libraries correctly
  4563. ENABLE_STATIC="$enable_static"
  4564. AC_SUBST(ENABLE_STATIC)
  4565. dnl merge the pkg-config Libs.private field into Libs when static-only
  4566. if test "x$enable_shared" = "xno"; then
  4567. LIBCURL_NO_SHARED=$LIBCURL_LIBS
  4568. else
  4569. LIBCURL_NO_SHARED=
  4570. fi
  4571. AC_SUBST(LIBCURL_NO_SHARED)
  4572. dnl
  4573. dnl For keeping supported features and protocols also in pkg-config file
  4574. dnl since it is more cross-compile friendly than curl-config
  4575. dnl
  4576. if test "x$OPENSSL_ENABLED" = "x1"; then
  4577. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  4578. elif test -n "$SSL_ENABLED"; then
  4579. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  4580. fi
  4581. if test "x$IPV6_ENABLED" = "x1"; then
  4582. SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
  4583. fi
  4584. if test "x$USE_UNIX_SOCKETS" = "x1"; then
  4585. SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets"
  4586. fi
  4587. if test "x$HAVE_LIBZ" = "x1"; then
  4588. SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
  4589. fi
  4590. if test "x$HAVE_BROTLI" = "x1"; then
  4591. SUPPORT_FEATURES="$SUPPORT_FEATURES brotli"
  4592. fi
  4593. if test "x$HAVE_ZSTD" = "x1"; then
  4594. SUPPORT_FEATURES="$SUPPORT_FEATURES zstd"
  4595. fi
  4596. if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \
  4597. -o "x$USE_THREADS_WIN32" = "x1"; then
  4598. SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
  4599. fi
  4600. if test "x$IDN_ENABLED" = "x1"; then
  4601. SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
  4602. fi
  4603. if test "x$USE_WINDOWS_SSPI" = "x1"; then
  4604. SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
  4605. fi
  4606. if test "x$HAVE_GSSAPI" = "x1"; then
  4607. SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API"
  4608. fi
  4609. if test "x$curl_psl_msg" = "xenabled"; then
  4610. SUPPORT_FEATURES="$SUPPORT_FEATURES PSL"
  4611. fi
  4612. if test "x$curl_gsasl_msg" = "xenabled"; then
  4613. SUPPORT_FEATURES="$SUPPORT_FEATURES GSASL"
  4614. fi
  4615. if test "x$enable_altsvc" = "xyes"; then
  4616. SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc"
  4617. fi
  4618. if test "x$enable_hsts" = "xyes"; then
  4619. SUPPORT_FEATURES="$SUPPORT_FEATURES HSTS"
  4620. fi
  4621. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  4622. \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
  4623. SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO"
  4624. fi
  4625. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \
  4626. \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then
  4627. SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos"
  4628. fi
  4629. if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then
  4630. if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
  4631. -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
  4632. -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
  4633. -o "x$WOLFSSL_NTLM" = "x1"; then
  4634. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
  4635. if test "x$CURL_DISABLE_HTTP" != "x1" -a \
  4636. "x$NTLM_WB_ENABLED" = "x1"; then
  4637. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
  4638. fi
  4639. fi
  4640. fi
  4641. if test "x$USE_TLS_SRP" = "x1"; then
  4642. SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
  4643. fi
  4644. if test "x$USE_NGHTTP2" = "x1" -o "x$USE_HYPER" = "x1"; then
  4645. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2"
  4646. fi
  4647. if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then
  4648. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3"
  4649. fi
  4650. if test "x$CURL_WITH_MULTI_SSL" = "x1"; then
  4651. SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL"
  4652. fi
  4653. dnl if not explictily turned off, HTTPS-proxy comes with some TLS backends
  4654. if test "x$https_proxy" != "xno"; then
  4655. if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \
  4656. -o "x$NSS_ENABLED" = "x1"; then
  4657. SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy"
  4658. fi
  4659. fi
  4660. if test "x$ECH_ENABLED" = "x1"; then
  4661. SUPPORT_FEATURES="$SUPPORT_FEATURES ECH"
  4662. fi
  4663. dnl replace spaces with newlines
  4664. dnl sort the lines
  4665. dnl replace the newlines back to spaces
  4666. SUPPORT_FEATURES=`echo $SUPPORT_FEATURES | tr ' ' '\012' | sort | tr '\012' ' '`
  4667. AC_SUBST(SUPPORT_FEATURES)
  4668. dnl For supported protocols in pkg-config file
  4669. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  4670. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
  4671. if test "x$SSL_ENABLED" = "x1"; then
  4672. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
  4673. fi
  4674. fi
  4675. if test "x$CURL_DISABLE_FTP" != "x1"; then
  4676. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
  4677. if test "x$SSL_ENABLED" = "x1"; then
  4678. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
  4679. fi
  4680. fi
  4681. if test "x$CURL_DISABLE_FILE" != "x1"; then
  4682. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
  4683. fi
  4684. if test "x$CURL_DISABLE_TELNET" != "x1"; then
  4685. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
  4686. fi
  4687. if test "x$CURL_DISABLE_LDAP" != "x1"; then
  4688. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
  4689. if test "x$CURL_DISABLE_LDAPS" != "x1"; then
  4690. if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
  4691. (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
  4692. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
  4693. fi
  4694. fi
  4695. fi
  4696. if test "x$CURL_DISABLE_DICT" != "x1"; then
  4697. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
  4698. fi
  4699. if test "x$CURL_DISABLE_TFTP" != "x1"; then
  4700. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
  4701. fi
  4702. if test "x$CURL_DISABLE_GOPHER" != "x1"; then
  4703. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
  4704. if test "x$SSL_ENABLED" = "x1"; then
  4705. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHERS"
  4706. fi
  4707. fi
  4708. if test "x$CURL_DISABLE_MQTT" != "x1"; then
  4709. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS MQTT"
  4710. fi
  4711. if test "x$CURL_DISABLE_POP3" != "x1"; then
  4712. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
  4713. if test "x$SSL_ENABLED" = "x1"; then
  4714. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
  4715. fi
  4716. fi
  4717. if test "x$CURL_DISABLE_IMAP" != "x1"; then
  4718. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
  4719. if test "x$SSL_ENABLED" = "x1"; then
  4720. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
  4721. fi
  4722. fi
  4723. if test "x$CURL_DISABLE_SMB" != "x1" \
  4724. -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \
  4725. -a \( "x$OPENSSL_ENABLED" = "x1" \
  4726. -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \
  4727. -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \
  4728. -o "x$WOLFSSL_NTLM" = "x1" \); then
  4729. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB"
  4730. if test "x$SSL_ENABLED" = "x1"; then
  4731. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS"
  4732. fi
  4733. fi
  4734. if test "x$CURL_DISABLE_SMTP" != "x1"; then
  4735. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
  4736. if test "x$SSL_ENABLED" = "x1"; then
  4737. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
  4738. fi
  4739. fi
  4740. if test "x$USE_LIBSSH2" = "x1"; then
  4741. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  4742. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  4743. fi
  4744. if test "x$USE_LIBSSH" = "x1"; then
  4745. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  4746. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  4747. fi
  4748. if test "x$USE_WOLFSSH" = "x1"; then
  4749. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  4750. fi
  4751. if test "x$CURL_DISABLE_RTSP" != "x1"; then
  4752. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
  4753. fi
  4754. if test "x$USE_LIBRTMP" = "x1"; then
  4755. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
  4756. fi
  4757. dnl replace spaces with newlines
  4758. dnl sort the lines
  4759. dnl replace the newlines back to spaces
  4760. SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
  4761. AC_SUBST(SUPPORT_PROTOCOLS)
  4762. dnl squeeze whitespace out of some variables
  4763. squeeze CFLAGS
  4764. squeeze CPPFLAGS
  4765. squeeze DEFS
  4766. squeeze LDFLAGS
  4767. squeeze LIBS
  4768. squeeze LIBCURL_LIBS
  4769. squeeze CURL_NETWORK_LIBS
  4770. squeeze CURL_NETWORK_AND_TIME_LIBS
  4771. squeeze SUPPORT_FEATURES
  4772. squeeze SUPPORT_PROTOCOLS
  4773. XC_CHECK_BUILD_FLAGS
  4774. SSL_BACKENDS=${ssl_backends}
  4775. AC_SUBST(SSL_BACKENDS)
  4776. if test "x$want_curldebug_assumed" = "xyes" &&
  4777. test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
  4778. ac_configure_args="$ac_configure_args --enable-curldebug"
  4779. fi
  4780. AC_CONFIG_FILES([Makefile \
  4781. docs/Makefile \
  4782. docs/examples/Makefile \
  4783. docs/libcurl/Makefile \
  4784. docs/libcurl/opts/Makefile \
  4785. docs/cmdline-opts/Makefile \
  4786. include/Makefile \
  4787. include/curl/Makefile \
  4788. src/Makefile \
  4789. lib/Makefile \
  4790. scripts/Makefile \
  4791. lib/libcurl.vers \
  4792. tests/Makefile \
  4793. tests/certs/Makefile \
  4794. tests/certs/scripts/Makefile \
  4795. tests/data/Makefile \
  4796. tests/server/Makefile \
  4797. tests/libtest/Makefile \
  4798. tests/unit/Makefile \
  4799. packages/Makefile \
  4800. packages/vms/Makefile \
  4801. curl-config \
  4802. libcurl.pc
  4803. ])
  4804. AC_OUTPUT
  4805. CURL_GENERATE_CONFIGUREHELP_PM
  4806. XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
  4807. AC_MSG_NOTICE([Configured to build curl/libcurl:
  4808. Host setup: ${host}
  4809. Install prefix: ${prefix}
  4810. Compiler: ${CC}
  4811. CFLAGS: ${CFLAGS}
  4812. CPPFLAGS: ${CPPFLAGS}
  4813. LDFLAGS: ${LDFLAGS}
  4814. LIBS: ${LIBS}
  4815. curl version: ${CURLVERSION}
  4816. SSL: ${curl_ssl_msg}
  4817. SSH: ${curl_ssh_msg}
  4818. zlib: ${curl_zlib_msg}
  4819. brotli: ${curl_brotli_msg}
  4820. zstd: ${curl_zstd_msg}
  4821. GSS-API: ${curl_gss_msg}
  4822. GSASL: ${curl_gsasl_msg}
  4823. TLS-SRP: ${curl_tls_srp_msg}
  4824. resolver: ${curl_res_msg}
  4825. IPv6: ${curl_ipv6_msg}
  4826. Unix sockets: ${curl_unix_sockets_msg}
  4827. IDN: ${curl_idn_msg}
  4828. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  4829. Built-in manual: ${curl_manual_msg}
  4830. --libcurl option: ${curl_libcurl_msg}
  4831. Verbose errors: ${curl_verbose_msg}
  4832. Code coverage: ${curl_coverage_msg}
  4833. SSPI: ${curl_sspi_msg}
  4834. ca cert bundle: ${ca}${ca_warning}
  4835. ca cert path: ${capath}${capath_warning}
  4836. ca fallback: ${with_ca_fallback}
  4837. LDAP: ${curl_ldap_msg}
  4838. LDAPS: ${curl_ldaps_msg}
  4839. RTSP: ${curl_rtsp_msg}
  4840. RTMP: ${curl_rtmp_msg}
  4841. Metalink: ${curl_mtlnk_msg}
  4842. PSL: ${curl_psl_msg}
  4843. Alt-svc: ${curl_altsvc_msg}
  4844. HTTP1: ${curl_h1_msg}
  4845. HTTP2: ${curl_h2_msg}
  4846. HTTP3: ${curl_h3_msg}
  4847. ECH: ${curl_ech_msg}
  4848. Protocols: ${SUPPORT_PROTOCOLS}
  4849. Features: ${SUPPORT_FEATURES}
  4850. ])
  4851. if test -n "$experimental"; then
  4852. cat >&2 << _EOF
  4853. WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution!
  4854. _EOF
  4855. fi