configure.ac 134 KB

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