2
0

configure.ac 147 KB

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