configure.ac 133 KB

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