configure.ac 275 KB

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