2
0

configure.ac 155 KB

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