configure.ac 215 KB

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