configure.ac 262 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269
  1. # configure.ac
  2. #
  3. # Copyright (C) 2006-2021 wolfSSL Inc.
  4. #
  5. # This file is part of wolfSSL. (formerly known as CyaSSL)
  6. #
  7. #
  8. AC_COPYRIGHT([Copyright (C) 2006-2020 wolfSSL Inc.])
  9. AC_PREREQ([2.69])
  10. AC_INIT([wolfssl],[5.3.0],[https://github.com/wolfssl/wolfssl/issues],[wolfssl],[https://www.wolfssl.com])
  11. AC_CONFIG_AUX_DIR([build-aux])
  12. # The following sets CFLAGS to empty if unset on command line. We do not
  13. # want the default "-g -O2" that AC_PROG_CC sets automatically.
  14. : ${CFLAGS=""}
  15. # Capture user C_EXTRA_FLAGS from configure line.
  16. # Use of C_EXTRA_FLAGS is deprecated because CFLAGS was fixed but someone
  17. # might still be using it.
  18. CFLAGS="$CFLAGS $C_EXTRA_FLAGS $C_FLAGS"
  19. AC_PROG_CC
  20. AM_PROG_CC_C_O
  21. AC_CANONICAL_HOST
  22. AC_CANONICAL_TARGET
  23. AC_CONFIG_MACRO_DIR([m4])
  24. AM_INIT_AUTOMAKE([1.14.1 -Wall -Werror -Wno-portability foreign tar-ustar subdir-objects no-define color-tests])
  25. m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
  26. AC_ARG_PROGRAM
  27. AC_CONFIG_HEADERS([config.h:config.in])
  28. LT_PREREQ([2.4.2])
  29. LT_INIT([disable-static win32-dll])
  30. AC_ARG_VAR(EXTRA_CFLAGS, [Extra CFLAGS to add to autoconf-computed arg list. Can also supply directly to make.])
  31. #shared library versioning
  32. WOLFSSL_LIBRARY_VERSION=33:0:0
  33. # | | |
  34. # +------+ | +---+
  35. # | | |
  36. # current:revision:age
  37. # | | |
  38. # | | +- increment if interfaces have been added
  39. # | | set to zero if interfaces have been removed
  40. # | | or changed
  41. # | +- increment if source code has changed
  42. # | set to zero if current is incremented
  43. # +- increment if interfaces have been added, removed or changed
  44. AC_SUBST([WOLFSSL_LIBRARY_VERSION])
  45. gl_VISIBILITY
  46. AS_IF([ test -n "$CFLAG_VISIBILITY" ], [
  47. AM_CFLAGS="$AM_CPPFLAGS $CFLAG_VISIBILITY"
  48. ])
  49. # Moved these size of and type checks before the library checks.
  50. # The library checks add the library to subsequent test compiles
  51. # and in some rare cases, the networking check causes these sizeof
  52. # checks to fail.
  53. AC_CHECK_SIZEOF([long long])
  54. AC_CHECK_SIZEOF([long])
  55. AC_CHECK_SIZEOF([time_t])
  56. AC_CHECK_TYPES([__uint128_t])
  57. # Distro build feature subset (Debian, Ubuntu, etc.)
  58. AC_ARG_ENABLE([distro],
  59. [AS_HELP_STRING([--enable-distro],[Enable wolfSSL distro build (default: disabled)])],
  60. [ ENABLED_DISTRO=$enableval ],
  61. [ ENABLED_DISTRO=no ]
  62. )
  63. if test "$ENABLED_DISTRO" = "yes"
  64. then
  65. enable_shared=yes
  66. enable_static=yes
  67. enable_all=yes
  68. enable_earlydata=no
  69. REPRODUCIBLE_BUILD_DEFAULT=yes
  70. else
  71. REPRODUCIBLE_BUILD_DEFAULT=no
  72. fi
  73. AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h time.h sys/ioctl.h sys/socket.h sys/time.h errno.h sys/un.h])
  74. AC_CHECK_LIB([network],[socket])
  75. AC_C_BIGENDIAN
  76. # check if functions of interest are linkable, but also check if
  77. # they're declared by the expected headers, and if not, supersede the
  78. # unusable positive from AC_CHECK_FUNCS().
  79. AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday gmtime_r gmtime_s inet_ntoa memset socket strftime atexit])
  80. AC_CHECK_DECLS([gethostbyname, getaddrinfo, gettimeofday, gmtime_r, gmtime_s, inet_ntoa, memset, socket, strftime], [], [
  81. if test "$(eval echo \$"$(eval 'echo ac_cv_func_${as_decl_name}')")" = "yes"
  82. then
  83. AC_MSG_NOTICE([ note: earlier check for $(eval 'echo ${as_decl_name}') superseded.])
  84. eval "ac_cv_func_${as_decl_name}=no"
  85. _mask_varname=HAVE_`eval "echo '${as_decl_name}'" | tr 'a-z' 'A-Z'`
  86. sed --in-place "s~^#define ${_mask_varname} 1$~~" confdefs.h
  87. fi
  88. ], [[
  89. #ifdef HAVE_SYS_SOCKET_H
  90. #include <sys/socket.h>
  91. #endif
  92. #ifdef HAVE_STRING_H
  93. #include <string.h>
  94. #endif
  95. #ifdef HAVE_NETDB_H
  96. #include <netdb.h>
  97. #endif
  98. #ifdef HAVE_ARPA_INET_H
  99. #include <arpa/inet.h>
  100. #endif
  101. #ifdef HAVE_SYS_TIME_H
  102. #include <sys/time.h>
  103. #endif
  104. #ifdef HAVE_TIME_H
  105. #include <time.h>
  106. #endif
  107. ]])
  108. AC_PROG_INSTALL
  109. AC_TYPE_SIZE_T
  110. AC_TYPE_UINT8_T
  111. AC_TYPE_UINTPTR_T
  112. AM_PROG_AS
  113. LT_LIB_M
  114. OPTIMIZE_CFLAGS="-Os"
  115. OPTIMIZE_FAST_CFLAGS="-O2"
  116. OPTIMIZE_HUGE_CFLAGS="-funroll-loops -DTFM_SMALL_SET -DTFM_HUGE_SET"
  117. DEBUG_CFLAGS="-g -DDEBUG -DDEBUG_WOLFSSL"
  118. LIB_ADD=
  119. LIB_STATIC_ADD=
  120. if test "$output_objdir" = ""
  121. then
  122. output_objdir=.
  123. fi
  124. # Thread local storage
  125. AX_TLS([thread_ls_on=yes],[thread_ls_on=no])
  126. AS_IF([test "x$thread_ls_on" = "xyes"],[AM_CFLAGS="$AM_CFLAGS -DHAVE_THREAD_LS"])
  127. # DEBUG
  128. AX_DEBUG
  129. AS_IF([test "$ax_enable_debug" = "yes"],
  130. [AM_CFLAGS="$AM_CFLAGS $DEBUG_CFLAGS"],
  131. [AM_CFLAGS="$AM_CFLAGS -DNDEBUG"])
  132. AS_IF([test "$ax_enable_debug" = "yes"],
  133. [AM_CCASFLAGS="$DEBUG_CFLAGS $AM_CCASFLAGS"],
  134. [AM_CCASFLAGS="$AM_CCASFLAGS -DNDEBUG"])
  135. # Start without certificates enabled and enable if a certificate algorithm is
  136. # enabled
  137. ENABLED_CERTS="no"
  138. # Support for forcing 32-bit mode
  139. # To force 32-bit instructions use:
  140. # ./configure CFLAGS="-m32" LDFLAGS="-m32" && make
  141. # The checks for sizeof long and long/long are run at the top of configure and require "-m32" to be set directly in the ./configure statement.
  142. AC_ARG_ENABLE([32bit],
  143. [AS_HELP_STRING([--enable-32bit],[Enables 32-bit support (default: disabled)])],
  144. [ ENABLED_32BIT=$enableval ],
  145. [ ENABLED_32BIT=no ]
  146. )
  147. # 16-bit compiler support
  148. AC_ARG_ENABLE([16bit],
  149. [AS_HELP_STRING([--enable-16bit],[Enables 16-bit support (default: disabled)])],
  150. [ ENABLED_16BIT=$enableval ],
  151. [ ENABLED_16BIT=no ]
  152. )
  153. if test "$ENABLED_16BIT" = "yes"
  154. then
  155. AM_CFLAGS="$AM_CFLAGS -DWC_16BIT_CPU"
  156. fi
  157. AC_ARG_ENABLE([64bit],
  158. [AS_HELP_STRING([--enable-64bit],[Enables 64-bit support (default: disabled)])],
  159. [ ENABLED_64BIT=$enableval ],
  160. [ ENABLED_64BIT=no ]
  161. )
  162. AC_ARG_ENABLE([kdf],
  163. [AS_HELP_STRING([--enable-kdf],[Enables kdf support (default: enabled)])],
  164. [ ENABLED_KDF=$enableval ],
  165. [ ENABLED_KDF=yes ]
  166. )
  167. AC_ARG_ENABLE([hmac],
  168. [AS_HELP_STRING([--enable-hmac],[Enables HMAC support (default: enabled)])],
  169. [ ENABLED_HMAC=$enableval ],
  170. [ ENABLED_HMAC=yes ]
  171. )
  172. AC_ARG_ENABLE([do178],
  173. [AS_HELP_STRING([--enable-do178],[Enable DO-178, Will NOT work w/o DO178 license (default: disabled)])],
  174. [ENABLED_DO178=$enableval],
  175. [ENABLED_DO178="no"])
  176. if test "$ENABLED_DO178" = "no"
  177. then
  178. AM_CFLAGS="$AM_CFLAGS -DNO_DO178"
  179. else
  180. AM_CFLAGS="$AM_CFLAGS -DHAVE_DO178"
  181. fi
  182. # Support for disabling all ASM
  183. AC_ARG_ENABLE([asm],
  184. [AS_HELP_STRING([--enable-asm],[Enables option for assembly (default: enabled)])],
  185. [ ENABLED_ASM=$enableval ],
  186. [ ENABLED_ASM=yes ]
  187. )
  188. if test "$ENABLED_ASM" = "no"
  189. then
  190. AM_CFLAGS="$AM_CFLAGS -DTFM_NO_ASM -DWOLFSSL_NO_ASM"
  191. fi
  192. AC_SUBST([ENABLED_ASM])
  193. # FIPS 140
  194. AC_ARG_ENABLE([fips],
  195. [AS_HELP_STRING([--enable-fips],[Enable FIPS 140-2, Will NOT work w/o FIPS license (default: disabled)])],
  196. [ENABLED_FIPS=$enableval],
  197. [ENABLED_FIPS="no"])
  198. # wolfEngine Options
  199. AC_ARG_ENABLE([engine],
  200. [AS_HELP_STRING([--enable-engine],[Enable wolfEngine options (default: disabled)])],
  201. [ ENABLED_WOLFENGINE=$enableval ],
  202. [ ENABLED_WOLFENGINE=no ]
  203. )
  204. AS_CASE([$ENABLED_WOLFENGINE],
  205. [no],[
  206. ENABLED_WOLFENGINE="no"
  207. ],
  208. [disabled],[
  209. ENABLED_WOLFENGINE="no"
  210. ],
  211. [yes|fips-v2|cert3389],[
  212. ENABLED_WOLFENGINE="yes"
  213. ENABLED_FIPS="v2"
  214. ],
  215. [fips-ready],[
  216. ENABLED_WOLFENGINE="yes"
  217. ENABLED_FIPS="ready"
  218. ],
  219. [no-fips],[
  220. ENABLED_WOLFENGINE="yes"
  221. ENABLED_FIPS="no"
  222. ],
  223. [
  224. AC_MSG_ERROR([Invalid value for --enable-engine "$ENABLED_WOLFENGINE" (options: fips-v2, fips-ready, no-fips, no, disabled)])
  225. ])
  226. # The FIPS options are:
  227. # no - FIPS build disabled, FIPS sources forbidden in build tree
  228. # disabled - FIPS build disabled, FIPS sources ignored in build tree
  229. # v1 - FIPS 140-2 Cert 2425
  230. # default - same as v1
  231. # v2 - FIPS 140-2 Cert 3389
  232. # cert3389 - alias for v2
  233. # rand - wolfRand
  234. # v5-RC8 - historical FIPS 140-3 (wolfCrypt WCv5.0-RC8)
  235. # v5-RC9 - historical FIPS 140-3 (wolfCrypt WCv5.0-RC9)
  236. # v5-RC10 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC10
  237. # v5-RC11 - historical FIPS 140-3, wolfCrypt/fips WCv5.0-RC11
  238. # v5-RC12 - FIPS 140-3, wolfCrypt/fips WCv5.0-RC12
  239. # v5 - currently, alias for v5-RC12
  240. # v5-ready - FIPS 140-3 settings with in-tree wolfcrypt sources, feature locked
  241. # v5-dev - FIPS 140-3 settings with in-tree wolfcrypt sources, features freely adjustable
  242. # ready - currently, same as v5-ready
  243. # dev - currently, same as v5-dev
  244. AS_CASE([$ENABLED_FIPS],
  245. [no],[
  246. FIPS_VERSION="none"
  247. ENABLED_FIPS="no"
  248. ],
  249. [disabled],[
  250. FIPS_VERSION="disabled"
  251. ENABLED_FIPS="no"
  252. ],
  253. [v1|yes|cert2425],[
  254. FIPS_VERSION="v1"
  255. HAVE_FIPS_VERSION=1
  256. ENABLED_FIPS="yes"
  257. ],
  258. [v2|cert3389],[
  259. FIPS_VERSION="v2"
  260. HAVE_FIPS_VERSION=2
  261. HAVE_FIPS_VERSION_MINOR=0
  262. ENABLED_FIPS="yes"
  263. ],
  264. [rand],[
  265. FIPS_VERSION="rand"
  266. HAVE_FIPS_VERSION=2
  267. HAVE_FIPS_VERSION_MINOR=1
  268. ENABLED_FIPS="yes"
  269. ],
  270. [v5-RC8],[
  271. FIPS_VERSION="v5-RC8"
  272. HAVE_FIPS_VERSION=5
  273. HAVE_FIPS_VERSION_MINOR=0
  274. ENABLED_FIPS="yes"
  275. ],
  276. [v5-RC9],[
  277. FIPS_VERSION="v5-RC9"
  278. HAVE_FIPS_VERSION=5
  279. HAVE_FIPS_VERSION_MINOR=1
  280. ENABLED_FIPS="yes"
  281. ],
  282. [v5-RC10],[
  283. FIPS_VERSION="v5-RC10"
  284. HAVE_FIPS_VERSION=5
  285. HAVE_FIPS_VERSION_MINOR=2
  286. ENABLED_FIPS="yes"
  287. ],
  288. [v5-RC11],[
  289. FIPS_VERSION="v5-RC11"
  290. HAVE_FIPS_VERSION=5
  291. HAVE_FIPS_VERSION_MINOR=2
  292. ENABLED_FIPS="yes"
  293. ],
  294. [v5|v5-RC12],[
  295. FIPS_VERSION="v5-RC12"
  296. HAVE_FIPS_VERSION=5
  297. HAVE_FIPS_VERSION_MINOR=2
  298. ENABLED_FIPS="yes"
  299. ],
  300. [ready|v5-ready],[
  301. FIPS_VERSION="v5-ready"
  302. HAVE_FIPS_VERSION=5
  303. HAVE_FIPS_VERSION_MINOR=3
  304. ENABLED_FIPS="yes"
  305. ],
  306. [dev|v5-dev],[
  307. FIPS_VERSION="v5-dev"
  308. HAVE_FIPS_VERSION=5
  309. HAVE_FIPS_VERSION_MINOR=3
  310. ENABLED_FIPS="yes"
  311. ],
  312. [
  313. AC_MSG_ERROR([Invalid value for --enable-fips "$ENABLED_FIPS" (main options: v1, v2, v5, ready, dev, rand, no, disabled)])
  314. ])
  315. if test -z "$HAVE_FIPS_VERSION_MINOR"
  316. then
  317. HAVE_FIPS_VERSION_MINOR=0
  318. fi
  319. if test -z "$HAVE_FIPS_VERSION"
  320. then
  321. HAVE_FIPS_VERSION=0
  322. fi
  323. if test "$ENABLED_FIPS" != "no"
  324. then
  325. REPRODUCIBLE_BUILD_DEFAULT=yes
  326. fi
  327. AS_CASE([$FIPS_VERSION],
  328. [none],
  329. [
  330. AS_IF([ test -s $srcdir/wolfcrypt/src/fips.c -o -s $srcdir/ctaocrypt/src/fips.c ],
  331. [AC_MSG_ERROR([FIPS source tree is incompatible with non-FIPS build (requires --enable-fips)])])
  332. ],
  333. [disabled],
  334. [],
  335. [v1],
  336. [
  337. AS_IF([ ! test -s $srcdir/ctaocrypt/src/fips.c],
  338. [AC_MSG_ERROR([non-FIPS-v1 source tree is incompatible with --enable-fips=$enableval])])
  339. ],
  340. [
  341. AS_IF([ ! test -s $srcdir/wolfcrypt/src/fips.c],
  342. [AC_MSG_ERROR([non-FIPS source tree is incompatible with --enable-fips=$enableval])])
  343. ]
  344. )
  345. # For reproducible build, gate out from the build anything that might
  346. # introduce semantically frivolous jitter, maximizing chance of
  347. # identical object files.
  348. AC_ARG_ENABLE([reproducible-build],
  349. [AS_HELP_STRING([--enable-reproducible-build],[Enable maximally reproducible build (default: disabled)])],
  350. [ ENABLED_REPRODUCIBLE_BUILD=$enableval ],
  351. [ ENABLED_REPRODUCIBLE_BUILD=$REPRODUCIBLE_BUILD_DEFAULT ]
  352. )
  353. if test "$ENABLED_REPRODUCIBLE_BUILD" = "yes"
  354. then
  355. # Test ar for the "D" option. Should be checked before the libtool macros.
  356. if test -z "$AR"; then
  357. AR=ar
  358. fi
  359. xxx_ar_flags=$(${AR} --help 2>&1)
  360. if test -z "$RANLIB"; then
  361. RANLIB=ranlib
  362. fi
  363. xxx_ranlib_flags=$(${RANLIB} --help 2>&1)
  364. AM_CFLAGS="$AM_CFLAGS -DHAVE_REPRODUCIBLE_BUILD"
  365. AS_CASE([$xxx_ar_flags],[*'use zero for timestamps and uids/gids'*],[AR_FLAGS="Dcr" lt_ar_flags="Dcr"])
  366. AS_CASE([$xxx_ranlib_flags],[*'Use zero for symbol map timestamp'*],[RANLIB="${RANLIB} -D"])
  367. fi
  368. AC_ARG_ENABLE([benchmark],
  369. [AS_HELP_STRING([--enable-benchmark],[Build benchmark when building crypttests (default: enabled)])],
  370. [ENABLED_BENCHMARK=$enableval],
  371. [ENABLED_BENCHMARK=yes]
  372. )
  373. # Linux Kernel Module
  374. AC_ARG_ENABLE([linuxkm],
  375. [AS_HELP_STRING([--enable-linuxkm],[Enable Linux Kernel Module (default: disabled)])],
  376. [ENABLED_LINUXKM=$enableval],
  377. [ENABLED_LINUXKM=no]
  378. )
  379. AC_ARG_ENABLE([linuxkm-defaults],
  380. [AS_HELP_STRING([--enable-linuxkm-defaults],[Enable feature defaults for Linux Kernel Module (default: disabled)])],
  381. [ENABLED_LINUXKM_DEFAULTS=$enableval],
  382. [ENABLED_LINUXKM_DEFAULTS=$ENABLED_LINUXKM]
  383. )
  384. AC_ARG_ENABLE([linuxkm-pie],
  385. [AS_HELP_STRING([--enable-linuxkm-pie],[Enable relocatable object build of Linux kernel module (default: disabled)])],
  386. [ENABLED_LINUXKM_PIE=$enableval],
  387. [ENABLED_LINUXKM_PIE=$ENABLED_FIPS]
  388. )
  389. if test "$ENABLED_LINUXKM_PIE" = "yes"
  390. then
  391. AM_CFLAGS="$AM_CFLAGS -DHAVE_LINUXKM_PIE_SUPPORT"
  392. elif test "$ENABLED_FIPS" = yes && test "$ENABLED_LINUXKM" = yes
  393. then
  394. AC_MSG_ERROR([FIPS linuxkm requires linuxkm-pie.])
  395. fi
  396. AC_SUBST([ENABLED_LINUXKM_PIE])
  397. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
  398. then
  399. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_CONST -DWOLFSSL_SP_MOD_WORD_RP -DWOLFSSL_SP_DIV_64 -DWOLFSSL_SP_DIV_WORD_HALF -DWOLFSSL_SMALL_STACK_STATIC -DWOLFSSL_TEST_SUBROUTINE=static"
  400. if test "$ENABLED_FIPS" = "no"; then
  401. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_OLD_PRIME_CHECK"
  402. fi
  403. fi
  404. AC_ARG_WITH([linux-source],
  405. [AS_HELP_STRING([--with-linux-source=PATH],[PATH to root of Linux kernel build tree])],
  406. [KERNEL_ROOT=$withval],
  407. [KERNEL_ROOT=""])
  408. AC_ARG_WITH([linux-arch],
  409. [AS_HELP_STRING([--with-linux-arch=arch],[built arch (SRCARCH) of Linux kernel build tree])],
  410. [KERNEL_ARCH=$withval],
  411. [KERNEL_ARCH=""])
  412. if test "x$ENABLED_LINUXKM" = "xyes"
  413. then
  414. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LINUXKM"
  415. ENABLED_NO_LIBRARY=yes
  416. ENABLED_BENCHMARK=no
  417. output_objdir="$(realpath "$output_objdir")/linuxkm"
  418. if test "$KERNEL_ROOT" = ""; then
  419. AC_PATH_DEFAULT_KERNEL_SOURCE
  420. KERNEL_ROOT="$DEFAULT_KERNEL_ROOT"
  421. fi
  422. AC_SUBST([KERNEL_ROOT])
  423. if test "$KERNEL_ARCH" = ""; then
  424. AC_DEFAULT_KERNEL_ARCH
  425. KERNEL_ARCH="$DEFAULT_KERNEL_ARCH"
  426. fi
  427. AC_SUBST([KERNEL_ARCH])
  428. if test "${KERNEL_ROOT}" = ""; then
  429. AC_MSG_ERROR([Linux kernel source root not found -- supply with --with-linux-source=PATH.])
  430. fi
  431. if test "${KERNEL_ARCH}" = ""; then
  432. AC_MSG_ERROR([Linux kernel target architecture for build tree ${KERNEL_ROOT} could not be determined. Is target kernel configured?])
  433. fi
  434. AM_CFLAGS="$AM_CFLAGS -DNO_DEV_RANDOM -DNO_WRITEV -DNO_STDIO_FILESYSTEM -DWOLFSSL_NO_SOCK -DWOLFSSL_USER_IO"
  435. fi
  436. # Single Precision maths implementation
  437. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
  438. then
  439. ENABLED_SP_DEFAULT=yes
  440. ENABLED_SP_MATH_ALL_DEFAULT=yes
  441. else
  442. ENABLED_SP_DEFAULT=no
  443. ENABLED_SP_MATH_ALL_DEFAULT=no
  444. fi
  445. AC_ARG_ENABLE([sp],
  446. [AS_HELP_STRING([--enable-sp],[Enable Single Precision maths implementation (default: disabled)])],
  447. [ ENABLED_SP=$enableval ],
  448. [ ENABLED_SP=$ENABLED_SP_DEFAULT ],
  449. )
  450. AC_ARG_ENABLE([sp-math-all],
  451. [AS_HELP_STRING([--enable-sp-math-all],[Enable Single Precision math implementation for full algorithm suite (default: disabled)])],
  452. [ ENABLED_SP_MATH_ALL=$enableval ],
  453. [ ENABLED_SP_MATH_ALL=$ENABLED_SP_MATH_ALL_DEFAULT ],
  454. )
  455. # Single Precision maths exclusively (no fastmath)
  456. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes" && test "$ENABLED_SP" != "no" && test "$ENABLED_SP_MATH_ALL" = "no"
  457. then
  458. ENABLED_SP_MATH_DEFAULT=yes
  459. else
  460. ENABLED_SP_MATH_DEFAULT=no
  461. fi
  462. AC_ARG_ENABLE([sp-math],
  463. [AS_HELP_STRING([--enable-sp-math],[Enable Single Precision math implementation with restricted algorithm suite (default: disabled)])],
  464. [ ENABLED_SP_MATH=$enableval ],
  465. [ ENABLED_SP_MATH=$ENABLED_SP_MATH_DEFAULT ],
  466. )
  467. AC_ARG_ENABLE([sp-asm],
  468. [AS_HELP_STRING([--enable-sp-asm],[Enable Single Precision assembly implementation (default: disabled)])],
  469. [ ENABLED_SP_ASM=$enableval ],
  470. [ ENABLED_SP_ASM=no ],
  471. )
  472. # ALL FEATURES
  473. AC_ARG_ENABLE([all],
  474. [AS_HELP_STRING([--enable-all],[Enable all wolfSSL features, except SSLv3 (default: disabled)])],
  475. [ ENABLED_ALL=$enableval ],
  476. [ ENABLED_ALL=no ]
  477. )
  478. if test "$ENABLED_ALL" = "yes"
  479. then
  480. test "$enable_dtls" = "" && enable_dtls=yes
  481. if test "x$FIPS_VERSION" != "xv1"
  482. then
  483. test "$enable_tls13" = "" && enable_tls13=yes
  484. test "$enable_rsapss" = "" && enable_rsapss=yes
  485. fi
  486. # this set is also enabled by enable-all-crypto:
  487. test "$enable_atomicuser" = "" && enable_atomicuser=yes
  488. test "$enable_aesgcm" = "" && enable_aesgcm=yes
  489. test "$enable_aesgcm_stream" = "" && enable_aesgcm_stream=yes
  490. test "$enable_aesccm" = "" && enable_aesccm=yes
  491. test "$enable_aesctr" = "" && enable_aesctr=yes
  492. test "$enable_aesofb" = "" && enable_aesofb=yes
  493. test "$enable_aescfb" = "" && enable_aescfb=yes
  494. test "$enable_aescbc_length_checks" = "" && enable_aescbc_length_checks=yes
  495. test "$enable_camellia" = "" && enable_camellia=yes
  496. test "$enable_ripemd" = "" && enable_ripemd=yes
  497. test "$enable_sha224" = "" && enable_sha224=yes
  498. test "$enable_sessioncerts" = "" && enable_sessioncerts=yes
  499. test "$enable_keygen" = "" && enable_keygen=yes
  500. test "$enable_certgen" = "" && enable_certgen=yes
  501. test "$enable_certreq" = "" && enable_certreq=yes
  502. test "$enable_certext" = "" && enable_certext=yes
  503. test "$enable_sep" = "" && enable_sep=yes
  504. test "$enable_hkdf" = "" && enable_hkdf=yes
  505. test "$enable_curve25519" = "" && enable_curve25519=yes
  506. test "$enable_curve448" = "" && enable_curve448=yes
  507. test "$enable_fpecc" = "" && enable_fpecc=yes
  508. test "$enable_eccencrypt" = "" && enable_eccencrypt=yes
  509. test "$enable_psk" = "" && enable_psk=yes
  510. test "$enable_cmac" = "" && enable_cmac=yes
  511. test "$enable_xts" = "" && enable_xts=yes
  512. test "$enable_ocsp" = "" && enable_ocsp=yes
  513. test "$enable_ocspstapling" = "" && enable_ocspstapling=yes
  514. test "$enable_ocspstapling2" = "" && enable_ocspstapling2=yes
  515. test "$enable_crl" = "" && enable_crl=yes
  516. test "$enable_supportedcurves" = "" && enable_supportedcurves=yes
  517. test "$enable_tlsx" = "" && enable_tlsx=yes
  518. test "$enable_pwdbased" = "" && enable_pwdbased=yes
  519. test "$enable_aeskeywrap" = "" && enable_aeskeywrap=yes
  520. test "$enable_x963kdf" = "" && enable_x963kdf=yes
  521. test "$enable_scrypt" = "" && enable_scrypt=yes
  522. test "$enable_indef" = "" && enable_indef=yes
  523. test "$enable_enckeys" = "" && enable_enckeys=yes
  524. test "$enable_hashflags" = "" && enable_hashflags=yes
  525. test "$enable_defaultdhparams" = "" && enable_defaultdhparams=yes
  526. test "$enable_base64encode" = "" && enable_base64encode=yes
  527. test "$enable_base16" = "" && enable_base16=yes
  528. test "$enable_arc4" = "" && enable_arc4=yes
  529. test "$enable_des3" = "" && enable_des3=yes
  530. test "$enable_nullcipher" = "" && enable_nullcipher=yes
  531. test "$enable_blake2" = "" && enable_blake2=yes
  532. test "$enable_blake2s" = "" && enable_blake2s=yes
  533. test "$enable_md2" = "" && enable_md2=yes
  534. test "$enable_md4" = "" && enable_md4=yes
  535. test "$enable_cryptocb" = "" && enable_cryptocb=yes
  536. test "$enable_anon" = "" && enable_anon=yes
  537. test "$enable_ssh" = "" && enable_ssh=yes
  538. test "$enable_savesession" = "" && enable_savesession=yes
  539. test "$enable_savecert" = "" && enable_savecert=yes
  540. test "$enable_postauth" = "" && enable_postauth=yes
  541. test "$enable_hrrcookie" = "" && enable_hrrcookie=yes
  542. test "$enable_fallback_scsv" = "" && enable_fallback_scsv=yes
  543. test "$enable_mcast" = "" && enable_mcast=yes
  544. test "$enable_webserver" = "" && enable_webserver=yes
  545. test "$enable_crl_monitor" = "" && enable_crl_monitor=yes
  546. test "$enable_sni" = "" && enable_sni=yes
  547. test "$enable_maxfragment" = "" && enable_maxfragment=yes
  548. test "$enable_alpn" = "" && enable_alpn=yes
  549. test "$enable_truncatedhmac" = "" && enable_truncatedhmac=yes
  550. test "$enable_trusted_ca" = "" && enable_trusted_ca=yes
  551. test "$enable_session_ticket" = "" && enable_session_ticket=yes
  552. test "$enable_earlydata" = "" && enable_earlydata=yes
  553. if test "$ENABLED_32BIT" != "yes"
  554. then
  555. test "$enable_sha512" = "" && enable_sha512=yes
  556. test "$enable_sha3" = "" && enable_sha3=yes
  557. fi
  558. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  559. then
  560. test "$enable_compkey" = "" && enable_compkey=yes
  561. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_IO -DHAVE_IO_TIMEOUT"
  562. fi
  563. # sp-math is incompatible with opensslextra, ECC custom curves, and DSA.
  564. if test "$ENABLED_SP_MATH" = "no"
  565. then
  566. test "$enable_dsa" = "" && enable_dsa=yes
  567. test "$enable_ecccustcurves" = "" && enable_ecccustcurves=yes
  568. test "$enable_srp" = "" && enable_srp=yes
  569. # linuxkm is incompatible with opensslextra and its dependents.
  570. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  571. then
  572. if test "$ENABLED_FIPS" = "no"
  573. then
  574. if test "$ENABLED_32BIT" != "yes"
  575. then
  576. test "$enable_openssh" = "" && enable_openssh=yes
  577. fi
  578. # S/MIME support requires PKCS7, which requires no FIPS.
  579. test "$enable_smime" = "" && enable_smime=yes
  580. fi
  581. test "$enable_opensslextra" = "" && enable_opensslextra=yes
  582. test "$enable_opensslall" = "" && enable_opensslall=yes
  583. test "$enable_certservice" = "" && enable_certservice=yes
  584. test "$enable_lighty" = "" && enable_lighty=yes
  585. test "$enable_nginx" = "" && enable_nginx=yes
  586. test "$enable_openvpn" = "" && enable_openvpn=yes
  587. test "$enable_asio" = "" && enable_asio=yes
  588. test "$enable_libwebsockets" = "" && enable_libwebsockets=yes
  589. test "$enable_qt" = "" && enable_qt=yes
  590. fi
  591. fi
  592. if test "$ENABLED_FIPS" = "no"
  593. then
  594. test "$enable_pkcallbacks" = "" && enable_pkcallbacks=yes
  595. test "$enable_xchacha" = "" && enable_xchacha=yes
  596. test "$enable_scep" = "" && enable_scep=yes
  597. test "$enable_pkcs7" = "" && enable_pkcs7=yes
  598. if test "$ENABLED_32BIT" != "yes"
  599. then
  600. test "$enable_ed25519" = "" && enable_ed25519=yes
  601. test "$enable_ed25519_stream" = "" && enable_ed25519_stream=yes
  602. test "$enable_ed448" = "" && enable_ed448=yes
  603. test "$enable_ed448_stream" = "" && enable_ed448_stream=yes
  604. fi
  605. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  606. then
  607. # these use DES3:
  608. test "$enable_stunnel" = "" && enable_stunnel=yes
  609. test "$enable_curl" = "" && enable_curl=yes
  610. test "$enable_tcpdump" = "" && enable_tcpdump=yes
  611. test "$enable_eccsi" = "" && enable_eccsi=yes
  612. test "$enable_sakke" = "" && enable_sakke=yes
  613. fi
  614. fi
  615. if test "$ENABLED_FIPS" = "no" || test "$ENABLED_FIPS" = "v5-dev"; then
  616. test "$enable_aessiv" = "" && enable_aessiv=yes
  617. fi
  618. # Enable DH const table speedups (eliminates `-lm` math lib dependency)
  619. AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072"
  620. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096
  621. # Enable multiple attribute additions such as DC
  622. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MULTI_ATTRIB"
  623. # Enable AES Decrypt, AES ECB
  624. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB"
  625. # Enable Alt Names, DER Load, Keep Certs, CRL IO with Timeout
  626. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_NAMES -DWOLFSSL_DER_LOAD -DKEEP_OUR_CERT -DKEEP_PEER_CERT"
  627. # Enable DH Extra
  628. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA"
  629. # Enable deterministic ECC signing API with variant
  630. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECDSA_DETERMINISTIC_K_VARIANT"
  631. # Store issuer name components when parsing certificates.
  632. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_ISSUER_NAMES"
  633. fi
  634. # ALL CRYPTO FEATURES
  635. AC_ARG_ENABLE([all-crypto],
  636. [AS_HELP_STRING([--enable-all-crypto],[Enable all wolfcrypt algorithms (default: disabled)])],
  637. [ ENABLED_ALL_CRYPT=$enableval ],
  638. [ ENABLED_ALL_CRYPT=no ]
  639. )
  640. if test "$ENABLED_ALL_CRYPT" = "yes"
  641. then
  642. test "$enable_atomicuser" = "" && enable_atomicuser=yes
  643. test "$enable_aesgcm" = "" && enable_aesgcm=yes
  644. test "$enable_aesgcm_stream" = "" && enable_aesgcm_stream=yes
  645. test "$enable_aesccm" = "" && enable_aesccm=yes
  646. test "$enable_aesctr" = "" && enable_aesctr=yes
  647. test "$enable_aesofb" = "" && enable_aesofb=yes
  648. test "$enable_aescfb" = "" && enable_aescfb=yes
  649. test "$enable_aescbc_length_checks" = "" && enable_aescbc_length_checks=yes
  650. test "$enable_camellia" = "" && enable_camellia=yes
  651. test "$enable_ripemd" = "" && enable_ripemd=yes
  652. test "$enable_sha224" = "" && enable_sha224=yes
  653. test "$enable_sessioncerts" = "" && enable_sessioncerts=yes
  654. test "$enable_keygen" = "" && enable_keygen=yes
  655. test "$enable_certgen" = "" && enable_certgen=yes
  656. test "$enable_certreq" = "" && enable_certreq=yes
  657. test "$enable_certext" = "" && enable_certext=yes
  658. test "$enable_sep" = "" && enable_sep=yes
  659. test "$enable_hkdf" = "" && enable_hkdf=yes
  660. test "$enable_curve25519" = "" && enable_curve25519=yes
  661. test "$enable_curve448" = "" && enable_curve448=yes
  662. test "$enable_fpecc" = "" && enable_fpecc=yes
  663. test "$enable_eccencrypt" = "" && enable_eccencrypt=yes
  664. test "$enable_psk" = "" && enable_psk=yes
  665. test "$enable_cmac" = "" && enable_cmac=yes
  666. test "$enable_siphash" = "" && enable_siphash=yes
  667. test "$enable_xts" = "" && enable_xts=yes
  668. test "$enable_ocsp" = "" && enable_ocsp=yes
  669. test "$enable_ocspstapling" = "" && enable_ocspstapling=yes
  670. test "$enable_ocspstapling2" = "" && enable_ocspstapling2=yes
  671. test "$enable_crl" = "" && enable_crl=yes
  672. test "$enable_supportedcurves" = "" && enable_supportedcurves=yes
  673. test "$enable_tlsx" = "" && enable_tlsx=yes
  674. test "$enable_pwdbased" = "" && enable_pwdbased=yes
  675. test "$enable_aeskeywrap" = "" && enable_aeskeywrap=yes
  676. test "$enable_x963kdf" = "" && enable_x963kdf=yes
  677. test "$enable_scrypt" = "" && enable_scrypt=yes
  678. test "$enable_indef" = "" && enable_indef=yes
  679. test "$enable_enckeys" = "" && enable_enckeys=yes
  680. test "$enable_hashflags" = "" && enable_hashflags=yes
  681. test "$enable_defaultdhparams" = "" && enable_defaultdhparams=yes
  682. test "$enable_base64encode" = "" && enable_base64encode=yes
  683. test "$enable_base16" = "" && enable_base16=yes
  684. test "$enable_arc4" = "" && enable_arc4=yes
  685. test "$enable_des3" = "" && enable_des3=yes
  686. test "$enable_nullcipher" = "" && enable_nullcipher=yes
  687. test "$enable_blake2" = "" && enable_blake2=yes
  688. test "$enable_blake2s" = "" && enable_blake2s=yes
  689. test "$enable_md2" = "" && enable_md2=yes
  690. test "$enable_md4" = "" && enable_md4=yes
  691. test "$enable_cryptocb" = "" && enable_cryptocb=yes
  692. test "$enable_anon" = "" && enable_anon=yes
  693. test "$enable_ssh" = "" && enable_ssh=yes
  694. if test "$ENABLED_32BIT" != "yes"
  695. then
  696. test "$enable_sha512" = "" && enable_sha512=yes
  697. test "$enable_sha3" = "" && enable_sha3=yes
  698. fi
  699. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  700. then
  701. test "$enable_compkey" = "" && enable_compkey=yes
  702. fi
  703. if test "$ENABLED_SP_MATH" = "no"
  704. then
  705. test "$enable_dsa" = "" && enable_dsa=yes
  706. test "$enable_ecccustcurves" = "" && enable_ecccustcurves=yes
  707. test "$enable_srp" = "" && enable_srp=yes
  708. fi
  709. if test "$ENABLED_FIPS" = "no"
  710. then
  711. test "$enable_pkcallbacks" = "" && enable_pkcallbacks=yes
  712. test "$enable_xchacha" = "" && enable_xchacha=yes
  713. test "$enable_pkcs7" = "" && enable_pkcs7=yes
  714. if test "$ENABLED_32BIT" != "yes"
  715. then
  716. test "$enable_ed25519" = "" && enable_ed25519=yes
  717. test "$enable_ed25519_stream" = "" && enable_ed25519_stream=yes
  718. test "$enable_ed448" = "" && enable_ed448=yes
  719. test "$enable_ed448_stream" = "" && enable_ed448_stream=yes
  720. fi
  721. if test "$ENABLED_LINUXKM_DEFAULTS" != "yes"
  722. then
  723. test "$enable_eccsi" = "" && enable_eccsi=yes
  724. test "$enable_sakke" = "" && enable_sakke=yes
  725. fi
  726. fi
  727. if test "$ENABLED_FIPS" = "no" || test "$ENABLED_FIPS" = "v5-dev"; then
  728. test "$enable_aessiv" = "" && enable_aessiv=yes
  729. fi
  730. # Enable AES Decrypt, AES ECB, Alt Names, DER Load
  731. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_DECRYPT -DHAVE_AES_ECB -DWOLFSSL_ALT_NAMES -DWOLFSSL_DER_LOAD"
  732. # Enable DH const table speedups (eliminates `-lm` math lib dependency)
  733. AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048 -DHAVE_FFDHE_3072"
  734. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096
  735. # Enable multiple attribute additions such as DC
  736. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MULTI_ATTRIB"
  737. fi
  738. # SINGLE THREADED
  739. AC_ARG_ENABLE([singlethreaded],
  740. [AS_HELP_STRING([--enable-singlethreaded],[Enable wolfSSL single threaded (default: disabled)])],
  741. [ ENABLED_SINGLETHREADED=$enableval ],
  742. [ ENABLED_SINGLETHREADED=no ])
  743. AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xno" ],[
  744. AX_PTHREAD([
  745. AC_DEFINE([HAVE_PTHREAD], [1], [Define if you have POSIX threads libraries and header files.])
  746. # If AX_PTHREAD is adding -Qunused-arguments, need to prepend with -Xcompiler libtool will use it. Newer
  747. # versions of clang don't need the -Q flag when using pthreads.
  748. AS_CASE([$PTHREAD_CFLAGS],[-Qunused-arguments*],[PTHREAD_CFLAGS="-Xcompiler $PTHREAD_CFLAGS"])
  749. AM_CFLAGS="$AM_CFLAGS -D_POSIX_THREADS $PTHREAD_CFLAGS"
  750. LIBS="$LIBS $PTHREAD_LIBS"
  751. ],[
  752. ENABLED_SINGLETHREADED=yes
  753. ])
  754. ])
  755. AS_IF([ test "x$ENABLED_SINGLETHREADED" = "xyes" ],[ AM_CFLAGS="$AM_CFLAGS -DSINGLE_THREADED" ])
  756. # DTLS
  757. # DTLS is a prereq for the options mcast, sctp, and jni. Enabling any of those
  758. # without DTLS will also enable DTLS.
  759. AC_ARG_ENABLE([dtls],
  760. [AS_HELP_STRING([--enable-dtls],[Enable wolfSSL DTLS (default: disabled)])],
  761. [ ENABLED_DTLS=$enableval ],
  762. [ ENABLED_DTLS=no ]
  763. )
  764. if test "$ENABLED_DTLS" = "yes"
  765. then
  766. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  767. fi
  768. # DTLS change MTU
  769. AC_ARG_ENABLE([dtls-mtu],
  770. [AS_HELP_STRING([--enable-dtls-mtu],[Enable setting the MTU size for wolfSSL DTLS (default: disabled)])],
  771. [ ENABLED_DTLS_MTU=$enableval ],
  772. [ ENABLED_DTLS_MTU=no ]
  773. )
  774. if test "$ENABLED_DTLS_MTU" = "yes"
  775. then
  776. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS_MTU"
  777. fi
  778. # TLS v1.3 Draft 18 (Note: only final TLS v1.3 supported, here for backwards build compatibility)
  779. AC_ARG_ENABLE([tls13-draft18],
  780. [AS_HELP_STRING([--enable-tls13-draft18],[Enable wolfSSL TLS v1.3 Draft 18 (default: disabled)])],
  781. [ ENABLED_TLS13_DRAFT18=$enableval ],
  782. [ ENABLED_TLS13_DRAFT18=no ]
  783. )
  784. # TLS v1.3
  785. AC_ARG_ENABLE([tls13],
  786. [AS_HELP_STRING([--enable-tls13],[Enable wolfSSL TLS v1.3 (default: enabled)])],
  787. [ ENABLED_TLS13=$enableval ],
  788. [ ENABLED_TLS13=yes ]
  789. )
  790. if test "x$FIPS_VERSION" = "xv1" ||
  791. ( test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" = 1 )
  792. then
  793. ENABLED_TLS13="no"
  794. fi
  795. # Post-handshake Authentication
  796. AC_ARG_ENABLE([postauth],
  797. [AS_HELP_STRING([--enable-postauth],[Enable wolfSSL Post-handshake Authentication (default: disabled)])],
  798. [ ENABLED_TLS13_POST_AUTH=$enableval ],
  799. [ ENABLED_TLS13_POST_AUTH=no ]
  800. )
  801. if test "$ENABLED_TLS13_POST_AUTH" = "yes"
  802. then
  803. if test "x$ENABLED_TLS13" = "xno"
  804. then
  805. AC_MSG_NOTICE([TLS 1.3 is disabled - disabling Post-handshake Authentication])
  806. ENABLED_TLS13_POST_AUTH="no"
  807. else
  808. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_POST_HANDSHAKE_AUTH"
  809. fi
  810. fi
  811. # Hello Retry Request Cookie
  812. AC_ARG_ENABLE([hrrcookie],
  813. [AS_HELP_STRING([--enable-hrrcookie],[Enable the server to send Cookie Extension in HRR with state (default: disabled)])],
  814. [ ENABLED_SEND_HRR_COOKIE=$enableval ],
  815. [ ENABLED_SEND_HRR_COOKIE=no ]
  816. )
  817. if test "$ENABLED_SEND_HRR_COOKIE" = "yes"
  818. then
  819. if test "x$ENABLED_TLS13" = "xno"
  820. then
  821. AC_MSG_NOTICE([TLS 1.3 is disabled - disabling HRR Cookie])
  822. ENABLED_SEND_HRR_COOKIE="no"
  823. else
  824. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SEND_HRR_COOKIE"
  825. fi
  826. fi
  827. # RNG
  828. AC_ARG_ENABLE([rng],
  829. [AS_HELP_STRING([--enable-rng],[Enable compiling and using RNG (default: enabled)])],
  830. [ ENABLED_RNG=$enableval ],
  831. [ ENABLED_RNG=yes ]
  832. )
  833. if test "$ENABLED_RNG" = "no"
  834. then
  835. AM_CFLAGS="$AM_CFLAGS -DWC_NO_RNG"
  836. fi
  837. # DTLS-SCTP
  838. AC_ARG_ENABLE([sctp],
  839. [AS_HELP_STRING([--enable-sctp],[Enable wolfSSL DTLS-SCTP support (default: disabled)])],
  840. [ENABLED_SCTP=$enableval],
  841. [ENABLED_SCTP=no])
  842. AS_IF([test "x$ENABLED_SCTP" = "xyes"],
  843. [AC_MSG_CHECKING([for SCTP])
  844. AC_RUN_IFELSE(
  845. [AC_LANG_PROGRAM(
  846. [[
  847. #include <sys/socket.h>
  848. #include <arpa/inet.h>
  849. ]],
  850. [[int s = socket(AF_INET, SOCK_STREAM, IPPROTO_SCTP); if (s == -1) return 1;]])],
  851. [AC_MSG_RESULT(yes)],
  852. [AC_MSG_RESULT(no)
  853. AC_MSG_ERROR([SCTP not available, remove enable-sctp from configure])],
  854. : ,
  855. : ,
  856. : )])
  857. # DTLS-SRTP
  858. AC_ARG_ENABLE([srtp],
  859. [AS_HELP_STRING([--enable-srtp],[Enable wolfSSL DTLS-SRTP support (default: disabled)])],
  860. [ENABLED_SRTP=$enableval],
  861. [ENABLED_SRTP=no])
  862. # DTLS-MULTICAST
  863. AC_ARG_ENABLE([mcast],
  864. [AS_HELP_STRING([--enable-mcast],[Enable wolfSSL DTLS multicast support (default: disabled)])],
  865. [ENABLED_MCAST=$enableval],
  866. [ENABLED_MCAST=no])
  867. # List of open source project defines using our openssl compatibility layer:
  868. # bind dns (--enable-bind) WOLFSSL_BIND
  869. # libssh2 (--enable-libssh2)
  870. # openssh (--enable-openssh) WOLFSSL_OPENSSH
  871. # openvpn (--enable-openvpn) WOLFSSL_OPENVPN
  872. # nginx (--enable-nginx) WOLFSSL_NGINX
  873. # ntp (--enable-ntp)
  874. # openresty (--enable-openresty)
  875. # haproxy (--enable-haproxy) WOLFSSL_HAPROXY
  876. # wpa_supplicant (--enable-wpas) WOLFSSL_WPAS
  877. # ssl fortress (--enable-fortress) FORTRESS
  878. # ssl bump (--enable-bump)
  879. # signal (--enable-signal)
  880. # lighty (--enable-lighty) HAVE_LIGHTY
  881. # rsyslog (--enable-rsyslog)
  882. # stunnel (--enable-stunnel) HAVE_STUNNEL
  883. # curl (--enable-curl) HAVE_CURL
  884. # libest (--enable-libest) HAVE_LIBEST
  885. # asio (--enable-asio) WOLFSSL_ASIO
  886. # libwebsockets (--enable-libwebsockets) WOLFSSL_LIBWEBSOCKETS
  887. # qt (--enable-qt) WOLFSSL_QT
  888. # qt test (--enable-qt-test) WOLFSSL_QT_TEST
  889. # HAVE_POCO_LIB
  890. # WOLFSSL_MYSQL_COMPATIBLE
  891. # web server (--enable-webserver) HAVE_WEBSERVER
  892. # net-snmp (--enable-net-snmp)
  893. # krb (--enable-krb) WOLFSSL_KRB
  894. # FFmpeg (--enable-ffmpeg) WOLFSSL_FFMPEG
  895. # Bind DNS compatibility Build
  896. AC_ARG_ENABLE([bind],
  897. [AS_HELP_STRING([--enable-bind],[Enable Bind DNS compatibility build (default: disabled)])],
  898. [ENABLED_BIND=$enableval],
  899. [ENABLED_BIND=no])
  900. AC_ARG_ENABLE([libssh2],
  901. [AS_HELP_STRING([--enable-libssh2],[Enable libssh2 compatibility build (default: disabled)])],
  902. [ENABLED_LIBSSH2=$enableval],
  903. [ENABLED_LIBSSH2=no])
  904. # OpenSSH compatibility Build
  905. AC_ARG_ENABLE([openssh],
  906. [AS_HELP_STRING([--enable-openssh],[Enable OpenSSH compatibility build (default: disabled)])],
  907. [ENABLED_OPENSSH=$enableval],
  908. [ENABLED_OPENSSH=no])
  909. # OpenVPN compatibility Build
  910. AC_ARG_ENABLE([openvpn],
  911. [AS_HELP_STRING([--enable-openvpn],[Enable OpenVPN compatibility build (default: disabled)])],
  912. [ENABLED_OPENVPN=$enableval],
  913. [ENABLED_OPENVPN=no])
  914. # openresty compatibility build
  915. AC_ARG_ENABLE([openresty],
  916. [AS_HELP_STRING([--enable-openresty],[Enable openresty (default: disabled)])],
  917. [ ENABLED_OPENRESTY=$enableval ],
  918. [ ENABLED_OPENRESTY=no ]
  919. )
  920. # nginx compatibility build
  921. AC_ARG_ENABLE([nginx],
  922. [AS_HELP_STRING([--enable-nginx],[Enable nginx (default: disabled)])],
  923. [ ENABLED_NGINX=$enableval ],
  924. [ ENABLED_NGINX=no ]
  925. )
  926. # chrony support. Needs the compatibility layer for SNI callback functionality,
  927. # but otherwise uses pure wolfCrypt.
  928. AC_ARG_ENABLE([chrony],
  929. [AS_HELP_STRING([--enable-chrony],[Enable chrony support (default: disabled)])],
  930. [ ENABLED_CHRONY=$enableval ],
  931. [ ENABLED_CHRONY=no ]
  932. )
  933. if test "$ENABLED_CHRONY" = "yes"
  934. then
  935. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  936. fi
  937. if test "$ENABLED_OPENRESTY" = "yes"
  938. then
  939. ENABLED_NGINX="yes"
  940. fi
  941. # lighty Support
  942. AC_ARG_ENABLE([lighty],
  943. [AS_HELP_STRING([--enable-lighty],[Enable lighttpd/lighty (default: disabled)])],
  944. [ ENABLED_LIGHTY=$enableval ],
  945. [ ENABLED_LIGHTY=no ]
  946. )
  947. # rsyslog Support
  948. AC_ARG_ENABLE([rsyslog],
  949. [AS_HELP_STRING([--enable-rsyslog],[Enable rsyslog (default: disabled)])],
  950. [ ENABLED_RSYSLOG=$enableval ],
  951. [ ENABLED_RSYSLOG=no ]
  952. )
  953. # haproxy compatibility build
  954. AC_ARG_ENABLE([haproxy],
  955. [AS_HELP_STRING([--enable-haproxy],[Enable haproxy (default: disabled)])],
  956. [ ENABLED_HAPROXY=$enableval ],
  957. [ ENABLED_HAPROXY=no ]
  958. )
  959. # wpa_supplicant support
  960. AC_ARG_ENABLE([wpas],
  961. [AS_HELP_STRING([--enable-wpas],[Enable wpa_supplicant support (default: disabled)])],
  962. [ ENABLED_WPAS=$enableval ],
  963. [ ENABLED_WPAS=no ]
  964. )
  965. # wpa_supplicant support
  966. AC_ARG_ENABLE([wpas-dpp],
  967. [AS_HELP_STRING([--enable-wpas-dpp],[Enable wpa_supplicant support with dpp (default: disabled)])],
  968. [ ENABLED_WPAS_DPP=$enableval ],
  969. [ ENABLED_WPAS_DPP=no ]
  970. )
  971. # ntp support
  972. AC_ARG_ENABLE([ntp],
  973. [AS_HELP_STRING([--enable-ntp],[Enable ntp support (default: disabled)])],
  974. [ ENABLED_NTP=$enableval ],
  975. [ ENABLED_NTP=no ]
  976. )
  977. if test "$ENABLED_WPAS_DPP" = "yes"
  978. then
  979. ENABLED_WPAS="yes"
  980. fi
  981. # Fortress build
  982. AC_ARG_ENABLE([fortress],
  983. [AS_HELP_STRING([--enable-fortress],[Enable SSL fortress build (default: disabled)])],
  984. [ ENABLED_FORTRESS=$enableval ],
  985. [ ENABLED_FORTRESS=no ]
  986. )
  987. # libwebsockets Support
  988. AC_ARG_ENABLE([libwebsockets],
  989. [AS_HELP_STRING([--enable-libwebsockets],[Enable libwebsockets (default: disabled)])],
  990. [ ENABLED_LIBWEBSOCKETS=$enableval ],
  991. [ ENABLED_LIBWEBSOCKETS=no ]
  992. )
  993. if test "$ENABLED_LIBWEBSOCKETS" = "yes"
  994. then
  995. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LIBWEBSOCKETS -DHAVE_EX_DATA -DOPENSSL_NO_EC"
  996. fi
  997. if test "$ENABLED_OPENSSH" = "yes"
  998. then
  999. ENABLED_FORTRESS="yes"
  1000. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_OPENSSH -DHAVE_EX_DATA -DWOLFSSL_BASE16"
  1001. fi
  1002. # net-snmp Build
  1003. AC_ARG_ENABLE([net-snmp],
  1004. [AS_HELP_STRING([--enable-net-snmp],[Enable net-snmp (default: disabled)])],
  1005. [ ENABLED_NETSNMP=$enableval ],
  1006. [ ENABLED_NETSNMP=no ]
  1007. )
  1008. # kerberos 5 Build
  1009. AC_ARG_ENABLE([krb],
  1010. [AS_HELP_STRING([--enable-krb],[Enable kerberos 5 support (default: disabled)])],
  1011. [ ENABLED_KRB=$enableval ],
  1012. [ ENABLED_KRB=no ]
  1013. )
  1014. # FFmpeg Build
  1015. AC_ARG_ENABLE([ffmpeg],
  1016. [AS_HELP_STRING([--enable-ffmpeg],[Enable FFmpeg support (default: disabled)])],
  1017. [ ENABLED_FFMPEG=$enableval ],
  1018. [ ENABLED_FFMPEG=no ]
  1019. )
  1020. #IP alternative name Support
  1021. AC_ARG_ENABLE([ip-alt-name],
  1022. [AS_HELP_STRING([--enable-ip-alt-name],[Enable IP subject alternative name (default: disabled)])],
  1023. [ ENABLE_IP_ALT_NAME=$enableval ],
  1024. [ ENABLE_IP_ALT_NAME=no ]
  1025. )
  1026. if test "$ENABLE_IP_ALT_NAME" = "yes"
  1027. then
  1028. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IP_ALT_NAME"
  1029. fi
  1030. #Qt Support
  1031. AC_ARG_ENABLE([qt],
  1032. [AS_HELP_STRING([--enable-qt],[Enable qt (default: disabled)])],
  1033. [ ENABLED_QT=$enableval ],
  1034. [ ENABLED_QT=no ]
  1035. )
  1036. # ssl bump build
  1037. AC_ARG_ENABLE([bump],
  1038. [AS_HELP_STRING([--enable-bump],[Enable SSL Bump build (default: disabled)])],
  1039. [ ENABLED_BUMP=$enableval ],
  1040. [ ENABLED_BUMP=no ]
  1041. )
  1042. # SNIFFER
  1043. AC_ARG_ENABLE([sniffer],
  1044. [AS_HELP_STRING([--enable-sniffer],[Enable wolfSSL sniffer support (default: disabled)])],
  1045. [ ENABLED_SNIFFER=$enableval ],
  1046. [ ENABLED_SNIFFER=no ]
  1047. )
  1048. # signal compatibility build
  1049. AC_ARG_ENABLE([signal],
  1050. [AS_HELP_STRING([--enable-signal],[Enable signal (default: disabled)])],
  1051. [ ENABLED_SIGNAL=$enableval ],
  1052. [ ENABLED_SIGNAL=no ]
  1053. )
  1054. # OpenSSL Coexist
  1055. AC_ARG_ENABLE([opensslcoexist],
  1056. [AS_HELP_STRING([--enable-opensslcoexist],[Enable coexistence of wolfssl/openssl (default: disabled)])],
  1057. [ ENABLED_OPENSSLCOEXIST=$enableval ],
  1058. [ ENABLED_OPENSSLCOEXIST=no ]
  1059. )
  1060. if test "x$ENABLED_OPENSSLCOEXIST" = "xyes" || test "$ENABLED_WOLFENGINE" = "yes"
  1061. then
  1062. # make sure old names are disabled
  1063. enable_oldnames=no
  1064. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COEXIST"
  1065. fi
  1066. # S/MIME
  1067. AC_ARG_ENABLE([smime],
  1068. [AS_HELP_STRING([--enable-smime],[Enable S/MIME (default: disabled)])],
  1069. [ ENABLED_SMIME=$enableval ],
  1070. [ ENABLED_SMIME=no ]
  1071. )
  1072. # Platform Security Architecture (PSA)
  1073. AC_ARG_ENABLE([psa],
  1074. [AS_HELP_STRING([--enable-psa],[use Platform Security Architecture (PSA) interface (default: disabled)])],
  1075. [ ENABLED_PSA=$enableval ],
  1076. [ ENABLED_PSA=no ]
  1077. )
  1078. AC_ARG_WITH([psa-include],
  1079. [AS_HELP_STRING([--with-psa-include=PATH],
  1080. [PATH to directory with PSA header files])],
  1081. [PSA_INCLUDE=$withval],
  1082. [PSA_INCLUDE=""])
  1083. AC_ARG_WITH([psa-lib],
  1084. [AS_HELP_STRING([--with-psa-lib=PATH],[PATH to directory with the PSA library])],
  1085. [PSA_LIB=$withval],
  1086. [PSA_LIB=""])
  1087. AC_ARG_WITH([psa-lib-name],
  1088. [AS_HELP_STRING([--with-psa-lib-name=NAME],[NAME of PSA library])],
  1089. [PSA_LIB_NAME=$withval],
  1090. [PSA_LIB_NAME=""])
  1091. AC_ARG_ENABLE([psa-lib-static],
  1092. [AS_HELP_STRING([--enable-psa-lib-static],[Link PSA as static library (default: disable)])],
  1093. [ ENABLED_PSA_STATIC=$enableval ],
  1094. [ ENABLED_PSA_STATIC=no ]
  1095. )
  1096. if test "x$ENABLED_PSA" = "xyes"
  1097. then
  1098. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_PSA"
  1099. fi
  1100. if test "x$ENABLED_PSA" != "xyes" && \
  1101. (test "x$PSA_LIB"! = "x" || test "x$PSA_INCLUDE" != "x" || test "x$PSA_LIB_NAME" != "x" )
  1102. then
  1103. AC_MSG_ERROR([to use PSA you need to enable it with --enable-psa])
  1104. fi
  1105. if test -n "$PSA_LIB"
  1106. then
  1107. AC_MSG_CHECKING([for $PSA_LIB])
  1108. if ! test -d "$PSA_LIB"
  1109. then
  1110. AC_MSG_ERROR([PSA lib dir $PSA_LIB not found.])
  1111. fi
  1112. AC_MSG_RESULT([yes])
  1113. AM_LDFLAGS="$AM_LDFLAGS -L$PSA_LIB"
  1114. fi
  1115. if test -n "$PSA_LIB_NAME"
  1116. then
  1117. if test "x$ENABLED_PSA_STATIC" = "xyes"
  1118. then
  1119. LIB_STATIC_ADD="$LIB_STATIC_ADD $PSA_LIB/$PSA_LIB_NAME"
  1120. else
  1121. LIB_ADD="$LIB_ADD -l$PSA_LIB_NAME"
  1122. fi
  1123. fi
  1124. if test -n "$PSA_INCLUDE"
  1125. then
  1126. AC_MSG_CHECKING([for $PSA_INCLUDE])
  1127. if ! test -d "$PSA_INCLUDE"
  1128. then
  1129. AC_MSG_ERROR([psa include dir $PSA_INCLUDE not found.])
  1130. fi
  1131. AC_MSG_RESULT([yes])
  1132. AM_CFLAGS="$AM_CFLAGS -I$PSA_INCLUDE"
  1133. fi
  1134. AC_SUBST([PSA_LIB])
  1135. AC_SUBST([PSA_LIB_NAME])
  1136. AC_SUBST([PSA_INCLUDE])
  1137. # OPENSSL Compatibility ALL
  1138. AC_ARG_ENABLE([opensslall],
  1139. [AS_HELP_STRING([--enable-opensslall],[Enable all OpenSSL API, size++ (default: disabled)])],
  1140. [ ENABLED_OPENSSLALL=$enableval ],
  1141. [ ENABLED_OPENSSLALL=no ]
  1142. )
  1143. if test "$ENABLED_LIBWEBSOCKETS" = "yes" || test "$ENABLED_OPENVPN" = "yes" || \
  1144. test "$ENABLED_WPAS_DPP" = "yes" || test "$ENABLED_SMIME" = "yes" || \
  1145. test "$ENABLED_HAPROXY" = "yes" || test "$ENABLED_BIND" = "yes" || \
  1146. test "$ENABLED_NTP" = "yes" || test "$ENABLED_NETSNMP" = "yes" || \
  1147. test "$ENABLED_OPENRESTY" = "yes" || test "$ENABLED_RSYSLOG" = "yes" || \
  1148. test "$ENABLED_KRB" = "yes" || test "$ENABLED_CHRONY" = "yes" || \
  1149. test "$ENABLED_FFMPEG" = "yes"
  1150. then
  1151. ENABLED_OPENSSLALL="yes"
  1152. fi
  1153. # OPENSSL Extra Compatibility
  1154. AC_ARG_ENABLE([opensslextra],
  1155. [AS_HELP_STRING([--enable-opensslextra],[Enable extra OpenSSL API, size+ (default: disabled)])],
  1156. [ ENABLED_OPENSSLEXTRA=$enableval ],
  1157. [ ENABLED_OPENSSLEXTRA=no ]
  1158. )
  1159. # One Error Queue per Thread
  1160. AC_ARG_ENABLE([error-queue-per-thread],
  1161. [AS_HELP_STRING([--enable-error-queue-per-thread],[Enable one error queue per thread. Requires thread local storage. (default: disabled)])],
  1162. [ ENABLED_ERRORQUEUEPERTHREAD=$enableval ],
  1163. [ ENABLED_ERRORQUEUEPERTHREAD=no ]
  1164. )
  1165. if test "$ENABLED_ERRORQUEUEPERTHREAD" = "yes"
  1166. then
  1167. AM_CFLAGS="$AM_CFLAGS -DERROR_QUEUE_PER_THREAD"
  1168. fi
  1169. # High Strength Build
  1170. AC_ARG_ENABLE([maxstrength],
  1171. [AS_HELP_STRING([--enable-maxstrength],[Enable Max Strength build, allows TLSv1.2-AEAD-PFS ciphers only (default: disabled)])],
  1172. [ENABLED_MAXSTRENGTH=$enableval],
  1173. [ENABLED_MAXSTRENGTH=no])
  1174. # Harden, enable Timing Resistance and Blinding by default
  1175. AC_ARG_ENABLE([harden],
  1176. [AS_HELP_STRING([--enable-harden],[Enable Hardened build, Enables Timing Resistance and Blinding (default: enabled)])],
  1177. [ENABLED_HARDEN=$enableval],
  1178. [ENABLED_HARDEN=yes])
  1179. if test "$ENABLED_HARDEN" = "yes"
  1180. then
  1181. AM_CFLAGS="$AM_CFLAGS -DTFM_TIMING_RESISTANT -DECC_TIMING_RESISTANT"
  1182. if test "$ENABLED_RNG" = "yes"
  1183. then
  1184. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_BLINDING"
  1185. fi
  1186. else
  1187. AM_CFLAGS="$AM_CFLAGS -DWC_NO_HARDEN"
  1188. fi
  1189. # IPv6 Test Apps
  1190. AC_ARG_ENABLE([ipv6],
  1191. [AS_HELP_STRING([--enable-ipv6],[Enable testing of IPV6 (default: disabled)])],
  1192. [ ENABLED_IPV6=$enableval ],
  1193. [ ENABLED_IPV6=no ]
  1194. )
  1195. if test "$ENABLED_IPV6" = "yes"
  1196. then
  1197. AM_CFLAGS="$AM_CFLAGS -DTEST_IPV6 -DWOLFSSL_IPV6"
  1198. fi
  1199. if test "$ENABLED_WPAS" = "small"
  1200. then
  1201. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WPAS_SMALL"
  1202. fi
  1203. if test "$ENABLED_WPAS" = "yes"
  1204. then
  1205. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WPAS"
  1206. AM_CFLAGS="$AM_CFLAGS -DHAVE_SECRET_CALLBACK"
  1207. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_ECC_ADD_DBL"
  1208. fi
  1209. if test "$ENABLED_WPAS" != "no"
  1210. then
  1211. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_VERIFY_CB"
  1212. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  1213. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  1214. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE"
  1215. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE"
  1216. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
  1217. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
  1218. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DER_LOAD"
  1219. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  1220. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  1221. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB"
  1222. AM_CFLAGS="$AM_CFLAGS -DKEEP_OUR_CERT"
  1223. AM_CFLAGS="$AM_CFLAGS -DKEEP_PEER_CERT"
  1224. AM_CFLAGS="$AM_CFLAGS -DHAVE_KEYING_MATERIAL"
  1225. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE_REF"
  1226. fi
  1227. if test "$ENABLED_FORTRESS" = "yes"
  1228. then
  1229. AM_CFLAGS="$AM_CFLAGS -DFORTRESS -DWOLFSSL_ALWAYS_VERIFY_CB -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT -DWOLFSSL_DER_LOAD -DWOLFSSL_KEY_GEN"
  1230. fi
  1231. if test "$ENABLED_BUMP" = "yes"
  1232. then
  1233. AM_CFLAGS="$AM_CFLAGS -DLARGE_STATIC_BUFFERS -DWOLFSSL_CERT_GEN -DWOLFSSL_KEY_GEN -DHUGE_SESSION_CACHE -DWOLFSSL_DER_LOAD -DWOLFSSL_ALT_NAMES -DWOLFSSL_TEST_CERT"
  1234. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=4096
  1235. fi
  1236. ENABLED_SLOWMATH="yes"
  1237. # lean psk build
  1238. AC_ARG_ENABLE([leanpsk],
  1239. [AS_HELP_STRING([--enable-leanpsk],[Enable Lean PSK build (default: disabled)])],
  1240. [ ENABLED_LEANPSK=$enableval ],
  1241. [ ENABLED_LEANPSK=no ]
  1242. )
  1243. if test "$ENABLED_LEANPSK" = "yes"
  1244. then
  1245. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANPSK -DWOLFSSL_STATIC_PSK -DHAVE_NULL_CIPHER -DSINGLE_THREADED -DNO_AES -DNO_FILESYSTEM -DNO_RSA -DNO_DSA -DNO_DH -DNO_PWDBASED -DNO_MD4 -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_WRITEV -DNO_DEV_RANDOM -DWOLFSSL_USER_IO -DNO_SHA"
  1246. ENABLED_SLOWMATH="no"
  1247. ENABLED_SINGLETHREADED="yes"
  1248. enable_lowresource=yes
  1249. fi
  1250. # lean TLS build (TLS 1.2 client only (no client auth), ECC256, AES128 and SHA256 w/o Shamir)
  1251. AC_ARG_ENABLE([leantls],
  1252. [AS_HELP_STRING([--enable-leantls],[Enable Lean TLS build (default: disabled)])],
  1253. [ ENABLED_LEANTLS=$enableval ],
  1254. [ ENABLED_LEANTLS=no ]
  1255. )
  1256. if test "$ENABLED_LEANTLS" = "yes"
  1257. then
  1258. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_LEANTLS -DNO_WRITEV -DHAVE_ECC -DTFM_ECC256 -DECC_USER_CURVES -DNO_WOLFSSL_SERVER -DNO_RSA -DNO_DSA -DNO_DH -DNO_PWDBASED -DNO_MD5 -DNO_ERROR_STRINGS -DNO_OLD_TLS -DNO_RC4 -DNO_SHA -DNO_PSK -DNO_WOLFSSL_MEMORY -DNO_WOLFSSL_CM_VERIFY"
  1259. enable_lowresource=yes
  1260. fi
  1261. # low resource options to reduce flash and memory use
  1262. AC_ARG_ENABLE([lowresource],
  1263. [AS_HELP_STRING([--enable-lowresource],[Enable low resource options for memory/flash (default: disabled)])],
  1264. [ ENABLED_LOWRESOURCE=$enableval ],
  1265. [ ENABLED_LOWRESOURCE=no ]
  1266. )
  1267. if test "$ENABLED_LOWRESOURCE" = "yes"
  1268. then
  1269. # low memory / flash flags
  1270. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE -DRSA_LOW_MEM -DGCM_SMALL -DCURVE25519_SMALL -DED25519_SMALL -DWOLFSSL_SMALL_CERT_VERIFY"
  1271. # low flash flags
  1272. AM_CFLAGS="$AM_CFLAGS -DUSE_SLOW_SHA -DUSE_SLOW_SHA256 -DUSE_SLOW_SHA512"
  1273. fi
  1274. # TITAN cache
  1275. AC_ARG_ENABLE([titancache],
  1276. [AS_HELP_STRING([--enable-titancache],[Enable titan session cache (default: disabled)])],
  1277. [ ENABLED_TITANCACHE=$enableval ],
  1278. [ ENABLED_TITANCACHE=no ]
  1279. )
  1280. if test "$ENABLED_TITANCACHE" = "yes"
  1281. then
  1282. AM_CFLAGS="$AM_CFLAGS -DTITAN_SESSION_CACHE"
  1283. fi
  1284. # HUGE cache
  1285. AC_ARG_ENABLE([hugecache],
  1286. [AS_HELP_STRING([--enable-hugecache],[Enable huge session cache (default: disabled)])],
  1287. [ ENABLED_HUGECACHE=$enableval ],
  1288. [ ENABLED_HUGECACHE=no ]
  1289. )
  1290. if test "$ENABLED_HUGECACHE" = "yes"
  1291. then
  1292. AM_CFLAGS="$AM_CFLAGS -DHUGE_SESSION_CACHE"
  1293. fi
  1294. # big cache
  1295. AC_ARG_ENABLE([bigcache],
  1296. [AS_HELP_STRING([--enable-bigcache],[Enable big session cache (default: disabled)])],
  1297. [ ENABLED_BIGCACHE=$enableval ],
  1298. [ ENABLED_BIGCACHE=no ]
  1299. )
  1300. if test "$ENABLED_BIGCACHE" = "yes"
  1301. then
  1302. AM_CFLAGS="$AM_CFLAGS -DBIG_SESSION_CACHE"
  1303. fi
  1304. # SMALL cache
  1305. AC_ARG_ENABLE([smallcache],
  1306. [AS_HELP_STRING([--enable-smallcache],[Enable small session cache (default: disabled)])],
  1307. [ ENABLED_SMALLCACHE=$enableval ],
  1308. [ ENABLED_SMALLCACHE=no ]
  1309. )
  1310. if test "$ENABLED_SMALLCACHE" = "yes"
  1311. then
  1312. AM_CFLAGS="$AM_CFLAGS -DSMALL_SESSION_CACHE"
  1313. fi
  1314. # Persistent session cache
  1315. AC_ARG_ENABLE([savesession],
  1316. [AS_HELP_STRING([--enable-savesession],[Enable persistent session cache (default: disabled)])],
  1317. [ ENABLED_SAVESESSION=$enableval ],
  1318. [ ENABLED_SAVESESSION=no ]
  1319. )
  1320. if test "$ENABLED_SAVESESSION" = "yes"
  1321. then
  1322. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  1323. fi
  1324. # Persistent cert cache
  1325. AC_ARG_ENABLE([savecert],
  1326. [AS_HELP_STRING([--enable-savecert],[Enable persistent cert cache (default: disabled)])],
  1327. [ ENABLED_SAVECERT=$enableval ],
  1328. [ ENABLED_SAVECERT=no ]
  1329. )
  1330. if test "$ENABLED_SAVECERT" = "yes"
  1331. then
  1332. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  1333. fi
  1334. # Write duplicate WOLFSSL object
  1335. AC_ARG_ENABLE([writedup],
  1336. [AS_HELP_STRING([--enable-writedup],[Enable write duplication of WOLFSSL objects (default: disabled)])],
  1337. [ ENABLED_WRITEDUP=$enableval ],
  1338. [ ENABLED_WRITEDUP=no ]
  1339. )
  1340. if test "$ENABLED_WRITEDUP" = "yes"
  1341. then
  1342. AM_CFLAGS="$AM_CFLAGS -DHAVE_WRITE_DUP"
  1343. fi
  1344. # Atomic User Record Layer
  1345. AC_ARG_ENABLE([atomicuser],
  1346. [AS_HELP_STRING([--enable-atomicuser],[Enable Atomic User Record Layer (default: disabled)])],
  1347. [ ENABLED_ATOMICUSER=$enableval ],
  1348. [ ENABLED_ATOMICUSER=no ]
  1349. )
  1350. if test "$ENABLED_ATOMICUSER" = "yes"
  1351. then
  1352. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  1353. fi
  1354. # Public Key Callbacks
  1355. AC_ARG_ENABLE([pkcallbacks],
  1356. [AS_HELP_STRING([--enable-pkcallbacks],[Enable Public Key Callbacks (default: disabled)])],
  1357. [ ENABLED_PKCALLBACKS=$enableval ],
  1358. [ ENABLED_PKCALLBACKS=no ]
  1359. )
  1360. if test "$ENABLED_PKCALLBACKS" = "yes"
  1361. then
  1362. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  1363. fi
  1364. # Microchip/Atmel CryptoAuthLib
  1365. ENABLED_CRYPTOAUTHLIB="no"
  1366. trylibatcadir=""
  1367. AC_ARG_WITH([cryptoauthlib],
  1368. [AS_HELP_STRING([--with-cryptoauthlib=PATH],[PATH to CryptoAuthLib install (default /usr/)])],
  1369. [
  1370. AC_MSG_CHECKING([for cryptoauthlib])
  1371. CPPFLAGS="$CPPFLAGS -DWOLFSSL_ATECC508A"
  1372. LIBS="$LIBS -lcryptoauth"
  1373. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cryptoauthlib.h>]], [[ atcab_init(0); ]])],[ libatca_linked=yes ],[ libatca_linked=no ])
  1374. if test "x$libatca_linked" = "xno" ; then
  1375. if test "x$withval" != "xno" ; then
  1376. trylibatcadir=$withval
  1377. fi
  1378. if test "x$withval" = "xyes" ; then
  1379. trylibatcadir="/usr"
  1380. fi
  1381. LDFLAGS="$LDFLAGS -L$trylibatcadir/lib"
  1382. CPPFLAGS="$CPPFLAGS -I$trylibatcadir/lib"
  1383. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <cryptoauthlib.h>]], [[ atcab_init(0); ]])],[ libatca_linked=yes ],[ libatca_linked=no ])
  1384. if test "x$libatca_linked" = "xno" ; then
  1385. AC_MSG_ERROR([cryptoauthlib isn't found.
  1386. If it's already installed, specify its path using --with-cryptoauthlib=/dir/])
  1387. fi
  1388. AM_LDFLAGS="$AM_LDFLAGS -L$trylibatcadir/lib"
  1389. AM_CFLAGS="$AM_CFLAGS -I$trylibatcadir/lib"
  1390. AC_MSG_RESULT([yes])
  1391. else
  1392. AC_MSG_RESULT([yes])
  1393. fi
  1394. ENABLED_CRYPTOAUTHLIB="yes"
  1395. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ATECC508A"
  1396. ]
  1397. )
  1398. # NXP SE050
  1399. # Example: "./configure --with-se050=/home/pi/simw_top"
  1400. ENABLED_SE050="no"
  1401. trylibse050dir=""
  1402. AC_ARG_WITH([se050],
  1403. [AS_HELP_STRING([--with-se050=PATH],[PATH to SE050 install (default /usr/local/lib/)])],
  1404. [
  1405. AC_MSG_CHECKING([for SE050])
  1406. LIBS="$LIBS -lSSS_APIs"
  1407. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fsl_sss_api.h>]], [[ sss_mac_init(0);]])],[ libse050_linked=yes ],[ libse050_linked=no ])
  1408. if test "x$libse050_linked" = "xno" ; then
  1409. if test "x$withval" != "xno" ; then
  1410. trylibse050dir=$withval
  1411. fi
  1412. if test "x$withval" = "xyes" ; then
  1413. trylibse050dir="/usr/local/lib/"
  1414. fi
  1415. LDFLAGS="$LDFLAGS -L$trylibse050dir/build/sss"
  1416. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/build"
  1417. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/sss/inc"
  1418. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/sss/ex/inc"
  1419. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/sss/port/default"
  1420. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/inc"
  1421. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/libCommon/log/"
  1422. CPPFLAGS="$CPPFLAGS -I$trylibse050dir/hostlib/hostLib/libCommon/infra"
  1423. if test -e "$trylibse050dir/build/sss/libSSS_APIs.a"; then
  1424. SE050_STATIC=yes
  1425. else
  1426. SE050_STATIC=no
  1427. fi
  1428. if test "x$SE050_STATIC" = "xyes"; then
  1429. LIB_STATIC_ADD="$trylibse050dir/build/sss/ex/src/libex_common.a \
  1430. $trylibse050dir/build/sss/libSSS_APIs.a \
  1431. $trylibse050dir/build/hostlib/hostLib/se05x/libse05x.a \
  1432. $trylibse050dir/build/hostlib/hostLib/liba7x_utils.a \
  1433. $trylibse050dir/build/hostlib/hostLib/libCommon/log/libmwlog.a \
  1434. $trylibse050dir/build/hostlib/hostLib/libCommon/libsmCom.a $LIB_STATIC_ADD"
  1435. else
  1436. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <fsl_sss_api.h>]], [[ sss_mac_init(0); ]])],[ libse050_linked=yes ],[ libse050_linked=no ])
  1437. if test "x$libse050_linked" = "xno" ; then
  1438. AC_MSG_ERROR([SE050 isn't found.
  1439. If it's already installed, specify its path using --with-se050=/dir/])
  1440. fi
  1441. fi
  1442. # Requires AES direct
  1443. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  1444. # Does not support SHA2-512 224/256
  1445. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  1446. AC_MSG_RESULT([yes])
  1447. else
  1448. AC_MSG_RESULT([yes])
  1449. fi
  1450. ENABLED_SE050="yes"
  1451. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SE050 -DSSS_USE_FTR_FILE"
  1452. ]
  1453. )
  1454. ENABLED_SNIFFTEST=no
  1455. AS_IF([ test "x$ENABLED_SNIFFER" = "xyes" ],
  1456. [
  1457. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SNIFFER -DWOLFSSL_STATIC_EPHEMERAL"
  1458. AC_CHECK_HEADERS([pcap/pcap.h],
  1459. [ ENABLED_SNIFFTEST=yes ],
  1460. [ AC_MSG_WARN([cannot enable sniffer test without having libpcap available.]) ]
  1461. )
  1462. ])
  1463. # AES-CBC
  1464. AC_ARG_ENABLE([aescbc],
  1465. [AS_HELP_STRING([--enable-aescbc],[Enable wolfSSL AES-CBC support (default: enabled)])],
  1466. [ ENABLED_AESCBC=$enableval ],
  1467. [ ENABLED_AESCBC=yes ]
  1468. )
  1469. if test "$ENABLED_AESCBC" = "no"
  1470. then
  1471. AM_CFLAGS="$AM_CFLAGS -DNO_AES_CBC"
  1472. fi
  1473. # AES-CBC length checks (checks that input lengths are multiples of block size)
  1474. AC_ARG_ENABLE([aescbc_length_checks],
  1475. [AS_HELP_STRING([--enable-aescbc-length-checks],[Enable AES-CBC length validity checks (default: disabled)])],
  1476. [ ENABLED_AESCBC_LENGTH_CHECKS=$enableval ],
  1477. [ ENABLED_AESCBC_LENGTH_CHECKS=no ]
  1478. )
  1479. if test "$ENABLED_AESCBC_LENGTH_CHECKS" = "yes"
  1480. then
  1481. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CBC_LENGTH_CHECKS"
  1482. fi
  1483. # leanpsk and leantls don't need gcm
  1484. # AES-GCM
  1485. AC_ARG_ENABLE([aesgcm],
  1486. [AS_HELP_STRING([--enable-aesgcm],[Enable wolfSSL AES-GCM support (default: enabled)])],
  1487. [ ENABLED_AESGCM=$enableval ],
  1488. [ ENABLED_AESGCM=yes ]
  1489. )
  1490. AC_ARG_ENABLE([aesgcm-stream],
  1491. [AS_HELP_STRING([--enable-aesgcm-stream],[Enable wolfSSL AES-GCM support with streaming APIs (default: disabled)])],
  1492. [ ENABLED_AESGCM_STREAM=$enableval ],
  1493. [ ENABLED_AESGCM_STREAM=no ]
  1494. )
  1495. # leanpsk and leantls don't need gcm
  1496. if test "$FIPS_VERSION" = "rand" || test "$ENABLED_LEANPSK" = "yes" ||
  1497. (test "$ENABLED_LEANTLS" = "yes" && test "$ENABLED_TLS13" = "no")
  1498. then
  1499. ENABLED_AESGCM=no
  1500. fi
  1501. if test "$ENABLED_AESGCM" = "yes" && test "$ac_cv_c_bigendian" != "yes"
  1502. then
  1503. ENABLED_AESGCM="4bit"
  1504. fi
  1505. # AES-CCM
  1506. AC_ARG_ENABLE([aesccm],
  1507. [AS_HELP_STRING([--enable-aesccm],[Enable wolfSSL AES-CCM support (default: disabled)])],
  1508. [ ENABLED_AESCCM=$enableval ],
  1509. [ ENABLED_AESCCM=no ]
  1510. )
  1511. if test "$ENABLED_AESCCM" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  1512. then
  1513. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"
  1514. fi
  1515. # AES-SIV (RFC 5297)
  1516. AC_ARG_ENABLE([aessiv],
  1517. [AS_HELP_STRING([--enable-aessiv],[Enable AES-SIV (RFC 5297) (default: disabled)])],
  1518. [ ENABLED_AESSIV=$enableval ],
  1519. [ ENABLED_AESSIV=no ]
  1520. )
  1521. if test "$ENABLED_CHRONY" = "yes"
  1522. then
  1523. ENABLED_AESSIV=yes
  1524. fi
  1525. # AES-CTRf
  1526. AC_ARG_ENABLE([aesctr],
  1527. [AS_HELP_STRING([--enable-aesctr],[Enable wolfSSL AES-CTR support (default: disabled)])],
  1528. [ ENABLED_AESCTR=$enableval ],
  1529. [ ENABLED_AESCTR=no ]
  1530. )
  1531. if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_AESSIV" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  1532. then
  1533. ENABLED_AESCTR=yes
  1534. fi
  1535. # AES-OFB
  1536. AC_ARG_ENABLE([aesofb],
  1537. [AS_HELP_STRING([--enable-aesofb],[Enable wolfSSL AES-OFB support (default: disabled)])],
  1538. [ ENABLED_AESOFB=$enableval ],
  1539. [ ENABLED_AESOFB=no ]
  1540. )
  1541. if test "$ENABLED_AESOFB" = "yes"
  1542. then
  1543. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB -DWOLFSSL_AES_DIRECT"
  1544. fi
  1545. # AES-CFB
  1546. AC_ARG_ENABLE([aescfb],
  1547. [AS_HELP_STRING([--enable-aescfb],[Enable wolfSSL AES-CFB support (default: disabled)])],
  1548. [ ENABLED_AESCFB=$enableval ],
  1549. [ ENABLED_AESCFB=no ]
  1550. )
  1551. if test "$ENABLED_AESCFB" = "yes"
  1552. then
  1553. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"
  1554. fi
  1555. ENABLED_ARMASM_INLINE="no"
  1556. ENABLED_ARMASM_SHA3="no"
  1557. # ARM Assembly
  1558. # Both SHA3 and SHA512 instructions available with ARMV8.2-a
  1559. AC_ARG_ENABLE([armasm],
  1560. [AS_HELP_STRING([--enable-armasm],[Enable wolfSSL ARMv8 ASM support (default: disabled). Set to sha512-crypto or sha3-crypto to use SHA512 and SHA3 instructions with Aarch64 CPU.])],
  1561. [ ENABLED_ARMASM=$enableval ],
  1562. [ ENABLED_ARMASM=no ]
  1563. )
  1564. if test "$ENABLED_ARMASM" != "no" && test "$ENABLED_ASM" = "yes"
  1565. then
  1566. for v in `echo $ENABLED_ARMASM | tr "," " "`
  1567. do
  1568. case $v in
  1569. yes)
  1570. ;;
  1571. inline)
  1572. ENABLED_ARMASM_INLINE=yes
  1573. ;;
  1574. sha512-crypto | sha3-crypto)
  1575. case $host_cpu in
  1576. *aarch64*)
  1577. ;;
  1578. *)
  1579. AC_MSG_ERROR([SHA512/SHA3 instructions only available on Aarch64 CPU.])
  1580. break;;
  1581. esac
  1582. ENABLED_ARMASM_SHA3=yes
  1583. ;;
  1584. *)
  1585. AC_MSG_ERROR([Invalid choice of ARM asm inclusions (yes, sha512-crypto, sha3-crypto): $ENABLED_ARMASM.])
  1586. break;;
  1587. esac
  1588. done
  1589. ENABLED_ARMASM="yes"
  1590. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ARMASM"
  1591. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM -DWOLFSSL_NO_HASH_RAW"
  1592. #Check if mcpu and mfpu values already set if not use default
  1593. case $CPPFLAGS in
  1594. *mcpu* | *mfpu*)
  1595. break;; #Do not override user set values
  1596. *)
  1597. case $host_cpu in
  1598. *aarch64*)
  1599. case $host_os in
  1600. *darwin*)
  1601. # All known Aarch64 Mac computers support SHA-512 instructions
  1602. ENABLED_ARMASM_SHA3=yes
  1603. ;;
  1604. *)
  1605. # +crypto needed for hardware acceleration
  1606. if test "$ENABLED_ARMASM_SHA3" = "yes"; then
  1607. AM_CPPFLAGS="$AM_CPPFLAGS -march=armv8.2-a+crypto+sha3"
  1608. else
  1609. AM_CPPFLAGS="$AM_CPPFLAGS -mcpu=generic+crypto"
  1610. fi
  1611. ;;
  1612. esac
  1613. # Include options.h
  1614. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  1615. # Check for and set -mstrict-align compiler flag
  1616. # Used to set assumption that Aarch64 systems will not handle
  1617. # unaligned memory references. The flag -mstrict-align is needed
  1618. # on some compiler versions to avoid an invalid addressing mode
  1619. # error with "m" constraint variables in the inline assembly AES
  1620. # code. Even though unaligned load/store access is permitted on
  1621. # normal memory with Cortex-A series boards with the exception
  1622. # being exclusive and ordered access.
  1623. case $CPPFLAGS in
  1624. *mstrict-align*)
  1625. break;; # already set by user
  1626. *)
  1627. AM_CPPFLAGS="$AM_CPPFLAGS -mstrict-align"
  1628. AC_MSG_NOTICE([64bit ARMv8, setting -mstrict-align]);;
  1629. esac
  1630. AC_MSG_NOTICE([64bit ARMv8 found, setting mcpu to generic+crypto]);;
  1631. *)
  1632. AM_CPPFLAGS="$AM_CPPFLAGS -mfpu=crypto-neon-fp-armv8"
  1633. # Include options.h
  1634. AM_CCASFLAGS="$AM_CCASFLAGS -DEXTERNAL_OPTS_OPENVPN"
  1635. AC_MSG_NOTICE([32bit ARMv8 found, setting mfpu to crypto-neon-fp-armv8]);;
  1636. esac
  1637. esac
  1638. fi
  1639. if test "$ENABLED_ARMASM_SHA3" = "yes"; then
  1640. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ARMASM_CRYPTO_SHA512 -DWOLFSSL_ARMASM_CRYPTO_SHA3"
  1641. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ARMASM_CRYPTO_SHA512 -DWOLFSSL_ARMASM_CRYPTO_SHA3"
  1642. fi
  1643. # Xilinx hardened crypto
  1644. AC_ARG_ENABLE([xilinx],
  1645. [AS_HELP_STRING([--enable-xilinx],[Enable wolfSSL support for Xilinx hardened crypto(default: disabled)])],
  1646. [ ENABLED_XILINX=$enableval ],
  1647. [ ENABLED_XILINX=no ]
  1648. )
  1649. if test "$ENABLED_XILINX" = "yes"
  1650. then
  1651. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_XILINX -DWOLFSSL_XILINX_CRYPT"
  1652. fi
  1653. # CAAM build
  1654. trylibsecodir="/usr"
  1655. AC_ARG_WITH([seco],
  1656. [AS_HELP_STRING([--with-seco=PATH],[PATH to SECO install (default /usr/lib/)])],
  1657. [
  1658. AC_MSG_CHECKING([for SECO])
  1659. if test "x$withval" != "xno" ; then
  1660. trylibsecodir=$withval
  1661. fi
  1662. ]
  1663. )
  1664. AC_ARG_ENABLE([caam],
  1665. [AS_HELP_STRING([--enable-caam],[Enable wolfSSL support for CAAM (default: disabled)])],
  1666. [ ENABLED_CAAM=$enableval ],
  1667. [ ENABLED_CAAM=no ]
  1668. )
  1669. if test "$ENABLED_CAAM" = "yes"
  1670. then
  1671. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM -DWOLFSSL_IMX6_CAAM"
  1672. fi
  1673. if test "$ENABLED_CAAM" = "qnx"
  1674. then
  1675. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM -DWOLFSSL_IMX6_CAAM -DWOLFSSL_QNX_CAAM"
  1676. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_ECC"
  1677. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_CMAC"
  1678. fi
  1679. if test "$ENABLED_CAAM" = "seco"
  1680. then
  1681. SECO_DIR=$trylibsecodir
  1682. AM_CPPFLAGS="$AM_CPPFLAGS -I$SECO_DIR/include"
  1683. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM -DWOLFSSL_SECO_CAAM -DWOLFSSL_HASH_KEEP"
  1684. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_ECC"
  1685. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_CMAC"
  1686. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_CIPHER"
  1687. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_HMAC"
  1688. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_HASH"
  1689. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CAAM_CURVE25519"
  1690. AC_CHECK_LIB([hsm_lib],[hsm_open_session])
  1691. AC_CHECK_LIB([seco_nvm_manager],[seco_nvm_manager])
  1692. LIB_STATIC_ADD="$LIB_STATIC_ADD $SECO_DIR/lib/hsm_lib.a $SECO_DIR/lib/seco_nvm_manager.a"
  1693. LIB_ADD="$LIB_ADD -lz"
  1694. fi
  1695. # INTEL AES-NI
  1696. AC_ARG_ENABLE([aesni],
  1697. [AS_HELP_STRING([--enable-aesni],[Enable wolfSSL AES-NI support (default: disabled)])],
  1698. [ ENABLED_AESNI=$enableval ],
  1699. [ ENABLED_AESNI=no ]
  1700. )
  1701. # INTEL ASM
  1702. AC_ARG_ENABLE([intelasm],
  1703. [AS_HELP_STRING([--enable-intelasm],[Enable All Intel ASM speedups (default: disabled)])],
  1704. [ ENABLED_INTELASM=$enableval ],
  1705. [ ENABLED_INTELASM=no ]
  1706. )
  1707. if test "$ENABLED_ASM" = "yes"
  1708. then
  1709. if test "$ENABLED_AESNI" = "small"
  1710. then
  1711. AM_CFLAGS="$AM_CFLAGS -DAES_GCM_AESNI_NO_UNROLL"
  1712. ENABLED_AESNI=yes
  1713. fi
  1714. if test "$ENABLED_AESNI" = "yes" || test "$ENABLED_INTELASM" = "yes"
  1715. then
  1716. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESNI"
  1717. if test "$GCC" = "yes"
  1718. then
  1719. # clang needs these flags
  1720. if test "$CC" = "clang"
  1721. then
  1722. AM_CFLAGS="$AM_CFLAGS -maes -mpclmul"
  1723. else
  1724. # GCC needs these flags, icc doesn't
  1725. # opt levels greater than 2 may cause problems on systems w/o
  1726. # aesni
  1727. if test "$CC" != "icc"
  1728. then
  1729. AM_CFLAGS="$AM_CFLAGS -maes -msse4 -mpclmul"
  1730. fi
  1731. fi
  1732. fi
  1733. AS_IF([test "x$ENABLED_AESGCM" != "xno"],[AM_CCASFLAGS="$AM_CCASFLAGS -DHAVE_AESGCM"])
  1734. fi
  1735. if test "$ENABLED_INTELASM" = "yes"
  1736. then
  1737. AM_CFLAGS="$AM_CFLAGS -DUSE_INTEL_SPEEDUP"
  1738. ENABLED_AESNI=yes
  1739. fi
  1740. fi
  1741. AC_ARG_ENABLE([aligndata],
  1742. [AS_HELP_STRING([--enable-aligndata],[align data for ciphers (default: enabled)])],
  1743. [ ENABLED_ALIGN_DATA=$enableval ],
  1744. [ ENABLED_ALIGN_DATA=yes ]
  1745. )
  1746. if test "$ENABLED_ALIGN_DATA" = "yes"
  1747. then
  1748. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_USE_ALIGN"
  1749. fi
  1750. # INTEL RDRAND
  1751. AC_ARG_ENABLE([intelrand],
  1752. [AS_HELP_STRING([--enable-intelrand],[Enable Intel rdrand as preferred RNG source (default: disabled)])],
  1753. [ ENABLED_INTELRDRAND=$enableval ],
  1754. [ ENABLED_INTELRDRAND=no ]
  1755. )
  1756. if test "$ENABLED_INTELRDRAND" = "yes"
  1757. then
  1758. AM_CFLAGS="$AM_CFLAGS -DHAVE_INTEL_RDRAND"
  1759. fi
  1760. # AMD RDSEED
  1761. AC_ARG_ENABLE([amdrand],
  1762. [AS_HELP_STRING([--enable-amdrand],[Enable AMD rdseed as preferred RNG seeding source (default: disabled)])],
  1763. [ ENABLED_AMDRDSEED=$enableval ],
  1764. [ ENABLED_AMDRDSEED=no ]
  1765. )
  1766. if test "$ENABLED_AMDRDSEED" = "yes"
  1767. then
  1768. AM_CFLAGS="$AM_CFLAGS -DHAVE_AMD_RDSEED"
  1769. fi
  1770. # Linux af_alg
  1771. AC_ARG_ENABLE([afalg],
  1772. [AS_HELP_STRING([--enable-afalg],[Enable Linux af_alg use for crypto (default: disabled)])],
  1773. [ ENABLED_AFALG=$enableval ],
  1774. [ ENABLED_AFALG=no ]
  1775. )
  1776. if test "$ENABLED_AFALG" = "yes"
  1777. then
  1778. if test "$ENABLED_AESCCM" = "yes"
  1779. then
  1780. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  1781. fi
  1782. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG"
  1783. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_HASH"
  1784. fi
  1785. if test "$ENABLED_AFALG" = "xilinx"
  1786. then
  1787. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX -DWOLFSSL_AFALG_XILINX_AES"
  1788. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX_SHA3 -DWOLFSSL_AFALG_XILINX_RSA"
  1789. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA3_224 -DWOLFSSL_NOSHA3_256 -DWOLFSSL_NOSHA3_512"
  1790. ENABLED_AFALG="yes"
  1791. ENABLED_XILINX="yes"
  1792. fi
  1793. if test "$ENABLED_AFALG" = "xilinx-aes"
  1794. then
  1795. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX -DWOLFSSL_AFALG_XILINX_AES"
  1796. ENABLED_AFALG="yes"
  1797. ENABLED_XILINX="yes"
  1798. fi
  1799. if test "$ENABLED_AFALG" = "xilinx-sha3"
  1800. then
  1801. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX"
  1802. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX_SHA3"
  1803. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA3_224 -DWOLFSSL_NOSHA3_256 -DWOLFSSL_NOSHA3_512"
  1804. ENABLED_AFALG="yes"
  1805. ENABLED_XILINX="yes"
  1806. fi
  1807. if test "$ENABLED_AFALG" = "xilinx-rsa"
  1808. then
  1809. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX"
  1810. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_XILINX_RSA"
  1811. ENABLED_AFALG="yes"
  1812. ENABLED_XILINX="yes"
  1813. fi
  1814. # libkcapi
  1815. AC_ARG_ENABLE([kcapi-hash],
  1816. [AS_HELP_STRING([--enable-kcapi-hash],[Enable libkcapi use for hashing (default: disabled)])],
  1817. [ ENABLED_KCAPI_HASH=$enableval ],
  1818. [ ENABLED_KCAPI_HASH=no ]
  1819. )
  1820. AC_ARG_ENABLE([kcapi-hmac],
  1821. [AS_HELP_STRING([--enable-kcapi-hmac],[Enable libkcapi use for HMAC (default: disabled)])],
  1822. [ ENABLED_KCAPI_HMAC=$enableval ],
  1823. [ ENABLED_KCAPI_HMAC=no ]
  1824. )
  1825. AC_ARG_ENABLE([kcapi-aes],
  1826. [AS_HELP_STRING([--enable-kcapi-aes],[Enable libkcapi use for AES (default: disabled)])],
  1827. [ ENABLED_KCAPI_AES=$enableval ],
  1828. [ ENABLED_KCAPI_AES=no ]
  1829. )
  1830. AC_ARG_ENABLE([kcapi-rsa],
  1831. [AS_HELP_STRING([--enable-kcapi-rsa],[Enable libkcapi use for RSA (default: disabled)])],
  1832. [ ENABLED_KCAPI_RSA=$enableval ],
  1833. [ ENABLED_KCAPI_RSA=no ]
  1834. )
  1835. AC_ARG_ENABLE([kcapi-dh],
  1836. [AS_HELP_STRING([--enable-kcapi-dh],[Enable libkcapi use for DH (default: disabled)])],
  1837. [ ENABLED_KCAPI_DH=$enableval ],
  1838. [ ENABLED_KCAPI_DH=no ]
  1839. )
  1840. AC_ARG_ENABLE([kcapi-ecc],
  1841. [AS_HELP_STRING([--enable-kcapi-ecc],[Enable libkcapi use for ECC (default: disabled)])],
  1842. [ ENABLED_KCAPI_ECC=$enableval ],
  1843. [ ENABLED_KCAPI_ECC=no ]
  1844. )
  1845. AC_ARG_ENABLE([kcapi],
  1846. [AS_HELP_STRING([--enable-kcapi],[Enable libkcapi use for crypto (default: disabled)])],
  1847. [ ENABLED_KCAPI=$enableval ],
  1848. [ ENABLED_KCAPI=no ]
  1849. )
  1850. if test "$ENABLED_KCAPI" = "yes"
  1851. then
  1852. AS_IF([test "$enable_kcapi_hash" != "no"], [ENABLED_KCAPI_HASH=yes])
  1853. AS_IF([test "$enable_kcapi_hmac" != "no"], [ENABLED_KCAPI_HMAC=yes])
  1854. AS_IF([test "$enable_kcapi_aes" != "no"], [ENABLED_KCAPI_AES=yes])
  1855. AS_IF([test "$enable_kcapi_rsa" != "no"], [ENABLED_KCAPI_RSA=yes])
  1856. AS_IF([test "$enable_kcapi_dh" != "no"], [ENABLED_KCAPI_DH=yes])
  1857. AS_IF([test "$enable_kcapi_ecc" != "no"], [ENABLED_KCAPI_ECC=yes])
  1858. fi
  1859. if test "$ENABLED_KCAPI_HASH" != "no" ||
  1860. test "$ENABLED_KCAPI_HMAC" != "no" ||
  1861. test "$ENABLED_KCAPI_AES" != "no" ||
  1862. test "$ENABLED_KCAPI_RSA" != "no" ||
  1863. test "$ENABLED_KCAPI_DH" != "no" ||
  1864. test "$ENABLED_KCAPI_ECC" != "no"
  1865. then
  1866. LIBS="$LIBS -lkcapi"
  1867. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI"
  1868. fi
  1869. if test "$ENABLED_KCAPI_HASH" = "yes"
  1870. then
  1871. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_HASH -DWOLFSSL_KCAPI_HASH_KEEP"
  1872. # Linux Kernel doesn't support truncated SHA512 algorithms
  1873. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  1874. fi
  1875. if test "$ENABLED_KCAPI_HMAC" = "yes"
  1876. then
  1877. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_HMAC"
  1878. fi
  1879. if test "$ENABLED_KCAPI_AES" = "yes"
  1880. then
  1881. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_AES"
  1882. HAVE_AESGCM_PORT=yes
  1883. if test "$ENABLED_AESCCM" = "yes"
  1884. then
  1885. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  1886. fi
  1887. fi
  1888. if test "$ENABLED_KCAPI_RSA" = "yes"
  1889. then
  1890. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_RSA"
  1891. fi
  1892. if test "$ENABLED_KCAPI_DH" = "yes"
  1893. then
  1894. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_DH -DWOLFSSL_DH_EXTRA"
  1895. fi
  1896. if test "$ENABLED_KCAPI_ECC" = "yes"
  1897. then
  1898. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KCAPI_ECC"
  1899. fi
  1900. # Support for Linux dev/crypto calls
  1901. AC_ARG_ENABLE([devcrypto],
  1902. [AS_HELP_STRING([--enable-devcrypto],[Enable Linux dev crypto calls: all | aes (all aes support) | hash (all hash algos) | cbc (aes-cbc only) (default: disabled)])],
  1903. [ ENABLED_DEVCRYPTO=$enableval ],
  1904. [ ENABLED_DEVCRYPTO=no ]
  1905. )
  1906. if test "$ENABLED_DEVCRYPTO" = "yes" || test "$ENABLED_DEVCRYPTO" = "all"
  1907. then
  1908. #enable all devcrypto supported algorithms
  1909. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1910. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CBC"
  1911. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_AES"
  1912. if test "$ENABLED_AESCCM" = "yes"
  1913. then
  1914. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  1915. fi
  1916. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HASH"
  1917. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_HASH_RAW"
  1918. ENABLED_DEVCRYPTO=yes
  1919. fi
  1920. if test "$ENABLED_DEVCRYPTO" = "aes"
  1921. then
  1922. #enable only AES-CBC algorithm support
  1923. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1924. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_AES"
  1925. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CBC"
  1926. if test "$ENABLED_AESCCM" = "yes"
  1927. then
  1928. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  1929. fi
  1930. ENABLED_DEVCRYPTO=yes
  1931. fi
  1932. if test "$ENABLED_DEVCRYPTO" = "cbc"
  1933. then
  1934. #enable only AES-CBC algorithm support
  1935. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1936. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CBC"
  1937. ENABLED_DEVCRYPTO=yes
  1938. fi
  1939. if test "$ENABLED_DEVCRYPTO" = "hash"
  1940. then
  1941. #enable only hash algorithm support
  1942. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1943. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HASH"
  1944. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_HASH_RAW"
  1945. ENABLED_DEVCRYPTO=yes
  1946. fi
  1947. if test "$ENABLED_DEVCRYPTO" = "hmac"
  1948. then
  1949. #enable only hmac algorithm support
  1950. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1951. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HMAC"
  1952. ENABLED_DEVCRYPTO=yes
  1953. fi
  1954. if test "$ENABLED_DEVCRYPTO" = "rsa"
  1955. then
  1956. #enable only rsa algorithm support
  1957. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1958. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_RSA"
  1959. ENABLED_DEVCRYPTO=yes
  1960. fi
  1961. if test "$ENABLED_DEVCRYPTO" = "seco"
  1962. then
  1963. #enable support of devcrypto for algos not supported with seco
  1964. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO"
  1965. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HMAC"
  1966. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_RSA"
  1967. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_CURVE25519"
  1968. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_ECDSA"
  1969. ENABLED_DEVCRYPTO=yes
  1970. fi
  1971. # Camellia
  1972. AC_ARG_ENABLE([camellia],
  1973. [AS_HELP_STRING([--enable-camellia],[Enable wolfSSL Camellia support (default: disabled)])],
  1974. [ ENABLED_CAMELLIA=$enableval ],
  1975. [ ENABLED_CAMELLIA=no ]
  1976. )
  1977. if test "$ENABLED_CAMELLIA" = "yes"
  1978. then
  1979. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAMELLIA"
  1980. fi
  1981. # MD2
  1982. AC_ARG_ENABLE([md2],
  1983. [AS_HELP_STRING([--enable-md2],[Enable wolfSSL MD2 support (default: disabled)])],
  1984. [ ENABLED_MD2=$enableval ],
  1985. [ ENABLED_MD2=no ]
  1986. )
  1987. if test "$ENABLED_BUMP" = "yes"
  1988. then
  1989. ENABLED_MD2="yes"
  1990. fi
  1991. if test "$ENABLED_MD2" = "yes"
  1992. then
  1993. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MD2"
  1994. fi
  1995. # NULL CIPHER
  1996. AC_ARG_ENABLE([nullcipher],
  1997. [AS_HELP_STRING([--enable-nullcipher],[Enable wolfSSL NULL cipher support (default: disabled)])],
  1998. [ ENABLED_NULL_CIPHER=$enableval ],
  1999. [ ENABLED_NULL_CIPHER=no ]
  2000. )
  2001. if test "$ENABLED_OPENSSH" = "yes"
  2002. then
  2003. ENABLED_NULL_CIPHER="yes"
  2004. fi
  2005. if test "$ENABLED_NULL_CIPHER" = "yes"
  2006. then
  2007. AM_CFLAGS="$AM_CFLAGS -DHAVE_NULL_CIPHER"
  2008. fi
  2009. # RIPEMD
  2010. AC_ARG_ENABLE([ripemd],
  2011. [AS_HELP_STRING([--enable-ripemd],[Enable wolfSSL RIPEMD-160 support (default: disabled)])],
  2012. [ ENABLED_RIPEMD=$enableval ],
  2013. [ ENABLED_RIPEMD=no ]
  2014. )
  2015. if test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno"
  2016. then
  2017. ENABLED_RIPEMD="yes"
  2018. fi
  2019. if test "$ENABLED_RIPEMD" = "yes"
  2020. then
  2021. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RIPEMD"
  2022. fi
  2023. # BLAKE2
  2024. AC_ARG_ENABLE([blake2],
  2025. [AS_HELP_STRING([--enable-blake2],[Enable wolfSSL BLAKE2b support (default: disabled)])],
  2026. [ ENABLED_BLAKE2=$enableval ],
  2027. [ ENABLED_BLAKE2=no ]
  2028. )
  2029. if test "$ENABLED_BLAKE2" = "yes"
  2030. then
  2031. AM_CFLAGS="$AM_CFLAGS -DHAVE_BLAKE2 -DHAVE_BLAKE2B"
  2032. fi
  2033. AC_ARG_ENABLE([blake2s],
  2034. [AS_HELP_STRING([--enable-blake2s],[Enable wolfSSL BLAKE2s support (default: disabled)])],
  2035. [ ENABLED_BLAKE2S=$enableval ],
  2036. [ ENABLED_BLAKE2S=no ]
  2037. )
  2038. if test "$ENABLED_BLAKE2S" = "yes"
  2039. then
  2040. AM_CFLAGS="$AM_CFLAGS -DHAVE_BLAKE2S"
  2041. ENABLED_BLAKE2="yes"
  2042. fi
  2043. # set sha224 default
  2044. SHA224_DEFAULT=no
  2045. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64"
  2046. then
  2047. if test "x$ENABLED_AFALG" = "xno" && test "x$ENABLED_DEVCRYPTO" = "xno" &&
  2048. ( test "x$ENABLED_FIPS" = "xno" ||
  2049. ( test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" != 1 ) )
  2050. then
  2051. SHA224_DEFAULT=yes
  2052. fi
  2053. fi
  2054. # SHA224
  2055. AC_ARG_ENABLE([sha224],
  2056. [AS_HELP_STRING([--enable-sha224],[Enable wolfSSL SHA-224 support (default: enabled on x86_64/aarch64)])],
  2057. [ ENABLED_SHA224=$enableval ],
  2058. [ ENABLED_SHA224=$SHA224_DEFAULT ]
  2059. )
  2060. if test "$ENABLED_SHA224" = "yes"
  2061. then
  2062. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"
  2063. fi
  2064. # set sha3 default
  2065. SHA3_DEFAULT=no
  2066. if (test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64") && test "$ENABLED_32BIT" = "no"
  2067. then
  2068. if test "x$ENABLED_FIPS" = "xno" || test "$HAVE_FIPS_VERSION" -ge 2
  2069. then
  2070. SHA3_DEFAULT=yes
  2071. fi
  2072. fi
  2073. # SHA3
  2074. AC_ARG_ENABLE([sha3],
  2075. [AS_HELP_STRING([--enable-sha3],[Enable wolfSSL SHA-3 support (default: enabled on x86_64/aarch64)])],
  2076. [ ENABLED_SHA3=$enableval ],
  2077. [ ENABLED_SHA3=$SHA3_DEFAULT ]
  2078. )
  2079. if test "$ENABLED_SHA3" = "small"
  2080. then
  2081. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3_SMALL"
  2082. ENABLED_SHA3="yes"
  2083. fi
  2084. # SHAKE256
  2085. AC_ARG_ENABLE([shake256],
  2086. [AS_HELP_STRING([--enable-shake256],[Enable wolfSSL SHAKE256 support (default: disabled)])],
  2087. [ ENABLED_SHAKE256=$enableval ]
  2088. [ ENABLED_SHAKE256=no ]
  2089. )
  2090. # SHA512
  2091. AC_ARG_ENABLE([sha512],
  2092. [AS_HELP_STRING([--enable-sha512],[Enable wolfSSL SHA-512 support (default: enabled)])],
  2093. [ ENABLED_SHA512=$enableval ],
  2094. [ ENABLED_SHA512=yes ]
  2095. )
  2096. # options that don't require sha512
  2097. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" || test "$ENABLED_32BIT" = "yes" || test "$ENABLED_16BIT" = "yes"
  2098. then
  2099. ENABLED_SHA512="no"
  2100. fi
  2101. # options that require sha512
  2102. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_FORTRESS" = "yes"
  2103. then
  2104. ENABLED_SHA512="yes"
  2105. ENABLED_SHA384="yes"
  2106. fi
  2107. if test "$ENABLED_SHA512" = "yes"
  2108. then
  2109. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512"
  2110. fi
  2111. # SHA384
  2112. AC_ARG_ENABLE([sha384],
  2113. [AS_HELP_STRING([--enable-sha384],[Enable wolfSSL SHA-384 support (default: enabled)])],
  2114. [ ENABLED_SHA384=$enableval ],
  2115. [ ENABLED_SHA384=yes ]
  2116. )
  2117. # options that don't require sha384
  2118. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes" || test "$ENABLED_32BIT" = "yes" || test "$ENABLED_16BIT" = "yes"
  2119. then
  2120. ENABLED_SHA384="no"
  2121. fi
  2122. # options that require sha384
  2123. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_FORTRESS" = "yes"
  2124. then
  2125. ENABLED_SHA384="yes"
  2126. fi
  2127. if test "$ENABLED_SHA384" = "yes"
  2128. then
  2129. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA384"
  2130. fi
  2131. # SESSION CERTS
  2132. AC_ARG_ENABLE([sessioncerts],
  2133. [AS_HELP_STRING([--enable-sessioncerts],[Enable session cert storing (default: disabled)])],
  2134. [ ENABLED_SESSIONCERTS=$enableval ],
  2135. [ ENABLED_SESSIONCERTS=no ]
  2136. )
  2137. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_OPENVPN" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes" || test "x$ENABLED_NETSNMP" = "xyes"
  2138. then
  2139. ENABLED_SESSIONCERTS=yes
  2140. fi
  2141. if test "$ENABLED_TLS13" = "yes" && test "$ENABLED_PSK" = "yes"
  2142. then
  2143. ENABLED_SESSIONCERTS=yes
  2144. fi
  2145. if test "$ENABLED_SESSIONCERTS" = "yes"
  2146. then
  2147. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  2148. fi
  2149. # KEY GENERATION
  2150. AC_ARG_ENABLE([keygen],
  2151. [AS_HELP_STRING([--enable-keygen],[Enable key generation (default: disabled)])],
  2152. [ ENABLED_KEYGEN=$enableval ],
  2153. [ ENABLED_KEYGEN=no ]
  2154. )
  2155. if test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_OPENRESTY" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  2156. then
  2157. ENABLED_KEYGEN=yes
  2158. fi
  2159. # CERT GENERATION
  2160. AC_ARG_ENABLE([certgen],
  2161. [AS_HELP_STRING([--enable-certgen],[Enable cert generation (default: disabled)])],
  2162. [ ENABLED_CERTGEN=$enableval ],
  2163. [ ENABLED_CERTGEN=no ]
  2164. )
  2165. if test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_BIND" = "yes" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_CHRONY" = "yes"
  2166. then
  2167. ENABLED_CERTGEN=yes
  2168. fi
  2169. # CERT REQUEST GENERATION
  2170. AC_ARG_ENABLE([certreq],
  2171. [AS_HELP_STRING([--enable-certreq],[Enable cert request generation (default: disabled)])],
  2172. [ ENABLED_CERTREQ=$enableval ],
  2173. [ ENABLED_CERTREQ=no ]
  2174. )
  2175. # CERT REQUEST EXTENSION
  2176. AC_ARG_ENABLE([certext],
  2177. [AS_HELP_STRING([--enable-certext],[Enable cert request extensions (default: disabled)])],
  2178. [ ENABLED_CERTEXT=$enableval ],
  2179. [ ENABLED_CERTEXT=no ]
  2180. )
  2181. if test "$ENABLED_OPENVPN" = "yes"
  2182. then
  2183. ENABLED_CERTEXT=yes
  2184. fi
  2185. # DECODED CERT CACHE
  2186. AC_ARG_ENABLE([certgencache],
  2187. [AS_HELP_STRING([--enable-certgencache],[Enable decoded cert caching (default: disabled)])],
  2188. [ ENABLED_certgencache=$enableval ],
  2189. [ ENABLED_certgencache=no ]
  2190. )
  2191. if test "$ENABLED_certgencache" = "yes"
  2192. then
  2193. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN_CACHE"
  2194. fi
  2195. # SEP
  2196. AC_ARG_ENABLE([sep],
  2197. [AS_HELP_STRING([--enable-sep],[Enable sep extensions (default: disabled)])],
  2198. [ ENABLED_SEP=$enableval ],
  2199. [ ENABLED_SEP=no ]
  2200. )
  2201. if test "$ENABLED_SEP" = "yes"
  2202. then
  2203. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SEP -DKEEP_PEER_CERT"
  2204. fi
  2205. # HKDF
  2206. AC_ARG_ENABLE([hkdf],
  2207. [AS_HELP_STRING([--enable-hkdf],[Enable HKDF (HMAC-KDF) support (default: disabled)])],
  2208. [ ENABLED_HKDF=$enableval ],
  2209. [ ENABLED_HKDF=no ]
  2210. )
  2211. if test "$ENABLED_TLS13" = "yes"
  2212. then
  2213. ENABLED_HKDF="yes"
  2214. fi
  2215. if test "$ENABLED_HKDF" = "yes"
  2216. then
  2217. AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"
  2218. fi
  2219. # X9.63 KDF
  2220. AC_ARG_ENABLE([x963kdf],
  2221. [AS_HELP_STRING([--enable-x963kdf],[Enable X9.63 KDF support (default: disabled)])],
  2222. [ ENABLED_X963KDF=$enableval ],
  2223. [ ENABLED_X963KDF=no ]
  2224. )
  2225. if test "$ENABLED_X963KDF" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  2226. then
  2227. AM_CFLAGS="$AM_CFLAGS -DHAVE_X963_KDF"
  2228. fi
  2229. # DSA
  2230. AC_ARG_ENABLE([dsa],
  2231. [AS_HELP_STRING([--enable-dsa],[Enable DSA (default: disabled)])],
  2232. [ ENABLED_DSA=$enableval ],
  2233. [ ENABLED_DSA=no ]
  2234. )
  2235. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || test "$ENABLED_OPENVPN" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_WPAS" = "yes" || test "$ENABLED_QT" = "yes" || test "$ENABLED_BIND" = "yes" || test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_NTP" = "yes"
  2236. then
  2237. ENABLED_DSA="yes"
  2238. fi
  2239. if test "$ENABLED_DSA" = "no"
  2240. then
  2241. AM_CFLAGS="$AM_CFLAGS -DNO_DSA"
  2242. else
  2243. ENABLED_CERTS=yes
  2244. fi
  2245. # ECC Shamir
  2246. AC_ARG_ENABLE([eccshamir],
  2247. [AS_HELP_STRING([--enable-eccshamir],[Enable ECC Shamir (default: enabled)])],
  2248. [ ENABLED_ECC_SHAMIR=$enableval ],
  2249. [ ENABLED_ECC_SHAMIR=yes ]
  2250. )
  2251. # ECC
  2252. AC_ARG_ENABLE([ecc],
  2253. [AS_HELP_STRING([--enable-ecc],[Enable ECC (default: enabled)])],
  2254. [ ENABLED_ECC=$enableval ],
  2255. [ ENABLED_ECC=yes ]
  2256. )
  2257. # lean psk doesn't need ecc
  2258. if test "$ENABLED_LEANPSK" = "yes"
  2259. then
  2260. ENABLED_ECC=no
  2261. fi
  2262. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_NGINX" = "yes" || test "$ENABLED_SIGNAL" = "yes"
  2263. then
  2264. ENABLED_ECC="yes"
  2265. fi
  2266. if test "$ENABLED_ECC" != "no"
  2267. then
  2268. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  2269. if test "$ENABLED_ECC_SHAMIR" = "yes" && test "$ENABLED_LOWRESOURCE" = "no"
  2270. then
  2271. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  2272. fi
  2273. if test "$ENABLED_ECC" = "nonblock"
  2274. then
  2275. AM_CFLAGS="$AM_CFLAGS -DWC_ECC_NONBLOCK"
  2276. fi
  2277. if test "$ENABLED_LOWRESOURCE" = "yes" && test "$ENABLED_FASTMATH" = "yes"
  2278. then
  2279. AM_CFLAGS="$AM_CFLAGS -DALT_ECC_SIZE"
  2280. fi
  2281. ENABLED_CERTS=yes
  2282. fi
  2283. # ECC Custom Curves
  2284. AC_ARG_ENABLE([ecccustcurves],
  2285. [AS_HELP_STRING([--enable-ecccustcurves],[Enable ECC custom curves (default: disabled)])],
  2286. [ ENABLED_ECCCUSTCURVES=$enableval ],
  2287. [ ENABLED_ECCCUSTCURVES=no ]
  2288. )
  2289. if test "$ENABLED_ECCCUSTCURVES" != "no"
  2290. then
  2291. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CUSTOM_CURVES"
  2292. # For distro, all or ecccustcurves=all builds, enable all curve types
  2293. if test "$ENABLED_DISTRO" = "yes" || test "$ENABLED_ALL" = "yes" || test "$ENABLED_ECCCUSTCURVES" = "all"
  2294. then
  2295. # Enable ECC SECPR2, SECPR3, BRAINPOOL and KOBLITZ curves
  2296. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ"
  2297. # Enable ECC Cofactor support
  2298. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_CDH"
  2299. # If fastmath enabled and on x86 use speedups
  2300. if test "x$ENABLED_FASTMATH" = "xyes" && test "$host_cpu" = "x86_64"
  2301. then
  2302. AM_CFLAGS="$AM_CFLAGS -DTFM_ECC192 -DTFM_ECC224 -DTFM_ECC256 -DTFM_ECC384 -DTFM_ECC521"
  2303. fi
  2304. fi
  2305. fi
  2306. # ECC Minimum Key Size
  2307. ENABLED_ECCMINSZ=224
  2308. AC_ARG_WITH([eccminsz],
  2309. [AS_HELP_STRING([--with-eccminsz=BITS],[Sets the ECC minimum key size (default: 224 bits)])],
  2310. [
  2311. ENABLED_ECCMINSZ=$withval
  2312. AM_CFLAGS="$AM_CFLAGS -DECC_MIN_KEY_SZ=$withval"
  2313. ]
  2314. )
  2315. # Compressed Key
  2316. AC_ARG_ENABLE([compkey],
  2317. [AS_HELP_STRING([--enable-compkey],[Enable compressed keys support (default: disabled)])],
  2318. [ ENABLED_COMPKEY=$enableval ],
  2319. [ ENABLED_COMPKEY=no ]
  2320. )
  2321. if test "$ENABLED_WPAS" = "yes"
  2322. then
  2323. ENABLED_COMPKEY=yes
  2324. fi
  2325. if test "$ENABLED_COMPKEY" = "yes"
  2326. then
  2327. AM_CFLAGS="$AM_CFLAGS -DHAVE_COMP_KEY"
  2328. fi
  2329. # for using memory optimization setting on both curve25519 and ed25519
  2330. ENABLED_CURVE25519_SMALL=no
  2331. ENABLED_ED25519_SMALL=no
  2332. # CURVE25519
  2333. AC_ARG_ENABLE([curve25519],
  2334. [AS_HELP_STRING([--enable-curve25519],[Enable Curve25519 (default: disabled)])],
  2335. [ ENABLED_CURVE25519=$enableval ],
  2336. [ ENABLED_CURVE25519=no ]
  2337. )
  2338. if test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno"
  2339. then
  2340. ENABLED_CURVE25519="yes"
  2341. fi
  2342. if test "$ENABLED_CURVE25519" != "no"
  2343. then
  2344. if test "$ENABLED_CURVE25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  2345. then
  2346. AM_CFLAGS="$AM_CFLAGS -DCURVE25519_SMALL"
  2347. ENABLED_CURVE25519_SMALL=yes
  2348. ENABLED_CURVE25519=yes
  2349. fi
  2350. if test "$ENABLED_CURVE25519" = "no128bit" || test "$ENABLED_32BIT" = "yes"
  2351. then
  2352. AM_CFLAGS="$AM_CFLAGS -DNO_CURVED25519_128BIT"
  2353. ENABLED_CURVE25519=yes
  2354. fi
  2355. AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE25519"
  2356. ENABLED_FEMATH=yes
  2357. fi
  2358. # ED25519
  2359. AC_ARG_ENABLE([ed25519],
  2360. [AS_HELP_STRING([--enable-ed25519],[Enable ED25519 (default: disabled)])],
  2361. [ ENABLED_ED25519=$enableval ],
  2362. [ ENABLED_ED25519=no ]
  2363. )
  2364. AC_ARG_ENABLE([ed25519-stream],
  2365. [AS_HELP_STRING([--enable-ed25519-stream],[Enable wolfSSL ED25519 support with streaming verify APIs (default: disabled)])],
  2366. [ ENABLED_ED25519_STREAM=$enableval ],
  2367. [ ENABLED_ED25519_STREAM=no ]
  2368. )
  2369. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
  2370. test "$ENABLED_CHRONY" = "yes"
  2371. then
  2372. ENABLED_ED25519="yes"
  2373. fi
  2374. # for using memory optimization setting on both curve448 and ed448
  2375. ENABLED_CURVE448_SMALL=no
  2376. ENABLED_ED448_SMALL=no
  2377. # CURVE448
  2378. AC_ARG_ENABLE([curve448],
  2379. [AS_HELP_STRING([--enable-curve448],[Enable Curve448 (default: disabled)])],
  2380. [ ENABLED_CURVE448=$enableval ],
  2381. [ ENABLED_CURVE448=no ]
  2382. )
  2383. if test "$ENABLED_CURVE448" != "no"
  2384. then
  2385. if test "$ENABLED_CURVE448" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  2386. then
  2387. AM_CFLAGS="$AM_CFLAGS -DCURVE448_SMALL"
  2388. ENABLED_CURVE448_SMALL=yes
  2389. ENABLED_CURVE448=yes
  2390. fi
  2391. if test "$ENABLED_CURVE448" = "no128bit" || test "$ENABLED_32BIT" = "yes"
  2392. then
  2393. AM_CFLAGS="$AM_CFLAGS -DNO_CURVED448_128BIT"
  2394. ENABLED_CURVE448=yes
  2395. fi
  2396. AM_CFLAGS="$AM_CFLAGS -DHAVE_CURVE448"
  2397. ENABLED_FE448=yes
  2398. fi
  2399. # ED448
  2400. AC_ARG_ENABLE([ed448],
  2401. [AS_HELP_STRING([--enable-ed448],[Enable ED448 (default: disabled)])],
  2402. [ ENABLED_ED448=$enableval ],
  2403. [ ENABLED_ED448=no ]
  2404. )
  2405. AC_ARG_ENABLE([ed448-stream],
  2406. [AS_HELP_STRING([--enable-ed448-stream],[Enable wolfSSL ED448 support with streaming verify APIs (default: disabled)])],
  2407. [ ENABLED_ED448_STREAM=$enableval ],
  2408. [ ENABLED_ED448_STREAM=no ]
  2409. )
  2410. if test "$ENABLED_ED448" != "no" && test "$ENABLED_32BIT" = "no"
  2411. then
  2412. if test "$ENABLED_ED448" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  2413. then
  2414. AM_CFLAGS="$AM_CFLAGS -DED448_SMALL"
  2415. ENABLED_ED448_SMALL=yes
  2416. ENABLED_CURVE448_SMALL=yes
  2417. ENABLED_ED448=yes
  2418. fi
  2419. if test "$ENABLED_SHA512" = "no"
  2420. then
  2421. AC_MSG_ERROR([cannot enable ed448 without enabling sha512.])
  2422. fi
  2423. if test "$HAVE_FIPS_VERSION" = 2
  2424. then
  2425. AC_MSG_ERROR([cannot enable ed448 w/ dependency shake256 in FIPSv2 mode])
  2426. fi
  2427. ENABLED_FE448=yes
  2428. ENABLED_GE448=yes
  2429. AM_CFLAGS="$AM_CFLAGS -DHAVE_ED448"
  2430. # EdDSA448 requires SHAKE256 which requires SHA-3
  2431. ENABLED_SHA3=yes
  2432. ENABLED_SHAKE256=yes
  2433. ENABLED_CERTS=yes
  2434. fi
  2435. if test "$ENABLED_ED448_STREAM" != "no"
  2436. then
  2437. if test "$ENABLED_ED448" = "no"
  2438. then
  2439. AC_MSG_ERROR([ED448 verify streaming enabled but ED448 is disabled])
  2440. else
  2441. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
  2442. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ED448_STREAMING_VERIFY"
  2443. fi
  2444. fi
  2445. # FP ECC, Fixed Point cache ECC
  2446. AC_ARG_ENABLE([fpecc],
  2447. [AS_HELP_STRING([--enable-fpecc],[Enable Fixed Point cache ECC (default: disabled)])],
  2448. [ ENABLED_FPECC=$enableval ],
  2449. [ ENABLED_FPECC=no ]
  2450. )
  2451. if test "$ENABLED_FPECC" = "yes"
  2452. then
  2453. if test "$ENABLED_ECC" = "no"
  2454. then
  2455. AC_MSG_ERROR([cannot enable fpecc without enabling ecc.])
  2456. fi
  2457. AM_CFLAGS="$AM_CFLAGS -DFP_ECC"
  2458. fi
  2459. # ECC encrypt
  2460. AC_ARG_ENABLE([eccencrypt],
  2461. [AS_HELP_STRING([--enable-eccencrypt],[Enable ECC encrypt (default: disabled). yes = SEC1 standard, iso18033 = ISO 18033 standard, old = original wolfSSL algorithm])],
  2462. [ ENABLED_ECC_ENCRYPT=$enableval ],
  2463. [ ENABLED_ECC_ENCRYPT=no ]
  2464. )
  2465. if test "$ENABLED_ECC_ENCRYPT" != "no"
  2466. then
  2467. if test "$ENABLED_ECC" = "no"
  2468. then
  2469. AC_MSG_ERROR([cannot enable eccencrypt without enabling ecc.])
  2470. fi
  2471. if test "$ENABLED_HKDF" = "no"
  2472. then
  2473. AC_MSG_ERROR([cannot enable eccencrypt without enabling hkdf.])
  2474. fi
  2475. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC_ENCRYPT"
  2476. if test "$ENABLED_ECC_ENCRYPT" = "old"
  2477. then
  2478. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECIES_OLD"
  2479. fi
  2480. if test "$ENABLED_ECC_ENCRYPT" = "iso18033"
  2481. then
  2482. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ECIES_ISO18033"
  2483. fi
  2484. fi
  2485. # Elliptic Curve-Based Certificateless Signatures for Identity-Based Encryption (ECCSI)
  2486. AC_ARG_ENABLE([eccsi],
  2487. [AS_HELP_STRING([--enable-eccsi],[Enable ECCSI (default: disabled)])],
  2488. [ ENABLED_ECCSI=$enableval ],
  2489. [ ENABLED_ECCSI=no ]
  2490. )
  2491. if test "x$ENABLED_ECCSI" = "xyes"
  2492. then
  2493. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_ECCSI -DWOLFSSL_PUBLIC_MP"
  2494. fi
  2495. # Sakai-Kasahara Key Encryption (SAKKE) - pairing based crypto
  2496. AC_ARG_ENABLE([sakke],
  2497. [AS_HELP_STRING([--enable-sakke],[Enable SAKKE - paring based crypto (default: disabled)])],
  2498. [ ENABLED_SAKKE=$enableval ],
  2499. [ ENABLED_SAKKE=no ]
  2500. )
  2501. if test "x$ENABLED_SAKKE" = "xsmall"
  2502. then
  2503. ENABLED_SAKKE="yes"
  2504. ENABLED_SAKKE_SMALL="yes"
  2505. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_SAKKE_SMALL"
  2506. fi
  2507. if test "x$ENABLED_SAKKE" = "xyes"
  2508. then
  2509. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SAKKE"
  2510. fi
  2511. # PSK
  2512. AC_ARG_ENABLE([psk],
  2513. [AS_HELP_STRING([--enable-psk],[Enable PSK (default: disabled)])],
  2514. [ ENABLED_PSK=$enableval ],
  2515. [ ENABLED_PSK=no ]
  2516. )
  2517. # Single PSK identity
  2518. AC_ARG_ENABLE([psk-one-id],
  2519. [AS_HELP_STRING([--enable-psk-one-id],[Enable PSK (default: disabled)])],
  2520. [ ENABLED_PSK_ONE_ID=$enableval ],
  2521. [ ENABLED_PSK_ONE_ID=no ]
  2522. )
  2523. if test "$ENABLED_PSK_ONE_ID" = "yes"
  2524. then
  2525. if test "$ENABLED_PSK" = "no"
  2526. then
  2527. ENABLED_PSK="yes"
  2528. fi
  2529. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSK_ONE_ID"
  2530. fi
  2531. # ERROR STRINGS
  2532. AC_ARG_ENABLE([errorstrings],
  2533. [AS_HELP_STRING([--enable-errorstrings],[Enable error strings table (default: enabled)])],
  2534. [ ENABLED_ERROR_STRINGS=$enableval ],
  2535. [ ENABLED_ERROR_STRINGS=yes ]
  2536. )
  2537. if test "$ENABLED_ERROR_STRINGS" = "no"
  2538. then
  2539. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  2540. else
  2541. # turn off error strings if leanpsk or leantls on
  2542. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  2543. then
  2544. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_STRINGS"
  2545. ENABLED_ERROR_STRINGS=no
  2546. fi
  2547. fi
  2548. # ERROR QUEUE
  2549. AC_ARG_ENABLE([errorqueue],
  2550. [AS_HELP_STRING([--enable-errorqueue],[Disables adding nodes to error queue when compiled with OPENSSL_EXTRA (default: enabled)])],
  2551. [ ENABLED_ERROR_QUEUE=$enableval ],
  2552. [ ENABLED_ERROR_QUEUE=yes ]
  2553. )
  2554. # OLD TLS
  2555. AC_ARG_ENABLE([oldtls],
  2556. [AS_HELP_STRING([--enable-oldtls],[Enable old TLS versions < 1.2 (default: enabled)])],
  2557. [ ENABLED_OLD_TLS=$enableval ],
  2558. [ ENABLED_OLD_TLS=yes ]
  2559. )
  2560. if test "$ENABLED_OLD_TLS" = "no"
  2561. then
  2562. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  2563. else
  2564. # turn off old if leanpsk or leantls on
  2565. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  2566. then
  2567. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  2568. ENABLED_OLD_TLS=no
  2569. fi
  2570. fi
  2571. # TLSv1.2
  2572. AC_ARG_ENABLE([tlsv12],
  2573. [AS_HELP_STRING([--enable-tlsv12],[Enable TLS versions 1.2 (default: enabled)])],
  2574. [ ENABLED_TLSV12=$enableval ],
  2575. [ ENABLED_TLSV12=yes ]
  2576. )
  2577. if test "$ENABLED_TLSV12" = "no"
  2578. then
  2579. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_TLS12 -DNO_OLD_TLS"
  2580. fi
  2581. # TLSv1.0
  2582. AC_ARG_ENABLE([tlsv10],
  2583. [AS_HELP_STRING([--enable-tlsv10],[Enable old TLS versions 1.0 (default: disabled)])],
  2584. [ ENABLED_TLSV10=$enableval ],
  2585. [ ENABLED_TLSV10=no ]
  2586. )
  2587. if test "$ENABLED_TLSV10" = "yes"
  2588. then
  2589. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_TLSV10"
  2590. fi
  2591. # SSLv3
  2592. AC_ARG_ENABLE([sslv3],
  2593. [AS_HELP_STRING([--enable-sslv3],[Enable SSL version 3.0 (default: disabled)])],
  2594. [ ENABLED_SSLV3=$enableval ],
  2595. [ ENABLED_SSLV3=no]
  2596. )
  2597. if test "x$ENABLED_HAPROXY" = "xyes" && test "x$ENABLED_ALL" = "xno"
  2598. then
  2599. ENABLED_SSLV3="yes"
  2600. fi
  2601. if test "$ENABLED_SSLV3" = "yes"
  2602. then
  2603. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_SSLV3"
  2604. fi
  2605. # STACK SIZE info for testwolfcrypt and examples
  2606. AC_ARG_ENABLE([stacksize],
  2607. [AS_HELP_STRING([--enable-stacksize],[Enable stack size info on examples (default: disabled)])],
  2608. [ ENABLED_STACKSIZE=$enableval ],
  2609. [ ENABLED_STACKSIZE=no ]
  2610. )
  2611. if test "$ENABLED_STACKSIZE" != "no"
  2612. then
  2613. AC_CHECK_FUNC([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
  2614. AC_CHECK_DECL([posix_memalign], [], [AC_MSG_ERROR(stacksize needs posix_memalign)])
  2615. AC_CHECK_FUNC([pthread_attr_setstack], [], AC_CHECK_LIB([pthread],[pthread_attr_setstack]))
  2616. AC_CHECK_DECL([pthread_attr_setstack], [], [AC_MSG_ERROR(stacksize needs pthread_attr_setstack)], [[#include <pthread.h>]])
  2617. AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE"
  2618. fi
  2619. if test "$ENABLED_STACKSIZE" = "verbose"
  2620. then
  2621. if test "$thread_ls_on" != "yes"
  2622. then
  2623. AC_MSG_ERROR(stacksize-verbose needs thread-local storage.)
  2624. fi
  2625. AM_CFLAGS="$AM_CFLAGS -DHAVE_STACK_SIZE_VERBOSE"
  2626. fi
  2627. # MEMORY
  2628. AC_ARG_ENABLE([memory],
  2629. [AS_HELP_STRING([--enable-memory],[Enable memory callbacks (default: enabled)])],
  2630. [ ENABLED_MEMORY=$enableval ],
  2631. [ ENABLED_MEMORY=yes ]
  2632. )
  2633. if test "$ENABLED_MEMORY" = "no"
  2634. then
  2635. AM_CFLAGS="$AM_CFLAGS -DNO_WOLFSSL_MEMORY"
  2636. else
  2637. # turn off memory cb if leanpsk or leantls on
  2638. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  2639. then
  2640. # but don't turn on NO_WOLFSSL_MEMORY because using own
  2641. ENABLED_MEMORY=no
  2642. fi
  2643. fi
  2644. # MEMORY SIZE info
  2645. AC_ARG_ENABLE([trackmemory],
  2646. [AS_HELP_STRING([--enable-trackmemory],[Enable memory use info on wolfCrypt and wolfSSL cleanup (default: disabled)])],
  2647. [ ENABLED_TRACKMEMORY=$enableval ],
  2648. [ ENABLED_TRACKMEMORY=no ]
  2649. )
  2650. if test "$ENABLED_TRACKMEMORY" != "no"
  2651. then
  2652. if test "$ENABLED_MEMORY" = "yes"
  2653. then
  2654. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY"
  2655. else
  2656. AC_MSG_ERROR([trackmemory requires using wolfSSL memory (--enable-memory).])
  2657. fi
  2658. if test "$ENABLED_TRACKMEMORY" = "verbose"
  2659. then
  2660. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY_VERBOSE"
  2661. fi
  2662. fi
  2663. # MEMORY usage logging
  2664. AC_ARG_ENABLE([memorylog],
  2665. [AS_HELP_STRING([--enable-memorylog],[Enable dynamic memory logging (default: disabled)])],
  2666. [ ENABLED_MEMORYLOG=$enableval ],
  2667. [ ENABLED_MEMORYLOG=no ]
  2668. )
  2669. if test "$ENABLED_MEMORYLOG" = "yes"
  2670. then
  2671. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MEMORY_LOG"
  2672. fi
  2673. # STACK usage logging
  2674. AC_ARG_ENABLE([stacklog],
  2675. [AS_HELP_STRING([--enable-stacklog],[Enable stack logging (default: disabled)])],
  2676. [ ENABLED_STACKLOG=$enableval ],
  2677. [ ENABLED_STACKLOG=no ]
  2678. )
  2679. if test "$ENABLED_STACKLOG" = "yes"
  2680. then
  2681. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STACK_LOG -finstrument-functions"
  2682. fi
  2683. ENABLED_WOLFSENTRY=no
  2684. AC_ARG_WITH([wolfsentry],
  2685. [AS_HELP_STRING([--with-wolfsentry=PATH],[PATH to directory with wolfSentry installation])],
  2686. [WOLFSENTRY_INSTALLDIR=$withval],
  2687. [WOLFSENTRY_INSTALLDIR=""])
  2688. AC_ARG_WITH([wolfsentry-lib],
  2689. [AS_HELP_STRING([--with-wolfsentry-lib=PATH],[PATH to directory with wolfSentry library])],
  2690. [WOLFSENTRY_LIB=$withval],
  2691. [WOLFSENTRY_LIB=""])
  2692. AC_ARG_WITH([wolfsentry-include],
  2693. [AS_HELP_STRING([--with-wolfsentry-include=PATH],[PATH to directory with wolfSentry header files])],
  2694. [WOLFSENTRY_INCLUDE=$withval],
  2695. [WOLFSENTRY_INCLUDE=""])
  2696. if test -n "$WOLFSENTRY_INSTALLDIR" || test -n "$WOLFSENTRY_LIB" || test -n "$WOLFSENTRY_INCLUDE"
  2697. then
  2698. ENABLED_WOLFSENTRY=yes
  2699. fi
  2700. AC_ARG_ENABLE([wolfsentry],
  2701. [AS_HELP_STRING([--enable-wolfsentry],[Enable wolfSentry hooks and plugins (default: disabled)])],
  2702. [ ENABLED_WOLFSENTRY=$enableval ],
  2703. [ ]
  2704. )
  2705. if test "$WOLFSENTRY_LIB" = "" && test -n "$WOLFSENTRY_INSTALLDIR"
  2706. then
  2707. WOLFSENTRY_LIB="${WOLFSENTRY_INSTALLDIR}/lib"
  2708. fi
  2709. if test "$WOLFSENTRY_INCLUDE" = "" && test -n "$WOLFSENTRY_INSTALLDIR"
  2710. then
  2711. WOLFSENTRY_INCLUDE="${WOLFSENTRY_INSTALLDIR}/include"
  2712. fi
  2713. if test -n "$WOLFSENTRY_LIB"
  2714. then
  2715. AC_MSG_CHECKING([for $WOLFSENTRY_LIB])
  2716. if ! test -d "$WOLFSENTRY_LIB"
  2717. then
  2718. AC_MSG_ERROR([wolfSentry lib dir $WOLFSENTRY_LIB not found.])
  2719. fi
  2720. AC_MSG_RESULT([yes])
  2721. WOLFSENTRY_LIB="-L$WOLFSENTRY_LIB"
  2722. fi
  2723. if test -n "$WOLFSENTRY_INCLUDE"
  2724. then
  2725. AC_MSG_CHECKING([for $WOLFSENTRY_INCLUDE])
  2726. if ! test -d "$WOLFSENTRY_INCLUDE"
  2727. then
  2728. AC_MSG_ERROR([wolfSentry include dir $WOLFSENTRY_INCLUDE not found.])
  2729. fi
  2730. AC_MSG_RESULT([yes])
  2731. WOLFSENTRY_INCLUDE="-I$WOLFSENTRY_INCLUDE"
  2732. fi
  2733. if test "$ENABLED_WOLFSENTRY" = "yes"
  2734. then
  2735. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_WOLFSENTRY_HOOKS -DHAVE_EX_DATA -DHAVE_EX_DATA_CLEANUP_HOOKS"
  2736. WOLFSENTRY_LIB="$WOLFSENTRY_LIB -lwolfsentry"
  2737. fi
  2738. AC_SUBST([WOLFSENTRY_LIB])
  2739. AC_SUBST([WOLFSENTRY_INCLUDE])
  2740. if test "$ENABLED_QT" = "yes"
  2741. then
  2742. # Requires opensslextra and opensslall
  2743. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  2744. then
  2745. ENABLED_OPENSSLALL="yes"
  2746. ENABLED_OPENSSLEXTRA="yes"
  2747. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL -DHAVE_EX_DATA"
  2748. fi
  2749. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_QT -DSESSION_CERTS -DOPENSSL_NO_SSL2"
  2750. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN -DHAVE_EX_DATA"
  2751. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CUSTOM_CURVES -DHAVE_ECC_SECPR2 -DHAVE_ECC_SECPR3 -DHAVE_ECC_BRAINPOOL -DHAVE_ECC_KOBLITZ"
  2752. if test "x$ENABLED_ALL" = "xno"; then
  2753. # Don't enable old SSL/TLS for --enable-all, which is used by distro
  2754. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_SSLV3 -DWOLFSSL_ALLOW_TLSV10"
  2755. fi
  2756. # Requires OCSP make sure on
  2757. if test "x$ENABLED_OCSP" = "xno"
  2758. then
  2759. ENABLED_OCSP="yes"
  2760. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  2761. fi
  2762. # Requires PSK make sure on
  2763. if test "x$ENABLED_PSK" = "xno"
  2764. then
  2765. ENABLED_PSK="yes"
  2766. fi
  2767. # Requires RC4 make sure on (if not forcefully disabled with --disable-arc4)
  2768. test "$enable_arc4" = "" && enable_arc4=yes
  2769. if test "x$ENABLED_CERTEXT" = "xno"
  2770. then
  2771. ENABLED_CERTEXT="yes"
  2772. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  2773. fi
  2774. if test "x$ENABLED_CERTGEN" = "xno"
  2775. then
  2776. ENABLED_CERTGEN="yes"
  2777. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  2778. fi
  2779. # requires oldnames disabled
  2780. enable_oldnames=no
  2781. fi
  2782. AC_ARG_ENABLE([qt-test],
  2783. [AS_HELP_STRING([--enable-qt-test],[Enable qt tests (default: disabled)])],
  2784. [ ENABLED_QT_TEST=$enableval ],
  2785. [ ENABLED_QT_TEST=no ]
  2786. )
  2787. if test "$ENABLED_QT_TEST" = "yes"
  2788. then
  2789. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL3 -DWOLFSSL_STATIC_RSA"
  2790. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC_PSK"
  2791. fi
  2792. # RSA
  2793. AC_ARG_ENABLE([rsa],
  2794. [AS_HELP_STRING([--enable-rsa],[Enable RSA (default: enabled)])],
  2795. [ ENABLED_RSA=$enableval ],
  2796. [ ENABLED_RSA=yes ]
  2797. )
  2798. if test "$ENABLED_RSA" = "no"
  2799. then
  2800. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  2801. else
  2802. # turn off RSA if leanpsk or leantls on
  2803. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  2804. then
  2805. AM_CFLAGS="$AM_CFLAGS -DNO_RSA"
  2806. ENABLED_RSA=no
  2807. else
  2808. ENABLED_CERTS=yes
  2809. fi
  2810. fi
  2811. AC_ARG_ENABLE([oaep],
  2812. [AS_HELP_STRING([--enable-oaep],[Enable RSA OAEP (default: enabled)])],
  2813. [ ENABLED_OAEP=$enableval ],
  2814. [ ENABLED_OAEP=yes ]
  2815. )
  2816. if test "$ENABLED_OAEP" = "no"
  2817. then
  2818. AM_CFLAGS="$AM_CFLAGS -DWC_NO_RSA_OAEP"
  2819. fi
  2820. AC_ARG_ENABLE([rsapub],
  2821. [AS_HELP_STRING([--enable-rsapub],[Enable RSA Public Only (default: disabled)])],
  2822. [ ENABLED_RSAPUB=$enableval ],
  2823. [ ENABLED_RSAPUB=no ]
  2824. )
  2825. if test "$ENABLED_RSAPUB" = "yes"
  2826. then
  2827. if test "$ENABLED_RSA" = "no"
  2828. then
  2829. ENABLED_RSA="yes"
  2830. fi
  2831. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSA_PUBLIC_ONLY"
  2832. fi
  2833. AC_ARG_ENABLE([rsavfy],
  2834. [AS_HELP_STRING([--enable-rsavfy],[Enable RSA Verify Inline Only (default: disabled)])],
  2835. [ ENABLED_RSAVFY=$enableval ],
  2836. [ ENABLED_RSAVFY=no ]
  2837. )
  2838. if test "$ENABLED_RSAVFY" = "yes"
  2839. then
  2840. if test "$ENABLED_RSA" = "no"
  2841. then
  2842. ENABLED_RSA="yes"
  2843. fi
  2844. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSA_PUBLIC_ONLY -DWOLFSSL_RSA_VERIFY_ONLY"
  2845. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSA_VERIFY_INLINE -DNO_SIG_WRAPPER"
  2846. AM_CFLAGS="$AM_CFLAGS -DNO_CHECK_PRIVATE_KEY"
  2847. fi
  2848. # RSA-PSS
  2849. AC_ARG_ENABLE([rsapss],
  2850. [ --enable-rsapss Enable RSA-PSS (default: disabled)],
  2851. [ ENABLED_RSAPSS=$enableval ],
  2852. [ ENABLED_RSAPSS=no ]
  2853. )
  2854. if test "$ENABLED_RSA" = "no"
  2855. then
  2856. ENABLED_RSAPSS="no"
  2857. else
  2858. if test "$ENABLED_TLS13" = "yes"
  2859. then
  2860. ENABLED_RSAPSS="yes"
  2861. fi
  2862. fi
  2863. if test "$ENABLED_RSAPSS" = "yes"
  2864. then
  2865. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"
  2866. fi
  2867. # DH
  2868. AC_ARG_ENABLE([dh],
  2869. [AS_HELP_STRING([--enable-dh],[Enable DH (default: enabled)])],
  2870. [ ENABLED_DH=$enableval ],
  2871. [ ENABLED_DH=yes ]
  2872. )
  2873. if test "$ENABLED_OPENSSH" = "yes"
  2874. then
  2875. ENABLED_DH="yes"
  2876. fi
  2877. if test "$ENABLED_DH" = "no"
  2878. then
  2879. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  2880. else
  2881. # turn off DH if leanpsk or leantls on
  2882. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  2883. then
  2884. AM_CFLAGS="$AM_CFLAGS -DNO_DH"
  2885. ENABLED_DH=no
  2886. fi
  2887. fi
  2888. if test "x$ENABLED_SNIFFER" = "xyes" && test "x$ENABLED_DH" = "xyes"
  2889. then
  2890. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DH_EXTRA"
  2891. fi
  2892. # Anonymous
  2893. AC_ARG_ENABLE([anon],
  2894. [AS_HELP_STRING([--enable-anon],[Enable Anonymous (default: disabled)])],
  2895. [ ENABLED_ANON=$enableval ],
  2896. [ ENABLED_ANON=no ]
  2897. )
  2898. if test "x$ENABLED_WPAS" = "xyes" || test "x$ENABLED_NGINX" = "xyes" || \
  2899. test "x$ENABLED_HAPROXY" = "xyes" || test "$ENABLED_RSYSLOG" = "yes"
  2900. then
  2901. ENABLED_ANON=yes
  2902. fi
  2903. if test "x$ENABLED_ANON" = "xyes"
  2904. then
  2905. if test "x$ENABLED_DH" != "xyes"
  2906. then
  2907. AC_MSG_ERROR([Anonymous suite requires DH.])
  2908. fi
  2909. AM_CFLAGS="$AM_CFLAGS -DHAVE_ANON"
  2910. fi
  2911. # ASN
  2912. # turn off asn, which means no certs, no rsa, no dsa, no ecc,
  2913. # and no big int (unless dh is on)
  2914. AC_ARG_ENABLE([asn],
  2915. [AS_HELP_STRING([--enable-asn],[Enable ASN (default: enabled)])],
  2916. [ ENABLED_ASN=$enableval ],
  2917. [ ENABLED_ASN=yes ]
  2918. )
  2919. if test "$ENABLED_ASN" = "template"
  2920. then
  2921. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASN_TEMPLATE"
  2922. ENABLED_ASN=yes
  2923. fi
  2924. if test "$ENABLED_ASN" = "no"
  2925. then
  2926. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_ASN_CRYPT"
  2927. enable_pwdbased=no
  2928. if test "$ENABLED_DH" = "no" && test "$ENABLED_ECC" = "no"
  2929. then
  2930. # DH and ECC need bigint
  2931. AM_CFLAGS="$AM_CFLAGS -DNO_BIG_INT"
  2932. fi
  2933. else
  2934. # turn off ASN if leanpsk on
  2935. if test "$ENABLED_LEANPSK" = "yes"
  2936. then
  2937. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_BIG_INT"
  2938. ENABLED_ASN=no
  2939. else
  2940. if test "$ENABLED_ASN" = "nocrypt"
  2941. then
  2942. AM_CFLAGS="$AM_CFLAGS -DNO_ASN_CRYPT"
  2943. enable_pwdbased=no
  2944. fi
  2945. fi
  2946. fi
  2947. if test "$ENABLED_RSA" = "yes" && test "$ENABLED_RSAVFY" = "no" && test "$ENABLED_ASN" = "no"
  2948. then
  2949. AC_MSG_ERROR([please disable rsa if disabling asn.])
  2950. fi
  2951. if test "$ENABLED_DSA" = "yes" && test "$ENABLED_ASN" = "no"
  2952. then
  2953. AC_MSG_ERROR([please disable dsa if disabling asn.])
  2954. fi
  2955. # DH and ECC need bigint
  2956. if test "$ENABLED_ASN" = "no" && test "$ENABLED_DH" = "no" && test "$ENABLED_ECC" = "no" && test "$ENABLED_RSA" = "no"
  2957. then
  2958. ENABLED_FASTMATH=no
  2959. ENABLED_SLOWMATH=no
  2960. fi
  2961. # AES
  2962. AC_ARG_ENABLE([aes],
  2963. [AS_HELP_STRING([--enable-aes],[Enable AES (default: enabled)])],
  2964. [ ENABLED_AES=$enableval ],
  2965. [ ENABLED_AES=yes ]
  2966. )
  2967. if test "$ENABLED_AES" = "no"
  2968. then
  2969. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  2970. if test "$ENABLED_FORTRESS" = "yes"
  2971. then
  2972. AC_MSG_ERROR([fortress requires aes])
  2973. fi
  2974. if test "$ENABLED_ECC_ENCRYPT" = "yes"
  2975. then
  2976. AC_MSG_ERROR([cannot enable eccencrypt and hkdf without aes.])
  2977. fi
  2978. if test "$ENABLED_AESGCM" = "yes"
  2979. then
  2980. AC_MSG_ERROR([AESGCM requires AES.])
  2981. fi
  2982. if test "$ENABLED_AESCCM" = "yes"
  2983. then
  2984. AC_MSG_ERROR([AESCCM requires AES.])
  2985. fi
  2986. if test "$ENABLED_AESCTR" = "yes"
  2987. then
  2988. AC_MSG_ERROR([AESCTR requires AES.])
  2989. fi
  2990. else
  2991. # turn off AES if leanpsk on
  2992. if test "$ENABLED_LEANPSK" = "yes"
  2993. then
  2994. AM_CFLAGS="$AM_CFLAGS -DNO_AES"
  2995. ENABLED_AES=no
  2996. fi
  2997. fi
  2998. # CODING
  2999. AC_ARG_ENABLE([coding],
  3000. [AS_HELP_STRING([--enable-coding],[Enable Coding base 16/64 (default: enabled)])],
  3001. [ ENABLED_CODING=$enableval ],
  3002. [ ENABLED_CODING=yes ]
  3003. )
  3004. if test "$ENABLED_CODING" = "no"
  3005. then
  3006. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  3007. else
  3008. # turn off CODING if leanpsk on
  3009. if test "$ENABLED_LEANPSK" = "yes"
  3010. then
  3011. AM_CFLAGS="$AM_CFLAGS -DNO_CODING"
  3012. ENABLED_CODING=no
  3013. fi
  3014. fi
  3015. # Base64 Encode
  3016. BASE64ENCODE_DEFAULT=no
  3017. if test "$host_cpu" = "x86_64"
  3018. then
  3019. BASE64ENCODE_DEFAULT=yes
  3020. fi
  3021. AC_ARG_ENABLE([base64encode],
  3022. [AS_HELP_STRING([--enable-base64encode],[Enable Base64 encoding (default: enabled on x86_64)])],
  3023. [ ENABLED_BASE64ENCODE=$enableval ],
  3024. [ ENABLED_BASE64ENCODE=$BASE64ENCODE_DEFAULT ]
  3025. )
  3026. if test "$ENABLED_BASE64ENCODE" = "yes"
  3027. then
  3028. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BASE64_ENCODE"
  3029. fi
  3030. # Base16
  3031. AC_ARG_ENABLE([base16],
  3032. [AS_HELP_STRING([--enable-base16],[Enable Base16 encoding/decoding (default: disabled)])],
  3033. [ ENABLED_BASE16=$enableval ],
  3034. [ ENABLED_BASE16=no ]
  3035. )
  3036. if test "$ENABLED_CAAM" = "qnx"
  3037. then
  3038. ENABLED_BASE16=yes
  3039. fi
  3040. if test "$ENABLED_BASE16" = "yes"
  3041. then
  3042. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BASE16"
  3043. fi
  3044. # DES3
  3045. AC_ARG_ENABLE([des3],
  3046. [AS_HELP_STRING([--enable-des3],[Enable DES3 (default: disabled)])],
  3047. [ ENABLED_DES3=$enableval ],
  3048. [ ENABLED_DES3=no ]
  3049. )
  3050. # Enable 3DES with OpenSSH and FIPS 140-2 but not 140-3
  3051. if (test "$ENABLED_OPENSSH" = "yes" && \
  3052. (test "x$ENABLED_FIPS" = "xno" || test "$HAVE_FIPS_VERSION" -le 2)) || \
  3053. test "$ENABLED_QT" = "yes" || test "$ENABLED_OPENVPN" = "yes" || \
  3054. test "x$ENABLED_WPAS" != "xno" || test "$ENABLED_NETSNMP" = "yes" || \
  3055. test "$ENABLED_LIBSSH2" = "yes" || test "$ENABLED_KRB" = "yes" || \
  3056. test "$ENABLED_WOLFENGINE" = "yes"
  3057. then
  3058. ENABLED_DES3="yes"
  3059. fi
  3060. # ARC4
  3061. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
  3062. test "$ENABLED_WPAS" = "yes" || test "$ENABLED_KRB" = "yes"
  3063. then
  3064. # Requires RC4 make sure on (if not forcefully disabled with --disable-arc4)
  3065. test "$enable_arc4" = "" && enable_arc4=yes
  3066. fi
  3067. AC_ARG_ENABLE([arc4],
  3068. [AS_HELP_STRING([--enable-arc4],[Enable ARC4 (default: disabled)])],
  3069. [ ENABLED_ARC4=$enableval ],
  3070. [ ENABLED_ARC4=no ]
  3071. )
  3072. # MD5
  3073. AC_ARG_ENABLE([md5],
  3074. [AS_HELP_STRING([--enable-md5],[Enable MD5 (default: enabled)])],
  3075. [ ENABLED_MD5=$enableval ],
  3076. [ ENABLED_MD5=yes ]
  3077. )
  3078. # SHA
  3079. AC_ARG_ENABLE([sha],
  3080. [AS_HELP_STRING([--enable-sha],[Enable SHA (default: enabled)])],
  3081. [ ENABLED_SHA=$enableval ],
  3082. [ ENABLED_SHA=yes ]
  3083. )
  3084. if test "$ENABLED_SHA" = "no"
  3085. then
  3086. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  3087. else
  3088. # turn off SHA if leanpsk or leantls on
  3089. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3090. then
  3091. AM_CFLAGS="$AM_CFLAGS -DNO_SHA -DNO_OLD_TLS"
  3092. ENABLED_SHA=no
  3093. fi
  3094. fi
  3095. # SipHash
  3096. AC_ARG_ENABLE([siphash],
  3097. [AS_HELP_STRING([--enable-siphash],[Enable SipHash (default: disabled)])],
  3098. [ ENABLED_SIPHASH=$enableval ],
  3099. [ ENABLED_SIPHASH=no ]
  3100. )
  3101. AS_IF([test "x$ENABLED_SIPHASH" = "xyes"],
  3102. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIPHASH"])
  3103. # CMAC
  3104. AC_ARG_ENABLE([cmac],
  3105. [AS_HELP_STRING([--enable-cmac],[Enable CMAC (default: disabled)])],
  3106. [ ENABLED_CMAC=$enableval ],
  3107. [ ENABLED_CMAC=no ]
  3108. )
  3109. if test "$ENABLED_WPAS" != "no" || test "$ENABLED_NTP" = "yes" || test "$ENABLED_AESSIV" = "yes" || test "$ENABLED_WOLFENGINE" = "yes"
  3110. then
  3111. ENABLED_CMAC=yes
  3112. fi
  3113. AS_IF([test "x$ENABLED_CMAC" = "xyes"],
  3114. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC -DWOLFSSL_AES_DIRECT"])
  3115. # AES-XTS
  3116. AC_ARG_ENABLE([xts],
  3117. [AS_HELP_STRING([--enable-xts],[Enable XTS (default: disabled)])],
  3118. [ ENABLED_XTS=$enableval ],
  3119. [ ENABLED_XTS=no ]
  3120. )
  3121. AS_IF([test "x$ENABLED_XTS" = "xyes"],
  3122. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_XTS -DWOLFSSL_AES_DIRECT"])
  3123. # Web Server Build
  3124. AC_ARG_ENABLE([webserver],
  3125. [AS_HELP_STRING([--enable-webserver],[Enable Web Server (default: disabled)])],
  3126. [ ENABLED_WEBSERVER=$enableval ],
  3127. [ ENABLED_WEBSERVER=no ]
  3128. )
  3129. if test "$ENABLED_WEBSERVER" = "yes"
  3130. then
  3131. AM_CFLAGS="$AM_CFLAGS -DHAVE_WEBSERVER"
  3132. fi
  3133. # Web Client Build (HTTP Client)
  3134. AC_ARG_ENABLE([webclient],
  3135. [AS_HELP_STRING([--enable-webclient],[Enable Web Client (HTTP) (default: disabled)])],
  3136. [ ENABLED_WEBCLIENT=$enableval ],
  3137. [ ENABLED_WEBCLIENT=no ]
  3138. )
  3139. if test "$ENABLED_WEBCLIENT" = "yes"
  3140. then
  3141. AM_CFLAGS="$AM_CFLAGS -DHAVE_HTTP_CLIENT"
  3142. fi
  3143. # RC2
  3144. AC_ARG_ENABLE([rc2],
  3145. [AS_HELP_STRING([--enable-rc2],[Enable RC2 encryption (default: disabled)])],
  3146. [ ENABLED_RC2=$enableval ],
  3147. [ ENABLED_RC2=no ]
  3148. )
  3149. if test "$ENABLED_RC2" = "yes"
  3150. then
  3151. AM_CFLAGS="$AM_CFLAGS -DWC_RC2"
  3152. fi
  3153. # FIPS feature and macro setup
  3154. AS_CASE([$FIPS_VERSION],
  3155. [v5*], [ # FIPS 140-3
  3156. AM_CFLAGS="$AM_CFLAGS \
  3157. -DHAVE_FIPS \
  3158. -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION \
  3159. -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR \
  3160. -DHAVE_ECC_CDH \
  3161. -DWC_RSA_NO_PADDING \
  3162. -DECC_USER_CURVES \
  3163. -DHAVE_ECC384 \
  3164. -DHAVE_ECC521 \
  3165. -DWOLFSSL_VALIDATE_FFC_IMPORT \
  3166. -DHAVE_FFDHE_Q \
  3167. -DHAVE_FFDHE_3072 \
  3168. -DHAVE_FFDHE_4096 \
  3169. -DHAVE_FFDHE_6144 \
  3170. -DHAVE_FFDHE_8192"
  3171. # KCAPI API does not support custom k for sign, don't force enable ECC key sizes and do not use seed callback
  3172. AS_IF([test "x$ENABLED_KCAPI_ECC" = "xno"],
  3173. [AM_CFLAGS="$AM_CFLAGS \
  3174. -DWC_RNG_SEED_CB \
  3175. -DWOLFSSL_ECDSA_SET_K \
  3176. -DWOLFSSL_VALIDATE_ECC_IMPORT \
  3177. -DWOLFSSL_VALIDATE_ECC_KEYGEN \
  3178. -DHAVE_ECC192 \
  3179. -DHAVE_ECC224 \
  3180. -DHAVE_ECC256"])
  3181. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=8192
  3182. # force various features to FIPS 140-3 defaults, unless overridden with v5-dev:
  3183. AS_IF([test "$ENABLED_KEYGEN" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_keygen" != "no")],
  3184. [ENABLED_KEYGEN="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"])
  3185. AS_IF([test "$ENABLED_SHA224" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_sha224" != "no")],
  3186. [ENABLED_SHA224="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224"])
  3187. AS_IF([test "$ENABLED_WOLFSSH" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_ssh" != "no")],
  3188. [enable_ssh="yes"])
  3189. # Shake256 is a SHA-3 algorithm not in our FIPS algorithm list
  3190. AS_IF([test "$ENABLED_SHAKE256" != "no" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_shake256" != "yes")],
  3191. [ENABLED_SHAKE256=no; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_SHAKE256"])
  3192. # SHA512-224 and SHA512-256 are SHA-2 algorithms not in our FIPS algorithm list
  3193. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  3194. AS_IF([test "$ENABLED_AESCCM" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesccm" != "no")],
  3195. [ENABLED_AESCCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"])
  3196. AS_IF([test "$ENABLED_RSAPSS" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_rsapss" != "no")],
  3197. [ENABLED_RSAPSS="yes"; AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"])
  3198. AS_IF([test "$ENABLED_ECC" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_ecc" != "no")],
  3199. [ENABLED_ECC="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  3200. AS_IF([test "$ENABLED_ECC_SHAMIR" = "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_eccshamir" != "no")],
  3201. [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])])
  3202. AS_IF([test "$ENABLED_AESCTR" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesctr" != "no")],
  3203. [ENABLED_AESCTR="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"])
  3204. AS_IF([test "$ENABLED_CMAC" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_cmac" != "no")],
  3205. [ENABLED_CMAC="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"])
  3206. AS_IF([test "$ENABLED_HKDF" != "yes" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_hkdf" != "no")],
  3207. [ENABLED_HKDF="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"])
  3208. AS_IF([test "$ENABLED_INTELASM" = "yes"],
  3209. [AM_CFLAGS="$AM_CFLAGS -DFORCE_FAILURE_RDSEED"])
  3210. AS_IF([test "$ENABLED_SHA512" = "no" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_sha512" != "no")],
  3211. [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"])
  3212. AS_IF([test "$ENABLED_AESGCM" = "no" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesgcm" != "no")],
  3213. [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"])
  3214. # Old TLS requires MD5 + HMAC, which is not allowed under FIPS 140-3
  3215. AS_IF([test "$ENABLED_OLD_TLS" != "no"],
  3216. [ENABLED_OLD_TLS="no"; AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"])
  3217. AS_IF([test $HAVE_FIPS_VERSION_MINOR -ge 2],
  3218. [AS_IF([test "x$ENABLED_AESOFB" = "xno" && (test "$FIPS_VERSION" != "v5-dev" || test "$enable_aesofb" != "no")],
  3219. [ENABLED_AESOFB="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_OFB"])])
  3220. AS_IF([(test "$ENABLED_AESCCM" = "yes" && test "$HAVE_AESCCM_PORT" != "yes") ||
  3221. (test "$ENABLED_AESCTR" = "yes" && test "$HAVE_AESCTR_PORT" != "yes") ||
  3222. (test "$ENABLED_AESGCM" = "yes" && test "$HAVE_AESGCM_PORT" != "yes") ||
  3223. (test "$ENABLED_AESOFB" = "yes" && test "$HAVE_AESOFB_PORT" != "yes")],
  3224. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB"])
  3225. ],
  3226. [v2],[ # FIPS 140-2, Cert 3389
  3227. AM_CFLAGS="$AM_CFLAGS \
  3228. -DHAVE_FIPS \
  3229. -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION \
  3230. -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR \
  3231. -DWOLFSSL_KEY_GEN \
  3232. -DWOLFSSL_SHA224 \
  3233. -DWOLFSSL_AES_DIRECT \
  3234. -DHAVE_AES_ECB \
  3235. -DHAVE_ECC_CDH \
  3236. -DWC_RSA_NO_PADDING \
  3237. -DWOLFSSL_VALIDATE_FFC_IMPORT \
  3238. -DHAVE_FFDHE_Q \
  3239. -DHAVE_PUBLIC_FFDHE"
  3240. ENABLED_KEYGEN="yes"
  3241. ENABLED_SHA224="yes"
  3242. ENABLED_DES3="yes"
  3243. # Shake256 is a SHA-3 algorithm not in our FIPS algorithm list
  3244. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_SHAKE256"
  3245. ENABLED_SHAKE256=no
  3246. # SHA512-224 and SHA512-256 are SHA-2 algorithms not in our FIPS algorithm list
  3247. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NOSHA512_224 -DWOLFSSL_NOSHA512_256"
  3248. AS_IF([test "x$ENABLED_AESCCM" != "xyes"],
  3249. [ENABLED_AESCCM="yes"
  3250. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESCCM"])
  3251. AS_IF([test "x$ENABLED_RSAPSS" != "xyes"],
  3252. [ENABLED_RSAPSS="yes"
  3253. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS"])
  3254. AS_IF([test "x$ENABLED_ECC" != "xyes"],
  3255. [ENABLED_ECC="yes"
  3256. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256 -DWOLFSSL_VALIDATE_ECC_IMPORT"
  3257. AS_IF([test "x$ENABLED_ECC_SHAMIR" = "xyes"],
  3258. [AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"])],
  3259. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VALIDATE_ECC_IMPORT"])
  3260. AS_IF([test "x$ENABLED_AESCTR" != "xyes"],
  3261. [ENABLED_AESCTR="yes"
  3262. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER"])
  3263. AS_IF([test "x$ENABLED_CMAC" != "xyes"],
  3264. [ENABLED_CMAC="yes"
  3265. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CMAC"])
  3266. AS_IF([test "x$ENABLED_HKDF" != "xyes"],
  3267. [ENABLED_HKDF="yes"
  3268. AM_CFLAGS="$AM_CFLAGS -DHAVE_HKDF"])
  3269. AS_IF([test "x$ENABLED_INTELASM" = "xyes"],
  3270. [AM_CFLAGS="$AM_CFLAGS -DFORCE_FAILURE_RDSEED"])
  3271. AS_IF([test "x$ENABLED_SHA512" = "xno"],
  3272. [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"])
  3273. AS_IF([test "x$ENABLED_AESGCM" = "xno"],
  3274. [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"])
  3275. ],
  3276. ["rand"],[
  3277. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_FIPS_RAND -DHAVE_FIPS -DHAVE_FIPS_VERSION=$HAVE_FIPS_VERSION -DHAVE_FIPS_VERSION_MINOR=$HAVE_FIPS_VERSION_MINOR"
  3278. ],
  3279. ["v1"],[ # FIPS 140-2, Cert 2425
  3280. AM_CFLAGS="$AM_CFLAGS -DHAVE_FIPS"
  3281. AS_IF([test "x$ENABLED_SHA512" = "xno"],
  3282. [ENABLED_SHA512="yes"; AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA512 -DWOLFSSL_SHA384"])
  3283. AS_IF([test "x$ENABLED_AESGCM" = "xno"],
  3284. [ENABLED_AESGCM="yes"; AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"])
  3285. AS_IF([test "x$ENABLED_DES3" = "xno"],[ENABLED_DES3="yes"])
  3286. ])
  3287. AS_IF([test "x$ENABLED_FIPS" = "xyes" && test "x$thread_ls_on" = "xno"],
  3288. [AC_MSG_ERROR([FIPS requires Thread Local Storage])])
  3289. # SELFTEST
  3290. AC_ARG_ENABLE([selftest],
  3291. [AS_HELP_STRING([--enable-selftest],[Enable selftest, Will NOT work w/o CAVP selftest license (default: disabled)])],
  3292. [ ENABLED_SELFTEST=$enableval ],
  3293. [ ENABLED_SELFTEST="no" ]
  3294. )
  3295. AS_CASE([$ENABLED_SELFTEST],
  3296. ["v2"],[
  3297. # selftest v2 (wolfCrypt 4.1.0)
  3298. ENABLED_SELFTEST="yes"
  3299. SELFTEST_VERSION="v2"
  3300. ],
  3301. ["no"],[SELFTEST_VERSION="none"],
  3302. [
  3303. # selftest v1 (wolfCrypt 3.14.2)
  3304. ENABLED_SELFTEST="yes"
  3305. SELFTEST_VERSION="v1"
  3306. ])
  3307. AS_CASE([$SELFTEST_VERSION],
  3308. ["v2"],[
  3309. AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_SELFTEST_VERSION=2 -DHAVE_PUBLIC_FFDHE"
  3310. ],
  3311. ["v1"],[
  3312. AM_CFLAGS="$AM_CFLAGS -DHAVE_SELFTEST -DHAVE_PUBLIC_FFDHE"
  3313. ])
  3314. # Set SHA-3 and SHAKE256 flags
  3315. if test "$ENABLED_SHA3" = "yes" && test "$ENABLED_32BIT" = "no"
  3316. then
  3317. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA3"
  3318. fi
  3319. AS_IF([test "x$ENABLED_FIPS" = "xyes"],[ENABLED_SHAKE256="no"])
  3320. if test "$ENABLED_SHAKE256" = "yes" || test "$ENABLED_SHAKE256" = "small"
  3321. then
  3322. if test "$ENABLED_32BIT" = "no"
  3323. then
  3324. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHAKE256"
  3325. if test "$ENABLED_SHA3" = "no"
  3326. then
  3327. AC_MSG_ERROR([Must have SHA-3 enabled: --enable-sha3])
  3328. fi
  3329. fi
  3330. fi
  3331. # set POLY1305 default
  3332. POLY1305_DEFAULT=yes
  3333. if test "x$ENABLED_FIPS" = "xyes"
  3334. then
  3335. POLY1305_DEFAULT=no
  3336. fi
  3337. # POLY1305
  3338. AC_ARG_ENABLE([poly1305],
  3339. [AS_HELP_STRING([--enable-poly1305],[Enable wolfSSL POLY1305 support (default: enabled)])],
  3340. [ ENABLED_POLY1305=$enableval ],
  3341. [ ENABLED_POLY1305=$POLY1305_DEFAULT]
  3342. )
  3343. # leanpsk and leantls don't need poly1305
  3344. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3345. then
  3346. ENABLED_POLY1305=no
  3347. fi
  3348. if test "$ENABLED_POLY1305" = "yes"
  3349. then
  3350. AM_CFLAGS="$AM_CFLAGS -DHAVE_POLY1305"
  3351. fi
  3352. # set CHACHA default
  3353. CHACHA_DEFAULT=yes
  3354. if test "x$ENABLED_FIPS" = "xyes"
  3355. then
  3356. CHACHA_DEFAULT=no
  3357. fi
  3358. # CHACHA
  3359. AC_ARG_ENABLE([chacha],
  3360. [AS_HELP_STRING([--enable-chacha],[Enable CHACHA (default: enabled). Use `=noasm` to disable ASM AVX/AVX2 speedups])],
  3361. [ ENABLED_CHACHA=$enableval ],
  3362. [ ENABLED_CHACHA=$CHACHA_DEFAULT]
  3363. )
  3364. # leanpsk and leantls don't need chacha
  3365. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  3366. then
  3367. ENABLED_CHACHA=no
  3368. fi
  3369. if test "$ENABLED_CHACHA" = "noasm" || test "$ENABLED_ASM" = "no"
  3370. then
  3371. AM_CFLAGS="$AM_CFLAGS -DNO_CHACHA_ASM"
  3372. fi
  3373. if test "$ENABLED_CHACHA" != "no"
  3374. then
  3375. AM_CFLAGS="$AM_CFLAGS -DHAVE_CHACHA"
  3376. fi
  3377. # XCHACHA
  3378. AC_ARG_ENABLE([xchacha],
  3379. [AS_HELP_STRING([--enable-xchacha],[Enable XCHACHA (default: disabled).])],
  3380. [ ENABLED_XCHACHA=$enableval ],
  3381. [ ENABLED_XCHACHA=no]
  3382. )
  3383. if test "$ENABLED_XCHACHA" = "yes"
  3384. then
  3385. if test "$ENABLED_CHACHA" = "no"
  3386. then
  3387. AC_MSG_ERROR([XChaCha (--enable-xchacha) depends on ChaCha (--enable-chacha)])
  3388. fi
  3389. AM_CFLAGS="$AM_CFLAGS -DHAVE_XCHACHA"
  3390. fi
  3391. # Hash DRBG
  3392. AC_ARG_ENABLE([hashdrbg],
  3393. [AS_HELP_STRING([--enable-hashdrbg],[Enable Hash DRBG support (default: enabled)])],
  3394. [ ENABLED_HASHDRBG=$enableval ],
  3395. [ ENABLED_HASHDRBG=yes ]
  3396. )
  3397. if test "x$ENABLED_HASHDRBG" = "xyes"
  3398. then
  3399. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  3400. else
  3401. # turn on Hash DRBG if FIPS is on (don't force on for KCAPI)
  3402. if test "x$ENABLED_FIPS" = "xyes" && test "x$ENABLED_KCAPI" = "xno"
  3403. then
  3404. AM_CFLAGS="$AM_CFLAGS -DHAVE_HASHDRBG"
  3405. ENABLED_HASHDRBG=yes
  3406. else
  3407. AM_CFLAGS="$AM_CFLAGS -DWC_NO_HASHDRBG"
  3408. fi
  3409. fi
  3410. # Filesystem Build
  3411. if test "$ENABLED_LINUXKM" = "yes"
  3412. then
  3413. ENABLED_FILESYSTEM_DEFAULT=no
  3414. else
  3415. ENABLED_FILESYSTEM_DEFAULT=yes
  3416. fi
  3417. AC_ARG_ENABLE([filesystem],
  3418. [AS_HELP_STRING([--enable-filesystem],[Enable Filesystem support (default: enabled)])],
  3419. [ ENABLED_FILESYSTEM=$enableval ],
  3420. [ ENABLED_FILESYSTEM=$ENABLED_FILESYSTEM_DEFAULT ]
  3421. )
  3422. if test "$ENABLED_FILESYSTEM" = "no"
  3423. then
  3424. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  3425. else
  3426. # turn off filesystem if leanpsk on
  3427. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LINUXKM" = "yes"
  3428. then
  3429. AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  3430. ENABLED_FILESYSTEM=no
  3431. fi
  3432. fi
  3433. # inline Build
  3434. AC_ARG_ENABLE([inline],
  3435. [AS_HELP_STRING([--enable-inline],[Enable inline functions (default: enabled)])],
  3436. [ ENABLED_INLINE=$enableval ],
  3437. [ ENABLED_INLINE=yes ]
  3438. )
  3439. if test "$ENABLED_INLINE" = "no"
  3440. then
  3441. AM_CFLAGS="$AM_CFLAGS -DNO_INLINE"
  3442. fi
  3443. # OCSP
  3444. if test "x$ENABLED_OPENSSLALL" = "xyes" || test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  3445. then
  3446. test "$enable_ocsp" = "" && enable_ocsp=yes
  3447. fi
  3448. AC_ARG_ENABLE([ocsp],
  3449. [AS_HELP_STRING([--enable-ocsp],[Enable OCSP (default: disabled)])],
  3450. [ ENABLED_OCSP=$enableval ],
  3451. [ ENABLED_OCSP=no ]
  3452. )
  3453. if test "$ENABLED_OCSP" = "yes"
  3454. then
  3455. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  3456. fi
  3457. if test "$ENABLED_OCSP" = "yes"
  3458. then
  3459. # check openssl command tool for testing ocsp
  3460. AC_CHECK_PROG([HAVE_OPENSSL_CMD],[openssl],[yes],[no])
  3461. if test "$HAVE_OPENSSL_CMD" = "yes"
  3462. then
  3463. AM_CFLAGS="$AM_CFLAGS -DHAVE_OPENSSL_CMD"
  3464. else
  3465. AC_MSG_WARN([openssl command line tool not available for testing ocsp])
  3466. fi
  3467. fi
  3468. # Certificate Status Request : a.k.a. OCSP Stapling
  3469. AC_ARG_ENABLE([ocspstapling],
  3470. [AS_HELP_STRING([--enable-ocspstapling],[Enable OCSP Stapling (default: disabled)])],
  3471. [ ENABLED_CERTIFICATE_STATUS_REQUEST=$enableval ],
  3472. [ ENABLED_CERTIFICATE_STATUS_REQUEST=no ]
  3473. )
  3474. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_WPAS" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  3475. then
  3476. ENABLED_CERTIFICATE_STATUS_REQUEST="yes"
  3477. fi
  3478. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"
  3479. then
  3480. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST"
  3481. # Requires OCSP make sure on
  3482. if test "x$ENABLED_OCSP" = "xno"
  3483. then
  3484. ENABLED_OCSP="yes"
  3485. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  3486. fi
  3487. fi
  3488. # Certificate Status Request v2 : a.k.a. OCSP stapling v2
  3489. AC_ARG_ENABLE([ocspstapling2],
  3490. [AS_HELP_STRING([--enable-ocspstapling2],[Enable OCSP Stapling v2 (default: disabled)])],
  3491. [ ENABLED_CERTIFICATE_STATUS_REQUEST_V2=$enableval ],
  3492. [ ENABLED_CERTIFICATE_STATUS_REQUEST_V2=no ]
  3493. )
  3494. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_WPAS" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  3495. then
  3496. ENABLED_CERTIFICATE_STATUS_REQUEST_V2=yes
  3497. fi
  3498. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"
  3499. then
  3500. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST_V2"
  3501. # Requires OCSP make sure on
  3502. if test "x$ENABLED_OCSP" = "xno"
  3503. then
  3504. ENABLED_OCSP="yes"
  3505. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  3506. fi
  3507. fi
  3508. # CRL
  3509. AC_ARG_ENABLE([crl],
  3510. [AS_HELP_STRING([--enable-crl],[Enable CRL (Use =io for inline CRL HTTP GET) (default: disabled)])],
  3511. [ ENABLED_CRL=$enableval ],
  3512. [ ENABLED_CRL=no ],
  3513. )
  3514. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_OPENVPN" = "xyes" || \
  3515. test "x$ENABLED_WPAS" != "xno" || test "x$ENABLED_LIGHTY" = "xyes" || test "x$ENABLED_NETSNMP" = "xyes" || \
  3516. test "x$ENABLED_KRB" = "xyes"
  3517. then
  3518. ENABLED_CRL=yes
  3519. fi
  3520. if test "$ENABLED_CRL" != "no"
  3521. then
  3522. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  3523. fi
  3524. if test "$ENABLED_CRL" = "io"
  3525. then
  3526. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_IO"
  3527. fi
  3528. # CRL Monitor
  3529. AC_ARG_ENABLE([crl-monitor],
  3530. [AS_HELP_STRING([--enable-crl-monitor],[Enable CRL Monitor (default: disabled)])],
  3531. [ ENABLED_CRL_MONITOR=$enableval ],
  3532. [ ENABLED_CRL_MONITOR=no ],
  3533. )
  3534. if test "$ENABLED_CRL_MONITOR" = "yes"
  3535. then
  3536. case $host_os in
  3537. *linux* | *darwin* | *freebsd*)
  3538. if test "x$ENABLED_SINGLETHREADED" = "xno"; then
  3539. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
  3540. else
  3541. ENABLED_CRL_MONITOR="no"
  3542. AC_MSG_ERROR([crl monitor requires threading / pthread])
  3543. fi
  3544. ;;
  3545. *)
  3546. if test "x$ENABLED_DISTRO" = "xyes" ; then
  3547. ENABLED_CRL_MONITOR="no"
  3548. else
  3549. AC_MSG_ERROR( [crl monitor only allowed on linux, OS X, or freebsd])
  3550. fi
  3551. break;;
  3552. esac
  3553. fi
  3554. # USER CRYPTO
  3555. ENABLED_USER_CRYPTO="no"
  3556. ENABLED_USER_RSA="no"
  3557. AC_DEFINE([BUILD_USER_RSA], [], [User RSA is being defined])
  3558. trycryptodir=""
  3559. AC_ARG_WITH([user-crypto],
  3560. [AS_HELP_STRING([--with-user-crypto=PATH],[Path to USER_CRYPTO install (default /usr/local)])],
  3561. [
  3562. CPPFLAGS="$CPPFLAGS -DHAVE_USER_CRYPTO"
  3563. LIBS="$LIBS -lusercrypto"
  3564. if test "x$withval" != "xno" ; then
  3565. trycryptodir=$withval
  3566. fi
  3567. if test "x$withval" = "xyes" ; then
  3568. trycryptodir="/usr/local"
  3569. fi
  3570. LDFLAGS="$LDFLAGS -L$trycryptodir/lib"
  3571. CPPFLAGS="$CPPFLAGS -I$trycryptodir/include"
  3572. #Look for RSA Init function in usercrypto lib
  3573. AC_CHECK_LIB([usercrypto], [wc_InitRsaKey], [user_rsa_linked=yes], [user_rsa_linked=no])
  3574. if test "x$user_rsa_linked" = "xyes" ; then
  3575. AC_MSG_NOTICE([User user_rsa.h being used])
  3576. AM_CFLAGS="$AM_CFLAGS -DHAVE_USER_RSA"
  3577. ENABLED_USER_RSA=yes
  3578. ENABLED_USER_CRYPTO=yes
  3579. fi
  3580. #Display check and find result of link attempts
  3581. AC_MSG_CHECKING([for USER_CRYPTO])
  3582. if test "x$ENABLED_USER_CRYPTO" = "xno" ; then
  3583. AC_MSG_RESULT([no])
  3584. AC_MSG_ERROR([USER_CRYPTO not found. Either move to /usr/include and /usr/lib or
  3585. Specify its path using --with-user-crypto=/dir/])
  3586. else
  3587. AC_MSG_RESULT([yes])
  3588. # Check if .la is available if not then rely on exported path
  3589. if test -e $trycryptodir/lib/libusercrypto.la
  3590. then
  3591. LIB_ADD="$trycryptodir/lib/libusercrypto.la $LIB_ADD"
  3592. else
  3593. LIB_ADD="-lusercrypto $LIB_ADD"
  3594. fi
  3595. AM_LDFLAGS="$AM_LDFLAGS -L$trycryptodir/lib"
  3596. AM_CFLAGS="$AM_CFLAGS -DHAVE_USER_CRYPTO"
  3597. fi
  3598. ]
  3599. )
  3600. if test "$ENABLED_USER_CRYPTO" = "yes" && test "$ENABLED_FIPS" = "yes"
  3601. then
  3602. AC_MSG_ERROR([cannot enable user crypto and fips, user crypto posibility of using code in fips boundary.])
  3603. fi
  3604. # liboqs
  3605. ENABLED_LIBOQS="no"
  3606. tryliboqsdir=""
  3607. AC_ARG_WITH([liboqs],
  3608. [AS_HELP_STRING([--with-liboqs=PATH],[Path to liboqs install (default /usr/local) EXPERIMENTAL!])],
  3609. [
  3610. AC_MSG_CHECKING([for liboqs])
  3611. CPPFLAGS="$CPPFLAGS -DHAVE_LIBOQS -DHAVE_TLS_EXTENSIONS"
  3612. LIBS="$LIBS -loqs"
  3613. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <oqs/common.h>]], [[ OQS_init(); ]])], [ liboqs_linked=yes ],[ liboqs_linked=no ])
  3614. if test "x$liboqs_linked" = "xno" ; then
  3615. if test "x$withval" != "xno" ; then
  3616. tryliboqsdir=$withval
  3617. fi
  3618. if test "x$withval" = "xyes" ; then
  3619. tryliboqsdir="/usr/local"
  3620. fi
  3621. LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$tryliboqsdir/lib"
  3622. CPPFLAGS="$CPPFLAGS -I$tryliboqsdir/include"
  3623. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <oqs/common.h>]], [[ OQS_init(); ]])], [ liboqs_linked=yes ],[ liboqs_linked=no ])
  3624. if test "x$liboqs_linked" = "xno" ; then
  3625. AC_MSG_ERROR([liboqs isn't found.
  3626. If it's already installed, specify its path using --with-liboqs=/dir/])
  3627. fi
  3628. AC_MSG_RESULT([yes])
  3629. AM_LDFLAGS="$AM_LDFLAGS -L$tryliboqsdir/lib"
  3630. else
  3631. AC_MSG_RESULT([yes])
  3632. fi
  3633. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  3634. then
  3635. ENABLED_OPENSSLEXTRA="yes"
  3636. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  3637. fi
  3638. AM_CFLAGS="$AM_CFLAGS -DHAVE_LIBOQS -DHAVE_TLS_EXTENSIONS"
  3639. ENABLED_LIBOQS="yes"
  3640. ]
  3641. )
  3642. # Whitewood netRandom client library
  3643. ENABLED_WNR="no"
  3644. trywnrdir=""
  3645. AC_ARG_WITH([wnr],
  3646. [AS_HELP_STRING([--with-wnr=PATH],[Path to Whitewood netRandom install (default /usr/local)])],
  3647. [
  3648. AC_MSG_CHECKING([for Whitewood netRandom])
  3649. CPPFLAGS="$CPPFLAGS -DHAVE_WNR"
  3650. LIBS="$LIBS -lwnr"
  3651. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <wnr.h>]], [[ wnr_setup(0, 0); ]])], [ wnr_linked=yes ],[ wnr_linked=no ])
  3652. if test "x$wnr_linked" = "xno" ; then
  3653. if test "x$withval" != "xno" ; then
  3654. trywnrdir=$withval
  3655. fi
  3656. if test "x$withval" = "xyes" ; then
  3657. trywnrdir="/usr/local"
  3658. fi
  3659. LDFLAGS="$AM_LDFLAGS $LDFLAGS -L$trywnrdir/lib"
  3660. CPPFLAGS="$CPPFLAGS -I$trywnrdir/include"
  3661. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <wnr.h>]], [[ wnr_setup(0, 0); ]])], [ wnr_linked=yes ],[ wnr_linked=no ])
  3662. if test "x$wnr_linked" = "xno" ; then
  3663. AC_MSG_ERROR([Whitewood netRandom isn't found.
  3664. If it's already installed, specify its path using --with-wnr=/dir/])
  3665. fi
  3666. AC_MSG_RESULT([yes])
  3667. AM_LDFLAGS="$AM_LDFLAGS -L$trywnrdir/lib"
  3668. else
  3669. AC_MSG_RESULT([yes])
  3670. fi
  3671. AM_CFLAGS="$AM_CFLAGS -DHAVE_WNR"
  3672. ENABLED_WNR="yes"
  3673. ]
  3674. )
  3675. # SNI
  3676. AC_ARG_ENABLE([sni],
  3677. [AS_HELP_STRING([--enable-sni],[Enable SNI (default: disabled)])],
  3678. [ ENABLED_SNI=$enableval ],
  3679. [ ENABLED_SNI=no ]
  3680. )
  3681. if test "x$ENABLED_QT" = "xyes"
  3682. then
  3683. ENABLED_SNI="yes"
  3684. fi
  3685. if test "x$ENABLED_SNI" = "xyes"
  3686. then
  3687. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  3688. fi
  3689. # Maximum Fragment Length
  3690. AC_ARG_ENABLE([maxfragment],
  3691. [AS_HELP_STRING([--enable-maxfragment],[Enable Maximum Fragment Length (default: disabled)])],
  3692. [ ENABLED_MAX_FRAGMENT=$enableval ],
  3693. [ ENABLED_MAX_FRAGMENT=no ]
  3694. )
  3695. # ALPN
  3696. AC_ARG_ENABLE([alpn],
  3697. [AS_HELP_STRING([--enable-alpn],[Enable ALPN (default: disabled)])],
  3698. [ ENABLED_ALPN=$enableval ],
  3699. [ ENABLED_ALPN=no ]
  3700. )
  3701. if test "$ENABLED_BIND" = "yes"
  3702. then
  3703. ENABLED_ALPN=yes
  3704. fi
  3705. if test "x$ENABLED_ALPN" = "xyes"
  3706. then
  3707. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_ALPN"
  3708. fi
  3709. # Maximum Fragment Length
  3710. if test "x$ENABLED_MAX_FRAGMENT" = "xyes"
  3711. then
  3712. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_MAX_FRAGMENT"
  3713. fi
  3714. # Trusted CA Indication Extension
  3715. AC_ARG_ENABLE([trustedca],
  3716. [AS_HELP_STRING([--enable-trustedca],[Enable Trusted CA Indication (default: disabled)])],
  3717. [ ENABLED_TRUSTED_CA=$enableval ],[ ENABLED_TRUSTED_CA=no ])
  3718. AS_IF([test "x$ENABLED_TRUSTED_CA" = "xyes"],
  3719. [AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_TRUSTED_CA"])
  3720. # Truncated HMAC
  3721. AC_ARG_ENABLE([truncatedhmac],
  3722. [AS_HELP_STRING([--enable-truncatedhmac],[Enable Truncated HMAC (default: disabled)])],
  3723. [ ENABLED_TRUNCATED_HMAC=$enableval ],
  3724. [ ENABLED_TRUNCATED_HMAC=no ]
  3725. )
  3726. if test "x$ENABLED_TRUNCATED_HMAC" = "xyes"
  3727. then
  3728. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_TRUNCATED_HMAC"
  3729. fi
  3730. # Renegotiation Indication - (FAKE Secure Renegotiation)
  3731. # Client will send TLS_EMPTY_RENEGOTIATION_INFO_SCSV, not supported
  3732. # with enabling secure renegotiation
  3733. AC_ARG_ENABLE([renegotiation-indication],
  3734. [AS_HELP_STRING([--enable-renegotiation-indication],[Enable Renegotiation Indication for client via empty cipher (default: disabled)])],
  3735. [ ENABLED_RENEGOTIATION_INDICATION=$enableval ],
  3736. [ ENABLED_RENEGOTIATION_INDICATION=no ]
  3737. )
  3738. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  3739. then
  3740. AM_CFLAGS="$AM_CFLAGS -DHAVE_RENEGOTIATION_INDICATION"
  3741. fi
  3742. # Secure Renegotiation
  3743. AC_ARG_ENABLE([secure-renegotiation],
  3744. [AS_HELP_STRING([--enable-secure-renegotiation],[Enable Secure Renegotiation (default: disabled)])],
  3745. [ ENABLED_SECURE_RENEGOTIATION=$enableval ],
  3746. [ ENABLED_SECURE_RENEGOTIATION=no ]
  3747. )
  3748. if test "x$ENABLED_HAPROXY" = "xyes"
  3749. then
  3750. ENABLED_SECURE_RENEGOTIATION=yes
  3751. fi
  3752. if test "x$ENABLED_SECURE_RENEGOTIATION" = "xyes"
  3753. then
  3754. if test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"
  3755. then
  3756. AC_MSG_ERROR([cannot enable renegotiation-indication and secure-renegotiation.])
  3757. fi
  3758. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SECURE_RENEGOTIATION -DHAVE_SERVER_RENEGOTIATION_INFO"
  3759. fi
  3760. # Secure Renegotiation Info
  3761. AC_ARG_ENABLE([secure-renegotiation-info],
  3762. [AS_HELP_STRING([--enable-secure-renegotiation-info],[Enable Secure Renegotiation info extension (default: enabled)])],
  3763. [ ENABLED_SECURE_RENEGOTIATION_INFO=$enableval ],
  3764. [ ENABLED_SECURE_RENEGOTIATION_INFO=yes ]
  3765. )
  3766. # Fallback SCSV
  3767. AC_ARG_ENABLE([fallback-scsv],
  3768. [AS_HELP_STRING([--enable-fallback-scsv],[Enable Fallback SCSV (default: disabled)])],
  3769. [ ENABLED_FALLBACK_SCSV=$enableval ],
  3770. [ ENABLED_FALLBACK_SCSV=no ]
  3771. )
  3772. if test "x$ENABLED_FALLBACK_SCSV" = "xyes"
  3773. then
  3774. AM_CFLAGS="$AM_CFLAGS -DHAVE_FALLBACK_SCSV"
  3775. fi
  3776. # Exporting Keying Material
  3777. AC_ARG_ENABLE([keying-material],
  3778. [AS_HELP_STRING([--enable-keying-material],[Enable Keying Material Exporters (default: disabled)])],
  3779. [ ENABLED_KEYING_MATERIAL=$enableval ],
  3780. [ ENABLED_KEYING_MATERIAL=no ]
  3781. )
  3782. if test "$ENABLED_CHRONY" = "yes"
  3783. then
  3784. ENABLED_KEYING_MATERIAL=yes
  3785. fi
  3786. if test "x$ENABLED_KEYING_MATERIAL" = "xyes"
  3787. then
  3788. AM_CFLAGS="$AM_CFLAGS -DHAVE_KEYING_MATERIAL"
  3789. fi
  3790. # Supported Elliptic Curves Extensions
  3791. AC_ARG_ENABLE([supportedcurves],
  3792. [AS_HELP_STRING([--enable-supportedcurves],[Enable Supported Elliptic Curves (default: enabled)])],
  3793. [ENABLED_SUPPORTED_CURVES=$enableval],
  3794. [ENABLED_SUPPORTED_CURVES=yes])
  3795. if test "x$ENABLED_SUPPORTED_CURVES" = "xyes"
  3796. then
  3797. AS_IF([test "x$ENABLED_ECC" = "xno" && test "x$ENABLED_CURVE25519" = "xno" && test "x$ENABLED_CURVE448" = "xno"],
  3798. [ENABLED_SUPPORTED_CURVES=no],
  3799. [AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SUPPORTED_CURVES"])
  3800. fi
  3801. # Diffie-Hellman
  3802. if test "$ENABLED_DH" = "yes"
  3803. then
  3804. if test "$ENABLED_TLS13" = "yes" || test "$ENABLED_SUPPORTED_CURVES" = "yes"
  3805. then
  3806. AM_CFLAGS="$AM_CFLAGS -DHAVE_FFDHE_2048"
  3807. fi
  3808. fi
  3809. # FFDHE parameters only
  3810. AC_ARG_ENABLE([ffdhe-only],
  3811. [AS_HELP_STRING([--enable-ffdhe-only],[Enable using only FFDHE in client (default: disabled)])],
  3812. [ ENABLED_FFDHE_ONLY=$enableval ],
  3813. [ ENABLED_FFDHE_ONLY=no ]
  3814. )
  3815. if test "x$ENABLED_FFDHE_ONLY" = "xyes"
  3816. then
  3817. if test "$ENABLED_DH" = "no"
  3818. then
  3819. AC_MSG_ERROR([FFDHE only support requires DH support])
  3820. fi
  3821. if test "$ENABLED_SUPPORTED_CURVES" = "no"
  3822. then
  3823. AC_MSG_ERROR([FFDHE only support requires Supported Curves extension])
  3824. fi
  3825. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_REQUIRE_FFDHE"
  3826. fi
  3827. # TLS 1.3 Requires either ECC or (RSA/DH), or CURVE25519/ED25519 or CURVE448/ED448 or libOQS
  3828. if test "x$ENABLED_PSK" = "xno" && test "x$ENABLED_ECC" = "xno" && \
  3829. (test "x$ENABLED_RSA" = "xno" || test "x$ENABLED_DH" = "xno") && \
  3830. (test "x$ENABLED_CURVE25519" = "xno" || test "x$ENABLED_ED25519" = "xno") && \
  3831. (test "x$ENABLED_CURVE448" = "xno" || test "x$ENABLED_ED448" = "xno") && \
  3832. test "x$ENABLED_LIBOQS" = "xno"
  3833. then
  3834. # disable TLS 1.3
  3835. ENABLED_TLS13=no
  3836. fi
  3837. if test "$ENABLED_TLS13" = "yes" && (test "x$ENABLED_ECC" = "xyes" || \
  3838. test "x$ENABLED_DH" = "xyes")
  3839. then
  3840. AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"
  3841. fi
  3842. if test "$ENABLED_TLS13" = "yes"
  3843. then
  3844. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TLS13 -DHAVE_TLS_EXTENSIONS"
  3845. fi
  3846. # Session Ticket Extension
  3847. AC_ARG_ENABLE([session-ticket],
  3848. [AS_HELP_STRING([--enable-session-ticket],[Enable Session Ticket (default: disabled)])],
  3849. [ ENABLED_SESSION_TICKET=$enableval ],
  3850. [ ENABLED_SESSION_TICKET=no ]
  3851. )
  3852. if test "x$ENABLED_NGINX" = "xyes" || test "$ENABLED_WPAS" = "yes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  3853. then
  3854. ENABLED_SESSION_TICKET=yes
  3855. fi
  3856. if test "x$ENABLED_SESSION_TICKET" = "xyes"
  3857. then
  3858. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SESSION_TICKET"
  3859. fi
  3860. # Extended Master Secret Extension
  3861. AC_ARG_ENABLE([extended-master],
  3862. [AS_HELP_STRING([--enable-extended-master],[Enable Extended Master Secret (default: enabled)])],
  3863. [ ENABLED_EXTENDED_MASTER=$enableval ],
  3864. [ ENABLED_EXTENDED_MASTER=yes ]
  3865. )
  3866. if test "x$ENABLED_EXTENDED_MASTER" = "xyes"
  3867. then
  3868. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXTENDED_MASTER"
  3869. fi
  3870. # TLS Extensions
  3871. AC_ARG_ENABLE([tlsx],
  3872. [AS_HELP_STRING([--enable-tlsx],[Enable all TLS Extensions (default: disabled)])],
  3873. [ ENABLED_TLSX=$enableval ],
  3874. [ ENABLED_TLSX=no ]
  3875. )
  3876. if test "x$ENABLED_NGINX" = "xyes" || test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_SIGNAL" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes" || test "$ENABLED_CHRONY" = "yes"
  3877. then
  3878. ENABLED_TLSX=yes
  3879. fi
  3880. if test "x$ENABLED_TLSX" = "xyes"
  3881. then
  3882. ENABLED_SNI=yes
  3883. ENABLED_MAX_FRAGMENT=yes
  3884. ENABLED_TRUNCATED_HMAC=yes
  3885. ENABLED_ALPN=yes
  3886. ENABLED_TRUSTED_CA=yes
  3887. ENABLED_ENCRYPT_THEN_MAC=yes
  3888. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC -DHAVE_ALPN -DHAVE_TRUSTED_CA"
  3889. # Check the ECC supported curves prereq
  3890. AS_IF([test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_CURVE25519" = "xyes" || test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_TLS13" = "xyes"],
  3891. [ENABLED_SUPPORTED_CURVES=yes
  3892. AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"])
  3893. fi
  3894. # Early Data handshake in TLS v1.3 and above
  3895. AC_ARG_ENABLE([earlydata],
  3896. [AS_HELP_STRING([--enable-earlydata],[Enable Early Data handshake with wolfSSL TLS v1.3 (default: disabled)])],
  3897. [ ENABLED_TLS13_EARLY_DATA=$enableval ],
  3898. [ ENABLED_TLS13_EARLY_DATA=no ]
  3899. )
  3900. if test "$ENABLED_TLS13_EARLY_DATA" = "group"
  3901. then
  3902. ENABLED_TLS13_EARLY_DATA="yes"
  3903. # Group EarlyData with ClientHello
  3904. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EARLY_DATA_GROUP"
  3905. fi
  3906. if test "$ENABLED_TLS13_EARLY_DATA" = "yes"
  3907. then
  3908. if test "x$ENABLED_TLS13" = "xno" && test "X$ENABLED_ALL" = "xno"
  3909. then
  3910. AC_MSG_ERROR([cannot enable earlydata without enabling tls13.])
  3911. fi
  3912. if test "x$ENABLED_SESSION_TICKET" = "xno" && test "x$ENABLED_PSK" = "xno"
  3913. then
  3914. AC_MSG_ERROR([cannot enable earlydata without enabling session tickets and/or PSK.])
  3915. fi
  3916. if test "x$ENABLED_TLS13" = "xyes"
  3917. then
  3918. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EARLY_DATA"
  3919. fi
  3920. fi
  3921. if test "$ENABLED_TLSV12" = "no" && test "$ENABLED_TLS13" = "yes" && test "x$ENABLED_SESSION_TICKET" = "xno"
  3922. then
  3923. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE"
  3924. fi
  3925. # PKCS7
  3926. AC_ARG_ENABLE([pkcs7],
  3927. [AS_HELP_STRING([--enable-pkcs7],[Enable PKCS7 (default: disabled)])],
  3928. [ ENABLED_PKCS7=$enableval ],
  3929. [ ENABLED_PKCS7=no ]
  3930. )
  3931. # wolfSSH Options
  3932. AC_ARG_ENABLE([wolfssh],
  3933. [AS_HELP_STRING([--enable-wolfssh],[Enable wolfSSH options (default: disabled)])],
  3934. [ ENABLED_WOLFSSH=$enableval ],
  3935. [ ENABLED_WOLFSSH=no ]
  3936. )
  3937. AC_ARG_ENABLE([ssh],
  3938. [AS_HELP_STRING([--enable-ssh],[Enable wolfSSH options (default: disabled)])],
  3939. [ ENABLED_SSH=$enableval ],
  3940. [ ENABLED_SSH=no ]
  3941. )
  3942. if test "x$ENABLED_SSH" = "xyes"
  3943. then
  3944. ENABLED_WOLFSSH="yes"
  3945. fi
  3946. # wolfTPM Options
  3947. AC_ARG_ENABLE([wolftpm],
  3948. [AS_HELP_STRING([--enable-wolftpm],[Enable wolfTPM options (default: disabled)])],
  3949. [ ENABLED_WOLFTPM=$enableval ],
  3950. [ ENABLED_WOLFTPM=no ]
  3951. )
  3952. # wolfCLU Options
  3953. AC_ARG_ENABLE([wolfclu],
  3954. [AS_HELP_STRING([--enable-wolfclu],[Enable wolfCLU options (default: disabled)])],
  3955. [ ENABLED_WOLFCLU=$enableval ],
  3956. [ ENABLED_WOLFCLU=no ]
  3957. )
  3958. if test "x$ENABLED_WOLFTPM" = "xyes"
  3959. then
  3960. # Requires cryptocb (set in its enable section)
  3961. # Requires certgen, certreq, certext
  3962. if test "x$ENABLED_CERTGEN" = "xno"
  3963. then
  3964. ENABLED_CERTGEN="yes"
  3965. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  3966. fi
  3967. if test "x$ENABLED_CERTREQ" = "xno"
  3968. then
  3969. ENABLED_CERTREQ="yes"
  3970. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  3971. fi
  3972. if test "x$ENABLED_CERTEXT" = "xno"
  3973. then
  3974. ENABLED_CERTEXT="yes"
  3975. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  3976. fi
  3977. # Requires PKCS7
  3978. if test "x$ENABLED_PKCS7" = "xno"
  3979. then
  3980. ENABLED_PKCS7="yes"
  3981. fi
  3982. # Requires aescfb
  3983. if test "x$ENABLED_AESCFB" = "xno"
  3984. then
  3985. ENABLED_AESCFB="yes"
  3986. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"
  3987. fi
  3988. fi
  3989. if test "x$ENABLED_SMIME" = "xyes"
  3990. then
  3991. AM_CFLAGS="$AM_CFLAGS -DHAVE_SMIME"
  3992. # Requires PKCS7
  3993. if test "x$ENABLED_PKCS7" = "xno"
  3994. then
  3995. ENABLED_PKCS7="yes"
  3996. fi
  3997. fi
  3998. # Simple Certificate Enrollment Protocol (SCEP)
  3999. AC_ARG_ENABLE([scep],
  4000. [AS_HELP_STRING([--enable-scep],[Enable wolfSCEP (default: disabled)])],
  4001. [ ENABLED_WOLFSCEP=$enableval ],
  4002. [ ENABLED_WOLFSCEP=no ]
  4003. )
  4004. # Secure Remote Password
  4005. AC_ARG_ENABLE([srp],
  4006. [AS_HELP_STRING([--enable-srp],[Enable Secure Remote Password (default: disabled)])],
  4007. [ ENABLED_SRP=$enableval ],
  4008. [ ENABLED_SRP=no ]
  4009. )
  4010. if test "x$ENABLED_SRP" = "xyes"
  4011. then
  4012. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SRP"
  4013. fi
  4014. # Indefinite length encoded BER message support
  4015. AC_ARG_ENABLE([indef],
  4016. [AS_HELP_STRING([--enable-indef],[Enable parsing of indefinite length encoded msgs (default: disabled)])],
  4017. [ ENABLED_BER_INDEF=$enableval ],
  4018. [ ENABLED_BER_INDEF=no ]
  4019. )
  4020. if test "x$ENABLED_BER_INDEF" = "xyes"
  4021. then
  4022. AM_CFLAGS="$AM_CFLAGS -DASN_BER_TO_DER"
  4023. fi
  4024. # Alternate certification chains, as oppossed to requiring full chain validataion.
  4025. # Certificate validation behavior is relaxed, similar to openssl and
  4026. # browsers. Only the peer certificate must validate to a trusted
  4027. # certificate. Without this, all certificates sent by a peer must be
  4028. # used in the trust chain or the connection will be rejected.
  4029. AC_ARG_ENABLE([altcertchains],
  4030. [AS_HELP_STRING([--enable-altcertchains],[Enable using alternative certificate chains, only require leaf certificate to validate to trust root (default: disabled)])],
  4031. [ ENABLED_ALT_CERT_CHAINS=$enableval ],
  4032. [ ENABLED_ALT_CERT_CHAINS=no ]
  4033. )
  4034. if test "x$ENABLED_ALT_CERT_CHAINS" = "xyes"
  4035. then
  4036. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_CERT_CHAINS"
  4037. fi
  4038. # Small Stack - Cache on object
  4039. AC_ARG_ENABLE([smallstackcache],
  4040. [AS_HELP_STRING([--enable-smallstackcache],[Enable Small Stack Usage Caching (default: disabled)])],
  4041. [ ENABLED_SMALL_STACK_CACHE=$enableval ],
  4042. [ ENABLED_SMALL_STACK_CACHE=no ]
  4043. )
  4044. if test "x$ENABLED_SMALL_STACK_CACHE" = "xyes"
  4045. then
  4046. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SMALL_STACK_CACHE"
  4047. fi
  4048. # Small Stack
  4049. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
  4050. then
  4051. ENABLED_SMALL_STACK_DEFAULT=yes
  4052. else
  4053. ENABLED_SMALL_STACK_DEFAULT=no
  4054. fi
  4055. AC_ARG_ENABLE([smallstack],
  4056. [AS_HELP_STRING([--enable-smallstack],[Enable Small Stack Usage (default: disabled)])],
  4057. [ ENABLED_SMALL_STACK=$enableval ],
  4058. [ ENABLED_SMALL_STACK=$ENABLED_SMALL_STACK_DEFAULT ]
  4059. )
  4060. if test "x$ENABLED_SMALL_STACK_CACHE" = "xyes"
  4061. then
  4062. ENABLED_SMALL_STACK=yes
  4063. fi
  4064. if test "x$ENABLED_SMALL_STACK" = "xyes"
  4065. then
  4066. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SMALL_STACK"
  4067. fi
  4068. #valgrind
  4069. AC_ARG_ENABLE([valgrind],
  4070. [AS_HELP_STRING([--enable-valgrind],[Enable valgrind for unit tests (default: disabled)])],
  4071. [ ENABLED_VALGRIND=$enableval ],
  4072. [ ENABLED_VALGRIND=no ]
  4073. )
  4074. if test "$ENABLED_VALGRIND" = "yes"
  4075. then
  4076. AC_CHECK_PROG([HAVE_VALGRIND],[valgrind],[yes],[no])
  4077. if test "$HAVE_VALGRIND" = "no"
  4078. then
  4079. AC_MSG_ERROR([Valgrind not found.])
  4080. fi
  4081. enable_shared=no
  4082. enable_static=yes
  4083. AM_CFLAGS="$AM_CFLAGS -DHAVE_VALGRIND"
  4084. fi
  4085. # Test certs, use internal cert functions for extra testing
  4086. AC_ARG_ENABLE([testcert],
  4087. [AS_HELP_STRING([--enable-testcert],[Enable Test Cert (default: disabled)])],
  4088. [ ENABLED_TESTCERT=$enableval ],
  4089. [ ENABLED_TESTCERT=no ]
  4090. )
  4091. if test "$ENABLED_TESTCERT" = "yes"
  4092. then
  4093. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TEST_CERT"
  4094. fi
  4095. # I/O Pool, an example to show user how to override memory handler and use
  4096. # a pool for the input/output buffer requests
  4097. AC_ARG_ENABLE([iopool],
  4098. [AS_HELP_STRING([--enable-iopool],[Enable I/O Pool example (default: disabled)])],
  4099. [ ENABLED_IOPOOL=$enableval ],
  4100. [ ENABLED_IOPOOL=no ]
  4101. )
  4102. if test "$ENABLED_IOPOOL" = "yes"
  4103. then
  4104. if test "$thread_ls_on" = "no"
  4105. then
  4106. AC_MSG_ERROR([I/O Pool example requires Thread Local Storage])
  4107. fi
  4108. AM_CFLAGS="$AM_CFLAGS -DHAVE_IO_POOL -DXMALLOC_USER"
  4109. fi
  4110. # Certificate Service Support
  4111. AC_ARG_ENABLE([certservice],
  4112. [AS_HELP_STRING([--enable-certservice],[Enable cert service (default: disabled)])],
  4113. [ ENABLED_CERT_SERVICE=$enableval ],
  4114. [ ENABLED_CERT_SERVICE=no ]
  4115. )
  4116. if test "$ENABLED_CERT_SERVICE" = "yes"
  4117. then
  4118. # Requires ecc,certgen, and opensslextra make sure on
  4119. if test "x$ENABLED_CERTGEN" = "xno"
  4120. then
  4121. ENABLED_CERTGEN="yes"
  4122. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4123. fi
  4124. if test "x$ENABLED_ECC" = "xno"
  4125. then
  4126. ENABLED_ECC="yes"
  4127. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  4128. if test "$ENABLED_ECC_SHAMIR" = "yes"
  4129. then
  4130. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  4131. fi
  4132. fi
  4133. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4134. then
  4135. ENABLED_OPENSSLEXTRA="yes"
  4136. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4137. fi
  4138. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_CERT_SERVICE"
  4139. fi
  4140. # wolfSSL JNI
  4141. AC_ARG_ENABLE([jni],
  4142. [AS_HELP_STRING([--enable-jni],[Enable wolfSSL JNI (default: disabled)])],
  4143. [ ENABLED_JNI=$enableval ],
  4144. [ ENABLED_JNI=no ]
  4145. )
  4146. if test "$ENABLED_JNI" = "yes"
  4147. then
  4148. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_JNI -DHAVE_EX_DATA"
  4149. # Enable prereqs if not already enabled
  4150. if test "x$ENABLED_DTLS" = "xno"
  4151. then
  4152. ENABLED_DTLS="yes"
  4153. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  4154. fi
  4155. if test "x$ENABLED_OPENSSLEXTRA" = "xno"
  4156. then
  4157. ENABLED_OPENSSLEXTRA="yes"
  4158. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4159. fi
  4160. if test "x$ENABLED_OPENSSLALL" = "xno"
  4161. then
  4162. ENABLED_OPENSSLALL="yes"
  4163. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_ALL"
  4164. fi
  4165. if test "x$ENABLED_CRL" = "xno"
  4166. then
  4167. ENABLED_CRL="yes"
  4168. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  4169. fi
  4170. if test "x$ENABLED_OCSP" = "xno"
  4171. then
  4172. ENABLED_OCSP="yes"
  4173. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  4174. fi
  4175. if test "x$ENABLED_CRL_MONITOR" = "xno" && test "x$ENABLED_DISTRO" = "xno"
  4176. then
  4177. ENABLED_CRL_MONITOR="yes"
  4178. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL_MONITOR"
  4179. fi
  4180. if test "x$ENABLED_SAVESESSION" = "xno"
  4181. then
  4182. ENABLED_SAVESESSION="yes"
  4183. AM_CFLAGS="$AM_CFLAGS -DPERSIST_SESSION_CACHE"
  4184. fi
  4185. if test "x$ENABLED_SAVECERT" = "xno"
  4186. then
  4187. ENABLED_SAVECERT="yes"
  4188. AM_CFLAGS="$AM_CFLAGS -DPERSIST_CERT_CACHE"
  4189. fi
  4190. if test "x$ENABLED_ATOMICUSER" = "xno"
  4191. then
  4192. ENABLED_ATOMICUSER="yes"
  4193. AM_CFLAGS="$AM_CFLAGS -DATOMIC_USER"
  4194. fi
  4195. if test "x$ENABLED_ECC" = "xno"
  4196. then
  4197. ENABLED_ECC="yes"
  4198. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  4199. if test "$ENABLED_ECC_SHAMIR" = "yes"
  4200. then
  4201. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  4202. fi
  4203. fi
  4204. # Do not enable PK Callbacks in FIPS mode with JNI
  4205. if test "x$ENABLED_PKCALLBACKS" = "xno" && test "$ENABLED_FIPS" = "no"
  4206. then
  4207. ENABLED_PKCALLBACKS="yes"
  4208. AM_CFLAGS="$AM_CFLAGS -DHAVE_PK_CALLBACKS"
  4209. fi
  4210. if test "x$ENABLED_DH" = "xno"
  4211. then
  4212. ENABLED_DH="yes"
  4213. AM_CFLAGS="$AM_CFLAGS -DHAVE_DH"
  4214. fi
  4215. if test "x$ENABLED_PSK" = "xno"
  4216. then
  4217. ENABLED_PSK="yes"
  4218. fi
  4219. if test "x$ENABLED_CERTEXT" = "xno"
  4220. then
  4221. ENABLED_CERTEXT="yes"
  4222. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  4223. fi
  4224. if test "x$ENABLED_CERTGEN" = "xno"
  4225. then
  4226. ENABLED_CERTGEN="yes"
  4227. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4228. fi
  4229. if test "x$ENABLED_SNI" = "xno"
  4230. then
  4231. ENABLED_SNI="yes"
  4232. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  4233. fi
  4234. if test "x$ENABLED_ALPN" = "xno"
  4235. then
  4236. ENABLED_ALPN="yes"
  4237. AM_CFLAGS="$AM_CFLAGS -DHAVE_ALPN"
  4238. fi
  4239. fi
  4240. if test "$ENABLED_LIGHTY" = "yes"
  4241. then
  4242. # Requires opensslextra make sure on
  4243. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4244. then
  4245. ENABLED_OPENSSLEXTRA="yes"
  4246. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4247. fi
  4248. AM_CFLAGS="$AM_CFLAGS -DHAVE_LIGHTY -DHAVE_WOLFSSL_SSL_H=1"
  4249. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  4250. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_ALL"
  4251. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  4252. # recommended if building wolfSSL specifically for use by lighttpd
  4253. if test "x$ENABLED_ALL" = "xno"; then
  4254. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_COMP"
  4255. if test "x$ENABLED_SSLV3" = "xno"; then
  4256. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL3"
  4257. if test "x$ENABLED_TLSV10" = "xno"; then
  4258. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  4259. ENABLED_OLD_TLS=no
  4260. fi
  4261. fi
  4262. if test "x$ENABLED_CRL_MONITOR" = "xno"; then
  4263. AM_CFLAGS="$AM_CFLAGS -DSINGLE_THREADED"
  4264. ENABLED_SINGLETHREADED="yes"
  4265. fi
  4266. # w/ lighttpd 1.4.56 once wolfSSL updated to expose non-filesystem funcs
  4267. #AM_CFLAGS="$AM_CFLAGS -DNO_BIO"
  4268. #AM_CFLAGS="$AM_CFLAGS -DNO_FILESYSTEM"
  4269. #ENABLED_FILESYSTEM=no
  4270. fi
  4271. fi
  4272. if test "$ENABLED_NGINX" = "yes"
  4273. then
  4274. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NGINX -DWOLFSSL_SIGNER_DER_CERT"
  4275. fi
  4276. if test "$ENABLED_HAPROXY" = "yes"
  4277. then
  4278. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAPROXY -DOPENSSL_COMPATIBLE_DEFAULTS"
  4279. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIGNER_DER_CERT"
  4280. # --enable-all defines its own DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS
  4281. if test -z "$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS"
  4282. then
  4283. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS=8192
  4284. fi
  4285. # Requires opensslextra and opensslall
  4286. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4287. then
  4288. ENABLED_OPENSSLALL="yes"
  4289. ENABLED_OPENSSLEXTRA="yes"
  4290. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  4291. fi
  4292. if test "x$ENABLED_CERTGEN" = "xno"
  4293. then
  4294. ENABLED_CERTGEN="yes"
  4295. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4296. fi
  4297. if test "x$ENABLED_CERTREQ" = "xno"
  4298. then
  4299. ENABLED_CERTREQ="yes"
  4300. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  4301. fi
  4302. # Requires sessioncerts make sure on
  4303. if test "x$ENABLED_SESSIONCERTS" = "xno"
  4304. then
  4305. ENABLED_SESSIONCERTS="yes"
  4306. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  4307. fi
  4308. fi
  4309. if test "$ENABLED_NETSNMP" = "yes"
  4310. then
  4311. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  4312. if test "x$ENABLED_AESCFB" = "xno"
  4313. then
  4314. ENABLED_AESCFB="yes"
  4315. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB"
  4316. fi
  4317. if test "x$ENABLED_DTLS" = "xno"
  4318. then
  4319. ENABLED_DTLS="yes"
  4320. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  4321. fi
  4322. fi
  4323. if test "$ENABLED_KRB" = "yes"
  4324. then
  4325. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KRB -DWOLFSSL_AES_DIRECT -DWOLFSSL_DES_ECB"
  4326. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  4327. # Requires PKCS7
  4328. if test "x$ENABLED_PKCS7" = "xno"
  4329. then
  4330. ENABLED_PKCS7="yes"
  4331. fi
  4332. fi
  4333. if test "$ENABLED_FFMPEG" = "yes"
  4334. then
  4335. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FFMPEG -DOPENSSL_COMPATIBLE_DEFAULTS"
  4336. fi
  4337. if test "$ENABLED_SIGNAL" = "yes"
  4338. then
  4339. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIGNAL -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"
  4340. # Requires opensslextra make sure on
  4341. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4342. then
  4343. ENABLED_OPENSSLEXTRA="yes"
  4344. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4345. fi
  4346. fi
  4347. if test "$ENABLED_BIND" = "yes"
  4348. then
  4349. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_BIND -DWOLFSSL_DSA_768_MODULUS"
  4350. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT -DHAVE_AES_ECB -DWOLFSSL_DES_ECB"
  4351. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SHA224 -DWOLFSSL_SHA384 -DWOLFSSL_SHA512"
  4352. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS"
  4353. ENABLED_SHA224="yes"
  4354. ENABLED_SHA384="yes"
  4355. ENABLED_SHA512="yes"
  4356. fi
  4357. if test "$ENABLED_RSYSLOG" = "yes"
  4358. then
  4359. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_RSYSLOG -DWOLFSSL_ERROR_CODE_OPENSSL"
  4360. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DOPENSSL_COMPATIBLE_DEFAULTS"
  4361. fi
  4362. if test "$ENABLED_OPENVPN" = "yes"
  4363. then
  4364. ENABLED_SUPPORTED_CURVES="yes"
  4365. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_OPENVPN -DHAVE_KEYING_MATERIAL"
  4366. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB -DHAVE_EX_DATA -DWOLFSSL_KEY_GEN"
  4367. fi
  4368. if test "$ENABLED_NGINX" = "yes"|| test "x$ENABLED_HAPROXY" = "xyes" || test "x$ENABLED_LIGHTY" = "xyes"
  4369. then
  4370. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_VERIFY_CB"
  4371. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  4372. AM_CFLAGS="$AM_CFLAGS -DKEEP_OUR_CERT -DKEEP_PEER_CERT"
  4373. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE -DHAVE_EX_DATA"
  4374. ENABLED_CERTGEN="yes"
  4375. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4376. fi
  4377. if (test "$ENABLED_OPENSSH" = "yes" && test "x$ENABLED_FIPS" = "xno") || \
  4378. test "$ENABLED_WPAS" = "yes" || test "$ENABLED_QT" = "yes"
  4379. then
  4380. test "$enable_arc4" = "" && enable_arc4=yes
  4381. fi
  4382. if test "$ENABLED_ARC4" = "no"
  4383. then
  4384. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  4385. else
  4386. # turn off ARC4 if leanpsk or leantls on
  4387. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  4388. then
  4389. AM_CFLAGS="$AM_CFLAGS -DNO_RC4"
  4390. ENABLED_ARC4=no
  4391. fi
  4392. fi
  4393. # Asio Support
  4394. AC_ARG_ENABLE([asio],
  4395. [AS_HELP_STRING([--enable-asio],[Enable asio (default: disabled)])],
  4396. [ ENABLED_ASIO=$enableval ],
  4397. [ ENABLED_ASIO=no ]
  4398. )
  4399. if test "$ENABLED_ASIO" = "yes"
  4400. then
  4401. # Requires opensslextra and opensslall
  4402. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4403. then
  4404. ENABLED_OPENSSLALL="yes"
  4405. ENABLED_OPENSSLEXTRA="yes"
  4406. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  4407. fi
  4408. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASIO -DASIO_USE_WOLFSSL -DWOLFSSL_KEY_GEN"
  4409. AM_CFLAGS="$AM_CFLAGS -DBOOST_ASIO_USE_WOLFSSL -DHAVE_EX_DATA"
  4410. AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1_2"
  4411. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3"
  4412. if test "$ENABLED_TLSV10" = "yes"
  4413. then
  4414. AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1"
  4415. fi
  4416. if test "$ENABLED_OLD_TLS" = "yes"
  4417. then
  4418. AM_CFLAGS="$AM_CFLAGS -DSSL_TXT_TLSV1_1"
  4419. fi
  4420. # Requires OCSP make sure on
  4421. if test "x$ENABLED_OCSP" = "xno"
  4422. then
  4423. ENABLED_OCSP="yes"
  4424. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  4425. fi
  4426. fi
  4427. # Apache HTTPD
  4428. AC_ARG_ENABLE([apachehttpd],
  4429. [AS_HELP_STRING([--enable-apachehttpd],[Enable Apache httpd (default: disabled)])],
  4430. [ ENABLED_APACHE_HTTPD=$enableval ],
  4431. [ ENABLED_APACHE_HTTPD=no ]
  4432. )
  4433. if test "$ENABLED_APACHE_HTTPD" = "yes"
  4434. then
  4435. # Requires opensslextra and opensslall
  4436. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4437. then
  4438. ENABLED_OPENSSLALL="yes"
  4439. ENABLED_OPENSSLEXTRA="yes"
  4440. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  4441. fi
  4442. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_APACHE_HTTPD"
  4443. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_NO_SSL2 -DOPENSSL_NO_SSL3 -DOPENSSL_NO_COMP"
  4444. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DWOLFSSL_SIGNER_DER_CERT"
  4445. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT -DWOLFSSL_CERT_GEN"
  4446. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI"
  4447. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS"
  4448. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_OCSP_ISSUER_CHECK"
  4449. # Requires OCSP make sure on
  4450. if test "x$ENABLED_OCSP" = "xno"
  4451. then
  4452. ENABLED_OCSP="yes"
  4453. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  4454. fi
  4455. # Requires sessioncerts make sure on
  4456. if test "x$ENABLED_SESSIONCERTS" = "xno"
  4457. then
  4458. ENABLED_SESSIONCERTS="yes"
  4459. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  4460. fi
  4461. # Requires ALPN
  4462. if test "x$ENABLED_ALPN" = "xno"
  4463. then
  4464. ENABLED_ALPN="yes"
  4465. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_ALPN"
  4466. fi
  4467. # Requires CRL
  4468. if test "x$ENABLED_CRL" = "xno"
  4469. then
  4470. ENABLED_CRL="yes"
  4471. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  4472. fi
  4473. # Requires Certificate Generation, Request and Extensions
  4474. if test "x$ENABLED_CERTGEN" = "xno"
  4475. then
  4476. ENABLED_CERTGEN="yes"
  4477. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4478. fi
  4479. if test "x$ENABLED_CERTREQ" = "xno"
  4480. then
  4481. ENABLED_CERTREQ="yes"
  4482. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  4483. fi
  4484. if test "x$ENABLED_CERTEXT" = "xno"
  4485. then
  4486. ENABLED_CERTEXT="yes"
  4487. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  4488. fi
  4489. # Requires Secure Renegotiation
  4490. if test "x$ENABLED_SECURE_RENEGOTIATION" = "xno"
  4491. then
  4492. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SECURE_RENEGOTIATION -DHAVE_SERVER_RENEGOTIATION_INFO"
  4493. fi
  4494. fi
  4495. # Encrypt-Then-Mac
  4496. AC_ARG_ENABLE([enc-then-mac],
  4497. [AS_HELP_STRING([--enable-enc-then-mac],[Enable Encrypt-Then-Mac extension (default: enabled)])],
  4498. [ ENABLED_ENCRYPT_THEN_MAC=$enableval ],
  4499. [ ENABLED_ENCRYPT_THEN_MAC=yes ]
  4500. )
  4501. if test "x$ENABLED_TLSX" = "xyes"
  4502. then
  4503. ENABLED_ENCRYPT_THEN_MAC=yes
  4504. fi
  4505. if test "x$ENABLED_ENCRYPT_THEN_MAC" = "xyes"
  4506. then
  4507. AM_CFLAGS="$AM_CFLAGS -DHAVE_ENCRYPT_THEN_MAC"
  4508. fi
  4509. # stunnel Support
  4510. AC_ARG_ENABLE([stunnel],
  4511. [AS_HELP_STRING([--enable-stunnel],[Enable stunnel (default: disabled)])],
  4512. [ ENABLED_STUNNEL=$enableval ],
  4513. [ ENABLED_STUNNEL=no ]
  4514. )
  4515. if test "$ENABLED_WPAS" = "yes"
  4516. then
  4517. ENABLED_STUNNEL="yes"
  4518. fi
  4519. # stunnel support requires all the features enabled within this conditional.
  4520. if test "$ENABLED_STUNNEL" = "yes"
  4521. then
  4522. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4523. then
  4524. ENABLED_OPENSSLEXTRA="yes"
  4525. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4526. fi
  4527. if test "x$ENABLED_SESSION_TICKET" = "xno"
  4528. then
  4529. ENABLED_SESSION_TICKET="yes"
  4530. AM_CFLAGS="$AM_CFLAGS -DHAVE_SESSION_TICKET"
  4531. fi
  4532. if test "x$ENABLED_OCSP" = "xno"
  4533. then
  4534. ENABLED_OCSP="yes"
  4535. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  4536. fi
  4537. if test "x$ENABLED_CODING" = "xno"
  4538. then
  4539. ENABLED_CODING="yes"
  4540. fi
  4541. if test "x$ENABLED_SESSIONCERTS" = "xno"
  4542. then
  4543. ENABLED_SESSIONCERTS="yes"
  4544. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  4545. fi
  4546. if test "x$ENABLED_CRL" = "xno"
  4547. then
  4548. ENABLED_CRL="yes"
  4549. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  4550. fi
  4551. if test "x$ENABLED_DES3" = "xno"
  4552. then
  4553. ENABLED_DES3="yes"
  4554. fi
  4555. if test "x$ENABLED_TLSX" = "xno"
  4556. then
  4557. ENABLED_TLSX="yes"
  4558. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI -DHAVE_MAX_FRAGMENT -DHAVE_TRUNCATED_HMAC"
  4559. # Check the ECC supported curves prereq
  4560. AS_IF([test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_CURVE25519" = "xyes"],
  4561. [ENABLED_SUPPORTED_CURVES=yes
  4562. AM_CFLAGS="$AM_CFLAGS -DHAVE_SUPPORTED_CURVES"])
  4563. fi
  4564. if test "x$ENABLED_ECC" = "xno"
  4565. then
  4566. ENABLED_OPENSSLEXTRA="yes"
  4567. ENABLED_ECC="yes"
  4568. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC -DTFM_ECC256"
  4569. if test "$ENABLED_ECC_SHAMIR" = "yes"
  4570. then
  4571. AM_CFLAGS="$AM_CFLAGS -DECC_SHAMIR"
  4572. fi
  4573. fi
  4574. if test "x$ENABLED_CERTEXT" = "xno"
  4575. then
  4576. ENABLED_CERTEXT="yes"
  4577. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  4578. fi
  4579. if test "x$ENABLED_CERTGEN" = "xno"
  4580. then
  4581. ENABLED_CERTGEN="yes"
  4582. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4583. fi
  4584. if test "x$ENABLED_KEYGEN" = "xno"
  4585. then
  4586. ENABLED_KEYGEN="yes"
  4587. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  4588. fi
  4589. AM_CFLAGS="$AM_CFLAGS -DHAVE_STUNNEL -DWOLFSSL_ALWAYS_VERIFY_CB"
  4590. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALWAYS_KEEP_SNI -DHAVE_EX_DATA"
  4591. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB -DWOLFSSL_SIGNER_DER_CERT"
  4592. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_COMPATIBLE_DEFAULTS -DWOLFSSL_TICKET_HAVE_ID"
  4593. fi
  4594. # curl Support
  4595. AC_ARG_ENABLE([curl],
  4596. [AS_HELP_STRING([--enable-curl],[Enable curl (default: disabled)])],
  4597. [ ENABLED_CURL=$enableval ],
  4598. [ ENABLED_CURL=no ]
  4599. )
  4600. # curl support requires all the features enabled within this conditional.
  4601. if test "$ENABLED_CURL" = "yes"
  4602. then
  4603. if test "x$ENABLED_DES3" = "xno"
  4604. then
  4605. ENABLED_DES3="yes"
  4606. fi
  4607. if test "x$ENABLED_ALPN" = "xno"
  4608. then
  4609. ENABLED_ALPN="yes"
  4610. fi
  4611. if test "x$ENABLED_WOLFSSH" = "xno"
  4612. then
  4613. ENABLED_WOLFSSH="yes"
  4614. fi
  4615. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4616. then
  4617. ENABLED_OPENSSLEXTRA="yes"
  4618. fi
  4619. if test "x$ENABLED_CRL" = "xno"
  4620. then
  4621. ENABLED_CRL="yes"
  4622. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  4623. fi
  4624. if test "x$ENABLED_OCSP" = "xno"
  4625. then
  4626. ENABLED_OCSP="yes"
  4627. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  4628. fi
  4629. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xno"
  4630. then
  4631. ENABLED_CERTIFICATE_STATUS_REQUEST="yes"
  4632. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST"
  4633. fi
  4634. if test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xno"
  4635. then
  4636. ENABLED_CERTIFICATE_STATUS_REQUEST_V2="yes"
  4637. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_CERTIFICATE_STATUS_REQUEST_V2"
  4638. fi
  4639. if test "x$ENABLED_SNI" = "xno"
  4640. then
  4641. ENABLED_SNI="yes"
  4642. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SNI"
  4643. fi
  4644. if test "x$ENABLED_ALT_CERT_CHAINS" = "xno"
  4645. then
  4646. ENABLED_ALT_CERT_CHAINS="yes"
  4647. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_CERT_CHAINS"
  4648. fi
  4649. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DES_ECB"
  4650. fi
  4651. if test "$ENABLED_PSK" = "no" && test "$ENABLED_LEANPSK" = "no" \
  4652. && test "x$ENABLED_STUNNEL" = "xno"
  4653. then
  4654. AM_CFLAGS="$AM_CFLAGS -DNO_PSK"
  4655. fi
  4656. if test "$ENABLED_PSK" = "no" && \
  4657. (test "$ENABLED_LEANPSK" = "yes" || test "x$ENABLED_STUNNEL" = "xyes")
  4658. then
  4659. ENABLED_PSK=yes
  4660. fi
  4661. # tcpdump support
  4662. AC_ARG_ENABLE([tcpdump],
  4663. [AS_HELP_STRING([--enable-tcpdump],[Enable tcpdump (default: disabled)])],
  4664. [ ENABLED_TCPDUMP=$enableval ],
  4665. [ ENABLED_TCPDUMP=no ]
  4666. )
  4667. # tcpdump support requires all the features enabled within this conditional.
  4668. if test "$ENABLED_TCPDUMP" = "yes"
  4669. then
  4670. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4671. then
  4672. ENABLED_OPENSSLEXTRA="yes"
  4673. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4674. fi
  4675. if test "x$ENABLED_DES3" = "xno"
  4676. then
  4677. ENABLED_DES3="yes"
  4678. fi
  4679. fi
  4680. # sblim-sfcb support
  4681. AC_ARG_ENABLE([sblim-sfcb],
  4682. [AS_HELP_STRING([--enable-sblim-sfcb],[Enable sblim-sfcb support (default: disabled)])],
  4683. [ ENABLED_SBLIM_SFCB=$enableval ],
  4684. [ ENABLED_SBLIM_SFCB=no ]
  4685. )
  4686. # sblim-sfcb support requires all the features enabled within this conditional.
  4687. if test "$ENABLED_SBLIM_SFCB" = "yes"
  4688. then
  4689. if test "x$ENABLED_OPENSSLEXTRA" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4690. then
  4691. ENABLED_OPENSSLEXTRA="yes"
  4692. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
  4693. fi
  4694. if test "x$ENABLED_CERTGEN" = "xno"
  4695. then
  4696. ENABLED_CERTGEN="yes"
  4697. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4698. fi
  4699. AM_CFLAGS="$AM_CFLAGS -DHAVE_SBLIM_SFCB -DWOLFSSL_SIGNER_DER_CERT"
  4700. fi
  4701. # libest Support
  4702. AC_ARG_ENABLE([libest],
  4703. [AS_HELP_STRING([--enable-libest],[Enable libest (default: disabled)])],
  4704. [ ENABLED_LIBEST=$enableval ],
  4705. [ ENABLED_LIBEST=no ]
  4706. )
  4707. if test "$ENABLED_LIBEST" = "yes"
  4708. then
  4709. AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DHAVE_LIBEST -DWOLFSSL_ALT_NAMES"
  4710. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_SALT_LEN_DISCOVER"
  4711. # Requires opensslextra and opensslall
  4712. if test "x$ENABLED_OPENSSLALL" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  4713. then
  4714. ENABLED_OPENSSLALL="yes"
  4715. ENABLED_OPENSSLEXTRA="yes"
  4716. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DOPENSSL_ALL"
  4717. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EITHER_SIDE -DWC_RSA_NO_PADDING"
  4718. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_PSS -DWOLFSSL_PSS_LONG_SALT"
  4719. fi
  4720. # Requires OCSP
  4721. if test "x$ENABLED_OCSP" = "xno"
  4722. then
  4723. ENABLED_OCSP="yes"
  4724. AM_CFLAGS="$AM_CFLAGS -DHAVE_OCSP"
  4725. fi
  4726. # Requires PKCS7
  4727. if test "x$ENABLED_PKCS7" = "xno"
  4728. then
  4729. ENABLED_PKCS7="yes"
  4730. fi
  4731. # Requires Certificate Generation and Request
  4732. if test "x$ENABLED_CERTGEN" = "xno"
  4733. then
  4734. ENABLED_CERTGEN="yes"
  4735. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  4736. fi
  4737. if test "x$ENABLED_CERTREQ" = "xno"
  4738. then
  4739. ENABLED_CERTREQ="yes"
  4740. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  4741. fi
  4742. if test "x$ENABLED_CERTEXT" = "xno"
  4743. then
  4744. ENABLED_CERTEXT="yes"
  4745. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  4746. fi
  4747. # Requires CRL
  4748. if test "x$ENABLED_CRL" = "xno"
  4749. then
  4750. ENABLED_CRL="yes"
  4751. AM_CFLAGS="$AM_CFLAGS -DHAVE_CRL"
  4752. fi
  4753. if test "x$ENABLED_SRP" = "xno"
  4754. then
  4755. ENABLED_SRP="yes"
  4756. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_HAVE_SRP"
  4757. fi
  4758. # Enable prereqs if not already enabled
  4759. if test "x$ENABLED_KEYGEN" = "xno"
  4760. then
  4761. ENABLED_KEYGEN="yes"
  4762. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  4763. fi
  4764. # Requires sessioncerts make sure on
  4765. if test "x$ENABLED_SESSIONCERTS" = "xno"
  4766. then
  4767. ENABLED_SESSIONCERTS="yes"
  4768. AM_CFLAGS="$AM_CFLAGS -DSESSION_CERTS"
  4769. fi
  4770. if test "x$ENABLED_DSA" = "xno"
  4771. then
  4772. AC_MSG_WARN([Enabling DSA with --enable-dsa is recommended for libest])
  4773. fi
  4774. fi
  4775. # MD4
  4776. AC_ARG_ENABLE([md4],
  4777. [AS_HELP_STRING([--enable-md4],[Enable MD4 (default: disabled)])],
  4778. [ ENABLED_MD4=$enableval ],
  4779. [ ENABLED_MD4=no ]
  4780. )
  4781. if test "$ENABLED_MD4" = "no"
  4782. then
  4783. #turn on MD4 if using stunnel
  4784. if test "x$ENABLED_STUNNEL" = "xyes" || test "x$ENABLED_WPAS" != "xno" || test "x$ENABLED_KRB" = "xyes"
  4785. then
  4786. ENABLED_MD4="yes"
  4787. else
  4788. AM_CFLAGS="$AM_CFLAGS -DNO_MD4"
  4789. fi
  4790. fi
  4791. # Encrypted keys
  4792. AC_ARG_ENABLE([enckeys],
  4793. [AS_HELP_STRING([--enable-enckeys],[Enable PEM encrypted private key support (default: disabled)])],
  4794. [ ENABLED_ENCKEYS=$enableval ],
  4795. [ ENABLED_ENCKEYS=no ]
  4796. )
  4797. if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_WEBSERVER" = "yes" || test "$ENABLED_WPAS" != "no"
  4798. then
  4799. ENABLED_ENCKEYS=yes
  4800. fi
  4801. if test "$ENABLED_ENCKEYS" = "yes"
  4802. then
  4803. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ENCRYPTED_KEYS"
  4804. fi
  4805. # PKCS#12
  4806. # set PKCS#12 default
  4807. PKCS12_DEFAULT=yes
  4808. if test "$ENABLED_ASN" = "no" || test "$FIPS_VERSION" = "rand"
  4809. then
  4810. PKCS12_DEFAULT=no
  4811. fi
  4812. AC_ARG_ENABLE([pkcs12],
  4813. [AS_HELP_STRING([--enable-pkcs12],[Enable pkcs12 (default: enabled)])],
  4814. [ ENABLED_PKCS12=$enableval ],
  4815. [ ENABLED_PKCS12=$PKCS12_DEFAULT ]
  4816. )
  4817. if test "x$ENABLED_PKCS12" = "xno"
  4818. then
  4819. AM_CFLAGS="$AM_CFLAGS -DNO_PKCS12"
  4820. fi
  4821. # PWDBASED has to come after certservice since we want it on w/o explicit on
  4822. # PWDBASED
  4823. AC_ARG_ENABLE([pwdbased],
  4824. [AS_HELP_STRING([--enable-pwdbased],[Enable PWDBASED (default: disabled)])],
  4825. [ ENABLED_PWDBASED=$enableval ],
  4826. [ ENABLED_PWDBASED=no ]
  4827. )
  4828. if test "$ENABLED_PWDBASED" = "no"
  4829. then
  4830. if test "$ENABLED_OPENSSLEXTRA" = "yes" || test "$ENABLED_OPENSSLALL" = "yes" || \
  4831. test "$ENABLED_WEBSERVER" = "yes" || test "$ENABLED_ENCKEYS" = "yes" || \
  4832. test "$ENABLED_PKCS12" = "yes"
  4833. then
  4834. # opensslextra, opensslall, webserver, enckeys and pkcs12 need pwdbased
  4835. ENABLED_PWDBASED=yes
  4836. else
  4837. AM_CFLAGS="$AM_CFLAGS -DNO_PWDBASED"
  4838. fi
  4839. fi
  4840. AC_ARG_ENABLE([scrypt],
  4841. [AS_HELP_STRING([--enable-scrypt],[Enable SCRYPT (default: disabled)])],
  4842. [ ENABLED_SCRYPT=$enableval ],
  4843. [ ENABLED_SCRYPT=no ]
  4844. )
  4845. if test "$ENABLED_SCRYPT" = "yes"
  4846. then
  4847. if test "$ENABLED_PWDBASED" = "no"
  4848. then
  4849. AC_MSG_ERROR([cannot enable scrypt without enabling pwdbased.])
  4850. fi
  4851. AM_CFLAGS="$AM_CFLAGS -DHAVE_SCRYPT"
  4852. fi
  4853. # wolfCrypt Only Build
  4854. AC_ARG_ENABLE([cryptonly],
  4855. [AS_HELP_STRING([--enable-cryptonly],[Enable wolfCrypt Only build (default: disabled)])],
  4856. [ENABLED_CRYPTONLY=$enableval],
  4857. [ENABLED_CRYPTONLY=no])
  4858. AS_IF([test "x$FIPS_VERSION" = "xrand"],[ENABLED_CRYPTONLY="yes"])
  4859. if test "$ENABLED_CRYPTONLY" = "yes"
  4860. then
  4861. if test "$ENABLED_OPENSSLALL" = "yes"
  4862. then
  4863. AC_MSG_ERROR([cryptonly and opensslall are mutually incompatible.])
  4864. fi
  4865. AM_CFLAGS="$AM_CFLAGS -DWOLFCRYPT_ONLY"
  4866. fi
  4867. if test "x$ENABLED_CRYPTONLY" = "xno"
  4868. then
  4869. if test "x$ENABLED_PSK" = "xno" && test "x$ENABLED_ASN" = "xno"
  4870. then
  4871. AC_MSG_ERROR([please enable psk if disabling asn.])
  4872. fi
  4873. if test "x$ENABLED_ECC" != "xno" && test "x$ENABLED_ASN" = "xno"
  4874. then
  4875. AC_MSG_ERROR([please disable ecc if disabling asn.])
  4876. fi
  4877. if test "$ENABLED_AFALG" = "yes"
  4878. then
  4879. # for TLS connections the intermediate hash needs to store buffer
  4880. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AFALG_HASH_KEEP"
  4881. fi
  4882. if test "$ENABLED_DEVCRYPTO" = "yes"
  4883. then
  4884. # for TLS connections the intermediate hash needs to store buffer
  4885. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DEVCRYPTO_HASH_KEEP"
  4886. fi
  4887. fi
  4888. # set fastmath default
  4889. FASTMATH_DEFAULT=no
  4890. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64"
  4891. then
  4892. FASTMATH_DEFAULT=yes
  4893. fi
  4894. if test "$ENABLED_LINUXKM_DEFAULTS" = "yes"
  4895. then
  4896. FASTMATH_DEFAULT=no
  4897. fi
  4898. if test "$ENABLED_SP_MATH" = "yes"
  4899. then
  4900. FASTMATH_DEFAULT=no
  4901. fi
  4902. # fastmath
  4903. AC_ARG_ENABLE([fastmath],
  4904. [AS_HELP_STRING([--enable-fastmath],[Enable fast math ops (default: enabled on x86_64/aarch64)])],
  4905. [ ENABLED_FASTMATH=$enableval ],
  4906. [ ENABLED_FASTMATH=$FASTMATH_DEFAULT]
  4907. )
  4908. if test "x$ENABLED_FASTMATH" = "xyes"
  4909. then
  4910. # turn off fastmth if leanpsk on or asn off (w/o DH and ECC)
  4911. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_ASN" = "no"
  4912. then
  4913. if test "$ENABLED_DH" = "no" && test "$ENABLED_ECC" = "no" && test "$ENABLED_RSA" = "no"
  4914. then
  4915. ENABLED_FASTMATH=no
  4916. else
  4917. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  4918. ENABLED_SLOWMATH="no"
  4919. fi
  4920. else
  4921. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  4922. ENABLED_SLOWMATH="no"
  4923. fi
  4924. if test "$host_cpu" = "x86_64"
  4925. then
  4926. # Have settings.h set FP_MAX_BITS higher if user didn't set directly
  4927. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_64_BUILD"
  4928. fi
  4929. AS_IF([test "x$host_cpu" = "xaarch64"],[AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AARCH64_BUILD"])
  4930. if test "$ENABLED_SAKKE" = "yes" && test "$ENABLED_SAKKE_SMALL" != "yes"
  4931. then
  4932. AM_CFLAGS="$AM_CFLAGS -funroll-loops -DTFM_SMALL_SET"
  4933. fi
  4934. fi
  4935. # fast HUGE math
  4936. AC_ARG_ENABLE([fasthugemath],
  4937. [AS_HELP_STRING([--enable-fasthugemath],[Enable fast math + huge code (default: disabled)])],
  4938. [ ENABLED_FASTHUGEMATH=$enableval ],
  4939. [ ENABLED_FASTHUGEMATH=no ]
  4940. )
  4941. if test "$ENABLED_BUMP" = "yes"
  4942. then
  4943. ENABLED_FASTHUGEMATH="yes"
  4944. fi
  4945. if test "$ENABLED_FASTHUGEMATH" = "yes"
  4946. then
  4947. ENABLED_FASTMATH="yes"
  4948. AM_CFLAGS="$AM_CFLAGS -DUSE_FAST_MATH"
  4949. ENABLED_SLOWMATH="no"
  4950. fi
  4951. # Enable Examples, used to disable examples
  4952. if test "$ENABLED_LINUXKM" = "yes"
  4953. then
  4954. ENABLED_EXAMPLES_DEFAULT=no
  4955. else
  4956. ENABLED_EXAMPLES_DEFAULT=yes
  4957. fi
  4958. AC_ARG_ENABLE([examples],
  4959. [AS_HELP_STRING([--enable-examples],[Enable Examples (default: enabled)])],
  4960. [ ENABLED_EXAMPLES=$enableval ],
  4961. [ ENABLED_EXAMPLES=$ENABLED_EXAMPLES_DEFAULT ]
  4962. )
  4963. AS_IF([test "x$ENABLED_FILESYSTEM" = "xno"], [ENABLED_EXAMPLES="no"])
  4964. AS_IF([test "x$ENABLED_INLINE" = "xno"], [ENABLED_EXAMPLES="no"])
  4965. AS_IF([test "x$ENABLED_CRYPTONLY" = "xyes"], [ENABLED_EXAMPLES="no"])
  4966. # Enable wolfCrypt test and benchmark
  4967. if test "$ENABLED_LINUXKM" = "yes"
  4968. then
  4969. ENABLED_CRYPT_TESTS_DEFAULT=no
  4970. else
  4971. ENABLED_CRYPT_TESTS_DEFAULT=yes
  4972. fi
  4973. AC_ARG_ENABLE([crypttests],
  4974. [AS_HELP_STRING([--enable-crypttests],[Enable Crypt Bench/Test (default: enabled)])],
  4975. [ ENABLED_CRYPT_TESTS=$enableval ],
  4976. [ ENABLED_CRYPT_TESTS=$ENABLED_CRYPT_TESTS_DEFAULT ]
  4977. )
  4978. AC_SUBST([ENABLED_CRYPT_TESTS])
  4979. # Build wolfCrypt test and benchmark as libraries. This will compile test.c and
  4980. # benchmark.c and make their functions available via libraries, libwolfcrypttest
  4981. # and libwolfcryptbench, respectively. Note that this feature is not enabled by
  4982. # default, and the API of these libraries should NOT be treated as stable.
  4983. AC_ARG_ENABLE([crypttests-libs],
  4984. [AS_HELP_STRING([--enable-crypttests-libs],[Enable wolfcrypt test and benchmark libraries (default: disabled)])],
  4985. [ ENABLED_CRYPT_TESTS_LIBS=$enableval ],
  4986. [ ENABLED_CRYPT_TESTS_LIBS=no ]
  4987. )
  4988. # LIBZ
  4989. ENABLED_LIBZ="no"
  4990. trylibzdir=""
  4991. AC_ARG_WITH([libz],
  4992. [ --with-libz=PATH PATH to libz install (default /usr/) ],
  4993. [
  4994. AC_MSG_CHECKING([for libz])
  4995. CPPFLAGS="$CPPFLAGS -DHAVE_LIBZ"
  4996. LIBS="$LIBS -lz"
  4997. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  4998. if test "x$libz_linked" = "xno" ; then
  4999. if test "x$withval" != "xno" ; then
  5000. trylibzdir=$withval
  5001. fi
  5002. if test "x$withval" = "xyes" ; then
  5003. trylibzdir="/usr"
  5004. fi
  5005. LDFLAGS="$LDFLAGS -L$trylibzdir/lib"
  5006. CPPFLAGS="$CPPFLAGS -I$trylibzdir/include"
  5007. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <zlib.h>]], [[ deflateInit(0, 8); ]])],[ libz_linked=yes ],[ libz_linked=no ])
  5008. if test "x$libz_linked" = "xno" ; then
  5009. AC_MSG_ERROR([libz isn't found.
  5010. If it's already installed, specify its path using --with-libz=/dir/])
  5011. fi
  5012. AC_MSG_RESULT([yes])
  5013. else
  5014. AC_MSG_RESULT([yes])
  5015. fi
  5016. ENABLED_LIBZ="yes"
  5017. ]
  5018. )
  5019. # PKCS#11
  5020. AC_ARG_ENABLE([pkcs11],
  5021. [AS_HELP_STRING([--enable-pkcs11],[Enable pkcs11 access (default: disabled)])],
  5022. [ ENABLED_PKCS11=$enableval ],
  5023. [ ENABLED_PKCS11=no ]
  5024. )
  5025. if test "x$ENABLED_PKCS11" != "xno"
  5026. then
  5027. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS11 -DHAVE_WOLF_BIGINT"
  5028. if test "x$ENABLED_PKCS11" != "xstatic"
  5029. then
  5030. LIBS="$LIBS -ldl"
  5031. else
  5032. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS11_STATIC"
  5033. ENABLED_PKCS11="yes"
  5034. fi
  5035. fi
  5036. # PKCS#8
  5037. AC_ARG_ENABLE([pkcs8],
  5038. [AS_HELP_STRING([--enable-pkcs8],[Enable PKCS #8 key packages (default: enabled)])],
  5039. [ ENABLED_PKCS8=$enableval ],
  5040. [ ENABLED_PKCS8=yes ]
  5041. )
  5042. if test "x$ENABLED_PKCS8" = "xno"
  5043. then
  5044. AM_CFLAGS="$AM_CFLAGS -DNO_PKCS8"
  5045. fi
  5046. # cavium
  5047. trycaviumdir=""
  5048. AC_ARG_WITH([cavium],
  5049. [ --with-cavium=PATH PATH to cavium/software dir ],
  5050. [
  5051. AC_MSG_CHECKING([for cavium])
  5052. CPPFLAGS="$CPPFLAGS -DHAVE_CAVIUM"
  5053. LIB_ADD="-lrt $LIB_ADD"
  5054. if test "x$withval" = "xyes" ; then
  5055. AC_MSG_ERROR([need a PATH for --with-cavium])
  5056. fi
  5057. if test "x$withval" != "xno" ; then
  5058. trycaviumdir=$withval
  5059. fi
  5060. LDFLAGS="$AM_LDFLAGS $trycaviumdir/api/cavium_common.o"
  5061. CPPFLAGS="$CPPFLAGS -I$trycaviumdir/include"
  5062. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cavium_common.h"]], [[ CspShutdown(CAVIUM_DEV_ID); ]])],[ cavium_linked=yes ],[ cavium_linked=no ])
  5063. if test "x$cavium_linked" = "xno" ; then
  5064. AC_MSG_ERROR([cavium isn't found.
  5065. If it's already installed, specify its path using --with-cavium=/dir/])
  5066. else
  5067. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM"
  5068. fi
  5069. AC_MSG_RESULT([yes])
  5070. enable_shared=no
  5071. enable_static=yes
  5072. ENABLED_CAVIUM=yes
  5073. ],
  5074. [ ENABLED_CAVIUM=no ]
  5075. )
  5076. # cavium V
  5077. trycaviumdir=""
  5078. AC_ARG_WITH([cavium-v],
  5079. [ --with-cavium-v=PATH PATH to Cavium V/software dir ],
  5080. [
  5081. AC_MSG_CHECKING([for cavium])
  5082. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM -DHAVE_CAVIUM_V"
  5083. LIB_ADD="-lrt -lcrypto $LIB_ADD"
  5084. if test "x$withval" = "xyes" ; then
  5085. AC_MSG_ERROR([need a PATH for --with-cavium])
  5086. fi
  5087. if test "x$withval" != "xno" ; then
  5088. trycaviumdir=$withval
  5089. fi
  5090. if test -e $trycaviumdir/lib/libnitrox.a
  5091. then
  5092. AM_CPPFLAGS="-I$trycaviumdir/include $AM_CPPFLAGS"
  5093. else
  5094. ENABLED_CAVIUM_V=no
  5095. fi
  5096. LIB_STATIC_ADD="$trycaviumdir/lib/libnitrox.a $LIB_STATIC_ADD"
  5097. if test "$ENABLED_CAVIUM_V" = "no"; then
  5098. AC_MSG_ERROR([Could not find Nitrox library])
  5099. fi
  5100. enable_shared=no
  5101. enable_static=yes
  5102. enable_opensslextra=yes
  5103. ENABLED_CAVIUM=yes
  5104. ENABLED_CAVIUM_V=yes
  5105. ],
  5106. [
  5107. ENABLED_CAVIUM_=no
  5108. ENABLED_CAVIUM_V=no
  5109. ]
  5110. )
  5111. # Cavium Octeon
  5112. OCTEON_ROOT=""
  5113. : ${OCTEON_OBJ="obj-octeon2"}
  5114. : ${OCTEON_HOST="standalone"}
  5115. AC_ARG_WITH([octeon-sync],
  5116. [AS_HELP_STRING([--with-octeon-sync=PATH],[PATH to Cavium Octeon SDK dir (sync)])],
  5117. [
  5118. AC_MSG_CHECKING([for octeon])
  5119. if test "x$withval" = "xyes" ; then
  5120. AC_MSG_ERROR([need a PATH for --with-octeon])
  5121. fi
  5122. if test "x$withval" != "xno" ; then
  5123. OCTEON_ROOT=$withval
  5124. fi
  5125. AM_CFLAGS="$AM_CFLAGS -DHAVE_CAVIUM_OCTEON_SYNC"
  5126. AM_CFLAGS="$AM_CFLAGS -DOCTEON_MODEL=$OCTEON_MODEL"
  5127. AM_CFLAGS="$AM_CFLAGS -I$OCTEON_ROOT/executive"
  5128. AS_CASE([$OCTEON_HOST],['linux'],[AM_CFLAGS="$AM_CFLAGS -DCVMX_BUILD_FOR_LINUX_HOST"])
  5129. #-I$OCTEON_ROOT/target/include
  5130. AM_LDFLAGS="$AM_LDFLAGS -lrt -Xlinker -T -Xlinker $OCTEON_ROOT/executive/cvmx-shared-linux.ld"
  5131. AM_LDFLAGS="$AM_LDFLAGS -L$OCTEON_ROOT/executive/$OCTEON_OBJ -lcvmx -lfdt"
  5132. enable_shared=no
  5133. enable_static=yes
  5134. ENABLED_OCTEON_SYNC=yes
  5135. AC_MSG_RESULT([yes])
  5136. ],
  5137. [ENABLED_OCTEON_SYNC=no]
  5138. )
  5139. # Intel QuickAssist
  5140. QAT_DIR=""
  5141. BUILD_INTEL_QAT_VERSION=2
  5142. AC_ARG_WITH([intelqa],
  5143. [AS_HELP_STRING([--with-intelqa=PATH],[PATH to Intel QuickAssist (QAT) driver dir])],
  5144. [ENABLED_INTEL_QA=yes; QAT_DIR=$withval],
  5145. [ENABLED_INTEL_QA=no])
  5146. AC_ARG_WITH([intelqa-sync],
  5147. [AS_HELP_STRING([--with-intelqa-sync=PATH],[PATH to Intel QuickAssist (QAT) driver dir (sync)])],
  5148. [ENABLED_INTEL_QA_SYNC=yes; QAT_DIR=$withval],
  5149. [ENABLED_INTEL_QA_SYNC=no])
  5150. AS_IF([test "x$ENABLED_INTEL_QA" = "xyes" && test "x$ENABLED_INTEL_QA_SYNC" = "xyes"],
  5151. [AC_MSG_ERROR([Both Intel QA Async and Sync are selected, only select one.])])
  5152. AS_IF([test "x$ENABLED_INTEL_QA" = "xyes" || test "x$ENABLED_INTEL_QA_SYNC" = "xyes"],
  5153. [AC_MSG_CHECKING([for intelqa])
  5154. AS_IF([test "x$ENABLED_INTEL_QA" = "xyes"],
  5155. [AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_INTEL_QA -DDO_CRYPTO -DUSER_SPACE"; intelqa_opt=""],
  5156. [AM_CPPFLAGS="$AM_CPPFLAGS -DHAVE_INTEL_QA_SYNC -DQAT_USE_POLLING_THREAD -DO_CRYPTO -DUSER_SPACE"; intelqa_opt="-sync"])
  5157. OLD_LIBS="$LIBS"
  5158. OLD_CPPFLAGS="$CPPFLAGS"
  5159. AS_IF([test "x$QAT_DIR" = "xyes"],[AC_MSG_ERROR([need a PATH for --with-intelqa$intelqa_opt])])
  5160. AM_CPPFLAGS="$AM_CPPFLAGS -I$QAT_DIR/quickassist/include -I$QAT_DIR/quickassist/include/lac -I$QAT_DIR/quickassist/utilities/osal/include \
  5161. -I$QAT_DIR/quickassist/utilities/osal/src/linux/user_space/include -I$QAT_DIR/quickassist/lookaside/access_layer/include \
  5162. -I$QAT_DIR/quickassist/lookaside/access_layer/src/common/include -I$srcdir/wolfssl -I$srcdir/wolfssl/wolfcrypt/port/intel \
  5163. -I$QAT_DIR/quickassist/utilities/libusdm_drv"
  5164. CPPFLAGS="$AM_CPPFLAGS"
  5165. LDFLAGS="$LDFLAGS -L$QAT_DIR/build"
  5166. LIBS="$LIBS -lqat_s -lusdm_drv_s"
  5167. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cpa_cy_common.h"]],[[Cpa16U count = 0; cpaCyGetNumInstances(&count);]])],[intelqa_linked=yes],[intelqa_linked=no])
  5168. AS_IF([test "x$intelqa_linked" = "xno"],
  5169. [# Try old QAT driver libraries
  5170. LIBS="$OLD_LIBS -licp_qa_al_s"
  5171. AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "cpa_cy_common.h"]],[[Cpa16U count = 0; cpaCyGetNumInstances(&count);]])],[intelqa_linked=yes],[intelqa_linked=no])
  5172. AS_IF([test "x$intelqa_linked" = "xno"],
  5173. [AC_MSG_ERROR([Intel QuickAssist not found. If it's already installed, specify its path using --with-intelqa$intelqa_opt=/dir/])],
  5174. [BUILD_INTEL_QAT_VERSION=1])
  5175. ])
  5176. AC_MSG_RESULT([yes])
  5177. AS_IF([test "x$BUILD_INTEL_QAT_VERSION" = "x1"],
  5178. [LIB_ADD="-ladf_proxy -losal -lrt $LIB_ADD"],
  5179. [LIB_ADD="-losal -lrt $LIB_ADD"])
  5180. CPPFLAGS="$OLD_CPPFLAGS"
  5181. ])
  5182. ################################################################################
  5183. # Single Precision option handling #
  5184. ################################################################################
  5185. ENABLED_SP_RSA=no
  5186. ENABLED_SP_DH=no
  5187. ENABLED_SP_FF_2048=no
  5188. ENABLED_SP_FF_3072=no
  5189. ENABLED_SP_FF_4096=no
  5190. ENABLED_SP_ECC=no
  5191. ENABLED_SP_EC_256=no
  5192. ENABLED_SP_EC_384=no
  5193. ENABLED_SP_EC_521=no
  5194. ENABLED_SP_SAKKE_1024=$ENABLED_SAKKE
  5195. ENABLED_SP_NO_MALLOC=no
  5196. ENABLED_SP_NONBLOCK=no
  5197. ENABLED_SP_SMALL=no
  5198. for v in `echo $ENABLED_SP | tr "," " "`
  5199. do
  5200. case $v in
  5201. small)
  5202. ENABLED_SP_SMALL=yes
  5203. ENABLED_SP_RSA=yes
  5204. ENABLED_SP_DH=yes
  5205. ENABLED_SP_FF_2048=yes
  5206. ENABLED_SP_FF_3072=yes
  5207. ENABLED_SP_ECC=yes
  5208. ENABLED_SP_EC_256=yes
  5209. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64"; then
  5210. ENABLED_SP_FF_4096=yes
  5211. ENABLED_SP_EC_384=yes
  5212. ENABLED_SP_EC_521=yes
  5213. fi
  5214. ;;
  5215. smallfast)
  5216. ENABLED_SP_SMALL=yes
  5217. ENABLED_SP_RSA=yes
  5218. ENABLED_SP_DH=yes
  5219. ENABLED_SP_FF_2048=yes
  5220. ENABLED_SP_FF_3072=yes
  5221. ENABLED_SP_ECC=yes
  5222. ENABLED_SP_EC_256=yes
  5223. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64"; then
  5224. ENABLED_SP_FF_4096=yes
  5225. ENABLED_SP_EC_384=yes
  5226. ENABLED_SP_EC_521=yes
  5227. fi
  5228. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_FAST_MODEXP"
  5229. ;;
  5230. yes)
  5231. ENABLED_SP_RSA=yes
  5232. ENABLED_SP_DH=yes
  5233. ENABLED_SP_FF_2048=yes
  5234. ENABLED_SP_FF_3072=yes
  5235. ENABLED_SP_ECC=yes
  5236. ENABLED_SP_EC_256=yes
  5237. if test "$host_cpu" = "x86_64" || test "$host_cpu" = "aarch64"; then
  5238. ENABLED_SP_FF_4096=yes
  5239. ENABLED_SP_EC_384=yes
  5240. ENABLED_SP_EC_521=yes
  5241. fi
  5242. ;;
  5243. no)
  5244. ;;
  5245. smallec256 | smallp256 | small256)
  5246. ENABLED_SP_SMALL=yes
  5247. ENABLED_SP_ECC=yes
  5248. ENABLED_SP_EC_256=yes
  5249. ;;
  5250. ec256 | p256 | 256)
  5251. ENABLED_SP_ECC=yes
  5252. ENABLED_SP_EC_256=yes
  5253. ;;
  5254. smallec384 | smallp384 | small384)
  5255. ENABLED_SP_SMALL=yes
  5256. ENABLED_SP_ECC=yes
  5257. ENABLED_SP_EC_384=yes
  5258. ;;
  5259. ec384 | p384 | 384)
  5260. ENABLED_SP_ECC=yes
  5261. ENABLED_SP_EC_384=yes
  5262. ;;
  5263. smallec521 | smallp521 | small521)
  5264. ENABLED_SP_SMALL=yes
  5265. ENABLED_SP_ECC=yes
  5266. ENABLED_SP_EC_521=yes
  5267. ;;
  5268. ec521 | p521 | 521)
  5269. ENABLED_SP_ECC=yes
  5270. ENABLED_SP_EC_521=yes
  5271. ;;
  5272. smallec1024 | smallp1024 | small1024)
  5273. ENABLED_SP_ECC=yes
  5274. ENABLED_SP_SMALL=yes
  5275. ENABLED_SP_SAKKE_1024=yes
  5276. ;;
  5277. ec1024 | p1024 | 1024)
  5278. ENABLED_SP_ECC=yes
  5279. ENABLED_SP_SAKKE_1024=yes
  5280. ;;
  5281. small2048)
  5282. ENABLED_SP_SMALL=yes
  5283. ENABLED_SP_RSA=yes
  5284. ENABLED_SP_DH=yes
  5285. ENABLED_SP_FF_2048=yes
  5286. ;;
  5287. 2048)
  5288. ENABLED_SP_RSA=yes
  5289. ENABLED_SP_DH=yes
  5290. ENABLED_SP_FF_2048=yes
  5291. ;;
  5292. smallrsa2048)
  5293. ENABLED_SP_SMALL=yes
  5294. ENABLED_SP_RSA=yes
  5295. ENABLED_SP_FF_2048=yes
  5296. ;;
  5297. rsa2048)
  5298. ENABLED_SP_RSA=yes
  5299. ENABLED_SP_FF_2048=yes
  5300. ;;
  5301. small3072)
  5302. ENABLED_SP_SMALL=yes
  5303. ENABLED_SP_RSA=yes
  5304. ENABLED_SP_DH=yes
  5305. ENABLED_SP_FF_3072=yes
  5306. ;;
  5307. 3072)
  5308. ENABLED_SP_RSA=yes
  5309. ENABLED_SP_DH=yes
  5310. ENABLED_SP_FF_3072=yes
  5311. ;;
  5312. smallrsa3072)
  5313. ENABLED_SP_SMALL=yes
  5314. ENABLED_SP_RSA=yes
  5315. ENABLED_SP_FF_3072=yes
  5316. ;;
  5317. rsa3072)
  5318. ENABLED_SP_RSA=yes
  5319. ENABLED_SP_FF_3072=yes
  5320. ;;
  5321. small4096)
  5322. ENABLED_SP_SMALL=yes
  5323. ENABLED_SP_RSA=yes
  5324. ENABLED_SP_DH=yes
  5325. ENABLED_SP_FF_4096=yes
  5326. ;;
  5327. 4096 | +4096)
  5328. ENABLED_SP_RSA=yes
  5329. ENABLED_SP_DH=yes
  5330. ENABLED_SP_FF_4096=yes
  5331. ;;
  5332. smallrsa4096)
  5333. ENABLED_SP_SMALL=yes
  5334. ENABLED_SP_RSA=yes
  5335. ENABLED_SP_FF_4096=yes
  5336. ;;
  5337. rsa4096)
  5338. ENABLED_SP_RSA=yes
  5339. ENABLED_SP_FF_4096=yes
  5340. ;;
  5341. nomalloc)
  5342. ENABLED_SP_NO_MALLOC=yes
  5343. ;;
  5344. nonblock)
  5345. # Requires small and no malloc
  5346. ENABLED_SP_NONBLOCK=yes
  5347. ENABLED_SP_NO_MALLOC=yes
  5348. ENABLED_SP_SMALL=yes
  5349. ;;
  5350. asm)
  5351. ENABLED_SP_ASM=yes
  5352. ;;
  5353. *)
  5354. AC_MSG_ERROR([Invalid choice of Single Precision length in bits [256, 384, 521, 1024, 2048, 3072, 4096]: $ENABLED_SP.])
  5355. break;;
  5356. esac
  5357. done
  5358. ENABLED_SP=no
  5359. if test "$ENABLED_RSA" = "yes" && test "$ENABLED_SP_RSA" = "yes"; then
  5360. ENABLED_SP=yes
  5361. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_SP_RSA"
  5362. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_SP_RSA"
  5363. fi
  5364. if test "$ENABLED_DH" = "yes" && test "$ENABLED_SP_DH" = "yes"; then
  5365. ENABLED_SP=yes
  5366. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_SP_DH"
  5367. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_SP_DH"
  5368. fi
  5369. if test "$ENABLED_SP_RSA" = "yes" || test "$ENABLED_SP_DH" = "yes"; then
  5370. if test "$ENABLED_SP_FF_2048" = "no"; then
  5371. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_2048"
  5372. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_2048"
  5373. fi
  5374. if test "$ENABLED_SP_FF_3072" = "no"; then
  5375. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_3072"
  5376. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_3072"
  5377. fi
  5378. if test "$ENABLED_SP_FF_4096" = "yes"; then
  5379. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_4096"
  5380. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_4096"
  5381. fi
  5382. case $host_cpu in
  5383. *x86_64* | *aarch64*)
  5384. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_LARGE_CODE"
  5385. ;;
  5386. *)
  5387. ;;
  5388. esac
  5389. fi
  5390. if test "$ENABLED_ECC" != "no" && test "$ENABLED_SP_ECC" = "yes"; then
  5391. ENABLED_SP=yes
  5392. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_SP_ECC"
  5393. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_HAVE_SP_ECC"
  5394. if test "$ENABLED_SP_EC_256" = "no"; then
  5395. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_256"
  5396. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_256"
  5397. fi
  5398. if test "$ENABLED_SP_EC_384" = "yes"; then
  5399. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC384 -DWOLFSSL_SP_384"
  5400. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_384"
  5401. fi
  5402. if test "$ENABLED_SP_EC_521" = "yes"; then
  5403. AM_CFLAGS="$AM_CFLAGS -DHAVE_ECC521 -DWOLFSSL_SP_521"
  5404. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_521"
  5405. fi
  5406. if test "$ENABLED_SP_SAKKE_1024" = "yes"; then
  5407. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_1024"
  5408. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_1024"
  5409. fi
  5410. fi
  5411. if test "$ENABLED_SP_SMALL" = "yes"; then
  5412. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_SMALL"
  5413. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_SMALL"
  5414. fi
  5415. if test "$ENABLED_SP_NO_MALLOC" = "yes"; then
  5416. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_MALLOC"
  5417. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NO_MALLOC"
  5418. fi
  5419. if test "$ENABLED_SP_NONBLOCK" = "yes"; then
  5420. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NONBLOCK"
  5421. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_NONBLOCK"
  5422. fi
  5423. # Check that we enable SP with RSA, DH or ECC.
  5424. if test "$ENABLED_SP" = "no"; then
  5425. # Didn't need SP, don't need SP_MATH.
  5426. if test "$ENABLED_SP_MATH" = "yes"; then
  5427. ENABLED_SP_MATH=no
  5428. fi
  5429. fi
  5430. if test "$ENABLED_SP_MATH" = "yes"; then
  5431. if test "$ENABLED_SP" = "no"; then
  5432. AC_MSG_ERROR([Must have SP enabled with SP math: --enable-sp])
  5433. fi
  5434. if test "$ENABLED_ECCCUSTCURVES" = "yes"; then
  5435. AC_MSG_ERROR([Cannot use single precision math and custom curves])
  5436. fi
  5437. if test "$ENABLED_DSA" = "yes"; then
  5438. AC_MSG_ERROR([Cannot use single precision math and DSA])
  5439. fi
  5440. if test "$ENABLED_SRP" = "yes"; then
  5441. AC_MSG_ERROR([Cannot use single precision math and SRP])
  5442. fi
  5443. if test "$ENABLED_SP_RSA" = "no" && test "$ENABLED_RSA" = "yes"; then
  5444. AC_MSG_ERROR([Cannot use RSA single precision only math and RSA])
  5445. fi
  5446. if test "$ENABLED_SP_DH" = "no" && test "$ENABLED_DH" = "yes"; then
  5447. AC_MSG_ERROR([Cannot use DH single precision only math and DH])
  5448. fi
  5449. ENABLED_FASTMATH="no"
  5450. ENABLED_SLOWMATH="no"
  5451. fi
  5452. for v in `echo $ENABLED_SP_MATH_ALL | tr "," " "`
  5453. do
  5454. case $v in
  5455. yes | no)
  5456. ;;
  5457. small)
  5458. ENABLED_SP_MATH_ALL="yes"
  5459. ENABLED_SP_SMALL="yes"
  5460. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_SMALL"
  5461. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_SMALL"
  5462. ;;
  5463. huge)
  5464. ENABLED_SP_MATH_ALL="yes"
  5465. ENABLED_FASTHUGEMATH="yes"
  5466. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  5467. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_INT_LARGE_COMBA"
  5468. ;;
  5469. 256 | 384 | 521 | 1024 | 2048 | 3072 | 4096)
  5470. if test -z "$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS" -o "$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS" -lt "$v"
  5471. then
  5472. DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS="$v"
  5473. fi
  5474. ENABLED_SP_MATH_ALL="yes"
  5475. ;;
  5476. nomalloc)
  5477. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_NO_MALLOC"
  5478. ENABLED_SP_MATH_ALL="yes"
  5479. ;;
  5480. *)
  5481. AC_MSG_ERROR([Support SP int bit sizes: 256, 384, 521, 1024, 2048, 3072, 4096. $ENABLED_SP_MATH_ALL not supported])
  5482. ;;
  5483. esac
  5484. done
  5485. if test "$ENABLED_SP_MATH_ALL" = "yes"; then
  5486. ENABLED_FASTMATH="no"
  5487. ENABLED_SLOWMATH="no"
  5488. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MATH_ALL"
  5489. case $host_cpu in
  5490. *x86_64*)
  5491. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86_64"
  5492. ;;
  5493. *x86*)
  5494. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86"
  5495. ;;
  5496. *aarch64*)
  5497. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM64"
  5498. ;;
  5499. *arm*)
  5500. if test $host_alias = "thumb"; then
  5501. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_THUMB"
  5502. else
  5503. if test $host_alias = "cortex"; then
  5504. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_CORTEX_M"
  5505. else
  5506. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32"
  5507. fi
  5508. fi
  5509. ;;
  5510. *ppc64* | *powerpc64*)
  5511. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_PPC64"
  5512. ;;
  5513. *ppc* | *powerpc*)
  5514. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_PPC"
  5515. ;;
  5516. *mips64*)
  5517. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MIPS64"
  5518. ;;
  5519. *mips*)
  5520. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MIPS"
  5521. ;;
  5522. *riscv32*)
  5523. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_RISCV32"
  5524. ;;
  5525. *riscv64*)
  5526. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_RISCV64"
  5527. ;;
  5528. *s390x*)
  5529. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_S390X"
  5530. ;;
  5531. esac
  5532. fi
  5533. if test "$ENABLED_SP_ASM" = "yes" && test "$ENABLED_SP" = "yes"; then
  5534. if test "$ENABLED_SP_NONBLOCK" = "yes"; then
  5535. AC_MSG_ERROR([SP non-blocking not supported with sp-asm])
  5536. fi
  5537. if test "$ENABLED_ASM" = "no"; then
  5538. AC_MSG_ERROR([Assembly code turned off])
  5539. fi
  5540. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ASM"
  5541. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ASM"
  5542. case $host_cpu in
  5543. *aarch64*)
  5544. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM64_ASM"
  5545. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM64_ASM"
  5546. ENABLED_SP_ARM64_ASM=yes
  5547. ;;
  5548. *arm*)
  5549. if test $host_alias = "thumb"; then
  5550. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_THUMB_ASM"
  5551. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM_THUMB_ASM"
  5552. ENABLED_SP_ARM_THUMB_ASM=yes
  5553. else
  5554. if test $host_alias = "cortex"; then
  5555. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM_CORTEX_M_ASM"
  5556. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM_CORTEX_M_ASM"
  5557. ENABLED_SP_ARM_CORTEX_ASM=yes
  5558. else
  5559. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_ARM32_ASM"
  5560. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_ARM32_ASM"
  5561. ENABLED_SP_ARM32_ASM=yes
  5562. fi
  5563. fi
  5564. ;;
  5565. *x86_64*|*amd64*)
  5566. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_X86_64_ASM"
  5567. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_SP_X86_64_ASM"
  5568. ENABLED_SP_X86_64_ASM=yes
  5569. if test "x$ENABLED_FASTMATH" = "xno"
  5570. then
  5571. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_X86_64_BUILD"
  5572. fi
  5573. ;;
  5574. *)
  5575. AC_MSG_ERROR([ASM not available for CPU. Supported CPUs: x86_64, aarch64, arm])
  5576. ;;
  5577. esac
  5578. fi
  5579. if test "$ENABLED_SP_MATH" = "yes"; then
  5580. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_MATH"
  5581. fi
  5582. ################################################################################
  5583. # End - Single Precision option handling #
  5584. ################################################################################
  5585. # Fast RSA using Intel IPP
  5586. ippdir="${srcdir}/IPP"
  5587. ipplib="lib" # if autoconf guesses 32bit system changes lib directory
  5588. fastRSA_found=no
  5589. abs_path=`pwd`
  5590. # set up variables used
  5591. IPPLIBS=
  5592. IPPHEADERS=
  5593. IPPLINK=
  5594. AC_ARG_ENABLE([fast-rsa],
  5595. [AS_HELP_STRING([--enable-fast-rsa],[Enable RSA using Intel IPP (default: disabled)])],
  5596. [ ENABLED_FAST_RSA=$enableval ],
  5597. [ ENABLED_FAST_RSA=no ],
  5598. )
  5599. # Fast RSA does not support RSA-PSS
  5600. if test "$ENABLED_RSAPSS" = "yes"; then
  5601. ENABLED_FAST_RSA=no
  5602. fi
  5603. if test "$ENABLED_USER_RSA" = "no" && test "$ENABLED_FIPS" = "no"; then
  5604. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  5605. ipplib="lib_32" # 32 bit OS detected
  5606. fi
  5607. # Use static IPP Libraries
  5608. if test "$enable_shared" = "no" && test "$ENABLED_FAST_RSA" = "yes"; then
  5609. case $host_os in
  5610. *darwin*)
  5611. ipplib="$ipplib/mac_static"
  5612. AC_MSG_ERROR([Issue with static linking to libippcp.a on Mac.
  5613. Dynamic IPP libraries supported on Mac])
  5614. break;;
  5615. *linux*)
  5616. ipplib="$ipplib/linux_static"
  5617. break;;
  5618. *)
  5619. ENABLED_FAST_RSA=no
  5620. esac
  5621. if test -e $srcdir/IPP/$ipplib/libippcore.a && test -e $srcdir/IPP/$ipplib/libippcp.a
  5622. then
  5623. :
  5624. else
  5625. ENABLED_FAST_RSA=no
  5626. fi
  5627. AC_CHECK_HEADERS([IPP/include/ipp.h IPP/include/ippcp.h], [AM_CPPFLAGS="-I$srcdir/IPP/include $AM_CPPFLAGS"], [ENABLED_FAST_RSA=no])
  5628. LIB_STATIC_ADD="$srcdir/IPP/$ipplib/libippcp.a $srcdir/IPP/$ipplib/libippcore.a $LIB_STATIC_ADD"
  5629. if test "$ENABLED_FAST_RSA" = "no"; then
  5630. AC_MSG_ERROR([Could not find fast rsa libraries])
  5631. fi
  5632. else
  5633. # Check for and use bundled IPP libraries
  5634. if test "$ENABLED_FAST_RSA" = "yes"; then
  5635. AC_MSG_NOTICE([Using local IPP crypto library])
  5636. AC_CHECK_HEADER([$abs_path/IPP/include/ippcp.h],
  5637. [
  5638. # build and default locations on linux and mac
  5639. STORE_LDFLAGS=${LDFLAGS}
  5640. STORE_CPPFLAGS=${CPPFLAGS}
  5641. # using LDFLAGS instead of AM_ temporarily to test link to library
  5642. LDFLAGS="-L$ippdir/$ipplib -lippcp -lippcore"
  5643. CPPFLAGS="-I$ippdir/include"
  5644. AC_CHECK_HEADERS([ippcp.h], [AC_CHECK_LIB([ippcp], [ippsRSAEncrypt_PKCSv15], [fastRSA_found=yes], [fastRSA_found=no])], [fastRSA_found=no])
  5645. name="$ippdir/$ipplib/libippcp"
  5646. case $host_os in
  5647. *darwin*)
  5648. # check file existence and conditionally set variables
  5649. if test -e $abs_path/IPP/$ipplib/libippcp.dylib
  5650. then
  5651. IPPLIBS="${name}.dylib ${name}-9.0.dylib ${name}e9-9.0.dylib ${name}g9-9.0.dylib ${name}h9-9.0.dylib ${name}k0-9.0.dylib ${name}l9-9.0.dylib ${name}n8-9.0.dylib ${name}p8-9.0.dylib ${name}s8-9.0.dylib ${name}y8-9.0.dylib IPP/lib/libippcore.dylib IPP/lib/libippcore-9.0.dylib"
  5652. IPPLINK="mkdir -p src/.libs && ln -f ${name}.dylib src/.libs/libippcp.dylib && ln -f ${srcdir}/${name}-9.0.dylib src/.libs/libippcp-9.0.dylib && ln -f ${srcdir}/${name}e9-9.0.dylib src/.libs/libippcpe9-9.0.dylib && ln -f ${srcdir}/${name}g9-9.0.dylib src/.libs/libippcpg9-9.0.dylib && ln -f ${srcdir}/${name}h9-9.0.dylib src/.libs/libippcph9-9.0.dylib && ln -f ${srcdir}/${name}k0-9.0.dylib src/.libs/libippcpk0-9.0.dylib && ln -f ${srcdir}/${name}l9-9.0.dylib src/.libs/libippcpl9-9.0.dylib && ln -f ${srcdir}/${name}n8-9.0.dylib src/.libs/libippcpn8-9.0.dylib && ln -f ${srcdir}/${name}p8-9.0.dylib src/.libs/libippcpp8-9.0.dylib && ln -f ${srcdir}/${name}s8-9.0.dylib src/.libs/libippcps8-9.0.dylib && ln -f ${srcdir}/${name}y8-9.0.dylib src/.libs/libippcpy8-9.0.dylib && ln -f ${srcdir}/IPP/lib/libippcore.dylib src/.libs/libippcore.dylib && ln -f ${srcdir}/IPP/lib/libippcore-9.0.dylib src/.libs/libippcore-9.0.dylib"
  5653. else
  5654. fastRSA_found=no
  5655. fi
  5656. break;;
  5657. *linux*)
  5658. # check file existence and conditionally set variables
  5659. if test -e $abs_path/IPP/$ipplib/libippcp.so.9.0
  5660. then
  5661. if test "$ac_cv_sizeof_long" = "4" && test "$ac_cv_sizeof_long_long" = "8"; then
  5662. IPPLIBS="${name}.so.9.0 ${name}g9.so.9.0 ${name}h9.so.9.0 ${name}p8.so.9.0 ${name}px.so.9.0 ${name}s8.so.9.0 ${name}.so ${name}w7.so.9.0 IPP/$ipplib/libippcore.so IPP/$ipplib/libippcore.so.9.0"
  5663. IPPLINK="mkdir -p src/.libs && ln -f ${name}.so.9.0 src/.libs/libippcp.so.9.0 && ln -f ${name}g9.so.9.0 src/.libs/libippcpg9.so.9.0 && ln -f ${name}h9.so.9.0 src/.libs/libippcph9.so.9.0 && ln -f ${name}p8.so.9.0 src/.libs/libippcpp8.so.9.0 && ln -f ${name}px.so.9.0 src/.libs/libippcppx.so.9.0 && ln -f ${name}s8.so.9.0 src/.libs/libippcps8.so.9.0 && ln -f ${name}.so src/.libs/libippcp.so && ln -f ${name}w7.so.9.0 src/.libs/libippcpw7.so.9.0 && ln -f IPP/$ipplib/libippcore.so src/.libs/libippcore.so && ln -f IPP/$ipplib/libippcore.so.9.0 src/.libs/libippcore.so.9.0"
  5664. else
  5665. IPPLIBS="${name}.so.9.0 ${name}e9.so.9.0 ${name}k0.so.9.0 ${name}l9.so.9.0 ${name}m7.so.9.0 ${name}mx.so.9.0 ${name}.so ${name}n8.so.9.0 ${name}y8.so.9.0 IPP/lib/libippcore.so IPP/lib/libippcore.so.9.0"
  5666. IPPLINK="mkdir -p src/.libs && ln -f ${name}.so.9.0 src/.libs/libippcp.so.9.0 && ln -f ${name}e9.so.9.0 src/.libs/libippcpe9.so.9.0 && ln -f ${name}k0.so.9.0 src/.libs/libippcpk0.so.9.0 && ln -f ${name}l9.so.9.0 src/.libs/libippcpl9.so.9.0 && ln -f ${name}m7.so.9.0 src/.libs/libippcpm7.so.9.0 && ln -f ${name}mx.so.9.0 src/.libs/libippcpmx.so.9.0 && ln -f ${name}.so src/.libs/libippcp.so && ln -f ${name}n8.so.9.0 src/.libs/libippcpn8.so.9.0 && ln -f ${name}y8.so.9.0 src/.libs/libippcpy8.so.9.0 && ln -f IPP/lib/libippcore.so src/.libs/libippcore.so && ln -f IPP/lib/libippcore.so.9.0 src/.libs/libippcore.so.9.0"
  5667. fi
  5668. else
  5669. fastRSA_found=no
  5670. fi
  5671. break;;
  5672. *)
  5673. fastRSA_found=no
  5674. esac
  5675. if test "$fastRSA_found" = "yes"; then
  5676. # was succesfull so add tested LDFLAGS to AM_ flags
  5677. AM_LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}"
  5678. AM_CPPFLAGS="${AM_CPPFLAGS} ${CPPFLAGS}"
  5679. IPPHEADERS="${srcdir}/IPP/include/*.h"
  5680. fi
  5681. # restore LDFLAGS to user set
  5682. LDFLAGS=${STORE_LDFLAGS}
  5683. CPPFLAGS=${STORE_CPPFLAGS}
  5684. ], [fastRSA_found=no])
  5685. fi
  5686. # Don't cache the result so it can be checked
  5687. AS_UNSET([ac_cv_header_ippcp_h])
  5688. AS_UNSET([ac_cv_header_ipp_h])
  5689. AS_UNSET([ac_cv_lib_ippcp_ippsRSAEncrypt_PKCSv15]);
  5690. # Check link and see if user has pre-existing IPP Libraries if not using local
  5691. if test "$ENABLED_FAST_RSA" = "yes" && test "$fastRSA_found" = "no"; then
  5692. AC_MSG_NOTICE([Checking if IPP crypto library installed])
  5693. AC_CHECK_HEADER([ippcp.h], [AC_CHECK_LIB([ippcp], [ippsRSAEncrypt_PKCSv15],
  5694. [
  5695. fastRSA_found=yes
  5696. AM_LDFLAGS="${AM_LDFLAGS} -lippcore -lippcp"
  5697. ], [ fastRSA_found=no])
  5698. ], [fastRSA_found=no])
  5699. # Error out on not finding libraries
  5700. if test "$fastRSA_found" = "no"; then
  5701. AC_MSG_ERROR([Could not find fast rsa libraries])
  5702. fi
  5703. fi
  5704. fi # end of if for shared library
  5705. else # if user rsa is set than do not use fast rsa option
  5706. if test "$ENABLED_FAST_RSA" = "yes"; then
  5707. AC_MSG_ERROR([Could not use fast rsa libraries with user crypto or fips])
  5708. fi
  5709. fi # end of if for user rsa crypto or fips
  5710. # End result of checking for IPP Libraries
  5711. AC_MSG_CHECKING([for fast RSA])
  5712. if test "$ENABLED_FAST_RSA" = "yes"; then
  5713. AM_CFLAGS="$AM_CFLAGS -DHAVE_FAST_RSA -DHAVE_USER_RSA"
  5714. # add in user crypto header that uses Intel IPP
  5715. AM_CPPFLAGS="$AM_CPPFLAGS -I$srcdir/wolfcrypt/user-crypto/include"
  5716. if test "$enable_shared" = "yes"; then
  5717. LIBS="$LIBS -lippcore -lippcp"
  5718. LIB_ADD="-lippcp -lippcore $LIB_ADD"
  5719. else
  5720. LIB_ADD="$srcdir/IPP/$ipplib/libippcp.a $srcdir/IPP/$ipplib/libippcore.a $LIB_ADD"
  5721. fi
  5722. AC_MSG_RESULT([yes])
  5723. else
  5724. AC_MSG_RESULT([no])
  5725. fi
  5726. AC_SUBST([IPPLIBS])
  5727. AC_SUBST([IPPHEADERS])
  5728. AC_SUBST([IPPLINK])
  5729. # static memory use
  5730. AC_ARG_ENABLE([staticmemory],
  5731. [AS_HELP_STRING([--enable-staticmemory],[Enable static memory use (default: disabled)])],
  5732. [ ENABLED_STATICMEMORY=$enableval ],
  5733. [ ENABLED_STATICMEMORY=no ]
  5734. )
  5735. if test "x$ENABLED_STATICMEMORY" = "xyes"
  5736. then
  5737. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC_MEMORY"
  5738. if test "$ENABLED_LOWRESOURCE" = "yes" && test "$ENABLED_RSA" = "no"
  5739. then
  5740. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_STATIC_MEMORY_SMALL"
  5741. fi
  5742. fi
  5743. # microchip api
  5744. AC_ARG_ENABLE([mcapi],
  5745. [AS_HELP_STRING([--enable-mcapi],[Enable Microchip API (default: disabled)])],
  5746. [ ENABLED_MCAPI=$enableval ],
  5747. [ ENABLED_MCAPI=no ]
  5748. )
  5749. if test "$ENABLED_MCAPI" = "yes"
  5750. then
  5751. AM_CFLAGS="$AM_CFLAGS -DHAVE_MCAPI"
  5752. if test "x$ENABLED_AESCTR" != "xyes"
  5753. then
  5754. # These flags are already implied by --enable-aesctr
  5755. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"
  5756. fi
  5757. if test "x$ENABLED_AESGCM" != "xyes" && test "x$ENABLED_AESGCM" != "xno"
  5758. then
  5759. # Use the smaller object size implementation
  5760. ENABLED_AESGCM=yes
  5761. fi
  5762. fi
  5763. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_SHA512" = "no"
  5764. then
  5765. AC_MSG_ERROR([please enable sha512 if enabling mcapi.])
  5766. fi
  5767. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_ECC" = "no"
  5768. then
  5769. AC_MSG_ERROR([please enable ecc if enabling mcapi.])
  5770. fi
  5771. if test "$ENABLED_MCAPI" = "yes" && test "$ENABLED_LIBZ" = "no"
  5772. then
  5773. AC_MSG_ERROR([please use --with-libz if enabling mcapi.])
  5774. fi
  5775. # Asynchronous Crypto
  5776. AC_ARG_ENABLE([asynccrypt],
  5777. [AS_HELP_STRING([--enable-asynccrypt],[Enable Asynchronous Crypto (default: disabled)])],
  5778. [ ENABLED_ASYNCCRYPT=$enableval ],
  5779. [ ENABLED_ASYNCCRYPT=no ]
  5780. )
  5781. if test "$ENABLED_ASYNCCRYPT" = "yes"
  5782. then
  5783. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT -DHAVE_WOLF_EVENT -DHAVE_WOLF_BIGINT -DWOLFSSL_NO_HASH_RAW"
  5784. # if no async hardware then use simulator for testing
  5785. if test "x$ENABLED_CAVIUM" = "xno" && test "x$ENABLED_INTEL_QA" = "xno"
  5786. then
  5787. # Async threading is Linux specific
  5788. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ASYNC_CRYPT_TEST"
  5789. fi
  5790. fi
  5791. # check for async if using Intel QuckAssist or Cavium
  5792. if test "x$ENABLED_INTEL_QA" = "xyes" || test "x$ENABLED_CAVIUM" = "xyes" ; then
  5793. if test "x$ENABLED_ASYNCCRYPT" = "xno" ; then
  5794. AC_MSG_ERROR([Please enable asynchronous support using --enable-asynccrypt])
  5795. fi
  5796. fi
  5797. # Asynchronous threading
  5798. AC_ARG_ENABLE([asyncthreads],
  5799. [AS_HELP_STRING([--enable-asyncthreads],[Enable Asynchronous Threading (default: enabled)])],
  5800. [ ENABLED_ASYNCTHREADS=$enableval ],
  5801. [ ENABLED_ASYNCTHREADS=yes ]
  5802. )
  5803. if test "$ENABLED_ASYNCCRYPT" = "yes" && test "$ENABLED_ASYNCTHREADS" = "yes"
  5804. then
  5805. AX_PTHREAD([ENABLED_ASYNCTHREADS=yes],[ENABLED_ASYNCTHREADS=no])
  5806. else
  5807. ENABLED_ASYNCTHREADS=no
  5808. fi
  5809. if test "$ENABLED_ASYNCTHREADS" = "yes"
  5810. then
  5811. LIB_ADD="-lpthread $LIB_ADD"
  5812. AM_CFLAGS="$AM_CFLAGS -D_GNU_SOURCE"
  5813. else
  5814. AM_CFLAGS="$AM_CFLAGS -DWC_NO_ASYNC_THREADING"
  5815. fi
  5816. # cryptodev is old name, replaced with cryptocb
  5817. AC_ARG_ENABLE([cryptodev],
  5818. [AS_HELP_STRING([--enable-cryptodev],[DEPRECATED, use cryptocb instead])],
  5819. [ ENABLED_CRYPTOCB=$enableval ],[ ENABLED_CRYPTOCB=no ])
  5820. # Support for crypto callbacks
  5821. AC_ARG_ENABLE([cryptocb],
  5822. [AS_HELP_STRING([--enable-cryptocb],[Enable crypto callbacks (default: disabled)])],
  5823. [ ENABLED_CRYPTOCB=$enableval ],
  5824. [ ENABLED_CRYPTOCB=no ]
  5825. )
  5826. if test "x$ENABLED_PKCS11" = "xyes" || test "x$ENABLED_WOLFTPM" = "xyes" || test "$ENABLED_CAAM" = "qnx" || test "$ENABLED_CAAM" = "seco"
  5827. then
  5828. ENABLED_CRYPTOCB=yes
  5829. fi
  5830. if test "$ENABLED_CRYPTOCB" = "yes"
  5831. then
  5832. AM_CFLAGS="$AM_CFLAGS -DWOLF_CRYPTO_CB"
  5833. fi
  5834. # Session Export
  5835. AC_ARG_ENABLE([sessionexport],
  5836. [AS_HELP_STRING([--enable-sessionexport],[Enable export and import of sessions (default: disabled)])],
  5837. [ ENABLED_SESSIONEXPORT=$enableval ],
  5838. [ ENABLED_SESSIONEXPORT=no ]
  5839. )
  5840. if test "$ENABLED_SESSIONEXPORT" = "yes" ||
  5841. test "$ENABLED_SESSIONEXPORT" = "nopeer"
  5842. then
  5843. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SESSION_EXPORT"
  5844. if test "$ENABLED_SESSIONEXPORT" = "nopeer"
  5845. then
  5846. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SESSION_EXPORT_NOPEER"
  5847. fi
  5848. fi
  5849. # AES key wrap
  5850. AC_ARG_ENABLE([aeskeywrap],
  5851. [AS_HELP_STRING([--enable-aeskeywrap],[Enable AES key wrap support (default: disabled)])],
  5852. [ ENABLED_AESKEYWRAP=$enableval ],
  5853. [ ENABLED_AESKEYWRAP=no ]
  5854. )
  5855. if test "$ENABLED_WPAS" != "no" && test "$ENABLED_FIPS" = "no"
  5856. then
  5857. ENABLED_AESKEYWRAP="yes"
  5858. fi
  5859. if test "$ENABLED_AESKEYWRAP" = "yes"
  5860. then
  5861. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP -DWOLFSSL_AES_DIRECT"
  5862. fi
  5863. # Old name support for backwards compatibility
  5864. AC_ARG_ENABLE([oldnames],
  5865. [AS_HELP_STRING([--enable-oldnames],[Keep backwards compat with old names (default: enabled)])],
  5866. [ ENABLED_OLDNAMES=$enableval ],
  5867. [ ENABLED_OLDNAMES=yes ]
  5868. )
  5869. if test "x$ENABLED_OLDNAMES" = "xno" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  5870. then
  5871. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_RNGNAME -DNO_OLD_WC_NAMES -DNO_OLD_SSL_NAMES"
  5872. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA_NAMES -DNO_OLD_MD5_NAME"
  5873. fi
  5874. # Memory Tests
  5875. AC_ARG_ENABLE([memtest],
  5876. [AS_HELP_STRING([--enable-memtest],[Memory testing option, for internal use (default: disabled)])],
  5877. [ ENABLED_MEMTEST=$enableval ],
  5878. [ ENABLED_MEMTEST=no ]
  5879. )
  5880. if test "x$ENABLED_MEMTEST" != "xno"
  5881. then
  5882. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRACK_MEMORY -DWOLFSSL_DEBUG_MEMORY"
  5883. fi
  5884. if test "x$ENABLED_MEMTEST" = "xfail"
  5885. then
  5886. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_FORCE_MALLOC_FAIL_TEST"
  5887. fi
  5888. # Enable hash flags support
  5889. # Hash flags are useful for runtime options such as SHA3 KECCAK256 selection
  5890. AC_ARG_ENABLE([hashflags],
  5891. [AS_HELP_STRING([--enable-hashflags],[Enable support for hash flags (default: disabled)])],
  5892. [ ENABLED_HASHFLAGS=$enableval ],
  5893. [ ENABLED_HASHFLAGS=no ]
  5894. )
  5895. if test "x$ENABLED_HASHFLAGS" != "xno"
  5896. then
  5897. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HASH_FLAGS"
  5898. fi
  5899. # Support for enabling setting default DH parameters in
  5900. AC_ARG_ENABLE([defaultdhparams],
  5901. [AS_HELP_STRING([--enable-dhdefaultparams],[Enables option for default dh parameters (default: disabled)])],
  5902. [ ENABLED_DHDEFAULTPARAMS=$enableval ],
  5903. [ ENABLED_DHDEFAULTPARAMS=no ]
  5904. )
  5905. if test "$ENABLED_DHDEFAULTPARAMS" = "yes" || test "$ENABLED_QT" = "no"
  5906. then
  5907. ENABLED_DHDEFAULTPARAMS=yes
  5908. AM_CFLAGS="$AM_CFLAGS -DHAVE_DH_DEFAULT_PARAMS"
  5909. fi
  5910. AC_ARG_WITH([max-rsa-bits],
  5911. [AS_HELP_STRING([--with-max-rsa-bits=number],[number of bits to support for RSA, DH, and DSA keys])],
  5912. [WITH_MAX_CLASSIC_ASYM_KEY_BITS=$withval],
  5913. [WITH_MAX_CLASSIC_ASYM_KEY_BITS="$DEFAULT_MAX_CLASSIC_ASYM_KEY_BITS"])
  5914. if test -n "$WITH_MAX_CLASSIC_ASYM_KEY_BITS"; then
  5915. if test "$WITH_MAX_CLASSIC_ASYM_KEY_BITS" -lt 1024 -o "$WITH_MAX_CLASSIC_ASYM_KEY_BITS" -gt 16384; then
  5916. AC_MSG_ERROR([--with-max-rsa-bits argument must be between 1024 and 16384 inclusive])
  5917. fi
  5918. if test "$ENABLED_FIPS" = "no"
  5919. then
  5920. AM_CFLAGS="$AM_CFLAGS -DRSA_MAX_SIZE=$WITH_MAX_CLASSIC_ASYM_KEY_BITS"
  5921. fi
  5922. MPI_MAX_KEY_BITS=$WITH_MAX_CLASSIC_ASYM_KEY_BITS
  5923. fi
  5924. AC_ARG_WITH([max-ecc-bits],
  5925. [AS_HELP_STRING([--with-max-ecc-bits=number],[number of bits to support for ECC algorithms])],
  5926. [WITH_MAX_ECC_BITS=$withval],
  5927. [WITH_MAX_ECC_BITS="$DEFAULT_MAX_ECC_BITS"])
  5928. if test -n "$WITH_MAX_ECC_BITS"; then
  5929. if test "$WITH_MAX_ECC_BITS" -lt 112 -o "$WITH_MAX_ECC_BITS" -gt 1024; then
  5930. AC_MSG_ERROR([--with-max-ecc-bits argument must be between 112 and 1024 inclusive])
  5931. fi
  5932. AM_CFLAGS="$AM_CFLAGS -DMAX_ECC_BITS=$WITH_MAX_ECC_BITS"
  5933. fi
  5934. if test -n "$MPI_MAX_KEY_BITS" -o -n "$WITH_MAX_ECC_BITS"; then
  5935. if test -n "$MAX_MPI_KEY_BITS" -a -n "$WITH_MAX_ECC_BITS"; then
  5936. if test -n "$MAX_MPI_KEY_BITS" -lt "$WITH_MAX_ECC_BITS"; then
  5937. MPI_MAX_KEY_BITS="$WITH_MAX_ECC_BITS"
  5938. fi
  5939. elif test -n "$WITH_MAX_ECC_BITS"; then
  5940. MPI_MAX_KEY_BITS="$WITH_MAX_ECC_BITS"
  5941. fi
  5942. if test "$MPI_MAX_KEY_BITS" -gt 1024; then
  5943. AM_CFLAGS="$AM_CFLAGS -DFP_MAX_BITS=$((MPI_MAX_KEY_BITS * 2)) -DSP_INT_BITS=$MPI_MAX_KEY_BITS"
  5944. fi
  5945. fi
  5946. AC_ARG_ENABLE([context-extra-user-data],
  5947. [AS_HELP_STRING([--enable-context-extra-user-data],[Enables option for storing user-defined data in TLS API contexts, with optional argument the number of slots to allocate (default: disabled)])],
  5948. [ ENABLED_EX_DATA=$enableval ],
  5949. [ ENABLED_EX_DATA=no ]
  5950. )
  5951. case "$ENABLED_EX_DATA" in
  5952. no) ;;
  5953. yes) AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA"
  5954. ;;
  5955. [[1-9]]|[[1-9]][[0-9]]) AM_CFLAGS="$AM_CFLAGS -DHAVE_EX_DATA -DMAX_EX_DATA=$ENABLED_EX_DATA"
  5956. ;;
  5957. *) AC_MSG_ERROR([Invalid argument to --enable-context-extra-user-data -- must be yes, no, or a number from 1 to 99])
  5958. ;;
  5959. esac
  5960. # IoT-Safe support
  5961. AC_ARG_ENABLE([iotsafe],
  5962. [AS_HELP_STRING([--enable-iotsafe],[Enables support for IoT-Safe secure applet (default: disabled)])],
  5963. [ ENABLED_IOTSAFE=$enableval ],
  5964. [ ENABLED_IOTSAFE=no ]
  5965. )
  5966. AC_ARG_ENABLE([iotsafe-hwrng],
  5967. [AS_HELP_STRING([--enable-iotsafe-hwrng],[Enables support for IoT-Safe RNG (default: disabled)])],
  5968. [ ENABLED_IOTSAFE_HWRNG=$enableval ],
  5969. [ ENABLED_IOTSAFE_HWRNG=no ]
  5970. )
  5971. # Make clean
  5972. AC_ARG_ENABLE([makeclean],
  5973. [AS_HELP_STRING([--enable-makeclean], [Enables forced "make clean" at the
  5974. end of configure (default: enabled)])],
  5975. [ ENABLED_MAKECLEAN=$enableval ],
  5976. [ ENABLED_MAKECLEAN=yes ]
  5977. )
  5978. # User Settings
  5979. AC_ARG_ENABLE([usersettings],
  5980. [AS_HELP_STRING([--enable-usersettings],[Use your own user_settings.h and do not add Makefile CFLAGS (default: disabled)])],
  5981. [ ENABLED_USERSETTINGS=$enableval ],
  5982. [ ENABLED_USERSETTINGS=no ]
  5983. )
  5984. # Default optimization CFLAGS enable
  5985. AC_ARG_ENABLE([optflags],
  5986. [AS_HELP_STRING([--enable-optflags],[Enable default optimization CFLAGS for the compiler (default: enabled)])],
  5987. [ ENABLED_OPTFLAGS=$enableval ],
  5988. [ ENABLED_OPTFLAGS=yes ]
  5989. )
  5990. # check if should run the trusted peer certs test
  5991. # (for now checking both C_FLAGS and C_EXTRA_FLAGS)
  5992. AS_CASE(["$CFLAGS $CPPFLAGS"],[*'WOLFSSL_TRUST_PEER_CERT'*],[ENABLED_TRUSTED_PEER_CERT=yes])
  5993. AS_CASE(["$CFLAGS $CPPFLAGS $AM_CFLAGS"],[*'OPENSSL_COMPATIBLE_DEFAULTS'*],
  5994. [ENABLED_OPENSSL_COMPATIBLE_DEFAULTS=yes])
  5995. if test "x$ENABLED_OPENSSL_COMPATIBLE_DEFAULTS" = "xyes"
  5996. then
  5997. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TRUST_PEER_CERT"
  5998. AM_CFLAGS="$AM_CFLAGS -DNO_SESSION_CACHE_REF"
  5999. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_TLS13_NO_PEEK_HANDSHAKE_DONE"
  6000. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_CERT_CHAINS"
  6001. ENABLED_TRUSTED_PEER_CERT=yes
  6002. fi
  6003. # dertermine if we have key validation mechanism
  6004. if test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_RSA" = "xyes"
  6005. then
  6006. if test "x$ENABLED_ASN" = "xyes"
  6007. then
  6008. ENABLED_PKI="yes"
  6009. fi
  6010. fi
  6011. # When building for wolfRand, strip out all options to disable everything.
  6012. AS_IF([test "x$ENABLED_FIPS" = "xyes" && test "x$FIPS_VERSION" = "xrand"],
  6013. [NEW_AM_CFLAGS="-DNO_AES -DNO_DH -DNO_ASN -DNO_RSA -DNO_SHA -DNO_MD5 -DNO_BIG_INT"
  6014. for v in $AM_CFLAGS
  6015. do
  6016. case $v in
  6017. -DHAVE_FFDHE_2048 | -DTFM_TIMING_RESISTANT | -DECC_TIMING_RESISTANT | \
  6018. -DWC_RSA_BLINDING | -DHAVE_AESGCM | -DWOLFSSL_SHA512 | -DWOLFSSL_SHA384 | \
  6019. -DHAVE_ECC | -DTFM_ECC256 | -DECC_SHAMIR | -DHAVE_TLS_EXTENSIONS | \
  6020. -DHAVE_SUPPORTED_CURVES | -DHAVE_EXTENDED_MASTER | -DUSE_FAST_MATH | \
  6021. -DWOLFSSL_SHA3)
  6022. AS_ECHO(["ignoring $v"])
  6023. ;;
  6024. *)
  6025. NEW_AM_CFLAGS="$NEW_AM_CFLAGS $v"
  6026. ;;
  6027. esac
  6028. done
  6029. AM_CFLAGS=$NEW_AM_CFLAGS])
  6030. case $host_cpu in
  6031. *arm*)
  6032. if test $host_alias = "thumb"; then
  6033. AM_CFLAGS="$AM_CFLAGS -mthumb -march=armv6"
  6034. else
  6035. if test $host_alias = "cortex"; then
  6036. AM_CFLAGS="$AM_CFLAGS -mcpu=cortex-r5"
  6037. fi
  6038. fi
  6039. ;;
  6040. esac
  6041. ################################################################################
  6042. # Update ENABLE_* variables #
  6043. ################################################################################
  6044. if test "x$ENABLED_WOLFCLU" = "xyes"
  6045. then
  6046. if test "x$ENABLED_CERTGEN" = "xno"
  6047. then
  6048. ENABLED_CERTGEN="yes"
  6049. fi
  6050. if test "x$ENABLED_CERTREQ" = "xno"
  6051. then
  6052. ENABLED_CERTREQ="yes"
  6053. fi
  6054. if test "x$ENABLED_CERTEXT" = "xno"
  6055. then
  6056. ENABLED_CERTEXT="yes"
  6057. fi
  6058. # Requires md5
  6059. if test "$ENABLED_MD5" = "no"
  6060. then
  6061. ENABLED_MD5="yes"
  6062. fi
  6063. # Requires aesctr
  6064. if test "x$ENABLED_AESCTR" = "xno"
  6065. then
  6066. ENABLED_AESCTR="yes"
  6067. fi
  6068. # Uses key generation
  6069. if test "x$ENABLED_KEYGEN" = "xno"
  6070. then
  6071. ENABLED_KEYGEN="yes"
  6072. fi
  6073. # Uses functions guarded by opensslall
  6074. if test "$ENABLED_OPENSSLALL" = "no"
  6075. then
  6076. ENABLED_OPENSSLALL="yes"
  6077. fi
  6078. # Has option for signing with ED25519
  6079. if test "$ENABLED_ED25519" = "no"
  6080. then
  6081. ENABLED_ED25519=yes
  6082. ENABLED_FEMATH=yes
  6083. ENABLED_GEMATH=yes
  6084. ENABLED_CERTS=yes
  6085. fi
  6086. # Has sha512 hashing
  6087. if test "$ENABLED_SHA512" = "no"
  6088. then
  6089. ENABLED_SHA512="yes"
  6090. fi
  6091. # Has support for DES3 encrypt/decrypt
  6092. if test "$ENABLED_DES3" = "no"
  6093. then
  6094. ENABLED_DES3="yes"
  6095. fi
  6096. # Uses alt name
  6097. ENABLED_ALTNAMES="yes"
  6098. fi
  6099. AS_IF([test "x$ENABLED_MCAPI" = "xyes"],
  6100. [AS_IF([test "x$ENABLED_DES3" = "xno"],[ENABLED_DES3="yes"])])
  6101. if test "$ENABLED_OPENSSH" = "yes" || test "$ENABLED_NGINX" = "yes" || \
  6102. test "$ENABLED_SIGNAL" = "yes" || test "$ENABLED_WPAS" = "yes" || \
  6103. test "$ENABLED_FORTRESS" = "yes" || test "$ENABLED_BUMP" = "yes" || \
  6104. test "$ENABLED_OPENSSLALL" = "yes" || \
  6105. test "$ENABLED_LIBWEBSOCKETS" = "yes" || \
  6106. test "x$ENABLED_LIGHTY" = "xyes" || test "$ENABLED_LIBSSH2" = "yes" || \
  6107. test "x$ENABLED_NTP" = "xyes" || test "$ENABLED_RSYSLOG" = "yes"
  6108. then
  6109. ENABLED_OPENSSLEXTRA="yes"
  6110. fi
  6111. if test "$ENABLED_ED25519" != "no" && test "$ENABLED_32BIT" = "no"
  6112. then
  6113. if test "$ENABLED_ED25519" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  6114. then
  6115. ENABLED_ED25519_SMALL=yes
  6116. ENABLED_CURVE25519_SMALL=yes
  6117. ENABLED_ED25519=yes
  6118. fi
  6119. ENABLED_FEMATH=yes
  6120. ENABLED_GEMATH=yes
  6121. ENABLED_CERTS=yes
  6122. fi
  6123. if test "$ENABLED_MD5" = "yes"
  6124. then
  6125. # turn off MD5 if leanpsk or leantls on
  6126. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  6127. then
  6128. ENABLED_MD5=no
  6129. fi
  6130. fi
  6131. ################################################################################
  6132. # Check for build-type conflicts #
  6133. ################################################################################
  6134. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  6135. test "x$ENABLED_LEANPSK" = "xyes"],
  6136. [AC_MSG_ERROR([Cannot use Max Strength and Lean PSK at the same time.])])
  6137. AS_IF([test "x$ENABLED_OCSP" = "xyes" && \
  6138. test "x$ENABLED_ASN" = "xno"],
  6139. [AC_MSG_ERROR([please enable asn if enabling ocsp.])])
  6140. AS_IF([test "x$ENABLED_SMIME" = "xyes" && \
  6141. test "x$ENABLED_ASN" = "xno"],
  6142. [AC_MSG_ERROR([please enable asn if enabling S/MIME.])])
  6143. AS_IF([test "x$ENABLED_OCSP" = "xyes" && \
  6144. test "x$ENABLED_RSA" = "xno" && \
  6145. test "x$ENABLED_ECC" = "xno"],
  6146. [AC_MSG_ERROR([please enable rsa or ecc if enabling ocsp.])])
  6147. # Sync Intel QA and Sync Cavium Octeon require the crypto callback
  6148. AS_IF([test "x$ENABLED_INTEL_QA_SYNC" = "xyes" || test "x$ENABLED_OCTEON_SYNC" = "xyes"],
  6149. [AS_IF([test "x$ENABLED_CRYPTOCB" = "xno"],
  6150. [AC_MSG_ERROR([please enable the crypto callback support using --enable-cryptocb])])])
  6151. # checks for pkcs7 needed enables
  6152. AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
  6153. test "x$ENABLED_RSA" = "xno" && \
  6154. test "x$ENABLED_ECC" = "xno"],
  6155. [AC_MSG_ERROR([please enable ecc or rsa if enabling pkcs7.])])
  6156. AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
  6157. test "x$ENABLED_SHA" = "xno"],
  6158. [AC_MSG_ERROR([please enable sha if enabling pkcs7.])])
  6159. AS_IF([test "x$ENABLED_PKCS7" = "xyes" && \
  6160. test "x$ENABLED_AES" = "xno" && \
  6161. test "x$ENABLED_DES3" = "xno"],
  6162. [AC_MSG_ERROR([please enable either AES or 3DES if enabling pkcs7.])])
  6163. AS_IF([test "x$ENABLED_WOLFSCEP" = "xyes" && \
  6164. test "x$ENABLED_AES" = "xno" && \
  6165. test "x$ENABLED_DES3" = "xno"],
  6166. [AC_MSG_ERROR([please enable either AES or 3DES if enabling scep.])])
  6167. AS_IF([test "x$ENABLED_LEANTLS" = "xyes" && \
  6168. test "x$ENABLED_ECC" = "xno"],
  6169. [AC_MSG_ERROR([please enable ecc if enabling leantls.])])
  6170. AS_IF([test "x$ENABLED_SNIFFER" = "xyes" && \
  6171. test "x$ENABLED_RSA" = "xno" && \
  6172. test "x$ENABLED_ECC" = "xno" && \
  6173. test "x$ENABLED_CURVE25519" = "xno"],
  6174. [AC_MSG_ERROR([please enable ecc, rsa or curve25519 if enabling sniffer.])])
  6175. # Lean TLS forces off prereqs of SCEP.
  6176. AS_IF([test "x$ENABLED_SCEP" = "xyes" && \
  6177. test "x$ENABLED_LEANTLS" = "xyes"],
  6178. [AC_MSG_ERROR([Cannot use SCEP and Lean TLS at the same time.])])
  6179. # CMAC currently requires AES.
  6180. AS_IF([test "x$ENABLED_CMAC" = "xyes" && \
  6181. test "x$ENABLED_AES" = "xno"],
  6182. [AC_MSG_ERROR([cannot use CMAC without AES.])])
  6183. # certreq requires certgen
  6184. AS_IF([test "x$ENABLED_CERT_REQ" = "xyes" && \
  6185. test "x$ENABLED_CERT_GEN" = "xno"],
  6186. [AC_MSG_ERROR([cannot use certreq without certgen.])])
  6187. # ed25519 requires sha512
  6188. AS_IF([test "x$ENABLED_ED25519" = "xyes" && \
  6189. test "x$ENABLED_SHA512" = "xno" && \
  6190. test "x$ENABLED_32BIT" = "xno"],
  6191. [AC_MSG_ERROR([cannot enable ed25519 without enabling sha512.])])
  6192. # ed25519 stream requires ed25519
  6193. AS_IF([test "x$ENABLED_ED25519_STREAM" = "xyes" && \
  6194. test "x$ENABLED_ED25519" = "xno"],
  6195. [AC_MSG_ERROR([ED25519 verify streaming enabled but ED25519 is disabled])])
  6196. # Ensure only one size is enabled
  6197. AS_IF([test "x$ENABLED_64BIT" = "xyes" && \
  6198. test "x$ENABLED_32BIT" = "xyes"],
  6199. [AC_MSG_ERROR([cannot specify 64-bit build and 32-bit build.])])
  6200. AS_IF([test "x$ENABLED_64BIT" = "xyes" && \
  6201. test "x$ENABLED_16BIT" = "xyes"],
  6202. [AC_MSG_ERROR([cannot specify 64-bit build and 16-bit build.])])
  6203. AS_IF([test "x$ENABLED_32BIT" = "xyes" && \
  6204. test "x$ENABLED_16BIT" = "xyes"],
  6205. [AC_MSG_ERROR([cannot specify 32-bit build and 16-bit build.])])
  6206. # 16-bit build not supported with SP
  6207. AS_IF([test "x$ENABLED_16BIT" = "xyes" && \
  6208. test "x$ENABLED_SP" = "xyes"],
  6209. [AC_MSG_ERROR([16-bit build not available with SP.])])
  6210. ################################################################################
  6211. # Update CFLAGS based on options #
  6212. ################################################################################
  6213. AS_IF([test "x$ENABLED_ALTNAMES" = "xyes"],
  6214. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALT_NAMES"])
  6215. AS_IF([test "x$ENABLED_KEYGEN" = "xyes"],
  6216. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"])
  6217. AS_IF([test "x$ENABLED_CERTREQ" = "xyes"],
  6218. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"])
  6219. AS_IF([test "x$ENABLED_CERTGEN" = "xyes"],
  6220. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"])
  6221. AS_IF([test "x$ENABLED_CERTEXT" = "xyes"],
  6222. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"])
  6223. AS_IF([test "x$ENABLED_ED25519" = "xyes" && test "x$ENABLED_32BIT" = "xno"],
  6224. [AM_CFLAGS="$AM_CFLAGS -DHAVE_ED25519"])
  6225. AS_IF([test "x$ENABLED_ED25519_SMALL" = "xyes"],
  6226. [AM_CFLAGS="$AM_CFLAGS -DED25519_SMALL"])
  6227. if test "$ENABLED_ED25519_STREAM" != "no"
  6228. then
  6229. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ED25519_STREAMING_VERIFY"
  6230. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_ED25519_STREAMING_VERIFY"
  6231. fi
  6232. if test "$ENABLED_ERROR_QUEUE" = "no" || test "$ENABLED_JNI" = "yes"
  6233. then
  6234. AM_CFLAGS="$AM_CFLAGS -DNO_ERROR_QUEUE"
  6235. fi
  6236. AS_IF([test "x$ENABLED_OPENSSLALL" = "xyes"],
  6237. [AM_CFLAGS="$AM_CFLAGS -DOPENSSL_ALL -DWOLFSSL_EITHER_SIDE -DWC_RSA_NO_PADDING -DWC_RSA_PSS -DWOLFSSL_PSS_LONG_SALT -DWOLFSSL_TICKET_HAVE_ID -DWOLFSSL_ERROR_CODE_OPENSSL"])
  6238. AS_IF([test "x$ENABLED_AESSIV" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_SIV"])
  6239. AS_IF([test "x$ENABLED_AESCTR" = "xyes" && test "x$ENABLED_FORTRESS" != "xyes"],
  6240. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT"])
  6241. if test "$ENABLED_MD5" = "no"
  6242. then
  6243. AM_CFLAGS="$AM_CFLAGS -DNO_MD5 -DNO_OLD_TLS"
  6244. fi
  6245. if test "$ENABLED_HMAC" = "no"
  6246. then
  6247. AM_CFLAGS="$AM_CFLAGS -DNO_HMAC"
  6248. fi
  6249. if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
  6250. then
  6251. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DWOLFSSL_ALWAYS_VERIFY_CB"
  6252. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VERIFY_CB_ALL_CERTS -DWOLFSSL_EXTRA_ALERTS"
  6253. AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE -DWOLFSSL_FORCE_CACHE_ON_TICKET"
  6254. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AKID_NAME -DHAVE_CTS"
  6255. fi
  6256. if test "$ENABLED_OPENSSLEXTRA" = "x509small"
  6257. then
  6258. AC_MSG_NOTICE([Enabling only a subset of X509 opensslextra])
  6259. AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
  6260. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EKU_OID -DWOLFSSL_MULTI_ATTRIB"
  6261. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_OPENSSL_RAND_CB"
  6262. fi
  6263. if test "$ENABLED_WOLFSCEP" = "yes"
  6264. then
  6265. # Enable prereqs if not already enabled
  6266. if test "x$ENABLED_KEYGEN" = "xno"
  6267. then
  6268. ENABLED_KEYGEN="yes"
  6269. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KEY_GEN"
  6270. fi
  6271. if test "x$ENABLED_CERTGEN" = "xno"
  6272. then
  6273. ENABLED_CERTGEN="yes"
  6274. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_GEN"
  6275. fi
  6276. if test "x$ENABLED_CERTREQ" = "xno"
  6277. then
  6278. ENABLED_CERTREQ="yes"
  6279. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_REQ"
  6280. fi
  6281. if test "x$ENABLED_CERTEXT" = "xno"
  6282. then
  6283. ENABLED_CERTEXT="yes"
  6284. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_CERT_EXT"
  6285. fi
  6286. if test "x$ENABLED_PKCS7" = "xno"
  6287. then
  6288. ENABLED_PKCS7="yes"
  6289. fi
  6290. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_WOLFSCEP"
  6291. fi
  6292. if test "x$ENABLED_PKCS7" = "xyes"
  6293. then
  6294. AM_CFLAGS="$AM_CFLAGS -DHAVE_PKCS7"
  6295. # Enable prereqs if not already enabled
  6296. if test "x$ENABLED_AESKEYWRAP" = "xno"
  6297. then
  6298. ENABLED_AESKEYWRAP="yes"
  6299. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_KEYWRAP -DWOLFSSL_AES_DIRECT"
  6300. fi
  6301. if test "x$ENABLED_X963KDF" = "xno" && test "$ENABLED_ECC" != "no"
  6302. then
  6303. ENABLED_X963KDF="yes"
  6304. AM_CFLAGS="$AM_CFLAGS -DHAVE_X963_KDF"
  6305. fi
  6306. fi
  6307. if test "x$ENABLED_DES3" = "xno"
  6308. then
  6309. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  6310. else
  6311. # turn off DES3 if leanpsk or leantls on
  6312. if test "$ENABLED_LEANPSK" = "yes" || test "$ENABLED_LEANTLS" = "yes"
  6313. then
  6314. AM_CFLAGS="$AM_CFLAGS -DNO_DES3"
  6315. ENABLED_DES3=no
  6316. fi
  6317. fi
  6318. if test "$ENABLED_AESGCM" != "no"
  6319. then
  6320. if test "$ENABLED_AESGCM" = "word"
  6321. then
  6322. ENABLED_AESGCM=yes
  6323. fi
  6324. if test "$ENABLED_AESGCM" = "word32"
  6325. then
  6326. AM_CFLAGS="$AM_CFLAGS -DGCM_WORD32"
  6327. ENABLED_AESGCM=yes
  6328. fi
  6329. if test "$ENABLED_AESGCM" = "small" || test "$ENABLED_LOWRESOURCE" = "yes"
  6330. then
  6331. AM_CFLAGS="$AM_CFLAGS -DGCM_SMALL"
  6332. ENABLED_AESGCM=yes
  6333. fi
  6334. if test "$ENABLED_AESGCM" = "table"
  6335. then
  6336. AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE"
  6337. ENABLED_AESGCM=yes
  6338. fi
  6339. if test "$ENABLED_AESGCM" = "4bit"
  6340. then
  6341. AM_CFLAGS="$AM_CFLAGS -DGCM_TABLE_4BIT"
  6342. ENABLED_AESGCM=yes
  6343. fi
  6344. AM_CFLAGS="$AM_CFLAGS -DHAVE_AESGCM"
  6345. fi
  6346. if test "$ENABLED_AESGCM_STREAM" != "no"
  6347. then
  6348. if test "$ENABLED_AESGCM" = "no"
  6349. then
  6350. AC_MSG_ERROR([AES-GCM streaming enabled but AES-GCM is disabled])
  6351. else
  6352. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AESGCM_STREAM"
  6353. AM_CCASFLAGS="$AM_CCASFLAGS -DWOLFSSL_AESGCM_STREAM"
  6354. fi
  6355. fi
  6356. if test "$ENABLED_IOTSAFE" != "no"
  6357. then
  6358. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_IOTSAFE"
  6359. ENABLED_IOTSAFE=yes
  6360. fi
  6361. if test "$ENABLED_IOTSAFE_HWRNG" != "no"
  6362. then
  6363. AM_CFLAGS="$AM_CFLAGS -DHAVE_IOTSAFE_HWRNG"
  6364. ENABLED_IOTSAFE_HWRNG=yes
  6365. fi
  6366. if test "x$ENABLED_WOLFENGINE" = "xyes"
  6367. then
  6368. AM_CFLAGS="$AM_CFLAGS -DHAVE_AES_ECB"
  6369. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_DIRECT"
  6370. AM_CFLAGS="$AM_CFLAGS -DWC_RSA_NO_PADDING"
  6371. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"
  6372. AM_CFLAGS="$AM_CFLAGS -DECC_MIN_KEY_SZ=192"
  6373. fi
  6374. if test "$ENABLED_WOLFENGINE" = "yes" && test "$ENABLED_FIPS" != "no"
  6375. then
  6376. AM_CFLAGS="$AM_CFLAGS -DSha3=wc_Sha3"
  6377. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_SHA256_NAMES"
  6378. AM_CFLAGS="$AM_CFLAGS -DNO_OLD_MD5_NAME"
  6379. fi
  6380. if test "$ENABLED_WOLFENGINE" = "yes" && test "$ENABLED_FIPS" = "no"
  6381. then
  6382. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_LONG_SALT"
  6383. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PSS_SALT_LEN_DISCOVER"
  6384. fi
  6385. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes"],
  6386. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MAX_STRENGTH"])
  6387. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  6388. test "x$ENABLED_OLD_TLS" = "xyes"],
  6389. [AM_CFLAGS="$AM_CFLAGS -DNO_OLD_TLS"
  6390. ENABLED_OLD_TLS=no])
  6391. AS_IF([test "x$ENABLED_MAXSTRENGTH" = "xyes" && \
  6392. test "x$ENABLED_SSLV3" = "xyes"],
  6393. [AC_MSG_ERROR([Cannot use Max Strength and SSLv3 at the same time.])])
  6394. AS_IF([test "x$ENABLED_SCTP" = "xyes"],
  6395. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SCTP"])
  6396. AS_IF([test "x$ENABLED_SRTP" = "xyes"],
  6397. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SRTP"])
  6398. AS_IF([test "x$ENABLED_MCAST" = "xyes"],
  6399. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_MULTICAST"])
  6400. # WOLFSSL_AFALG does not support SHA224 yet
  6401. AS_IF([(test "x$ENABLED_AFALG" = "xyes") && (test "x$ENABLED_SHA224" = "xyes")],
  6402. [AC_MSG_ERROR([--enable-sha224 with --enable-afalg not yet supported])])
  6403. # WOLFSSL_DEVCRYPTO does not support SHA224 yet
  6404. AS_IF([(test "x$ENABLED_DEVCRYPTO" = "xyes") && \
  6405. (test "x$ENABLED_CAAM" = "xno") && \
  6406. (test "x$ENABLED_SHA224" = "xyes")],
  6407. [AC_MSG_ERROR([--enable-sha224 with --enable-devcrypto not yet supported])])
  6408. # SCTP and Multicast require DTLS
  6409. AS_IF([(test "x$ENABLED_DTLS" = "xno") && \
  6410. (test "x$ENABLED_SCTP" = "xyes" || test "x$ENABLED_MCAST" = "xyes" || test "x$ENABLED_SRTP" = "xyes")],
  6411. [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS"
  6412. ENABLED_DTLS=yes])
  6413. # Multicast requires the null cipher
  6414. AS_IF([test "x$ENABLED_NULL_CIPHER" = "xno" && \
  6415. test "x$ENABLED_MCAST" = "xyes"],
  6416. [AM_CFLAGS="$AM_CFLAGS -DHAVE_NULL_CIPHER"
  6417. ENABLED_NULL_CIPHER=yes])
  6418. # wolfSSH and WPA Supplicant both need Public MP, only enable once.
  6419. # This will let you know if you enabled wolfSSH but have any of the prereqs
  6420. # disabled. Some of these options, disabling them adds things to the FLAGS and
  6421. # you need to check and add items in two places depending on the option.
  6422. AS_IF([test "x$ENABLED_WOLFSSH" = "xyes"],[AS_IF([test "x$ENABLED_WPAS" = "xno"],[AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_PUBLIC_MP"])])
  6423. if test "x$ENABLED_OPENSSLCOEXIST" = "xyes"; then
  6424. if test "x$ENABLED_OPENSSLALL" = "xyes"; then
  6425. AC_MSG_ERROR([Cannot use --enable-opensslcoexist with --enable-opensslall])
  6426. fi
  6427. if test "x$ENABLED_OPENSSLEXTRA" = "xyes"; then
  6428. AC_MSG_ERROR([Cannot use --enable-opensslcoexist with --enable-opensslextra])
  6429. fi
  6430. fi
  6431. AS_IF([test "x$ENABLED_WOLFSSH" = "xyes"],[AM_CPPFLAGS="$AM_CPPFLAGS -DWOLFSSL_WOLFSSH"])
  6432. if test "x$ENABLED_CERTS" = "xno" || test "x$ENABLED_LEANPSK" = "xyes" || test "x$ENABLED_ASN" = "xno"; then
  6433. AM_CFLAGS="$AM_CFLAGS -DNO_ASN -DNO_CERTS"
  6434. ENABLED_ASN=no
  6435. fi
  6436. # only allow secure renegotiation info with TLSV12 and ASN
  6437. if test "x$ENABLED_ASN" = "xno" || \
  6438. test "x$ENABLED_TLSV12" = "xno" || \
  6439. test "x$ENABLED_RENEGOTIATION_INDICATION" = "xyes"; then
  6440. ENABLED_SECURE_RENEGOTIATION_INFO="no"
  6441. fi
  6442. if test "x$ENABLED_SECURE_RENEGOTIATION_INFO" = "xyes"; then
  6443. AM_CFLAGS="$AM_CFLAGS -DHAVE_TLS_EXTENSIONS -DHAVE_SERVER_RENEGOTIATION_INFO"
  6444. fi
  6445. # Depricated Algorithm Handling
  6446. if test "$ENABLED_ARC4" = "yes"
  6447. then
  6448. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ALLOW_RC4"
  6449. fi
  6450. ################################################################################
  6451. # USER SETTINGS
  6452. if test "x$ENABLED_USERSETTINGS" = "xyes"
  6453. then
  6454. # Replace all options and just use WOLFSSL_USER_SETTINGS
  6455. AM_CFLAGS="-DWOLFSSL_USER_SETTINGS"
  6456. fi
  6457. # OPTIMIZE FLAGS
  6458. # For distro disable custom build options that interfere with symbol generation
  6459. if test "$GCC" = "yes" && test "$ENABLED_DISTRO" = "no"
  6460. then
  6461. AM_CFLAGS="$AM_CFLAGS -Wall -Wno-unused"
  6462. if test "$ax_enable_debug" = "no"
  6463. then
  6464. AS_IF([test "x$ENABLED_OPTFLAGS" = "xyes"], [
  6465. if test "$ENABLED_FASTMATH" = "yes"
  6466. then
  6467. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
  6468. if test "$ENABLED_FASTHUGEMATH" = "yes"
  6469. then
  6470. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  6471. fi
  6472. else
  6473. if (test "$ENABLED_SP" = "yes" || test "$ENABLED_SP_MATH_ALL" = "yes") && test "$ENABLED_SP_SMALL" = "no"
  6474. then
  6475. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_FAST_CFLAGS"
  6476. if test "$ENABLED_FASTHUGEMATH" = "yes"
  6477. then
  6478. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_HUGE_CFLAGS"
  6479. AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SP_INT_LARGE_COMBA"
  6480. fi
  6481. else
  6482. AM_CFLAGS="$AM_CFLAGS $OPTIMIZE_CFLAGS"
  6483. fi
  6484. fi
  6485. ])
  6486. fi
  6487. fi
  6488. # ICC command line warning for non supported warning flags
  6489. if test "$CC" = "icc"
  6490. then
  6491. AM_CFLAGS="$AM_CFLAGS -wd10006"
  6492. fi
  6493. # Expose HAVE___UINT128_T to options flags"
  6494. if test "$ac_cv_type___uint128_t" = "yes"
  6495. then
  6496. AM_CFLAGS="$AM_CFLAGS -DHAVE___UINT128_T=1"
  6497. fi
  6498. LIB_SOCKET_NSL
  6499. AX_HARDEN_CC_COMPILER_FLAGS
  6500. # if mingw then link to ws2_32 for sockets
  6501. case $host_os in
  6502. mingw*)
  6503. LDFLAGS="$LDFLAGS -lws2_32"
  6504. if test "$enable_shared" = "yes"
  6505. then
  6506. AC_DEFINE([WOLFSSL_DLL], [1], [Use __declspec(dllexport) when building library])
  6507. if test "$enable_static" = "yes"
  6508. then
  6509. MINGW_LIB_WARNING="yes"
  6510. fi
  6511. fi ;;
  6512. esac
  6513. if test "x$ENABLED_LINUXKM" = "xyes"; then
  6514. AX_SIMD_CC_COMPILER_FLAGS
  6515. AC_SUBST([CFLAGS_FPU_DISABLE])
  6516. AC_SUBST([CFLAGS_FPU_ENABLE])
  6517. AC_SUBST([CFLAGS_SIMD_DISABLE])
  6518. AC_SUBST([CFLAGS_SIMD_ENABLE])
  6519. AC_SUBST([CFLAGS_AUTO_VECTORIZE_DISABLE])
  6520. AC_SUBST([CFLAGS_AUTO_VECTORIZE_ENABLE])
  6521. AC_SUBST([ASFLAGS_FPU_DISABLE_SIMD_ENABLE])
  6522. AC_SUBST([ASFLAGS_FPU_ENABLE_SIMD_DISABLE])
  6523. AC_SUBST([ASFLAGS_FPUSIMD_DISABLE])
  6524. AC_SUBST([ASFLAGS_FPUSIMD_ENABLE])
  6525. if test "$ENABLED_OPENSSLEXTRA" != "no"; then
  6526. AC_MSG_ERROR([--enable-opensslextra is incompatible with --enable-linuxkm.])
  6527. fi
  6528. if test "$ENABLED_FILESYSTEM" = "yes"; then
  6529. AC_MSG_ERROR([--enable-filesystem is incompatible with --enable-linuxkm.])
  6530. fi
  6531. if test "$ENABLED_AFALG" = "yes"; then
  6532. AC_MSG_ERROR([--enable-afalg is incompatible with --enable-linuxkm.])
  6533. fi
  6534. if test "$ENABLED_DEVCRYPTO" = "yes"; then
  6535. AC_MSG_ERROR([--enable-devcrypto is incompatible with --enable-linuxkm.])
  6536. fi
  6537. if test "$ENABLED_PKCS11" = "yes"; then
  6538. AC_MSG_ERROR([--enable-pkcs11 is incompatible with --enable-linuxkm.])
  6539. fi
  6540. if test "$ENABLED_JNI" = "yes"; then
  6541. AC_MSG_ERROR([--enable-jni is incompatible with --enable-linuxkm.])
  6542. fi
  6543. if test "$ENABLED_16BIT" = "yes"; then
  6544. AC_MSG_ERROR([--enable-16bit is incompatible with --enable-linuxkm.])
  6545. fi
  6546. if test "$ENABLED_SINGLETHREADED" = "yes"; then
  6547. AC_MSG_ERROR([--enable-singlethreaded is incompatible with --enable-linuxkm.])
  6548. fi
  6549. if test "$ENABLED_VALGRIND" = "yes"; then
  6550. AC_MSG_ERROR([--enable-valgrind is incompatible with --enable-linuxkm.])
  6551. fi
  6552. if test "$ENABLED_FASTMATH" = "yes"; then
  6553. AC_MSG_ERROR([--enable-fastmath is incompatible with --enable-linuxkm (exceeds stack limit).])
  6554. fi
  6555. if test "$ENABLED_FAST_RSA" = "yes"; then
  6556. AC_MSG_ERROR([--enable-fastrsa is incompatible with --enable-linuxkm.])
  6557. fi
  6558. if test "$ENABLED_LIBZ_RSA" = "yes"; then
  6559. AC_MSG_ERROR([--with-libz is incompatible with --enable-linuxkm.])
  6560. fi
  6561. if test "$ENABLED_IOPOOL" = "yes"; then
  6562. AC_MSG_ERROR([--enable-iopool is incompatible with --enable-linuxkm.])
  6563. fi
  6564. if test "$ENABLED_EXAMPLES" = "yes"; then
  6565. AC_MSG_ERROR([--enable-examples is incompatible with --enable-linuxkm.])
  6566. fi
  6567. if test "$ENABLED_SMALL_STACK" != "yes"; then
  6568. AC_MSG_ERROR([--enable-smallstack is required for --enable-linuxkm.])
  6569. fi
  6570. if test "$ENABLED_SP_MATH" = "no" && test "$ENABLED_SP_MATH_ALL" = "no"; then
  6571. AC_MSG_ERROR([--enable-sp-math or --enable-sp-math-all is required for --enable-linuxkm.])
  6572. fi
  6573. if test "$ENABLED_STACKSIZE" != "no"; then
  6574. AC_MSG_ERROR([--enable-stacksize is incompatible with --enable-linuxkm.])
  6575. fi
  6576. if test "$ENABLED_STACKLOG" = "yes"; then
  6577. AC_MSG_ERROR([--enable-stacklog is incompatible with --enable-linuxkm.])
  6578. fi
  6579. if test "$ENABLED_COMPKEY" = "yes"; then
  6580. AC_MSG_ERROR([--enable-compkey is incompatible with --enable-linuxkm.])
  6581. fi
  6582. fi
  6583. # The following AM_CONDITIONAL statements set flags for use in the Makefiles.
  6584. # Some of these affect build targets and objects, some trigger different
  6585. # test scripts for make check.
  6586. AM_CONDITIONAL([BUILD_DISTRO],[test "x$ENABLED_DISTRO" = "xyes"])
  6587. AM_CONDITIONAL([BUILD_ALL],[test "x$ENABLED_ALL" = "xyes"])
  6588. AM_CONDITIONAL([BUILD_TLS13],[test "x$ENABLED_TLS13" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6589. AM_CONDITIONAL([BUILD_RNG],[test "x$ENABLED_RNG" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6590. AM_CONDITIONAL([BUILD_SCTP],[test "x$ENABLED_SCTP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6591. AM_CONDITIONAL([BUILD_SRTP],[test "x$ENABLED_SRTP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6592. AM_CONDITIONAL([BUILD_MCAST],[test "x$ENABLED_MCAST" = "xyes"])
  6593. AM_CONDITIONAL([BUILD_IPV6],[test "x$ENABLED_IPV6" = "xyes"])
  6594. AM_CONDITIONAL([BUILD_LEANPSK],[test "x$ENABLED_LEANPSK" = "xyes"])
  6595. AM_CONDITIONAL([BUILD_LEANTLS],[test "x$ENABLED_LEANTLS" = "xyes"])
  6596. AM_CONDITIONAL([BUILD_LOWMEM],[test "x$ENABLED_LOWRESOURCE" = "xyes"])
  6597. AM_CONDITIONAL([BUILD_PKCALLBACKS], [ test "x$ENABLED_PKCALLBACKS" = "xyes"])
  6598. AM_CONDITIONAL([BUILD_CRYPTOAUTHLIB],[test "x$ENABLED_CRYPTOAUTHLIB" = "xyes"])
  6599. AM_CONDITIONAL([BUILD_SNIFFER], [ test "x$ENABLED_SNIFFER" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6600. AM_CONDITIONAL([BUILD_SNIFFTEST],[ test "x$ENABLED_SNIFFTEST" = "xyes"])
  6601. AM_CONDITIONAL([BUILD_AESGCM],[test "x$ENABLED_AESGCM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6602. AM_CONDITIONAL([BUILD_AESCCM],[test "x$ENABLED_AESCCM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6603. AM_CONDITIONAL([BUILD_ARMASM],[test "x$ENABLED_ARMASM" = "xyes"])
  6604. AM_CONDITIONAL([BUILD_ARMASM_INLINE],[test "x$ENABLED_ARMASM_INLINE" = "xyes"])
  6605. AM_CONDITIONAL([BUILD_XILINX],[test "x$ENABLED_XILINX" = "xyes"])
  6606. AM_CONDITIONAL([BUILD_AESNI],[test "x$ENABLED_AESNI" = "xyes"])
  6607. AM_CONDITIONAL([BUILD_INTELASM],[test "x$ENABLED_INTELASM" = "xyes"])
  6608. AM_CONDITIONAL([BUILD_AFALG],[test "x$ENABLED_AFALG" = "xyes"])
  6609. AM_CONDITIONAL([BUILD_KCAPI],[test "x$ENABLED_KCAPI" = "xyes"])
  6610. AM_CONDITIONAL([BUILD_DEVCRYPTO],[test "x$ENABLED_DEVCRYPTO" = "xyes"])
  6611. AM_CONDITIONAL([BUILD_CAMELLIA],[test "x$ENABLED_CAMELLIA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6612. AM_CONDITIONAL([BUILD_MD2],[test "x$ENABLED_MD2" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6613. AM_CONDITIONAL([BUILD_RIPEMD],[test "x$ENABLED_RIPEMD" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6614. AM_CONDITIONAL([BUILD_BLAKE2],[test "x$ENABLED_BLAKE2" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6615. AM_CONDITIONAL([BUILD_BLAKE2S],[test "x$ENABLED_BLAKE2S" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6616. AM_CONDITIONAL([BUILD_SHA512],[test "x$ENABLED_SHA512" = "xyes" || test "x$ENABLED_SHA384" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6617. AM_CONDITIONAL([BUILD_DSA],[test "x$ENABLED_DSA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6618. AM_CONDITIONAL([BUILD_ECC],[test "x$ENABLED_ECC" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6619. AM_CONDITIONAL([BUILD_ED25519],[test "x$ENABLED_ED25519" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6620. AM_CONDITIONAL([BUILD_ED25519_SMALL],[test "x$ENABLED_ED25519_SMALL" = "xyes"])
  6621. AM_CONDITIONAL([BUILD_FEMATH], [test "x$ENABLED_FEMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6622. AM_CONDITIONAL([BUILD_GEMATH], [test "x$ENABLED_GEMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6623. AM_CONDITIONAL([BUILD_CURVE25519],[test "x$ENABLED_CURVE25519" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6624. AM_CONDITIONAL([BUILD_CURVE25519_SMALL],[test "x$ENABLED_CURVE25519_SMALL" = "xyes"])
  6625. AM_CONDITIONAL([BUILD_ED448],[test "x$ENABLED_ED448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6626. AM_CONDITIONAL([BUILD_ED448_SMALL],[test "x$ENABLED_ED448_SMALL" = "xyes"])
  6627. AM_CONDITIONAL([BUILD_FE448], [test "x$ENABLED_FE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6628. AM_CONDITIONAL([BUILD_GE448], [test "x$ENABLED_GE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6629. AM_CONDITIONAL([BUILD_CURVE448],[test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6630. AM_CONDITIONAL([BUILD_CURVE448_SMALL],[test "x$ENABLED_CURVE448_SMALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6631. AM_CONDITIONAL([BUILD_ECCSI],[test "x$ENABLED_ECCSI" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6632. AM_CONDITIONAL([BUILD_SAKKE],[test "x$ENABLED_SAKKE" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6633. AM_CONDITIONAL([BUILD_MEMORY],[test "x$ENABLED_MEMORY" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6634. AM_CONDITIONAL([BUILD_RSA],[test "x$ENABLED_RSA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6635. AM_CONDITIONAL([BUILD_DH],[test "x$ENABLED_DH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6636. AM_CONDITIONAL([BUILD_ASN],[test "x$ENABLED_ASN" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6637. AM_CONDITIONAL([BUILD_AES],[test "x$ENABLED_AES" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6638. AM_CONDITIONAL([BUILD_CODING],[test "x$ENABLED_CODING" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6639. AM_CONDITIONAL([BUILD_RC4],[test "x$ENABLED_ARC4" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6640. AM_CONDITIONAL([BUILD_MD5],[test "x$ENABLED_MD5" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6641. AM_CONDITIONAL([BUILD_SHA],[test "x$ENABLED_SHA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6642. AM_CONDITIONAL([BUILD_FIPS],[test "x$ENABLED_FIPS" = "xyes"])
  6643. AM_CONDITIONAL([BUILD_FIPS_V1],[test "$HAVE_FIPS_VERSION" = 1])
  6644. AM_CONDITIONAL([BUILD_FIPS_V2],[test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" = 0])
  6645. AM_CONDITIONAL([BUILD_FIPS_RAND],[test "$HAVE_FIPS_VERSION" = 2 && test "$HAVE_FIPS_VERSION_MINOR" = 1])
  6646. AM_CONDITIONAL([BUILD_FIPS_V5],[test "$HAVE_FIPS_VERSION" = 5])
  6647. AM_CONDITIONAL([BUILD_FIPS_CURRENT],[test "$HAVE_FIPS_VERSION" -ge 2 ])
  6648. # BUILD_FIPS_CURRENT is for builds after cert 2425.
  6649. AM_CONDITIONAL([BUILD_SIPHASH],[test "x$ENABLED_SIPHASH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6650. AM_CONDITIONAL([BUILD_CMAC],[test "x$ENABLED_CMAC" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6651. AM_CONDITIONAL([BUILD_SELFTEST],[test "x$ENABLED_SELFTEST" = "xyes"])
  6652. AM_CONDITIONAL([BUILD_SHA224],[test "x$ENABLED_SHA224" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6653. AM_CONDITIONAL([BUILD_SHA3],[test "x$ENABLED_SHA3" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6654. AM_CONDITIONAL([BUILD_POLY1305],[test "x$ENABLED_POLY1305" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6655. AM_CONDITIONAL([BUILD_CHACHA],[test "x$ENABLED_CHACHA" = "xyes" || test "x$ENABLED_CHACHA" = "xnoasm" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6656. AM_CONDITIONAL([BUILD_XCHACHA],[test "x$ENABLED_XCHACHA" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6657. AM_CONDITIONAL([BUILD_INLINE],[test "x$ENABLED_INLINE" = "xyes"])
  6658. AM_CONDITIONAL([BUILD_OCSP],[test "x$ENABLED_OCSP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6659. AM_CONDITIONAL([BUILD_OCSP_STAPLING],[test "x$ENABLED_CERTIFICATE_STATUS_REQUEST" = "xyes"])
  6660. AM_CONDITIONAL([BUILD_OCSP_STAPLING_V2],[test "x$ENABLED_CERTIFICATE_STATUS_REQUEST_V2" = "xyes"])
  6661. AM_CONDITIONAL([BUILD_CRL],[test "x$ENABLED_CRL" != "xno" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6662. AM_CONDITIONAL([BUILD_CRL_MONITOR],[test "x$ENABLED_CRL_MONITOR" = "xyes"])
  6663. AM_CONDITIONAL([BUILD_USER_RSA],[test "x$ENABLED_USER_RSA" = "xyes"] )
  6664. AM_CONDITIONAL([BUILD_USER_CRYPTO],[test "x$ENABLED_USER_CRYPTO" = "xyes"])
  6665. AM_CONDITIONAL([BUILD_LIBOQS],[test "x$ENABLED_LIBOQS" = "xyes"])
  6666. AM_CONDITIONAL([BUILD_WNR],[test "x$ENABLED_WNR" = "xyes"])
  6667. AM_CONDITIONAL([BUILD_SRP],[test "x$ENABLED_SRP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6668. AM_CONDITIONAL([USE_VALGRIND],[test "x$ENABLED_VALGRIND" = "xyes"])
  6669. AM_CONDITIONAL([BUILD_MD4],[test "x$ENABLED_MD4" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6670. AM_CONDITIONAL([BUILD_PWDBASED],[test "x$ENABLED_PWDBASED" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6671. AM_CONDITIONAL([BUILD_SCRYPT],[test "x$ENABLED_SCRYPT" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6672. AM_CONDITIONAL([BUILD_CRYPTONLY],[test "x$ENABLED_CRYPTONLY" = "xyes" && test "x$ENABLED_OPENSSLEXTRA" = "xno"])
  6673. AM_CONDITIONAL([BUILD_FASTMATH],[test "x$ENABLED_FASTMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6674. AM_CONDITIONAL([BUILD_SLOWMATH],[test "x$ENABLED_SLOWMATH" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6675. AM_CONDITIONAL([BUILD_EXAMPLE_SERVERS],[test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"])
  6676. AM_CONDITIONAL([BUILD_EXAMPLE_CLIENTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
  6677. AM_CONDITIONAL([BUILD_TESTS],[test "x$ENABLED_EXAMPLES" = "xyes"])
  6678. AM_CONDITIONAL([BUILD_THREADED_EXAMPLES],[test "x$ENABLED_SINGLETHREADED" = "xno" && test "x$ENABLED_EXAMPLES" = "xyes" && test "x$ENABLED_LEANTLS" = "xno"])
  6679. AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS],[test "x$ENABLED_CRYPT_TESTS" = "xyes"])
  6680. AM_CONDITIONAL([BUILD_WOLFCRYPT_TESTS_LIBS],[test "x$ENABLED_CRYPT_TESTS_LIBS" = "xyes"])
  6681. AM_CONDITIONAL([BUILD_LIBZ],[test "x$ENABLED_LIBZ" = "xyes"])
  6682. AM_CONDITIONAL([BUILD_PKCS11],[test "x$ENABLED_PKCS11" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6683. AM_CONDITIONAL([BUILD_PKCS12],[test "x$ENABLED_PKCS12" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6684. AM_CONDITIONAL([BUILD_PKCS8],[test "x$ENABLED_PKCS8" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6685. AM_CONDITIONAL([BUILD_CAVIUM],[test "x$ENABLED_CAVIUM" = "xyes"])
  6686. AM_CONDITIONAL([BUILD_CAVIUM_V],[test "x$ENABLED_CAVIUM_V" = "xyes"])
  6687. AM_CONDITIONAL([BUILD_OCTEON_SYNC],[test "x$ENABLED_OCTEON_SYNC" = "xyes"])
  6688. AM_CONDITIONAL([BUILD_INTEL_QA],[test "x$ENABLED_INTEL_QA" = "xyes"])
  6689. AM_CONDITIONAL([BUILD_INTEL_QA_SYNC],[test "x$ENABLED_INTEL_QA_SYNC" = "xyes"])
  6690. AM_CONDITIONAL([BUILD_SP],[test "x$ENABLED_SP" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6691. AM_CONDITIONAL([BUILD_SP_C32],[ ( ( (test "$ENABLED_SP_RSA" = "yes" || test "$ENABLED_SP_DH" = "yes" \
  6692. || test "$ENABLED_SP_ECC" = "yes") && test "x$ENABLED_SP_ASM" = "xno") \
  6693. || test "x$ENABLED_USERSETTINGS" = "xyes") && test "x$ENABLED_64BIT" != "xyes"])
  6694. AM_CONDITIONAL([BUILD_SP_C64],[ ( ( (test "$ENABLED_SP_RSA" = "yes" || test "$ENABLED_SP_DH" = "yes" \
  6695. || test "$ENABLED_SP_ECC" = "yes") && test "x$ENABLED_SP_ASM" = "xno") \
  6696. || test "x$ENABLED_USERSETTINGS" = "xyes") && test "x$ENABLED_32BIT" != "xyes"])
  6697. AM_CONDITIONAL([BUILD_SP_ARM64],[test "x$ENABLED_SP_ARM64_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6698. AM_CONDITIONAL([BUILD_SP_ARM32],[test "x$ENABLED_SP_ARM32_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6699. AM_CONDITIONAL([BUILD_SP_ARM_THUMB],[test "x$ENABLED_SP_ARM_THUMB_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6700. AM_CONDITIONAL([BUILD_SP_ARM_CORTEX],[test "x$ENABLED_SP_ARM_CORTEX_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6701. AM_CONDITIONAL([BUILD_SP_X86_64],[test "x$ENABLED_SP_X86_64_ASM" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6702. AM_CONDITIONAL([BUILD_SP_INT],[test "x$ENABLED_SP_MATH" = "xyes" || test "x$ENABLED_SP_MATH_ALL" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6703. AM_CONDITIONAL([BUILD_FAST_RSA],[test "x$ENABLED_FAST_RSA" = "xyes"])
  6704. AM_CONDITIONAL([BUILD_MCAPI],[test "x$ENABLED_MCAPI" = "xyes"])
  6705. AM_CONDITIONAL([BUILD_ASYNCCRYPT],[test "x$ENABLED_ASYNCCRYPT" = "xyes"])
  6706. AM_CONDITIONAL([BUILD_WOLFEVENT],[test "x$ENABLED_ASYNCCRYPT" = "xyes"])
  6707. AM_CONDITIONAL([BUILD_CRYPTOCB],[test "x$ENABLED_CRYPTOCB" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6708. AM_CONDITIONAL([BUILD_PSK],[test "x$ENABLED_PSK" = "xyes"])
  6709. AM_CONDITIONAL([BUILD_TRUST_PEER_CERT],[test "x$ENABLED_TRUSTED_PEER_CERT" = "xyes"])
  6710. AM_CONDITIONAL([BUILD_PKI],[test "x$ENABLED_PKI" = "xyes"])
  6711. AM_CONDITIONAL([BUILD_DES3],[test "x$ENABLED_DES3" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6712. AM_CONDITIONAL([BUILD_PKCS7],[test "x$ENABLED_PKCS7" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6713. AM_CONDITIONAL([BUILD_SMIME],[test "x$ENABLED_SMIME" = "xyes" || test "x$ENABLED_USERSETTINGS" = "xyes"])
  6714. AM_CONDITIONAL([BUILD_HASHFLAGS],[test "x$ENABLED_HASHFLAGS" = "xyes"])
  6715. AM_CONDITIONAL([BUILD_CAAM],[test "x$ENABLED_CAAM" = "xyes" || test "x$ENABLED_CAAM" = "xqnx" || test "x$ENABLED_CAAM" = "xseco"])
  6716. AM_CONDITIONAL([BUILD_LINUXKM],[test "$ENABLED_LINUXKM" = "yes"])
  6717. AM_CONDITIONAL([BUILD_NO_LIBRARY],[test "$ENABLED_NO_LIBRARY" = "yes"])
  6718. AM_CONDITIONAL([BUILD_BENCHMARK],[test "$ENABLED_BENCHMARK" = "yes"])
  6719. AM_CONDITIONAL([BUILD_RC2],[test "x$ENABLED_RC2" = "xyes"])
  6720. AM_CONDITIONAL([BUILD_QNXCAAM],[test "x$ENABLED_CAAM" = "xqnx"])
  6721. AM_CONDITIONAL([BUILD_IOTSAFE],[test "x$ENABLED_IOTSAFE" = "xyes"])
  6722. AM_CONDITIONAL([BUILD_IOTSAFE_HWRNG],[test "x$ENABLED_IOTSAFE_HWRNG" = "xyes"])
  6723. AM_CONDITIONAL([BUILD_SE050],[test "x$ENABLED_SE050" = "xyes"])
  6724. AM_CONDITIONAL([BUILD_KDF],[test "x$ENABLED_KDF" = "xyes"])
  6725. AM_CONDITIONAL([BUILD_HMAC],[test "x$ENABLED_HMAC" = "xyes"])
  6726. AM_CONDITIONAL([BUILD_ERROR_STRINGS],[test "x$ENABLED_ERROR_STRINGS" = "xyes"])
  6727. AM_CONDITIONAL([BUILD_DO178],[test "x$ENABLED_DO178" = "xyes"])
  6728. AM_CONDITIONAL([BUILD_PSA],[test "x$ENABLED_PSA" = "xyes"])
  6729. if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes" &&
  6730. (test "$ax_enable_debug" = "yes" ||
  6731. test "$ENABLED_STACKSIZE" != "no" ||
  6732. (test "$ENABLED_LEANTLS" = "no" &&
  6733. test "$ENABLED_LEANPSK" = "no" &&
  6734. test "$ENABLED_LOWRESOURCE" = "no"))
  6735. then
  6736. AM_CFLAGS="$AM_CFLAGS -DHAVE_WC_INTROSPECTION"
  6737. fi
  6738. if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes"
  6739. then
  6740. AM_CFLAGS="$AM_CFLAGS -include ${output_objdir}/.build_params"
  6741. fi
  6742. CREATE_HEX_VERSION
  6743. AC_SUBST([AM_CPPFLAGS])
  6744. AC_SUBST([AM_CFLAGS])
  6745. AC_SUBST([AM_LDFLAGS])
  6746. AC_SUBST([AM_CCASFLAGS])
  6747. AC_SUBST([LIB_ADD])
  6748. AC_SUBST([LIB_STATIC_ADD])
  6749. # FINAL
  6750. AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h])
  6751. AC_CONFIG_FILES([Makefile
  6752. wolfssl/version.h
  6753. wolfssl/options.h
  6754. cyassl/options.h
  6755. support/wolfssl.pc
  6756. rpm/spec
  6757. wolfcrypt/test/test_paths.h
  6758. ])
  6759. AC_CONFIG_FILES([scripts/unit.test],[chmod +x scripts/unit.test])
  6760. AX_CREATE_GENERIC_CONFIG
  6761. AX_AM_JOBSERVER([yes])
  6762. # See Automake 9.4.1 Built Sources Example
  6763. AC_DEFUN([AX_OUT_OF_TREE_FILE],[
  6764. AC_CONFIG_COMMANDS([$1], [test ! -f $srcdir/$1 && >> $srcdir/$1])
  6765. ])
  6766. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/async.h])
  6767. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/fips.h])
  6768. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/port/cavium/cavium_nitrox.h])
  6769. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/port/intel/quickassist.h])
  6770. AX_OUT_OF_TREE_FILE([wolfssl/wolfcrypt/port/intel/quickassist_mem.h])
  6771. AC_OUTPUT
  6772. if test "$ENABLED_MAKECLEAN" = "yes"
  6773. then
  6774. # force make clean
  6775. AC_MSG_NOTICE([---])
  6776. AC_MSG_NOTICE([Running make clean...])
  6777. if test -z "$MAKE"; then
  6778. MAKE="make"
  6779. fi
  6780. if test "$verbose" = "yes"; then
  6781. $MAKE clean
  6782. else
  6783. $MAKE clean >/dev/null
  6784. fi
  6785. fi
  6786. if test "$ENABLED_REPRODUCIBLE_BUILD" != "yes"
  6787. then
  6788. echo "#define LIBWOLFSSL_CONFIGURE_ARGS \"$ac_configure_args\"" > ${output_objdir}/.build_params &&
  6789. echo "#define LIBWOLFSSL_GLOBAL_CFLAGS \"$CPPFLAGS $AM_CPPFLAGS $CFLAGS $AM_CFLAGS\" LIBWOLFSSL_GLOBAL_EXTRA_CFLAGS" >> ${output_objdir}/.build_params ||
  6790. AC_MSG_ERROR([Couldn't create ${output_objdir}/.build_params.])
  6791. fi
  6792. # generate user options header
  6793. AC_MSG_NOTICE([---])
  6794. AC_MSG_NOTICE([Generating user options header...])
  6795. OPTION_FILE="wolfssl/options.h"
  6796. rm -f $OPTION_FILE
  6797. echo "/* wolfssl options.h" > $OPTION_FILE
  6798. echo " * generated from configure options" >> $OPTION_FILE
  6799. echo " *" >> $OPTION_FILE
  6800. echo " * Copyright (C) 2006-2022 wolfSSL Inc." >> $OPTION_FILE
  6801. echo " *" >> $OPTION_FILE
  6802. echo " * This file is part of wolfSSL. (formerly known as CyaSSL)" >> $OPTION_FILE
  6803. echo " *" >> $OPTION_FILE
  6804. echo " */" >> $OPTION_FILE
  6805. echo "" >> $OPTION_FILE
  6806. echo "#ifndef WOLFSSL_OPTIONS_H" >> $OPTION_FILE
  6807. echo "#define WOLFSSL_OPTIONS_H" >> $OPTION_FILE
  6808. echo "" >> $OPTION_FILE
  6809. echo "" >> $OPTION_FILE
  6810. echo "#ifdef __cplusplus" >> $OPTION_FILE
  6811. echo "extern \"C\" {" >> $OPTION_FILE
  6812. echo "#endif" >> $OPTION_FILE
  6813. echo "" >> $OPTION_FILE
  6814. for option in $CPPFLAGS $AM_CPPFLAGS $CFLAGS $AM_CFLAGS $EXTRA_CFLAGS; do
  6815. defonly=`echo $option | sed 's/^-D//'`
  6816. if test "$defonly" != "$option"
  6817. then
  6818. noequalsign=`echo $defonly | sed 's/=/ /'`
  6819. if test "$noequalsign" = "NDEBUG" || test "$noequalsign" = "DEBUG"
  6820. then
  6821. if test "$verbose" = "yes"; then
  6822. AC_MSG_NOTICE([not outputting (N)DEBUG to $OPTION_FILE])
  6823. fi
  6824. continue
  6825. fi
  6826. # allow user to ignore system options
  6827. ignoresys=$(echo "$noequalsign" | grep '^_.*')
  6828. if test -n "$ignoresys"
  6829. then
  6830. echo "#ifndef WOLFSSL_OPTIONS_IGNORE_SYS" >> $OPTION_FILE
  6831. fi
  6832. noarg=`echo $defonly | sed 's/=.*//'`
  6833. echo "#undef $noarg" >> $OPTION_FILE
  6834. echo "#define $noequalsign" >> $OPTION_FILE
  6835. if test -n "$ignoresys"
  6836. then
  6837. echo "#endif" >> $OPTION_FILE
  6838. fi
  6839. echo "" >> $OPTION_FILE
  6840. else
  6841. if test "$verbose" = "yes"; then
  6842. AC_MSG_NOTICE([option w/o begin -D is $option, not saving to $OPTION_FILE])
  6843. fi
  6844. fi
  6845. done
  6846. echo "" >> $OPTION_FILE
  6847. echo "#ifdef __cplusplus" >> $OPTION_FILE
  6848. echo "}" >> $OPTION_FILE
  6849. echo "#endif" >> $OPTION_FILE
  6850. echo "" >> $OPTION_FILE
  6851. echo "" >> $OPTION_FILE
  6852. echo "#endif /* WOLFSSL_OPTIONS_H */" >> $OPTION_FILE
  6853. echo "" >> $OPTION_FILE
  6854. #backwards compatibility for those who have included options or version
  6855. touch cyassl/options.h
  6856. echo "/* cyassl options.h" > cyassl/options.h
  6857. echo " * generated from wolfssl/options.h" >> cyassl/options.h
  6858. echo " */" >> cyassl/options.h
  6859. while read -r line
  6860. do
  6861. echo "$line" >> cyassl/options.h
  6862. done < $OPTION_FILE
  6863. # switch ifdef protection in cyassl/option.h to CYASSL_OPTONS_H, remove bak
  6864. sed -i.bak 's/WOLFSSL_OPTIONS_H/CYASSL_OPTIONS_H/g' cyassl/options.h
  6865. # workaround for mingw sed that may get "Permission denied" trying to preserver permissions
  6866. case $host_os in
  6867. mingw*)
  6868. chmod u+w cyassl/options.h ;;
  6869. esac
  6870. rm cyassl/options.h.bak
  6871. if test "$silent" != "yes"; then
  6872. # output config summary
  6873. echo "---"
  6874. echo "Configuration summary for $PACKAGE_NAME version $VERSION"
  6875. echo ""
  6876. echo " * Installation prefix: $prefix"
  6877. echo " * System type: $host_vendor-$host_os"
  6878. echo " * Host CPU: $host_cpu"
  6879. echo " * C Compiler: $CC"
  6880. echo " * C Flags: $CFLAGS"
  6881. echo " * C++ Compiler: $CXX"
  6882. echo " * C++ Flags: $CXXFLAGS"
  6883. echo " * CPP Flags: $CPPFLAGS"
  6884. echo " * CCAS Flags: $CCASFLAGS"
  6885. echo " * LIB Flags: $LIB"
  6886. test "$ENABLED_LINUXKM" = "yes" && \
  6887. echo " * Linux Kernel Build Root: $KERNEL_ROOT" && \
  6888. echo " * Linux Kernel Build Arch: $KERNEL_ARCH" && \
  6889. echo " * fpu disable C flags: $CFLAGS_FPU_DISABLE" && \
  6890. echo " * fpu enable C flags: $CFLAGS_FPU_ENABLE" && \
  6891. echo " * SIMD disable C flags: $CFLAGS_SIMD_DISABLE" && \
  6892. echo " * SIMD enable C flags: $CFLAGS_SIMD_ENABLE" && \
  6893. echo " * No-auto-vectorize C flags: $CFLAGS_AUTO_VECTORIZE_DISABLE" && \
  6894. echo " * Auto-vectorize C flags: $CFLAGS_AUTO_VECTORIZE_ENABLE" && \
  6895. echo " * SIMD enable as flags: $ASFLAGS_FPU_DISABLE_SIMD_ENABLE" && \
  6896. echo " * FPU enable as flags: $ASFLAGS_FPU_ENABLE_SIMD_DISABLE" && \
  6897. echo " * SIMD+FPU disable as flags: $ASFLAGS_FPUSIMD_DISABLE" && \
  6898. echo " * SIMD+FPU enable as flags: $ASFLAGS_FPUSIMD_ENABLE" && \
  6899. echo " * Linux kernel module PIE: $ENABLED_LINUXKM_PIE"
  6900. echo " * Debug enabled: $ax_enable_debug"
  6901. echo " * Coverage enabled: $ax_enable_coverage"
  6902. echo " * Warnings as failure: $ac_cv_warnings_as_errors"
  6903. echo " * make -j: $enable_jobserver"
  6904. echo " * VCS checkout: $ac_cv_vcs_checkout"
  6905. echo
  6906. echo " Features "
  6907. if test "$ENABLED_FIPS" = "yes"; then
  6908. echo " * FIPS: $FIPS_VERSION"
  6909. else
  6910. echo " * FIPS: $ENABLED_FIPS"
  6911. fi
  6912. echo " * Single threaded: $ENABLED_SINGLETHREADED"
  6913. echo " * Filesystem: $ENABLED_FILESYSTEM"
  6914. echo " * OpenSSH Build: $ENABLED_OPENSSH"
  6915. echo " * OpenSSL Extra API: $ENABLED_OPENSSLEXTRA"
  6916. echo " * OpenSSL Coexist: $ENABLED_OPENSSLCOEXIST"
  6917. echo " * Old Names: $ENABLED_OLDNAMES"
  6918. echo " * Max Strength Build: $ENABLED_MAXSTRENGTH"
  6919. echo " * Distro Build: $ENABLED_DISTRO"
  6920. echo " * Reproducible Build: $ENABLED_REPRODUCIBLE_BUILD"
  6921. echo " * fastmath: $ENABLED_FASTMATH"
  6922. echo " * Assembly Allowed: $ENABLED_ASM"
  6923. echo " * sniffer: $ENABLED_SNIFFER"
  6924. echo " * snifftest: $ENABLED_SNIFFTEST"
  6925. echo " * ARC4: $ENABLED_ARC4"
  6926. echo " * AES: $ENABLED_AES"
  6927. echo " * AES-NI: $ENABLED_AESNI"
  6928. echo " * AES-CBC: $ENABLED_AESCBC"
  6929. echo " * AES-CBC length checks: $ENABLED_AESCBC_LENGTH_CHECKS"
  6930. echo " * AES-GCM: $ENABLED_AESGCM"
  6931. echo " * AES-GCM streaming: $ENABLED_AESGCM_STREAM"
  6932. echo " * AES-CCM: $ENABLED_AESCCM"
  6933. echo " * AES-CTR: $ENABLED_AESCTR"
  6934. echo " * AES-CFB: $ENABLED_AESCFB"
  6935. echo " * AES-OFB: $ENABLED_AESOFB"
  6936. echo " * AES-SIV: $ENABLED_AESSIV"
  6937. echo " * DES3: $ENABLED_DES3"
  6938. echo " * Camellia: $ENABLED_CAMELLIA"
  6939. echo " * NULL Cipher: $ENABLED_NULL_CIPHER"
  6940. echo " * MD2: $ENABLED_MD2"
  6941. echo " * MD4: $ENABLED_MD4"
  6942. echo " * MD5: $ENABLED_MD5"
  6943. echo " * RIPEMD: $ENABLED_RIPEMD"
  6944. echo " * SHA: $ENABLED_SHA"
  6945. echo " * SHA-224: $ENABLED_SHA224"
  6946. echo " * SHA-384: $ENABLED_SHA384"
  6947. echo " * SHA-512: $ENABLED_SHA512"
  6948. echo " * SHA3: $ENABLED_SHA3"
  6949. echo " * SHAKE256: $ENABLED_SHAKE256"
  6950. echo " * BLAKE2: $ENABLED_BLAKE2"
  6951. echo " * BLAKE2S: $ENABLED_BLAKE2S"
  6952. echo " * SipHash: $ENABLED_SIPHASH"
  6953. echo " * CMAC: $ENABLED_CMAC"
  6954. echo " * keygen: $ENABLED_KEYGEN"
  6955. echo " * certgen: $ENABLED_CERTGEN"
  6956. echo " * certreq: $ENABLED_CERTREQ"
  6957. echo " * certext: $ENABLED_CERTEXT"
  6958. echo " * certgencache: $ENABLED_certgencache"
  6959. echo " * CHACHA: $ENABLED_CHACHA"
  6960. echo " * XCHACHA: $ENABLED_XCHACHA"
  6961. echo " * Hash DRBG: $ENABLED_HASHDRBG"
  6962. echo " * PWDBASED: $ENABLED_PWDBASED"
  6963. echo " * scrypt: $ENABLED_SCRYPT"
  6964. echo " * wolfCrypt Only: $ENABLED_CRYPTONLY"
  6965. echo " * HKDF: $ENABLED_HKDF"
  6966. echo " * X9.63 KDF: $ENABLED_X963KDF"
  6967. echo " * MD4: $ENABLED_MD4"
  6968. echo " * PSK: $ENABLED_PSK"
  6969. echo " * Poly1305: $ENABLED_POLY1305"
  6970. echo " * LEANPSK: $ENABLED_LEANPSK"
  6971. echo " * LEANTLS: $ENABLED_LEANTLS"
  6972. echo " * RSA: $ENABLED_RSA"
  6973. echo " * RSA-PSS: $ENABLED_RSAPSS"
  6974. echo " * DSA: $ENABLED_DSA"
  6975. echo " * DH: $ENABLED_DH"
  6976. echo " * DH Default Parameters: $ENABLED_DHDEFAULTPARAMS"
  6977. echo " * ECC: $ENABLED_ECC"
  6978. echo " * ECC Custom Curves: $ENABLED_ECCCUSTCURVES"
  6979. echo " * ECC Minimum Bits: $ENABLED_ECCMINSZ"
  6980. echo " * CURVE25519: $ENABLED_CURVE25519"
  6981. echo " * ED25519: $ENABLED_ED25519"
  6982. echo " * ED25519 streaming: $ENABLED_ED25519_STREAM"
  6983. echo " * CURVE448: $ENABLED_CURVE448"
  6984. echo " * ED448: $ENABLED_ED448"
  6985. echo " * ED448 streaming: $ENABLED_ED448_STREAM"
  6986. echo " * FPECC: $ENABLED_FPECC"
  6987. echo " * ECC_ENCRYPT: $ENABLED_ECC_ENCRYPT"
  6988. echo " * ECCSI $ENABLED_ECCSI"
  6989. echo " * SAKKE $ENABLED_SAKKE"
  6990. echo " * ASN: $ENABLED_ASN"
  6991. echo " * Anonymous cipher: $ENABLED_ANON"
  6992. echo " * CODING: $ENABLED_CODING"
  6993. echo " * MEMORY: $ENABLED_MEMORY"
  6994. echo " * I/O POOL: $ENABLED_IOPOOL"
  6995. echo " * wolfSentry: $ENABLED_WOLFSENTRY"
  6996. echo " * LIGHTY: $ENABLED_LIGHTY"
  6997. echo " * WPA Supplicant: $ENABLED_WPAS"
  6998. echo " * HAPROXY: $ENABLED_HAPROXY"
  6999. echo " * STUNNEL: $ENABLED_STUNNEL"
  7000. echo " * tcpdump: $ENABLED_TCPDUMP"
  7001. echo " * libssh2: $ENABLED_LIBSSH2"
  7002. echo " * ntp: $ENABLED_NTP"
  7003. echo " * rsyslog: $ENABLED_RSYSLOG"
  7004. echo " * Apache httpd: $ENABLED_APACHE_HTTPD"
  7005. echo " * NGINX: $ENABLED_NGINX"
  7006. echo " * OpenResty: $ENABLED_OPENRESTY"
  7007. echo " * ASIO: $ENABLED_ASIO"
  7008. echo " * LIBWEBSOCKETS: $ENABLED_LIBWEBSOCKETS"
  7009. echo " * Qt: $ENABLED_QT"
  7010. echo " * Qt Unit Testing: $ENABLED_QT_TEST"
  7011. echo " * SIGNAL: $ENABLED_SIGNAL"
  7012. echo " * chrony: $ENABLED_CHRONY"
  7013. echo " * ERROR_STRINGS: $ENABLED_ERROR_STRINGS"
  7014. echo " * DTLS: $ENABLED_DTLS"
  7015. echo " * SCTP: $ENABLED_SCTP"
  7016. echo " * SRTP: $ENABLED_SRTP"
  7017. echo " * Indefinite Length: $ENABLED_BER_INDEF"
  7018. echo " * Multicast: $ENABLED_MCAST"
  7019. echo " * SSL v3.0 (Old): $ENABLED_SSLV3"
  7020. echo " * TLS v1.0 (Old): $ENABLED_TLSV10"
  7021. echo " * TLS v1.1 (Old): $ENABLED_OLD_TLS"
  7022. echo " * TLS v1.2: $ENABLED_TLSV12"
  7023. echo " * TLS v1.3: $ENABLED_TLS13"
  7024. echo " * Post-handshake Auth: $ENABLED_TLS13_POST_AUTH"
  7025. echo " * Early Data: $ENABLED_TLS13_EARLY_DATA"
  7026. echo " * Send State in HRR Cookie: $ENABLED_SEND_HRR_COOKIE"
  7027. echo " * OCSP: $ENABLED_OCSP"
  7028. echo " * OCSP Stapling: $ENABLED_CERTIFICATE_STATUS_REQUEST"
  7029. echo " * OCSP Stapling v2: $ENABLED_CERTIFICATE_STATUS_REQUEST_V2"
  7030. echo " * CRL: $ENABLED_CRL"
  7031. echo " * CRL-MONITOR: $ENABLED_CRL_MONITOR"
  7032. echo " * Persistent session cache: $ENABLED_SAVESESSION"
  7033. echo " * Persistent cert cache: $ENABLED_SAVECERT"
  7034. echo " * Atomic User Record Layer: $ENABLED_ATOMICUSER"
  7035. echo " * Public Key Callbacks: $ENABLED_PKCALLBACKS"
  7036. echo " * liboqs: $ENABLED_LIBOQS"
  7037. echo " * Whitewood netRandom: $ENABLED_WNR"
  7038. echo " * Server Name Indication: $ENABLED_SNI"
  7039. echo " * ALPN: $ENABLED_ALPN"
  7040. echo " * Maximum Fragment Length: $ENABLED_MAX_FRAGMENT"
  7041. echo " * Trusted CA Indication: $ENABLED_TRUSTED_CA"
  7042. echo " * Truncated HMAC: $ENABLED_TRUNCATED_HMAC"
  7043. echo " * Supported Elliptic Curves: $ENABLED_SUPPORTED_CURVES"
  7044. echo " * FFDHE only in client: $ENABLED_FFDHE_ONLY"
  7045. echo " * Session Ticket: $ENABLED_SESSION_TICKET"
  7046. echo " * Extended Master Secret: $ENABLED_EXTENDED_MASTER"
  7047. echo " * Renegotiation Indication: $ENABLED_RENEGOTIATION_INDICATION"
  7048. echo " * Secure Renegotiation: $ENABLED_SECURE_RENEGOTIATION"
  7049. echo " * Fallback SCSV: $ENABLED_FALLBACK_SCSV"
  7050. echo " * Keying Material Exporter: $ENABLED_KEYING_MATERIAL"
  7051. echo " * All TLS Extensions: $ENABLED_TLSX"
  7052. echo " * PKCS#7: $ENABLED_PKCS7"
  7053. echo " * S/MIME: $ENABLED_SMIME"
  7054. echo " * wolfSSH: $ENABLED_WOLFSSH"
  7055. echo " * wolfEngine: $ENABLED_WOLFENGINE"
  7056. echo " * wolfTPM: $ENABLED_WOLFTPM"
  7057. echo " * wolfCLU: $ENABLED_WOLFCLU"
  7058. echo " * wolfSCEP: $ENABLED_WOLFSCEP"
  7059. echo " * Secure Remote Password: $ENABLED_SRP"
  7060. echo " * Small Stack: $ENABLED_SMALL_STACK"
  7061. echo " * Linux Kernel Module: $ENABLED_LINUXKM"
  7062. echo " * valgrind unit tests: $ENABLED_VALGRIND"
  7063. echo " * LIBZ: $ENABLED_LIBZ"
  7064. echo " * Examples: $ENABLED_EXAMPLES"
  7065. echo " * Crypt tests: $ENABLED_CRYPT_TESTS"
  7066. echo " * Stack sizes in tests: $ENABLED_STACKSIZE"
  7067. echo " * Heap stats in tests: $ENABLED_TRACKMEMORY"
  7068. echo " * User Crypto: $ENABLED_USER_CRYPTO"
  7069. echo " * Fast RSA: $ENABLED_FAST_RSA"
  7070. echo " * Single Precision: $ENABLED_SP"
  7071. if test "$ENABLED_SP_MATH_ALL" != "no"
  7072. then
  7073. ENABLED_SP_MATH_DESC="all"
  7074. else
  7075. if test "$ENABLED_SP_MATH" != "no"
  7076. then
  7077. ENABLED_SP_MATH_DESC="restricted"
  7078. else
  7079. ENABLED_SP_MATH_DESC="no"
  7080. fi
  7081. fi
  7082. echo " * SP math implementation: $ENABLED_SP_MATH_DESC"
  7083. echo " * Async Crypto: $ENABLED_ASYNCCRYPT"
  7084. echo " * PKCS#8: $ENABLED_PKCS8"
  7085. echo " * PKCS#11: $ENABLED_PKCS11"
  7086. echo " * PKCS#12: $ENABLED_PKCS12"
  7087. echo " * Cavium Nitrox: $ENABLED_CAVIUM"
  7088. echo " * Cavium Octeon (Sync): $ENABLED_OCTEON_SYNC"
  7089. echo " * Intel Quick Assist: $ENABLED_INTEL_QA"
  7090. if test "$ENABLED_ARMASM_INLINE" = "yes"
  7091. then
  7092. ENABLED_ARMASM="inline C"
  7093. fi
  7094. echo " * ARM ASM: $ENABLED_ARMASM"
  7095. echo " * ARM ASM SHA512/SHA3 Crypto $ENABLED_ARMASM_SHA3"
  7096. echo " * AES Key Wrap: $ENABLED_AESKEYWRAP"
  7097. echo " * Write duplicate: $ENABLED_WRITEDUP"
  7098. echo " * Xilinx Hardware Acc.: $ENABLED_XILINX"
  7099. echo " * Inline Code: $ENABLED_INLINE"
  7100. echo " * Linux AF_ALG: $ENABLED_AFALG"
  7101. echo " * Linux KCAPI: $ENABLED_KCAPI"
  7102. echo " * Linux devcrypto: $ENABLED_DEVCRYPTO"
  7103. echo " * Crypto callbacks: $ENABLED_CRYPTOCB"
  7104. echo " * i.MX CAAM: $ENABLED_CAAM"
  7105. echo " * IoT-Safe: $ENABLED_IOTSAFE"
  7106. echo " * IoT-Safe HWRNG: $ENABLED_IOTSAFE_HWRNG"
  7107. echo " * NXP SE050: $ENABLED_SE050"
  7108. echo " * PSA: $ENABLED_PSA"
  7109. echo ""
  7110. echo "---"
  7111. fi # $silent != yes
  7112. ################################################################################
  7113. # Show warnings at bottom so they are noticed
  7114. ################################################################################
  7115. if test "$ENABLED_ASYNCCRYPT" = "yes" && ! test -s $srcdir/wolfcrypt/src/async.c
  7116. then
  7117. AC_MSG_WARN([Make sure real async files are loaded. Contact wolfSSL for details on using the asynccrypt option.])
  7118. fi
  7119. # MinGW static vs shared library
  7120. # Reference URL from libtool for MinGW is located at
  7121. # http://www.gnu.org/software/libtool/manual/libtool.html#Cygwin-to-MinGW-Cross
  7122. # this allows for not even having dllimport/dllexport on functions
  7123. # with recent libtools, only requiring it with global variables.
  7124. #
  7125. # The following warning is displayed here because if not using "contemporary GNU
  7126. # tools" there is the possibility of export/import issues.
  7127. # wolfSSL uses __declspec(dllexport) and "contemporary GNU tools" handle the
  7128. # case where both static and shared libraries are built.
  7129. #
  7130. # More can be found about the MinGW linker at
  7131. # https://sourceware.org/binutils/docs/ld/WIN32.html
  7132. if test "$MINGW_LIB_WARNING" = "yes"
  7133. then
  7134. AC_MSG_WARN([Building with shared and static library at the same time on this system may cause export/import problems when using non contemporary GNU tools.])
  7135. fi