configure.ac 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841
  1. # configure.ac
  2. #
  3. # Copyright (C) 2006-2014 wolfSSL Inc.
  4. #
  5. # This file is part of CyaSSL.
  6. #
  7. #
  8. AC_INIT([cyassl],[3.0.3],[https://github.com/cyassl/cyassl/issues],[cyassl],[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. CYASSL_LIBRARY_VERSION=5:5: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([CYASSL_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_CYASSL"
  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 CyaSSL 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 CyaSSL DTLS (default: disabled)],
  118. [ ENABLED_DTLS=$enableval ],
  119. [ ENABLED_DTLS=no ]
  120. )
  121. if test "$ENABLED_DTLS" = "yes"
  122. then
  123. AM_CFLAGS="-DCYASSL_DTLS $AM_CFLAGS"
  124. fi
  125. # OPENSSL Extra Compatibility
  126. AC_ARG_ENABLE([opensslextra],
  127. [ --enable-opensslextra Enable extra OpenSSL API, size+ (default: disabled)],
  128. [ ENABLED_OPENSSLEXTRA=$enableval ],
  129. [ ENABLED_OPENSSLEXTRA=no ]
  130. )
  131. if test "$ENABLED_OPENSSLEXTRA" = "yes"
  132. then
  133. AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
  134. fi
  135. if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "$ENABLED_SMALL" = "yes"
  136. then
  137. AC_MSG_ERROR([cannot enable small and opensslextra, only one or the other.])
  138. fi
  139. # IPv6 Test Apps
  140. AC_ARG_ENABLE([ipv6],
  141. [ --enable-ipv6 Enable testing of IPV6 (default: disabled)],
  142. [ ENABLED_IPV6=$enableval ],
  143. [ ENABLED_IPV6=no ]
  144. )
  145. if test "$ENABLED_IPV6" = "yes"
  146. then
  147. AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6"
  148. fi
  149. # Fortress build
  150. AC_ARG_ENABLE([fortress],
  151. [ --enable-fortress Enable SSL fortress build (default: disabled)],
  152. [ ENABLED_FORTRESS=$enableval ],
  153. [ ENABLED_FORTRESS=no ]
  154. )
  155. if test "$ENABLED_FORTRESS" = "yes"
  156. then
  157. AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DCYASSL_ALWAYS_VERIFY_CB -DOPENSSL_EXTRA -DCYASSL_DES_ECB -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT -DCYASSL_DER_LOAD -DCYASSL_SHA512 -DCYASSL_SHA384 -DCYASSL_KEY_GEN"
  158. fi
  159. # ssl bump build
  160. AC_ARG_ENABLE([bump],
  161. [ --enable-bump Enable SSL Bump build (default: disabled)],
  162. [ ENABLED_BUMP=$enableval ],
  163. [ ENABLED_BUMP=no ]
  164. )
  165. if test "$ENABLED_BUMP" = "yes"
  166. then
  167. AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DCYASSL_CERT_GEN -DCYASSL_KEY_GEN -DHUGE_SESSION_CACHE -DOPENSSL_EXTRA -DFP_MAX_BITS=8192 -DCYASSL_DER_LOAD -DCYASSL_ALT_NAMES -DCYASSL_TEST_CERT"
  168. fi
  169. ENABLED_SLOWMATH="yes"
  170. # lean psk build
  171. AC_ARG_ENABLE([leanpsk],
  172. [ --enable-leanpsk Enable Lean PSK build (default: disabled)],
  173. [ ENABLED_LEANPSK=$enableval ],
  174. [ ENABLED_LEANPSK=no ]
  175. )
  176. if test "$ENABLED_LEANPSK" = "yes"
  177. then
  178. AM_CFLAGS="$AM_CFLAGS -DCYASSL_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 -DCYASSL_USER_IO -DNO_SHA -DUSE_SLOW_SHA"
  179. ENABLED_SLOWMATH="no"
  180. ENABLED_SINGLETHREADED="yes"
  181. fi
  182. AM_CONDITIONAL([BUILD_LEANPSK], [test "x$ENABLED_LEANPSK" = "xyes"])
  183. # big cache
  184. AC_ARG_ENABLE([bigcache],
  185. [ --enable-bigcache Enable big session cache (default: disabled)],
  186. [ ENABLED_BIGCACHE=$enableval ],
  187. [ ENABLED_BIGCACHE=no ]
  188. )
  189. if test "$ENABLED_BIGCACHE" = "yes"
  190. then
  191. AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
  192. fi
  193. # HUGE cache
  194. AC_ARG_ENABLE([hugecache],
  195. [ --enable-hugecache Enable huge session cache (default: disabled)],
  196. [ ENABLED_HUGECACHE=$enableval ],
  197. [ ENABLED_HUGECACHE=no ]
  198. )
  199. if test "$ENABLED_HUGECACHE" = "yes"
  200. then
  201. AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
  202. fi
  203. # SMALL cache
  204. AC_ARG_ENABLE([smallcache],
  205. [ --enable-smallcache Enable small session cache (default: disabled)],
  206. [ ENABLED_SMALLCACHE=$enableval ],
  207. [ ENABLED_SMALLCACHE=no ]
  208. )
  209. if test "$ENABLED_SMALLCACHE" = "yes"
  210. then
  211. AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
  212. fi
  213. # Persistent session cache
  214. AC_ARG_ENABLE([savesession],
  215. [ --enable-savesession Enable persistent session cache (default: disabled)],
  216. [ ENABLED_SAVESESSION=$enableval ],
  217. [ ENABLED_SAVESESSION=no ]
  218. )
  219. if test "$ENABLED_SAVESESSION" = "yes"
  220. then
  221. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  222. fi
  223. # Persistent cert cache
  224. AC_ARG_ENABLE([savecert],
  225. [ --enable-savecert Enable persistent cert cache (default: disabled)],
  226. [ ENABLED_SAVECERT=$enableval ],
  227. [ ENABLED_SAVECERT=no ]
  228. )
  229. if test "$ENABLED_SAVECERT" = "yes"
  230. then
  231. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  232. fi
  233. # Atomic User Record Layer
  234. AC_ARG_ENABLE([atomicuser],
  235. [ --enable-atomicuser Enable Atomic User Record Layer (default: disabled)],
  236. [ ENABLED_ATOMICUSER=$enableval ],
  237. [ ENABLED_ATOMICUSER=no ]
  238. )
  239. if test "$ENABLED_ATOMICUSER" = "yes"
  240. then
  241. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  242. fi
  243. # Public Key Callbacks
  244. AC_ARG_ENABLE([pkcallbacks],
  245. [ --enable-pkcallbacks Enable Public Key Callbacks (default: disabled)],
  246. [ ENABLED_PKCALLBACKS=$enableval ],
  247. [ ENABLED_PKCALLBACKS=no ]
  248. )
  249. if test "$ENABLED_PKCALLBACKS" = "yes"
  250. then
  251. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  252. fi
  253. # SNIFFER
  254. ENABLED_SNIFFTEST=no
  255. AC_ARG_ENABLE([sniffer],
  256. [AS_HELP_STRING([--enable-sniffer],[ Enable CyaSSL sniffer support (default: disabled) ])],[
  257. ENABLED_SNIFFER=yes
  258. AM_CFLAGS="$AM_CFLAGS -DCYASSL_SNIFFER -DOPENSSL_EXTRA"
  259. AS_IF([ test "x$enableval" = "xyes" ],[ AC_CHECK_HEADERS([pcap/pcap.h],[
  260. ENABLED_SNIFFTEST=yes
  261. ],[ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]) ])
  262. ],[
  263. ENABLED_SNIFFER=no
  264. ])
  265. AM_CONDITIONAL([BUILD_SNIFFER], [ test "x$ENABLED_SNIFFER" = "xyes" ])
  266. AM_CONDITIONAL([BUILD_SNIFFTEST], [ test "x$ENABLED_SNIFFTEST" = "xyes" ])
  267. # AES-GCM
  268. AC_ARG_ENABLE([aesgcm],
  269. [ --enable-aesgcm Enable CyaSSL AES-GCM support (default: disabled)],
  270. [ ENABLED_AESGCM=$enableval ],
  271. [ ENABLED_AESGCM=no ]
  272. )
  273. if test "$ENABLED_AESGCM" = "word32"
  274. then
  275. AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
  276. ENABLED_AESGCM=yes
  277. fi
  278. if test "$ENABLED_AESGCM" = "small"
  279. then
  280. AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
  281. ENABLED_AESGCM=yes
  282. fi
  283. if test "$ENABLED_AESGCM" = "table"
  284. then
  285. AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
  286. ENABLED_AESGCM=yes
  287. fi
  288. if test "$ENABLED_AESGCM" = "yes"
  289. then
  290. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"
  291. fi
  292. AM_CONDITIONAL([BUILD_AESGCM], [test "x$ENABLED_AESGCM" = "xyes"])
  293. # AES-CCM
  294. AC_ARG_ENABLE([aesccm],
  295. [ --enable-aesccm Enable CyaSSL AES-CCM support (default: disabled)],
  296. [ ENABLED_AESCCM=$enableval ],
  297. [ ENABLED_AESCCM=no ]
  298. )
  299. if test "$ENABLED_AESCCM" = "yes"
  300. then
  301. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"
  302. fi
  303. AM_CONDITIONAL([BUILD_AESCCM], [test "x$ENABLED_AESCCM" = "xyes"])
  304. # AES-NI
  305. AC_ARG_ENABLE([aesni],
  306. [ --enable-aesni Enable CyaSSL AES-NI support (default: disabled)],
  307. [ ENABLED_AESNI=$enableval ],
  308. [ ENABLED_AESNI=no ]
  309. )
  310. if test "$ENABLED_AESNI" = "yes"
  311. then
  312. AM_CFLAGS="$AM_CFLAGS -DCYASSL_AESNI"
  313. if test "$GCC" = "yes"
  314. then
  315. # GCC needs these flags, icc doesn't
  316. # opt levels greater than 2 may cause problems on systems w/o aesni
  317. if test "$CC" != "icc"
  318. then
  319. AM_CFLAGS="$AM_CFLAGS -maes -msse4"
  320. fi
  321. fi
  322. fi
  323. AM_CONDITIONAL([BUILD_AESNI], [test "x$ENABLED_AESNI" = "xyes"])
  324. # Camellia
  325. AC_ARG_ENABLE([camellia],
  326. [ --enable-camellia Enable CyaSSL Camellia support (default: disabled)],
  327. [ ENABLED_CAMELLIA=$enableval ],
  328. [ ENABLED_CAMELLIA=no ]
  329. )
  330. if test "$ENABLED_CAMELLIA" = "yes"
  331. then
  332. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAMELLIA"
  333. fi
  334. AM_CONDITIONAL([BUILD_CAMELLIA], [test "x$ENABLED_CAMELLIA" = "xyes"])
  335. # MD2
  336. AC_ARG_ENABLE([md2],
  337. [ --enable-md2 Enable CyaSSL MD2 support (default: disabled)],
  338. [ ENABLED_MD2=$enableval ],
  339. [ ENABLED_MD2=no ]
  340. )
  341. if test "$ENABLED_BUMP" = "yes"
  342. then
  343. ENABLED_MD2="yes"
  344. fi
  345. if test "$ENABLED_MD2" = "yes"
  346. then
  347. AM_CFLAGS="$AM_CFLAGS -DCYASSL_MD2"
  348. fi
  349. AM_CONDITIONAL([BUILD_MD2], [test "x$ENABLED_MD2" = "xyes"])
  350. # NULL CIPHER
  351. AC_ARG_ENABLE([nullcipher],
  352. [ --enable-nullcipher Enable CyaSSL NULL cipher support (default: disabled)],
  353. [ ENABLED_NULL_CIPHER=$enableval ],
  354. [ ENABLED_NULL_CIPHER=no ]
  355. )
  356. if test "$ENABLED_NULL_CIPHER" = "yes"
  357. then
  358. AM_CFLAGS="$AM_CFLAGS -DHAVE_NULL_CIPHER"
  359. fi
  360. # RIPEMD
  361. AC_ARG_ENABLE([ripemd],
  362. [ --enable-ripemd Enable CyaSSL RIPEMD-160 support (default: disabled)],
  363. [ ENABLED_RIPEMD=$enableval ],
  364. [ ENABLED_RIPEMD=no ]
  365. )
  366. if test "$ENABLED_RIPEMD" = "yes"
  367. then
  368. AM_CFLAGS="$AM_CFLAGS -DCYASSL_RIPEMD"
  369. fi
  370. AM_CONDITIONAL([BUILD_RIPEMD], [test "x$ENABLED_RIPEMD" = "xyes"])
  371. # BLAKE2
  372. AC_ARG_ENABLE([blake2],
  373. [ --enable-blake2 Enable CyaSSL BLAKE2 support (default: disabled)],
  374. [ ENABLED_BLAKE2=$enableval ],
  375. [ ENABLED_BLAKE2=no ]
  376. )
  377. if test "$ENABLED_BLAKE2" = "yes"
  378. then
  379. AM_CFLAGS="$AM_CFLAGS -DHAVE_BLAKE2"
  380. fi
  381. AM_CONDITIONAL([BUILD_BLAKE2], [test "x$ENABLED_BLAKE2" = "xyes"])
  382. # SHA512
  383. AC_ARG_ENABLE([sha512],
  384. [ --enable-sha512 Enable CyaSSL SHA-512 support (default: disabled)],
  385. [ ENABLED_SHA512=$enableval ],
  386. [ ENABLED_SHA512=no ]
  387. )
  388. if test "$ENABLED_SHA512" = "yes"
  389. then
  390. AM_CFLAGS="$AM_CFLAGS -DCYASSL_SHA512 -DCYASSL_SHA384"
  391. fi
  392. if test "$ENABLED_FORTRESS" = "yes"
  393. then
  394. ENABLED_SHA512="yes"
  395. fi
  396. AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
  397. # SESSION CERTS
  398. AC_ARG_ENABLE([sessioncerts],
  399. [ --enable-sessioncerts Enable session cert storing (default: disabled)],
  400. [ ENABLED_SESSIONCERTS=$enableval ],
  401. [ ENABLED_SESSIONCERTS=no ]
  402. )
  403. if test "$ENABLED_SESSIONCERTS" = "yes"
  404. then
  405. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  406. fi
  407. # KEY GENERATION
  408. AC_ARG_ENABLE([keygen],
  409. [ --enable-keygen Enable key generation (default: disabled)],
  410. [ ENABLED_KEYGEN=$enableval ],
  411. [ ENABLED_KEYGEN=no ]
  412. )
  413. if test "$ENABLED_KEYGEN" = "yes"
  414. then
  415. AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN"
  416. fi
  417. # CERT GENERATION
  418. AC_ARG_ENABLE([certgen],
  419. [ --enable-certgen Enable cert generation (default: disabled)],
  420. [ ENABLED_CERTGEN=$enableval ],
  421. [ ENABLED_CERTGEN=no ]
  422. )
  423. if test "$ENABLED_CERTGEN" = "yes"
  424. then
  425. AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
  426. fi
  427. # CERT REQUEST GENERATION
  428. AC_ARG_ENABLE([certreq],
  429. [ --enable-certreq Enable cert request generation (default: disabled)],
  430. [ ENABLED_CERTREQ=$enableval ],
  431. [ ENABLED_CERTREQ=no ]
  432. )
  433. if test "$ENABLED_CERTREQ" = "yes"
  434. then
  435. if test "$ENABLED_CERTGEN" = "no"
  436. then
  437. AC_MSG_ERROR([cannot enable certreq without enabling certgen.])
  438. fi
  439. AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_REQ"
  440. fi
  441. # SEP
  442. AC_ARG_ENABLE([sep],
  443. [ --enable-sep Enable sep extensions (default: disabled)],
  444. [ ENABLED_SEP=$enableval ],
  445. [ ENABLED_SEP=no ]
  446. )
  447. if test "$ENABLED_SEP" = "yes"
  448. then
  449. AM_CFLAGS="-DCYASSL_SEP -DKEEP_PEER_CERT $AM_CFLAGS"
  450. fi
  451. # HKDF
  452. AC_ARG_ENABLE([hkdf],
  453. [ --enable-hkdf Enable HKDF (HMAC-KDF) support (default: disabled)],
  454. [ ENABLED_HKDF=$enableval ],
  455. [ ENABLED_HKDF=no ]
  456. )
  457. if test "$ENABLED_HKDF" = "yes"
  458. then
  459. AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"
  460. fi
  461. # DSA
  462. AC_ARG_ENABLE([dsa],
  463. [ --enable-dsa Enable DSA (default: disabled)],
  464. [ ENABLED_DSA=$enableval ],
  465. [ ENABLED_DSA=no ]
  466. )
  467. if test "$ENABLED_DSA" = "no"
  468. then
  469. AM_CFLAGS="$AM_CFLAGS -DNO_DSA"
  470. fi
  471. AM_CONDITIONAL([BUILD_DSA], [test "x$ENABLED_DSA" = "xyes"])
  472. # ECC
  473. AC_ARG_ENABLE([ecc],
  474. [ --enable-ecc Enable ECC (default: disabled)],
  475. [ ENABLED_ECC=$enableval ],
  476. [ ENABLED_ECC=no ]
  477. )
  478. if test "$ENABLED_ECC" = "yes"
  479. then
  480. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR"
  481. fi
  482. AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
  483. if test "$ENABLED_ECC" = "yes" && test "$ENABLED_SMALL" = "yes"
  484. then
  485. AC_MSG_ERROR([cannot enable ecc and small, ecc requires TLS which small turns off.])
  486. fi
  487. # FP ECC, Fixed Point cache ECC
  488. AC_ARG_ENABLE([fpecc],
  489. [ --enable-fpecc Enable Fixed Point cache ECC (default: disabled)],
  490. [ ENABLED_FPECC=$enableval ],
  491. [ ENABLED_FPECC=no ]
  492. )
  493. if test "$ENABLED_FPECC" = "yes"
  494. then
  495. if test "$ENABLED_ECC" = "no"
  496. then
  497. AC_MSG_ERROR([cannot enable fpecc without enabling ecc.])
  498. fi
  499. AM_CFLAGS="$AM_CFLAGS -DFP_ECC"
  500. fi
  501. # ECC encrypt
  502. AC_ARG_ENABLE([eccencrypt],
  503. [ --enable-eccencrypt Enable ECC encrypt (default: disabled)],
  504. [ ENABLED_ECC_ENCRYPT=$enableval ],
  505. [ ENABLED_ECC_ENCRYPT=no ]
  506. )
  507. if test "$ENABLED_ECC_ENCRYPT" = "yes"
  508. then
  509. if test "$ENABLED_ECC" = "no"
  510. then
  511. AC_MSG_ERROR([cannot enable eccencrypt without enabling ecc.])
  512. fi
  513. if test "$ENABLED_HKDF" = "no"
  514. then
  515. AC_MSG_ERROR([cannot enable eccencrypt without enabling hkdf.])
  516. fi
  517. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_ENCRYPT"
  518. fi
  519. # PSK
  520. AC_ARG_ENABLE([psk],
  521. [ --enable-psk Enable PSK (default: disabled)],
  522. [ ENABLED_PSK=$enableval ],
  523. [ ENABLED_PSK=no ]
  524. )
  525. if test "$ENABLED_PSK" = "no" && test "$ENABLED_LEANPSK" = "no"
  526. then
  527. AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
  528. fi
  529. if test "$ENABLED_PSK" = "no" && test "$ENABLED_LEANPSK" = "yes"
  530. then
  531. ENABLED_PSK=yes
  532. fi
  533. # ERROR STRINGS
  534. AC_ARG_ENABLE([errorstrings],
  535. [ --enable-errorstrings Enable error strings table (default: enabled)],
  536. [ ENABLED_ERROR_STRINGS=$enableval ],
  537. [ ENABLED_ERROR_STRINGS=yes ]
  538. )
  539. if test "$ENABLED_ERROR_STRINGS" = "no"
  540. then
  541. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  542. else
  543. # turn off error strings if leanpsk on
  544. if test "$ENABLED_LEANPSK" = "yes"
  545. then
  546. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  547. ENABLED_ERROR_STRINGS=no
  548. fi
  549. fi
  550. # OLD TLS
  551. AC_ARG_ENABLE([oldtls],
  552. [ --enable-oldtls Enable old TLS versions < 1.2 (default: enabled)],
  553. [ ENABLED_OLD_TLS=$enableval ],
  554. [ ENABLED_OLD_TLS=yes ]
  555. )
  556. if test "$ENABLED_OLD_TLS" = "no"
  557. then
  558. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  559. else
  560. # turn off old if leanpsk on
  561. if test "$ENABLED_LEANPSK" = "yes"
  562. then
  563. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  564. ENABLED_OLD_TLS=no
  565. fi
  566. fi
  567. # STACK SIZE info for examples
  568. AC_ARG_ENABLE([stacksize],
  569. [ --enable-stacksize Enable stack size info on examples (default: disabled)],
  570. [ ENABLED_STACKSIZE=$enableval ],
  571. [ ENABLED_STACKSIZE=no ]
  572. )
  573. if test "$ENABLED_STACKSIZE" = "yes"
  574. then
  575. AC_CHECK_FUNC([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
  576. AC_CHECK_FUNC([pthread_attr_setstack], [], AC_CHECK_LIB([pthread],[pthread_attr_setstack]))
  577. AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE -DCYASSL_LOW_MEMORY"
  578. fi
  579. # MEMORY
  580. AC_ARG_ENABLE([memory],
  581. [ --enable-memory Enable memory callbacks (default: enabled)],
  582. [ ENABLED_MEMORY=$enableval ],
  583. [ ENABLED_MEMORY=yes ]
  584. )
  585. if test "$ENABLED_MEMORY" = "no"
  586. then
  587. AM_CFLAGS="$AM_CFLAGS -DNO_CYASSL_MEMORY"
  588. else
  589. # turn off memory cb if leanpsk on
  590. if test "$ENABLED_LEANPSK" = "yes"
  591. then
  592. # but don't turn on NO_CYASSL_MEMORY because using own
  593. ENABLED_MEMORY=no
  594. fi
  595. fi
  596. AM_CONDITIONAL([BUILD_MEMORY], [test "x$ENABLED_MEMORY" = "xyes"])
  597. # RSA
  598. AC_ARG_ENABLE([rsa],
  599. [ --enable-rsa Enable RSA (default: enabled)],
  600. [ ENABLED_RSA=$enableval ],
  601. [ ENABLED_RSA=yes ]
  602. )
  603. if test "$ENABLED_RSA" = "no"
  604. then
  605. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  606. else
  607. # turn off RSA if leanpsk on
  608. if test "$ENABLED_LEANPSK" = "yes"
  609. then
  610. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  611. ENABLED_RSA=no
  612. fi
  613. fi
  614. AM_CONDITIONAL([BUILD_RSA], [test "x$ENABLED_RSA" = "xyes"])
  615. # DH
  616. AC_ARG_ENABLE([dh],
  617. [ --enable-dh Enable DH (default: enabled)],
  618. [ ENABLED_DH=$enableval ],
  619. [ ENABLED_DH=yes ]
  620. )
  621. if test "$ENABLED_DH" = "no"
  622. then
  623. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  624. else
  625. # turn off DH if leanpsk on
  626. if test "$ENABLED_LEANPSK" = "yes"
  627. then
  628. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  629. ENABLED_DH=no
  630. fi
  631. fi
  632. AM_CONDITIONAL([BUILD_DH], [test "x$ENABLED_DH" = "xyes"])
  633. # ASN
  634. # turn off asn, which means no certs, no rsa, no dh, no dsa, no ecc,
  635. # and no big int, use this to disable all public key stuff
  636. AC_ARG_ENABLE([asn],
  637. [ --enable-asn Enable ASN (default: enabled)],
  638. [ ENABLED_ASN=$enableval ],
  639. [ ENABLED_ASN=yes ]
  640. )
  641. if test "$ENABLED_ASN" = "no"
  642. then
  643. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_CERTS -DNO_BIG_INT"
  644. else
  645. # turn off ASN if leanpsk on
  646. if test "$ENABLED_LEANPSK" = "yes"
  647. then
  648. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_CERTS -DNO_BIG_INT"
  649. ENABLED_ASN=no
  650. fi
  651. fi
  652. if test "$ENABLED_RSA" = "yes" && test "$ENABLED_ASN" = "no"
  653. then
  654. AC_MSG_ERROR([please disable rsa if disabling asn.])
  655. fi
  656. if test "$ENABLED_DSA" = "yes" && test "$ENABLED_ASN" = "no"
  657. then
  658. AC_MSG_ERROR([please disable dsa if disabling asn.])
  659. fi
  660. if test "$ENABLED_DH" = "yes" && test "$ENABLED_ASN" = "no"
  661. then
  662. AC_MSG_ERROR([please disable dh if disabling asn.])
  663. fi
  664. if test "$ENABLED_ECC" = "yes" && test "$ENABLED_ASN" = "no"
  665. then
  666. AC_MSG_ERROR([please disable ecc if disabling asn.])
  667. fi
  668. if test "$ENABLED_PSK" = "no" && test "$ENABLED_ASN" = "no"
  669. then
  670. AC_MSG_ERROR([please enable psk if disabling asn.])
  671. fi
  672. if test "$ENABLED_ASN" = "no"
  673. then
  674. ENABLED_FASTMATH=no
  675. ENABLED_SLOWMATH=no
  676. fi
  677. AM_CONDITIONAL([BUILD_ASN], [test "x$ENABLED_ASN" = "xyes"])
  678. # AES
  679. AC_ARG_ENABLE([aes],
  680. [ --enable-aes Enable AES (default: enabled)],
  681. [ ENABLED_AES=$enableval ],
  682. [ ENABLED_AES=yes ]
  683. )
  684. if test "$ENABLED_AES" = "no"
  685. then
  686. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  687. else
  688. # turn off AES if leanpsk on
  689. if test "$ENABLED_LEANPSK" = "yes"
  690. then
  691. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  692. ENABLED_AES=no
  693. fi
  694. fi
  695. AM_CONDITIONAL([BUILD_AES], [test "x$ENABLED_AES" = "xyes"])
  696. # CODING
  697. AC_ARG_ENABLE([coding],
  698. [ --enable-coding Enable Coding base 16/64 (default: enabled)],
  699. [ ENABLED_CODING=$enableval ],
  700. [ ENABLED_CODING=yes ]
  701. )
  702. if test "$ENABLED_CODING" = "no"
  703. then
  704. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  705. else
  706. # turn off CODING if leanpsk on
  707. if test "$ENABLED_LEANPSK" = "yes"
  708. then
  709. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  710. ENABLED_CODING=no
  711. fi
  712. fi
  713. AM_CONDITIONAL([BUILD_CODING], [test "x$ENABLED_CODING" = "xyes"])
  714. # DES3
  715. AC_ARG_ENABLE([des3],
  716. [ --enable-des3 Enable DES3 (default: enabled)],
  717. [ ENABLED_DES3=$enableval ],
  718. [ ENABLED_DES3=yes ]
  719. )
  720. if test "$ENABLED_DES3" = "no"
  721. then
  722. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  723. else
  724. # turn off DES3 if leanpsk on
  725. if test "$ENABLED_LEANPSK" = "yes"
  726. then
  727. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  728. ENABLED_DES3=no
  729. fi
  730. fi
  731. AM_CONDITIONAL([BUILD_DES3], [test "x$ENABLED_DES3" = "xyes"])
  732. # ARC4
  733. AC_ARG_ENABLE([arc4],
  734. [ --enable-arc4 Enable ARC4 (default: enabled)],
  735. [ ENABLED_ARC4=$enableval ],
  736. [ ENABLED_ARC4=yes ]
  737. )
  738. if test "$ENABLED_ARC4" = "no"
  739. then
  740. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  741. else
  742. # turn off ARC4 if leanpsk on
  743. if test "$ENABLED_LEANPSK" = "yes"
  744. then
  745. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  746. ENABLED_ARC4=no
  747. fi
  748. fi
  749. AM_CONDITIONAL([BUILD_RC4], [test "x$ENABLED_ARC4" = "xyes"])
  750. # MD5
  751. AC_ARG_ENABLE([md5],
  752. [ --enable-md5 Enable MD5 (default: enabled)],
  753. [ ENABLED_MD5=$enableval ],
  754. [ ENABLED_MD5=yes ]
  755. )
  756. if test "$ENABLED_MD5" = "no"
  757. then
  758. AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS"
  759. else
  760. # turn off MD5 if leanpsk on
  761. if test "$ENABLED_LEANPSK" = "yes"
  762. then
  763. AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS"
  764. ENABLED_MD5=no
  765. fi
  766. fi
  767. AM_CONDITIONAL([BUILD_MD5], [test "x$ENABLED_MD5" = "xyes"])
  768. # SHA
  769. AC_ARG_ENABLE([sha],
  770. [ --enable-sha Enable SHA (default: enabled)],
  771. [ ENABLED_SHA=$enableval ],
  772. [ ENABLED_SHA=yes ]
  773. )
  774. if test "$ENABLED_SHA" = "no"
  775. then
  776. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  777. else
  778. # turn off SHA if leanpsk on
  779. if test "$ENABLED_LEANPSK" = "yes"
  780. then
  781. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  782. ENABLED_SHA=no
  783. fi
  784. fi
  785. AM_CONDITIONAL([BUILD_SHA], [test "x$ENABLED_SHA" = "xyes"])
  786. # MD4
  787. AC_ARG_ENABLE([md4],
  788. [ --enable-md4 Enable MD4 (default: disabled)],
  789. [ ENABLED_MD4=$enableval ],
  790. [ ENABLED_MD4=no ]
  791. )
  792. if test "$ENABLED_MD4" = "no"
  793. then
  794. AM_CFLAGS="$AM_CFLAGS -DNO_MD4"
  795. fi
  796. AM_CONDITIONAL([BUILD_MD4], [test "x$ENABLED_MD4" = "xyes"])
  797. # Web Server Build
  798. AC_ARG_ENABLE([webserver],
  799. [ --enable-webserver Enable Web Server (default: disabled)],
  800. [ ENABLED_WEBSERVER=$enableval ],
  801. [ ENABLED_WEBSERVER=no ]
  802. )
  803. if test "$ENABLED_WEBSERVER" = "yes"
  804. then
  805. AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
  806. fi
  807. # PWDBASED
  808. AC_ARG_ENABLE([pwdbased],
  809. [ --enable-pwdbased Enable PWDBASED (default: disabled)],
  810. [ ENABLED_PWDBASED=$enableval ],
  811. [ ENABLED_PWDBASED=no ]
  812. )
  813. if test "$ENABLED_PWDBASED" = "no"
  814. then
  815. if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes"
  816. then
  817. # opensslextra and webserver needs pwdbased
  818. ENABLED_PWDBASED=yes
  819. else
  820. AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
  821. fi
  822. fi
  823. AM_CONDITIONAL([BUILD_PWDBASED], [test "x$ENABLED_PWDBASED" = "xyes"])
  824. # HC128
  825. AC_ARG_ENABLE([hc128],
  826. [ --enable-hc128 Enable HC-128 (default: disabled)],
  827. [ ENABLED_HC128=$enableval ],
  828. [ ENABLED_HC128=no ]
  829. )
  830. if test "$ENABLED_HC128" = "no"
  831. then
  832. AM_CFLAGS="$AM_CFLAGS -DNO_HC128"
  833. else
  834. AM_CFLAGS="$AM_CFLAGS -DHAVE_HC128"
  835. fi
  836. AM_CONDITIONAL([BUILD_HC128], [test "x$ENABLED_HC128" = "xyes"])
  837. # RABBIT
  838. AC_ARG_ENABLE([rabbit],
  839. [ --enable-rabbit Enable RABBIT (default: disabled)],
  840. [ ENABLED_RABBIT=$enableval ],
  841. [ ENABLED_RABBIT=no ]
  842. )
  843. if test "$ENABLED_RABBIT" = "no"
  844. then
  845. AM_CFLAGS="$AM_CFLAGS -DNO_RABBIT"
  846. else
  847. AM_CFLAGS="$AM_CFLAGS -DHAVE_RABBIT"
  848. fi
  849. AM_CONDITIONAL([BUILD_RABBIT], [test "x$ENABLED_RABBIT" = "xyes"])
  850. # FIPS
  851. AC_ARG_ENABLE([fips],
  852. [ --enable-fips Enable FIPS 140-2 (default: disabled)],
  853. [ ENABLED_FIPS=$enableval ],
  854. [ ENABLED_FIPS=no ]
  855. )
  856. if test "x$ENABLED_FIPS" = "xyes"
  857. then
  858. # requires thread local storage
  859. if test "$thread_ls_on" = "no"
  860. then
  861. AC_MSG_ERROR([FIPS requires Thread Local Storage])
  862. fi
  863. # requires SHA512
  864. if test "x$ENABLED_SHA512" = "xno"
  865. then
  866. ENABLED_SHA512="yes"
  867. AM_CFLAGS="$AM_CFLAGS -DCYASSL_SHA512 -DCYASSL_SHA384"
  868. AM_CONDITIONAL([BUILD_SHA512], [test "x$ENABLED_SHA512" = "xyes"])
  869. fi
  870. AM_CFLAGS="$AM_CFLAGS -DHAVE_FIPS"
  871. fi
  872. AM_CONDITIONAL([BUILD_FIPS], [test "x$ENABLED_FIPS" = "xyes"])
  873. # Hash DRBG
  874. AC_ARG_ENABLE([hashdrbg],
  875. [ --enable-hashdrbg Enable Hash DRBG support (default: disabled)],
  876. [ ENABLED_HASHDRBG=$enableval ],
  877. [ ENABLED_HASHDRBG=no ]
  878. )
  879. if test "x$ENABLED_HASHDRBG" = "xyes"
  880. then
  881. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  882. else
  883. # turn on Hash DRBG if FIPS is on or ARC4 is off
  884. if test "x$ENABLED_FIPS" = "xyes" || test "x$ENABLED_ARC4" = "xno"
  885. then
  886. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  887. ENABLED_HASHDRBG=yes
  888. fi
  889. fi
  890. # Filesystem Build
  891. AC_ARG_ENABLE([filesystem],
  892. [ --enable-filesystem Enable Filesystem support (default: enabled)],
  893. [ ENABLED_FILESYSTEM=$enableval ],
  894. [ ENABLED_FILESYSTEM=yes ]
  895. )
  896. if test "$ENABLED_FILESYSTEM" = "no"
  897. then
  898. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  899. else
  900. # turn off filesystem if leanpsk on
  901. if test "$ENABLED_LEANPSK" = "yes"
  902. then
  903. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  904. ENABLED_FILESYSTEM=no
  905. fi
  906. fi
  907. # inline Build
  908. AC_ARG_ENABLE([inline],
  909. [ --enable-inline Enable inline functions (default: enabled)],
  910. [ ENABLED_INLINE=$enableval ],
  911. [ ENABLED_INLINE=yes ]
  912. )
  913. if test "$ENABLED_INLINE" = "no"
  914. then
  915. AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
  916. fi
  917. AM_CONDITIONAL([BUILD_INLINE], [test "x$ENABLED_INLINE" = "xyes"])
  918. # OCSP
  919. AC_ARG_ENABLE([ocsp],
  920. [ --enable-ocsp Enable OCSP (default: disabled)],
  921. [ ENABLED_OCSP=$enableval ],
  922. [ ENABLED_OCSP=no ],
  923. )
  924. if test "$ENABLED_OCSP" = "yes"
  925. then
  926. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  927. fi
  928. AM_CONDITIONAL([BUILD_OCSP], [test "x$ENABLED_OCSP" = "xyes"])
  929. if test "$ENABLED_OCSP" = "yes"
  930. then
  931. # check openssl command tool for testing ocsp
  932. AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no])
  933. if test "$HAVE_OPENSSL_CMD" = "yes"
  934. then
  935. AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD"
  936. else
  937. AC_MSG_WARN([openssl command line tool not available for testing ocsp])
  938. fi
  939. fi
  940. # CRL
  941. AC_ARG_ENABLE([crl],
  942. [ --enable-crl Enable CRL (default: disabled)],
  943. [ ENABLED_CRL=$enableval ],
  944. [ ENABLED_CRL=no ],
  945. )
  946. if test "$ENABLED_CRL" = "yes"
  947. then
  948. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  949. fi
  950. AM_CONDITIONAL([BUILD_CRL], [test "x$ENABLED_CRL" = "xyes"])
  951. # CRL Monitor
  952. AC_ARG_ENABLE([crl-monitor],
  953. [ --enable-crl-monitor Enable CRL Monitor (default: disabled)],
  954. [ ENABLED_CRL_MONITOR=$enableval ],
  955. [ ENABLED_CRL_MONITOR=no ],
  956. )
  957. if test "$ENABLED_CRL_MONITOR" = "yes"
  958. then
  959. case $host_os in
  960. *linux* | *darwin* | *freebsd*)
  961. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR" ;;
  962. *)
  963. AC_MSG_ERROR([crl monitor only allowed on linux, OS X, or freebsd]) ;;
  964. esac
  965. fi
  966. AM_CONDITIONAL([BUILD_CRL_MONITOR], [test "x$ENABLED_CRL_MONITOR" = "xyes"])
  967. # NTRU
  968. ENABLED_NTRU="no"
  969. tryntrudir=""
  970. AC_ARG_WITH([ntru],
  971. [ --with-ntru=PATH Path to NTRU install (default /usr/) ],
  972. [
  973. AC_MSG_CHECKING([for NTRU])
  974. CPPFLAGS="$CPPFLAGS -DHAVE_NTRU"
  975. LIBS="$LIBS -lNTRUEncrypt"
  976. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ntru_crypto_drbg.h>]], [[ ntru_crypto_drbg_instantiate(0, 0, 0, 0, 0); ]])], [ ntru_linked=yes ],[ ntru_linked=no ])
  977. if test "x$ntru_linked" == "xno" ; then
  978. if test "x$withval" != "xno" ; then
  979. tryntrudir=$withval
  980. fi
  981. if test "x$withval" == "xyes" ; then
  982. tryntrudir="/usr"
  983. fi
  984. LDFLAGS="$AM_LDFLAGS -L$tryntrudir/lib"
  985. CPPFLAGS="$CPPFLAGS -I$tryntrudir/include"
  986. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ntru_crypto_drbg.h>]], [[ ntru_crypto_drbg_instantiate(0, 0, 0, 0, 0); ]])], [ ntru_linked=yes ],[ ntru_linked=no ])
  987. if test "x$ntru_linked" == "xno" ; then
  988. AC_MSG_ERROR([NTRU isn't found.
  989. If it's already installed, specify its path using --with-ntru=/dir/])
  990. fi
  991. AC_MSG_RESULT([yes])
  992. AM_LDFLAGS="$AM_LDFLAGS -L$tryntrudir/lib"
  993. else
  994. AC_MSG_RESULT([yes])
  995. fi
  996. AM_CFLAGS="$AM_CFLAGS -DHAVE_NTRU"
  997. ENABLED_NTRU="yes"
  998. ]
  999. )
  1000. AM_CONDITIONAL([BUILD_NTRU], [test "x$ENABLED_NTRU" = "xyes"])
  1001. if test "$ENABLED_NTRU" = "yes" && test "$ENABLED_SMALL" = "yes"
  1002. then
  1003. AC_MSG_ERROR([cannot enable ntru and small, ntru requires TLS which small turns off.])
  1004. fi
  1005. # SNI
  1006. AC_ARG_ENABLE([sni],
  1007. [ --enable-sni Enable SNI (default: disabled)],
  1008. [ ENABLED_SNI=$enableval ],
  1009. [ ENABLED_SNI=no ]
  1010. )
  1011. if test "x$ENABLED_SNI" = "xyes"
  1012. then
  1013. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  1014. fi
  1015. # Maximum Fragment Length
  1016. AC_ARG_ENABLE([maxfragment],
  1017. [ --enable-maxfragment Enable Maximum Fragment Length (default: disabled)],
  1018. [ ENABLED_MAX_FRAGMENT=$enableval ],
  1019. [ ENABLED_MAX_FRAGMENT=no ]
  1020. )
  1021. if test "x$ENABLED_MAX_FRAGMENT" = "xyes"
  1022. then
  1023. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_MAX_FRAGMENT"
  1024. fi
  1025. # Truncated HMAC
  1026. AC_ARG_ENABLE([truncatedhmac],
  1027. [ --enable-truncatedhmac Enable Truncated HMAC (default: disabled)],
  1028. [ ENABLED_TRUNCATED_HMAC=$enableval ],
  1029. [ ENABLED_TRUNCATED_HMAC=no ]
  1030. )
  1031. if test "x$ENABLED_TRUNCATED_HMAC" = "xyes"
  1032. then
  1033. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_TRUNCATED_HMAC"
  1034. fi
  1035. # Renegotiation Indication
  1036. AC_ARG_ENABLE([renegotiation-indication],
  1037. [ --enable-renegotiation-indication Enable Renegotiation Indication (default: disabled)],
  1038. [ ENABLED_RENEGOTIATION_INDICATION=$enableval ],
  1039. [ ENABLED_RENEGOTIATION_INDICATION=no ]
  1040. )
  1041. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  1042. then
  1043. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_RENEGOTIATION_INDICATION"
  1044. fi
  1045. # Supported Elliptic Curves Extensions
  1046. AC_ARG_ENABLE([supportedcurves],
  1047. [ --enable-supportedcurves Enable Supported Elliptic Curves (default: disabled)],
  1048. [ ENABLED_SUPPORTED_CURVES=$enableval ],
  1049. [ ENABLED_SUPPORTED_CURVES=no ]
  1050. )
  1051. if test "x$ENABLED_SUPPORTED_CURVES" = "xyes"
  1052. then
  1053. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES"
  1054. fi
  1055. # TLS Extensions
  1056. AC_ARG_ENABLE([tlsx],
  1057. [ --enable-tlsx Enable all TLS Extensions (default: disabled)],
  1058. [ ENABLED_TLSX=$enableval ],
  1059. [ ENABLED_TLSX=no ]
  1060. )
  1061. if test "x$ENABLED_TLSX" = "xyes"
  1062. then
  1063. ENABLED_SNI=yes
  1064. ENABLED_MAX_FRAGMENT=yes
  1065. ENABLED_TRUNCATED_HMAC=yes
  1066. ENABLED_RENEGOTIATION_INDICATION=yes
  1067. ENABLED_SUPPORTED_CURVES=yes
  1068. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC -DHAVE_RENEGOTIATION_INDICATION -DHAVE_SUPPORTED_CURVES"
  1069. fi
  1070. # PKCS7
  1071. AC_ARG_ENABLE([pkcs7],
  1072. [ --enable-pkcs7 Enable PKCS7 (default: disabled)],
  1073. [ ENABLED_PKCS7=$enableval ],
  1074. [ ENABLED_PKCS7=no ],
  1075. )
  1076. if test "$ENABLED_PKCS7" = "yes"
  1077. then
  1078. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
  1079. fi
  1080. AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
  1081. # Simple Certificate Enrollment Protocol (SCEP)
  1082. AC_ARG_ENABLE([scep],
  1083. [ --enable-scep Enable wolfSCEP (default: disabled)],
  1084. [ ENABLED_WOLFSCEP=$enableval ],
  1085. [ ENABLED_WOLFSCEP=no ]
  1086. )
  1087. if test "$ENABLED_WOLFSCEP" = "yes"
  1088. then
  1089. # Enable prereqs if not already enabled
  1090. if test "x$ENABLED_KEYGEN" = "xno"
  1091. then
  1092. ENABLED_KEYGEN="yes"
  1093. AM_CFLAGS="$AM_CFLAGS -DCYASSL_KEY_GEN"
  1094. fi
  1095. if test "x$ENABLED_CERTGEN" = "xno"
  1096. then
  1097. ENABLED_CERTGEN="yes"
  1098. AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
  1099. fi
  1100. if test "x$ENABLED_CERTREQ" = "xno"
  1101. then
  1102. ENABLED_CERTREQ="yes"
  1103. AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_REQ"
  1104. fi
  1105. if test "x$ENABLED_PKCS7" = "xno"
  1106. then
  1107. ENABLED_PKCS7="yes"
  1108. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
  1109. AM_CONDITIONAL([BUILD_PKCS7], [test "x$ENABLED_PKCS7" = "xyes"])
  1110. fi
  1111. AM_CFLAGS="$AM_CFLAGS -DCYASSL_HAVE_WOLFSCEP"
  1112. fi
  1113. # Small Stack
  1114. AC_ARG_ENABLE([smallstack],
  1115. [ --enable-smallstack Enable Small Stack Usage (default: disabled)],
  1116. [ ENABLED_SMALL_STACK=$enableval ],
  1117. [ ENABLED_SMALL_STACK=no ]
  1118. )
  1119. if test "x$ENABLED_SMALL_STACK" = "xyes"
  1120. then
  1121. AM_CFLAGS="$AM_CFLAGS -DCYASSL_SMALL_STACK"
  1122. fi
  1123. #valgrind
  1124. AC_ARG_ENABLE([valgrind],
  1125. [ --enable-valgrind Enable valgrind for unit tests (default: disabled)],
  1126. [ ENABLED_VALGRIND=$enableval ],
  1127. [ ENABLED_VALGRIND=no ]
  1128. )
  1129. if test "$ENABLED_VALGRIND" = "yes"
  1130. then
  1131. AC_CHECK_PROG([HAVE_VALGRIND],[valgrind],[yes],[no])
  1132. if test "$HAVE_VALGRIND" = "no"
  1133. then
  1134. AC_MSG_ERROR([Valgrind not found.])
  1135. fi
  1136. enable_shared=no
  1137. enable_static=yes
  1138. AM_CFLAGS="$AM_CFLAGS -DHAVE_VALGRIND"
  1139. fi
  1140. AM_CONDITIONAL([USE_VALGRIND], [test "x$ENABLED_VALGRIND" = "xyes"])
  1141. # Test certs, use internal cert functions for extra testing
  1142. AC_ARG_ENABLE([testcert],
  1143. [ --enable-testcert Enable Test Cert (default: disabled)],
  1144. [ ENABLED_TESTCERT=$enableval ],
  1145. [ ENABLED_TESTCERT=no ]
  1146. )
  1147. if test "$ENABLED_TESTCERT" = "yes"
  1148. then
  1149. AM_CFLAGS="$AM_CFLAGS -DCYASSL_TEST_CERT"
  1150. fi
  1151. # I/O Pool, an example to show user how to override memory handler and use
  1152. # a pool for the input/output buffer requests
  1153. AC_ARG_ENABLE([iopool],
  1154. [ --enable-iopool Enable I/O Pool example (default: disabled)],
  1155. [ ENABLED_IOPOOL=$enableval ],
  1156. [ ENABLED_IOPOOL=no ]
  1157. )
  1158. if test "$ENABLED_IOPOOL" = "yes"
  1159. then
  1160. if test "$thread_ls_on" = "no"
  1161. then
  1162. AC_MSG_ERROR([I/O Pool example requires Thread Local Storage])
  1163. fi
  1164. AM_CFLAGS="$AM_CFLAGS -DHAVE_IO_POOL -DXMALLOC_USER"
  1165. fi
  1166. # Certificate Service Support
  1167. AC_ARG_ENABLE([certservice],
  1168. [ --enable-certservice Enable cert service (default: disabled)],
  1169. [ ENABLED_CERT_SERVICE=$enableval ],
  1170. [ ENABLED_CERT_SERVICE=no ]
  1171. )
  1172. if test "$ENABLED_CERT_SERVICE" = "yes"
  1173. then
  1174. # Requires ecc,certgen, and opensslextra make sure on
  1175. if test "x$ENABLED_CERTGEN" = "xno"
  1176. then
  1177. ENABLED_CERTGEN="yes"
  1178. AM_CFLAGS="$AM_CFLAGS -DCYASSL_CERT_GEN"
  1179. fi
  1180. if test "x$ENABLED_ECC" = "xno"
  1181. then
  1182. ENABLED_ECC="yes"
  1183. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DECC_SHAMIR"
  1184. AM_CONDITIONAL([BUILD_ECC], [test "x$ENABLED_ECC" = "xyes"])
  1185. fi
  1186. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  1187. then
  1188. ENABLED_OPENSSLEXTRA="yes"
  1189. AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS"
  1190. fi
  1191. AM_CFLAGS="$AM_CFLAGS -DCYASSL_HAVE_CERT_SERVICE"
  1192. fi
  1193. # set fastmath default
  1194. FASTMATH_DEFAULT=no
  1195. if test "$host_cpu" = "x86_64"
  1196. then
  1197. FASTMATH_DEFAULT=yes
  1198. fi
  1199. # fastmath
  1200. AC_ARG_ENABLE([fastmath],
  1201. [ --enable-fastmath Enable fast math ops (default: enabled on x86_64)],
  1202. [ ENABLED_FASTMATH=$enableval ],
  1203. [ ENABLED_FASTMATH=$FASTMATH_DEFAULT]
  1204. )
  1205. if test "x$ENABLED_FASTMATH" = "xyes"
  1206. then
  1207. # turn off fastmth if leanpsk on or asn off
  1208. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_ASN" = "no"
  1209. then
  1210. ENABLED_FASTMATH=no
  1211. else
  1212. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  1213. ENABLED_SLOWMATH="no"
  1214. fi
  1215. fi
  1216. # fast HUGE math
  1217. AC_ARG_ENABLE([fasthugemath],
  1218. [ --enable-fasthugemath Enable fast math + huge code (default: disabled)],
  1219. [ ENABLED_FASTHUGEMATH=$enableval ],
  1220. [ ENABLED_FASTHUGEMATH=no ]
  1221. )
  1222. if test "$ENABLED_BUMP" = "yes"
  1223. then
  1224. ENABLED_FASTHUGEMATH="yes"
  1225. fi
  1226. if test "$ENABLED_FASTHUGEMATH" = "yes"
  1227. then
  1228. ENABLED_FASTMATH="yes"
  1229. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  1230. ENABLED_SLOWMATH="no"
  1231. fi
  1232. AM_CONDITIONAL([BUILD_FASTMATH], [test "x$ENABLED_FASTMATH" = "xyes"])
  1233. AM_CONDITIONAL([BUILD_SLOWMATH], [test "x$ENABLED_SLOWMATH" = "xyes"])
  1234. # Enable Examples, used to disable examples
  1235. AC_ARG_ENABLE([examples],
  1236. [ --enable-examples Enable Examples (default: enabled)],
  1237. [ ENABLED_EXAMPLES=$enableval ],
  1238. [ ENABLED_EXAMPLES=yes ]
  1239. )
  1240. AS_IF([test "x$ENABLED_FILESYSTEM" = "xno"], [ENABLED_EXAMPLES="no"])
  1241. AS_IF([test "x$ENABLED_INLINE" = "xno"], [ENABLED_EXAMPLES="no"])
  1242. # certs still have sha signatures for now
  1243. AS_IF([test "x$ENABLED_SHA" = "xno"], [ENABLED_EXAMPLES="no"])
  1244. AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$ENABLED_EXAMPLES" = "xyes"])
  1245. # LIBZ
  1246. ENABLED_LIBZ="no"
  1247. trylibzdir=""
  1248. AC_ARG_WITH([libz],
  1249. [ --with-libz=PATH PATH to libz install (default /usr/) ],
  1250. [
  1251. AC_MSG_CHECKING([for libz])
  1252. CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
  1253. LIBS="$LIBS -lz"
  1254. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  1255. if test "x$libz_linked" == "xno" ; then
  1256. if test "x$withval" != "xno" ; then
  1257. trylibzdir=$withval
  1258. fi
  1259. if test "x$withval" == "xyes" ; then
  1260. trylibzdir="/usr"
  1261. fi
  1262. AM_LDFLAGS="$AM_LDFLAGS -L$trylibzdir/lib"
  1263. CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
  1264. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  1265. if test "x$libz_linked" == "xno" ; then
  1266. AC_MSG_ERROR([libz isn't found.
  1267. If it's already installed, specify its path using --with-libz=/dir/])
  1268. fi
  1269. AC_MSG_RESULT([yes])
  1270. else
  1271. AC_MSG_RESULT([yes])
  1272. fi
  1273. ENABLED_LIBZ="yes"
  1274. ]
  1275. )
  1276. AM_CONDITIONAL([BUILD_LIBZ], [test "x$ENABLED_LIBZ" = "xyes"])
  1277. # cavium
  1278. trycaviumdir=""
  1279. AC_ARG_WITH([cavium],
  1280. [ --with-cavium=PATH PATH to cavium/software dir ],
  1281. [
  1282. AC_MSG_CHECKING([for cavium])
  1283. CPPFLAGS="$CPPFLAGS -DHAVE_CAVIUM"
  1284. if test "x$withval" == "xyes" ; then
  1285. AC_MSG_ERROR([need a PATH for --with-cavium])
  1286. fi
  1287. if test "x$withval" != "xno" ; then
  1288. trycaviumdir=$withval
  1289. fi
  1290. LDFLAGS="$AM_LDFLAGS $trycaviumdir/api/cavium_common.o"
  1291. CPPFLAGS="$CPPFLAGS -I$trycaviumdir/include"
  1292. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cavium_common.h"]], [[ CspShutdown(CAVIUM_DEV_ID); ]])],[ cavium_linked=yes ],[ cavium_linked=no ])
  1293. if test "x$cavium_linked" == "xno" ; then
  1294. AC_MSG_ERROR([cavium isn't found.
  1295. If it's already installed, specify its path using --with-cavium=/dir/])
  1296. fi
  1297. AC_MSG_RESULT([yes])
  1298. enable_shared=no
  1299. enable_static=yes
  1300. ]
  1301. )
  1302. # microchip api
  1303. AC_ARG_ENABLE([mcapi],
  1304. [ --enable-mcapi Enable Microchip API (default: disabled)],
  1305. [ ENABLED_MCAPI=$enableval ],
  1306. [ ENABLED_MCAPI=no ]
  1307. )
  1308. if test "$ENABLED_MCAPI" = "yes"
  1309. then
  1310. AM_CFLAGS="$AM_CFLAGS -DHAVE_MCAPI -DCYASSL_AES_COUNTER -DCYASSL_AES_DIRECT"
  1311. fi
  1312. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_SHA512" = "no"
  1313. then
  1314. AC_MSG_ERROR([please enable sha512 if enabling mcapi.])
  1315. fi
  1316. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_ECC" = "no"
  1317. then
  1318. AC_MSG_ERROR([please enable ecc if enabling mcapi.])
  1319. fi
  1320. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_LIBZ" = "no"
  1321. then
  1322. AC_MSG_ERROR([please use --with-libz if enabling mcapi.])
  1323. fi
  1324. AM_CONDITIONAL([BUILD_MCAPI], [test "x$ENABLED_MCAPI" = "xyes"])
  1325. # OPTIMIZE FLAGS
  1326. if test "$GCC" = "yes"
  1327. then
  1328. AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
  1329. if test "$ax_enable_debug" = "no"
  1330. then
  1331. if test "$ENABLED_FASTMATH" = "yes"
  1332. then
  1333. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
  1334. if test "$ENABLED_FASTHUGEMATH" = "yes"
  1335. then
  1336. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  1337. fi
  1338. else
  1339. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
  1340. fi
  1341. fi
  1342. fi
  1343. # ICC command line warning for non supported warning flags
  1344. if test "$CC" = "icc"
  1345. then
  1346. AM_CFLAGS="$AM_CFLAGS -wd10006"
  1347. fi
  1348. LIB_SOCKET_NSL
  1349. AX_HARDEN_CC_COMPILER_FLAGS
  1350. # link to ws2_32 if on mingw
  1351. case $host_os in
  1352. *mingw32)
  1353. LDFLAGS="$LDFLAGS -lws2_32" ;;
  1354. esac
  1355. # add user C_EXTRA_FLAGS back
  1356. CFLAGS="$CFLAGS $USER_C_EXTRA_FLAGS"
  1357. OPTION_FLAGS="$USER_C_EXTRA_FLAGS $AM_CFLAGS"
  1358. CREATE_HEX_VERSION
  1359. AC_SUBST([AM_CPPFLAGS])
  1360. AC_SUBST([AM_CFLAGS])
  1361. AC_SUBST([AM_LDFLAGS])
  1362. # FINAL
  1363. AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
  1364. AC_CONFIG_FILES([Makefile])
  1365. AC_CONFIG_FILES([cyassl/version.h])
  1366. AC_CONFIG_FILES([cyassl/options.h])
  1367. AC_CONFIG_FILES([support/cyassl.pc])
  1368. AC_CONFIG_FILES([rpm/spec])
  1369. AX_CREATE_GENERIC_CONFIG
  1370. AX_AM_JOBSERVER([yes])
  1371. AC_OUTPUT
  1372. # force make clean
  1373. echo "---"
  1374. echo "Running make clean..."
  1375. make clean >/dev/null 2>&1
  1376. # Touch files that may not be in repository
  1377. echo "Touching File..."
  1378. touch ctaocrypt/src/fips.c
  1379. touch ctaocrypt/src/fips_test.c
  1380. echo
  1381. # generate user options header
  1382. echo "---"
  1383. echo "Generating user options header..."
  1384. OPTION_FILE="cyassl/options.h"
  1385. rm -f $OPTION_FILE
  1386. echo "/* cyassl options.h" > $OPTION_FILE
  1387. echo " * generated from configure options" >> $OPTION_FILE
  1388. echo " *" >> $OPTION_FILE
  1389. echo " * Copyright (C) 2006-2014 wolfSSL Inc." >> $OPTION_FILE
  1390. echo " *" >> $OPTION_FILE
  1391. echo " * This file is part of CyaSSL." >> $OPTION_FILE
  1392. echo " *" >> $OPTION_FILE
  1393. echo " */" >> $OPTION_FILE
  1394. echo "" >> $OPTION_FILE
  1395. echo "#pragma once" >> $OPTION_FILE
  1396. echo "" >> $OPTION_FILE
  1397. echo "#ifdef __cplusplus" >> $OPTION_FILE
  1398. echo "extern \"C\" {" >> $OPTION_FILE
  1399. echo "#endif" >> $OPTION_FILE
  1400. echo "" >> $OPTION_FILE
  1401. for option in $OPTION_FLAGS; do
  1402. defonly=`echo $option | sed 's/-D//'`
  1403. if test "$defonly" != "$option"
  1404. then
  1405. noequalsign=`echo $defonly | sed 's/=/ /'`
  1406. echo "#undef $noequalsign" >> $OPTION_FILE
  1407. echo "#define $noequalsign" >> $OPTION_FILE
  1408. echo "" >> $OPTION_FILE
  1409. else
  1410. echo "option w/o begin -D is $option, not saving to $OPTION_FILE"
  1411. fi
  1412. done
  1413. echo "" >> $OPTION_FILE
  1414. echo "#ifdef __cplusplus" >> $OPTION_FILE
  1415. echo "}" >> $OPTION_FILE
  1416. echo "#endif" >> $OPTION_FILE
  1417. echo "" >> $OPTION_FILE
  1418. echo
  1419. # output config summary
  1420. echo "---"
  1421. echo "Configuration summary for $PACKAGE_NAME version $VERSION"
  1422. echo ""
  1423. echo " * Installation prefix: $prefix"
  1424. echo " * System type: $host_vendor-$host_os"
  1425. echo " * Host CPU: $host_cpu"
  1426. echo " * C Compiler: $CC"
  1427. echo " * C Flags: $CFLAGS"
  1428. echo " * C++ Compiler: $CXX"
  1429. echo " * C++ Flags: $CXXFLAGS"
  1430. echo " * CPP Flags: $CPPFLAGS"
  1431. echo " * LIB Flags: $LIB"
  1432. echo " * Debug enabled: $ax_enable_debug"
  1433. echo " * Warnings as failure: $ac_cv_warnings_as_errors"
  1434. echo " * make -j: $enable_jobserver"
  1435. echo " * VCS checkout: $ac_cv_vcs_checkout"
  1436. echo
  1437. echo " Features "
  1438. echo " * Single threaded: $ENABLED_SINGLETHREADED"
  1439. echo " * Filesystem: $ENABLED_FILESYSTEM"
  1440. echo " * OpenSSL Extra API: $ENABLED_OPENSSLEXTRA"
  1441. echo " * fastmath: $ENABLED_FASTMATH"
  1442. echo " * sniffer: $ENABLED_SNIFFER"
  1443. echo " * snifftest: $ENABLED_SNIFFTEST"
  1444. echo " * ARC4: $ENABLED_ARC4"
  1445. echo " * AES: $ENABLED_AES"
  1446. echo " * AES-NI: $ENABLED_AESNI"
  1447. echo " * AES-GCM: $ENABLED_AESGCM"
  1448. echo " * AES-CCM: $ENABLED_AESCCM"
  1449. echo " * DES3: $ENABLED_DES3"
  1450. echo " * Camellia: $ENABLED_CAMELLIA"
  1451. echo " * NULL Cipher: $ENABLED_NULL_CIPHER"
  1452. echo " * MD5: $ENABLED_MD5"
  1453. echo " * RIPEMD: $ENABLED_RIPEMD"
  1454. echo " * SHA: $ENABLED_SHA"
  1455. echo " * SHA-512: $ENABLED_SHA512"
  1456. echo " * BLAKE2: $ENABLED_BLAKE2"
  1457. echo " * keygen: $ENABLED_KEYGEN"
  1458. echo " * certgen: $ENABLED_CERTGEN"
  1459. echo " * certreq: $ENABLED_CERTREQ"
  1460. echo " * HC-128: $ENABLED_HC128"
  1461. echo " * RABBIT: $ENABLED_RABBIT"
  1462. echo " * Hash DRBG: $ENABLED_HASHDRBG"
  1463. echo " * PWDBASED: $ENABLED_PWDBASED"
  1464. echo " * HKDF: $ENABLED_HKDF"
  1465. echo " * MD4: $ENABLED_MD4"
  1466. echo " * PSK: $ENABLED_PSK"
  1467. echo " * LEANPSK: $ENABLED_LEANPSK"
  1468. echo " * RSA: $ENABLED_RSA"
  1469. echo " * DSA: $ENABLED_DSA"
  1470. echo " * DH: $ENABLED_DH"
  1471. echo " * ECC: $ENABLED_ECC"
  1472. echo " * FPECC: $ENABLED_FPECC"
  1473. echo " * ECC_ENCRYPT: $ENABLED_ECC_ENCRYPT"
  1474. echo " * ASN: $ENABLED_ASN"
  1475. echo " * CODING: $ENABLED_CODING"
  1476. echo " * MEMORY: $ENABLED_MEMORY"
  1477. echo " * I/O POOL: $ENABLED_IOPOOL"
  1478. echo " * ERROR_STRINGS: $ENABLED_ERROR_STRINGS"
  1479. echo " * DTLS: $ENABLED_DTLS"
  1480. echo " * Old TLS Versions: $ENABLED_OLD_TLS"
  1481. echo " * OCSP: $ENABLED_OCSP"
  1482. echo " * CRL: $ENABLED_CRL"
  1483. echo " * CRL-MONITOR: $ENABLED_CRL_MONITOR"
  1484. echo " * Persistent session cache: $ENABLED_SAVESESSION"
  1485. echo " * Persistent cert cache: $ENABLED_SAVECERT"
  1486. echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
  1487. echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
  1488. echo " * NTRU: $ENABLED_NTRU"
  1489. echo " * SNI: $ENABLED_SNI"
  1490. echo " * Maximum Fragment Length: $ENABLED_MAX_FRAGMENT"
  1491. echo " * Truncated HMAC: $ENABLED_TRUNCATED_HMAC"
  1492. echo " * Renegotiation Indication: $ENABLED_RENEGOTIATION_INDICATION"
  1493. echo " * Supported Elliptic Curves: $ENABLED_SUPPORTED_CURVES"
  1494. echo " * All TLS Extensions: $ENABLED_TLSX"
  1495. echo " * PKCS#7 $ENABLED_PKCS7"
  1496. echo " * wolfSCEP $ENABLED_WOLFSCEP"
  1497. echo " * Small Stack: $ENABLED_SMALL_STACK"
  1498. echo " * valgrind unit tests: $ENABLED_VALGRIND"
  1499. echo " * LIBZ: $ENABLED_LIBZ"
  1500. echo " * Examples: $ENABLED_EXAMPLES"
  1501. echo ""
  1502. echo "---"