configure.ac 290 KB

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