configure.ac 153 KB

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