configure.ac 74 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712
  1. # configure.ac
  2. #
  3. # Copyright (C) 2006-2015 wolfSSL Inc.
  4. #
  5. # This file is part of wolfSSL. (formerly known as CyaSSL)
  6. #
  7. #
  8. AC_INIT([wolfssl],[3.6.9d],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[http://www.wolfssl.com])
  9. AC_CONFIG_AUX_DIR([build-aux])
  10. # The following sets CFLAGS to empty if unset on command line. We do not want
  11. # the default "-g -O2" that AC_PROG_CC sets automatically.
  12. : ${CFLAGS=""}
  13. AC_CANONICAL_HOST
  14. AC_CANONICAL_BUILD
  15. AM_INIT_AUTOMAKE([1.11 -Wall -Werror -Wno-portability foreign tar-ustar subdir-objects no-define color-tests])
  16. AC_PREREQ([2.63])
  17. AC_ARG_PROGRAM
  18. AC_DEFUN([PROTECT_AC_USE_SYSTEM_EXTENSIONS],
  19. [AX_SAVE_FLAGS
  20. AC_LANG_PUSH([C])
  21. AC_USE_SYSTEM_EXTENSIONS
  22. AC_LANG_POP([C])
  23. AX_RESTORE_FLAGS
  24. ])
  25. #PROTECT_AC_USE_SYSTEM_EXTENSIONS
  26. AC_CONFIG_MACRO_DIR([m4])
  27. AC_CONFIG_HEADERS([config.h:config.in])dnl Keep filename to 8.3 for MS-DOS.
  28. #shared library versioning
  29. WOLFSSL_LIBRARY_VERSION=1:0:0
  30. # | | |
  31. # +------+ | +---+
  32. # | | |
  33. # current:revision:age
  34. # | | |
  35. # | | +- increment if interfaces have been added
  36. # | | set to zero if interfaces have been removed
  37. # | | or changed
  38. # | +- increment if source code has changed
  39. # | set to zero if current is incremented
  40. # +- increment if interfaces have been added, removed or changed
  41. AC_SUBST([WOLFSSL_LIBRARY_VERSION])
  42. # capture user C_EXTRA_FLAGS from ./configure line, CFLAGS may hold -g -O2 even
  43. # if user doesn't override, no way to tell
  44. USER_C_EXTRA_FLAGS="$C_EXTRA_FLAGS"
  45. USER_CFLAGS="$CFLAGS"
  46. LT_PREREQ([2.2])
  47. LT_INIT([disable-static],[win32-dll])
  48. LT_LANG([C++])
  49. LT_LANG([C])
  50. gl_VISIBILITY
  51. AS_IF([ test -n "$CFLAG_VISIBILITY" ], [
  52. AM_CPPFLAGS="$AM_CPPFLAGS $CFLAG_VISIBILITY"
  53. CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY"
  54. ])
  55. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  56. AC_CHECK_FUNCS([gethostbyname])
  57. AC_CHECK_FUNCS([getaddrinfo])
  58. AC_CHECK_FUNCS([gettimeofday])
  59. AC_CHECK_FUNCS([inet_ntoa])
  60. AC_CHECK_FUNCS([memset])
  61. AC_CHECK_FUNCS([socket])
  62. AC_CHECK_HEADERS([arpa/inet.h])
  63. AC_CHECK_HEADERS([fcntl.h])
  64. AC_CHECK_HEADERS([limits.h])
  65. AC_CHECK_HEADERS([netdb.h])
  66. AC_CHECK_HEADERS([netinet/in.h])
  67. AC_CHECK_HEADERS([stddef.h])
  68. AC_CHECK_HEADERS([sys/ioctl.h])
  69. AC_CHECK_HEADERS([sys/socket.h])
  70. AC_CHECK_HEADERS([sys/time.h])
  71. AC_CHECK_HEADERS([errno.h])
  72. AC_CHECK_LIB(network,socket)
  73. AC_CHECK_SIZEOF(long long, 8)
  74. AC_CHECK_SIZEOF(long, 4)
  75. AC_CHECK_TYPES(__uint128_t)
  76. AC_C_BIGENDIAN
  77. # mktime check takes forever on some systems, if time supported it would be
  78. # highly unusual for mktime to be missing
  79. #AC_FUNC_MKTIME
  80. AC_PROG_CC
  81. AC_PROG_CC_C_O
  82. AC_PROG_CXX
  83. AC_PROG_INSTALL
  84. AC_TYPE_SIZE_T
  85. AC_TYPE_UINT8_T
  86. AM_PROG_AS
  87. AM_PROG_CC_C_O
  88. LT_LIB_M
  89. OPTIMIZE_CFLAGS="-Os -fomit-frame-pointer"
  90. OPTIMIZE_FAST_CFLAGS="-O2 -fomit-frame-pointer"
  91. OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET -DTFM_HUGE_SET"
  92. DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_WOLFSSL"
  93. LIB_ADD=
  94. LIB_STATIC_ADD=
  95. thread_ls_on=no
  96. # Thread local storage
  97. AX_TLS([
  98. [AM_CFLAGS="$AM_CFLAGS -DHAVE_THREAD_LS"]
  99. [thread_ls_on=yes]
  100. ] , [:])
  101. # DEBUG
  102. AX_DEBUG
  103. AS_IF([test "$ax_enable_debug" = "yes"],
  104. [AM_CFLAGS="$DEBUG_CFLAGS $AM_CFLAGS"],
  105. [AM_CFLAGS="$AM_CFLAGS -DNDEBUG"])
  106. # SINGLE THREADED
  107. AC_ARG_ENABLE([singlethreaded],
  108. [ --enable-singlethreaded Enable wolfSSL single threaded (default: disabled)],
  109. [ ENABLED_SINGLETHREADED=$enableval ],
  110. [ ENABLED_SINGLETHREADED=no ])
  111. AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xno" ],[
  112. AX_PTHREAD([
  113. AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
  114. AM_CFLAGS="-D_POSIX_THREADS $AM_CFLAGS $PTHREAD_CFLAGS"
  115. LIBS="$LIBS $PTHREAD_LIBS"
  116. ],[
  117. ENABLED_SINGLETHREADED=yes
  118. ])
  119. ])
  120. AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xyes" ],[ AM_CFLAGS="-DSINGLE_THREADED $AM_CFLAGS" ])
  121. # DTLS
  122. AC_ARG_ENABLE([dtls],
  123. [ --enable-dtls Enable wolfSSL DTLS (default: disabled)],
  124. [ ENABLED_DTLS=$enableval ],
  125. [ ENABLED_DTLS=no ]
  126. )
  127. if test "$ENABLED_DTLS" = "yes"
  128. then
  129. AM_CFLAGS="-DWOLFSSL_DTLS $AM_CFLAGS"
  130. fi
  131. # OpenSSH compatibility Build
  132. AC_ARG_ENABLE([openssh],
  133. [AS_HELP_STRING([--enable-openssh],[Enable OpenSSH compatibility build (default: disabled)])],
  134. [ENABLED_OPENSSH=$enableval],
  135. [ENABLED_OPENSSH=no])
  136. # OPENSSL Extra Compatibility
  137. AC_ARG_ENABLE([opensslextra],
  138. [ --enable-opensslextra Enable extra OpenSSL API, size+ (default: disabled)],
  139. [ ENABLED_OPENSSLEXTRA=$enableval ],
  140. [ ENABLED_OPENSSLEXTRA=no ]
  141. )
  142. if test "$ENABLED_OPENSSH" = "yes"
  143. then
  144. ENABLED_OPENSSLEXTRA="yes"
  145. fi
  146. if test "$ENABLED_OPENSSLEXTRA" = "yes"
  147. then
  148. AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
  149. fi
  150. if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_SMALL" = "yes"
  151. then
  152. AC_MSG_ERROR([cannot enable small and opensslextra, only one or the other.])
  153. fi
  154. # High Strength Build
  155. AC_ARG_ENABLE([maxstrength],
  156. [AS_HELP_STRING([--enable-maxstrength],[Enable Max Strengh build, allows TLSv1.2-AEAD-PFS ciphers only (default: disabled)])],
  157. [ENABLED_MAXSTRENGTH=$enableval],
  158. [ENABLED_MAXSTRENGTH=no])
  159. # IPv6 Test Apps
  160. AC_ARG_ENABLE([ipv6],
  161. [ --enable-ipv6 Enable testing of IPV6 (default: disabled)],
  162. [ ENABLED_IPV6=$enableval ],
  163. [ ENABLED_IPV6=no ]
  164. )
  165. if test "$ENABLED_IPV6" = "yes"
  166. then
  167. AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6"
  168. fi
  169. AM_CONDITIONAL([BUILD_IPV6], [test "x$ENABLED_IPV6" = "xyes"])
  170. # Fortress build
  171. AC_ARG_ENABLE([fortress],
  172. [ --enable-fortress Enable SSL fortress build (default: disabled)],
  173. [ ENABLED_FORTRESS=$enableval ],
  174. [ ENABLED_FORTRESS=no ]
  175. )
  176. if test "$ENABLED_OPENSSH" = "yes"
  177. then
  178. ENABLED_FORTRESS="yes"
  179. fi
  180. if test "$ENABLED_FORTRESS" = "yes"
  181. then
  182. AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DWOLFSSL_ALWAYS_VERIFY_CB -DOPENSSL_EXTRA -DWOLFSSL_DES_ECB -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT -DWOLFSSL_DER_LOAD -DWOLFSSL_SHA512 -DWOLFSSL_SHA384 -DWOLFSSL_KEY_GEN"
  183. fi
  184. # ssl bump build
  185. AC_ARG_ENABLE([bump],
  186. [ --enable-bump Enable SSL Bump build (default: disabled)],
  187. [ ENABLED_BUMP=$enableval ],
  188. [ ENABLED_BUMP=no ]
  189. )
  190. if test "$ENABLED_BUMP" = "yes"
  191. then
  192. AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DWOLFSSL_CERT_GEN -DWOLFSSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DWOLFSSL_DER_LOAD -DWOLFSSL_ALT_NAMES -DWOLFSSL_TEST_CERT"
  193. fi
  194. ENABLED_SLOWMATH="yes"
  195. # lean psk build
  196. AC_ARG_ENABLE([leanpsk],
  197. [ --enable-leanpsk Enable Lean PSK build (default: disabled)],
  198. [ ENABLED_LEANPSK=$enableval ],
  199. [ ENABLED_LEANPSK=no ]
  200. )
  201. if test "$ENABLED_LEANPSK" = "yes"
  202. then
  203. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANPSK -DHAVE_NULL_CIPHER -DSINGLE_THREADED -DNO_AES -DNO_FILESYSTEM -DNO_RABBIT -DNO_RSA -DNO_DSA -DNO_DH -DNO_CERTS -DNO_PWDBASED -DNO_DES3 -DNO_MD4 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_WRITEV -DNO_SESSION_CACHE -DNO_DEV_RANDOM -DWOLFSSL_USER_IO -DNO_SHA -DUSE_SLOW_SHA"
  204. ENABLED_SLOWMATH="no"
  205. ENABLED_SINGLETHREADED="yes"
  206. fi
  207. AM_CONDITIONAL([BUILD_LEANPSK], [test "x$ENABLED_LEANPSK" = "xyes"])
  208. # big cache
  209. AC_ARG_ENABLE([bigcache],
  210. [ --enable-bigcache Enable big session cache (default: disabled)],
  211. [ ENABLED_BIGCACHE=$enableval ],
  212. [ ENABLED_BIGCACHE=no ]
  213. )
  214. if test "$ENABLED_BIGCACHE" = "yes"
  215. then
  216. AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
  217. fi
  218. # HUGE cache
  219. AC_ARG_ENABLE([hugecache],
  220. [ --enable-hugecache Enable huge session cache (default: disabled)],
  221. [ ENABLED_HUGECACHE=$enableval ],
  222. [ ENABLED_HUGECACHE=no ]
  223. )
  224. if test "$ENABLED_HUGECACHE" = "yes"
  225. then
  226. AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
  227. fi
  228. # SMALL cache
  229. AC_ARG_ENABLE([smallcache],
  230. [ --enable-smallcache Enable small session cache (default: disabled)],
  231. [ ENABLED_SMALLCACHE=$enableval ],
  232. [ ENABLED_SMALLCACHE=no ]
  233. )
  234. if test "$ENABLED_SMALLCACHE" = "yes"
  235. then
  236. AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
  237. fi
  238. # Persistent session cache
  239. AC_ARG_ENABLE([savesession],
  240. [ --enable-savesession Enable persistent session cache (default: disabled)],
  241. [ ENABLED_SAVESESSION=$enableval ],
  242. [ ENABLED_SAVESESSION=no ]
  243. )
  244. if test "$ENABLED_SAVESESSION" = "yes"
  245. then
  246. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  247. fi
  248. # Persistent cert cache
  249. AC_ARG_ENABLE([savecert],
  250. [ --enable-savecert Enable persistent cert cache (default: disabled)],
  251. [ ENABLED_SAVECERT=$enableval ],
  252. [ ENABLED_SAVECERT=no ]
  253. )
  254. if test "$ENABLED_SAVECERT" = "yes"
  255. then
  256. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  257. fi
  258. # Atomic User Record Layer
  259. AC_ARG_ENABLE([atomicuser],
  260. [ --enable-atomicuser Enable Atomic User Record Layer (default: disabled)],
  261. [ ENABLED_ATOMICUSER=$enableval ],
  262. [ ENABLED_ATOMICUSER=no ]
  263. )
  264. if test "$ENABLED_ATOMICUSER" = "yes"
  265. then
  266. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  267. fi
  268. # Public Key Callbacks
  269. AC_ARG_ENABLE([pkcallbacks],
  270. [ --enable-pkcallbacks Enable Public Key Callbacks (default: disabled)],
  271. [ ENABLED_PKCALLBACKS=$enableval ],
  272. [ ENABLED_PKCALLBACKS=no ]
  273. )
  274. if test "$ENABLED_PKCALLBACKS" = "yes"
  275. then
  276. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  277. fi
  278. # SNIFFER
  279. AC_ARG_ENABLE([sniffer],
  280. [AS_HELP_STRING([--enable-sniffer],[Enable wolfSSL sniffer support (default: disabled)])],
  281. [ ENABLED_SNIFFER=$enableval ],
  282. [ ENABLED_SNIFFER=no ]
  283. )
  284. # sniffer does't work in maxstrength mode
  285. if test "$ENABLED_SNIFFER" = "yes" && test "$ENABLED_MAXSTRENGTH" = "yes"
  286. then
  287. AC_MSG_ERROR([cannot enable maxstrength in sniffer mode.])
  288. fi
  289. ENABLED_SNIFFTEST=no
  290. AS_IF([ test "x$ENABLED_SNIFFER" = "xyes" ],
  291. [
  292. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SNIFFER -DOPENSSL_EXTRA"
  293. AC_CHECK_HEADERS([pcap/pcap.h],
  294. [ ENABLED_SNIFFTEST=yes ],
  295. [ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]
  296. )
  297. ])
  298. AM_CONDITIONAL([BUILD_SNIFFER], [ test "x$ENABLED_SNIFFER" = "xyes" ])
  299. AM_CONDITIONAL([BUILD_SNIFFTEST], [ test "x$ENABLED_SNIFFTEST" = "xyes" ])
  300. # AES-GCM
  301. AC_ARG_ENABLE([aesgcm],
  302. [AS_HELP_STRING([--enable-aesgcm],[Enable wolfSSL AES-GCM support (default: enabled)])],
  303. [ ENABLED_AESGCM=$enableval ],
  304. [ ENABLED_AESGCM=yes ]
  305. )
  306. # lean psk does't need gcm
  307. if test "$ENABLED_LEANPSK" = "yes"
  308. then
  309. ENABLED_AESGCM=no
  310. fi
  311. if test "$ENABLED_AESGCM" = "word32"
  312. then
  313. AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
  314. ENABLED_AESGCM=yes
  315. fi
  316. if test "$ENABLED_AESGCM" = "small"
  317. then
  318. AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
  319. ENABLED_AESGCM=yes
  320. fi
  321. if test "$ENABLED_AESGCM" = "table"
  322. then
  323. AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
  324. ENABLED_AESGCM=yes
  325. fi
  326. if test "$ENABLED_AESGCM" = "yes"
  327. then
  328. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"
  329. fi
  330. AM_CONDITIONAL([BUILD_AESGCM], [test "x$ENABLED_AESGCM" = "xyes"])
  331. # AES-CCM
  332. AC_ARG_ENABLE([aesccm],
  333. [ --enable-aesccm Enable wolfSSL AES-CCM support (default: disabled)],
  334. [ ENABLED_AESCCM=$enableval ],
  335. [ ENABLED_AESCCM=no ]
  336. )
  337. if test "$ENABLED_AESCCM" = "yes"
  338. then
  339. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"
  340. fi
  341. AM_CONDITIONAL([BUILD_AESCCM], [test "x$ENABLED_AESCCM" = "xyes"])
  342. # AES-NI
  343. AC_ARG_ENABLE([aesni],
  344. [AS_HELP_STRING([--enable-aesni],[Enable wolfSSL AES-NI support (default: disabled)])],
  345. [ ENABLED_AESNI=$enableval ],
  346. [ ENABLED_AESNI=no ]
  347. )
  348. # INTEL ASM
  349. AC_ARG_ENABLE([intelasm],
  350. [AS_HELP_STRING([--enable-intelasm],[Enable All Intel ASM speedups (default: disabled)])],
  351. [ ENABLED_INTELASM=$enableval ],
  352. [ ENABLED_INTELASM=no ]
  353. )
  354. if test "$ENABLED_AESNI" = "yes" || test "$ENABLED_INTELASM" = "yes"
  355. then
  356. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESNI"
  357. if test "$GCC" = "yes"
  358. then
  359. # GCC needs these flags, icc doesn't
  360. # opt levels greater than 2 may cause problems on systems w/o aesni
  361. if test "$CC" != "icc"
  362. then
  363. AM_CFLAGS="$AM_CFLAGS -maes -msse4"
  364. fi
  365. fi
  366. fi
  367. if test "$ENABLED_INTELASM" = "yes"
  368. then
  369. AM_CFLAGS="$AM_CFLAGS -DHAVE_INTEL_RDGEN -DUSE_INTEL_SPEEDUP"
  370. ENABLED_AESNI=yes
  371. fi
  372. AM_CONDITIONAL([BUILD_AESNI], [test "x$ENABLED_AESNI" = "xyes"])
  373. # Camellia
  374. AC_ARG_ENABLE([camellia],
  375. [ --enable-camellia Enable wolfSSL Camellia support (default: disabled)],
  376. [ ENABLED_CAMELLIA=$enableval ],
  377. [ ENABLED_CAMELLIA=no ]
  378. )
  379. if test "$ENABLED_CAMELLIA" = "yes"
  380. then
  381. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAMELLIA"
  382. fi
  383. AM_CONDITIONAL([BUILD_CAMELLIA], [test "x$ENABLED_CAMELLIA" = "xyes"])
  384. # MD2
  385. AC_ARG_ENABLE([md2],
  386. [ --enable-md2 Enable wolfSSL MD2 support (default: disabled)],
  387. [ ENABLED_MD2=$enableval ],
  388. [ ENABLED_MD2=no ]
  389. )
  390. if test "$ENABLED_BUMP" = "yes"
  391. then
  392. ENABLED_MD2="yes"
  393. fi
  394. if test "$ENABLED_MD2" = "yes"
  395. then
  396. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MD2"
  397. fi
  398. AM_CONDITIONAL([BUILD_MD2], [test "x$ENABLED_MD2" = "xyes"])
  399. # NULL CIPHER
  400. AC_ARG_ENABLE([nullcipher],
  401. [ --enable-nullcipher Enable wolfSSL NULL cipher support (default: disabled)],
  402. [ ENABLED_NULL_CIPHER=$enableval ],
  403. [ ENABLED_NULL_CIPHER=no ]
  404. )
  405. if test "$ENABLED_OPENSSH" = "yes"
  406. then
  407. ENABLED_NULL_CIPHER="yes"
  408. fi
  409. if test "$ENABLED_NULL_CIPHER" = "yes"
  410. then
  411. AM_CFLAGS="$AM_CFLAGS -DHAVE_NULL_CIPHER"
  412. fi
  413. # RIPEMD
  414. AC_ARG_ENABLE([ripemd],
  415. [ --enable-ripemd Enable wolfSSL RIPEMD-160 support (default: disabled)],
  416. [ ENABLED_RIPEMD=$enableval ],
  417. [ ENABLED_RIPEMD=no ]
  418. )
  419. if test "$ENABLED_OPENSSH" = "yes"
  420. then
  421. ENABLED_RIPEMD="yes"
  422. fi
  423. if test "$ENABLED_RIPEMD" = "yes"
  424. then
  425. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RIPEMD"
  426. fi
  427. AM_CONDITIONAL([BUILD_RIPEMD], [test "x$ENABLED_RIPEMD" = "xyes"])
  428. # BLAKE2
  429. AC_ARG_ENABLE([blake2],
  430. [ --enable-blake2 Enable wolfSSL BLAKE2 support (default: disabled)],
  431. [ ENABLED_BLAKE2=$enableval ],
  432. [ ENABLED_BLAKE2=no ]
  433. )
  434. if test "$ENABLED_BLAKE2" = "yes"
  435. then
  436. AM_CFLAGS="$AM_CFLAGS -DHAVE_BLAKE2"
  437. fi
  438. AM_CONDITIONAL([BUILD_BLAKE2], [test "x$ENABLED_BLAKE2" = "xyes"])
  439. # set sha512 default
  440. SHA512_DEFAULT=no
  441. if test "$host_cpu" = "x86_64"
  442. then
  443. SHA512_DEFAULT=yes
  444. fi
  445. # SHA512
  446. AC_ARG_ENABLE([sha512],
  447. [AS_HELP_STRING([--enable-sha512],[Enable wolfSSL SHA-512 support (default: enabled on x86_64)])],
  448. [ ENABLED_SHA512=$enableval ],
  449. [ ENABLED_SHA512=$SHA512_DEFAULT ]
  450. )
  451. # lean psk does't need sha512
  452. if test "$ENABLED_LEANPSK" = "yes"
  453. then
  454. ENABLED_SHA512=no
  455. fi
  456. if test "$ENABLED_OPENSSH" = "yes"
  457. then
  458. ENABLED_SHA512="yes"
  459. fi
  460. if test "$ENABLED_SHA512" = "yes"
  461. then
  462. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"
  463. fi
  464. if test "$ENABLED_FORTRESS" = "yes"
  465. then
  466. ENABLED_SHA512="yes"
  467. fi
  468. AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
  469. # SESSION CERTS
  470. AC_ARG_ENABLE([sessioncerts],
  471. [ --enable-sessioncerts Enable session cert storing (default: disabled)],
  472. [ ENABLED_SESSIONCERTS=$enableval ],
  473. [ ENABLED_SESSIONCERTS=no ]
  474. )
  475. if test "$ENABLED_SESSIONCERTS" = "yes"
  476. then
  477. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  478. fi
  479. # KEY GENERATION
  480. AC_ARG_ENABLE([keygen],
  481. [ --enable-keygen Enable key generation (default: disabled)],
  482. [ ENABLED_KEYGEN=$enableval ],
  483. [ ENABLED_KEYGEN=no ]
  484. )
  485. if test "$ENABLED_KEYGEN" = "yes"
  486. then
  487. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  488. fi
  489. # CERT GENERATION
  490. AC_ARG_ENABLE([certgen],
  491. [ --enable-certgen Enable cert generation (default: disabled)],
  492. [ ENABLED_CERTGEN=$enableval ],
  493. [ ENABLED_CERTGEN=no ]
  494. )
  495. if test "$ENABLED_CERTGEN" = "yes"
  496. then
  497. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  498. fi
  499. # CERT REQUEST GENERATION
  500. AC_ARG_ENABLE([certreq],
  501. [ --enable-certreq Enable cert request generation (default: disabled)],
  502. [ ENABLED_CERTREQ=$enableval ],
  503. [ ENABLED_CERTREQ=no ]
  504. )
  505. if test "$ENABLED_CERTREQ" = "yes"
  506. then
  507. if test "$ENABLED_CERTGEN" = "no"
  508. then
  509. AC_MSG_ERROR([cannot enable certreq without enabling certgen.])
  510. fi
  511. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  512. fi
  513. # CERT REQUEST EXTENSION
  514. AC_ARG_ENABLE([certext],
  515. [ --enable-certext Enable cert request extensions (default: disabled)],
  516. [ ENABLED_CERTEXT=$enableval ],
  517. [ ENABLED_CERTEXT=no ]
  518. )
  519. if test "$ENABLED_CERTEXT" = "yes"
  520. then
  521. if test "$ENABLED_CERTGEN" = "no"
  522. then
  523. AC_MSG_ERROR([cannot enable certext without enabling certgen.])
  524. fi
  525. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  526. fi
  527. # SEP
  528. AC_ARG_ENABLE([sep],
  529. [ --enable-sep Enable sep extensions (default: disabled)],
  530. [ ENABLED_SEP=$enableval ],
  531. [ ENABLED_SEP=no ]
  532. )
  533. if test "$ENABLED_SEP" = "yes"
  534. then
  535. AM_CFLAGS="-DWOLFSSL_SEP -DKEEP_PEER_CERT $AM_CFLAGS"
  536. fi
  537. # HKDF
  538. AC_ARG_ENABLE([hkdf],
  539. [ --enable-hkdf Enable HKDF (HMAC-KDF) support (default: disabled)],
  540. [ ENABLED_HKDF=$enableval ],
  541. [ ENABLED_HKDF=no ]
  542. )
  543. if test "$ENABLED_HKDF" = "yes"
  544. then
  545. AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"
  546. fi
  547. # DSA
  548. AC_ARG_ENABLE([dsa],
  549. [ --enable-dsa Enable DSA (default: disabled)],
  550. [ ENABLED_DSA=$enableval ],
  551. [ ENABLED_DSA=no ]
  552. )
  553. if test "$ENABLED_OPENSSH" = "yes"
  554. then
  555. ENABLED_DSA="yes"
  556. fi
  557. if test "$ENABLED_DSA" = "no"
  558. then
  559. AM_CFLAGS="$AM_CFLAGS -DNO_DSA"
  560. fi
  561. AM_CONDITIONAL([BUILD_DSA], [test "x$ENABLED_DSA" = "xyes"])
  562. # set ecc default
  563. ECC_DEFAULT=no
  564. if test "$host_cpu" = "x86_64"
  565. then
  566. ECC_DEFAULT=yes
  567. fi
  568. # ECC
  569. AC_ARG_ENABLE([ecc],
  570. [AS_HELP_STRING([--enable-ecc],[Enable ECC (default: enabled on x86_64)])],
  571. [ ENABLED_ECC=$enableval ],
  572. [ ENABLED_ECC=$ECC_DEFAULT ]
  573. )
  574. # lean psk does't need ecc
  575. if test "$ENABLED_LEANPSK" = "yes"
  576. then
  577. ENABLED_ECC=no
  578. fi
  579. if test "$ENABLED_OPENSSH" = "yes"
  580. then
  581. ENABLED_ECC="yes"
  582. fi
  583. if test "$ENABLED_ECC" = "yes"
  584. then
  585. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR"
  586. fi
  587. AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
  588. if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes"
  589. then
  590. AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.])
  591. fi
  592. # for using memory optimization setting on both curve25519 and ed25519
  593. ENABLED_CURVED25519_SMALL=no
  594. # CURVE25519
  595. AC_ARG_ENABLE([curve25519],
  596. [AS_HELP_STRING([--enable-curve25519],[Enable Curve25519 (default: disabled)])],
  597. [ ENABLED_CURVE25519=$enableval ],
  598. [ ENABLED_CURVE25519=no ]
  599. )
  600. if test "$ENABLED_OPENSSH" = "yes"
  601. then
  602. ENABLED_CURVE25519="yes"
  603. fi
  604. if test "$ENABLED_CURVE25519" = "small"
  605. then
  606. AM_CFLAGS="$AM_CFLAGS -DCURVED25519_SMALL"
  607. ENABLED_CURVED25519_SMALL=yes
  608. ENABLED_CURVE25519=yes
  609. fi
  610. if test "$ENABLED_CURVE25519" = "yes"
  611. then
  612. AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519"
  613. ENABLED_FEMATH=yes
  614. fi
  615. AM_CONDITIONAL([BUILD_CURVE25519], [test "x$ENABLED_CURVE25519" = "xyes"])
  616. # ED25519
  617. AC_ARG_ENABLE([ed25519],
  618. [AS_HELP_STRING([--enable-ed25519],[Enable ED25519 (default: disabled)])],
  619. [ ENABLED_ED25519=$enableval ],
  620. [ ENABLED_ED25519=no ]
  621. )
  622. if test "$ENABLED_OPENSSH" = "yes"
  623. then
  624. ENABLED_ED25519="yes"
  625. fi
  626. if test "$ENABLED_ED25519" = "small"
  627. then
  628. AM_CFLAGS="$AM_CFLAGS -DCURVED25519_SMALL"
  629. ENABLED_CURVED25519_SMALL=yes
  630. ENABLED_ED25519=yes
  631. fi
  632. if test "$ENABLED_ED25519" = "yes"
  633. then
  634. if test "$ENABLED_SHA512" = "no"
  635. then
  636. AC_MSG_ERROR([cannot enable ed25519 without enabling sha512.])
  637. fi
  638. ENABLED_FEMATH=yes
  639. ENABLED_GEMATH=yes
  640. AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519"
  641. fi
  642. AM_CONDITIONAL([BUILD_ED25519], [test "x$ENABLED_ED25519" = "xyes"])
  643. AM_CONDITIONAL([BUILD_CURVED25519_SMALL], [test "x$ENABLED_CURVED25519_SMALL" = "xyes"])
  644. AM_CONDITIONAL([BUILD_FEMATH], [test "x$ENABLED_FEMATH" = "xyes"])
  645. AM_CONDITIONAL([BUILD_GEMATH], [test "x$ENABLED_GEMATH" = "xyes"])
  646. # FP ECC, Fixed Point cache ECC
  647. AC_ARG_ENABLE([fpecc],
  648. [ --enable-fpecc Enable Fixed Point cache ECC (default: disabled)],
  649. [ ENABLED_FPECC=$enableval ],
  650. [ ENABLED_FPECC=no ]
  651. )
  652. if test "$ENABLED_FPECC" = "yes"
  653. then
  654. if test "$ENABLED_ECC" = "no"
  655. then
  656. AC_MSG_ERROR([cannot enable fpecc without enabling ecc.])
  657. fi
  658. AM_CFLAGS="$AM_CFLAGS -DFP_ECC"
  659. fi
  660. # ECC encrypt
  661. AC_ARG_ENABLE([eccencrypt],
  662. [ --enable-eccencrypt Enable ECC encrypt (default: disabled)],
  663. [ ENABLED_ECC_ENCRYPT=$enableval ],
  664. [ ENABLED_ECC_ENCRYPT=no ]
  665. )
  666. if test "$ENABLED_ECC_ENCRYPT" = "yes"
  667. then
  668. if test "$ENABLED_ECC" = "no"
  669. then
  670. AC_MSG_ERROR([cannot enable eccencrypt without enabling ecc.])
  671. fi
  672. if test "$ENABLED_HKDF" = "no"
  673. then
  674. AC_MSG_ERROR([cannot enable eccencrypt without enabling hkdf.])
  675. fi
  676. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_ENCRYPT"
  677. fi
  678. # PSK
  679. AC_ARG_ENABLE([psk],
  680. [ --enable-psk Enable PSK (default: disabled)],
  681. [ ENABLED_PSK=$enableval ],
  682. [ ENABLED_PSK=no ]
  683. )
  684. # ERROR STRINGS
  685. AC_ARG_ENABLE([errorstrings],
  686. [ --enable-errorstrings Enable error strings table (default: enabled)],
  687. [ ENABLED_ERROR_STRINGS=$enableval ],
  688. [ ENABLED_ERROR_STRINGS=yes ]
  689. )
  690. if test "$ENABLED_ERROR_STRINGS" = "no"
  691. then
  692. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  693. else
  694. # turn off error strings if leanpsk on
  695. if test "$ENABLED_LEANPSK" = "yes"
  696. then
  697. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  698. ENABLED_ERROR_STRINGS=no
  699. fi
  700. fi
  701. # OLD TLS
  702. AC_ARG_ENABLE([oldtls],
  703. [ --enable-oldtls Enable old TLS versions < 1.2 (default: enabled)],
  704. [ ENABLED_OLD_TLS=$enableval ],
  705. [ ENABLED_OLD_TLS=yes ]
  706. )
  707. if test "$ENABLED_OLD_TLS" = "no"
  708. then
  709. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  710. else
  711. # turn off old if leanpsk on
  712. if test "$ENABLED_LEANPSK" = "yes"
  713. then
  714. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  715. ENABLED_OLD_TLS=no
  716. fi
  717. fi
  718. # SSLv3
  719. AC_ARG_ENABLE([sslv3],
  720. [AS_HELP_STRING([--enable-sslv3],[Enable SSL version 3.0 (default: disabled)])],
  721. [ ENABLED_SSLV3=$enableval ],
  722. [ ENABLED_SSLV3=no]
  723. )
  724. if test "$ENABLED_SSLV3" = "yes"
  725. then
  726. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_SSLV3"
  727. fi
  728. # STACK SIZE info for examples
  729. AC_ARG_ENABLE([stacksize],
  730. [ --enable-stacksize Enable stack size info on examples (default: disabled)],
  731. [ ENABLED_STACKSIZE=$enableval ],
  732. [ ENABLED_STACKSIZE=no ]
  733. )
  734. if test "$ENABLED_STACKSIZE" = "yes"
  735. then
  736. AC_CHECK_FUNC([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
  737. AC_CHECK_FUNC([pthread_attr_setstack], [], AC_CHECK_LIB([pthread],[pthread_attr_setstack]))
  738. AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE -DWOLFSSL_LOW_MEMORY"
  739. fi
  740. # MEMORY
  741. AC_ARG_ENABLE([memory],
  742. [ --enable-memory Enable memory callbacks (default: enabled)],
  743. [ ENABLED_MEMORY=$enableval ],
  744. [ ENABLED_MEMORY=yes ]
  745. )
  746. if test "$ENABLED_MEMORY" = "no"
  747. then
  748. AM_CFLAGS="$AM_CFLAGS -DNO_WOLFSSL_MEMORY"
  749. else
  750. # turn off memory cb if leanpsk on
  751. if test "$ENABLED_LEANPSK" = "yes"
  752. then
  753. # but don't turn on NO_WOLFSSL_MEMORY because using own
  754. ENABLED_MEMORY=no
  755. fi
  756. fi
  757. AM_CONDITIONAL([BUILD_MEMORY], [test "x$ENABLED_MEMORY" = "xyes"])
  758. # RSA
  759. AC_ARG_ENABLE([rsa],
  760. [ --enable-rsa Enable RSA (default: enabled)],
  761. [ ENABLED_RSA=$enableval ],
  762. [ ENABLED_RSA=yes ]
  763. )
  764. if test "$ENABLED_RSA" = "no"
  765. then
  766. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  767. else
  768. # turn off RSA if leanpsk on
  769. if test "$ENABLED_LEANPSK" = "yes"
  770. then
  771. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  772. ENABLED_RSA=no
  773. fi
  774. fi
  775. AM_CONDITIONAL([BUILD_RSA], [test "x$ENABLED_RSA" = "xyes"])
  776. # DH
  777. AC_ARG_ENABLE([dh],
  778. [AS_HELP_STRING([--enable-dh],[Enable DH (default: enabled)])],
  779. [ ENABLED_DH=$enableval ],
  780. [ ENABLED_DH=yes ]
  781. )
  782. if test "$ENABLED_OPENSSH" = "yes"
  783. then
  784. ENABLED_DH="yes"
  785. fi
  786. if test "$ENABLED_DH" = "no"
  787. then
  788. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  789. else
  790. # turn off DH if leanpsk on
  791. if test "$ENABLED_LEANPSK" = "yes"
  792. then
  793. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  794. ENABLED_DH=no
  795. fi
  796. fi
  797. AM_CONDITIONAL([BUILD_DH], [test "x$ENABLED_DH" = "xyes"])
  798. # Anonymous
  799. AC_ARG_ENABLE([anon],
  800. [AS_HELP_STRING([--enable-anon],[Enable Anonymous (default: disabled)])],
  801. [ ENABLED_ANON=$enableval ],
  802. [ ENABLED_ANON=no ]
  803. )
  804. if test "x$ENABLED_ANON" = "xyes"
  805. then
  806. if test "x$ENABLED_DH" != "xyes"
  807. then
  808. AC_MSG_ERROR([Anonymous suite requires DH.])
  809. fi
  810. AM_CFLAGS="$AM_CFLAGS -DHAVE_ANON"
  811. fi
  812. # ASN
  813. # turn off asn, which means no certs, no rsa, no dsa, no ecc,
  814. # and no big int (unless dh is on)
  815. AC_ARG_ENABLE([asn],
  816. [ --enable-asn Enable ASN (default: enabled)],
  817. [ ENABLED_ASN=$enableval ],
  818. [ ENABLED_ASN=yes ]
  819. )
  820. if test "$ENABLED_ASN" = "no"
  821. then
  822. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_CERTS"
  823. if test "$ENABLED_DH" = "no"
  824. then
  825. # DH needs bigint
  826. AM_CFLAGS="$AM_CFLAGS -DNO_BIG_INT"
  827. fi
  828. else
  829. # turn off ASN if leanpsk on
  830. if test "$ENABLED_LEANPSK" = "yes"
  831. then
  832. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_CERTS -DNO_BIG_INT"
  833. ENABLED_ASN=no
  834. fi
  835. fi
  836. if test "$ENABLED_RSA" = "yes" && test "$ENABLED_ASN" = "no"
  837. then
  838. AC_MSG_ERROR([please disable rsa if disabling asn.])
  839. fi
  840. if test "$ENABLED_DSA" = "yes" && test "$ENABLED_ASN" = "no"
  841. then
  842. AC_MSG_ERROR([please disable dsa if disabling asn.])
  843. fi
  844. if test "$ENABLED_ECC" = "yes" && test "$ENABLED_ASN" = "no"
  845. then
  846. AC_MSG_ERROR([please disable ecc if disabling asn.])
  847. fi
  848. if test "$ENABLED_PSK" = "no" && test "$ENABLED_ASN" = "no"
  849. then
  850. AC_MSG_ERROR([please enable psk if disabling asn.])
  851. fi
  852. # DH needs bigint
  853. if test "$ENABLED_ASN" = "no" && test "$ENABLED_DH" = "no"
  854. then
  855. ENABLED_FASTMATH=no
  856. ENABLED_SLOWMATH=no
  857. fi
  858. AM_CONDITIONAL([BUILD_ASN], [test "x$ENABLED_ASN" = "xyes"])
  859. # AES
  860. AC_ARG_ENABLE([aes],
  861. [ --enable-aes Enable AES (default: enabled)],
  862. [ ENABLED_AES=$enableval ],
  863. [ ENABLED_AES=yes ]
  864. )
  865. if test "$ENABLED_AES" = "no"
  866. then
  867. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  868. if test "$ENABLED_FORTRESS" = "yes"
  869. then
  870. AC_MSG_ERROR([fortress requires aes])
  871. fi
  872. if test "$ENABLED_ECC_ENCRYPT" = "yes"
  873. then
  874. AC_MSG_ERROR([cannot enable eccencrypt and hkdf without aes.])
  875. fi
  876. if test "$ENABLED_AESGCM" = "yes"
  877. then
  878. AC_MSG_ERROR([AESGCM requires AES.])
  879. fi
  880. if test "$ENABLED_AESCCM" = "yes"
  881. then
  882. AC_MSG_ERROR([AESCCM requires AES.])
  883. fi
  884. else
  885. # turn off AES if leanpsk on
  886. if test "$ENABLED_LEANPSK" = "yes"
  887. then
  888. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  889. ENABLED_AES=no
  890. fi
  891. fi
  892. AM_CONDITIONAL([BUILD_AES], [test "x$ENABLED_AES" = "xyes"])
  893. # CODING
  894. AC_ARG_ENABLE([coding],
  895. [ --enable-coding Enable Coding base 16/64 (default: enabled)],
  896. [ ENABLED_CODING=$enableval ],
  897. [ ENABLED_CODING=yes ]
  898. )
  899. if test "$ENABLED_CODING" = "no"
  900. then
  901. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  902. else
  903. # turn off CODING if leanpsk on
  904. if test "$ENABLED_LEANPSK" = "yes"
  905. then
  906. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  907. ENABLED_CODING=no
  908. fi
  909. fi
  910. AM_CONDITIONAL([BUILD_CODING], [test "x$ENABLED_CODING" = "xyes"])
  911. # DES3
  912. AC_ARG_ENABLE([des3],
  913. [ --enable-des3 Enable DES3 (default: enabled)],
  914. [ ENABLED_DES3=$enableval ],
  915. [ ENABLED_DES3=yes ]
  916. )
  917. if test "$ENABLED_DES3" = "no"
  918. then
  919. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  920. else
  921. # turn off DES3 if leanpsk on
  922. if test "$ENABLED_LEANPSK" = "yes"
  923. then
  924. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  925. ENABLED_DES3=no
  926. fi
  927. fi
  928. AM_CONDITIONAL([BUILD_DES3], [test "x$ENABLED_DES3" = "xyes"])
  929. # IDEA
  930. AC_ARG_ENABLE([idea],
  931. [AS_HELP_STRING([--enable-idea],[Enable IDEA Cipher (default: disabled)])],
  932. [ ENABLED_IDEA=$enableval ],
  933. [ ENABLED_IDEA=no ]
  934. )
  935. if test "x$ENABLED_IDEA" = "xyes"
  936. then
  937. AM_CFLAGS="$AM_CFLAGS -DHAVE_IDEA"
  938. fi
  939. AM_CONDITIONAL([BUILD_IDEA], [test "x$ENABLED_IDEA" = "xyes"])
  940. # ARC4
  941. AC_ARG_ENABLE([arc4],
  942. [ --enable-arc4 Enable ARC4 (default: disabled)],
  943. [ ENABLED_ARC4=$enableval ],
  944. [ ENABLED_ARC4=no ]
  945. )
  946. if test "$ENABLED_OPENSSH" = "yes"
  947. then
  948. ENABLED_ARC4="yes"
  949. fi
  950. if test "$ENABLED_ARC4" = "no"
  951. then
  952. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  953. else
  954. # turn off ARC4 if leanpsk on
  955. if test "$ENABLED_LEANPSK" = "yes"
  956. then
  957. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  958. ENABLED_ARC4=no
  959. fi
  960. fi
  961. AM_CONDITIONAL([BUILD_RC4], [test "x$ENABLED_ARC4" = "xyes"])
  962. # MD5
  963. AC_ARG_ENABLE([md5],
  964. [ --enable-md5 Enable MD5 (default: enabled)],
  965. [ ENABLED_MD5=$enableval ],
  966. [ ENABLED_MD5=yes ]
  967. )
  968. if test "$ENABLED_MD5" = "no"
  969. then
  970. AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS"
  971. else
  972. # turn off MD5 if leanpsk on
  973. if test "$ENABLED_LEANPSK" = "yes"
  974. then
  975. AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS"
  976. ENABLED_MD5=no
  977. fi
  978. fi
  979. AM_CONDITIONAL([BUILD_MD5], [test "x$ENABLED_MD5" = "xyes"])
  980. # SHA
  981. AC_ARG_ENABLE([sha],
  982. [ --enable-sha Enable SHA (default: enabled)],
  983. [ ENABLED_SHA=$enableval ],
  984. [ ENABLED_SHA=yes ]
  985. )
  986. if test "$ENABLED_SHA" = "no"
  987. then
  988. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  989. else
  990. # turn off SHA if leanpsk on
  991. if test "$ENABLED_LEANPSK" = "yes"
  992. then
  993. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  994. ENABLED_SHA=no
  995. fi
  996. fi
  997. AM_CONDITIONAL([BUILD_SHA], [test "x$ENABLED_SHA" = "xyes"])
  998. # Web Server Build
  999. AC_ARG_ENABLE([webserver],
  1000. [ --enable-webserver Enable Web Server (default: disabled)],
  1001. [ ENABLED_WEBSERVER=$enableval ],
  1002. [ ENABLED_WEBSERVER=no ]
  1003. )
  1004. if test "$ENABLED_WEBSERVER" = "yes"
  1005. then
  1006. AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
  1007. fi
  1008. # HC128
  1009. AC_ARG_ENABLE([hc128],
  1010. [ --enable-hc128 Enable HC-128 (default: disabled)],
  1011. [ ENABLED_HC128=$enableval ],
  1012. [ ENABLED_HC128=no ]
  1013. )
  1014. if test "$ENABLED_HC128" = "no"
  1015. then
  1016. AM_CFLAGS="$AM_CFLAGS -DNO_HC128"
  1017. else
  1018. AM_CFLAGS="$AM_CFLAGS -DHAVE_HC128"
  1019. fi
  1020. AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"])
  1021. # RABBIT
  1022. AC_ARG_ENABLE([rabbit],
  1023. [ --enable-rabbit Enable RABBIT (default: disabled)],
  1024. [ ENABLED_RABBIT=$enableval ],
  1025. [ ENABLED_RABBIT=no ]
  1026. )
  1027. if test "$ENABLED_RABBIT" = "no"
  1028. then
  1029. AM_CFLAGS="$AM_CFLAGS -DNO_RABBIT"
  1030. else
  1031. AM_CFLAGS="$AM_CFLAGS -DHAVE_RABBIT"
  1032. fi
  1033. AM_CONDITIONAL([BUILD_RABBIT], [test "x$ENABLED_RABBIT" = "xyes"])
  1034. # FIPS
  1035. AC_ARG_ENABLE([fips],
  1036. [AS_HELP_STRING([--enable-fips],[Enable FIPS 140-2, Will NOT work w/o FIPS license (default: disabled)])],
  1037. [ ENABLED_FIPS=$enableval ],
  1038. [ ENABLED_FIPS=no ]
  1039. )
  1040. if test "x$ENABLED_FIPS" = "xyes"
  1041. then
  1042. # requires thread local storage
  1043. if test "$thread_ls_on" = "no"
  1044. then
  1045. AC_MSG_ERROR([FIPS requires Thread Local Storage])
  1046. fi
  1047. # requires SHA512
  1048. if test "x$ENABLED_SHA512" = "xno"
  1049. then
  1050. ENABLED_SHA512="yes"
  1051. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"
  1052. AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
  1053. fi
  1054. # requires AESGCM
  1055. if test "x$ENABLED_AESGCM" != "xyes"
  1056. then
  1057. ENABLED_AESGCM="yes"
  1058. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"
  1059. AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
  1060. fi
  1061. AM_CFLAGS="$AM_CFLAGS -DHAVE_FIPS"
  1062. fi
  1063. AM_CONDITIONAL([BUILD_FIPS], [test "x$ENABLED_FIPS" = "xyes"])
  1064. # set POLY1305 default
  1065. POLY1305_DEFAULT=yes
  1066. if test "x$ENABLED_FIPS" = "xyes"
  1067. then
  1068. POLY1305_DEFAULT=no
  1069. fi
  1070. # POLY1305
  1071. AC_ARG_ENABLE([poly1305],
  1072. [AS_HELP_STRING([--enable-poly1305],[Enable wolfSSL POLY1305 support (default: enabled)])],
  1073. [ ENABLED_POLY1305=$enableval ],
  1074. [ ENABLED_POLY1305=$POLY1305_DEFAULT]
  1075. )
  1076. # lean psk does't need poly1305
  1077. if test "$ENABLED_LEANPSK" = "yes"
  1078. then
  1079. ENABLED_POLY1305=no
  1080. fi
  1081. if test "$ENABLED_POLY1305" = "yes"
  1082. then
  1083. AM_CFLAGS="$AM_CFLAGS -DHAVE_POLY1305 -DHAVE_ONE_TIME_AUTH"
  1084. fi
  1085. AM_CONDITIONAL([BUILD_POLY1305], [test "x$ENABLED_POLY1305" = "xyes"])
  1086. # set CHACHA default
  1087. CHACHA_DEFAULT=yes
  1088. if test "x$ENABLED_FIPS" = "xyes"
  1089. then
  1090. CHACHA_DEFAULT=no
  1091. fi
  1092. # CHACHA
  1093. AC_ARG_ENABLE([chacha],
  1094. [ --enable-chacha Enable CHACHA (default: enabled)],
  1095. [ ENABLED_CHACHA=$enableval ],
  1096. [ ENABLED_CHACHA=$CHACHA_DEFAULT]
  1097. )
  1098. # lean psk does't need chacha
  1099. if test "$ENABLED_LEANPSK" = "yes"
  1100. then
  1101. ENABLED_CHACHA=no
  1102. fi
  1103. if test "$ENABLED_CHACHA" = "yes"
  1104. then
  1105. AM_CFLAGS="$AM_CFLAGS -DHAVE_CHACHA"
  1106. fi
  1107. AM_CONDITIONAL([BUILD_CHACHA], [test "x$ENABLED_CHACHA" = "xyes"])
  1108. # Hash DRBG
  1109. AC_ARG_ENABLE([hashdrbg],
  1110. [ --enable-hashdrbg Enable Hash DRBG support (default: enabled)],
  1111. [ ENABLED_HASHDRBG=$enableval ],
  1112. [ ENABLED_HASHDRBG=yes ]
  1113. )
  1114. if test "x$ENABLED_HASHDRBG" = "xyes"
  1115. then
  1116. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  1117. else
  1118. # turn on Hash DRBG if FIPS is on or ARC4 is off
  1119. if test "x$ENABLED_FIPS" = "xyes" || test "x$ENABLED_ARC4" = "xno"
  1120. then
  1121. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  1122. ENABLED_HASHDRBG=yes
  1123. fi
  1124. fi
  1125. # Filesystem Build
  1126. AC_ARG_ENABLE([filesystem],
  1127. [ --enable-filesystem Enable Filesystem support (default: enabled)],
  1128. [ ENABLED_FILESYSTEM=$enableval ],
  1129. [ ENABLED_FILESYSTEM=yes ]
  1130. )
  1131. if test "$ENABLED_FILESYSTEM" = "no"
  1132. then
  1133. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  1134. else
  1135. # turn off filesystem if leanpsk on
  1136. if test "$ENABLED_LEANPSK" = "yes"
  1137. then
  1138. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  1139. ENABLED_FILESYSTEM=no
  1140. fi
  1141. fi
  1142. # inline Build
  1143. AC_ARG_ENABLE([inline],
  1144. [ --enable-inline Enable inline functions (default: enabled)],
  1145. [ ENABLED_INLINE=$enableval ],
  1146. [ ENABLED_INLINE=yes ]
  1147. )
  1148. if test "$ENABLED_INLINE" = "no"
  1149. then
  1150. AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
  1151. fi
  1152. AM_CONDITIONAL([BUILD_INLINE], [test "x$ENABLED_INLINE" = "xyes"])
  1153. # OCSP
  1154. AC_ARG_ENABLE([ocsp],
  1155. [ --enable-ocsp Enable OCSP (default: disabled)],
  1156. [ ENABLED_OCSP=$enableval ],
  1157. [ ENABLED_OCSP=no ],
  1158. )
  1159. if test "$ENABLED_OCSP" = "yes"
  1160. then
  1161. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  1162. fi
  1163. AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"])
  1164. if test "$ENABLED_OCSP" = "yes"
  1165. then
  1166. # check openssl command tool for testing ocsp
  1167. AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no])
  1168. if test "$HAVE_OPENSSL_CMD" = "yes"
  1169. then
  1170. AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD"
  1171. else
  1172. AC_MSG_WARN([openssl command line tool not available for testing ocsp])
  1173. fi
  1174. fi
  1175. # CRL
  1176. AC_ARG_ENABLE([crl],
  1177. [ --enable-crl Enable CRL (default: disabled)],
  1178. [ ENABLED_CRL=$enableval ],
  1179. [ ENABLED_CRL=no ],
  1180. )
  1181. if test "$ENABLED_CRL" = "yes"
  1182. then
  1183. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  1184. fi
  1185. AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"])
  1186. # CRL Monitor
  1187. AC_ARG_ENABLE([crl-monitor],
  1188. [ --enable-crl-monitor Enable CRL Monitor (default: disabled)],
  1189. [ ENABLED_CRL_MONITOR=$enableval ],
  1190. [ ENABLED_CRL_MONITOR=no ],
  1191. )
  1192. if test "$ENABLED_CRL_MONITOR" = "yes"
  1193. then
  1194. case $host_os in
  1195. *linux* | *darwin* | *freebsd*)
  1196. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR" ;;
  1197. *)
  1198. AC_MSG_ERROR([crl monitor only allowed on linux, OS X, or freebsd]) ;;
  1199. esac
  1200. fi
  1201. AM_CONDITIONAL([BUILD_CRL_MONITOR], [test "x$ENABLED_CRL_MONITOR" = "xyes"])
  1202. # USER CRYPTO
  1203. ENABLED_USER_CRYPTO="no"
  1204. ENABLED_USER_RSA="no"
  1205. AC_DEFINE([BUILD_USER_RSA], [], [User RSA is being defined])
  1206. trycryptodir=""
  1207. AC_ARG_WITH([user-crypto],
  1208. [AS_HELP_STRING([--with-user-crypto=PATH],[Path to USER_CRYPTO install (default /usr/local)])],
  1209. [
  1210. CPPFLAGS="$CPPFLAGS -DHAVE_USER_CRYPTO"
  1211. LIBS="$LIBS -lusercrypto"
  1212. if test "x$withval" != "xno" ; then
  1213. trycryptodir=$withval
  1214. fi
  1215. if test "x$withval" == "xyes" ; then
  1216. trycryptodir="/usr/local"
  1217. fi
  1218. LDFLAGS="$LDFLAGS -L$trycryptodir/lib"
  1219. CPPFLAGS="$CPPFLAGS -I$trycryptodir/include"
  1220. #Look for RSA Init function in usercrypto lib
  1221. AC_CHECK_LIB([usercrypto], [wc_InitRsaKey], [user_rsa_linked=yes], [user_rsa_linked=no])
  1222. if test "x$user_rsa_linked" == "xyes" ; then
  1223. AC_MSG_NOTICE([User user_rsa.h being used])
  1224. AM_CFLAGS="$AM_CFLAGS -DHAVE_USER_RSA"
  1225. ENABLED_USER_RSA=yes
  1226. ENABLED_USER_CRYPTO=yes
  1227. fi
  1228. #Display check and find result of link attempts
  1229. AC_MSG_CHECKING([for USER_CRYPTO])
  1230. if test "x$ENABLED_USER_CRYPTO" == "xno" ; then
  1231. AC_MSG_RESULT([no])
  1232. AC_MSG_ERROR([USER_CRYPTO not found. Either move to /usr/include and /usr/lib or
  1233. Specify its path using --with-user-crypto=/dir/])
  1234. else
  1235. AC_MSG_RESULT([yes])
  1236. # Check if .la is available if not then rely on exported path
  1237. AC_CHECK_FILE($trycryptodir/lib/libusercrypto.la, [LIB_ADD="$trycryptodir/lib/libusercrypto.la $LIB_ADD"], [LIB_ADD="-lusercrypto $LIB_ADD"])
  1238. AM_LDFLAGS="$AM_LDFLAGS -L$trycryptodir/lib"
  1239. AM_CFLAGS="$AM_CFLAGS -DHAVE_USER_CRYPTO"
  1240. fi
  1241. ]
  1242. )
  1243. AM_CONDITIONAL([BUILD_USER_RSA], [test "x$ENABLED_USER_RSA" == "xyes"] )
  1244. AM_CONDITIONAL([BUILD_USER_CRYPTO], [test "x$ENABLED_USER_CRYPTO" = "xyes"])
  1245. if test "$ENABLED_USER_CRYPTO" = "yes" && test "$ENABLED_FIPS" = "yes"
  1246. then
  1247. AC_MSG_ERROR([cannot enable user crypto and fips, user crypto posibility of using code in fips boundary.])
  1248. fi
  1249. # NTRU
  1250. ENABLED_NTRU="no"
  1251. tryntrudir=""
  1252. AC_ARG_WITH([ntru],
  1253. [AS_HELP_STRING([--with-ntru=PATH],[Path to NTRU install (default /usr/)])],
  1254. [
  1255. AC_MSG_CHECKING([for NTRU])
  1256. CPPFLAGS="$CPPFLAGS -DHAVE_NTRU -DHAVE_QSH -DHAVE_TLS_EXTENSIONS"
  1257. LIBS="$LIBS -lntruencrypt"
  1258. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libntruencrypt/ntru_crypto_drbg.h>]], [[ ntru_crypto_drbg_instantiate(0, 0, 0, 0, 0); ]])], [ ntru_linked=yes ],[ ntru_linked=no ])
  1259. if test "x$ntru_linked" == "xno" ; then
  1260. if test "x$withval" != "xno" ; then
  1261. tryntrudir=$withval
  1262. fi
  1263. if test "x$withval" == "xyes" ; then
  1264. tryntrudir="/usr"
  1265. fi
  1266. LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$tryntrudir/lib"
  1267. CPPFLAGS="$CPPFLAGS -I$tryntrudir/include"
  1268. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <libntruencrypt/ntru_crypto_drbg.h>]], [[ ntru_crypto_drbg_instantiate(0, 0, 0, 0, 0); ]])], [ ntru_linked=yes ],[ ntru_linked=no ])
  1269. if test "x$ntru_linked" == "xno" ; then
  1270. AC_MSG_ERROR([NTRU isn't found.
  1271. If it's already installed, specify its path using --with-ntru=/dir/])
  1272. fi
  1273. AC_MSG_RESULT([yes])
  1274. AM_LDFLAGS="$AM_LDFLAGS -L$tryntrudir/lib"
  1275. else
  1276. AC_MSG_RESULT([yes])
  1277. fi
  1278. AM_CFLAGS="$AM_CFLAGS -DHAVE_NTRU -DHAVE_QSH -DHAVE_TLS_EXTENSIONS"
  1279. ENABLED_NTRU="yes"
  1280. ]
  1281. )
  1282. AM_CONDITIONAL([BUILD_NTRU], [test "x$ENABLED_NTRU" = "xyes"])
  1283. if test "$ENABLED_NTRU" = "yes" && test "$ENABLED_SMALL" = "yes"
  1284. then
  1285. AC_MSG_ERROR([cannot enable ntru and small, ntru requires TLS which small turns off.])
  1286. fi
  1287. # SNI
  1288. AC_ARG_ENABLE([sni],
  1289. [ --enable-sni Enable SNI (default: disabled)],
  1290. [ ENABLED_SNI=$enableval ],
  1291. [ ENABLED_SNI=no ]
  1292. )
  1293. if test "x$ENABLED_SNI" = "xyes"
  1294. then
  1295. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  1296. fi
  1297. # Maximum Fragment Length
  1298. AC_ARG_ENABLE([maxfragment],
  1299. [ --enable-maxfragment Enable Maximum Fragment Length (default: disabled)],
  1300. [ ENABLED_MAX_FRAGMENT=$enableval ],
  1301. [ ENABLED_MAX_FRAGMENT=no ]
  1302. )
  1303. # ALPN
  1304. AC_ARG_ENABLE([alpn],
  1305. [ --enable-alpn Enable ALPN (default: disabled)],
  1306. [ ENABLED_ALPN=$enableval ],
  1307. [ ENABLED_ALPN=no ]
  1308. )
  1309. if test "x$ENABLED_ALPN" = "xyes"
  1310. then
  1311. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_ALPN"
  1312. fi
  1313. # Maximum Fragment Length
  1314. if test "x$ENABLED_MAX_FRAGMENT" = "xyes"
  1315. then
  1316. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_MAX_FRAGMENT"
  1317. fi
  1318. # Truncated HMAC
  1319. AC_ARG_ENABLE([truncatedhmac],
  1320. [ --enable-truncatedhmac Enable Truncated HMAC (default: disabled)],
  1321. [ ENABLED_TRUNCATED_HMAC=$enableval ],
  1322. [ ENABLED_TRUNCATED_HMAC=no ]
  1323. )
  1324. if test "x$ENABLED_TRUNCATED_HMAC" = "xyes"
  1325. then
  1326. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_TRUNCATED_HMAC"
  1327. fi
  1328. # Renegotiation Indication - (FAKE Secure Renegotiation)
  1329. AC_ARG_ENABLE([renegotiation-indication],
  1330. [AS_HELP_STRING([--enable-renegotiation-indication],[Enable Renegotiation Indication (default: disabled)])],
  1331. [ ENABLED_RENEGOTIATION_INDICATION=$enableval ],
  1332. [ ENABLED_RENEGOTIATION_INDICATION=no ]
  1333. )
  1334. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  1335. then
  1336. AM_CFLAGS="$AM_CFLAGS -DHAVE_RENEGOTIATION_INDICATION"
  1337. fi
  1338. # Secure Renegotiation
  1339. AC_ARG_ENABLE([secure-renegotiation],
  1340. [AS_HELP_STRING([--enable-secure-renegotiation],[Enable Secure Renegotiation (default: disabled)])],
  1341. [ ENABLED_SECURE_RENEGOTIATION=$enableval ],
  1342. [ ENABLED_SECURE_RENEGOTIATION=no ]
  1343. )
  1344. if test "x$ENABLED_SECURE_RENEGOTIATION" = "xyes"
  1345. then
  1346. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  1347. then
  1348. AC_MSG_ERROR([cannot enable renegotiation-indication and secure-renegotiation.])
  1349. fi
  1350. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SECURE_RENEGOTIATION"
  1351. fi
  1352. # Supported Elliptic Curves Extensions
  1353. AC_ARG_ENABLE([supportedcurves],
  1354. [AS_HELP_STRING([--enable-supportedcurves],[Enable Supported Elliptic Curves (default: disabled)])],
  1355. [ ENABLED_SUPPORTED_CURVES=$enableval ],
  1356. [ ENABLED_SUPPORTED_CURVES=no ]
  1357. )
  1358. if test "x$ENABLED_SUPPORTED_CURVES" = "xyes"
  1359. then
  1360. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES"
  1361. fi
  1362. # Session Ticket Extension
  1363. AC_ARG_ENABLE([session-ticket],
  1364. [AS_HELP_STRING([--enable-session-ticket],[Enable Session Ticket (default: disabled)])],
  1365. [ ENABLED_SESSION_TICKET=$enableval ],
  1366. [ ENABLED_SESSION_TICKET=no ]
  1367. )
  1368. if test "x$ENABLED_SESSION_TICKET" = "xyes"
  1369. then
  1370. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SESSION_TICKET"
  1371. fi
  1372. # TLS Extensions
  1373. AC_ARG_ENABLE([tlsx],
  1374. [ --enable-tlsx Enable all TLS Extensions (default: disabled)],
  1375. [ ENABLED_TLSX=$enableval ],
  1376. [ ENABLED_TLSX=no ]
  1377. )
  1378. if test "x$ENABLED_TLSX" = "xyes"
  1379. then
  1380. ENABLED_SNI=yes
  1381. ENABLED_MAX_FRAGMENT=yes
  1382. ENABLED_TRUNCATED_HMAC=yes
  1383. ENABLED_SUPPORTED_CURVES=yes
  1384. ENABLED_ALPN=yes
  1385. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC -DHAVE_SUPPORTED_CURVES -DHAVE_ALPN"
  1386. fi
  1387. # PKCS7
  1388. AC_ARG_ENABLE([pkcs7],
  1389. [ --enable-pkcs7 Enable PKCS7 (default: disabled)],
  1390. [ ENABLED_PKCS7=$enableval ],
  1391. [ ENABLED_PKCS7=no ],
  1392. )
  1393. if test "$ENABLED_PKCS7" = "yes"
  1394. then
  1395. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
  1396. fi
  1397. AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
  1398. # Simple Certificate Enrollment Protocol (SCEP)
  1399. AC_ARG_ENABLE([scep],
  1400. [ --enable-scep Enable wolfSCEP (default: disabled)],
  1401. [ ENABLED_WOLFSCEP=$enableval ],
  1402. [ ENABLED_WOLFSCEP=no ]
  1403. )
  1404. if test "$ENABLED_WOLFSCEP" = "yes"
  1405. then
  1406. # Enable prereqs if not already enabled
  1407. if test "x$ENABLED_KEYGEN" = "xno"
  1408. then
  1409. ENABLED_KEYGEN="yes"
  1410. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  1411. fi
  1412. if test "x$ENABLED_CERTGEN" = "xno"
  1413. then
  1414. ENABLED_CERTGEN="yes"
  1415. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  1416. fi
  1417. if test "x$ENABLED_CERTREQ" = "xno"
  1418. then
  1419. ENABLED_CERTREQ="yes"
  1420. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  1421. fi
  1422. if test "x$ENABLED_CERTEXT" = "xno"
  1423. then
  1424. ENABLED_CERTEXT="yes"
  1425. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  1426. fi
  1427. if test "x$ENABLED_PKCS7" = "xno"
  1428. then
  1429. ENABLED_PKCS7="yes"
  1430. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
  1431. AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
  1432. fi
  1433. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_WOLFSCEP"
  1434. fi
  1435. # Secure Remote Password
  1436. AC_ARG_ENABLE([srp],
  1437. [ --enable-srp Enable Secure Remote Password (default: disabled)],
  1438. [ ENABLED_SRP=$enableval ],
  1439. [ ENABLED_SRP=no ]
  1440. )
  1441. if test "x$ENABLED_SRP" = "xyes"
  1442. then
  1443. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SRP"
  1444. fi
  1445. AM_CONDITIONAL([BUILD_SRP], [test "x$ENABLED_SRP" = "xyes"])
  1446. # Small Stack
  1447. AC_ARG_ENABLE([smallstack],
  1448. [ --enable-smallstack Enable Small Stack Usage (default: disabled)],
  1449. [ ENABLED_SMALL_STACK=$enableval ],
  1450. [ ENABLED_SMALL_STACK=no ]
  1451. )
  1452. if test "x$ENABLED_SMALL_STACK" = "xyes"
  1453. then
  1454. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SMALL_STACK"
  1455. fi
  1456. #valgrind
  1457. AC_ARG_ENABLE([valgrind],
  1458. [ --enable-valgrind Enable valgrind for unit tests (default: disabled)],
  1459. [ ENABLED_VALGRIND=$enableval ],
  1460. [ ENABLED_VALGRIND=no ]
  1461. )
  1462. if test "$ENABLED_VALGRIND" = "yes"
  1463. then
  1464. AC_CHECK_PROG([HAVE_VALGRIND],[valgrind],[yes],[no])
  1465. if test "$HAVE_VALGRIND" = "no"
  1466. then
  1467. AC_MSG_ERROR([Valgrind not found.])
  1468. fi
  1469. enable_shared=no
  1470. enable_static=yes
  1471. AM_CFLAGS="$AM_CFLAGS -DHAVE_VALGRIND"
  1472. fi
  1473. AM_CONDITIONAL([USE_VALGRIND], [test "x$ENABLED_VALGRIND" = "xyes"])
  1474. # Test certs, use internal cert functions for extra testing
  1475. AC_ARG_ENABLE([testcert],
  1476. [ --enable-testcert Enable Test Cert (default: disabled)],
  1477. [ ENABLED_TESTCERT=$enableval ],
  1478. [ ENABLED_TESTCERT=no ]
  1479. )
  1480. if test "$ENABLED_TESTCERT" = "yes"
  1481. then
  1482. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TEST_CERT"
  1483. fi
  1484. # I/O Pool, an example to show user how to override memory handler and use
  1485. # a pool for the input/output buffer requests
  1486. AC_ARG_ENABLE([iopool],
  1487. [ --enable-iopool Enable I/O Pool example (default: disabled)],
  1488. [ ENABLED_IOPOOL=$enableval ],
  1489. [ ENABLED_IOPOOL=no ]
  1490. )
  1491. if test "$ENABLED_IOPOOL" = "yes"
  1492. then
  1493. if test "$thread_ls_on" = "no"
  1494. then
  1495. AC_MSG_ERROR([I/O Pool example requires Thread Local Storage])
  1496. fi
  1497. AM_CFLAGS="$AM_CFLAGS -DHAVE_IO_POOL -DXMALLOC_USER"
  1498. fi
  1499. # Certificate Service Support
  1500. AC_ARG_ENABLE([certservice],
  1501. [ --enable-certservice Enable cert service (default: disabled)],
  1502. [ ENABLED_CERT_SERVICE=$enableval ],
  1503. [ ENABLED_CERT_SERVICE=no ]
  1504. )
  1505. if test "$ENABLED_CERT_SERVICE" = "yes"
  1506. then
  1507. # Requires ecc,certgen, and opensslextra make sure on
  1508. if test "x$ENABLED_CERTGEN" = "xno"
  1509. then
  1510. ENABLED_CERTGEN="yes"
  1511. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  1512. fi
  1513. if test "x$ENABLED_ECC" = "xno"
  1514. then
  1515. ENABLED_ECC="yes"
  1516. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR"
  1517. AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
  1518. fi
  1519. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  1520. then
  1521. ENABLED_OPENSSLEXTRA="yes"
  1522. AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
  1523. fi
  1524. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_CERT_SERVICE"
  1525. fi
  1526. # wolfSSL JNI
  1527. AC_ARG_ENABLE([jni],
  1528. [ --enable-jni Enable wolfSSL JNI (default: disabled)],
  1529. [ ENABLED_JNI=$enableval ],
  1530. [ ENABLED_JNI=no ]
  1531. )
  1532. if test "$ENABLED_JNI" = "yes"
  1533. then
  1534. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_JNI"
  1535. # Enable prereqs if not already enabled
  1536. if test "x$ENABLED_DTLS" = "xno"
  1537. then
  1538. ENABLED_DTLS="yes"
  1539. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  1540. fi
  1541. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  1542. then
  1543. ENABLED_OPENSSLEXTRA="yes"
  1544. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  1545. fi
  1546. if test "x$ENABLED_CRL" = "xno"
  1547. then
  1548. ENABLED_CRL="yes"
  1549. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  1550. AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"])
  1551. fi
  1552. if test "x$ENABLED_OCSP" = "xno"
  1553. then
  1554. ENABLED_OCSP="yes"
  1555. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  1556. AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"])
  1557. fi
  1558. if test "x$ENABLED_CRL_MONITOR" = "xno"
  1559. then
  1560. ENABLED_CRL_MONITOR="yes"
  1561. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
  1562. fi
  1563. if test "x$ENABLED_SAVESESSION" = "xno"
  1564. then
  1565. ENABLED_SAVESESSION="yes"
  1566. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  1567. fi
  1568. if test "x$ENABLED_SAVECERT" = "xno"
  1569. then
  1570. ENABLED_SAVECERT="yes"
  1571. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  1572. fi
  1573. if test "x$ENABLED_ATOMICUSER" = "xno"
  1574. then
  1575. ENABLED_ATOMICUSER="yes"
  1576. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  1577. fi
  1578. if test "x$ENABLED_ECC" = "xno"
  1579. then
  1580. ENABLED_ECC="yes"
  1581. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC"
  1582. fi
  1583. if test "x$ENABLED_PKCALLBACKS" = "xno"
  1584. then
  1585. ENABLED_PKCALLBACKS="yes"
  1586. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  1587. fi
  1588. if test "x$ENABLED_DH" = "xno"
  1589. then
  1590. ENABLED_DH="yes"
  1591. AM_CFLAGS="$AM_CFLAGS -DHAVE_DH"
  1592. fi
  1593. if test "x$ENABLED_PSK" = "xno"
  1594. then
  1595. ENABLED_PSK="yes"
  1596. fi
  1597. fi
  1598. # lighty Support
  1599. AC_ARG_ENABLE([lighty],
  1600. [ --enable-lighty Enable lighttpd/lighty (default: disabled)],
  1601. [ ENABLED_LIGHTY=$enableval ],
  1602. [ ENABLED_LIGHTY=no ]
  1603. )
  1604. if test "$ENABLED_LIGHTY" = "yes"
  1605. then
  1606. # Requires opensslextra make sure on
  1607. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  1608. then
  1609. ENABLED_OPENSSLEXTRA="yes"
  1610. AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
  1611. fi
  1612. AM_CFLAGS="$AM_CFLAGS -DHAVE_LIGHTY -DHAVE_WOLFSSL_SSL_H=1"
  1613. fi
  1614. # stunnel Support
  1615. AC_ARG_ENABLE([stunnel],
  1616. [ --enable-stunnel Enable stunnel (default: disabled)],
  1617. [ ENABLED_STUNNEL=$enableval ],
  1618. [ ENABLED_STUNNEL=no ]
  1619. )
  1620. if test "$ENABLED_STUNNEL" = "yes"
  1621. then
  1622. # Requires opensslextra make sure on
  1623. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  1624. then
  1625. ENABLED_OPENSSLEXTRA="yes"
  1626. AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
  1627. fi
  1628. # Requires OCSP make sure on
  1629. if test "x$ENABLED_OCSP" = "xno"
  1630. then
  1631. ENABLED_OCSP="yes"
  1632. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  1633. AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"])
  1634. fi
  1635. # Requires coding make sure on
  1636. if test "x$ENABLED_CODING" = "xno"
  1637. then
  1638. ENABLED_CODING="yes"
  1639. fi
  1640. # Requires sessioncerts make sure on
  1641. if test "x$ENABLED_SESSIONCERTS" = "xno"
  1642. then
  1643. ENABLED_SESSIONCERTS="yes"
  1644. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  1645. fi
  1646. # Requires crls, make sure on
  1647. if test "x$ENABLED_CRL" = "xno"
  1648. then
  1649. ENABLED_CRL="yes"
  1650. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  1651. AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"])
  1652. fi
  1653. # Requires tlsx, make sure on
  1654. if test "x$ENABLED_TLSX" = "xno"
  1655. then
  1656. ENABLED_TLSX="yes"
  1657. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC -DHAVE_SUPPORTED_CURVES"
  1658. fi
  1659. # Requires ecc make sure on
  1660. if test "x$ENABLED_ECC" = "xno"
  1661. then
  1662. ENABLED_OPENSSLEXTRA="yes"
  1663. ENABLED_ECC="yes"
  1664. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR"
  1665. AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
  1666. fi
  1667. AM_CFLAGS="$AM_CFLAGS -DHAVE_STUNNEL -DWOLFSSL_ALWAYS_VERIFY_CB"
  1668. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  1669. fi
  1670. if test "$ENABLED_PSK" = "no" && test "$ENABLED_LEANPSK" = "no" \
  1671. && test "x$ENABLED_STUNNEL" = "xno"
  1672. then
  1673. AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
  1674. fi
  1675. if test "$ENABLED_PSK" = "no" && \
  1676. (test "$ENABLED_LEANPSK" = "yes" || test "x$ENABLED_STUNNEL" = "xyes")
  1677. then
  1678. ENABLED_PSK=yes
  1679. fi
  1680. # MD4
  1681. AC_ARG_ENABLE([md4],
  1682. [ --enable-md4 Enable MD4 (default: disabled)],
  1683. [ ENABLED_MD4=$enableval ],
  1684. [ ENABLED_MD4=no ]
  1685. )
  1686. if test "$ENABLED_MD4" = "no"
  1687. then
  1688. #turn on MD4 if using stunnel
  1689. if test "x$ENABLED_STUNNEL" = "xyes"
  1690. then
  1691. ENABLED_MD4="yes"
  1692. else
  1693. AM_CFLAGS="$AM_CFLAGS -DNO_MD4"
  1694. fi
  1695. fi
  1696. AM_CONDITIONAL([BUILD_MD4], [test "x$ENABLED_MD4" = "xyes"])
  1697. # PWDBASED has to come after certservice since we want it on w/o explicit on
  1698. # PWDBASED
  1699. AC_ARG_ENABLE([pwdbased],
  1700. [ --enable-pwdbased Enable PWDBASED (default: disabled)],
  1701. [ ENABLED_PWDBASED=$enableval ],
  1702. [ ENABLED_PWDBASED=no ]
  1703. )
  1704. if test "$ENABLED_PWDBASED" = "no"
  1705. then
  1706. if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes"
  1707. then
  1708. # opensslextra and webserver needs pwdbased
  1709. ENABLED_PWDBASED=yes
  1710. else
  1711. AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
  1712. fi
  1713. fi
  1714. AM_CONDITIONAL([BUILD_PWDBASED], [test "x$ENABLED_PWDBASED" = "xyes"])
  1715. # wolfCrypt Only Build
  1716. AC_ARG_ENABLE([cryptonly],
  1717. [AS_HELP_STRING([--enable-cryptonly],[Enable wolfCrypt Only build (default: disabled)])],
  1718. [ENABLED_CRYPTONLY=$enableval],
  1719. [ENABLED_CRYPTONLY=no])
  1720. if test "$ENABLED_CRYPTONLY" = "yes"
  1721. then
  1722. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_ONLY"
  1723. fi
  1724. AM_CONDITIONAL([BUILD_CRYPTONLY], [test "x$ENABLED_CRYPTONLY" = "xyes"])
  1725. # set fastmath default
  1726. FASTMATH_DEFAULT=no
  1727. if test "$host_cpu" = "x86_64"
  1728. then
  1729. FASTMATH_DEFAULT=yes
  1730. fi
  1731. # fastmath
  1732. AC_ARG_ENABLE([fastmath],
  1733. [ --enable-fastmath Enable fast math ops (default: enabled on x86_64)],
  1734. [ ENABLED_FASTMATH=$enableval ],
  1735. [ ENABLED_FASTMATH=$FASTMATH_DEFAULT]
  1736. )
  1737. if test "x$ENABLED_FASTMATH" = "xyes"
  1738. then
  1739. # turn off fastmth if leanpsk on or asn off (w/o dh)
  1740. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_ASN" = "no"
  1741. then
  1742. if test "$ENABLED_DH" = "no"
  1743. then
  1744. ENABLED_FASTMATH=no
  1745. else
  1746. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  1747. ENABLED_SLOWMATH="no"
  1748. fi
  1749. else
  1750. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  1751. ENABLED_SLOWMATH="no"
  1752. fi
  1753. if test "$host_cpu" = "x86_64"
  1754. then
  1755. # Have settings.h set FP_MAX_BITS higher if user didn't set directly
  1756. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_64_BUILD"
  1757. fi
  1758. fi
  1759. # fast HUGE math
  1760. AC_ARG_ENABLE([fasthugemath],
  1761. [ --enable-fasthugemath Enable fast math + huge code (default: disabled)],
  1762. [ ENABLED_FASTHUGEMATH=$enableval ],
  1763. [ ENABLED_FASTHUGEMATH=no ]
  1764. )
  1765. if test "$ENABLED_BUMP" = "yes"
  1766. then
  1767. ENABLED_FASTHUGEMATH="yes"
  1768. fi
  1769. if test "$ENABLED_FASTHUGEMATH" = "yes"
  1770. then
  1771. ENABLED_FASTMATH="yes"
  1772. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  1773. ENABLED_SLOWMATH="no"
  1774. fi
  1775. AM_CONDITIONAL([BUILD_FASTMATH], [test "x$ENABLED_FASTMATH" = "xyes"])
  1776. AM_CONDITIONAL([BUILD_SLOWMATH], [test "x$ENABLED_SLOWMATH" = "xyes"])
  1777. # Enable Examples, used to disable examples
  1778. AC_ARG_ENABLE([examples],
  1779. [ --enable-examples Enable Examples (default: enabled)],
  1780. [ ENABLED_EXAMPLES=$enableval ],
  1781. [ ENABLED_EXAMPLES=yes ]
  1782. )
  1783. AS_IF([test "x$ENABLED_FILESYSTEM" = "xno"], [ENABLED_EXAMPLES="no"])
  1784. AS_IF([test "x$ENABLED_INLINE" = "xno"], [ENABLED_EXAMPLES="no"])
  1785. AS_IF([test "x$ENABLED_CRYPTONLY" = "xyes"], [ENABLED_EXAMPLES="no"])
  1786. AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$ENABLED_EXAMPLES" = "xyes"])
  1787. # LIBZ
  1788. ENABLED_LIBZ="no"
  1789. trylibzdir=""
  1790. AC_ARG_WITH([libz],
  1791. [ --with-libz=PATH PATH to libz install (default /usr/) ],
  1792. [
  1793. AC_MSG_CHECKING([for libz])
  1794. CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
  1795. LIBS="$LIBS -lz"
  1796. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  1797. if test "x$libz_linked" == "xno" ; then
  1798. if test "x$withval" != "xno" ; then
  1799. trylibzdir=$withval
  1800. fi
  1801. if test "x$withval" == "xyes" ; then
  1802. trylibzdir="/usr"
  1803. fi
  1804. AM_LDFLAGS="$AM_LDFLAGS -L$trylibzdir/lib"
  1805. CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
  1806. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  1807. if test "x$libz_linked" == "xno" ; then
  1808. AC_MSG_ERROR([libz isn't found.
  1809. If it's already installed, specify its path using --with-libz=/dir/])
  1810. fi
  1811. AC_MSG_RESULT([yes])
  1812. else
  1813. AC_MSG_RESULT([yes])
  1814. fi
  1815. ENABLED_LIBZ="yes"
  1816. ]
  1817. )
  1818. AM_CONDITIONAL([BUILD_LIBZ], [test "x$ENABLED_LIBZ" = "xyes"])
  1819. # cavium
  1820. trycaviumdir=""
  1821. AC_ARG_WITH([cavium],
  1822. [ --with-cavium=PATH PATH to cavium/software dir ],
  1823. [
  1824. AC_MSG_CHECKING([for cavium])
  1825. CPPFLAGS="$CPPFLAGS -DHAVE_CAVIUM"
  1826. if test "x$withval" == "xyes" ; then
  1827. AC_MSG_ERROR([need a PATH for --with-cavium])
  1828. fi
  1829. if test "x$withval" != "xno" ; then
  1830. trycaviumdir=$withval
  1831. fi
  1832. LDFLAGS="$AM_LDFLAGS $trycaviumdir/api/cavium_common.o"
  1833. CPPFLAGS="$CPPFLAGS -I$trycaviumdir/include"
  1834. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cavium_common.h"]], [[ CspShutdown(CAVIUM_DEV_ID); ]])],[ cavium_linked=yes ],[ cavium_linked=no ])
  1835. if test "x$cavium_linked" == "xno" ; then
  1836. AC_MSG_ERROR([cavium isn't found.
  1837. If it's already installed, specify its path using --with-cavium=/dir/])
  1838. fi
  1839. AC_MSG_RESULT([yes])
  1840. enable_shared=no
  1841. enable_static=yes
  1842. ]
  1843. )
  1844. # Fast RSA using Intel IPP
  1845. ippdir="${srcdir}/IPP"
  1846. ipplib="lib" # if autoconf guesses 32 changes lib directory
  1847. fastRSA_headers=no
  1848. # set up variables used
  1849. IPPLIBS=
  1850. IPPHEADERS=
  1851. IPPLINK=
  1852. AC_ARG_ENABLE([fast-rsa],
  1853. [AS_HELP_STRING([--enable-fast-rsa],[Enable RSA using Intel IPP (default: disabled)])],
  1854. [ ENABLED_FAST_RSA=$enableval ],
  1855. [ ENABLED_FAST_RSA=no ],
  1856. )
  1857. if test "$ENABLED_USER_RSA" = "no" && test "$ENABLED_FIPS" = "no"; then
  1858. if test "$enable_shared" = "no" && test "$ENABLED_FAST_RSA" = "yes"; then
  1859. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  1860. ipplib="lib_32" # 32 bit OS detected
  1861. fi
  1862. case $host_os in
  1863. *darwin*)
  1864. ipplib="$ipplib/mac_static"
  1865. AC_MSG_ERROR([Issue with static linking to libippcp.a on Mac.
  1866. Dynamic IPP libraries supported on Mac])
  1867. break;;
  1868. *linux*)
  1869. ipplib="$ipplib/linux_static"
  1870. break;;
  1871. *)
  1872. ENABLED_FAST_RSA=no
  1873. esac
  1874. AC_CHECK_FILES([$srcdir/IPP/$ipplib/libippcore.a $srcdir/IPP/$ipplib/libippcp.a], [], [ENABLED_FAST_RSA=no])
  1875. AC_CHECK_FILES([$srcdir/IPP/include/ipp.h $srcdir/IPP/include/ippcp.h], [AM_CPPFLAGS="-I$srcdir/IPP/include $AM_CPPFLAGS"], [ENABLED_FAST_RSA=no])
  1876. LIB_STATIC_ADD="$srcdir/IPP/$ipplib/libippcp.a $srcdir/IPP/$ipplib/libippcore.a"
  1877. if test "$ENABLED_FAST_RSA" = "no"; then
  1878. AC_MSG_ERROR([Could not find fast rsa libraries])
  1879. fi
  1880. else
  1881. # just check link and see if user has already exported paths
  1882. if test "$ENABLED_FAST_RSA" = "yes"
  1883. then
  1884. AC_MSG_NOTICE([Checking if IPP crypto library installed])
  1885. AC_CHECK_HEADER([ippcp.h], [AC_CHECK_LIB([ippcp], [ippsRSAEncrypt_PKCSv15], [LIBS="$LIBS -lippcore"; fastRSA_headers=yes], [AS_UNSET([ac_cv_lib_ippcp_ippsRSAEncrypt_PKCSv15]); fastRSA_headers=no])], [fastRSA_headers=no])
  1886. if test "$fastRSA_headers" = "yes"; then
  1887. AM_LDFLAGS="${AM_LDFLAGS} -lippcore -lippcp"
  1888. fi
  1889. fi
  1890. # Don't cache the result so it can be checked again
  1891. AS_UNSET([ac_cv_header_ippcp_h])
  1892. AS_UNSET([ac_cv_header_ipp_h])
  1893. if test "$fastRSA_headers" = "no"; then
  1894. dnl set default paths
  1895. if test "$ENABLED_FAST_RSA" = "yes"; then
  1896. AC_MSG_NOTICE([Using local IPP crypto library])
  1897. # build and default locations on linux and mac
  1898. STORE_LDFLAGS=${LDFLAGS}
  1899. STORE_CPPFLAGS=${CPPFLAGS}
  1900. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  1901. ipplib="lib_32" # 32 bit OS detected
  1902. fi
  1903. # using LDFLAGS instead of AM_ temporarily to test link to library
  1904. LDFLAGS="-L$ippdir/$ipplib -lippcp -lippcore"
  1905. CPPFLAGS="-I$ippdir/include"
  1906. AC_CHECK_HEADERS([ippcp.h], [AC_CHECK_LIB([ippcp], [ippsRSAEncrypt_PKCSv15], [], [ENABLED_FAST_RSA=no])], [ENABLED_FAST_RSA=no])
  1907. if test "$ENABLED_FAST_RSA" = "yes"; then
  1908. # was succesfull so add tested LDFLAGS to AM_ flags
  1909. AM_LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}"
  1910. AM_CPPFLAGS="${AM_CPPFLAGS} ${CPPFLAGS}"
  1911. case $host_os in
  1912. *darwin*)
  1913. name="$ippdir/$ipplib/libippcp"
  1914. IPPLIBS="${name}.dylib ${name}-9.0.dylib ${name}e9-9.0.dylib ${name}g9-9.0.dylib ${name}h9-9.0.dylib ${name}k0-9.0.dylib ${name}l9-9.0.dylib ${name}n8-9.0.dylib ${name}p8-9.0.dylib ${name}s8-9.0.dylib ${name}y8-9.0.dylib IPP/lib/libippcore.dylib IPP/lib/libippcore-9.0.dylib"
  1915. IPPLINK="mkdir -p src/.libs && ln -f ${name}.dylib src/.libs/libippcp.dylib && ln -f ${srcdir}/${name}-9.0.dylib src/.libs/libippcp-9.0.dylib && ln -f ${srcdir}/${name}e9-9.0.dylib src/.libs/libippcpe9-9.0.dylib && ln -f ${srcdir}/${name}g9-9.0.dylib src/.libs/libippcpg9-9.0.dylib && ln -f ${srcdir}/${name}h9-9.0.dylib src/.libs/libippcph9-9.0.dylib && ln -f ${srcdir}/${name}k0-9.0.dylib src/.libs/libippcpk0-9.0.dylib && ln -f ${srcdir}/${name}l9-9.0.dylib src/.libs/libippcpl9-9.0.dylib && ln -f ${srcdir}/${name}n8-9.0.dylib src/.libs/libippcpn8-9.0.dylib && ln -f ${srcdir}/${name}p8-9.0.dylib src/.libs/libippcpp8-9.0.dylib && ln -f ${srcdir}/${name}s8-9.0.dylib src/.libs/libippcps8-9.0.dylib && ln -f ${srcdir}/${name}y8-9.0.dylib src/.libs/libippcpy8-9.0.dylib && ln -f ${srcdir}/IPP/lib/libippcore.dylib src/.libs/libippcore.dylib && ln -f ${srcdir}/IPP/lib/libippcore-9.0.dylib src/.libs/libippcore-9.0.dylib"
  1916. break;;
  1917. *linux*)
  1918. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  1919. name="$ippdir/$ipplib/libippcp"
  1920. IPPLIBS="${name}.so.9.0 ${name}g9.so.9.0 ${name}h9.so.9.0 ${name}p8.so.9.0 ${name}px.so.9.0 ${name}s8.so.9.0 ${name}.so ${name}w7.so.9.0 IPP/$ipplib/libippcore.so"
  1921. IPPLINK="mkdir -p src/.libs && ln -f ${name}.so.9.0 src/.libs/libippcp.so.9.0 && ln -f ${name}g9.so.9.0 src/.libs/libippcpg9.so.9.0 && ln -f ${name}h9.so.9.0 src/.libs/libippcph9.so.9.0 && ln -f ${name}p8.so.9.0 src/.libs/libippcpp8.so.9.0 && ln -f ${name}px.so.9.0 src/.libs/libippcppx.so.9.0 && ln -f ${name}s8.so.9.0 src/.libs/libippcps8.so.9.0 && ln -f ${name}.so src/.libs/libippcp.so && ln -f ${name}w7.so.9.0 src/.libs/libippcpw7.so.9.0 && ln -f IPP/$ipplib/libippcore.so src/.libs/libippcore.so && ln -f IPP/$ipplib/libippcore.so.9.0 src/.libs/libippcore.so.9.0"
  1922. else
  1923. name="$ippdir/$ipplib/libippcp"
  1924. IPPLIBS="${name}.so.9.0 ${name}e9.so.9.0 ${name}k0.so.9.0 ${name}l9.so.9.0 ${name}m7.so.9.0 ${name}mx.so.9.0 ${name}.so ${name}n8.so.9.0 ${name}y8.so.9.0 IPP/lib/libippcore.so"
  1925. IPPLINK="mkdir -p src/.libs && ln -f ${name}.so.9.0 src/.libs/libippcp.so.9.0 && ln -f ${name}e9.so.9.0 src/.libs/libippcpe9.so.9.0 && ln -f ${name}k0.so.9.0 src/.libs/libippcpk0.so.9.0 && ln -f ${name}l9.so.9.0 src/.libs/libippcpl9.so.9.0 && ln -f ${name}m7.so.9.0 src/.libs/libippcpm7.so.9.0 && ln -f ${name}mx.so.9.0 src/.libs/libippcpmx.so.9.0 && ln -f ${name}.so src/.libs/libippcp.so && ln -f ${name}n8.so.9.0 src/.libs/libippcpn8.so.9.0 && ln -f ${name}y8.so.9.0 src/.libs/libippcpy8.so.9.0 && ln -f IPP/lib/libippcore.so src/.libs/libippcore.so && ln -f IPP/lib/libippcore.so.9.0 src/.libs/libippcore.so.9.0"
  1926. fi
  1927. break;;
  1928. *)
  1929. ENABLED_FAST_RSA=no
  1930. esac
  1931. fi
  1932. # restore LDFLAGS to user set
  1933. LDFLAGS=${STORE_LDFLAGS}
  1934. CPPFLAGS=${STORE_CPPFLAGS}
  1935. IPPHEADERS="${srcdir}/IPP/include/*.h"
  1936. # Error out on not finding libraries
  1937. if test "$ENABLED_FAST_RSA" = "no"; then
  1938. AC_MSG_ERROR([Could not find fast rsa libraries])
  1939. fi
  1940. fi
  1941. fi # end of if found exported paths
  1942. fi # end of if for shared library
  1943. else # if user rsa is set than do not use fast rsa option
  1944. if test "$ENABLED_FAST_RSA" = "yes"; then
  1945. AC_MSG_ERROR([Could not use fast rsa libraries with user crypto or fips])
  1946. fi
  1947. fi # end of if for user rsa crypto
  1948. AC_MSG_CHECKING([for fast RSA])
  1949. if test "$ENABLED_FAST_RSA" = "yes"; then
  1950. AM_CFLAGS="$AM_CFLAGS -DHAVE_FAST_RSA -DHAVE_USER_RSA"
  1951. # add in user crypto header that uses Intel IPP
  1952. AM_CPPFLAGS="$AM_CPPFLAGS -I$srcdir/wolfcrypt/user-crypto/include"
  1953. if test "$enable_shared" = "yes"; then
  1954. LIBS="$LIBS -lippcore"
  1955. LIB_ADD="-lippcp -lippcore $LIB_ADD"
  1956. else
  1957. LIB_ADD="$srcdir/IPP/$ipplib/libippcp.a $srcdir/IPP/$ipplib/libippcore.a $LIB_ADD"
  1958. fi
  1959. AC_MSG_RESULT([yes])
  1960. else
  1961. AC_MSG_RESULT([no])
  1962. fi
  1963. AC_SUBST([IPPLIBS])
  1964. AC_SUBST([IPPHEADERS])
  1965. AC_SUBST([IPPLINK])
  1966. # Found IPP library now build in user crypto to use it
  1967. AM_CONDITIONAL([BUILD_FAST_RSA], [test "x$ENABLED_FAST_RSA" = "xyes"])
  1968. # microchip api
  1969. AC_ARG_ENABLE([mcapi],
  1970. [ --enable-mcapi Enable Microchip API (default: disabled)],
  1971. [ ENABLED_MCAPI=$enableval ],
  1972. [ ENABLED_MCAPI=no ]
  1973. )
  1974. if test "$ENABLED_MCAPI" = "yes"
  1975. then
  1976. AM_CFLAGS="$AM_CFLAGS -DHAVE_MCAPI -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"
  1977. fi
  1978. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_SHA512" = "no"
  1979. then
  1980. AC_MSG_ERROR([please enable sha512 if enabling mcapi.])
  1981. fi
  1982. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_ECC" = "no"
  1983. then
  1984. AC_MSG_ERROR([please enable ecc if enabling mcapi.])
  1985. fi
  1986. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_LIBZ" = "no"
  1987. then
  1988. AC_MSG_ERROR([please use --with-libz if enabling mcapi.])
  1989. fi
  1990. AM_CONDITIONAL([BUILD_MCAPI], [test "x$ENABLED_MCAPI" = "xyes"])
  1991. # Check for build-type conflicts
  1992. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  1993. test "x$ENABLED_LEANPSK" = "xyes"],
  1994. [AC_MSG_ERROR([Cannot use Max Strength and Lean PSK at the same time.])])
  1995. # Update CFLAGS based on options
  1996. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes"],
  1997. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAX_STRENGTH"])
  1998. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  1999. test "x$ENABLED_OLD_TLS" = "xyes"],
  2000. [AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  2001. ENABLED_OLD_TLS=no])
  2002. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  2003. test "x$ENABLED_SSLV3" = "xyes"],
  2004. [AC_MSG_ERROR([Cannot use Max Strength and SSLv3 at the same time.])])
  2005. # OPTIMIZE FLAGS
  2006. if test "$GCC" = "yes"
  2007. then
  2008. AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
  2009. if test "$ax_enable_debug" = "no"
  2010. then
  2011. if test "$ENABLED_FASTMATH" = "yes"
  2012. then
  2013. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
  2014. if test "$ENABLED_FASTHUGEMATH" = "yes"
  2015. then
  2016. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  2017. fi
  2018. else
  2019. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
  2020. fi
  2021. fi
  2022. fi
  2023. # ICC command line warning for non supported warning flags
  2024. if test "$CC" = "icc"
  2025. then
  2026. AM_CFLAGS="$AM_CFLAGS -wd10006"
  2027. fi
  2028. # Expose HAVE___UINT128_T to options flags"
  2029. if test "$ac_cv_type___uint128_t" = "yes"
  2030. then
  2031. AM_CFLAGS="$AM_CFLAGS -DHAVE___UINT128_T"
  2032. fi
  2033. LIB_SOCKET_NSL
  2034. AX_HARDEN_CC_COMPILER_FLAGS
  2035. # link to ws2_32 if on mingw
  2036. case $host_os in
  2037. *mingw32)
  2038. LDFLAGS="$LDFLAGS -lws2_32" ;;
  2039. esac
  2040. # add user C_EXTRA_FLAGS back
  2041. CFLAGS="$CFLAGS $USER_C_EXTRA_FLAGS"
  2042. OPTION_FLAGS="$USER_CFLAGS $USER_C_EXTRA_FLAGS $AM_CFLAGS"
  2043. CREATE_HEX_VERSION
  2044. AC_SUBST([AM_CPPFLAGS])
  2045. AC_SUBST([AM_CFLAGS])
  2046. AC_SUBST([AM_LDFLAGS])
  2047. AC_SUBST([LIB_ADD])
  2048. AC_SUBST([LIB_STATIC_ADD])
  2049. # FINAL
  2050. AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
  2051. AC_CONFIG_FILES([Makefile])
  2052. AC_CONFIG_FILES([wolfssl/version.h])
  2053. AC_CONFIG_FILES([wolfssl/options.h])
  2054. #have options.h and version.h for autoconf fips tag and build
  2055. #if test "x$ENABLED_FIPS" = "xyes"
  2056. #then
  2057. # AC_CONFIG_FILES([cyassl/version.h])
  2058. # AC_CONFIG_FILES([cyassl/options.h])
  2059. #fi
  2060. AC_CONFIG_FILES([support/wolfssl.pc])
  2061. AC_CONFIG_FILES([rpm/spec])
  2062. AX_CREATE_GENERIC_CONFIG
  2063. AX_AM_JOBSERVER([yes])
  2064. AC_OUTPUT
  2065. # force make clean
  2066. echo "---"
  2067. echo "Running make clean..."
  2068. make clean >/dev/null 2>&1
  2069. # generate user options header
  2070. echo "---"
  2071. echo "Generating user options header..."
  2072. OPTION_FILE="wolfssl/options.h"
  2073. #if
  2074. #OPTION_FILE+="cyassl/options.h"
  2075. #fi
  2076. rm -f $OPTION_FILE
  2077. echo "/* wolfssl options.h" > $OPTION_FILE
  2078. echo " * generated from configure options" >> $OPTION_FILE
  2079. echo " *" >> $OPTION_FILE
  2080. echo " * Copyright (C) 2006-2015 wolfSSL Inc." >> $OPTION_FILE
  2081. echo " *" >> $OPTION_FILE
  2082. echo " * This file is part of wolfSSL. (formerly known as CyaSSL)" >> $OPTION_FILE
  2083. echo " *" >> $OPTION_FILE
  2084. echo " */" >> $OPTION_FILE
  2085. echo "" >> $OPTION_FILE
  2086. echo "#pragma once" >> $OPTION_FILE
  2087. echo "" >> $OPTION_FILE
  2088. echo "#ifdef __cplusplus" >> $OPTION_FILE
  2089. echo "extern \"C\" {" >> $OPTION_FILE
  2090. echo "#endif" >> $OPTION_FILE
  2091. echo "" >> $OPTION_FILE
  2092. for option in $OPTION_FLAGS; do
  2093. defonly=`echo $option | sed 's/-D//'`
  2094. if test "$defonly" != "$option"
  2095. then
  2096. noequalsign=`echo $defonly | sed 's/=/ /'`
  2097. if test "$noequalsign" = "NDEBUG" || test "$noequalsign" = "DEBUG"
  2098. then
  2099. echo "not outputing (N)DEBUG to $OPTION_FILE"
  2100. continue
  2101. fi
  2102. # allow user to igonore system options
  2103. ignoresys=no
  2104. if [[[ $noequalsign == _* ]]] ;
  2105. then
  2106. ignoresys=yes
  2107. echo "#ifndef WOLFSSL_OPTIONS_IGNORE_SYS" >> $OPTION_FILE
  2108. fi
  2109. noarg=`echo $defonly | sed 's/=.*//'`
  2110. echo "#undef $noarg" >> $OPTION_FILE
  2111. echo "#define $noequalsign" >> $OPTION_FILE
  2112. if test "$ignoresys" = "yes"
  2113. then
  2114. echo "#endif" >> $OPTION_FILE
  2115. fi
  2116. echo "" >> $OPTION_FILE
  2117. else
  2118. echo "option w/o begin -D is $option, not saving to $OPTION_FILE"
  2119. fi
  2120. done
  2121. echo "" >> $OPTION_FILE
  2122. echo "#ifdef __cplusplus" >> $OPTION_FILE
  2123. echo "}" >> $OPTION_FILE
  2124. echo "#endif" >> $OPTION_FILE
  2125. echo "" >> $OPTION_FILE
  2126. echo
  2127. #backwards compatability for those who have included options or version
  2128. touch cyassl/options.h
  2129. echo "/* cyassl options.h" > cyassl/options.h
  2130. echo " * generated from wolfssl/options.h" >> cyassl/options.h
  2131. echo " */" >> cyassl/options.h
  2132. echo ""
  2133. while read -r line
  2134. do
  2135. echo "$line" >> cyassl/options.h
  2136. done < $OPTION_FILE
  2137. # output config summary
  2138. echo "---"
  2139. echo "Configuration summary for $PACKAGE_NAME version $VERSION"
  2140. echo ""
  2141. echo " * Installation prefix: $prefix"
  2142. echo " * System type: $host_vendor-$host_os"
  2143. echo " * Host CPU: $host_cpu"
  2144. echo " * C Compiler: $CC"
  2145. echo " * C Flags: $CFLAGS"
  2146. echo " * C++ Compiler: $CXX"
  2147. echo " * C++ Flags: $CXXFLAGS"
  2148. echo " * CPP Flags: $CPPFLAGS"
  2149. echo " * LIB Flags: $LIB"
  2150. echo " * Debug enabled: $ax_enable_debug"
  2151. echo " * Warnings as failure: $ac_cv_warnings_as_errors"
  2152. echo " * make -j: $enable_jobserver"
  2153. echo " * VCS checkout: $ac_cv_vcs_checkout"
  2154. echo
  2155. echo " Features "
  2156. echo " * Single threaded: $ENABLED_SINGLETHREADED"
  2157. echo " * Filesystem: $ENABLED_FILESYSTEM"
  2158. echo " * OpenSSH Build: $ENABLED_OPENSSH"
  2159. echo " * OpenSSL Extra API: $ENABLED_OPENSSLEXTRA"
  2160. echo " * Max Strength Build: $ENABLED_MAXSTRENGTH"
  2161. echo " * fastmath: $ENABLED_FASTMATH"
  2162. echo " * sniffer: $ENABLED_SNIFFER"
  2163. echo " * snifftest: $ENABLED_SNIFFTEST"
  2164. echo " * ARC4: $ENABLED_ARC4"
  2165. echo " * AES: $ENABLED_AES"
  2166. echo " * AES-NI: $ENABLED_AESNI"
  2167. echo " * AES-GCM: $ENABLED_AESGCM"
  2168. echo " * AES-CCM: $ENABLED_AESCCM"
  2169. echo " * DES3: $ENABLED_DES3"
  2170. echo " * IDEA: $ENABLED_IDEA"
  2171. echo " * Camellia: $ENABLED_CAMELLIA"
  2172. echo " * NULL Cipher: $ENABLED_NULL_CIPHER"
  2173. echo " * MD5: $ENABLED_MD5"
  2174. echo " * RIPEMD: $ENABLED_RIPEMD"
  2175. echo " * SHA: $ENABLED_SHA"
  2176. echo " * SHA-512: $ENABLED_SHA512"
  2177. echo " * BLAKE2: $ENABLED_BLAKE2"
  2178. echo " * keygen: $ENABLED_KEYGEN"
  2179. echo " * certgen: $ENABLED_CERTGEN"
  2180. echo " * certreq: $ENABLED_CERTREQ"
  2181. echo " * certext: $ENABLED_CERTEXT"
  2182. echo " * HC-128: $ENABLED_HC128"
  2183. echo " * RABBIT: $ENABLED_RABBIT"
  2184. echo " * CHACHA: $ENABLED_CHACHA"
  2185. echo " * Hash DRBG: $ENABLED_HASHDRBG"
  2186. echo " * PWDBASED: $ENABLED_PWDBASED"
  2187. echo " * wolfCrypt Only: $ENABLED_CRYPTONLY"
  2188. echo " * HKDF: $ENABLED_HKDF"
  2189. echo " * MD4: $ENABLED_MD4"
  2190. echo " * PSK: $ENABLED_PSK"
  2191. echo " * Poly1305: $ENABLED_POLY1305"
  2192. echo " * LEANPSK: $ENABLED_LEANPSK"
  2193. echo " * RSA: $ENABLED_RSA"
  2194. echo " * DSA: $ENABLED_DSA"
  2195. echo " * DH: $ENABLED_DH"
  2196. echo " * ECC: $ENABLED_ECC"
  2197. echo " * CURVE25519: $ENABLED_CURVE25519"
  2198. echo " * ED25519: $ENABLED_ED25519"
  2199. echo " * FPECC: $ENABLED_FPECC"
  2200. echo " * ECC_ENCRYPT: $ENABLED_ECC_ENCRYPT"
  2201. echo " * ASN: $ENABLED_ASN"
  2202. echo " * Anonymous cipher: $ENABLED_ANON"
  2203. echo " * CODING: $ENABLED_CODING"
  2204. echo " * MEMORY: $ENABLED_MEMORY"
  2205. echo " * I/O POOL: $ENABLED_IOPOOL"
  2206. echo " * LIGHTY: $ENABLED_LIGHTY"
  2207. echo " * STUNNEL: $ENABLED_STUNNEL"
  2208. echo " * ERROR_STRINGS: $ENABLED_ERROR_STRINGS"
  2209. echo " * DTLS: $ENABLED_DTLS"
  2210. echo " * Old TLS Versions: $ENABLED_OLD_TLS"
  2211. echo " * SSL version 3.0: $ENABLED_SSLV3"
  2212. echo " * OCSP: $ENABLED_OCSP"
  2213. echo " * CRL: $ENABLED_CRL"
  2214. echo " * CRL-MONITOR: $ENABLED_CRL_MONITOR"
  2215. echo " * Persistent session cache: $ENABLED_SAVESESSION"
  2216. echo " * Persistent cert cache: $ENABLED_SAVECERT"
  2217. echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
  2218. echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
  2219. echo " * NTRU: $ENABLED_NTRU"
  2220. echo " * SNI: $ENABLED_SNI"
  2221. echo " * ALPN: $ENABLED_ALPN"
  2222. echo " * Maximum Fragment Length: $ENABLED_MAX_FRAGMENT"
  2223. echo " * Truncated HMAC: $ENABLED_TRUNCATED_HMAC"
  2224. echo " * Renegotiation Indication: $ENABLED_RENEGOTIATION_INDICATION"
  2225. echo " * Secure Renegotiation: $ENABLED_SECURE_RENEGOTIATION"
  2226. echo " * Supported Elliptic Curves: $ENABLED_SUPPORTED_CURVES"
  2227. echo " * Session Ticket: $ENABLED_SESSION_TICKET"
  2228. echo " * All TLS Extensions: $ENABLED_TLSX"
  2229. echo " * PKCS#7 $ENABLED_PKCS7"
  2230. echo " * wolfSCEP $ENABLED_WOLFSCEP"
  2231. echo " * Secure Remote Password $ENABLED_SRP"
  2232. echo " * Small Stack: $ENABLED_SMALL_STACK"
  2233. echo " * valgrind unit tests: $ENABLED_VALGRIND"
  2234. echo " * LIBZ: $ENABLED_LIBZ"
  2235. echo " * Examples: $ENABLED_EXAMPLES"
  2236. echo " * User Crypto: $ENABLED_USER_CRYPTO"
  2237. echo " * Fast RSA: $ENABLED_FAST_RSA"
  2238. echo ""
  2239. echo "---"