configure.ac 100 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2012, 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 http://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: http://curl.haxx.se/mail/])
  26. XC_OVR_ZZ50
  27. CURL_OVERRIDE_AUTOCONF
  28. dnl configure script copyright
  29. AC_COPYRIGHT([Copyright (c) 1998 - 2011 Daniel Stenberg, <daniel@haxx.se>
  30. This configure script may be copied, distributed and modified under the
  31. terms of the curl license; see COPYING for more details])
  32. AC_CONFIG_SRCDIR([lib/urldata.h])
  33. AM_CONFIG_HEADER(lib/curl_config.h include/curl/curlbuild.h)
  34. AC_CONFIG_MACRO_DIR([m4])
  35. AM_MAINTAINER_MODE
  36. CURL_CHECK_OPTION_DEBUG
  37. CURL_CHECK_OPTION_OPTIMIZE
  38. CURL_CHECK_OPTION_WARNINGS
  39. CURL_CHECK_OPTION_WERROR
  40. CURL_CHECK_OPTION_CURLDEBUG
  41. CURL_CHECK_OPTION_SYMBOL_HIDING
  42. CURL_CHECK_OPTION_ARES
  43. CURL_CHECK_PATH_SEPARATOR_REQUIRED
  44. #
  45. # save the configure arguments
  46. #
  47. CONFIGURE_OPTIONS="\"$ac_configure_args\""
  48. AC_SUBST(CONFIGURE_OPTIONS)
  49. CURL_CFLAG_EXTRAS=""
  50. if test X"$want_werror" = Xyes; then
  51. CURL_CFLAG_EXTRAS="-Werror"
  52. fi
  53. AC_SUBST(CURL_CFLAG_EXTRAS)
  54. dnl SED is mandatory for configure process and libtool.
  55. dnl Set it now, allowing it to be changed later.
  56. if test -z "$SED"; then
  57. dnl allow it to be overridden
  58. AC_PATH_PROG([SED], [sed], [not_found],
  59. [$PATH:/usr/bin:/usr/local/bin])
  60. if test -z "$SED" || test "$SED" = "not_found"; then
  61. AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
  62. fi
  63. fi
  64. AC_SUBST([SED])
  65. dnl GREP is mandatory for configure process and libtool.
  66. dnl Set it now, allowing it to be changed later.
  67. if test -z "$GREP"; then
  68. dnl allow it to be overridden
  69. AC_PATH_PROG([GREP], [grep], [not_found],
  70. [$PATH:/usr/bin:/usr/local/bin])
  71. if test -z "$GREP" || test "$GREP" = "not_found"; then
  72. AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
  73. fi
  74. fi
  75. AC_SUBST([GREP])
  76. dnl EGREP is mandatory for configure process and libtool.
  77. dnl Set it now, allowing it to be changed later.
  78. if test -z "$EGREP"; then
  79. dnl allow it to be overridden
  80. if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
  81. AC_MSG_CHECKING([for egrep])
  82. EGREP="$GREP -E"
  83. AC_MSG_RESULT([$EGREP])
  84. else
  85. AC_PATH_PROG([EGREP], [egrep], [not_found],
  86. [$PATH:/usr/bin:/usr/local/bin])
  87. fi
  88. fi
  89. if test -z "$EGREP" || test "$EGREP" = "not_found"; then
  90. AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
  91. fi
  92. AC_SUBST([EGREP])
  93. dnl AR is mandatory for configure process and libtool.
  94. dnl This is target dependent, so check it as a tool.
  95. if test -z "$AR"; then
  96. dnl allow it to be overridden
  97. AC_PATH_TOOL([AR], [ar], [not_found],
  98. [$PATH:/usr/bin:/usr/local/bin])
  99. if test -z "$AR" || test "$AR" = "not_found"; then
  100. AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
  101. fi
  102. fi
  103. AC_SUBST([AR])
  104. AC_SUBST(libext)
  105. dnl Remove non-configure distributed curlbuild.h
  106. if test -f ${srcdir}/include/curl/curlbuild.h; then
  107. rm -f ${srcdir}/include/curl/curlbuild.h
  108. fi
  109. dnl figure out the libcurl version
  110. CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
  111. AM_INIT_AUTOMAKE
  112. AC_MSG_CHECKING([curl version])
  113. AC_MSG_RESULT($CURLVERSION)
  114. AC_SUBST(CURLVERSION)
  115. dnl
  116. dnl we extract the numerical version for curl-config only
  117. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
  118. AC_SUBST(VERSIONNUM)
  119. dnl Solaris pkgadd support definitions
  120. PKGADD_PKG="HAXXcurl"
  121. PKGADD_NAME="cURL - a client that groks URLs"
  122. PKGADD_VENDOR="curl.haxx.se"
  123. AC_SUBST(PKGADD_PKG)
  124. AC_SUBST(PKGADD_NAME)
  125. AC_SUBST(PKGADD_VENDOR)
  126. dnl
  127. dnl initialize all the info variables
  128. curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl} )"
  129. curl_ssh_msg="no (--with-libssh2)"
  130. curl_zlib_msg="no (--with-zlib)"
  131. curl_krb4_msg="no (--with-krb4*)"
  132. curl_gss_msg="no (--with-gssapi)"
  133. curl_spnego_msg="no (--with-spnego)"
  134. curl_tls_srp_msg="no (--enable-tls-srp)"
  135. curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
  136. curl_ipv6_msg="no (--enable-ipv6)"
  137. curl_idn_msg="no (--with-libidn)"
  138. curl_manual_msg="no (--enable-manual)"
  139. curl_libcurl_msg="enabled (--disable-libcurl-option)"
  140. curl_verbose_msg="enabled (--disable-verbose)"
  141. curl_sspi_msg="no (--enable-sspi)"
  142. curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
  143. curl_ldaps_msg="no (--enable-ldaps)"
  144. curl_rtsp_msg="no (--enable-rtsp)"
  145. curl_rtmp_msg="no (--with-librtmp)"
  146. curl_mtlnk_msg="no (--with-libmetalink)"
  147. init_ssl_msg=${curl_ssl_msg}
  148. dnl
  149. dnl Save anything in $LIBS for later
  150. dnl
  151. ALL_LIBS=$LIBS
  152. dnl
  153. dnl Detect the canonical host and target build environment
  154. dnl
  155. AC_CANONICAL_HOST
  156. dnl Get system canonical name
  157. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  158. dnl Checks for programs.
  159. CURL_CHECK_PROG_CC
  160. dnl Our curl_off_t internal and external configure settings
  161. CURL_CONFIGURE_CURL_OFF_T
  162. dnl This defines _ALL_SOURCE for AIX
  163. CURL_CHECK_AIX_ALL_SOURCE
  164. dnl Our configure and build reentrant settings
  165. CURL_CONFIGURE_THREAD_SAFE
  166. CURL_CONFIGURE_REENTRANT
  167. dnl check for how to do large files
  168. AC_SYS_LARGEFILE
  169. dnl support building of Windows DLLs
  170. AC_LIBTOOL_WIN32_DLL
  171. dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD
  172. AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)])
  173. case $host in
  174. x86_64*linux*|amd64*freebsd*|ia64*freebsd*)
  175. AC_MSG_RESULT([yes])
  176. with_pic=yes
  177. ;;
  178. *)
  179. AC_MSG_RESULT([no])
  180. ;;
  181. esac
  182. AC_MSG_CHECKING([if compiler is icc (to build with PIC)])
  183. case $CC in
  184. icc | */icc)
  185. AC_MSG_RESULT([yes])
  186. with_pic=yes
  187. ;;
  188. *)
  189. AC_MSG_RESULT([no])
  190. ;;
  191. esac
  192. dnl libtool setup
  193. AC_PROG_LIBTOOL
  194. AC_MSG_CHECKING([if we need -mimpure-text])
  195. mimpure=no
  196. case $host in
  197. *-*-solaris2*)
  198. if test "$GCC" = "yes"; then
  199. mimpure="yes"
  200. fi
  201. ;;
  202. *)
  203. ;;
  204. esac
  205. AC_MSG_RESULT($mimpure)
  206. AM_CONDITIONAL(MIMPURE, test x$mimpure = xyes)
  207. AC_MSG_CHECKING([if we need BUILDING_LIBCURL])
  208. use_cppflag_building_libcurl="no"
  209. use_cppflag_curl_staticlib="no"
  210. CPPFLAG_CURL_STATICLIB=""
  211. case $host in
  212. *-*-mingw*)
  213. AC_MSG_RESULT(yes)
  214. use_cppflag_building_libcurl="yes"
  215. AC_MSG_CHECKING([if we need CURL_STATICLIB])
  216. if test "X$enable_shared" = "Xno"
  217. then
  218. AC_MSG_RESULT(yes)
  219. use_cppflag_curl_staticlib="yes"
  220. CPPFLAG_CURL_STATICLIB="-DCURL_STATICLIB"
  221. else
  222. AC_MSG_RESULT(no)
  223. fi
  224. ;;
  225. *)
  226. AC_MSG_RESULT(no)
  227. ;;
  228. esac
  229. AM_CONDITIONAL(USE_CPPFLAG_BUILDING_LIBCURL, test x$use_cppflag_building_libcurl = xyes)
  230. AM_CONDITIONAL(USE_CPPFLAG_CURL_STATICLIB, test x$use_cppflag_curl_staticlib = xyes)
  231. AC_SUBST(CPPFLAG_CURL_STATICLIB)
  232. # Determine whether all dependent libraries must be specified when linking
  233. if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
  234. then
  235. REQUIRE_LIB_DEPS=no
  236. else
  237. REQUIRE_LIB_DEPS=yes
  238. fi
  239. AC_SUBST(REQUIRE_LIB_DEPS)
  240. dnl The install stuff has already been taken care of by the automake stuff
  241. dnl AC_PROG_INSTALL
  242. AC_PROG_MAKE_SET
  243. dnl check if there's a way to force code inline
  244. AC_C_INLINE
  245. dnl **********************************************************************
  246. dnl platform/compiler/architecture specific checks/flags
  247. dnl **********************************************************************
  248. CURL_CHECK_COMPILER
  249. CURL_SET_COMPILER_BASIC_OPTS
  250. CURL_SET_COMPILER_DEBUG_OPTS
  251. CURL_SET_COMPILER_OPTIMIZE_OPTS
  252. CURL_SET_COMPILER_WARNING_OPTS
  253. if test "$compiler_id" = "INTEL_UNIX_C"; then
  254. #
  255. if test "$compiler_num" -ge "1000"; then
  256. dnl icc 10.X or later
  257. CFLAGS="$CFLAGS -shared-intel"
  258. elif test "$compiler_num" -ge "900"; then
  259. dnl icc 9.X specific
  260. CFLAGS="$CFLAGS -i-dynamic"
  261. fi
  262. #
  263. fi
  264. CURL_CHECK_COMPILER_HALT_ON_ERROR
  265. CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
  266. CURL_CHECK_COMPILER_SYMBOL_HIDING
  267. CURL_CHECK_NO_UNDEFINED
  268. AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes)
  269. CURL_CHECK_CURLDEBUG
  270. AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
  271. supports_unittests=yes
  272. # cross-compilation of unit tests static library/programs fails when
  273. # libcurl shared library is built. This might be due to a libtool or
  274. # automake issue. In this case we disable unit tests.
  275. if test "x$cross_compiling" != "xno" &&
  276. test "x$enable_shared" != "xno"; then
  277. supports_unittests=no
  278. fi
  279. # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
  280. # a problem related with OpenSSL headers and library versions not matching.
  281. # Disable unit tests while time to further investigate this is found.
  282. case $host in
  283. mips-sgi-irix6.5)
  284. if test "$compiler_id" = "GNU_C"; then
  285. supports_unittests=no
  286. fi
  287. ;;
  288. esac
  289. # All AIX autobuilds fails unit tests linking against unittests library
  290. # due to unittests library being built with no symbols or members. Libtool ?
  291. # Disable unit tests while time to further investigate this is found.
  292. case $host_os in
  293. aix*)
  294. supports_unittests=no
  295. ;;
  296. esac
  297. dnl Build unit tests when option --enable-debug is given.
  298. if test "x$want_debug" = "xyes" &&
  299. test "x$supports_unittests" = "xyes"; then
  300. want_unittests=yes
  301. else
  302. want_unittests=no
  303. fi
  304. AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
  305. dnl **********************************************************************
  306. dnl Compilation based checks should not be done before this point.
  307. dnl **********************************************************************
  308. dnl **********************************************************************
  309. dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
  310. dnl and ws2tcpip.h take precedence over any other further checks which
  311. dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
  312. dnl this specific header files. And do them before its results are used.
  313. dnl **********************************************************************
  314. CURL_CHECK_HEADER_WINDOWS
  315. CURL_CHECK_NATIVE_WINDOWS
  316. case X-"$ac_cv_native_windows" in
  317. X-yes)
  318. CURL_CHECK_HEADER_WINSOCK
  319. CURL_CHECK_HEADER_WINSOCK2
  320. CURL_CHECK_HEADER_WS2TCPIP
  321. CURL_CHECK_HEADER_WINLDAP
  322. CURL_CHECK_HEADER_WINBER
  323. ;;
  324. *)
  325. ac_cv_header_winsock_h="no"
  326. ac_cv_header_winsock2_h="no"
  327. ac_cv_header_ws2tcpip_h="no"
  328. ac_cv_header_winldap_h="no"
  329. ac_cv_header_winber_h="no"
  330. ;;
  331. esac
  332. CURL_CHECK_WIN32_LARGEFILE
  333. dnl ************************************************************
  334. dnl switch off particular protocols
  335. dnl
  336. AC_MSG_CHECKING([whether to support http])
  337. AC_ARG_ENABLE(http,
  338. AC_HELP_STRING([--enable-http],[Enable HTTP support])
  339. AC_HELP_STRING([--disable-http],[Disable HTTP support]),
  340. [ case "$enableval" in
  341. no)
  342. AC_MSG_RESULT(no)
  343. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  344. AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
  345. AC_SUBST(CURL_DISABLE_HTTP, [1])
  346. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  347. AC_SUBST(CURL_DISABLE_RTSP, [1])
  348. ;;
  349. *) AC_MSG_RESULT(yes)
  350. ;;
  351. esac ],
  352. AC_MSG_RESULT(yes)
  353. )
  354. AC_MSG_CHECKING([whether to support ftp])
  355. AC_ARG_ENABLE(ftp,
  356. AC_HELP_STRING([--enable-ftp],[Enable FTP support])
  357. AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
  358. [ case "$enableval" in
  359. no)
  360. AC_MSG_RESULT(no)
  361. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  362. AC_SUBST(CURL_DISABLE_FTP, [1])
  363. ;;
  364. *) AC_MSG_RESULT(yes)
  365. ;;
  366. esac ],
  367. AC_MSG_RESULT(yes)
  368. )
  369. AC_MSG_CHECKING([whether to support file])
  370. AC_ARG_ENABLE(file,
  371. AC_HELP_STRING([--enable-file],[Enable FILE support])
  372. AC_HELP_STRING([--disable-file],[Disable FILE support]),
  373. [ case "$enableval" in
  374. no)
  375. AC_MSG_RESULT(no)
  376. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  377. AC_SUBST(CURL_DISABLE_FILE, [1])
  378. ;;
  379. *) AC_MSG_RESULT(yes)
  380. ;;
  381. esac ],
  382. AC_MSG_RESULT(yes)
  383. )
  384. AC_MSG_CHECKING([whether to support ldap])
  385. AC_ARG_ENABLE(ldap,
  386. AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
  387. AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  388. [ case "$enableval" in
  389. no)
  390. AC_MSG_RESULT(no)
  391. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  392. AC_SUBST(CURL_DISABLE_LDAP, [1])
  393. ;;
  394. *)
  395. AC_MSG_RESULT(yes)
  396. ;;
  397. esac ],[
  398. AC_MSG_RESULT(yes) ]
  399. )
  400. AC_MSG_CHECKING([whether to support ldaps])
  401. AC_ARG_ENABLE(ldaps,
  402. AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
  403. AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
  404. [ case "$enableval" in
  405. no)
  406. AC_MSG_RESULT(no)
  407. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  408. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  409. ;;
  410. *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  411. AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
  412. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  413. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  414. else
  415. AC_MSG_RESULT(yes)
  416. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  417. AC_SUBST(HAVE_LDAP_SSL, [1])
  418. fi
  419. ;;
  420. esac ],[
  421. if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  422. AC_MSG_RESULT(no)
  423. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  424. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  425. else
  426. AC_MSG_RESULT(yes)
  427. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  428. AC_SUBST(HAVE_LDAP_SSL, [1])
  429. fi ]
  430. )
  431. AC_MSG_CHECKING([whether to support rtsp])
  432. AC_ARG_ENABLE(rtsp,
  433. AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
  434. AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
  435. [ case "$enableval" in
  436. no)
  437. AC_MSG_RESULT(no)
  438. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  439. AC_SUBST(CURL_DISABLE_RTSP, [1])
  440. ;;
  441. *) if test x$CURL_DISABLE_HTTP = x1 ; then
  442. AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
  443. else
  444. AC_MSG_RESULT(yes)
  445. curl_rtsp_msg="enabled"
  446. fi
  447. ;;
  448. esac ],
  449. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  450. AC_MSG_RESULT(yes)
  451. curl_rtsp_msg="enabled"
  452. else
  453. AC_MSG_RESULT(no)
  454. fi
  455. )
  456. AC_MSG_CHECKING([whether to support proxies])
  457. AC_ARG_ENABLE(proxy,
  458. AC_HELP_STRING([--enable-proxy],[Enable proxy support])
  459. AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
  460. [ case "$enableval" in
  461. no)
  462. AC_MSG_RESULT(no)
  463. AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
  464. AC_SUBST(CURL_DISABLE_PROXY, [1])
  465. ;;
  466. *) AC_MSG_RESULT(yes)
  467. ;;
  468. esac ],
  469. AC_MSG_RESULT(yes)
  470. )
  471. AC_MSG_CHECKING([whether to support dict])
  472. AC_ARG_ENABLE(dict,
  473. AC_HELP_STRING([--enable-dict],[Enable DICT support])
  474. AC_HELP_STRING([--disable-dict],[Disable DICT support]),
  475. [ case "$enableval" in
  476. no)
  477. AC_MSG_RESULT(no)
  478. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  479. AC_SUBST(CURL_DISABLE_DICT, [1])
  480. ;;
  481. *) AC_MSG_RESULT(yes)
  482. ;;
  483. esac ],
  484. AC_MSG_RESULT(yes)
  485. )
  486. AC_MSG_CHECKING([whether to support telnet])
  487. AC_ARG_ENABLE(telnet,
  488. AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
  489. AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  490. [ case "$enableval" in
  491. no)
  492. AC_MSG_RESULT(no)
  493. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  494. AC_SUBST(CURL_DISABLE_TELNET, [1])
  495. ;;
  496. *) AC_MSG_RESULT(yes)
  497. ;;
  498. esac ],
  499. AC_MSG_RESULT(yes)
  500. )
  501. AC_MSG_CHECKING([whether to support tftp])
  502. AC_ARG_ENABLE(tftp,
  503. AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
  504. AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
  505. [ case "$enableval" in
  506. no)
  507. AC_MSG_RESULT(no)
  508. AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
  509. AC_SUBST(CURL_DISABLE_TFTP, [1])
  510. ;;
  511. *) AC_MSG_RESULT(yes)
  512. ;;
  513. esac ],
  514. AC_MSG_RESULT(yes)
  515. )
  516. AC_MSG_CHECKING([whether to support pop3])
  517. AC_ARG_ENABLE(pop3,
  518. AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
  519. AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
  520. [ case "$enableval" in
  521. no)
  522. AC_MSG_RESULT(no)
  523. AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
  524. AC_SUBST(CURL_DISABLE_POP3, [1])
  525. ;;
  526. *) AC_MSG_RESULT(yes)
  527. ;;
  528. esac ],
  529. AC_MSG_RESULT(yes)
  530. )
  531. AC_MSG_CHECKING([whether to support imap])
  532. AC_ARG_ENABLE(imap,
  533. AC_HELP_STRING([--enable-imap],[Enable IMAP support])
  534. AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
  535. [ case "$enableval" in
  536. no)
  537. AC_MSG_RESULT(no)
  538. AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
  539. AC_SUBST(CURL_DISABLE_IMAP, [1])
  540. ;;
  541. *) AC_MSG_RESULT(yes)
  542. ;;
  543. esac ],
  544. AC_MSG_RESULT(yes)
  545. )
  546. AC_MSG_CHECKING([whether to support smtp])
  547. AC_ARG_ENABLE(smtp,
  548. AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
  549. AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
  550. [ case "$enableval" in
  551. no)
  552. AC_MSG_RESULT(no)
  553. AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
  554. AC_SUBST(CURL_DISABLE_SMTP, [1])
  555. ;;
  556. *) AC_MSG_RESULT(yes)
  557. ;;
  558. esac ],
  559. AC_MSG_RESULT(yes)
  560. )
  561. AC_MSG_CHECKING([whether to support gopher])
  562. AC_ARG_ENABLE(gopher,
  563. AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
  564. AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
  565. [ case "$enableval" in
  566. no)
  567. AC_MSG_RESULT(no)
  568. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
  569. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  570. ;;
  571. *) AC_MSG_RESULT(yes)
  572. ;;
  573. esac ],
  574. AC_MSG_RESULT(yes)
  575. )
  576. dnl **********************************************************************
  577. dnl Check for built-in manual
  578. dnl **********************************************************************
  579. AC_MSG_CHECKING([whether to provide built-in manual])
  580. AC_ARG_ENABLE(manual,
  581. AC_HELP_STRING([--enable-manual],[Enable built-in manual])
  582. AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
  583. [ case "$enableval" in
  584. no)
  585. AC_MSG_RESULT(no)
  586. ;;
  587. *) AC_MSG_RESULT(yes)
  588. USE_MANUAL="1"
  589. ;;
  590. esac ],
  591. AC_MSG_RESULT(yes)
  592. USE_MANUAL="1"
  593. )
  594. dnl The actual use of the USE_MANUAL variable is done much later in this
  595. dnl script to allow other actions to disable it as well.
  596. dnl ************************************************************
  597. dnl disable C code generation support
  598. dnl
  599. AC_MSG_CHECKING([whether to enable generation of C code])
  600. AC_ARG_ENABLE(libcurl_option,
  601. AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
  602. AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
  603. [ case "$enableval" in
  604. no)
  605. AC_MSG_RESULT(no)
  606. AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
  607. curl_libcurl_msg="no"
  608. ;;
  609. *) AC_MSG_RESULT(yes)
  610. ;;
  611. esac ],
  612. AC_MSG_RESULT(yes)
  613. )
  614. dnl **********************************************************************
  615. dnl Checks for libraries.
  616. dnl **********************************************************************
  617. CURL_CHECK_LIB_XNET
  618. dnl gethostbyname without lib or in the nsl lib?
  619. AC_CHECK_FUNC(gethostbyname,
  620. [HAVE_GETHOSTBYNAME="1"
  621. ],
  622. [ AC_CHECK_LIB(nsl, gethostbyname,
  623. [HAVE_GETHOSTBYNAME="1"
  624. LIBS="$LIBS -lnsl"
  625. ])
  626. ])
  627. if test "$HAVE_GETHOSTBYNAME" != "1"
  628. then
  629. dnl gethostbyname in the socket lib?
  630. AC_CHECK_LIB(socket, gethostbyname,
  631. [HAVE_GETHOSTBYNAME="1"
  632. LIBS="$LIBS -lsocket"
  633. ])
  634. fi
  635. if test "$HAVE_GETHOSTBYNAME" != "1"
  636. then
  637. dnl gethostbyname in the watt lib?
  638. AC_CHECK_LIB(watt, gethostbyname,
  639. [HAVE_GETHOSTBYNAME="1"
  640. CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
  641. LDFLAGS="-L/dev/env/WATT_ROOT/lib"
  642. LIBS="$LIBS -lwatt"
  643. ])
  644. fi
  645. dnl At least one system has been identified to require BOTH nsl and socket
  646. dnl libs at the same time to link properly.
  647. if test "$HAVE_GETHOSTBYNAME" != "1"
  648. then
  649. AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
  650. my_ac_save_LIBS=$LIBS
  651. LIBS="-lnsl -lsocket $LIBS"
  652. AC_LINK_IFELSE([
  653. AC_LANG_PROGRAM([[
  654. ]],[[
  655. gethostbyname();
  656. ]])
  657. ],[
  658. AC_MSG_RESULT([yes])
  659. HAVE_GETHOSTBYNAME="1"
  660. ],[
  661. AC_MSG_RESULT([no])
  662. LIBS=$my_ac_save_LIBS
  663. ])
  664. fi
  665. if test "$HAVE_GETHOSTBYNAME" != "1"
  666. then
  667. dnl This is for winsock systems
  668. if test "$ac_cv_header_windows_h" = "yes"; then
  669. if test "$ac_cv_header_winsock_h" = "yes"; then
  670. case $host in
  671. *-*-mingw32ce*)
  672. winsock_LIB="-lwinsock"
  673. ;;
  674. *)
  675. winsock_LIB="-lwsock32"
  676. ;;
  677. esac
  678. fi
  679. if test "$ac_cv_header_winsock2_h" = "yes"; then
  680. winsock_LIB="-lws2_32"
  681. fi
  682. if test ! -z "$winsock_LIB"; then
  683. my_ac_save_LIBS=$LIBS
  684. LIBS="$winsock_LIB $LIBS"
  685. AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
  686. AC_LINK_IFELSE([
  687. AC_LANG_PROGRAM([[
  688. #ifdef HAVE_WINDOWS_H
  689. #ifndef WIN32_LEAN_AND_MEAN
  690. #define WIN32_LEAN_AND_MEAN
  691. #endif
  692. #include <windows.h>
  693. #ifdef HAVE_WINSOCK2_H
  694. #include <winsock2.h>
  695. #else
  696. #ifdef HAVE_WINSOCK_H
  697. #include <winsock.h>
  698. #endif
  699. #endif
  700. #endif
  701. ]],[[
  702. gethostbyname("www.dummysite.com");
  703. ]])
  704. ],[
  705. AC_MSG_RESULT([yes])
  706. HAVE_GETHOSTBYNAME="1"
  707. ],[
  708. AC_MSG_RESULT([no])
  709. winsock_LIB=""
  710. LIBS=$my_ac_save_LIBS
  711. ])
  712. fi
  713. fi
  714. fi
  715. if test "$HAVE_GETHOSTBYNAME" != "1"
  716. then
  717. dnl This is for Minix 3.1
  718. AC_MSG_CHECKING([for gethostbyname for Minix 3])
  719. AC_LINK_IFELSE([
  720. AC_LANG_PROGRAM([[
  721. /* Older Minix versions may need <net/gen/netdb.h> here instead */
  722. #include <netdb.h>
  723. ]],[[
  724. gethostbyname("www.dummysite.com");
  725. ]])
  726. ],[
  727. AC_MSG_RESULT([yes])
  728. HAVE_GETHOSTBYNAME="1"
  729. ],[
  730. AC_MSG_RESULT([no])
  731. ])
  732. fi
  733. if test "$HAVE_GETHOSTBYNAME" != "1"
  734. then
  735. dnl This is for eCos with a stubbed DNS implementation
  736. AC_MSG_CHECKING([for gethostbyname for eCos])
  737. AC_LINK_IFELSE([
  738. AC_LANG_PROGRAM([[
  739. #include <stdio.h>
  740. #include <netdb.h>
  741. ]],[[
  742. gethostbyname("www.dummysite.com");
  743. ]])
  744. ],[
  745. AC_MSG_RESULT([yes])
  746. HAVE_GETHOSTBYNAME="1"
  747. ],[
  748. AC_MSG_RESULT([no])
  749. ])
  750. fi
  751. if test "$HAVE_GETHOSTBYNAME" != "1"
  752. then
  753. dnl gethostbyname in the network lib - for Haiku OS
  754. AC_CHECK_LIB(network, gethostbyname,
  755. [HAVE_GETHOSTBYNAME="1"
  756. LIBS="$LIBS -lnetwork"
  757. ])
  758. fi
  759. if test "$HAVE_GETHOSTBYNAME" != "1"
  760. then
  761. dnl gethostbyname in the net lib - for BeOS
  762. AC_CHECK_LIB(net, gethostbyname,
  763. [HAVE_GETHOSTBYNAME="1"
  764. LIBS="$LIBS -lnet"
  765. ])
  766. fi
  767. if test "$HAVE_GETHOSTBYNAME" != "1"; then
  768. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  769. fi
  770. dnl resolve lib?
  771. AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
  772. if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
  773. AC_CHECK_LIB(resolve, strcasecmp,
  774. [LIBS="-lresolve $LIBS"],
  775. ,
  776. -lnsl)
  777. fi
  778. ac_cv_func_strcasecmp="no"
  779. CURL_CHECK_LIBS_CONNECT
  780. CURL_NETWORK_LIBS=$LIBS
  781. dnl **********************************************************************
  782. dnl In case that function clock_gettime with monotonic timer is available,
  783. dnl check for additional required libraries.
  784. dnl **********************************************************************
  785. CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
  786. dnl **********************************************************************
  787. dnl The preceding library checks are all potentially useful for test
  788. dnl servers (for providing networking support). Save the list of required
  789. dnl libraries at this point for use while linking those test servers.
  790. dnl **********************************************************************
  791. TEST_SERVER_LIBS=$LIBS
  792. dnl **********************************************************************
  793. AC_MSG_CHECKING([whether to use libgcc])
  794. AC_ARG_ENABLE(libgcc,
  795. AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  796. [ case "$enableval" in
  797. yes)
  798. ALL_LIBS="$ALL_LIBS -lgcc"
  799. AC_MSG_RESULT(yes)
  800. ;;
  801. *) AC_MSG_RESULT(no)
  802. ;;
  803. esac ],
  804. AC_MSG_RESULT(no)
  805. )
  806. dnl **********************************************************************
  807. dnl Check for LDAP
  808. dnl **********************************************************************
  809. LDAPLIBNAME=""
  810. AC_ARG_WITH(ldap-lib,
  811. AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
  812. [LDAPLIBNAME="$withval"])
  813. LBERLIBNAME=""
  814. AC_ARG_WITH(lber-lib,
  815. AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
  816. [LBERLIBNAME="$withval"])
  817. if test x$CURL_DISABLE_LDAP != x1 ; then
  818. CURL_CHECK_HEADER_LBER
  819. CURL_CHECK_HEADER_LDAP
  820. CURL_CHECK_HEADER_LDAPSSL
  821. CURL_CHECK_HEADER_LDAP_SSL
  822. if test -z "$LDAPLIBNAME" ; then
  823. if test "$ac_cv_native_windows" = "yes"; then
  824. dnl Windows uses a single and unique LDAP library name
  825. LDAPLIBNAME="wldap32"
  826. LBERLIBNAME="no"
  827. fi
  828. fi
  829. if test "$LDAPLIBNAME" ; then
  830. AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
  831. AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
  832. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  833. AC_SUBST(CURL_DISABLE_LDAP, [1])
  834. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  835. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  836. else
  837. dnl Try to find the right ldap libraries for this system
  838. CURL_CHECK_LIBS_LDAP
  839. case X-"$curl_cv_ldap_LIBS" in
  840. X-unknown)
  841. AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
  842. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  843. AC_SUBST(CURL_DISABLE_LDAP, [1])
  844. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  845. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  846. ;;
  847. esac
  848. fi
  849. fi
  850. if test x$CURL_DISABLE_LDAP != x1 ; then
  851. if test "$LBERLIBNAME" ; then
  852. dnl If name is "no" then don't define this library at all
  853. dnl (it's only needed if libldap.so's dependencies are broken).
  854. if test "$LBERLIBNAME" != "no" ; then
  855. AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
  856. AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
  857. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  858. AC_SUBST(CURL_DISABLE_LDAP, [1])
  859. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  860. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  861. fi
  862. fi
  863. fi
  864. if test x$CURL_DISABLE_LDAP != x1 ; then
  865. AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
  866. if test "$LDAPLIBNAME" = "wldap32"; then
  867. curl_ldap_msg="enabled (winldap)"
  868. AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
  869. else
  870. curl_ldap_msg="enabled (OpenLDAP)"
  871. if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
  872. AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
  873. AC_SUBST(USE_OPENLDAP, [1])
  874. fi
  875. fi
  876. fi
  877. if test x$CURL_DISABLE_LDAPS != x1 ; then
  878. curl_ldaps_msg="enabled"
  879. fi
  880. dnl **********************************************************************
  881. dnl Checks for IPv6
  882. dnl **********************************************************************
  883. AC_MSG_CHECKING([whether to enable ipv6])
  884. AC_ARG_ENABLE(ipv6,
  885. AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
  886. AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
  887. [ case "$enableval" in
  888. no)
  889. AC_MSG_RESULT(no)
  890. ipv6=no
  891. ;;
  892. *) AC_MSG_RESULT(yes)
  893. ipv6=yes
  894. ;;
  895. esac ],
  896. AC_TRY_RUN([ /* is AF_INET6 available? */
  897. #include <sys/types.h>
  898. #include <sys/socket.h>
  899. main()
  900. {
  901. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  902. exit(1);
  903. else
  904. exit(0);
  905. }
  906. ],
  907. AC_MSG_RESULT(yes)
  908. ipv6=yes,
  909. AC_MSG_RESULT(no)
  910. ipv6=no,
  911. AC_MSG_RESULT(no)
  912. ipv6=no
  913. ))
  914. if test "$ipv6" = "yes"; then
  915. curl_ipv6_msg="enabled"
  916. fi
  917. # Check if struct sockaddr_in6 have sin6_scope_id member
  918. if test "$ipv6" = yes; then
  919. AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
  920. AC_TRY_COMPILE([
  921. #include <sys/types.h>
  922. #include <netinet/in.h>] ,
  923. struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
  924. if test "$have_sin6_scope_id" = yes; then
  925. AC_MSG_RESULT([yes])
  926. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
  927. else
  928. AC_MSG_RESULT([no])
  929. fi
  930. fi
  931. dnl **********************************************************************
  932. dnl Check if the operating system allows programs to write to their own argv[]
  933. dnl **********************************************************************
  934. AC_MSG_CHECKING([if argv can be written to])
  935. AC_RUN_IFELSE([
  936. AC_LANG_SOURCE([[
  937. int main(int argc, char ** argv) {
  938. argv[0][0] = ' ';
  939. return (argv[0][0] == ' ')?0:1;
  940. }
  941. ]])
  942. ],[
  943. curl_cv_writable_argv=yes
  944. ],[
  945. curl_cv_writable_argv=no
  946. ],[
  947. curl_cv_writable_argv=cross
  948. ])
  949. case $curl_cv_writable_argv in
  950. yes)
  951. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  952. AC_MSG_RESULT(yes)
  953. ;;
  954. no)
  955. AC_MSG_RESULT(no)
  956. ;;
  957. *)
  958. AC_MSG_RESULT(no)
  959. AC_MSG_WARN([the previous check could not be made default was used])
  960. ;;
  961. esac
  962. dnl **********************************************************************
  963. dnl Check for the presence of Kerberos4 libraries and headers
  964. dnl **********************************************************************
  965. AC_ARG_WITH(krb4-includes,
  966. AC_HELP_STRING([--with-krb4-includes=DIR],
  967. [Specify location of kerberos4 headers]),[
  968. CPPFLAGS="$CPPFLAGS -I$withval"
  969. KRB4INC="$withval"
  970. want_krb4=yes
  971. ])
  972. AC_ARG_WITH(krb4-libs,
  973. AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
  974. LDFLAGS="$LDFLAGS -L$withval"
  975. KRB4LIB="$withval"
  976. want_krb4=yes
  977. ])
  978. OPT_KRB4=off
  979. AC_ARG_WITH(krb4,dnl
  980. AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
  981. OPT_KRB4="$withval"
  982. if test X"$OPT_KRB4" != Xno; then
  983. want_krb4="yes"
  984. if test X"$OPT_KRB4" != Xyes; then
  985. LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
  986. KRB4LIB="$OPT_KRB4/lib$libsuff"
  987. CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
  988. KRB4INC="$OPT_KRB4/include"
  989. fi
  990. fi
  991. ])
  992. AC_MSG_CHECKING([if Kerberos4 support is requested])
  993. if test "$want_krb4" = yes
  994. then
  995. if test "$ipv6" = "yes"; then
  996. echo krb4 is not compatible with IPv6
  997. exit 1
  998. fi
  999. AC_MSG_RESULT(yes)
  1000. dnl Check for & handle argument to --with-krb4
  1001. AC_MSG_CHECKING(where to look for Kerberos4)
  1002. if test X"$OPT_KRB4" = Xyes
  1003. then
  1004. AC_MSG_RESULT([defaults])
  1005. else
  1006. AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
  1007. fi
  1008. dnl Check for DES library
  1009. AC_CHECK_LIB(des, des_pcbc_encrypt,
  1010. [
  1011. AC_CHECK_HEADERS(des.h)
  1012. dnl resolv lib?
  1013. AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
  1014. dnl Check for the Kerberos4 library
  1015. AC_CHECK_LIB(krb, krb_net_read,
  1016. [
  1017. dnl Check for header files
  1018. AC_CHECK_HEADERS(krb.h)
  1019. dnl we found the required libraries, add to LIBS
  1020. LIBS="-lkrb -lcom_err -ldes $LIBS"
  1021. dnl Check for function krb_get_our_ip_for_realm
  1022. dnl this is needed for NAT networks
  1023. AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
  1024. dnl add define KRB4
  1025. AC_DEFINE(HAVE_KRB4, 1,
  1026. [if you have the Kerberos4 libraries (including -ldes)])
  1027. dnl substitute it too!
  1028. KRB4_ENABLED=1
  1029. AC_SUBST(KRB4_ENABLED)
  1030. curl_krb4_msg="enabled"
  1031. dnl the krb4 stuff needs a strlcpy()
  1032. AC_CHECK_FUNCS(strlcpy)
  1033. ])
  1034. ])
  1035. else
  1036. AC_MSG_RESULT(no)
  1037. fi
  1038. dnl **********************************************************************
  1039. dnl Check for FBopenssl(SPNEGO) libraries
  1040. dnl **********************************************************************
  1041. AC_ARG_WITH(spnego,
  1042. AC_HELP_STRING([--with-spnego=DIR],
  1043. [Specify location of SPNEGO library fbopenssl]), [
  1044. SPNEGO_ROOT="$withval"
  1045. if test x"$SPNEGO_ROOT" != xno; then
  1046. want_spnego="yes"
  1047. fi
  1048. ])
  1049. AC_MSG_CHECKING([if SPNEGO support is requested])
  1050. if test x"$want_spnego" = xyes; then
  1051. if test X"$SPNEGO_ROOT" = Xyes; then
  1052. AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
  1053. AC_MSG_RESULT(no)
  1054. else
  1055. if test -z "$SPNEGO_LIB_DIR"; then
  1056. LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
  1057. else
  1058. LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
  1059. fi
  1060. AC_MSG_RESULT(yes)
  1061. AC_DEFINE(HAVE_SPNEGO, 1,
  1062. [Define this if you have the SPNEGO library fbopenssl])
  1063. curl_spnego_msg="enabled"
  1064. fi
  1065. else
  1066. AC_MSG_RESULT(no)
  1067. fi
  1068. dnl **********************************************************************
  1069. dnl Check for GSS-API libraries
  1070. dnl **********************************************************************
  1071. dnl check for gss stuff in the /usr as default
  1072. GSSAPI_ROOT="/usr"
  1073. AC_ARG_WITH(gssapi-includes,
  1074. AC_HELP_STRING([--with-gssapi-includes=DIR],
  1075. [Specify location of GSSAPI header]),
  1076. [ GSSAPI_INCS="-I$withval"
  1077. want_gss="yes" ]
  1078. )
  1079. AC_ARG_WITH(gssapi-libs,
  1080. AC_HELP_STRING([--with-gssapi-libs=DIR],
  1081. [Specify location of GSSAPI libs]),
  1082. [ GSSAPI_LIB_DIR="-L$withval"
  1083. want_gss="yes" ]
  1084. )
  1085. AC_ARG_WITH(gssapi,
  1086. AC_HELP_STRING([--with-gssapi=DIR],
  1087. [Where to look for GSSAPI]), [
  1088. GSSAPI_ROOT="$withval"
  1089. if test x"$GSSAPI_ROOT" != xno; then
  1090. want_gss="yes"
  1091. if test x"$GSSAPI_ROOT" = xyes; then
  1092. dnl if yes, then use default root
  1093. GSSAPI_ROOT="/usr"
  1094. fi
  1095. fi
  1096. ])
  1097. save_CPPFLAGS="$CPPFLAGS"
  1098. AC_MSG_CHECKING([if GSSAPI support is requested])
  1099. if test x"$want_gss" = xyes; then
  1100. AC_MSG_RESULT(yes)
  1101. if test -z "$GSSAPI_INCS"; then
  1102. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  1103. GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
  1104. elif test "$GSSAPI_ROOT" != "yes"; then
  1105. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  1106. fi
  1107. fi
  1108. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  1109. AC_CHECK_HEADER(gss.h,
  1110. [
  1111. dnl found in the given dirs
  1112. AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
  1113. gnu_gss=yes
  1114. ],
  1115. [
  1116. dnl not found, check Heimdal or MIT
  1117. AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
  1118. AC_CHECK_HEADERS(
  1119. [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
  1120. [],
  1121. [not_mit=1],
  1122. [
  1123. AC_INCLUDES_DEFAULT
  1124. #ifdef HAVE_GSSAPI_GSSAPI_H
  1125. #include <gssapi/gssapi.h>
  1126. #endif
  1127. ])
  1128. if test "x$not_mit" = "x1"; then
  1129. dnl MIT not found, check for Heimdal
  1130. AC_CHECK_HEADER(gssapi.h,
  1131. [
  1132. dnl found
  1133. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
  1134. ],
  1135. [
  1136. dnl no header found, disabling GSS
  1137. want_gss=no
  1138. AC_MSG_WARN(disabling GSSAPI since no header files was found)
  1139. ]
  1140. )
  1141. else
  1142. dnl MIT found
  1143. AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
  1144. dnl check if we have a really old MIT kerberos (<= 1.2)
  1145. AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
  1146. AC_COMPILE_IFELSE([
  1147. AC_LANG_PROGRAM([[
  1148. #include <gssapi/gssapi.h>
  1149. #include <gssapi/gssapi_generic.h>
  1150. #include <gssapi/gssapi_krb5.h>
  1151. ]],[[
  1152. gss_import_name(
  1153. (OM_uint32 *)0,
  1154. (gss_buffer_t)0,
  1155. GSS_C_NT_HOSTBASED_SERVICE,
  1156. (gss_name_t *)0);
  1157. ]])
  1158. ],[
  1159. AC_MSG_RESULT([yes])
  1160. ],[
  1161. AC_MSG_RESULT([no])
  1162. AC_DEFINE(HAVE_OLD_GSSMIT, 1,
  1163. [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
  1164. ])
  1165. fi
  1166. ]
  1167. )
  1168. else
  1169. AC_MSG_RESULT(no)
  1170. fi
  1171. if test x"$want_gss" = xyes; then
  1172. AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
  1173. curl_gss_msg="enabled (MIT/Heimdal)"
  1174. if test -n "$gnu_gss"; then
  1175. curl_gss_msg="enabled (GNU GSS)"
  1176. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1177. LIBS="$LIBS -lgss"
  1178. elif test -z "$GSSAPI_LIB_DIR"; then
  1179. case $host in
  1180. *-*-darwin*)
  1181. LIBS="$LIBS -lgssapi_krb5 -lresolv"
  1182. ;;
  1183. *)
  1184. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  1185. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1186. dnl into LIBS
  1187. gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
  1188. LIBS="$LIBS $gss_libs"
  1189. elif test "$GSSAPI_ROOT" != "yes"; then
  1190. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
  1191. LIBS="$LIBS -lgssapi"
  1192. else
  1193. LIBS="$LIBS -lgssapi"
  1194. fi
  1195. ;;
  1196. esac
  1197. else
  1198. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1199. LIBS="$LIBS -lgssapi"
  1200. fi
  1201. else
  1202. CPPFLAGS="$save_CPPFLAGS"
  1203. fi
  1204. dnl -------------------------------------------------
  1205. dnl check winssl option before other SSL libraries
  1206. dnl -------------------------------------------------
  1207. OPT_WINSSL=no
  1208. AC_ARG_WITH(winssl,dnl
  1209. AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
  1210. AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
  1211. OPT_WINSSL=$withval)
  1212. AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
  1213. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1214. if test "x$OPT_WINSSL" != "xno" &&
  1215. test "x$ac_cv_native_windows" = "xyes"; then
  1216. AC_MSG_RESULT(yes)
  1217. AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
  1218. AC_SUBST(USE_SCHANNEL, [1])
  1219. curl_ssl_msg="enabled (Windows-native)"
  1220. WINSSL_ENABLED=1
  1221. # --with-winssl implies --enable-sspi
  1222. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  1223. AC_SUBST(USE_WINDOWS_SSPI, [1])
  1224. curl_sspi_msg="enabled"
  1225. else
  1226. AC_MSG_RESULT(no)
  1227. fi
  1228. else
  1229. AC_MSG_RESULT(no)
  1230. fi
  1231. OPT_DARWINSSL=no
  1232. AC_ARG_WITH(darwinssl,dnl
  1233. AC_HELP_STRING([--with-darwinssl],[enable iOS/Mac OS X native SSL/TLS])
  1234. AC_HELP_STRING([--without-darwinssl], [disable iOS/Mac OS X native SSL/TLS]),
  1235. OPT_DARWINSSL=$withval)
  1236. AC_MSG_CHECKING([whether to enable iOS/Mac OS X native SSL/TLS])
  1237. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1238. if test "x$OPT_DARWINSSL" != "xno" &&
  1239. test -d "/System/Library/Frameworks/Security.framework"; then
  1240. AC_MSG_RESULT(yes)
  1241. AC_DEFINE(USE_DARWINSSL, 1, [to enable iOS/Mac OS X native SSL/TLS support])
  1242. AC_SUBST(USE_DARWINSSL, [1])
  1243. curl_ssl_msg="enabled (iOS/Mac OS X-native)"
  1244. DARWINSSL_ENABLED=1
  1245. LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
  1246. else
  1247. AC_MSG_RESULT(no)
  1248. fi
  1249. else
  1250. AC_MSG_RESULT(no)
  1251. fi
  1252. dnl **********************************************************************
  1253. dnl Check for the presence of SSL libraries and headers
  1254. dnl **********************************************************************
  1255. dnl Default to compiler & linker defaults for SSL files & libraries.
  1256. OPT_SSL=off
  1257. dnl Default to no CA bundle
  1258. ca="no"
  1259. AC_ARG_WITH(ssl,dnl
  1260. 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])
  1261. AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
  1262. OPT_SSL=$withval)
  1263. if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
  1264. dnl backup the pre-ssl variables
  1265. CLEANLDFLAGS="$LDFLAGS"
  1266. CLEANCPPFLAGS="$CPPFLAGS"
  1267. CLEANLIBS="$LIBS"
  1268. case "$OPT_SSL" in
  1269. yes)
  1270. dnl --with-ssl (without path) used
  1271. if test x$cross_compiling != xyes; then
  1272. dnl only do pkg-config magic when not cross-compiling
  1273. PKGTEST="yes"
  1274. fi
  1275. PREFIX_OPENSSL=/usr/local/ssl
  1276. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1277. ;;
  1278. off)
  1279. dnl no --with-ssl option given, just check default places
  1280. if test x$cross_compiling != xyes; then
  1281. dnl only do pkg-config magic when not cross-compiling
  1282. PKGTEST="yes"
  1283. fi
  1284. PREFIX_OPENSSL=
  1285. ;;
  1286. *)
  1287. dnl check the given --with-ssl spot
  1288. PKGTEST="no"
  1289. PREFIX_OPENSSL=$OPT_SSL
  1290. dnl Try pkg-config even when cross-compiling. Since we
  1291. dnl specify PKG_CONFIG_LIBDIR we're only looking where
  1292. dnl the user told us to look
  1293. OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
  1294. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
  1295. if test -f "$OPENSSL_PCDIR/openssl.pc"; then
  1296. PKGTEST="yes"
  1297. fi
  1298. dnl in case pkg-config comes up empty, use what we got
  1299. dnl via --with-ssl
  1300. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1301. if test "$PREFIX_OPENSSL" != "/usr" ; then
  1302. SSL_LDFLAGS="-L$LIB_OPENSSL"
  1303. SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
  1304. fi
  1305. SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
  1306. ;;
  1307. esac
  1308. if test "$PKGTEST" = "yes"; then
  1309. CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
  1310. if test "$PKGCONFIG" != "no" ; then
  1311. SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1312. $PKGCONFIG --libs-only-l openssl 2>/dev/null`
  1313. SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1314. $PKGCONFIG --libs-only-L openssl 2>/dev/null`
  1315. SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1316. $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
  1317. AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
  1318. AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
  1319. AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
  1320. LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
  1321. dnl use the values pkg-config reported. This is here
  1322. dnl instead of below with CPPFLAGS and LDFLAGS because we only
  1323. dnl learn about this via pkg-config. If we only have
  1324. dnl the argument to --with-ssl we don't know what
  1325. dnl additional libs may be necessary. Hope that we
  1326. dnl don't need any.
  1327. LIBS="$LIBS $SSL_LIBS"
  1328. fi
  1329. fi
  1330. dnl finally, set flags to use SSL
  1331. CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
  1332. LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
  1333. dnl This is for Msys/Mingw
  1334. case $host in
  1335. *-*-msys* | *-*-mingw*)
  1336. AC_MSG_CHECKING([for gdi32])
  1337. my_ac_save_LIBS=$LIBS
  1338. LIBS="-lgdi32 $LIBS"
  1339. AC_TRY_LINK([#include <windef.h>
  1340. #include <wingdi.h>],
  1341. [GdiFlush();],
  1342. [ dnl worked!
  1343. AC_MSG_RESULT([yes])],
  1344. [ dnl failed, restore LIBS
  1345. LIBS=$my_ac_save_LIBS
  1346. AC_MSG_RESULT(no)]
  1347. )
  1348. ;;
  1349. esac
  1350. AC_CHECK_LIB(crypto, CRYPTO_lock,[
  1351. HAVECRYPTO="yes"
  1352. LIBS="-lcrypto $LIBS"
  1353. ],[
  1354. LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
  1355. CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
  1356. AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
  1357. HAVECRYPTO="yes"
  1358. LIBS="-lcrypto $LIBS"], [
  1359. LDFLAGS="$CLEANLDFLAGS"
  1360. CPPFLAGS="$CLEANCPPFLAGS"
  1361. LIBS="$CLEANLIBS"
  1362. ])
  1363. ])
  1364. if test X"$HAVECRYPTO" = X"yes"; then
  1365. dnl This is only reasonable to do if crypto actually is there: check for
  1366. dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
  1367. AC_CHECK_LIB(ssl, SSL_connect)
  1368. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1369. dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
  1370. AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
  1371. OLIBS=$LIBS
  1372. LIBS="$LIBS -lRSAglue -lrsaref"
  1373. AC_CHECK_LIB(ssl, SSL_connect)
  1374. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1375. dnl still no SSL_connect
  1376. AC_MSG_RESULT(no)
  1377. LIBS=$OLIBS
  1378. else
  1379. AC_MSG_RESULT(yes)
  1380. fi
  1381. else
  1382. dnl Have the libraries--check for SSLeay/OpenSSL headers
  1383. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  1384. openssl/pem.h openssl/ssl.h openssl/err.h,
  1385. curl_ssl_msg="enabled (OpenSSL)"
  1386. OPENSSL_ENABLED=1
  1387. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
  1388. if test $ac_cv_header_openssl_x509_h = no; then
  1389. dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
  1390. dnl since 'err.h' might in fact find a krb4 header with the same
  1391. dnl name
  1392. AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
  1393. if test $ac_cv_header_x509_h = yes &&
  1394. test $ac_cv_header_crypto_h = yes &&
  1395. test $ac_cv_header_ssl_h = yes; then
  1396. dnl three matches
  1397. curl_ssl_msg="enabled (OpenSSL)"
  1398. OPENSSL_ENABLED=1
  1399. fi
  1400. fi
  1401. fi
  1402. if test X"$OPENSSL_ENABLED" = X"1"; then
  1403. AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
  1404. dnl is there a pkcs12.h header present?
  1405. AC_CHECK_HEADERS(openssl/pkcs12.h)
  1406. else
  1407. LIBS="$CLEANLIBS"
  1408. fi
  1409. dnl USE_SSLEAY is the historical name for what configure calls
  1410. dnl OPENSSL_ENABLED; the names should really be unified
  1411. USE_SSLEAY="$OPENSSL_ENABLED"
  1412. AC_SUBST(USE_SSLEAY)
  1413. if test X"$OPT_SSL" != Xoff &&
  1414. test "$OPENSSL_ENABLED" != "1"; then
  1415. AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
  1416. fi
  1417. fi
  1418. if test X"$OPENSSL_ENABLED" = X"1"; then
  1419. dnl If the ENGINE library seems to be around, check for the OpenSSL engine
  1420. dnl stuff, it is kind of "separated" from the main SSL check
  1421. AC_CHECK_FUNC(ENGINE_init,
  1422. [
  1423. AC_CHECK_HEADERS(openssl/engine.h)
  1424. AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
  1425. ])
  1426. dnl these can only exist if openssl exists
  1427. dnl yassl doesn't have SSL_get_shutdown
  1428. AC_CHECK_FUNCS( RAND_status \
  1429. RAND_screen \
  1430. RAND_egd \
  1431. ENGINE_cleanup \
  1432. CRYPTO_cleanup_all_ex_data \
  1433. SSL_get_shutdown \
  1434. SSLv2_client_method )
  1435. dnl Make an attempt to detect if this is actually yassl's headers and
  1436. dnl OpenSSL emulation layer. We still leave everything else believing
  1437. dnl and acting like OpenSSL.
  1438. AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
  1439. AC_COMPILE_IFELSE([
  1440. AC_LANG_PROGRAM([[
  1441. #include <openssl/ssl.h>
  1442. ]],[[
  1443. #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
  1444. int dummy = SSL_ERROR_NONE;
  1445. #else
  1446. Not the yaSSL OpenSSL compatibility header.
  1447. #endif
  1448. ]])
  1449. ],[
  1450. AC_MSG_RESULT([yes])
  1451. AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
  1452. [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
  1453. curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
  1454. ],[
  1455. AC_MSG_RESULT([no])
  1456. ])
  1457. fi
  1458. if test "$OPENSSL_ENABLED" = "1"; then
  1459. if test -n "$LIB_OPENSSL"; then
  1460. dnl when the ssl shared libs were found in a path that the run-time
  1461. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  1462. dnl to prevent further configure tests to fail due to this
  1463. if test "x$cross_compiling" != "xyes"; then
  1464. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
  1465. export LD_LIBRARY_PATH
  1466. AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
  1467. fi
  1468. fi
  1469. CURL_CHECK_OPENSSL_API
  1470. fi
  1471. fi
  1472. dnl **********************************************************************
  1473. dnl Check for the presence of ZLIB libraries and headers
  1474. dnl **********************************************************************
  1475. dnl Check for & handle argument to --with-zlib.
  1476. _cppflags=$CPPFLAGS
  1477. _ldflags=$LDFLAGS
  1478. AC_ARG_WITH(zlib,
  1479. AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  1480. AC_HELP_STRING([--without-zlib],[disable use of zlib]),
  1481. [OPT_ZLIB="$withval"])
  1482. if test "$OPT_ZLIB" = "no" ; then
  1483. AC_MSG_WARN([zlib disabled])
  1484. else
  1485. if test "$OPT_ZLIB" = "yes" ; then
  1486. OPT_ZLIB=""
  1487. fi
  1488. if test -z "$OPT_ZLIB" ; then
  1489. dnl check for the lib first without setting any new path, since many
  1490. dnl people have it in the default path
  1491. AC_CHECK_LIB(z, inflateEnd,
  1492. dnl libz found, set the variable
  1493. [HAVE_LIBZ="1"],
  1494. dnl if no lib found, try /usr/local
  1495. [OPT_ZLIB="/usr/local"])
  1496. fi
  1497. dnl Add a nonempty path to the compiler flags
  1498. if test -n "$OPT_ZLIB"; then
  1499. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  1500. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  1501. fi
  1502. AC_CHECK_HEADER(zlib.h,
  1503. [
  1504. dnl zlib.h was found
  1505. HAVE_ZLIB_H="1"
  1506. dnl if the lib wasn't found already, try again with the new paths
  1507. if test "$HAVE_LIBZ" != "1"; then
  1508. AC_CHECK_LIB(z, gzread,
  1509. [
  1510. dnl the lib was found!
  1511. HAVE_LIBZ="1"
  1512. ],
  1513. [ CPPFLAGS=$_cppflags
  1514. LDFLAGS=$_ldflags])
  1515. fi
  1516. ],
  1517. [
  1518. dnl zlib.h was not found, restore the flags
  1519. CPPFLAGS=$_cppflags
  1520. LDFLAGS=$_ldflags]
  1521. )
  1522. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  1523. then
  1524. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  1525. HAVE_LIBZ=""
  1526. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  1527. then
  1528. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  1529. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  1530. then
  1531. dnl both header and lib were found!
  1532. AC_SUBST(HAVE_LIBZ)
  1533. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  1534. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  1535. CURL_LIBS="$CURL_LIBS -lz"
  1536. LIBS="$LIBS -lz"
  1537. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  1538. AMFIXLIB="1"
  1539. AC_MSG_NOTICE([found both libz and libz.h header])
  1540. curl_zlib_msg="enabled"
  1541. fi
  1542. fi
  1543. dnl set variable for use in automakefile(s)
  1544. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  1545. dnl **********************************************************************
  1546. dnl Check for the random seed preferences
  1547. dnl **********************************************************************
  1548. if test X"$OPENSSL_ENABLED" = X"1"; then
  1549. AC_ARG_WITH(egd-socket,
  1550. AC_HELP_STRING([--with-egd-socket=FILE],
  1551. [Entropy Gathering Daemon socket pathname]),
  1552. [ EGD_SOCKET="$withval" ]
  1553. )
  1554. if test -n "$EGD_SOCKET" ; then
  1555. AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
  1556. [your Entropy Gathering Daemon socket pathname] )
  1557. fi
  1558. dnl Check for user-specified random device
  1559. AC_ARG_WITH(random,
  1560. AC_HELP_STRING([--with-random=FILE],
  1561. [read randomness from FILE (default=/dev/urandom)]),
  1562. [ RANDOM_FILE="$withval" ],
  1563. [
  1564. if test x$cross_compiling != xyes; then
  1565. dnl Check for random device
  1566. AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
  1567. else
  1568. AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
  1569. fi
  1570. ]
  1571. )
  1572. if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
  1573. AC_SUBST(RANDOM_FILE)
  1574. AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
  1575. [a suitable file to read random data from])
  1576. fi
  1577. fi
  1578. dnl ---
  1579. dnl We require OpenSSL with SRP support.
  1580. dnl ---
  1581. if test "$OPENSSL_ENABLED" = "1"; then
  1582. AC_CHECK_LIB(crypto, SRP_Calc_client_key,
  1583. [
  1584. AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key])
  1585. AC_SUBST(HAVE_SSLEAY_SRP, [1])
  1586. ])
  1587. fi
  1588. dnl ----------------------------------------------------
  1589. dnl check for GnuTLS
  1590. dnl ----------------------------------------------------
  1591. dnl Default to compiler & linker defaults for GnuTLS files & libraries.
  1592. OPT_GNUTLS=no
  1593. AC_ARG_WITH(gnutls,dnl
  1594. AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
  1595. AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
  1596. OPT_GNUTLS=$withval)
  1597. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1598. if test X"$OPT_GNUTLS" != Xno; then
  1599. addld=""
  1600. if test "x$OPT_GNUTLS" = "xyes"; then
  1601. dnl this is with no partiular path given
  1602. CURL_CHECK_PKGCONFIG(gnutls)
  1603. if test "$PKGCONFIG" != "no" ; then
  1604. addlib=`$PKGCONFIG --libs-only-l gnutls`
  1605. addld=`$PKGCONFIG --libs-only-L gnutls`
  1606. addcflags=`$PKGCONFIG --cflags-only-I gnutls`
  1607. version=`$PKGCONFIG --modversion gnutls`
  1608. gtlslib=`echo $addld | $SED -e 's/-L//'`
  1609. else
  1610. dnl without pkg-config, we try libgnutls-config as that was how it
  1611. dnl used to be done
  1612. check=`libgnutls-config --version 2>/dev/null`
  1613. if test -n "$check"; then
  1614. addlib=`libgnutls-config --libs`
  1615. addcflags=`libgnutls-config --cflags`
  1616. version=`libgnutls-config --version`
  1617. gtlslib=`libgnutls-config --prefix`/lib$libsuff
  1618. fi
  1619. fi
  1620. else
  1621. dnl this is with a given path, first check if there's a libgnutls-config
  1622. dnl there and if not, make an educated guess
  1623. cfg=$OPT_GNUTLS/bin/libgnutls-config
  1624. check=`$cfg --version 2>/dev/null`
  1625. if test -n "$check"; then
  1626. addlib=`$cfg --libs`
  1627. addcflags=`$cfg --cflags`
  1628. version=`$cfg --version`
  1629. gtlslib=`$cfg --prefix`/lib$libsuff
  1630. else
  1631. dnl without pkg-config and libgnutls-config, we guess a lot!
  1632. addlib=-lgnutls
  1633. addld=-L$OPT_GNUTLS/lib$libsuff
  1634. addcflags=-I$OPT_GNUTLS/include
  1635. version="" # we just don't know
  1636. gtlslib=$OPT_GNUTLS/lib$libsuff
  1637. fi
  1638. fi
  1639. if test -z "$version"; then
  1640. dnl lots of efforts, still no go
  1641. version="unknown"
  1642. fi
  1643. if test -n "$addlib"; then
  1644. CLEANLIBS="$LIBS"
  1645. CLEANCPPFLAGS="$CPPFLAGS"
  1646. CLEADLDFLAGS="$LDFLAGS"
  1647. LIBS="$LIBS $addlib"
  1648. LDFLAGS="$LDFLAGS $addld"
  1649. if test "$addcflags" != "-I/usr/include"; then
  1650. CPPFLAGS="$CPPFLAGS $addcflags"
  1651. fi
  1652. AC_CHECK_LIB(gnutls, gnutls_check_version,
  1653. [
  1654. AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
  1655. AC_SUBST(USE_GNUTLS, [1])
  1656. GNUTLS_ENABLED=1
  1657. USE_GNUTLS="yes"
  1658. curl_ssl_msg="enabled (GnuTLS)"
  1659. ],
  1660. [
  1661. LIBS="$CLEANLIBS"
  1662. CPPFLAGS="$CLEANCPPFLAGS"
  1663. ])
  1664. if test "x$USE_GNUTLS" = "xyes"; then
  1665. AC_MSG_NOTICE([detected GnuTLS version $version])
  1666. if test -n "$gtlslib"; then
  1667. dnl when shared libs were found in a path that the run-time
  1668. dnl linker doesn't search through, we need to add it to
  1669. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1670. dnl due to this
  1671. if test "x$cross_compiling" != "xyes"; then
  1672. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
  1673. export LD_LIBRARY_PATH
  1674. AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
  1675. fi
  1676. fi
  1677. fi
  1678. fi
  1679. fi dnl GNUTLS not disabled
  1680. fi
  1681. dnl ---
  1682. dnl Check which crypto backend GnuTLS uses
  1683. dnl ---
  1684. if test "$GNUTLS_ENABLED" = "1"; then
  1685. USE_GNUTLS_NETTLE=
  1686. # First check if we can detect either crypto library via transitive linking
  1687. AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
  1688. if test "$USE_GNUTLS_NETTLE" = ""; then
  1689. AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
  1690. fi
  1691. # If not, try linking directly to both of them to see if they are available
  1692. if test "$USE_GNUTLS_NETTLE" = ""; then
  1693. AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
  1694. fi
  1695. if test "$USE_GNUTLS_NETTLE" = ""; then
  1696. AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
  1697. fi
  1698. if test "$USE_GNUTLS_NETTLE" = ""; then
  1699. AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
  1700. fi
  1701. if test "$USE_GNUTLS_NETTLE" = "1"; then
  1702. AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
  1703. AC_SUBST(USE_GNUTLS_NETTLE, [1])
  1704. LIBS="$LIBS -lnettle"
  1705. else
  1706. LIBS="$LIBS -lgcrypt"
  1707. fi
  1708. fi
  1709. dnl ---
  1710. dnl We require GnuTLS with SRP support.
  1711. dnl ---
  1712. if test "$GNUTLS_ENABLED" = "1"; then
  1713. AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
  1714. [
  1715. AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
  1716. AC_SUBST(HAVE_GNUTLS_SRP, [1])
  1717. ])
  1718. fi
  1719. dnl ----------------------------------------------------
  1720. dnl check for PolarSSL
  1721. dnl ----------------------------------------------------
  1722. dnl Default to compiler & linker defaults for PolarSSL files & libraries.
  1723. OPT_POLARSSL=no
  1724. _cppflags=$CPPFLAGS
  1725. _ldflags=$LDFLAGS
  1726. AC_ARG_WITH(polarssl,dnl
  1727. AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root])
  1728. AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
  1729. OPT_POLARSSL=$withval)
  1730. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1731. if test X"$OPT_POLARSSL" != Xno; then
  1732. if test "$OPT_POLARSSL" = "yes"; then
  1733. OPT_POLARSSL=""
  1734. fi
  1735. if test -z "$OPT_POLARSSL" ; then
  1736. dnl check for lib first without setting any new path
  1737. AC_CHECK_LIB(polarssl, havege_init,
  1738. dnl libpolarssl found, set the variable
  1739. [
  1740. AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
  1741. AC_SUBST(USE_POLARSSL, [1])
  1742. POLARSSL_ENABLED=1
  1743. USE_POLARSSL="yes"
  1744. curl_ssl_msg="enabled (PolarSSL)"
  1745. ])
  1746. fi
  1747. if test "x$USE_POLARSSL" != "xyes"; then
  1748. dnl add the path and test again
  1749. addld=-L$OPT_POLARSSL/lib$libsuff
  1750. addcflags=-I$OPT_POLARSSL/include
  1751. polarssllib=$OPT_POLARSSL/lib$libsuff
  1752. LDFLAGS="$LDFLAGS $addld"
  1753. if test "$addcflags" != "-I/usr/include"; then
  1754. CPPFLAGS="$CPPFLAGS $addcflags"
  1755. fi
  1756. AC_CHECK_LIB(polarssl, ssl_init,
  1757. [
  1758. AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
  1759. AC_SUBST(USE_POLARSSL, [1])
  1760. POLARSSL_ENABLED=1
  1761. USE_POLARSSL="yes"
  1762. curl_ssl_msg="enabled (PolarSSL)"
  1763. ],
  1764. [
  1765. CPPFLAGS=$_cppflags
  1766. LDFLAGS=$_ldflags
  1767. ])
  1768. fi
  1769. if test "x$USE_POLARSSL" = "xyes"; then
  1770. AC_MSG_NOTICE([detected PolarSSL])
  1771. CURL_LIBS="$CURL_LIBS -lpolarssl"
  1772. LIBS="$LIBS -lpolarssl"
  1773. if test -n "$polarssllib"; then
  1774. dnl when shared libs were found in a path that the run-time
  1775. dnl linker doesn't search through, we need to add it to
  1776. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1777. dnl due to this
  1778. if test "x$cross_compiling" != "xyes"; then
  1779. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
  1780. export LD_LIBRARY_PATH
  1781. AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
  1782. fi
  1783. fi
  1784. fi
  1785. fi dnl PolarSSL not disabled
  1786. fi
  1787. dnl ----------------------------------------------------
  1788. dnl check for CyaSSL
  1789. dnl ----------------------------------------------------
  1790. dnl Default to compiler & linker defaults for CyaSSL files & libraries.
  1791. OPT_CYASSL=no
  1792. _cppflags=$CPPFLAGS
  1793. _ldflags=$LDFLAGS
  1794. AC_ARG_WITH(cyassl,dnl
  1795. AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
  1796. AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
  1797. OPT_CYASSL=$withval)
  1798. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1799. if test X"$OPT_CYASSL" != Xno; then
  1800. if test "$OPT_CYASSL" = "yes"; then
  1801. OPT_CYASSL=""
  1802. fi
  1803. if test -z "$OPT_CYASSL" ; then
  1804. dnl check for lib in system default first
  1805. AC_CHECK_LIB(cyassl, CyaSSL_Init,
  1806. dnl libcyassl found, set the variable
  1807. [
  1808. AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
  1809. AC_SUBST(USE_CYASSL, [1])
  1810. CYASSL_ENABLED=1
  1811. USE_CYASSL="yes"
  1812. curl_ssl_msg="enabled (CyaSSL)"
  1813. ])
  1814. fi
  1815. if test "x$USE_CYASSL" != "xyes"; then
  1816. dnl add the path and test again
  1817. addld=-L$OPT_CYASSL/lib$libsuff
  1818. addcflags=-I$OPT_CYASSL/include
  1819. cyassllib=$OPT_CYASSL/lib$libsuff
  1820. LDFLAGS="$LDFLAGS $addld"
  1821. if test "$addcflags" != "-I/usr/include"; then
  1822. CPPFLAGS="$CPPFLAGS $addcflags"
  1823. fi
  1824. AC_CHECK_LIB(cyassl, CyaSSL_Init,
  1825. [
  1826. AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
  1827. AC_SUBST(USE_CYASSL, [1])
  1828. CYASSL_ENABLED=1
  1829. USE_CYASSL="yes"
  1830. curl_ssl_msg="enabled (CyaSSL)"
  1831. ],
  1832. [
  1833. CPPFLAGS=$_cppflags
  1834. LDFLAGS=$_ldflags
  1835. ])
  1836. fi
  1837. if test "x$USE_CYASSL" = "xyes"; then
  1838. AC_MSG_NOTICE([detected CyaSSL])
  1839. CURL_LIBS="$CURL_LIBS -lcyassl -lm"
  1840. LIBS="$LIBS -lcyassl -lm"
  1841. if test -n "$cyassllib"; then
  1842. dnl when shared libs were found in a path that the run-time
  1843. dnl linker doesn't search through, we need to add it to
  1844. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1845. dnl due to this
  1846. if test "x$cross_compiling" != "xyes"; then
  1847. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib"
  1848. export LD_LIBRARY_PATH
  1849. AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH])
  1850. fi
  1851. fi
  1852. fi
  1853. fi dnl CyaSSL not disabled
  1854. fi
  1855. dnl ----------------------------------------------------
  1856. dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
  1857. dnl ----------------------------------------------------
  1858. dnl Default to compiler & linker defaults for NSS files & libraries.
  1859. OPT_NSS=no
  1860. AC_ARG_WITH(nss,dnl
  1861. AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
  1862. AC_HELP_STRING([--without-nss], [disable NSS detection]),
  1863. OPT_NSS=$withval)
  1864. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1865. if test X"$OPT_NSS" != Xno; then
  1866. if test "x$OPT_NSS" = "xyes"; then
  1867. CURL_CHECK_PKGCONFIG(nss)
  1868. if test "$PKGCONFIG" != "no" ; then
  1869. addlib=`$PKGCONFIG --libs nss`
  1870. addcflags=`$PKGCONFIG --cflags nss`
  1871. version=`$PKGCONFIG --modversion nss`
  1872. nssprefix=`$PKGCONFIG --variable=prefix nss`
  1873. else
  1874. dnl Without pkg-config, we check for nss-config
  1875. check=`nss-config --version 2>/dev/null`
  1876. if test -n "$check"; then
  1877. addlib=`nss-config --libs`
  1878. addcflags=`nss-config --cflags`
  1879. version=`nss-config --version`
  1880. nssprefix=`nss-config --prefix`
  1881. else
  1882. addlib="-lnss3"
  1883. addcflags=""
  1884. version="unknown"
  1885. fi
  1886. fi
  1887. else
  1888. # Without pkg-config, we'll kludge in some defaults
  1889. addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
  1890. addcflags="-I$OPT_NSS/include"
  1891. version="unknown"
  1892. nssprefix=$OPT_NSS
  1893. fi
  1894. if test -n "$addlib"; then
  1895. CLEANLIBS="$LIBS"
  1896. CLEANCPPFLAGS="$CPPFLAGS"
  1897. LIBS="$LIBS $addlib"
  1898. if test "$addcflags" != "-I/usr/include"; then
  1899. CPPFLAGS="$CPPFLAGS $addcflags"
  1900. fi
  1901. dnl The function PK11_CreateGenericObject is needed to load libnsspem.so
  1902. AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
  1903. [
  1904. AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
  1905. AC_SUBST(USE_NSS, [1])
  1906. USE_NSS="yes"
  1907. NSS_ENABLED=1
  1908. curl_ssl_msg="enabled (NSS)"
  1909. ],
  1910. [
  1911. LIBS="$CLEANLIBS"
  1912. CPPFLAGS="$CLEANCPPFLAGS"
  1913. ])
  1914. if test "x$USE_NSS" = "xyes"; then
  1915. AC_MSG_NOTICE([detected NSS version $version])
  1916. dnl NSS_InitContext() was introduced in NSS 3.12.5 and helps to prevent
  1917. dnl collisions on NSS initialization/shutdown with other libraries
  1918. AC_CHECK_FUNC(NSS_InitContext,
  1919. [
  1920. AC_DEFINE(HAVE_NSS_INITCONTEXT, 1, [if you have the NSS_InitContext function])
  1921. AC_SUBST(HAVE_NSS_INITCONTEXT, [1])
  1922. ])
  1923. dnl when shared libs were found in a path that the run-time
  1924. dnl linker doesn't search through, we need to add it to
  1925. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1926. dnl due to this
  1927. if test "x$cross_compiling" != "xyes"; then
  1928. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
  1929. export LD_LIBRARY_PATH
  1930. AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
  1931. fi
  1932. fi
  1933. fi
  1934. fi dnl NSS not disabled
  1935. fi dnl curl_ssl_msg = init_ssl_msg
  1936. OPT_AXTLS=off
  1937. AC_ARG_WITH(axtls,dnl
  1938. AC_HELP_STRING([--with-axtls=PATH],[Where to look for axTLS, PATH points to the axTLS installation prefix (default: /usr/local). Ignored if another SSL engine is selected.])
  1939. AC_HELP_STRING([--without-axtls], [disable axTLS]),
  1940. OPT_AXTLS=$withval)
  1941. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1942. if test X"$OPT_AXTLS" != Xno; then
  1943. dnl backup the pre-axtls variables
  1944. CLEANLDFLAGS="$LDFLAGS"
  1945. CLEANCPPFLAGS="$CPPFLAGS"
  1946. CLEANLIBS="$LIBS"
  1947. case "$OPT_AXTLS" in
  1948. yes)
  1949. dnl --with-axtls (without path) used
  1950. PREFIX_AXTLS=/usr/local
  1951. LIB_AXTLS="$PREFIX_AXTLS/lib"
  1952. LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
  1953. CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
  1954. ;;
  1955. off)
  1956. dnl no --with-axtls option given, just check default places
  1957. PREFIX_AXTLS=
  1958. ;;
  1959. *)
  1960. dnl check the given --with-axtls spot
  1961. PREFIX_AXTLS=$OPT_AXTLS
  1962. LIB_AXTLS="$PREFIX_AXTLS/lib"
  1963. LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
  1964. CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
  1965. ;;
  1966. esac
  1967. AC_CHECK_LIB(axtls, ssl_version,[
  1968. LIBS="-laxtls $LIBS"
  1969. AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled])
  1970. AC_SUBST(USE_AXTLS, [1])
  1971. AXTLS_ENABLED=1
  1972. USE_AXTLS="yes"
  1973. curl_ssl_msg="enabled (axTLS)"
  1974. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS"
  1975. export LD_LIBRARY_PATH
  1976. AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH])
  1977. ],[
  1978. LDFLAGS="$CLEANLDFLAGS"
  1979. CPPFLAGS="$CLEANCPPFLAGS"
  1980. LIBS="$CLEANLIBS"
  1981. ])
  1982. fi
  1983. fi
  1984. if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
  1985. AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
  1986. AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls or --with-winssl to address this.])
  1987. else
  1988. # SSL is enabled, genericly
  1989. AC_SUBST(SSL_ENABLED)
  1990. SSL_ENABLED="1"
  1991. fi
  1992. dnl **********************************************************************
  1993. dnl Check for the CA bundle
  1994. dnl **********************************************************************
  1995. CURL_CHECK_CA_BUNDLE
  1996. dnl **********************************************************************
  1997. dnl Check for libmetalink
  1998. dnl **********************************************************************
  1999. OPT_LIBMETALINK=no
  2000. AC_ARG_WITH(libmetalink,dnl
  2001. AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
  2002. AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
  2003. OPT_LIBMETALINK=$withval)
  2004. if test X"$OPT_LIBMETALINK" != Xno; then
  2005. addlib=""
  2006. addld=""
  2007. addcflags=""
  2008. version=""
  2009. libmetalinklib=""
  2010. PKGTEST="no"
  2011. if test "x$OPT_LIBMETALINK" = "xyes"; then
  2012. dnl this is with no partiular path given
  2013. PKGTEST="yes"
  2014. CURL_CHECK_PKGCONFIG(libmetalink)
  2015. else
  2016. dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
  2017. LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
  2018. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
  2019. if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
  2020. PKGTEST="yes"
  2021. fi
  2022. if test "$PKGTEST" = "yes"; then
  2023. CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
  2024. fi
  2025. fi
  2026. if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
  2027. addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2028. $PKGCONFIG --libs-only-l libmetalink`
  2029. addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2030. $PKGCONFIG --libs-only-L libmetalink`
  2031. addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2032. $PKGCONFIG --cflags-only-I libmetalink`
  2033. version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2034. $PKGCONFIG --modversion libmetalink`
  2035. libmetalinklib=`echo $addld | $SED -e 's/-L//'`
  2036. fi
  2037. if test -n "$addlib"; then
  2038. clean_CPPFLAGS="$CPPFLAGS"
  2039. clean_LDFLAGS="$LDFLAGS"
  2040. clean_LIBS="$LIBS"
  2041. CPPFLAGS="$addcflags $clean_CPPFLAGS"
  2042. LDFLAGS="$addld $clean_LDFLAGS"
  2043. LIBS="$addlib $clean_LIBS"
  2044. AC_MSG_CHECKING([if libmetalink is recent enough])
  2045. AC_LINK_IFELSE([
  2046. AC_LANG_PROGRAM([[
  2047. # include <metalink/metalink.h>
  2048. ]],[[
  2049. if(0 != metalink_strerror(0)) /* added in 0.1.0 */
  2050. return 1;
  2051. ]])
  2052. ],[
  2053. AC_MSG_RESULT([yes ($version)])
  2054. want_metalink="yes"
  2055. ],[
  2056. AC_MSG_RESULT([no ($version)])
  2057. AC_MSG_NOTICE([libmetalink library defective or too old])
  2058. want_metalink="no"
  2059. ])
  2060. CPPFLAGS="$clean_CPPFLAGS"
  2061. LDFLAGS="$clean_LDFLAGS"
  2062. LIBS="$clean_LIBS"
  2063. if test "$want_metalink" = "yes"; then
  2064. dnl finally libmetalink will be used
  2065. AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
  2066. LIBMETALINK_LIBS=$addlib
  2067. LIBMETALINK_LDFLAGS=$addld
  2068. LIBMETALINK_CFLAGS=$addcflags
  2069. AC_SUBST([LIBMETALINK_LIBS])
  2070. AC_SUBST([LIBMETALINK_LDFLAGS])
  2071. AC_SUBST([LIBMETALINK_CFLAGS])
  2072. curl_mtlnk_msg="enabled"
  2073. fi
  2074. fi
  2075. fi
  2076. dnl **********************************************************************
  2077. dnl Check for the presence of LIBSSH2 libraries and headers
  2078. dnl **********************************************************************
  2079. dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
  2080. OPT_LIBSSH2=off
  2081. AC_ARG_WITH(libssh2,dnl
  2082. 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])
  2083. AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
  2084. OPT_LIBSSH2=$withval)
  2085. if test X"$OPT_LIBSSH2" != Xno; then
  2086. dnl backup the pre-libssh2 variables
  2087. CLEANLDFLAGS="$LDFLAGS"
  2088. CLEANCPPFLAGS="$CPPFLAGS"
  2089. CLEANLIBS="$LIBS"
  2090. case "$OPT_LIBSSH2" in
  2091. yes)
  2092. dnl --with-libssh2 (without path) used
  2093. CURL_CHECK_PKGCONFIG(libssh2)
  2094. if test "$PKGCONFIG" != "no" ; then
  2095. LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
  2096. LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
  2097. CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
  2098. version=`$PKGCONFIG --modversion libssh2`
  2099. DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
  2100. fi
  2101. ;;
  2102. off)
  2103. dnl no --with-libssh2 option given, just check default places
  2104. ;;
  2105. *)
  2106. dnl use the given --with-libssh2 spot
  2107. PREFIX_SSH2=$OPT_LIBSSH2
  2108. ;;
  2109. esac
  2110. dnl if given with a prefix, we set -L and -I based on that
  2111. if test -n "$PREFIX_SSH2"; then
  2112. LIB_SSH2="-lssh2"
  2113. LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
  2114. CPP_SSH2=-I${PREFIX_SSH2}/include
  2115. DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
  2116. fi
  2117. LDFLAGS="$LDFLAGS $LD_SSH2"
  2118. CPPFLAGS="$CPPFLAGS $CPP_SSH2"
  2119. LIBS="$LIBS $LIB_SSH2"
  2120. AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
  2121. AC_CHECK_HEADERS(libssh2.h,
  2122. curl_ssh_msg="enabled (libSSH2)"
  2123. LIBSSH2_ENABLED=1
  2124. AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
  2125. AC_SUBST(USE_LIBSSH2, [1])
  2126. )
  2127. if test X"$OPT_LIBSSH2" != Xoff &&
  2128. test "$LIBSSH2_ENABLED" != "1"; then
  2129. AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
  2130. fi
  2131. if test "$LIBSSH2_ENABLED" = "1"; then
  2132. if test -n "$DIR_SSH2"; then
  2133. dnl when the libssh2 shared libs were found in a path that the run-time
  2134. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  2135. dnl to prevent further configure tests to fail due to this
  2136. dnl libssh2_version is a post 1.0 addition
  2137. dnl libssh2_init and libssh2_exit were added in 1.2.5
  2138. dnl libssh2_scp_send64 was added in 1.2.6
  2139. dnl libssh2_session_handshake was added in 1.2.8
  2140. AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
  2141. libssh2_scp_send64 libssh2_session_handshake)
  2142. if test "x$cross_compiling" != "xyes"; then
  2143. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
  2144. export LD_LIBRARY_PATH
  2145. AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
  2146. fi
  2147. fi
  2148. else
  2149. dnl no libssh2, revert back to clean variables
  2150. LDFLAGS=$CLEANLDFLAGS
  2151. CPPFLAGS=$CLEANCPPFLAGS
  2152. LIBS=$CLEANLIBS
  2153. fi
  2154. fi
  2155. dnl **********************************************************************
  2156. dnl Check for the presence of LIBRTMP libraries and headers
  2157. dnl **********************************************************************
  2158. dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
  2159. OPT_LIBRTMP=off
  2160. AC_ARG_WITH(librtmp,dnl
  2161. 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])
  2162. AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
  2163. OPT_LIBRTMP=$withval)
  2164. if test X"$OPT_LIBRTMP" != Xno; then
  2165. dnl backup the pre-librtmp variables
  2166. CLEANLDFLAGS="$LDFLAGS"
  2167. CLEANCPPFLAGS="$CPPFLAGS"
  2168. CLEANLIBS="$LIBS"
  2169. case "$OPT_LIBRTMP" in
  2170. yes)
  2171. dnl --with-librtmp (without path) used
  2172. CURL_CHECK_PKGCONFIG(librtmp)
  2173. if test "$PKGCONFIG" != "no" ; then
  2174. LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
  2175. LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
  2176. CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
  2177. version=`$PKGCONFIG --modversion librtmp`
  2178. DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
  2179. else
  2180. dnl To avoid link errors, we do not allow --librtmp without
  2181. dnl a pkgconfig file
  2182. AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
  2183. fi
  2184. ;;
  2185. off)
  2186. dnl no --with-librtmp option given, just check default places
  2187. LIB_RTMP="-lrtmp"
  2188. ;;
  2189. *)
  2190. dnl use the given --with-librtmp spot
  2191. PREFIX_RTMP=$OPT_LIBRTMP
  2192. ;;
  2193. esac
  2194. dnl if given with a prefix, we set -L and -I based on that
  2195. if test -n "$PREFIX_RTMP"; then
  2196. LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
  2197. CPP_RTMP=-I${PREFIX_RTMP}/include
  2198. DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
  2199. fi
  2200. LDFLAGS="$LDFLAGS $LD_RTMP"
  2201. CPPFLAGS="$CPPFLAGS $CPP_RTMP"
  2202. LIBS="$LIBS $LIB_RTMP"
  2203. AC_CHECK_LIB(rtmp, RTMP_Init,
  2204. [
  2205. AC_CHECK_HEADERS(librtmp/rtmp.h,
  2206. curl_rtmp_msg="enabled (librtmp)"
  2207. LIBRTMP_ENABLED=1
  2208. AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
  2209. AC_SUBST(USE_LIBRTMP, [1])
  2210. )
  2211. ],
  2212. dnl not found, revert back to clean variables
  2213. LDFLAGS=$CLEANLDFLAGS
  2214. CPPFLAGS=$CLEANCPPFLAGS
  2215. LIBS=$CLEANLIBS
  2216. )
  2217. if test X"$OPT_LIBRTMP" != Xoff &&
  2218. test "$LIBRTMP_ENABLED" != "1"; then
  2219. AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
  2220. fi
  2221. fi
  2222. dnl **********************************************************************
  2223. dnl Check for linker switch for versioned symbols
  2224. dnl **********************************************************************
  2225. versioned_symbols_flavour=
  2226. AC_MSG_CHECKING([whether versioned symbols are wanted])
  2227. AC_ARG_ENABLE(versioned-symbols,
  2228. AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
  2229. AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
  2230. [ case "$enableval" in
  2231. yes) AC_MSG_RESULT(yes)
  2232. AC_MSG_CHECKING([if libraries can be versioned])
  2233. GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
  2234. if test -z "$GLD"; then
  2235. AC_MSG_RESULT(no)
  2236. AC_MSG_WARN([You need an ld version supporting the --version-script option])
  2237. else
  2238. AC_MSG_RESULT(yes)
  2239. if test "x$OPENSSL_ENABLED" = "x1"; then
  2240. versioned_symbols_flavour="OPENSSL_"
  2241. elif test "x$GNUTLS_ENABLED" == "x1"; then
  2242. versioned_symbols_flavour="GNUTLS_"
  2243. elif test "x$NSS_ENABLED" == "x1"; then
  2244. versioned_symbols_flavour="NSS_"
  2245. elif test "x$POLARSSL_ENABLED" == "x1"; then
  2246. versioned_symbols_flavour="POLARSSL_"
  2247. elif test "x$CYASSL_ENABLED" == "x1"; then
  2248. versioned_symbols_flavour="CYASSL_"
  2249. elif test "x$AXTLS_ENABLED" == "x1"; then
  2250. versioned_symbols_flavour="AXTLS_"
  2251. elif test "x$WINSSL_ENABLED" == "x1"; then
  2252. versioned_symbols_flavour="WINSSL_"
  2253. elif test "x$DARWINSSL_ENABLED" == "x1"; then
  2254. versioned_symbols_flavour="DARWINSSL_"
  2255. else
  2256. versioned_symbols_flavour=""
  2257. fi
  2258. versioned_symbols="yes"
  2259. fi
  2260. ;;
  2261. *) AC_MSG_RESULT(no)
  2262. ;;
  2263. esac
  2264. ], [
  2265. AC_MSG_RESULT(no)
  2266. ]
  2267. )
  2268. AC_SUBST(VERSIONED_FLAVOUR, ["$versioned_symbols_flavour"])
  2269. AM_CONDITIONAL(VERSIONED_SYMBOLS, test "x$versioned_symbols" = "xyes")
  2270. dnl **********************************************************************
  2271. dnl Check for the presence of IDN libraries and headers
  2272. dnl **********************************************************************
  2273. AC_MSG_CHECKING([whether to build with libidn])
  2274. OPT_IDN="default"
  2275. AC_ARG_WITH(libidn,
  2276. AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
  2277. AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
  2278. [OPT_IDN=$withval])
  2279. case "$OPT_IDN" in
  2280. no)
  2281. dnl --without-libidn option used
  2282. want_idn="no"
  2283. AC_MSG_RESULT([no])
  2284. ;;
  2285. default)
  2286. dnl configure option not specified
  2287. want_idn="yes"
  2288. want_idn_path="default"
  2289. AC_MSG_RESULT([(assumed) yes])
  2290. ;;
  2291. yes)
  2292. dnl --with-libidn option used without path
  2293. want_idn="yes"
  2294. want_idn_path="default"
  2295. AC_MSG_RESULT([yes])
  2296. ;;
  2297. *)
  2298. dnl --with-libidn option used with path
  2299. want_idn="yes"
  2300. want_idn_path="$withval"
  2301. AC_MSG_RESULT([yes ($withval)])
  2302. ;;
  2303. esac
  2304. if test "$want_idn" = "yes"; then
  2305. dnl idn library support has been requested
  2306. clean_CPPFLAGS="$CPPFLAGS"
  2307. clean_LDFLAGS="$LDFLAGS"
  2308. clean_LIBS="$LIBS"
  2309. PKGCONFIG="no"
  2310. #
  2311. if test "$want_idn_path" != "default"; then
  2312. dnl path has been specified
  2313. IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
  2314. CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
  2315. if test "$PKGCONFIG" != "no"; then
  2316. IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2317. $PKGCONFIG --libs-only-l libidn 2>/dev/null`
  2318. IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2319. $PKGCONFIG --libs-only-L libidn 2>/dev/null`
  2320. IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2321. $PKGCONFIG --cflags-only-I libidn 2>/dev/null`
  2322. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
  2323. else
  2324. dnl pkg-config not available or provides no info
  2325. IDN_LIBS="-lidn"
  2326. IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
  2327. IDN_CPPFLAGS="-I$want_idn_path/include"
  2328. IDN_DIR="$want_idn_path/lib$libsuff"
  2329. fi
  2330. else
  2331. dnl path not specified
  2332. CURL_CHECK_PKGCONFIG(libidn)
  2333. if test "$PKGCONFIG" != "no"; then
  2334. IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
  2335. IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
  2336. IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
  2337. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
  2338. else
  2339. dnl pkg-config not available or provides no info
  2340. IDN_LIBS="-lidn"
  2341. fi
  2342. fi
  2343. #
  2344. if test "$PKGCONFIG" != "no"; then
  2345. AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
  2346. AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2347. AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2348. AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
  2349. else
  2350. AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
  2351. AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2352. AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2353. AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
  2354. fi
  2355. #
  2356. CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
  2357. LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
  2358. LIBS="$IDN_LIBS $LIBS"
  2359. #
  2360. AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
  2361. AC_LINK_IFELSE([
  2362. AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
  2363. ],[
  2364. AC_MSG_RESULT([yes])
  2365. tst_links_libidn="yes"
  2366. ],[
  2367. AC_MSG_RESULT([no])
  2368. tst_links_libidn="no"
  2369. ])
  2370. if test "$tst_links_libidn" = "no"; then
  2371. AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
  2372. AC_LINK_IFELSE([
  2373. AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
  2374. ],[
  2375. AC_MSG_RESULT([yes])
  2376. tst_links_libidn="yes"
  2377. ],[
  2378. AC_MSG_RESULT([no])
  2379. tst_links_libidn="no"
  2380. ])
  2381. fi
  2382. #
  2383. if test "$tst_links_libidn" = "yes"; then
  2384. AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
  2385. dnl different versions of libidn have different setups of these:
  2386. AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
  2387. AC_CHECK_HEADERS( idn-free.h tld.h )
  2388. if test "x$ac_cv_header_tld_h" = "xyes"; then
  2389. AC_SUBST([IDN_ENABLED], [1])
  2390. curl_idn_msg="enabled"
  2391. if test -n "$IDN_DIR"; then
  2392. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
  2393. export LD_LIBRARY_PATH
  2394. AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
  2395. fi
  2396. else
  2397. AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
  2398. CPPFLAGS="$clean_CPPFLAGS"
  2399. LDFLAGS="$clean_LDFLAGS"
  2400. LIBS="$clean_LIBS"
  2401. fi
  2402. else
  2403. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2404. CPPFLAGS="$clean_CPPFLAGS"
  2405. LDFLAGS="$clean_LDFLAGS"
  2406. LIBS="$clean_LIBS"
  2407. fi
  2408. fi
  2409. dnl Let's hope this split URL remains working:
  2410. dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
  2411. dnl genprogc/thread_quick_ref.htm
  2412. dnl **********************************************************************
  2413. dnl Back to "normal" configuring
  2414. dnl **********************************************************************
  2415. dnl Checks for header files.
  2416. AC_HEADER_STDC
  2417. CURL_CHECK_HEADER_MALLOC
  2418. CURL_CHECK_HEADER_MEMORY
  2419. dnl Now check for the very most basic headers. Then we can use these
  2420. dnl ones as default-headers when checking for the rest!
  2421. AC_CHECK_HEADERS(
  2422. sys/types.h \
  2423. sys/time.h \
  2424. sys/select.h \
  2425. sys/socket.h \
  2426. sys/ioctl.h \
  2427. sys/uio.h \
  2428. assert.h \
  2429. unistd.h \
  2430. stdlib.h \
  2431. limits.h \
  2432. arpa/inet.h \
  2433. net/if.h \
  2434. netinet/in.h \
  2435. sys/un.h \
  2436. netinet/tcp.h \
  2437. netdb.h \
  2438. sys/sockio.h \
  2439. sys/stat.h \
  2440. sys/param.h \
  2441. termios.h \
  2442. termio.h \
  2443. sgtty.h \
  2444. fcntl.h \
  2445. alloca.h \
  2446. time.h \
  2447. io.h \
  2448. pwd.h \
  2449. utime.h \
  2450. sys/utime.h \
  2451. sys/poll.h \
  2452. poll.h \
  2453. socket.h \
  2454. sys/resource.h \
  2455. libgen.h \
  2456. locale.h \
  2457. errno.h \
  2458. stdbool.h \
  2459. arpa/tftp.h \
  2460. sys/filio.h \
  2461. sys/wait.h \
  2462. setjmp.h,
  2463. dnl to do if not found
  2464. [],
  2465. dnl to do if found
  2466. [],
  2467. dnl default includes
  2468. [
  2469. #ifdef HAVE_SYS_TYPES_H
  2470. #include <sys/types.h>
  2471. #endif
  2472. #ifdef HAVE_SYS_TIME_H
  2473. #include <sys/time.h>
  2474. #endif
  2475. #ifdef HAVE_SYS_SELECT_H
  2476. #include <sys/select.h>
  2477. #endif
  2478. #ifdef HAVE_SYS_SOCKET_H
  2479. #include <sys/socket.h>
  2480. #endif
  2481. #ifdef HAVE_NETINET_IN_H
  2482. #include <netinet/in.h>
  2483. #endif
  2484. #ifdef HAVE_SYS_UN_H
  2485. #include <sys/un.h>
  2486. #endif
  2487. ]
  2488. )
  2489. dnl Checks for typedefs, structures, and compiler characteristics.
  2490. AC_C_CONST
  2491. CURL_CHECK_VARIADIC_MACROS
  2492. AC_TYPE_SIZE_T
  2493. AC_HEADER_TIME
  2494. CURL_CHECK_STRUCT_TIMEVAL
  2495. CURL_VERIFY_RUNTIMELIBS
  2496. AC_CHECK_SIZEOF(size_t)
  2497. AC_CHECK_SIZEOF(long)
  2498. AC_CHECK_SIZEOF(int)
  2499. AC_CHECK_SIZEOF(short)
  2500. CURL_CONFIGURE_LONG
  2501. AC_CHECK_SIZEOF(time_t)
  2502. AC_CHECK_SIZEOF(off_t)
  2503. soname_bump=no
  2504. if test x"$ac_cv_native_windows" != "xyes" &&
  2505. test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
  2506. AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
  2507. AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
  2508. soname_bump=yes
  2509. fi
  2510. AC_CHECK_TYPE(long long,
  2511. [AC_DEFINE(HAVE_LONGLONG, 1,
  2512. [Define to 1 if the compiler supports the 'long long' data type.])]
  2513. longlong="yes"
  2514. )
  2515. if test "xyes" = "x$longlong"; then
  2516. AC_MSG_CHECKING([if numberLL works])
  2517. AC_COMPILE_IFELSE([
  2518. AC_LANG_PROGRAM([[
  2519. ]],[[
  2520. long long val = 1000LL;
  2521. ]])
  2522. ],[
  2523. AC_MSG_RESULT([yes])
  2524. AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
  2525. ],[
  2526. AC_MSG_RESULT([no])
  2527. ])
  2528. fi
  2529. # check for ssize_t
  2530. AC_CHECK_TYPE(ssize_t, ,
  2531. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  2532. # check for bool type
  2533. AC_CHECK_TYPE([bool],[
  2534. AC_DEFINE(HAVE_BOOL_T, 1,
  2535. [Define to 1 if bool is an available type.])
  2536. ], ,[
  2537. #ifdef HAVE_SYS_TYPES_H
  2538. #include <sys/types.h>
  2539. #endif
  2540. #ifdef HAVE_STDBOOL_H
  2541. #include <stdbool.h>
  2542. #endif
  2543. ])
  2544. CURL_CONFIGURE_CURL_SOCKLEN_T
  2545. TYPE_IN_ADDR_T
  2546. TYPE_SOCKADDR_STORAGE
  2547. TYPE_SIG_ATOMIC_T
  2548. AC_TYPE_SIGNAL
  2549. CURL_CHECK_FUNC_SELECT
  2550. CURL_CHECK_FUNC_RECV
  2551. CURL_CHECK_FUNC_RECVFROM
  2552. CURL_CHECK_FUNC_SEND
  2553. CURL_CHECK_MSG_NOSIGNAL
  2554. CURL_CHECK_FUNC_ALARM
  2555. CURL_CHECK_FUNC_BASENAME
  2556. CURL_CHECK_FUNC_CLOSESOCKET
  2557. CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  2558. CURL_CHECK_FUNC_CONNECT
  2559. CURL_CHECK_FUNC_FCNTL
  2560. CURL_CHECK_FUNC_FDOPEN
  2561. CURL_CHECK_FUNC_FREEADDRINFO
  2562. CURL_CHECK_FUNC_FREEIFADDRS
  2563. CURL_CHECK_FUNC_FSETXATTR
  2564. CURL_CHECK_FUNC_FTRUNCATE
  2565. CURL_CHECK_FUNC_GETADDRINFO
  2566. CURL_CHECK_FUNC_GAI_STRERROR
  2567. CURL_CHECK_FUNC_GETHOSTBYADDR
  2568. CURL_CHECK_FUNC_GETHOSTBYADDR_R
  2569. CURL_CHECK_FUNC_GETHOSTBYNAME
  2570. CURL_CHECK_FUNC_GETHOSTBYNAME_R
  2571. CURL_CHECK_FUNC_GETHOSTNAME
  2572. CURL_CHECK_FUNC_GETIFADDRS
  2573. CURL_CHECK_FUNC_GETSERVBYPORT_R
  2574. CURL_CHECK_FUNC_GMTIME_R
  2575. CURL_CHECK_FUNC_INET_NTOA_R
  2576. CURL_CHECK_FUNC_INET_NTOP
  2577. CURL_CHECK_FUNC_INET_PTON
  2578. CURL_CHECK_FUNC_IOCTL
  2579. CURL_CHECK_FUNC_IOCTLSOCKET
  2580. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  2581. CURL_CHECK_FUNC_LOCALTIME_R
  2582. CURL_CHECK_FUNC_MEMRCHR
  2583. CURL_CHECK_FUNC_POLL
  2584. CURL_CHECK_FUNC_SETSOCKOPT
  2585. CURL_CHECK_FUNC_SIGACTION
  2586. CURL_CHECK_FUNC_SIGINTERRUPT
  2587. CURL_CHECK_FUNC_SIGNAL
  2588. CURL_CHECK_FUNC_SIGSETJMP
  2589. CURL_CHECK_FUNC_SOCKET
  2590. CURL_CHECK_FUNC_SOCKETPAIR
  2591. CURL_CHECK_FUNC_STRCASECMP
  2592. CURL_CHECK_FUNC_STRCASESTR
  2593. CURL_CHECK_FUNC_STRCMPI
  2594. CURL_CHECK_FUNC_STRDUP
  2595. CURL_CHECK_FUNC_STRERROR_R
  2596. CURL_CHECK_FUNC_STRICMP
  2597. CURL_CHECK_FUNC_STRLCAT
  2598. CURL_CHECK_FUNC_STRNCASECMP
  2599. CURL_CHECK_FUNC_STRNCMPI
  2600. CURL_CHECK_FUNC_STRNICMP
  2601. CURL_CHECK_FUNC_STRSTR
  2602. CURL_CHECK_FUNC_STRTOK_R
  2603. CURL_CHECK_FUNC_STRTOLL
  2604. CURL_CHECK_FUNC_WRITEV
  2605. case $host in
  2606. *msdosdjgpp)
  2607. ac_cv_func_pipe=no
  2608. skipcheck_pipe=yes
  2609. AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
  2610. ;;
  2611. esac
  2612. AC_CHECK_FUNCS([fork \
  2613. geteuid \
  2614. getpass_r \
  2615. getppid \
  2616. getprotobyname \
  2617. getpwuid \
  2618. getrlimit \
  2619. gettimeofday \
  2620. inet_addr \
  2621. perror \
  2622. pipe \
  2623. setlocale \
  2624. setmode \
  2625. setrlimit \
  2626. uname \
  2627. utime
  2628. ],[
  2629. ],[
  2630. func="$ac_func"
  2631. eval skipcheck=\$skipcheck_$func
  2632. if test "x$skipcheck" != "xyes"; then
  2633. AC_MSG_CHECKING([deeper for $func])
  2634. AC_LINK_IFELSE([
  2635. AC_LANG_PROGRAM([[
  2636. ]],[[
  2637. $func ();
  2638. ]])
  2639. ],[
  2640. AC_MSG_RESULT([yes])
  2641. eval "ac_cv_func_$func=yes"
  2642. AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
  2643. [Define to 1 if you have the $func function.])
  2644. ],[
  2645. AC_MSG_RESULT([but still no])
  2646. ])
  2647. fi
  2648. ])
  2649. dnl Check if the getnameinfo function is available
  2650. dnl and get the types of five of its arguments.
  2651. CURL_CHECK_FUNC_GETNAMEINFO
  2652. if test "$ipv6" = "yes"; then
  2653. if test "$ac_cv_func_getaddrinfo" = "yes"; then
  2654. AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
  2655. IPV6_ENABLED=1
  2656. AC_SUBST(IPV6_ENABLED)
  2657. fi
  2658. CURL_CHECK_NI_WITHSCOPEID
  2659. fi
  2660. dnl ************************************************************
  2661. dnl enable non-blocking communications
  2662. dnl
  2663. CURL_CHECK_OPTION_NONBLOCKING
  2664. CURL_CHECK_NONBLOCKING_SOCKET
  2665. dnl ************************************************************
  2666. dnl nroff tool stuff
  2667. dnl
  2668. AC_PATH_PROG( PERL, perl, ,
  2669. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  2670. AC_SUBST(PERL)
  2671. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  2672. $PATH:/usr/bin/:/usr/local/bin )
  2673. AC_SUBST(NROFF)
  2674. if test -n "$NROFF"; then
  2675. dnl only check for nroff options if an nroff command was found
  2676. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  2677. MANOPT="-man"
  2678. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  2679. if test -z "$mancheck"; then
  2680. MANOPT="-mandoc"
  2681. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  2682. if test -z "$mancheck"; then
  2683. MANOPT=""
  2684. AC_MSG_RESULT([failed])
  2685. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  2686. else
  2687. AC_MSG_RESULT([$MANOPT])
  2688. fi
  2689. else
  2690. AC_MSG_RESULT([$MANOPT])
  2691. fi
  2692. AC_SUBST(MANOPT)
  2693. fi
  2694. if test -z "$MANOPT"
  2695. then
  2696. dnl if no nroff tool was found, or no option that could convert man pages
  2697. dnl was found, then disable the built-in manual stuff
  2698. AC_MSG_WARN([disabling built-in manual])
  2699. USE_MANUAL="no";
  2700. fi
  2701. dnl *************************************************************************
  2702. dnl If the manual variable still is set, then we go with providing a built-in
  2703. dnl manual
  2704. if test "$USE_MANUAL" = "1"; then
  2705. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  2706. curl_manual_msg="enabled"
  2707. fi
  2708. dnl set variable for use in automakefile(s)
  2709. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  2710. CURL_CHECK_LIB_ARES
  2711. AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
  2712. if test "x$ac_cv_native_windows" != "xyes" &&
  2713. test "x$enable_shared" = "xyes"; then
  2714. build_libhostname=yes
  2715. else
  2716. build_libhostname=no
  2717. fi
  2718. AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
  2719. CURL_CHECK_OPTION_THREADED_RESOLVER
  2720. if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
  2721. AC_MSG_ERROR(
  2722. [Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
  2723. fi
  2724. if test "$want_thres" = "yes"; then
  2725. AC_CHECK_HEADER(pthread.h,
  2726. [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
  2727. save_CFLAGS="$CFLAGS"
  2728. CFLAGS="$CFLAGS -pthread"
  2729. AC_CHECK_LIB(pthread, pthread_create,
  2730. [ AC_MSG_NOTICE([using POSIX threaded DNS lookup])
  2731. AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
  2732. USE_THREADS_POSIX=1
  2733. curl_res_msg="threaded"
  2734. ],
  2735. [ CFLAGS="$save_CFLAGS"])
  2736. ])
  2737. fi
  2738. dnl ************************************************************
  2739. dnl disable verbose text strings
  2740. dnl
  2741. AC_MSG_CHECKING([whether to enable verbose strings])
  2742. AC_ARG_ENABLE(verbose,
  2743. AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
  2744. AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  2745. [ case "$enableval" in
  2746. no)
  2747. AC_MSG_RESULT(no)
  2748. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  2749. curl_verbose_msg="no"
  2750. ;;
  2751. *) AC_MSG_RESULT(yes)
  2752. ;;
  2753. esac ],
  2754. AC_MSG_RESULT(yes)
  2755. )
  2756. dnl ************************************************************
  2757. dnl enable SSPI support
  2758. dnl
  2759. AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
  2760. AC_ARG_ENABLE(sspi,
  2761. AC_HELP_STRING([--enable-sspi],[Enable SSPI])
  2762. AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
  2763. [ case "$enableval" in
  2764. yes)
  2765. if test "$ac_cv_native_windows" = "yes"; then
  2766. AC_MSG_RESULT(yes)
  2767. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  2768. AC_SUBST(USE_WINDOWS_SSPI, [1])
  2769. curl_sspi_msg="enabled"
  2770. else
  2771. AC_MSG_RESULT(no)
  2772. AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
  2773. fi
  2774. ;;
  2775. *)
  2776. if test "x$WINSSL_ENABLED" = "x1"; then
  2777. # --with-winssl implies --enable-sspi
  2778. AC_MSG_RESULT(yes)
  2779. else
  2780. AC_MSG_RESULT(no)
  2781. fi
  2782. ;;
  2783. esac ],
  2784. if test "x$WINSSL_ENABLED" = "x1"; then
  2785. # --with-winssl implies --enable-sspi
  2786. AC_MSG_RESULT(yes)
  2787. else
  2788. AC_MSG_RESULT(no)
  2789. fi
  2790. )
  2791. dnl ************************************************************
  2792. dnl disable cryptographic authentication
  2793. dnl
  2794. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  2795. AC_ARG_ENABLE(crypto-auth,
  2796. AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  2797. AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  2798. [ case "$enableval" in
  2799. no)
  2800. AC_MSG_RESULT(no)
  2801. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  2802. ;;
  2803. *) AC_MSG_RESULT(yes)
  2804. ;;
  2805. esac ],
  2806. AC_MSG_RESULT(yes)
  2807. )
  2808. CURL_CHECK_OPTION_NTLM_WB
  2809. CURL_CHECK_NTLM_WB
  2810. dnl ************************************************************
  2811. dnl disable TLS-SRP authentication
  2812. dnl
  2813. AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
  2814. AC_ARG_ENABLE(tls-srp,
  2815. AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
  2816. AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
  2817. [ case "$enableval" in
  2818. no)
  2819. AC_MSG_RESULT(no)
  2820. AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication])
  2821. want_tls_srp=no
  2822. ;;
  2823. *) AC_MSG_RESULT(yes)
  2824. want_tls_srp=yes
  2825. ;;
  2826. esac ],
  2827. AC_MSG_RESULT(yes)
  2828. want_tls_srp=yes
  2829. )
  2830. if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then
  2831. AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
  2832. USE_TLS_SRP=1
  2833. curl_tls_srp_msg="enabled"
  2834. fi
  2835. dnl ************************************************************
  2836. dnl disable cookies support
  2837. dnl
  2838. AC_MSG_CHECKING([whether to enable support for cookies])
  2839. AC_ARG_ENABLE(cookies,
  2840. AC_HELP_STRING([--enable-cookies],[Enable cookies support])
  2841. AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
  2842. [ case "$enableval" in
  2843. no)
  2844. AC_MSG_RESULT(no)
  2845. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  2846. ;;
  2847. *) AC_MSG_RESULT(yes)
  2848. ;;
  2849. esac ],
  2850. AC_MSG_RESULT(yes)
  2851. )
  2852. dnl ************************************************************
  2853. dnl hiding of library internal symbols
  2854. dnl
  2855. CURL_CONFIGURE_SYMBOL_HIDING
  2856. dnl ************************************************************
  2857. dnl enforce SONAME bump
  2858. dnl
  2859. AC_MSG_CHECKING([whether to enforce SONAME bump])
  2860. AC_ARG_ENABLE(soname-bump,
  2861. AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
  2862. AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
  2863. [ case "$enableval" in
  2864. yes) AC_MSG_RESULT(yes)
  2865. soname_bump=yes
  2866. ;;
  2867. *)
  2868. AC_MSG_RESULT(no)
  2869. ;;
  2870. esac ],
  2871. AC_MSG_RESULT($soname_bump)
  2872. )
  2873. AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
  2874. dnl ************************************************************
  2875. if test ! -z "$winsock_LIB"; then
  2876. dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
  2877. dnl things work when built with c-ares). But we can't just move it last
  2878. dnl since then other stuff (SSL) won't build. So we simply append it to the
  2879. dnl end.
  2880. LIBS="$LIBS $winsock_LIB"
  2881. TEST_SERVER_LIBS="$TEST_SERVER_LIBS $winsock_LIB"
  2882. fi
  2883. dnl
  2884. dnl All the library dependencies put into $LIB apply to libcurl only.
  2885. dnl Those in $CURL_LIBS apply to the curl command-line client only.
  2886. dnl Those in $TEST_SERVER_LIBS apply to test servers only.
  2887. dnl Those in $ALL_LIBS apply to all targets, including test targets.
  2888. dnl
  2889. LIBCURL_LIBS=$LIBS
  2890. AC_SUBST(LIBCURL_LIBS)
  2891. AC_SUBST(CURL_LIBS)
  2892. AC_SUBST(TEST_SERVER_LIBS)
  2893. AC_SUBST(CURL_NETWORK_LIBS)
  2894. LIBS=$ALL_LIBS dnl LIBS is a magic variable that's used for every link
  2895. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  2896. dnl yes or no
  2897. ENABLE_SHARED="$enable_shared"
  2898. AC_SUBST(ENABLE_SHARED)
  2899. dnl
  2900. dnl For keeping supported features and protocols also in pkg-config file
  2901. dnl since it is more cross-compile friendly than curl-config
  2902. dnl
  2903. if test "x$USE_SSLEAY" = "x1"; then
  2904. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  2905. elif test -n "$SSL_ENABLED"; then
  2906. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  2907. fi
  2908. if test "@KRB4_ENABLED@" = "x1"; then
  2909. SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
  2910. fi
  2911. if test "x$IPV6_ENABLED" = "x1"; then
  2912. SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
  2913. fi
  2914. if test "x$HAVE_LIBZ" = "x1"; then
  2915. SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
  2916. fi
  2917. if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
  2918. SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
  2919. fi
  2920. if test "x$IDN_ENABLED" = "x1"; then
  2921. SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
  2922. fi
  2923. if test "x$USE_WINDOWS_SSPI" = "x1"; then
  2924. SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
  2925. fi
  2926. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  2927. if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
  2928. -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
  2929. -o "x$DARWINSSL_ENABLED" = "x1"; then
  2930. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
  2931. if test "x$NTLM_WB_ENABLED" = "x1"; then
  2932. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
  2933. fi
  2934. fi
  2935. fi
  2936. if test "x$USE_TLS_SRP" = "x1"; then
  2937. SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
  2938. fi
  2939. AC_SUBST(SUPPORT_FEATURES)
  2940. dnl For supported protocols in pkg-config file
  2941. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  2942. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
  2943. if test "x$SSL_ENABLED" = "x1"; then
  2944. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
  2945. fi
  2946. fi
  2947. if test "x$CURL_DISABLE_FTP" != "x1"; then
  2948. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
  2949. if test "x$SSL_ENABLED" = "x1"; then
  2950. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
  2951. fi
  2952. fi
  2953. if test "x$CURL_DISABLE_FILE" != "x1"; then
  2954. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
  2955. fi
  2956. if test "x$CURL_DISABLE_TELNET" != "x1"; then
  2957. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
  2958. fi
  2959. if test "x$CURL_DISABLE_LDAP" != "x1"; then
  2960. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
  2961. if test "x$CURL_DISABLE_LDAPS" != "x1"; then
  2962. if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
  2963. (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
  2964. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
  2965. fi
  2966. fi
  2967. fi
  2968. if test "x$CURL_DISABLE_DICT" != "x1"; then
  2969. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
  2970. fi
  2971. if test "x$CURL_DISABLE_TFTP" != "x1"; then
  2972. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
  2973. fi
  2974. if test "x$CURL_DISABLE_GOPHER" != "x1"; then
  2975. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
  2976. fi
  2977. if test "x$CURL_DISABLE_POP3" != "x1"; then
  2978. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
  2979. if test "x$SSL_ENABLED" = "x1"; then
  2980. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
  2981. fi
  2982. fi
  2983. if test "x$CURL_DISABLE_IMAP" != "x1"; then
  2984. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
  2985. if test "x$SSL_ENABLED" = "x1"; then
  2986. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
  2987. fi
  2988. fi
  2989. if test "x$CURL_DISABLE_SMTP" != "x1"; then
  2990. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
  2991. if test "x$SSL_ENABLED" = "x1"; then
  2992. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
  2993. fi
  2994. fi
  2995. if test "x$USE_LIBSSH2" = "x1"; then
  2996. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  2997. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  2998. fi
  2999. if test "x$CURL_DISABLE_RTSP" != "x1"; then
  3000. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
  3001. fi
  3002. if test "x$USE_LIBRTMP" = "x1"; then
  3003. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
  3004. fi
  3005. dnl replace spaces with newlines
  3006. dnl sort the lines
  3007. dnl replace the newlines back to spaces
  3008. SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
  3009. AC_SUBST(SUPPORT_PROTOCOLS)
  3010. dnl squeeze whitespace out of some variables
  3011. squeeze CFLAGS
  3012. squeeze CPPFLAGS
  3013. squeeze DEFS
  3014. squeeze LDFLAGS
  3015. squeeze LIBS
  3016. squeeze CURL_LIBS
  3017. squeeze LIBCURL_LIBS
  3018. squeeze TEST_SERVER_LIBS
  3019. squeeze CURL_NETWORK_LIBS
  3020. squeeze SUPPORT_FEATURES
  3021. squeeze SUPPORT_PROTOCOLS
  3022. if test "x$want_curldebug_assumed" = "xyes" &&
  3023. test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
  3024. ac_configure_args="$ac_configure_args --enable-curldebug"
  3025. fi
  3026. AC_CONFIG_FILES([Makefile \
  3027. docs/Makefile \
  3028. docs/examples/Makefile \
  3029. docs/libcurl/Makefile \
  3030. include/Makefile \
  3031. include/curl/Makefile \
  3032. src/Makefile \
  3033. lib/Makefile \
  3034. lib/libcurl.vers \
  3035. tests/Makefile \
  3036. tests/data/Makefile \
  3037. tests/server/Makefile \
  3038. tests/libtest/Makefile \
  3039. tests/unit/Makefile \
  3040. packages/Makefile \
  3041. packages/Win32/Makefile \
  3042. packages/Win32/cygwin/Makefile \
  3043. packages/Linux/Makefile \
  3044. packages/Linux/RPM/Makefile \
  3045. packages/Linux/RPM/curl.spec \
  3046. packages/Linux/RPM/curl-ssl.spec \
  3047. packages/Solaris/Makefile \
  3048. packages/EPM/curl.list \
  3049. packages/EPM/Makefile \
  3050. packages/vms/Makefile \
  3051. packages/AIX/Makefile \
  3052. packages/AIX/RPM/Makefile \
  3053. packages/AIX/RPM/curl.spec \
  3054. curl-config \
  3055. libcurl.pc
  3056. ])
  3057. AC_OUTPUT
  3058. CURL_GENERATE_CONFIGUREHELP_PM
  3059. AC_MSG_NOTICE([Configured to build curl/libcurl:
  3060. curl version: ${CURLVERSION}
  3061. Host setup: ${host}
  3062. Install prefix: ${prefix}
  3063. Compiler: ${CC}
  3064. SSL support: ${curl_ssl_msg}
  3065. SSH support: ${curl_ssh_msg}
  3066. zlib support: ${curl_zlib_msg}
  3067. krb4 support: ${curl_krb4_msg}
  3068. GSSAPI support: ${curl_gss_msg}
  3069. SPNEGO support: ${curl_spnego_msg}
  3070. TLS-SRP support: ${curl_tls_srp_msg}
  3071. resolver: ${curl_res_msg}
  3072. ipv6 support: ${curl_ipv6_msg}
  3073. IDN support: ${curl_idn_msg}
  3074. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  3075. Built-in manual: ${curl_manual_msg}
  3076. --libcurl option: ${curl_libcurl_msg}
  3077. Verbose errors: ${curl_verbose_msg}
  3078. SSPI support: ${curl_sspi_msg}
  3079. ca cert bundle: ${ca}
  3080. ca cert path: ${capath}
  3081. LDAP support: ${curl_ldap_msg}
  3082. LDAPS support: ${curl_ldaps_msg}
  3083. RTSP support: ${curl_rtsp_msg}
  3084. RTMP support: ${curl_rtmp_msg}
  3085. metalink support: ${curl_mtlnk_msg}
  3086. Protocols: ${SUPPORT_PROTOCOLS}
  3087. ])
  3088. if test "x$soname_bump" = "xyes"; then
  3089. cat <<EOM
  3090. SONAME bump: yes - WARNING: this library will be built with the SONAME
  3091. number bumped due to (a detected) ABI breakage.
  3092. See lib/README.curl_off_t for details on this.
  3093. EOM
  3094. fi