configure.ac 139 KB

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