configure.ac 263 KB

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