configure.ac 84 KB

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