configure.ac 261 KB

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