1
0

configure.ac 61 KB

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