configure.ac 149 KB

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