configure.ac 212 KB

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