configure.ac 308 KB

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