makepanda.py 318 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as queue
  18. except KeyboardInterrupt:
  19. raise
  20. except:
  21. print("You are either using an incomplete or an old version of Python!")
  22. print("Please install the development package of Python and try again.")
  23. exit(1)
  24. from makepandacore import *
  25. import time
  26. import os
  27. import sys
  28. from sysconfig import get_platform
  29. ########################################################################
  30. ##
  31. ## PARSING THE COMMAND LINE OPTIONS
  32. ##
  33. ## You might be tempted to change the defaults by editing them
  34. ## here. Don't do it. Instead, create a script that compiles
  35. ## panda with your preferred options. Or, create
  36. ## a 'makepandaPreferences' file and put it into your python path.
  37. ##
  38. ########################################################################
  39. COMPILER=0
  40. INSTALLER=0
  41. WHEEL=0
  42. RUNTESTS=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. CXXFLAGS=""
  48. LDFLAGS=""
  49. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMVERSION=None
  57. RPMRELEASE="1"
  58. GIT_COMMIT=None
  59. P3DSUFFIX=None
  60. MAJOR_VERSION=None
  61. COREAPI_VERSION=None
  62. PLUGIN_VERSION=None
  63. OSXTARGET=None
  64. OSX_ARCHS=[]
  65. HOST_URL=None
  66. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  67. STRDXSDKVERSION = 'default'
  68. WINDOWS_SDK = None
  69. MSVC_VERSION = None
  70. BOOUSEINTELCOMPILER = False
  71. OPENCV_VER_23 = False
  72. PLATFORM = None
  73. COPY_PYTHON = True
  74. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  75. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  76. PkgListSet(["PYTHON", "DIRECT", # Python support
  77. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  78. "EGL", # OpenGL (ES) integration
  79. "EIGEN", # Linear algebra acceleration
  80. "OPENAL", "FMODEX", # Audio playback
  81. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  82. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  83. "SPEEDTREE", # SpeedTree
  84. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  85. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  86. "FREETYPE", "HARFBUZZ", # Text rendering
  87. "VRPN", "OPENSSL", # Transport
  88. "FFTW", # Algorithm helpers
  89. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  90. "GTK2", # GTK2 is used for PStats on Unix
  91. "MFC", "WX", "FLTK", # Used for web plug-in only
  92. "ROCKET", # GUI libraries
  93. "CARBON", "COCOA", # macOS toolkits
  94. "X11", # Unix platform support
  95. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  96. "SKEL", # Example SKEL project
  97. "PANDAFX", # Some distortion special lenses
  98. "PANDAPARTICLESYSTEM", # Built in particle system
  99. "CONTRIB", # Experimental
  100. "SSE2", "NEON", # Compiler features
  101. "MIMALLOC", # Memory allocators
  102. ])
  103. CheckPandaSourceTree()
  104. def keyboardInterruptHandler(x,y):
  105. exit("keyboard interrupt")
  106. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  107. ########################################################################
  108. ##
  109. ## Command-line parser.
  110. ##
  111. ## You can type "makepanda --help" to see all the options.
  112. ##
  113. ########################################################################
  114. def usage(problem):
  115. if (problem):
  116. print("")
  117. print("Error parsing command-line input: %s" % (problem))
  118. print("")
  119. print("Makepanda generates a 'built' subdirectory containing a")
  120. print("compiled copy of Panda3D. Command-line arguments are:")
  121. print("")
  122. print(" --help (print the help message you're reading now)")
  123. print(" --verbose (print out more information)")
  124. print(" --runtime (build a runtime build instead of an SDK build)")
  125. print(" --tests (run the test suite)")
  126. print(" --installer (build an installer)")
  127. print(" --wheel (build a pip-installable .whl)")
  128. print(" --optimize X (optimization level can be 1,2,3,4)")
  129. print(" --version X (set the panda version number)")
  130. print(" --lzma (use lzma compression when building Windows installer)")
  131. print(" --distributor X (short string identifying the distributor of the build)")
  132. print(" --outputdir X (use the specified directory instead of 'built')")
  133. print(" --host URL (set the host url (runtime build only))")
  134. print(" --threads N (use the multithreaded build system. see manual)")
  135. print(" --osxtarget N (the macOS version number to build for (macOS only))")
  136. print(" --universal (build universal binaries (macOS only))")
  137. print(" --override \"O=V\" (override dtool_config/prc option value)")
  138. print(" --static (builds libraries for static linking)")
  139. print(" --target X (experimental cross-compilation (android only))")
  140. print(" --arch X (target architecture for cross-compilation)")
  141. print("")
  142. for pkg in PkgListGet():
  143. p = pkg.lower()
  144. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  145. if sys.platform != 'win32':
  146. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  147. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  148. print("")
  149. print(" --nothing (disable every third-party lib)")
  150. print(" --everything (enable every third-party lib)")
  151. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  152. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1, 10 or 11. Default is 7.1)")
  153. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)")
  154. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  155. print("")
  156. print("The simplest way to compile panda is to just type:")
  157. print("")
  158. print(" makepanda --everything")
  159. print("")
  160. os._exit(1)
  161. def parseopts(args):
  162. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  163. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  164. global DEBVERSION,WHLVERSION,RPMVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  165. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  166. global COPY_PYTHON
  167. # Options for which to display a deprecation warning.
  168. removedopts = [
  169. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  170. ]
  171. # All recognized options.
  172. longopts = [
  173. "help","distributor=","verbose","runtime","osxtarget=","tests",
  174. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  175. "version=","lzma","no-python","threads=","outputdir=","override=",
  176. "static","host=","debversion=","rpmversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  177. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  178. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  179. "cggl-incdir=", "cggl-libdir=",
  180. ] + removedopts
  181. anything = 0
  182. optimize = ""
  183. target = None
  184. target_archs = []
  185. universal = False
  186. clean_build = False
  187. for pkg in PkgListGet():
  188. longopts.append("use-" + pkg.lower())
  189. longopts.append("no-" + pkg.lower())
  190. longopts.append(pkg.lower() + "-incdir=")
  191. longopts.append(pkg.lower() + "-libdir=")
  192. try:
  193. opts, extras = getopt.getopt(args, "", longopts)
  194. for option, value in opts:
  195. if (option=="--help"): raise Exception
  196. elif (option=="--optimize"): optimize=value
  197. elif (option=="--installer"): INSTALLER=1
  198. elif (option=="--tests"): RUNTESTS=1
  199. elif (option=="--wheel"): WHEEL=1
  200. elif (option=="--verbose"): SetVerbose(True)
  201. elif (option=="--distributor"): DISTRIBUTOR=value
  202. elif (option=="--rtdist"): RTDIST=1
  203. elif (option=="--runtime"): RUNTIME=1
  204. elif (option=="--genman"): GENMAN=1
  205. elif (option=="--everything"): PkgEnableAll()
  206. elif (option=="--nothing"): PkgDisableAll()
  207. elif (option=="--threads"): THREADCOUNT=int(value)
  208. elif (option=="--outputdir"): SetOutputDir(value.strip())
  209. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  210. elif (option=="--universal"): universal = True
  211. elif (option=="--target"): target = value.strip()
  212. elif (option=="--arch"): target_archs.append(value.strip())
  213. elif (option=="--nocolor"): DisableColors()
  214. elif (option=="--version"):
  215. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  216. if not match:
  217. usage("version requires three digits")
  218. WHLVERSION = value
  219. VERSION = match.group()
  220. elif (option=="--lzma"): COMPRESSOR="lzma"
  221. elif (option=="--override"): AddOverride(value.strip())
  222. elif (option=="--static"): SetLinkAllStatic(True)
  223. elif (option=="--host"): HOST_URL=value
  224. elif (option=="--debversion"): DEBVERSION=value
  225. elif (option=="--rpmversion"): RPMVERSION=value
  226. elif (option=="--rpmrelease"): RPMRELEASE=value
  227. elif (option=="--git-commit"): GIT_COMMIT=value
  228. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  229. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  230. # Backward compatibility, OPENGL was renamed to GL
  231. elif (option=="--use-opengl"): PkgEnable("GL")
  232. elif (option=="--no-opengl"): PkgDisable("GL")
  233. elif (option=="--directx-sdk"):
  234. STRDXSDKVERSION = value.strip().lower()
  235. if STRDXSDKVERSION == '':
  236. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  237. STRDXSDKVERSION = 'default'
  238. elif (option=="--windows-sdk"):
  239. WINDOWS_SDK = value.strip().lower()
  240. elif (option=="--msvc-version"):
  241. MSVC_VERSION = value.strip().lower()
  242. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  243. elif (option=="--clean"): clean_build = True
  244. elif (option=="--no-copy-python"): COPY_PYTHON = False
  245. elif (option[2:] in removedopts):
  246. Warn("Ignoring removed option %s" % (option))
  247. else:
  248. for pkg in PkgListGet() + ['CGGL']:
  249. if option == "--use-" + pkg.lower():
  250. PkgEnable(pkg)
  251. break
  252. elif option == "--no-" + pkg.lower():
  253. PkgDisable(pkg)
  254. break
  255. elif option == "--" + pkg.lower() + "-incdir":
  256. PkgSetCustomLocation(pkg)
  257. IncDirectory(pkg, value)
  258. break
  259. elif option == "--" + pkg.lower() + "-libdir":
  260. PkgSetCustomLocation(pkg)
  261. LibDirectory(pkg, value)
  262. break
  263. if (option == "--everything" or option.startswith("--use-")
  264. or option == "--nothing" or option.startswith("--no-")):
  265. anything = 1
  266. except:
  267. usage(sys.exc_info()[1])
  268. if not anything:
  269. if RUNTIME:
  270. PkgEnableAll()
  271. else:
  272. usage("You should specify a list of packages to use or --everything to enable all packages.")
  273. if (RTDIST and RUNTIME):
  274. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  275. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  276. elif (optimize==""): optimize = "3"
  277. if OSXTARGET:
  278. parts = OSXTARGET.strip().split('.')
  279. try:
  280. assert len(parts) <= 2
  281. maj = int(parts[0])
  282. min = 0
  283. if len(parts) > 1:
  284. min = int(parts[1])
  285. OSXTARGET = maj, min
  286. assert OSXTARGET >= (10, 4)
  287. except:
  288. usage("Invalid setting for --osxtarget")
  289. else:
  290. OSXTARGET = None
  291. if target is not None or target_archs:
  292. SetTarget(target, target_archs[-1] if target_archs else None)
  293. if universal:
  294. if target_archs:
  295. exit("--universal is incompatible with --arch")
  296. if OSXTARGET:
  297. osxver = OSXTARGET
  298. else:
  299. maj, min = platform.mac_ver()[0].split('.')[:2]
  300. osxver = int(maj), int(min)
  301. if osxver < (10, 15):
  302. OSX_ARCHS.append("i386")
  303. if osxver < (10, 6):
  304. OSX_ARCHS.append("ppc")
  305. else:
  306. OSX_ARCHS.append("x86_64")
  307. if osxver >= (11, 0):
  308. OSX_ARCHS.append("arm64")
  309. elif target_archs:
  310. OSX_ARCHS = target_archs
  311. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  312. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  313. elif platform.machine() == 'arm64':
  314. OSX_ARCHS = ('arm64',)
  315. try:
  316. SetOptimize(int(optimize))
  317. assert GetOptimize() in [1, 2, 3, 4]
  318. except:
  319. usage("Invalid setting for OPTIMIZE")
  320. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  321. usage("Invalid SHA-1 hash given for --git-commit option!")
  322. if GetTarget() == 'windows':
  323. if not MSVC_VERSION:
  324. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  325. MSVC_VERSION = (14, 0)
  326. else:
  327. try:
  328. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  329. if (len(MSVC_VERSION) == 1):
  330. MSVC_VERSION += (0,)
  331. except:
  332. usage("Invalid setting for --msvc-version")
  333. if MSVC_VERSION < (14, 0):
  334. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  335. print("=========================================================================")
  336. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  337. print(warn_prefix + "For more information, or any questions, please visit:")
  338. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  339. print("=========================================================================")
  340. sys.stdout.flush()
  341. time.sleep(1.0)
  342. sys.exit(1)
  343. if not WINDOWS_SDK:
  344. print("No Windows SDK version specified. Defaulting to '7.1'.")
  345. WINDOWS_SDK = '7.1'
  346. if clean_build and os.path.isdir(GetOutputDir()):
  347. print("Deleting %s" % (GetOutputDir()))
  348. shutil.rmtree(GetOutputDir())
  349. parseopts(sys.argv[1:])
  350. ########################################################################
  351. ##
  352. ## Handle environment variables.
  353. ##
  354. ########################################################################
  355. if ("CFLAGS" in os.environ):
  356. CFLAGS = os.environ["CFLAGS"].strip()
  357. if ("CXXFLAGS" in os.environ):
  358. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  359. if ("RPM_OPT_FLAGS" in os.environ):
  360. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  361. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  362. if ("LDFLAGS" in os.environ):
  363. LDFLAGS = os.environ["LDFLAGS"].strip()
  364. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  365. if GetHost() == "darwin" and OSXTARGET is not None:
  366. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  367. ########################################################################
  368. ##
  369. ## Configure things based on the command-line parameters.
  370. ##
  371. ########################################################################
  372. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  373. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  374. if VERSION is None:
  375. if RUNTIME:
  376. VERSION = PLUGIN_VERSION
  377. else:
  378. # Take the value from the setup.cfg file.
  379. VERSION = GetMetadataValue('version')
  380. match = re.match(r'^\d+\.\d+(\.\d+)+', VERSION)
  381. if not match:
  382. exit("Invalid version %s in setup.cfg, three digits are required" % (VERSION))
  383. if WHLVERSION is None:
  384. WHLVERSION = VERSION
  385. VERSION = match.group()
  386. if WHLVERSION is None:
  387. WHLVERSION = VERSION
  388. print("Version: %s" % VERSION)
  389. if RUNTIME or RTDIST:
  390. print("Core API Version: %s" % COREAPI_VERSION)
  391. if DEBVERSION is None:
  392. DEBVERSION = VERSION
  393. if RPMVERSION is None:
  394. RPMVERSION = VERSION
  395. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  396. if P3DSUFFIX is None:
  397. P3DSUFFIX = MAJOR_VERSION
  398. # Now determine the distutils-style platform tag for the target system.
  399. target = GetTarget()
  400. target_arch = GetTargetArch()
  401. if target == 'windows':
  402. if target_arch == 'x64':
  403. PLATFORM = 'win-amd64'
  404. else:
  405. PLATFORM = 'win32'
  406. elif target == 'darwin':
  407. if OSXTARGET:
  408. osxver = OSXTARGET
  409. else:
  410. maj, min = platform.mac_ver()[0].split('.')[:2]
  411. osxver = int(maj), int(min)
  412. if osxver[0] >= 11:
  413. # I think Python pins minor version to 0 from macOS 11 onward
  414. osxver = (osxver[0], 0)
  415. arch_tag = None
  416. if not OSX_ARCHS:
  417. arch_tag = target_arch
  418. elif len(OSX_ARCHS) == 1:
  419. arch_tag = OSX_ARCHS[0]
  420. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  421. arch_tag = 'fat'
  422. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  423. arch_tag = 'intel'
  424. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  425. arch_tag = 'fat64'
  426. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  427. arch_tag = 'fat32'
  428. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  429. arch_tag = 'universal'
  430. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  431. arch_tag = 'universal2'
  432. else:
  433. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  434. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  435. elif target == 'linux' and (os.path.isfile("/lib/libc-2.5.so") or os.path.isfile("/lib64/libc-2.5.so")) and os.path.isdir("/opt/python"):
  436. # This is manylinux1. A bit of a sloppy check, though.
  437. if target_arch in ('x86_64', 'amd64'):
  438. PLATFORM = 'manylinux1-x86_64'
  439. elif target_arch in ('arm64', 'aarch64'):
  440. PLATFORM = 'manylinux1-aarch64'
  441. else:
  442. PLATFORM = 'manylinux1-i686'
  443. elif target == 'linux' and (os.path.isfile("/lib/libc-2.12.so") or os.path.isfile("/lib64/libc-2.12.so")) and os.path.isdir("/opt/python"):
  444. # Same sloppy check for manylinux2010.
  445. if target_arch in ('x86_64', 'amd64'):
  446. PLATFORM = 'manylinux2010-x86_64'
  447. elif target_arch in ('arm64', 'aarch64'):
  448. PLATFORM = 'manylinux2010-aarch64'
  449. else:
  450. PLATFORM = 'manylinux2010-i686'
  451. elif target == 'linux' and (os.path.isfile("/lib/libc-2.17.so") or os.path.isfile("/lib64/libc-2.17.so")) and os.path.isdir("/opt/python"):
  452. # Same sloppy check for manylinux2014.
  453. if target_arch in ('x86_64', 'amd64'):
  454. PLATFORM = 'manylinux2014-x86_64'
  455. elif target_arch in ('arm64', 'aarch64'):
  456. PLATFORM = 'manylinux2014-aarch64'
  457. else:
  458. PLATFORM = 'manylinux2014-i686'
  459. elif target == 'linux' and (os.path.isfile("/lib/i386-linux-gnu/libc-2.24.so") or os.path.isfile("/lib/x86_64-linux-gnu/libc-2.24.so")) and os.path.isdir("/opt/python"):
  460. # Same sloppy check for manylinux_2_24.
  461. if target_arch in ('x86_64', 'amd64'):
  462. PLATFORM = 'manylinux_2_24-x86_64'
  463. elif target_arch in ('arm64', 'aarch64'):
  464. PLATFORM = 'manylinux_2_24-aarch64'
  465. else:
  466. PLATFORM = 'manylinux_2_24-i686'
  467. elif target == 'linux' and os.path.isfile("/lib64/libc-2.28.so") and os.path.isfile('/etc/almalinux-release') and os.path.isdir("/opt/python"):
  468. # Same sloppy check for manylinux_2_28.
  469. if target_arch in ('x86_64', 'amd64'):
  470. PLATFORM = 'manylinux_2_28-x86_64'
  471. elif target_arch in ('arm64', 'aarch64'):
  472. PLATFORM = 'manylinux_2_28-aarch64'
  473. else:
  474. raise RuntimeError('Unhandled arch %s, please file a bug report!' % (target_arch))
  475. elif not CrossCompiling():
  476. if HasTargetArch():
  477. # Replace the architecture in the platform string.
  478. platform_parts = get_platform().rsplit('-', 1)
  479. if target_arch == 'amd64':
  480. target_arch = 'x86_64'
  481. PLATFORM = platform_parts[0] + '-' + target_arch
  482. else:
  483. # We're not cross-compiling; just take the host arch.
  484. PLATFORM = get_platform()
  485. else:
  486. if target_arch == 'amd64':
  487. target_arch = 'x86_64'
  488. PLATFORM = '{0}-{1}'.format(target, target_arch)
  489. print("Platform: %s" % PLATFORM)
  490. outputdir_suffix = ""
  491. if (RUNTIME or RTDIST):
  492. # Compiling Maya/Max is pointless in rtdist build
  493. for ver in MAYAVERSIONS + MAXVERSIONS:
  494. PkgDisable(ver)
  495. if (DISTRIBUTOR.strip() == ""):
  496. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  497. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  498. if (RUNTIME):
  499. outputdir_suffix += "_rt"
  500. if DISTRIBUTOR == "":
  501. DISTRIBUTOR = "makepanda"
  502. elif not RTDIST_VERSION:
  503. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  504. if not RTDIST_VERSION:
  505. RTDIST_VERSION = "dev"
  506. if not IsCustomOutputDir():
  507. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  508. outputdir_suffix += '_x64'
  509. SetOutputDir("built" + outputdir_suffix)
  510. if (RUNTIME):
  511. for pkg in PkgListGet():
  512. if pkg in ["GTK2", "MFC"]:
  513. # Optional package(s) for runtime.
  514. pass
  515. elif pkg in ["OPENSSL", "ZLIB"]:
  516. # Required packages for runtime.
  517. if (PkgSkip(pkg)==1):
  518. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  519. else:
  520. # Unused packages for runtime.
  521. PkgDisable(pkg)
  522. if (INSTALLER and RTDIST):
  523. exit("Cannot build an installer for the rtdist build!")
  524. if (WHEEL and RUNTIME):
  525. exit("Cannot build a wheel for the runtime build!")
  526. if (WHEEL and RTDIST):
  527. exit("Cannot build a wheel for the rtdist build!")
  528. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  529. exit("Cannot build installer on Windows without python")
  530. if WHEEL and PkgSkip("PYTHON"):
  531. exit("Cannot build wheel without Python")
  532. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  533. exit("Cannot build rtdist without wx or fltk")
  534. if (RUNTIME):
  535. SetLinkAllStatic(True)
  536. if not os.path.isdir("contrib"):
  537. PkgDisable("CONTRIB")
  538. ########################################################################
  539. ##
  540. ## Load the dependency cache.
  541. ##
  542. ########################################################################
  543. LoadDependencyCache()
  544. ########################################################################
  545. ##
  546. ## Locate various SDKs.
  547. ##
  548. ########################################################################
  549. MakeBuildTree()
  550. SdkLocateDirectX(STRDXSDKVERSION)
  551. SdkLocateMaya()
  552. SdkLocateMax()
  553. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  554. SdkLocatePython(RTDIST)
  555. SdkLocateWindows(WINDOWS_SDK)
  556. SdkLocatePhysX()
  557. SdkLocateSpeedTree()
  558. SdkLocateAndroid()
  559. SdkAutoDisableDirectX()
  560. SdkAutoDisableMaya()
  561. SdkAutoDisableMax()
  562. SdkAutoDisablePhysX()
  563. SdkAutoDisableSpeedTree()
  564. if RTDIST and DISTRIBUTOR == "cmu":
  565. # Some validation checks for the CMU builds.
  566. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  567. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  568. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  569. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  570. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  571. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  572. if RTDIST and not HOST_URL:
  573. exit("You must specify a host URL when building the rtdist!")
  574. if RUNTIME and not HOST_URL:
  575. # Set this to a nice default.
  576. HOST_URL = "https://runtime.panda3d.org/"
  577. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  578. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  579. print("==========================================================================")
  580. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  581. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  582. print(warn_prefix + "Please upgrade to Python 3 now.")
  583. print("==========================================================================")
  584. sys.stdout.flush()
  585. # Give the user some time to contemplate their sins
  586. time.sleep(6.0)
  587. ########################################################################
  588. ##
  589. ## Choose a Compiler.
  590. ##
  591. ## This should also set up any environment variables needed to make
  592. ## the compiler work.
  593. ##
  594. ########################################################################
  595. if GetHost() == 'windows' and GetTarget() == 'windows':
  596. COMPILER = "MSVC"
  597. SdkLocateVisualStudio(MSVC_VERSION)
  598. else:
  599. COMPILER = "GCC"
  600. SetupBuildEnvironment(COMPILER)
  601. ########################################################################
  602. ##
  603. ## External includes, external libraries, and external defsyms.
  604. ##
  605. ########################################################################
  606. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  607. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  608. if (COMPILER == "MSVC"):
  609. PkgDisable("X11")
  610. PkgDisable("GLES")
  611. PkgDisable("GLES2")
  612. PkgDisable("EGL")
  613. PkgDisable("CARBON")
  614. PkgDisable("COCOA")
  615. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  616. if (PkgSkip("PYTHON")==0):
  617. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  618. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  619. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  620. for pkg in PkgListGet():
  621. if (PkgSkip(pkg)==0):
  622. if (pkg[:4]=="MAYA"):
  623. IncDirectory(pkg, SDK[pkg] + "/include")
  624. DefSymbol(pkg, "MAYAVERSION", pkg)
  625. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  626. elif (pkg[:3]=="MAX"):
  627. IncDirectory(pkg, SDK[pkg] + "/include")
  628. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  629. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  630. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  631. DefSymbol(pkg, "MAX", pkg)
  632. if (int(pkg[3:]) >= 2013):
  633. DefSymbol(pkg, "UNICODE", "")
  634. DefSymbol(pkg, "_UNICODE", "")
  635. elif (pkg[:2]=="DX"):
  636. IncDirectory(pkg, SDK[pkg] + "/include")
  637. elif GetThirdpartyDir() is not None:
  638. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  639. for pkg in DXVERSIONS:
  640. if (PkgSkip(pkg)==0):
  641. vnum=pkg[2:]
  642. if GetTargetArch() == 'x64':
  643. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  644. else:
  645. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  646. LibDirectory(pkg, SDK[pkg] + '/lib')
  647. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  648. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  649. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  650. LibName(pkg, 'dxerr.lib')
  651. else:
  652. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  653. #LibName(pkg, 'ddraw.lib')
  654. LibName(pkg, 'dxguid.lib')
  655. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  656. # dxerr needs this for __vsnwprintf definition.
  657. LibName(pkg, 'legacy_stdio_definitions.lib')
  658. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  659. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  660. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  661. LibName("WINSOCK", "wsock32.lib")
  662. LibName("WINSOCK2", "wsock32.lib")
  663. LibName("WINSOCK2", "ws2_32.lib")
  664. LibName("WINCOMCTL", "comctl32.lib")
  665. LibName("WINCOMDLG", "comdlg32.lib")
  666. LibName("WINUSER", "user32.lib")
  667. LibName("WINMM", "winmm.lib")
  668. LibName("WINIMM", "imm32.lib")
  669. LibName("WINKERNEL", "kernel32.lib")
  670. LibName("WINOLE", "ole32.lib")
  671. LibName("WINOLEAUT", "oleaut32.lib")
  672. LibName("WINOLDNAMES", "oldnames.lib")
  673. LibName("WINSHELL", "shell32.lib")
  674. LibName("WINGDI", "gdi32.lib")
  675. LibName("ADVAPI", "advapi32.lib")
  676. LibName("IPHLPAPI", "iphlpapi.lib")
  677. LibName("SETUPAPI", "setupapi.lib")
  678. LibName("GL", "opengl32.lib")
  679. LibName("GLES", "libgles_cm.lib")
  680. LibName("GLES2", "libGLESv2.lib")
  681. LibName("EGL", "libEGL.lib")
  682. LibName("MSIMG", "msimg32.lib")
  683. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  684. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  685. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  686. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  687. if (PkgSkip("MIMALLOC")==0): LibName("MIMALLOC", GetThirdpartyDir() + "mimalloc/lib/mimalloc-static.lib")
  688. if (PkgSkip("OPENSSL")==0):
  689. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  690. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  691. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  692. elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
  693. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  694. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  695. else:
  696. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
  697. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
  698. LibName("OPENSSL", "crypt32.lib")
  699. LibName("OPENSSL", "ws2_32.lib")
  700. if (PkgSkip("PNG")==0):
  701. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  702. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  703. else:
  704. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  705. if (PkgSkip("TIFF")==0):
  706. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  707. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  708. else:
  709. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  710. if (PkgSkip("OPENEXR")==0):
  711. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXRCore-3_1.lib"):
  712. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_1.lib")
  713. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_1.lib")
  714. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_1.lib")
  715. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_1.lib")
  716. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib"):
  717. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib")
  718. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_0.lib")
  719. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_0.lib")
  720. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_0.lib")
  721. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR.lib"):
  722. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR.lib")
  723. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread.lib")
  724. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath.lib")
  725. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex.lib")
  726. else:
  727. suffix = ""
  728. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  729. suffix = "-2_2"
  730. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  731. suffix = "-2_3"
  732. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  733. suffix = "-2_4"
  734. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  735. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  736. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  737. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  738. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  739. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  740. if suffix == "-2_2":
  741. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  742. else:
  743. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  744. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  745. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath")
  746. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  747. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  748. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  749. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  750. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  751. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  752. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  753. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  754. if (PkgSkip("HARFBUZZ")==0):
  755. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  756. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  757. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  758. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  759. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  760. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  761. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  762. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  763. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  764. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  765. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  766. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  767. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  768. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  769. if (PkgSkip("FCOLLADA")==0):
  770. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  771. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  772. if (PkgSkip("ASSIMP")==0):
  773. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  774. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  775. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  776. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  777. if (PkgSkip("SQUISH")==0):
  778. if GetOptimize() <= 2:
  779. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  780. else:
  781. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  782. if (PkgSkip("ROCKET")==0):
  783. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  784. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  785. if (PkgSkip("PYTHON")==0):
  786. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  787. if (GetOptimize() <= 3):
  788. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  789. if (PkgSkip("OPENAL")==0):
  790. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  791. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  792. # Link OpenAL Soft statically.
  793. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  794. if (PkgSkip("ODE")==0):
  795. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  796. DefSymbol("ODE", "dSINGLE", "")
  797. if (PkgSkip("FMODEX")==0):
  798. if (GetTargetArch() == 'x64'):
  799. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  800. else:
  801. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  802. if (PkgSkip("FLTK")==0 and RTDIST):
  803. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  804. if not PkgSkip("FLTK"):
  805. # If we have fltk, we don't need wx
  806. PkgDisable("WX")
  807. if (PkgSkip("WX")==0 and RTDIST):
  808. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  809. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  810. DefSymbol("WX", "__WXMSW__", "")
  811. DefSymbol("WX", "_UNICODE", "")
  812. DefSymbol("WX", "UNICODE", "")
  813. if (PkgSkip("VORBIS")==0):
  814. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  815. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  816. if not os.path.isfile(path):
  817. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  818. LibName("VORBIS", path)
  819. if (PkgSkip("OPUS")==0):
  820. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  821. for lib in ('ogg', 'opus', 'opusfile'):
  822. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  823. if not os.path.isfile(path):
  824. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  825. LibName("OPUS", path)
  826. for pkg in MAYAVERSIONS:
  827. if (PkgSkip(pkg)==0):
  828. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  829. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  830. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  831. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  832. for pkg in MAXVERSIONS:
  833. if (PkgSkip(pkg)==0):
  834. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  835. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  836. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  837. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  838. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  839. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  840. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  841. if (PkgSkip("PHYSX")==0):
  842. if GetTargetArch() == 'x64':
  843. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  844. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  845. else:
  846. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  847. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  848. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  849. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  850. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  851. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  852. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  853. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  854. if (PkgSkip("SPEEDTREE")==0):
  855. if GetTargetArch() == 'x64':
  856. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  857. p64ext = '64'
  858. else:
  859. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  860. p64ext = ''
  861. debugext = ''
  862. if (GetOptimize() <= 2): debugext = "_d"
  863. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  864. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  865. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  866. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  867. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  868. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  869. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  870. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  871. LibName("SPEEDTREE", "glu32.lib")
  872. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  873. if (PkgSkip("BULLET")==0):
  874. suffix = '.lib'
  875. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  876. suffix = '_x64.lib'
  877. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  878. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  879. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  880. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  881. if (COMPILER=="GCC"):
  882. PkgDisable("MIMALLOC") # no discernable benefit over glibc
  883. if GetTarget() != "darwin":
  884. PkgDisable("CARBON")
  885. PkgDisable("COCOA")
  886. elif RUNTIME:
  887. # We don't support Cocoa in the runtime yet.
  888. PkgDisable("COCOA")
  889. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  890. # 64-bits macOS doesn't have Carbon.
  891. PkgDisable("CARBON")
  892. if GetTarget() == 'darwin':
  893. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  894. # These support only these archs, so don't build them if we're not
  895. # targeting any of the supported archs.
  896. PkgDisable("FMODEX")
  897. PkgDisable("NVIDIACG")
  898. PkgDisable("ROCKET")
  899. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  900. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  901. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  902. # Also, we can't target FMOD Ex with the 10.14 SDK
  903. PkgDisable("FMODEX")
  904. #if (PkgSkip("PYTHON")==0):
  905. # IncDirectory("PYTHON", SDK["PYTHON"])
  906. if (GetHost() == "darwin"):
  907. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  908. IncDirectory("FREETYPE", "/usr/X11/include")
  909. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  910. LibDirectory("FREETYPE", "/usr/X11/lib")
  911. if (GetHost() == "freebsd"):
  912. IncDirectory("ALWAYS", "/usr/local/include")
  913. LibDirectory("ALWAYS", "/usr/local/lib")
  914. if (os.path.isdir("/usr/PCBSD")):
  915. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  916. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  917. SmartPkgEnable("INOTIFY", "libinotify", ("inotify"), "sys/inotify.h")
  918. if GetTarget() != "windows":
  919. PkgDisable("DIRECTCAM")
  920. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  921. # WARNING! The order of the ffmpeg libraries matters!
  922. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  923. assimp_libs = ("libassimp", "libassimpd")
  924. # Name pkg-config libs, include(dir)s
  925. if (not RUNTIME):
  926. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  927. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  928. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  929. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  930. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  931. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  932. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  933. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  934. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  935. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  936. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  937. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  938. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  939. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  940. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  941. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  942. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  943. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  944. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  945. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  946. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h"))
  947. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  948. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  949. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  950. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  951. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  952. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  953. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  954. # because there's a circular dependency between the two libraries.
  955. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  956. for (opt, name) in LIBNAMES:
  957. if opt == "FREETYPE":
  958. LibName("HARFBUZZ", name)
  959. if not PkgSkip("FFMPEG"):
  960. if GetTarget() == "darwin":
  961. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  962. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  963. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  964. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  965. # Needed when linking ffmpeg statically on Linux.
  966. LibName("FFMPEG", "-Wl,-Bsymbolic")
  967. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  968. for ffmpeg_lib in ffmpeg_libs:
  969. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  970. if GetTarget() != "darwin":
  971. for fcollada_lib in fcollada_libs:
  972. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  973. if not PkgSkip("SWSCALE"):
  974. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  975. if not PkgSkip("SWRESAMPLE"):
  976. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  977. if not PkgSkip("JPEG"):
  978. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  979. if not PkgSkip("TIFF"):
  980. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  981. if not PkgSkip("PNG"):
  982. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  983. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  984. if not PkgSkip("SQUISH"):
  985. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  986. if not PkgSkip("OPENEXR"):
  987. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  988. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  989. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  990. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  991. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  992. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  993. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  994. if not PkgSkip("VORBIS"):
  995. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  996. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  997. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  998. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  999. if not PkgSkip("OPUS"):
  1000. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  1001. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  1002. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  1003. if not PkgSkip("VRPN"):
  1004. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  1005. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  1006. if not PkgSkip("ARTOOLKIT"):
  1007. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  1008. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  1009. if not PkgSkip("HARFBUZZ"):
  1010. LibName("HARFBUZZ", "-Wl,--exclude-libs,libharfbuzz.a")
  1011. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  1012. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  1013. if cv_lib == "opencv_core":
  1014. OPENCV_VER_23 = True
  1015. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  1016. else:
  1017. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  1018. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  1019. else:
  1020. PkgDisable("OPENCV")
  1021. if not PkgSkip("OPENAL"):
  1022. if GetTarget() == "darwin":
  1023. LibName("OPENAL", "-framework AudioUnit")
  1024. LibName("OPENAL", "-framework AudioToolbox")
  1025. LibName("OPENAL", "-framework CoreAudio")
  1026. else:
  1027. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  1028. if not PkgSkip("ASSIMP") and \
  1029. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  1030. # Also pick up IrrXML, which is needed when linking statically.
  1031. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  1032. if os.path.isfile(irrxml):
  1033. LibName("ASSIMP", irrxml)
  1034. if GetTarget() != "darwin":
  1035. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  1036. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  1037. rocket_libs = ("RocketCore", "RocketControls")
  1038. if (GetOptimize() <= 3):
  1039. rocket_libs += ("RocketDebugger",)
  1040. rocket_libs += ("boost_python",)
  1041. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  1042. if not PkgSkip("PYTHON"):
  1043. python_lib = SDK["PYTHONVERSION"]
  1044. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  1045. if GetTarget() == "linux":
  1046. LibName("PYTHON", "-lutil")
  1047. LibName("PYTHON", "-lrt")
  1048. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  1049. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  1050. SmartPkgEnable("GTK2", "gtk+-2.0")
  1051. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  1052. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  1053. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  1054. if (RTDIST):
  1055. SmartPkgEnable("WX", tool = "wx-config")
  1056. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  1057. if GetTarget() != 'darwin':
  1058. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  1059. if not PkgSkip("NVIDIACG") and not RUNTIME:
  1060. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1061. if not RUNTIME and GetTarget() != "android":
  1062. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1063. if GetHost() != "darwin":
  1064. # Workaround for an issue where pkg-config does not include this path
  1065. if GetTargetArch() in ("x86_64", "amd64"):
  1066. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1067. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1068. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1069. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1070. if not PkgSkip("X11"):
  1071. if (os.path.isdir("/usr/X11R6/lib64")):
  1072. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1073. else:
  1074. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1075. elif not PkgSkip("X11"):
  1076. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1077. if RUNTIME:
  1078. # For the runtime, these packages are required
  1079. for pkg in ["OPENSSL", "ZLIB"]:
  1080. skips = []
  1081. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1082. skips.append(pkg)
  1083. if skips:
  1084. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1085. for pkg in MAYAVERSIONS:
  1086. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1087. if (GetHost() == "darwin"):
  1088. # Sheesh, Autodesk really can't make up their mind
  1089. # regarding the location of the Maya devkit on macOS.
  1090. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1091. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1092. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1093. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1094. if (os.path.isdir(SDK[pkg] + "/lib")):
  1095. LibDirectory(pkg, SDK[pkg] + "/lib")
  1096. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1097. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1098. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1099. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1100. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1101. IncDirectory(pkg, SDK[pkg] + "/include")
  1102. else:
  1103. LibDirectory(pkg, SDK[pkg] + "/lib")
  1104. IncDirectory(pkg, SDK[pkg] + "/include")
  1105. DefSymbol(pkg, "MAYAVERSION", pkg)
  1106. if GetTarget() == 'darwin':
  1107. LibName("ALWAYS", "-framework AppKit")
  1108. if SDK["OSXTARGET"] < (26, 0):
  1109. LibName("AGL", "-framework AGL")
  1110. LibName("CARBON", "-framework Carbon")
  1111. LibName("COCOA", "-framework Cocoa")
  1112. # Fix for a bug in OSX Leopard:
  1113. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1114. if GetTarget() == 'android':
  1115. LibName("ALWAYS", '-llog')
  1116. LibName("ANDROID", '-landroid')
  1117. LibName("JNIGRAPHICS", '-ljnigraphics')
  1118. for pkg in MAYAVERSIONS:
  1119. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1120. if GetTarget() == 'darwin':
  1121. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1122. else:
  1123. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1124. LibName(pkg, "-lOpenMaya")
  1125. LibName(pkg, "-lOpenMayaAnim")
  1126. LibName(pkg, "-lOpenMayaUI")
  1127. LibName(pkg, "-lAnimSlice")
  1128. LibName(pkg, "-lDeformSlice")
  1129. LibName(pkg, "-lModifiers")
  1130. LibName(pkg, "-lDynSlice")
  1131. LibName(pkg, "-lKinSlice")
  1132. LibName(pkg, "-lModelSlice")
  1133. LibName(pkg, "-lNurbsSlice")
  1134. LibName(pkg, "-lPolySlice")
  1135. LibName(pkg, "-lProjectSlice")
  1136. LibName(pkg, "-lImage")
  1137. LibName(pkg, "-lShared")
  1138. LibName(pkg, "-lTranslators")
  1139. LibName(pkg, "-lDataModel")
  1140. LibName(pkg, "-lRenderModel")
  1141. LibName(pkg, "-lNurbsEngine")
  1142. LibName(pkg, "-lDependEngine")
  1143. LibName(pkg, "-lCommandEngine")
  1144. LibName(pkg, "-lFoundation")
  1145. if pkg not in ("MAYA2020", "MAYA2022"):
  1146. LibName(pkg, "-lIMFbase")
  1147. if GetTarget() != 'darwin':
  1148. LibName(pkg, "-lOpenMayalib")
  1149. else:
  1150. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1151. if (PkgSkip("PHYSX")==0):
  1152. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1153. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1154. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1155. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1156. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1157. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1158. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1159. if (GetHost() == "darwin"):
  1160. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1161. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1162. else:
  1163. LibName("PHYSX", "-lPhysXLoader")
  1164. LibName("PHYSX", "-lNxCharacter")
  1165. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1166. if GetLinkAllStatic():
  1167. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1168. if GetTarget() == 'android':
  1169. DefSymbol("ALWAYS", "ANDROID")
  1170. if not PkgSkip("EIGEN"):
  1171. if GetOptimize() >= 3:
  1172. if COMPILER == "MSVC":
  1173. # Squeeze out a bit more performance on MSVC builds...
  1174. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1175. # will turn them into runtime assertions.
  1176. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1177. if not PkgSkip("EGL"):
  1178. DefSymbol('EGL', 'HAVE_EGL', '')
  1179. if PkgSkip("X11"):
  1180. DefSymbol('EGL', 'EGL_NO_X11', '')
  1181. if not PkgSkip("X11"):
  1182. DefSymbol('X11', 'USE_X11', '')
  1183. ########################################################################
  1184. ##
  1185. ## Give a Status Report on Command-Line Options
  1186. ##
  1187. ########################################################################
  1188. def printStatus(header,warnings):
  1189. if GetVerbose():
  1190. print("")
  1191. print("-------------------------------------------------------------------")
  1192. print(header)
  1193. tkeep = ""
  1194. tomit = ""
  1195. for x in PkgListGet():
  1196. if PkgSkip(x):
  1197. tomit = tomit + x + " "
  1198. else:
  1199. tkeep = tkeep + x + " "
  1200. if RTDIST:
  1201. print("Makepanda: Runtime distribution build")
  1202. elif RUNTIME:
  1203. print("Makepanda: Runtime build")
  1204. else:
  1205. print("Makepanda: Regular build")
  1206. print("Makepanda: Compiler: %s" % (COMPILER))
  1207. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1208. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1209. print("Makepanda: Omit Pkg: %s" % (tomit))
  1210. if GENMAN:
  1211. print("Makepanda: Generate API reference manual")
  1212. else:
  1213. print("Makepanda: Don't generate API reference manual")
  1214. if GetHost() == "windows" and not RTDIST:
  1215. if INSTALLER:
  1216. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1217. else:
  1218. print("Makepanda: Don't build installer")
  1219. print("Makepanda: Version ID: %s" % (VERSION))
  1220. for x in warnings:
  1221. print("Makepanda: %s" % (x))
  1222. print("-------------------------------------------------------------------")
  1223. print("")
  1224. sys.stdout.flush()
  1225. ########################################################################
  1226. ##
  1227. ## BracketNameWithQuotes
  1228. ##
  1229. ########################################################################
  1230. def BracketNameWithQuotes(name):
  1231. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1232. if (name.startswith("-framework")): return name
  1233. if (name.startswith("-dylib_file")): return name
  1234. # Don't add quotes when it's not necessary.
  1235. if " " not in name: return name
  1236. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1237. if (name.startswith('"') and name.endswith('"')): return name
  1238. else: return '"' + name + '"'
  1239. ########################################################################
  1240. ##
  1241. ## CompileCxx
  1242. ##
  1243. ########################################################################
  1244. def CompileCxx(obj,src,opts):
  1245. ipath = GetListOption(opts, "DIR:")
  1246. optlevel = GetOptimizeOption(opts)
  1247. if (COMPILER=="MSVC"):
  1248. if not BOOUSEINTELCOMPILER:
  1249. cmd = "cl "
  1250. if GetTargetArch() == 'x64':
  1251. cmd += "/favor:blend "
  1252. cmd += "/wd4996 /wd4275 /wd4273 "
  1253. # We still target Windows XP.
  1254. cmd += "/DWINVER=0x501 "
  1255. # Work around a WinXP/2003 bug when using VS 2015+.
  1256. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1257. cmd += "/Zc:threadSafeInit- "
  1258. cmd += "/Fo" + obj + " /nologo /c"
  1259. if GetTargetArch() == 'x86':
  1260. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1261. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1262. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1263. else: # x86 without SSE2
  1264. cmd += " /arch:IA32"
  1265. for x in ipath: cmd += " /I" + x
  1266. for (opt,dir) in INCDIRECTORIES:
  1267. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1268. for (opt,var,val) in DEFSYMBOLS:
  1269. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1270. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1271. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1272. if (optlevel==2): cmd += " /MDd /Zi"
  1273. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1274. if (optlevel==4):
  1275. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1276. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1277. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1278. building = GetValueOption(opts, "BUILDING:")
  1279. if (building):
  1280. cmd += " /DBUILDING_" + building
  1281. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1282. cmd += " /bigobj"
  1283. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1284. if 'EXCEPTIONS' in opts:
  1285. cmd += " /EHsc"
  1286. else:
  1287. cmd += " /D_HAS_EXCEPTIONS=0"
  1288. if 'RTTI' not in opts:
  1289. cmd += " /GR-"
  1290. if GetTargetArch() == 'x64':
  1291. cmd += " /DWIN64_VC /DWIN64"
  1292. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1293. # To preserve Windows XP compatibility.
  1294. cmd += " /D_USING_V110_SDK71_"
  1295. cmd += " /W3 " + BracketNameWithQuotes(src)
  1296. oscmd(cmd)
  1297. else:
  1298. cmd = "icl "
  1299. if GetTargetArch() == 'x64':
  1300. cmd += "/favor:blend "
  1301. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1302. cmd += "/DWINVER=0x501 "
  1303. cmd += "/Fo" + obj + " /c"
  1304. for x in ipath: cmd += " /I" + x
  1305. for (opt,dir) in INCDIRECTORIES:
  1306. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1307. for (opt,var,val) in DEFSYMBOLS:
  1308. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1309. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1310. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1311. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1312. # core changes from jean-claude (dec 2011)
  1313. # ----------------------------------------
  1314. # performance will be seeked at level 3 & 4
  1315. # -----------------------------------------
  1316. if (optlevel==3):
  1317. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1318. cmd += " /Ob0"
  1319. cmd += " /Qipo-" # beware of IPO !!!
  1320. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1321. ## ----------------------------------------------------------------
  1322. if (optlevel==4):
  1323. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1324. cmd += " /Qipo" # optimization multi file
  1325. # for 3 & 4 optimization levels
  1326. # -----------------------------
  1327. if (optlevel>=3):
  1328. cmd += " /fp:fast=2"
  1329. cmd += " /Qftz"
  1330. cmd += " /Qfp-speculation:fast"
  1331. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1332. cmd += " /Qprec-div-"
  1333. cmd += " /Qsimd"
  1334. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1335. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1336. cmd += " /Qparallel" # enable parallelization
  1337. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1338. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1339. ## PCH files with a .pchi filename suffix and reduce build time.
  1340. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1341. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1342. cmd += " /Qpchi-" # keep it this way!
  1343. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1344. ## ------------------------------------
  1345. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1346. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1347. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1348. ## Ctor displacement /vd0 : Disable constructor displacement.
  1349. ## Choose this option only if no class constructors or destructors call virtual functions.
  1350. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1351. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1352. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1353. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1354. ## Alternate: #pragma pointers_to_members
  1355. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1356. building = GetValueOption(opts, "BUILDING:")
  1357. if (building): cmd += " /DBUILDING_" + building
  1358. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1359. cmd += " /bigobj"
  1360. # level of warnings and optimization reports
  1361. if GetVerbose():
  1362. cmd += " /W3 " # or /W4 or /Wall
  1363. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1364. else:
  1365. cmd += " /W1 "
  1366. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1367. if GetTargetArch() == 'x64':
  1368. cmd += " /DWIN64_VC /DWIN64"
  1369. cmd += " " + BracketNameWithQuotes(src)
  1370. oscmd(cmd)
  1371. if (COMPILER=="GCC"):
  1372. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1373. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1374. for (opt, dir) in INCDIRECTORIES:
  1375. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1376. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1377. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1378. for (opt,var,val) in DEFSYMBOLS:
  1379. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1380. for x in ipath: cmd += ' -I' + x
  1381. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1382. cmd += ' -fvisibility=hidden'
  1383. # Mac-specific flags.
  1384. if GetTarget() == "darwin":
  1385. cmd += " -Wno-deprecated-declarations"
  1386. if OSXTARGET is not None:
  1387. cmd += " -isysroot " + SDK["MACOSX"]
  1388. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1389. elif platform.mac_ver()[0].startswith('11.'):
  1390. cmd += " -mmacosx-version-min=11.0"
  1391. for arch in OSX_ARCHS:
  1392. if 'NOARCH:' + arch.upper() not in opts:
  1393. cmd += " -arch %s" % arch
  1394. if "SYSROOT" in SDK:
  1395. if GetTarget() != "android":
  1396. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1397. else:
  1398. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1399. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1400. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1401. cmd += ' -no-canonical-prefixes'
  1402. # Android-specific flags.
  1403. arch = GetTargetArch()
  1404. if GetTarget() == "android":
  1405. # Most of the specific optimization flags here were
  1406. # just copied from the default Android Makefiles.
  1407. if "ANDROID_API" in SDK:
  1408. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1409. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1410. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1411. cmd += ' -ffunction-sections -funwind-tables'
  1412. if arch == 'armv7a':
  1413. cmd += ' -target armv7-none-linux-androideabi'
  1414. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1415. cmd += ' -fno-integrated-as'
  1416. elif arch == 'arm':
  1417. cmd += ' -target armv5te-none-linux-androideabi'
  1418. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1419. cmd += ' -fno-integrated-as'
  1420. elif arch == 'aarch64':
  1421. cmd += ' -target aarch64-none-linux-android'
  1422. elif arch == 'mips':
  1423. cmd += ' -target mipsel-none-linux-android'
  1424. cmd += ' -mips32'
  1425. elif arch == 'mips64':
  1426. cmd += ' -target mips64el-none-linux-android'
  1427. cmd += ' -fintegrated-as'
  1428. elif arch == 'x86':
  1429. cmd += ' -target i686-none-linux-android'
  1430. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1431. cmd += ' -mstackrealign'
  1432. elif arch == 'x86_64':
  1433. cmd += ' -target x86_64-none-linux-android'
  1434. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1435. cmd += " -Wa,--noexecstack"
  1436. # Do we want thumb or arm instructions?
  1437. if arch.startswith('arm'):
  1438. if optlevel >= 3:
  1439. cmd += ' -mthumb'
  1440. else:
  1441. cmd += ' -marm'
  1442. # Enable SIMD instructions if requested
  1443. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1444. cmd += ' -mfpu=neon'
  1445. else:
  1446. cmd += " -pthread"
  1447. if not src.endswith(".c"):
  1448. # We don't use exceptions for most modules.
  1449. if 'EXCEPTIONS' in opts:
  1450. cmd += " -fexceptions"
  1451. else:
  1452. cmd += " -fno-exceptions"
  1453. if src.endswith(".mm"):
  1454. # Work around Apple compiler bug.
  1455. cmd += " -U__EXCEPTIONS"
  1456. target = GetTarget()
  1457. if 'RTTI' not in opts and target != "darwin":
  1458. # We always disable RTTI on Android for memory usage reasons.
  1459. if optlevel >= 4 or target == "android":
  1460. cmd += " -fno-rtti"
  1461. if ('SSE2' in opts or not PkgSkip("SSE2")) and arch.find('86') > 0:
  1462. cmd += " -msse2"
  1463. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1464. cmd += " -fno-strict-aliasing"
  1465. # Certain clang versions crash when passing these math flags while
  1466. # compiling Objective-C++ code
  1467. if not src.endswith(".m") and not src.endswith(".mm"):
  1468. if optlevel >= 3:
  1469. cmd += " -ffast-math -fno-stack-protector"
  1470. if optlevel == 3:
  1471. # Fast math is nice, but we'd like to see NaN in dev builds.
  1472. cmd += " -fno-finite-math-only"
  1473. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1474. cmd += " -fno-unsafe-math-optimizations"
  1475. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1476. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1477. if (optlevel==3): cmd += " -O2"
  1478. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1479. # Enable more warnings.
  1480. cmd += " -Wall -Wno-unused-function"
  1481. if not src.endswith(".c"):
  1482. cmd += " -Wno-reorder"
  1483. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1484. if optlevel == 4:
  1485. cmd += " -Wno-unused-variable"
  1486. if src.endswith(".c"):
  1487. cmd += ' ' + CFLAGS
  1488. else:
  1489. cmd += ' ' + CXXFLAGS
  1490. cmd = cmd.rstrip()
  1491. building = GetValueOption(opts, "BUILDING:")
  1492. if (building): cmd += " -DBUILDING_" + building
  1493. cmd += ' ' + BracketNameWithQuotes(src)
  1494. oscmd(cmd)
  1495. ########################################################################
  1496. ##
  1497. ## CompileBison
  1498. ##
  1499. ########################################################################
  1500. def CompileBison(wobj, wsrc, opts):
  1501. ifile = os.path.basename(wsrc)
  1502. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1503. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1504. pre = GetValueOption(opts, "BISONPREFIX_")
  1505. bison = GetBison()
  1506. if bison is None:
  1507. # We don't have bison. See if there is a prebuilt file.
  1508. base, ext = os.path.splitext(wsrc)
  1509. if os.path.isfile(base + '.h.prebuilt') and \
  1510. os.path.isfile(base + '.cxx.prebuilt'):
  1511. CopyFile(wdstc, base + '.cxx.prebuilt')
  1512. CopyFile(wdsth, base + '.h.prebuilt')
  1513. else:
  1514. exit('Could not find bison!')
  1515. else:
  1516. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1517. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1518. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1519. # Finally, compile the generated source file.
  1520. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1521. ########################################################################
  1522. ##
  1523. ## CompileFlex
  1524. ##
  1525. ########################################################################
  1526. def CompileFlex(wobj,wsrc,opts):
  1527. ifile = os.path.basename(wsrc)
  1528. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1529. pre = GetValueOption(opts, "BISONPREFIX_")
  1530. dashi = opts.count("FLEXDASHI")
  1531. flex = GetFlex()
  1532. want_version = GetValueOption(opts, "FLEXVERSION:")
  1533. if flex and want_version:
  1534. # Is flex at the required version for this file?
  1535. want_version = tuple(map(int, want_version.split('.')))
  1536. have_version = GetFlexVersion()
  1537. if want_version > have_version:
  1538. Warn("Skipping flex %s for file %s, need at least %s" % (
  1539. '.'.join(map(str, have_version)),
  1540. ifile,
  1541. '.'.join(map(str, want_version)),
  1542. ))
  1543. flex = None
  1544. if flex is None:
  1545. # We don't have flex. See if there is a prebuilt file.
  1546. base, ext = os.path.splitext(wsrc)
  1547. if os.path.isfile(base + '.cxx.prebuilt'):
  1548. CopyFile(wdst, base + '.cxx.prebuilt')
  1549. else:
  1550. exit('Could not find flex!')
  1551. else:
  1552. if (dashi):
  1553. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1554. else:
  1555. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1556. # Finally, compile the generated source file.
  1557. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1558. ########################################################################
  1559. ##
  1560. ## CompileIgate
  1561. ##
  1562. ########################################################################
  1563. def CompileIgate(woutd,wsrc,opts):
  1564. outbase = os.path.basename(woutd)[:-3]
  1565. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1566. srcdir = GetValueOption(opts, "SRCDIR:")
  1567. module = GetValueOption(opts, "IMOD:")
  1568. library = GetValueOption(opts, "ILIB:")
  1569. ipath = GetListOption(opts, "DIR:")
  1570. if (PkgSkip("PYTHON")):
  1571. WriteFile(woutc, "")
  1572. WriteFile(woutd, "")
  1573. ConditionalWriteFile(woutd, "")
  1574. return
  1575. if not CrossCompiling():
  1576. # If we're compiling for this platform, we can use the one we've built.
  1577. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1578. else:
  1579. # Assume that interrogate is on the PATH somewhere.
  1580. cmd = 'interrogate'
  1581. if GetVerbose():
  1582. cmd += ' -v'
  1583. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1584. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1585. if (COMPILER=="MSVC"):
  1586. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1587. if GetTargetArch() == 'x64':
  1588. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1589. else:
  1590. cmd += ' -D_M_IX86'
  1591. # NOTE: this 1600 value is the version number for VC2010.
  1592. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1593. if (COMPILER=="GCC"):
  1594. cmd += ' -D__attribute__\\(x\\)='
  1595. target_arch = GetTargetArch()
  1596. if target_arch in ("x86_64", "amd64"):
  1597. cmd += ' -D_LP64'
  1598. elif target_arch in ('aarch64', 'arm64'):
  1599. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1600. else:
  1601. cmd += ' -D__i386__'
  1602. target = GetTarget()
  1603. if target == 'darwin':
  1604. cmd += ' -D__APPLE__'
  1605. elif target == 'android':
  1606. cmd += ' -D__ANDROID__'
  1607. optlevel = GetOptimizeOption(opts)
  1608. if (optlevel==1): cmd += ' -D_DEBUG'
  1609. if (optlevel==2): cmd += ' -D_DEBUG'
  1610. if (optlevel==3): pass
  1611. if (optlevel==4): cmd += ' -DNDEBUG'
  1612. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1613. cmd += ' -fnames -string -refcount -assert -python-native'
  1614. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1615. # Add -I, -S and -D flags
  1616. for x in ipath:
  1617. cmd += ' -I' + BracketNameWithQuotes(x)
  1618. for (opt,dir) in INCDIRECTORIES:
  1619. if (opt=="ALWAYS") or (opt in opts):
  1620. cmd += ' -S' + BracketNameWithQuotes(dir)
  1621. for (opt,var,val) in DEFSYMBOLS:
  1622. if (opt=="ALWAYS") or (opt in opts):
  1623. cmd += ' -D' + var + '=' + val
  1624. #building = GetValueOption(opts, "BUILDING:")
  1625. #if (building): cmd += " -DBUILDING_"+building
  1626. cmd += ' -module ' + module + ' -library ' + library
  1627. for x in wsrc:
  1628. if (x.startswith("/")):
  1629. cmd += ' ' + BracketNameWithQuotes(x)
  1630. else:
  1631. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1632. oscmd(cmd)
  1633. ########################################################################
  1634. ##
  1635. ## CompileImod
  1636. ##
  1637. ########################################################################
  1638. def CompileImod(wobj, wsrc, opts):
  1639. module = GetValueOption(opts, "IMOD:")
  1640. library = GetValueOption(opts, "ILIB:")
  1641. if (COMPILER=="MSVC"):
  1642. woutc = wobj[:-4]+".cxx"
  1643. if (COMPILER=="GCC"):
  1644. woutc = wobj[:-2]+".cxx"
  1645. if (PkgSkip("PYTHON")):
  1646. WriteFile(woutc, "")
  1647. CompileCxx(wobj, woutc, opts)
  1648. return
  1649. if not CrossCompiling():
  1650. # If we're compiling for this platform, we can use the one we've built.
  1651. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1652. else:
  1653. # Assume that interrogate_module is on the PATH somewhere.
  1654. cmd = 'interrogate_module'
  1655. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1656. importmod = GetValueOption(opts, "IMPORT:")
  1657. if importmod:
  1658. cmd += ' -import ' + importmod
  1659. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1660. oscmd(cmd)
  1661. CompileCxx(wobj,woutc,opts)
  1662. return
  1663. ########################################################################
  1664. ##
  1665. ## CompileLib
  1666. ##
  1667. ########################################################################
  1668. def CompileLib(lib, obj, opts):
  1669. if (COMPILER=="MSVC"):
  1670. if not BOOUSEINTELCOMPILER:
  1671. #Use MSVC Linker
  1672. cmd = 'link /lib /nologo'
  1673. if GetOptimizeOption(opts) == 4:
  1674. cmd += " /LTCG"
  1675. if HasTargetArch():
  1676. cmd += " /MACHINE:" + GetTargetArch().upper()
  1677. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1678. for x in obj:
  1679. if not x.endswith('.lib'):
  1680. cmd += ' ' + BracketNameWithQuotes(x)
  1681. oscmd(cmd)
  1682. else:
  1683. # Choose Intel linker; from Jean-Claude
  1684. cmd = 'xilink /verbose:lib /lib '
  1685. if HasTargetArch():
  1686. cmd += " /MACHINE:" + GetTargetArch().upper()
  1687. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1688. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1689. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1690. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1691. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1692. oscmd(cmd)
  1693. if (COMPILER=="GCC"):
  1694. if GetTarget() == 'darwin':
  1695. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1696. else:
  1697. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1698. for x in obj:
  1699. if GetLinkAllStatic() and x.endswith('.a'):
  1700. continue
  1701. cmd += ' ' + BracketNameWithQuotes(x)
  1702. oscmd(cmd)
  1703. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1704. ########################################################################
  1705. ##
  1706. ## CompileLink
  1707. ##
  1708. ########################################################################
  1709. def CompileLink(dll, obj, opts):
  1710. if (COMPILER=="MSVC"):
  1711. if not BOOUSEINTELCOMPILER:
  1712. cmd = "link /nologo "
  1713. if HasTargetArch():
  1714. cmd += " /MACHINE:" + GetTargetArch().upper()
  1715. if ("MFC" not in opts):
  1716. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1717. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1718. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1719. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1720. optlevel = GetOptimizeOption(opts)
  1721. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1722. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1723. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1724. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1725. if ("MFC" in opts):
  1726. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1727. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1728. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1729. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1730. if not PkgSkip("PYTHON"):
  1731. # If we're building without Python, don't pick it up implicitly.
  1732. if "PYTHON" not in opts:
  1733. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1734. if optlevel <= 2:
  1735. cmd += ' /NOD:{}_d.lib'.format(pythonv)
  1736. else:
  1737. cmd += ' /NOD:{}.lib'.format(pythonv)
  1738. # Yes, we know we are importing "locally defined symbols".
  1739. for x in obj:
  1740. if x.endswith('libp3pystub.lib'):
  1741. cmd += ' /ignore:4049,4217'
  1742. break
  1743. # Set the subsystem. Specify that we want to target Windows XP.
  1744. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1745. cmd += " /SUBSYSTEM:" + subsystem
  1746. if GetTargetArch() == 'x64':
  1747. cmd += ",5.02"
  1748. else:
  1749. cmd += ",5.01"
  1750. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1751. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1752. for (opt, dir) in LIBDIRECTORIES:
  1753. if (opt=="ALWAYS") or (opt in opts):
  1754. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1755. for x in obj:
  1756. if x.endswith(".dll") or x.endswith(".pyd"):
  1757. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1758. elif x.endswith(".lib"):
  1759. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1760. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1761. exit("Error: in makepanda, specify "+dname+", not "+x)
  1762. cmd += ' ' + BracketNameWithQuotes(x)
  1763. elif x.endswith(".def"):
  1764. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1765. elif x.endswith(".dat"):
  1766. pass
  1767. else:
  1768. cmd += ' ' + BracketNameWithQuotes(x)
  1769. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1770. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1771. for (opt, name) in LIBNAMES:
  1772. if (opt=="ALWAYS") or (opt in opts):
  1773. cmd += " " + BracketNameWithQuotes(name)
  1774. oscmd(cmd)
  1775. else:
  1776. cmd = "xilink"
  1777. if GetVerbose(): cmd += " /verbose:lib"
  1778. if HasTargetArch():
  1779. cmd += " /MACHINE:" + GetTargetArch().upper()
  1780. if ("MFC" not in opts):
  1781. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1782. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1783. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1784. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1785. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1786. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1787. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1788. optlevel = GetOptimizeOption(opts)
  1789. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1790. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1791. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1792. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1793. if ("MFC" in opts):
  1794. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1795. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1796. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1797. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1798. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1799. if subsystem:
  1800. cmd += " /SUBSYSTEM:" + subsystem
  1801. if dll.endswith(".dll"):
  1802. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1803. for (opt, dir) in LIBDIRECTORIES:
  1804. if (opt=="ALWAYS") or (opt in opts):
  1805. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1806. for x in obj:
  1807. if x.endswith(".dll") or x.endswith(".pyd"):
  1808. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1809. elif x.endswith(".lib"):
  1810. dname = os.path.splitext(dll)[0]+".dll"
  1811. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1812. exit("Error: in makepanda, specify "+dname+", not "+x)
  1813. cmd += ' ' + BracketNameWithQuotes(x)
  1814. elif x.endswith(".def"):
  1815. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1816. elif x.endswith(".dat"):
  1817. pass
  1818. else:
  1819. cmd += ' ' + BracketNameWithQuotes(x)
  1820. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1821. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1822. for (opt, name) in LIBNAMES:
  1823. if (opt=="ALWAYS") or (opt in opts):
  1824. cmd += " " + BracketNameWithQuotes(name)
  1825. oscmd(cmd)
  1826. if COMPILER == "GCC":
  1827. cxx = GetCXX()
  1828. if GetOrigExt(dll) == ".exe":
  1829. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1830. if GetTarget() == "android":
  1831. # Necessary to work around an issue with libandroid depending on vendor libraries
  1832. cmd += ' -Wl,--allow-shlib-undefined'
  1833. else:
  1834. if (GetTarget() == "darwin"):
  1835. cmd = cxx + ' -undefined dynamic_lookup'
  1836. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1837. cmd += ' -bundle '
  1838. else:
  1839. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1840. cmd += ' -dynamiclib -install_name ' + install_name
  1841. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1842. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1843. else:
  1844. cmd = cxx + ' -shared'
  1845. # Always set soname on Android to avoid a linker warning when loading the library.
  1846. if "MODULE" not in opts or GetTarget() == 'android':
  1847. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1848. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1849. for x in obj:
  1850. if GetOrigExt(x) != ".dat":
  1851. cmd += ' ' + x
  1852. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1853. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1854. # macOS specific flags.
  1855. if GetTarget() == 'darwin':
  1856. cmd += " -headerpad_max_install_names"
  1857. if OSXTARGET is not None:
  1858. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1859. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1860. elif platform.mac_ver()[0].startswith('11.'):
  1861. cmd += " -mmacosx-version-min=11.0"
  1862. for arch in OSX_ARCHS:
  1863. if 'NOARCH:' + arch.upper() not in opts:
  1864. cmd += " -arch %s" % arch
  1865. elif GetTarget() == 'android':
  1866. arch = GetTargetArch()
  1867. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1868. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1869. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1870. if arch == 'armv7a':
  1871. cmd += ' -target armv7-none-linux-androideabi'
  1872. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1873. elif arch == 'arm':
  1874. cmd += ' -target armv5te-none-linux-androideabi'
  1875. elif arch == 'aarch64':
  1876. cmd += ' -target aarch64-none-linux-android'
  1877. elif arch == 'mips':
  1878. cmd += ' -target mipsel-none-linux-android'
  1879. cmd += ' -mips32'
  1880. elif arch == 'mips64':
  1881. cmd += ' -target mips64el-none-linux-android'
  1882. elif arch == 'x86':
  1883. cmd += ' -target i686-none-linux-android'
  1884. elif arch == 'x86_64':
  1885. cmd += ' -target x86_64-none-linux-android'
  1886. cmd += ' -lc -lm'
  1887. else:
  1888. cmd += " -pthread"
  1889. if "SYSROOT" in SDK:
  1890. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1891. if LDFLAGS != "":
  1892. cmd += " " + LDFLAGS
  1893. # Don't link libraries with Python, except on Android.
  1894. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1895. opts = opts[:]
  1896. opts.remove("PYTHON")
  1897. for (opt, dir) in LIBDIRECTORIES:
  1898. if (opt=="ALWAYS") or (opt in opts):
  1899. cmd += ' -L' + BracketNameWithQuotes(dir)
  1900. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1901. if (opt=="ALWAYS") or (opt in opts):
  1902. cmd += ' -F' + BracketNameWithQuotes(dir)
  1903. for (opt, name) in LIBNAMES:
  1904. if (opt=="ALWAYS") or (opt in opts):
  1905. cmd += ' ' + BracketNameWithQuotes(name)
  1906. if GetTarget() != 'freebsd':
  1907. cmd += " -ldl"
  1908. oscmd(cmd)
  1909. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1910. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1911. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1912. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1913. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1914. if os.path.isfile(newdll):
  1915. os.remove(newdll)
  1916. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1917. elif dll.endswith("." + MAJOR_VERSION):
  1918. newdll = dll[:-len(MAJOR_VERSION)-1]
  1919. if os.path.isfile(newdll):
  1920. os.remove(newdll)
  1921. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1922. ##########################################################################################
  1923. #
  1924. # CompileEgg
  1925. #
  1926. ##########################################################################################
  1927. def CompileEgg(eggfile, src, opts):
  1928. pz = False
  1929. if eggfile.endswith(".pz"):
  1930. pz = True
  1931. eggfile = eggfile[:-3]
  1932. # Determine the location of the pzip and flt2egg tools.
  1933. if CrossCompiling():
  1934. # We may not be able to use our generated versions of these tools,
  1935. # so we'll expect them to already be present in the PATH.
  1936. pzip = 'pzip'
  1937. flt2egg = 'flt2egg'
  1938. else:
  1939. # If we're compiling for this machine, we can use the binaries we've built.
  1940. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1941. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1942. if not os.path.isfile(pzip):
  1943. pzip = 'pzip'
  1944. if not os.path.isfile(flt2egg):
  1945. flt2egg = 'flt2egg'
  1946. if src.endswith(".egg"):
  1947. CopyFile(eggfile, src)
  1948. elif src.endswith(".flt"):
  1949. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1950. if pz:
  1951. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1952. ##########################################################################################
  1953. #
  1954. # CompileRes, CompileRsrc
  1955. #
  1956. ##########################################################################################
  1957. def CompileRes(target, src, opts):
  1958. """Compiles a Windows .rc file into a .res file."""
  1959. ipath = GetListOption(opts, "DIR:")
  1960. if (COMPILER == "MSVC"):
  1961. cmd = "rc"
  1962. cmd += " /Fo" + BracketNameWithQuotes(target)
  1963. for x in ipath: cmd += " /I" + x
  1964. for (opt,dir) in INCDIRECTORIES:
  1965. if (opt=="ALWAYS") or (opt in opts):
  1966. cmd += " /I" + BracketNameWithQuotes(dir)
  1967. for (opt,var,val) in DEFSYMBOLS:
  1968. if (opt=="ALWAYS") or (opt in opts):
  1969. cmd += " /D" + var + "=" + val
  1970. cmd += " " + BracketNameWithQuotes(src)
  1971. else:
  1972. cmd = "windres"
  1973. for x in ipath: cmd += " -I" + x
  1974. for (opt,dir) in INCDIRECTORIES:
  1975. if (opt=="ALWAYS") or (opt in opts):
  1976. cmd += " -I" + BracketNameWithQuotes(dir)
  1977. for (opt,var,val) in DEFSYMBOLS:
  1978. if (opt=="ALWAYS") or (opt in opts):
  1979. cmd += " -D" + var + "=" + val
  1980. cmd += " -i " + BracketNameWithQuotes(src)
  1981. cmd += " -o " + BracketNameWithQuotes(target)
  1982. oscmd(cmd)
  1983. def CompileRsrc(target, src, opts):
  1984. """Compiles a Mac OS .r file into an .rsrc file."""
  1985. ipath = GetListOption(opts, "DIR:")
  1986. if os.path.isfile("/usr/bin/Rez"):
  1987. cmd = "Rez -useDF"
  1988. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1989. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1990. else:
  1991. cmd = "/Developer/Tools/Rez -useDF"
  1992. cmd += " -o " + BracketNameWithQuotes(target)
  1993. for x in ipath:
  1994. cmd += " -i " + x
  1995. for (opt,dir) in INCDIRECTORIES:
  1996. if (opt=="ALWAYS") or (opt in opts):
  1997. cmd += " -i " + BracketNameWithQuotes(dir)
  1998. for (opt,var,val) in DEFSYMBOLS:
  1999. if (opt=="ALWAYS") or (opt in opts):
  2000. if (val == ""):
  2001. cmd += " -d " + var
  2002. else:
  2003. cmd += " -d " + var + " = " + val
  2004. cmd += " " + BracketNameWithQuotes(src)
  2005. oscmd(cmd)
  2006. ##########################################################################################
  2007. #
  2008. # CompileJava (Android only)
  2009. #
  2010. ##########################################################################################
  2011. def CompileJava(target, src, opts):
  2012. """Compiles a .java file into a .class file."""
  2013. if GetHost() == 'android':
  2014. cmd = "ecj "
  2015. else:
  2016. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  2017. optlevel = GetOptimizeOption(opts)
  2018. if optlevel >= 4:
  2019. cmd += "-debug:none "
  2020. cmd += "-cp " + GetOutputDir() + "/classes "
  2021. cmd += "-d " + GetOutputDir() + "/classes "
  2022. cmd += BracketNameWithQuotes(src)
  2023. oscmd(cmd)
  2024. ##########################################################################################
  2025. #
  2026. # FreezePy
  2027. #
  2028. ##########################################################################################
  2029. def FreezePy(target, inputs, opts):
  2030. assert len(inputs) > 0
  2031. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  2032. if sys.version_info >= (2, 6):
  2033. cmdstr += "-B "
  2034. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  2035. if 'FREEZE_STARTUP' in opts:
  2036. cmdstr += " -s"
  2037. if GetOrigExt(target) == '.exe':
  2038. src = inputs.pop(0)
  2039. else:
  2040. src = ""
  2041. for i in inputs:
  2042. i = os.path.splitext(i)[0]
  2043. i = i.replace('/', '.')
  2044. if i.startswith('direct.src'):
  2045. i = i.replace('.src.', '.')
  2046. cmdstr += " -i " + i
  2047. cmdstr += " -o " + target + " " + src
  2048. if ("LINK_PYTHON_STATIC" in opts):
  2049. os.environ["LINK_PYTHON_STATIC"] = "1"
  2050. oscmd(cmdstr)
  2051. if ("LINK_PYTHON_STATIC" in os.environ):
  2052. del os.environ["LINK_PYTHON_STATIC"]
  2053. if (not os.path.exists(target)):
  2054. exit("FREEZER_ERROR")
  2055. ##########################################################################################
  2056. #
  2057. # Package
  2058. #
  2059. ##########################################################################################
  2060. def Package(target, inputs, opts):
  2061. assert len(inputs) == 1
  2062. # Invoke the ppackage script.
  2063. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  2064. if GetOptimizeOption(opts) >= 4:
  2065. command += "-OO "
  2066. if sys.version_info >= (2, 6):
  2067. command += "-B "
  2068. command += "direct/src/p3d/ppackage.py"
  2069. if not RTDIST:
  2070. # Don't compile Python sources, because we might not running in the same
  2071. # Python version as the selected host.
  2072. command += " -N"
  2073. if GetTarget() == "darwin":
  2074. if SDK.get("MACOSX"):
  2075. command += " -R \"%s\"" % SDK["MACOSX"]
  2076. for arch in OSX_ARCHS:
  2077. if arch == "x86_64":
  2078. arch = "amd64"
  2079. command += " -P osx_%s" % arch
  2080. command += " -i \"" + GetOutputDir() + "/stage\""
  2081. if (P3DSUFFIX):
  2082. command += ' -a "' + P3DSUFFIX + '"'
  2083. command += " " + inputs[0]
  2084. if GetOrigExt(target) == '.p3d':
  2085. # Build a specific .p3d file.
  2086. basename = os.path.basename(os.path.splitext(target)[0])
  2087. command += " " + basename
  2088. oscmd(command)
  2089. if GetTarget() == 'windows':
  2090. # Make an .exe that calls this .p3d.
  2091. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2092. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2093. exefile = FindLocation(basename + '.exe', [])
  2094. CompileLink(exefile, [objfile], ['ADVAPI'])
  2095. # Move it to the bin directory.
  2096. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2097. if sys.platform != 'win32':
  2098. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2099. else:
  2100. # This is presumably a package or set of packages.
  2101. oscmd(command)
  2102. ##########################################################################################
  2103. #
  2104. # CompileBundle
  2105. #
  2106. ##########################################################################################
  2107. def CompileBundle(target, inputs, opts):
  2108. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2109. plist = None
  2110. resources = []
  2111. objects = []
  2112. for i in inputs:
  2113. if (i.endswith(".plist")):
  2114. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2115. plist = i
  2116. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2117. resources.append(i)
  2118. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2119. objects.append(i)
  2120. else:
  2121. exit("Don't know how to bundle file %s" % i)
  2122. # Now link the object files to form the bundle.
  2123. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2124. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2125. oscmd("rm -rf %s" % target)
  2126. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2127. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2128. if target.endswith(".app"):
  2129. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2130. else:
  2131. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2132. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2133. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2134. for r in resources:
  2135. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2136. ##########################################################################################
  2137. #
  2138. # CompileMIDL
  2139. #
  2140. ##########################################################################################
  2141. def CompileMIDL(target, src, opts):
  2142. ipath = GetListOption(opts, "DIR:")
  2143. if (COMPILER=="MSVC"):
  2144. cmd = "midl"
  2145. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2146. for x in ipath: cmd += " /I" + x
  2147. for (opt,dir) in INCDIRECTORIES:
  2148. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2149. for (opt,var,val) in DEFSYMBOLS:
  2150. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2151. cmd += " " + BracketNameWithQuotes(src)
  2152. oscmd(cmd)
  2153. ##########################################################################################
  2154. #
  2155. # CompileAnything
  2156. #
  2157. ##########################################################################################
  2158. def CompileAnything(target, inputs, opts, progress = None):
  2159. if (opts.count("DEPENDENCYONLY")):
  2160. return
  2161. if (len(inputs)==0):
  2162. exit("No input files for target "+target)
  2163. infile = inputs[0]
  2164. origsuffix = GetOrigExt(target)
  2165. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2166. # It must be a simple copy operation.
  2167. ProgressOutput(progress, "Copying file", target)
  2168. CopyFile(target, infile)
  2169. if (origsuffix==".exe" and GetHost() != "windows"):
  2170. os.system("chmod +x \"%s\"" % target)
  2171. return
  2172. elif (infile.endswith(".py")):
  2173. if origsuffix == ".obj":
  2174. source = os.path.splitext(target)[0] + ".c"
  2175. SetOrigExt(source, ".c")
  2176. ProgressOutput(progress, "Building frozen source", source)
  2177. FreezePy(source, inputs, opts)
  2178. ProgressOutput(progress, "Building C++ object", target)
  2179. return CompileCxx(target, source, opts)
  2180. if origsuffix == ".exe":
  2181. ProgressOutput(progress, "Building frozen executable", target)
  2182. else:
  2183. ProgressOutput(progress, "Building frozen library", target)
  2184. return FreezePy(target, inputs, opts)
  2185. elif (infile.endswith(".idl")):
  2186. ProgressOutput(progress, "Compiling MIDL file", infile)
  2187. return CompileMIDL(target, infile, opts)
  2188. elif (infile.endswith(".pdef")):
  2189. if origsuffix == '.p3d':
  2190. ProgressOutput(progress, "Building package", target)
  2191. else:
  2192. ProgressOutput(progress, "Building package from pdef file", infile)
  2193. return Package(target, inputs, opts)
  2194. elif origsuffix in SUFFIX_LIB:
  2195. ProgressOutput(progress, "Linking static library", target)
  2196. return CompileLib(target, inputs, opts)
  2197. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2198. if (origsuffix==".exe"):
  2199. ProgressOutput(progress, "Linking executable", target)
  2200. else:
  2201. ProgressOutput(progress, "Linking dynamic library", target)
  2202. # Add version number to the dynamic library, on unix
  2203. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2204. tplatform = GetTarget()
  2205. if tplatform == "darwin":
  2206. # On Mac, libraries are named like libpanda.1.2.dylib
  2207. if target.lower().endswith(".dylib"):
  2208. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2209. SetOrigExt(target, origsuffix)
  2210. elif tplatform != "windows" and tplatform != "android":
  2211. # On Linux, libraries are named like libpanda.so.1.2
  2212. target += "." + MAJOR_VERSION
  2213. SetOrigExt(target, origsuffix)
  2214. return CompileLink(target, inputs, opts)
  2215. elif (origsuffix==".in"):
  2216. ProgressOutput(progress, "Building Interrogate database", target)
  2217. return CompileIgate(target, inputs, opts)
  2218. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2219. ProgressOutput(progress, "Building plugin bundle", target)
  2220. return CompileBundle(target, inputs, opts)
  2221. elif (origsuffix==".app"):
  2222. ProgressOutput(progress, "Building application bundle", target)
  2223. return CompileBundle(target, inputs, opts)
  2224. elif (origsuffix==".pz"):
  2225. ProgressOutput(progress, "Compressing", target)
  2226. return CompileEgg(target, infile, opts)
  2227. elif (origsuffix==".egg"):
  2228. ProgressOutput(progress, "Converting", target)
  2229. return CompileEgg(target, infile, opts)
  2230. elif (origsuffix==".res"):
  2231. ProgressOutput(progress, "Building resource object", target)
  2232. return CompileRes(target, infile, opts)
  2233. elif (origsuffix==".rsrc"):
  2234. ProgressOutput(progress, "Building resource object", target)
  2235. return CompileRsrc(target, infile, opts)
  2236. elif (origsuffix==".class"):
  2237. ProgressOutput(progress, "Building Java class", target)
  2238. return CompileJava(target, infile, opts)
  2239. elif (origsuffix==".obj"):
  2240. if (infile.endswith(".cxx")):
  2241. ProgressOutput(progress, "Building C++ object", target)
  2242. return CompileCxx(target, infile, opts)
  2243. elif (infile.endswith(".c")):
  2244. ProgressOutput(progress, "Building C object", target)
  2245. return CompileCxx(target, infile, opts)
  2246. elif (infile.endswith(".mm")):
  2247. ProgressOutput(progress, "Building Objective-C++ object", target)
  2248. return CompileCxx(target, infile, opts)
  2249. elif (infile.endswith(".yxx")):
  2250. ProgressOutput(progress, "Building Bison object", target)
  2251. return CompileBison(target, infile, opts)
  2252. elif (infile.endswith(".lxx")):
  2253. ProgressOutput(progress, "Building Flex object", target)
  2254. return CompileFlex(target, infile, opts)
  2255. elif (infile.endswith(".in")):
  2256. ProgressOutput(progress, "Building Interrogate object", target)
  2257. return CompileImod(target, inputs, opts)
  2258. elif (infile.endswith(".rc")):
  2259. ProgressOutput(progress, "Building resource object", target)
  2260. return CompileRes(target, infile, opts)
  2261. elif (infile.endswith(".r")):
  2262. ProgressOutput(progress, "Building resource object", target)
  2263. return CompileRsrc(target, infile, opts)
  2264. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2265. ##########################################################################################
  2266. #
  2267. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2268. #
  2269. ##########################################################################################
  2270. DTOOL_CONFIG=[
  2271. #_Variable_________________________Windows___________________Unix__________
  2272. ("HAVE_PYTHON", '1', '1'),
  2273. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2274. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2275. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2276. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2277. ("HAVE_MAYA", '1', '1'),
  2278. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2279. ("USE_PANDAFILESTREAM", '1', '1'),
  2280. ("USE_DELETED_CHAIN", '1', '1'),
  2281. ("HAVE_WGL", '1', 'UNDEF'),
  2282. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2283. ("HAVE_THREADS", '1', '1'),
  2284. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2285. ("OS_SIMPLE_THREADS", '1', '1'),
  2286. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2287. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2288. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2289. ("HAVE_AUDIO", '1', '1'),
  2290. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2291. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2292. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2293. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2294. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2295. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2296. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2297. ("DO_PIPELINING", '1', '1'),
  2298. ("DEFAULT_PATHSEP", '";"', '":"'),
  2299. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2300. ("PHAVE_LOCKF", '1', '1'),
  2301. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2302. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2303. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2304. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2305. ("HAVE_GETOPT", 'UNDEF', '1'),
  2306. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2307. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2308. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2309. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2310. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2311. ("HAVE_IOS_BINARY", '1', '1'),
  2312. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2313. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2314. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2315. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2316. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2317. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2318. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2319. ("HAVE_PROC_CURPROC_CMDLINE", 'UNDEF', 'UNDEF'),
  2320. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2321. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2322. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2323. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2324. ("PHAVE_IO_H", '1', 'UNDEF'),
  2325. ("PHAVE_IOSTREAM", '1', '1'),
  2326. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2327. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2328. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2329. ("PHAVE_MALLOC_H", '1', '1'),
  2330. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2331. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2332. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2333. ("PHAVE_SSTREAM", '1', '1'),
  2334. ("PHAVE_NEW", '1', '1'),
  2335. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2336. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2337. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2338. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2339. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2340. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2341. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2342. ("PHAVE_STDINT_H", '1', '1'),
  2343. ("HAVE_RTTI", '1', '1'),
  2344. ("HAVE_X11", 'UNDEF', '1'),
  2345. ("IS_LINUX", 'UNDEF', '1'),
  2346. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2347. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2348. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2349. ("LINMATH_ALIGN", '1', '1'),
  2350. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2351. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2352. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2353. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2354. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2355. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2356. ("HAVE_SGI_RGB", '1', '1'),
  2357. ("HAVE_TGA", '1', '1'),
  2358. ("HAVE_IMG", '1', '1'),
  2359. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2360. ("HAVE_BMP", '1', '1'),
  2361. ("HAVE_PNM", '1', '1'),
  2362. ("HAVE_STB_IMAGE", '1', '1'),
  2363. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2364. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2365. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2366. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2367. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2368. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2369. ("WANT_NATIVE_NET", '1', '1'),
  2370. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2371. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2372. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2373. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2374. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2375. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2376. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2377. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2378. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2379. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2380. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2381. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2382. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2383. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2384. # ("_SECURE_SCL", '0', 'UNDEF'),
  2385. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2386. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2387. ]
  2388. PRC_PARAMETERS=[
  2389. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2390. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2391. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2392. ("PRC_PATH2_ENVVARS", '""', '""'),
  2393. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2394. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2395. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2396. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2397. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2398. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2399. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2400. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2401. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2402. ]
  2403. def WriteConfigSettings():
  2404. dtool_config={}
  2405. prc_parameters={}
  2406. speedtree_parameters={}
  2407. plugin_config={}
  2408. if (GetTarget() == 'windows'):
  2409. for key,win,unix in DTOOL_CONFIG:
  2410. dtool_config[key] = win
  2411. for key,win,unix in PRC_PARAMETERS:
  2412. prc_parameters[key] = win
  2413. else:
  2414. for key,win,unix in DTOOL_CONFIG:
  2415. dtool_config[key] = unix
  2416. for key,win,unix in PRC_PARAMETERS:
  2417. prc_parameters[key] = unix
  2418. for x in PkgListGet():
  2419. if ("HAVE_"+x in dtool_config):
  2420. if (PkgSkip(x)==0):
  2421. dtool_config["HAVE_"+x] = '1'
  2422. else:
  2423. dtool_config["HAVE_"+x] = 'UNDEF'
  2424. dtool_config["HAVE_NET"] = '1'
  2425. if (PkgSkip("NVIDIACG")==0):
  2426. dtool_config["HAVE_CG"] = '1'
  2427. dtool_config["HAVE_CGGL"] = '1'
  2428. dtool_config["HAVE_CGDX9"] = '1'
  2429. if GetTarget() not in ("linux", "android"):
  2430. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2431. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2432. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2433. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2434. if (GetTarget() == "darwin"):
  2435. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2436. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2437. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2438. if not os.path.isdir(os.path.join(GetThirdpartyDir(), 'openal')):
  2439. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2440. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2441. dtool_config["IS_LINUX"] = 'UNDEF'
  2442. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2443. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2444. dtool_config["IS_OSX"] = '1'
  2445. if (GetTarget() == "freebsd"):
  2446. dtool_config["IS_LINUX"] = 'UNDEF'
  2447. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2448. dtool_config["IS_FREEBSD"] = '1'
  2449. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2450. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2451. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2452. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2453. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2454. if (GetTarget() == "android"):
  2455. # Android does have RTTI, but we disable it anyway.
  2456. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2457. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2458. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2459. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2460. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2461. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2462. # This should probably be more sophisticated, such as based
  2463. # on whether the libRocket Python modules are available.
  2464. if (PkgSkip("PYTHON") != 0):
  2465. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2466. if (GetOptimize() <= 3):
  2467. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2468. if (GetOptimize() <= 3):
  2469. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2470. dtool_config["DO_PSTATS"] = '1'
  2471. if (GetOptimize() <= 3):
  2472. dtool_config["DO_DCAST"] = '1'
  2473. if (GetOptimize() <= 3):
  2474. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2475. if (GetOptimize() <= 3):
  2476. dtool_config["DO_MEMORY_USAGE"] = '1'
  2477. if (GetOptimize() <= 3):
  2478. dtool_config["NOTIFY_DEBUG"] = '1'
  2479. if (GetOptimize() >= 4):
  2480. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2481. if (GetOptimize() >= 4):
  2482. # Disable RTTI on release builds.
  2483. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2484. # Now that we have OS_SIMPLE_THREADS, we can support
  2485. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2486. # longer need to disable it for this platform.
  2487. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2488. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2489. if (RTDIST or RUNTIME):
  2490. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2491. if HOST_URL:
  2492. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2493. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2494. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2495. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2496. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2497. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2498. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2499. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2500. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2501. if PkgSkip("GTK2") == 0:
  2502. plugin_config["HAVE_GTK"] = '1'
  2503. if (RUNTIME):
  2504. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2505. # Whether it's present on the system doesn't matter here,
  2506. # as the runtime itself doesn't include or link with X11.
  2507. if (RUNTIME and GetTarget() == 'linux'):
  2508. dtool_config["HAVE_X11"] = '1'
  2509. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2510. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2511. else:
  2512. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2513. if (PkgSkip("SPEEDTREE")==0):
  2514. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2515. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2516. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2517. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2518. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2519. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2520. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2521. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2522. for key in sorted(prc_parameters.keys()):
  2523. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2524. val = OverrideValue(key, prc_parameters[key])
  2525. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2526. else: conf = conf + "#define " + key + " " + val + "\n"
  2527. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2528. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2529. for key in sorted(dtool_config.keys()):
  2530. val = OverrideValue(key, dtool_config[key])
  2531. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2532. # These are not available for ARM, period.
  2533. conf = conf + "#ifdef __aarch64__\n"
  2534. conf = conf + "#undef " + key + "\n"
  2535. conf = conf + "#else\n"
  2536. conf = conf + "#define " + key + " " + val + "\n"
  2537. conf = conf + "#endif\n"
  2538. elif val == 'UNDEF':
  2539. conf = conf + "#undef " + key + "\n"
  2540. else:
  2541. conf = conf + "#define " + key + " " + val + "\n"
  2542. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2543. if (RTDIST or RUNTIME):
  2544. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2545. for key in sorted(plugin_config.keys()):
  2546. val = plugin_config[key]
  2547. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2548. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2549. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2550. if (PkgSkip("SPEEDTREE")==0):
  2551. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2552. for key in sorted(speedtree_parameters.keys()):
  2553. val = OverrideValue(key, speedtree_parameters[key])
  2554. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2555. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2556. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2557. for x in PkgListGet():
  2558. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2559. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2560. # Finally, write a platform.dat with the platform we are compiling for.
  2561. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2562. # This is useful for tools like makepackage that need to know things about
  2563. # the build parameters.
  2564. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2565. WriteConfigSettings()
  2566. WarnConflictingFiles()
  2567. if SystemLibraryExists("dtoolbase"):
  2568. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2569. if SystemLibraryExists("p3dtoolconfig"):
  2570. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2571. ##########################################################################################
  2572. #
  2573. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2574. #
  2575. ##########################################################################################
  2576. PANDAVERSION_H="""
  2577. #define PANDA_MAJOR_VERSION $VERSION1
  2578. #define PANDA_MINOR_VERSION $VERSION2
  2579. #define PANDA_SEQUENCE_VERSION $VERSION3
  2580. #define PANDA_VERSION $NVERSION
  2581. #define PANDA_NUMERIC_VERSION $NVERSION
  2582. #define PANDA_VERSION_STR "$VERSION"
  2583. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2584. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2585. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2586. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2587. """
  2588. PANDAVERSION_H_RUNTIME="""
  2589. #define PANDA_MAJOR_VERSION 0
  2590. #define PANDA_MINOR_VERSION 0
  2591. #define PANDA_SEQUENCE_VERSION 0
  2592. #define PANDA_VERSION_STR "0.0.0"
  2593. #define PANDA_ABI_VERSION_STR "0.0"
  2594. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2595. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2596. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2597. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2598. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2599. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2600. #define PANDA_PACKAGE_VERSION_STR ""
  2601. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2602. """
  2603. CHECKPANDAVERSION_CXX="""
  2604. # include "dtoolbase.h"
  2605. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2606. """
  2607. CHECKPANDAVERSION_H="""
  2608. # ifndef CHECKPANDAVERSION_H
  2609. # define CHECKPANDAVERSION_H
  2610. # include "dtoolbase.h"
  2611. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2612. // Hack to forcibly depend on the check
  2613. template<typename T>
  2614. class CheckPandaVersion {
  2615. public:
  2616. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2617. };
  2618. template class CheckPandaVersion<void>;
  2619. # endif
  2620. """
  2621. P3DACTIVEX_RC="""#include "resource.h"
  2622. #define APSTUDIO_READONLY_SYMBOLS
  2623. #include "afxres.h"
  2624. #undef APSTUDIO_READONLY_SYMBOLS
  2625. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2626. #ifdef _WIN32
  2627. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2628. #pragma code_page(1252)
  2629. #endif
  2630. #ifdef APSTUDIO_INVOKED
  2631. 1 TEXTINCLUDE
  2632. BEGIN
  2633. "resource.h\\0"
  2634. END
  2635. 2 TEXTINCLUDE
  2636. BEGIN
  2637. "#include ""afxres.h""\\r\\n"
  2638. "\\0"
  2639. END
  2640. 3 TEXTINCLUDE
  2641. BEGIN
  2642. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2643. "\\0"
  2644. END
  2645. #endif
  2646. %s
  2647. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2648. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2649. STYLE DS_SETFONT | WS_CHILD
  2650. FONT 8, "MS Sans Serif"
  2651. BEGIN
  2652. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2653. IDC_STATIC,7,25,229,16
  2654. END
  2655. #ifdef APSTUDIO_INVOKED
  2656. GUIDELINES DESIGNINFO
  2657. BEGIN
  2658. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2659. BEGIN
  2660. LEFTMARGIN, 7
  2661. RIGHTMARGIN, 243
  2662. TOPMARGIN, 7
  2663. BOTTOMMARGIN, 55
  2664. END
  2665. END
  2666. #endif
  2667. STRINGTABLE
  2668. BEGIN
  2669. IDS_P3DACTIVEX "P3DActiveX Control"
  2670. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2671. END
  2672. STRINGTABLE
  2673. BEGIN
  2674. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2675. END
  2676. #endif
  2677. #ifndef APSTUDIO_INVOKED
  2678. 1 TYPELIB "P3DActiveX.tlb"
  2679. #endif"""
  2680. def CreatePandaVersionFiles():
  2681. parts = VERSION.split(".", 2)
  2682. version1 = int(parts[0])
  2683. version2 = int(parts[1])
  2684. version3 = 0
  2685. if len(parts) > 2:
  2686. for c in parts[2]:
  2687. if c.isdigit():
  2688. version3 = version3 * 10 + ord(c) - 48
  2689. else:
  2690. break
  2691. nversion = version1 * 1000000 + version2 * 1000 + version3
  2692. if DISTRIBUTOR != "cmu":
  2693. # Subtract 1 if we are not an official version.
  2694. nversion -= 1
  2695. if (RUNTIME):
  2696. pandaversion_h = PANDAVERSION_H_RUNTIME
  2697. else:
  2698. pandaversion_h = PANDAVERSION_H
  2699. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2700. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2701. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2702. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2703. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2704. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2705. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2706. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2707. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2708. if (DISTRIBUTOR == "cmu"):
  2709. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2710. else:
  2711. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2712. if GIT_COMMIT:
  2713. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2714. # Allow creating a deterministic build by setting this.
  2715. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2716. if source_date:
  2717. # This matches the GCC / Clang format for __DATE__ __TIME__
  2718. source_date = time.gmtime(int(source_date))
  2719. try:
  2720. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2721. except ValueError:
  2722. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2723. if source_date[3:5] == ' 0':
  2724. source_date = source_date[:3] + ' ' + source_date[5:]
  2725. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2726. if not RUNTIME:
  2727. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2728. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2729. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2730. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2731. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2732. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2733. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2734. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2735. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2736. if RUNTIME:
  2737. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2738. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2739. else:
  2740. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2741. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2742. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2743. if RUNTIME:
  2744. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2745. "version" : VERSION,
  2746. "description" : "Runs 3-D games and interactive applets",
  2747. "filename" : "p3dactivex.ocx",
  2748. "mimetype" : "application/x-panda3d",
  2749. "extension" : "p3d",
  2750. "filedesc" : "Panda3D applet"}
  2751. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2752. CreatePandaVersionFiles()
  2753. ##########################################################################################
  2754. #
  2755. # Copy the "direct" tree
  2756. #
  2757. ##########################################################################################
  2758. if (PkgSkip("DIRECT")==0):
  2759. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2760. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2761. # This file used to be copied, but would nowadays cause conflicts.
  2762. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2763. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2764. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2765. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2766. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2767. # This directory doesn't exist at all any more.
  2768. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2769. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2770. # These files used to exist; remove them to avoid conflicts.
  2771. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2772. '_core.pyd', '_core.so',
  2773. 'direct.py', 'direct.pyc', 'direct.pyo',
  2774. '_direct.pyd', '_direct.so',
  2775. 'dtoolconfig.pyd', 'dtoolconfig.so',
  2776. 'net.pyd', 'net.so',
  2777. 'net.py', 'net.pyc', 'net.pyo']
  2778. for basename in del_files:
  2779. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2780. if os.path.isfile(path):
  2781. print("Removing %s" % (path))
  2782. os.remove(path)
  2783. # Write an appropriate panda3d/__init__.py
  2784. p3d_init = """"Python bindings for the Panda3D libraries"
  2785. __version__ = '%s'
  2786. """ % (WHLVERSION)
  2787. if GetTarget() == 'windows':
  2788. p3d_init += """
  2789. if '__file__' in locals():
  2790. import os
  2791. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2792. if os.path.isdir(bindir):
  2793. if hasattr(os, 'add_dll_directory'):
  2794. os.add_dll_directory(bindir)
  2795. elif not os.environ.get('PATH'):
  2796. os.environ['PATH'] = bindir
  2797. else:
  2798. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2799. del os, bindir
  2800. """
  2801. if not PkgSkip("PYTHON"):
  2802. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2803. # Also add this file, for backward compatibility.
  2804. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2805. '''Alias of :mod:`panda3d.interrogatedb`.
  2806. .. deprecated:: 1.10.0
  2807. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2808. '''
  2809. if __debug__:
  2810. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2811. from .interrogatedb import *
  2812. """)
  2813. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2814. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2815. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2816. os.remove(fn)
  2817. panda_modules = ['core']
  2818. if not PkgSkip("PANDAPHYSICS"):
  2819. panda_modules.append('physics')
  2820. if not PkgSkip('PANDAFX'):
  2821. panda_modules.append('fx')
  2822. if not PkgSkip("DIRECT"):
  2823. panda_modules.append('direct')
  2824. if not PkgSkip("VISION"):
  2825. panda_modules.append('vision')
  2826. if not PkgSkip("SKEL"):
  2827. panda_modules.append('skel')
  2828. if not PkgSkip("EGG"):
  2829. panda_modules.append('egg')
  2830. if not PkgSkip("ODE"):
  2831. panda_modules.append('ode')
  2832. if not PkgSkip("VRPN"):
  2833. panda_modules.append('vrpn')
  2834. panda_modules_code = """
  2835. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2836. if __debug__:
  2837. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2838. """
  2839. for module in panda_modules:
  2840. panda_modules_code += """
  2841. try:
  2842. from panda3d.%s import *
  2843. except ImportError as err:
  2844. if "No module named %s" not in str(err):
  2845. raise""" % (module, module)
  2846. panda_modules_code += """
  2847. from direct.showbase import DConfig
  2848. def get_config_showbase():
  2849. return DConfig
  2850. def get_config_express():
  2851. return DConfig
  2852. getConfigShowbase = get_config_showbase
  2853. getConfigExpress = get_config_express
  2854. """
  2855. exthelpers_code = """
  2856. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2857. from direct.extensions_native.extension_native_helpers import *
  2858. """
  2859. if not PkgSkip("PYTHON"):
  2860. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2861. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2862. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2863. ##########################################################################################
  2864. #
  2865. # Write the dist-info directory.
  2866. #
  2867. ##########################################################################################
  2868. # This is just some basic stuff since setuptools just needs this file to
  2869. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2870. # eventually want to merge this with the metadata generator in makewheel.py.
  2871. METADATA = """Metadata-Version: 2.1
  2872. Name: Panda3D
  2873. Version: {version}
  2874. License: BSD
  2875. Home-page: https://www.panda3d.org/
  2876. Author: Panda3D Team
  2877. Author-email: [email protected]
  2878. """
  2879. ENTRY_POINTS = """[distutils.commands]
  2880. build_apps = direct.dist.commands:build_apps
  2881. bdist_apps = direct.dist.commands:bdist_apps
  2882. [setuptools.finalize_distribution_options]
  2883. build_apps = direct.dist._dist_hooks:finalize_distribution_options
  2884. """
  2885. if not PkgSkip("DIRECT"):
  2886. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2887. MakeDirectory(dist_dir)
  2888. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2889. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2890. ##########################################################################################
  2891. #
  2892. # Generate the PRC files into the ETC directory.
  2893. #
  2894. ##########################################################################################
  2895. confautoprc = ReadFile("makepanda/confauto.in")
  2896. if (PkgSkip("SPEEDTREE")==0):
  2897. # If SpeedTree is available, enable it in the config file
  2898. confautoprc = confautoprc.replace('#st#', '')
  2899. else:
  2900. # otherwise, disable it.
  2901. confautoprc = confautoprc.replace('#st#', '#')
  2902. confautoprc = confautoprc.replace('\r\n', '\n')
  2903. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2904. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2905. if PkgSkip("EGG") or GetLinkAllStatic():
  2906. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2907. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2908. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2909. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2910. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2911. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2912. if (os.path.isfile("makepanda/myconfig.in")):
  2913. configprc = ReadFile("makepanda/myconfig.in")
  2914. else:
  2915. configprc = ReadFile("makepanda/config.in")
  2916. configprc = configprc.replace('\r\n', '\n')
  2917. if (GetTarget() == 'windows'):
  2918. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2919. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2920. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2921. else:
  2922. configprc = configprc.replace("aux-display pandadx9", "")
  2923. if (GetTarget() == 'darwin'):
  2924. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2925. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2926. if not PkgSkip("FMODEX"):
  2927. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2928. if PkgSkip("GL") or GetLinkAllStatic():
  2929. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2930. if PkgSkip("GLES") or GetLinkAllStatic():
  2931. configprc = configprc.replace("\n#load-display pandagles", "")
  2932. if PkgSkip("DX9") or GetLinkAllStatic():
  2933. configprc = configprc.replace("\n#load-display pandadx9", "")
  2934. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2935. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2936. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2937. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2938. if GetTarget() == 'windows':
  2939. # Convert to Windows newlines.
  2940. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2941. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2942. else:
  2943. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2944. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2945. ##########################################################################################
  2946. #
  2947. # Copy the precompiled binaries and DLLs into the build.
  2948. #
  2949. ##########################################################################################
  2950. tp_dir = GetThirdpartyDir()
  2951. if tp_dir is not None:
  2952. dylibs = {}
  2953. if GetTarget() == 'darwin':
  2954. # Make a list of all the dylibs we ship, to figure out whether we should use
  2955. # install_name_tool to correct the library reference to point to our copy.
  2956. for pkg in PkgListGet():
  2957. if PkgSkip(pkg):
  2958. continue
  2959. tp_libdir = GetThirdpartyLibDir(pkg)
  2960. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2961. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2962. if not PkgSkip("PYTHON"):
  2963. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2964. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2965. for pkg in PkgListGet():
  2966. if PkgSkip(pkg):
  2967. continue
  2968. tp_pkg = tp_dir + pkg.lower()
  2969. if GetTarget() == 'windows':
  2970. if os.path.exists(tp_pkg + "/bin"):
  2971. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2972. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2973. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2974. elif GetTarget() == 'darwin':
  2975. tp_libdir = GetThirdpartyLibDir(pkg)
  2976. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2977. if not PkgSkip("PYTHON"):
  2978. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2979. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2980. if pkg != 'PYTHON':
  2981. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2982. for tp_lib in tp_libs:
  2983. basename = os.path.basename(tp_lib)
  2984. if basename.endswith('.dylib'):
  2985. # It's a dynamic link library. Put it in the lib directory.
  2986. target = GetOutputDir() + "/lib/" + basename
  2987. dep_prefix = "@loader_path/../lib/"
  2988. lib_id = dep_prefix + basename
  2989. else:
  2990. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2991. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2992. target = GetOutputDir() + "/" + basename
  2993. dep_prefix = "@loader_path/lib/"
  2994. lib_id = basename
  2995. if not NeedsBuild([target], [tp_lib]):
  2996. continue
  2997. CopyFile(target, tp_lib)
  2998. if os.path.islink(target) or target.endswith('.py'):
  2999. continue
  3000. # Correct the inter-library dependencies so that the build is relocatable.
  3001. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  3002. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  3003. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  3004. line = line.strip()
  3005. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  3006. continue
  3007. libdep = line.split(" ", 1)[0]
  3008. dep_basename = os.path.basename(libdep)
  3009. if dep_basename in dylibs:
  3010. dep_target = dylibs[dep_basename]
  3011. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  3012. JustBuilt([target], [tp_lib])
  3013. for fwx in glob.glob(tp_pkg + "/*.framework"):
  3014. MakeDirectory(GetOutputDir() + "/Frameworks")
  3015. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  3016. else: # Linux / FreeBSD case.
  3017. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  3018. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  3019. if not PkgSkip("PYTHON"):
  3020. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  3021. base = os.path.basename(tp_lib)
  3022. if base.startswith('lib'):
  3023. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  3024. else:
  3025. # It's a Python module, like _rocketcore.so.
  3026. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  3027. if GetTarget() == 'windows':
  3028. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  3029. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  3030. if not PkgSkip("PYTHON") and not RTDIST:
  3031. # We need to copy the Python DLL to the bin directory for now.
  3032. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  3033. if GetOptimize() <= 2:
  3034. pydll += "_d.dll"
  3035. else:
  3036. pydll += ".dll"
  3037. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  3038. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  3039. CopyFile(GetOutputDir() + "/bin/", fn)
  3040. # Copy the whole Python directory.
  3041. if COPY_PYTHON:
  3042. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  3043. # NB: Python does not always ship with the correct manifest/dll.
  3044. # Figure out the correct one to ship, and grab it from WinSxS dir.
  3045. manifest = GetOutputDir() + '/tmp/python.manifest'
  3046. if os.path.isfile(manifest):
  3047. os.unlink(manifest)
  3048. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  3049. if COPY_PYTHON and os.path.isfile(manifest):
  3050. import xml.etree.ElementTree as ET
  3051. tree = ET.parse(manifest)
  3052. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  3053. else:
  3054. idents = ()
  3055. for ident in idents:
  3056. sxs_name = '_'.join([
  3057. ident.get('processorArchitecture'),
  3058. ident.get('name').lower(),
  3059. ident.get('publicKeyToken'),
  3060. ident.get('version'),
  3061. ])
  3062. # Find the manifest matching these parameters.
  3063. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  3064. manifests = glob.glob(pattern)
  3065. if not manifests:
  3066. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  3067. continue
  3068. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  3069. # Also copy the corresponding msvcr dll.
  3070. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  3071. for file in glob.glob(pattern):
  3072. CopyFile(GetOutputDir() + "/python/", file)
  3073. # Copy python.exe to ppython.exe.
  3074. if COPY_PYTHON:
  3075. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  3076. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  3077. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  3078. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  3079. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  3080. # Copy over the MSVC runtime.
  3081. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  3082. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  3083. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3084. if ("VCTOOLSVERSION" in SDK):
  3085. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3086. else:
  3087. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3088. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3089. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3090. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3091. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3092. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3093. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3094. ########################################################################
  3095. ##
  3096. ## Copy various stuff into the build.
  3097. ##
  3098. ########################################################################
  3099. if GetTarget() == 'windows':
  3100. # Convert to Windows newlines so they can be opened by notepad.
  3101. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3102. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3103. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3104. else:
  3105. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3106. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3107. if (PkgSkip("PANDATOOL")==0):
  3108. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3109. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3110. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3111. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3112. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3113. # Since Eigen is included by all sorts of core headers, as a convenience
  3114. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3115. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3116. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3117. ########################################################################
  3118. #
  3119. # Copy header files to the built/include/parser-inc directory.
  3120. #
  3121. ########################################################################
  3122. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3123. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3124. ########################################################################
  3125. #
  3126. # Transfer all header files to the built/include directory.
  3127. #
  3128. ########################################################################
  3129. CopyAllHeaders('dtool/src/dtoolbase')
  3130. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3131. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3132. CopyAllHeaders('dtool/metalibs/dtool')
  3133. CopyAllHeaders('dtool/src/cppparser')
  3134. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3135. CopyAllHeaders('dtool/src/dconfig')
  3136. CopyAllHeaders('dtool/src/interrogatedb')
  3137. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3138. CopyAllHeaders('dtool/src/pystub')
  3139. CopyAllHeaders('dtool/src/interrogate')
  3140. CopyAllHeaders('dtool/src/test_interrogate')
  3141. CopyAllHeaders('panda/src/putil')
  3142. CopyAllHeaders('panda/src/pandabase')
  3143. CopyAllHeaders('panda/src/express')
  3144. CopyAllHeaders('panda/src/downloader')
  3145. CopyAllHeaders('panda/metalibs/pandaexpress')
  3146. CopyAllHeaders('panda/src/pipeline')
  3147. CopyAllHeaders('panda/src/linmath')
  3148. CopyAllHeaders('panda/src/putil')
  3149. CopyAllHeaders('dtool/src/prckeys')
  3150. CopyAllHeaders('panda/src/audio')
  3151. CopyAllHeaders('panda/src/event')
  3152. CopyAllHeaders('panda/src/mathutil')
  3153. CopyAllHeaders('panda/src/gsgbase')
  3154. CopyAllHeaders('panda/src/pnmimage')
  3155. CopyAllHeaders('panda/src/nativenet')
  3156. CopyAllHeaders('panda/src/net')
  3157. CopyAllHeaders('panda/src/pstatclient')
  3158. CopyAllHeaders('panda/src/gobj')
  3159. CopyAllHeaders('panda/src/movies')
  3160. CopyAllHeaders('panda/src/pgraphnodes')
  3161. CopyAllHeaders('panda/src/pgraph')
  3162. CopyAllHeaders('panda/src/cull')
  3163. CopyAllHeaders('panda/src/display')
  3164. CopyAllHeaders('panda/src/chan')
  3165. CopyAllHeaders('panda/src/char')
  3166. CopyAllHeaders('panda/src/dgraph')
  3167. CopyAllHeaders('panda/src/device')
  3168. CopyAllHeaders('panda/src/pnmtext')
  3169. CopyAllHeaders('panda/src/text')
  3170. CopyAllHeaders('panda/src/grutil')
  3171. if (PkgSkip("VISION")==0):
  3172. CopyAllHeaders('panda/src/vision')
  3173. if (PkgSkip("FFMPEG")==0):
  3174. CopyAllHeaders('panda/src/ffmpeg')
  3175. CopyAllHeaders('panda/src/tform')
  3176. CopyAllHeaders('panda/src/collide')
  3177. CopyAllHeaders('panda/src/parametrics')
  3178. CopyAllHeaders('panda/src/pgui')
  3179. CopyAllHeaders('panda/src/pnmimagetypes')
  3180. CopyAllHeaders('panda/src/recorder')
  3181. if (PkgSkip("ROCKET")==0):
  3182. CopyAllHeaders('panda/src/rocket')
  3183. if (PkgSkip("VRPN")==0):
  3184. CopyAllHeaders('panda/src/vrpn')
  3185. CopyAllHeaders('panda/src/wgldisplay')
  3186. CopyAllHeaders('panda/src/ode')
  3187. CopyAllHeaders('panda/metalibs/pandaode')
  3188. if (PkgSkip("PANDAPHYSICS")==0):
  3189. CopyAllHeaders('panda/src/physics')
  3190. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3191. CopyAllHeaders('panda/src/particlesystem')
  3192. CopyAllHeaders('panda/src/dxml')
  3193. CopyAllHeaders('panda/metalibs/panda')
  3194. CopyAllHeaders('panda/src/audiotraits')
  3195. CopyAllHeaders('panda/src/audiotraits')
  3196. CopyAllHeaders('panda/src/distort')
  3197. CopyAllHeaders('panda/src/downloadertools')
  3198. CopyAllHeaders('panda/src/windisplay')
  3199. CopyAllHeaders('panda/src/dxgsg9')
  3200. CopyAllHeaders('panda/metalibs/pandadx9')
  3201. if not PkgSkip("EGG"):
  3202. CopyAllHeaders('panda/src/egg')
  3203. CopyAllHeaders('panda/src/egg2pg')
  3204. CopyAllHeaders('panda/src/framework')
  3205. CopyAllHeaders('panda/metalibs/pandafx')
  3206. CopyAllHeaders('panda/src/glstuff')
  3207. CopyAllHeaders('panda/src/glgsg')
  3208. CopyAllHeaders('panda/src/glesgsg')
  3209. CopyAllHeaders('panda/src/gles2gsg')
  3210. if not PkgSkip("EGG"):
  3211. CopyAllHeaders('panda/metalibs/pandaegg')
  3212. if GetTarget() == 'windows':
  3213. CopyAllHeaders('panda/src/wgldisplay')
  3214. elif GetTarget() == 'darwin':
  3215. CopyAllHeaders('panda/src/osxdisplay')
  3216. CopyAllHeaders('panda/src/cocoadisplay')
  3217. elif GetTarget() == 'android':
  3218. CopyAllHeaders('panda/src/android')
  3219. CopyAllHeaders('panda/src/androiddisplay')
  3220. if not PkgSkip('X11'):
  3221. CopyAllHeaders('panda/src/x11display')
  3222. if not PkgSkip('GL'):
  3223. CopyAllHeaders('panda/src/glxdisplay')
  3224. CopyAllHeaders('panda/src/egldisplay')
  3225. CopyAllHeaders('panda/metalibs/pandagl')
  3226. CopyAllHeaders('panda/metalibs/pandagles')
  3227. CopyAllHeaders('panda/metalibs/pandagles2')
  3228. CopyAllHeaders('panda/metalibs/pandaphysics')
  3229. CopyAllHeaders('panda/src/testbed')
  3230. if (PkgSkip("PHYSX")==0):
  3231. CopyAllHeaders('panda/src/physx')
  3232. CopyAllHeaders('panda/metalibs/pandaphysx')
  3233. if (PkgSkip("BULLET")==0):
  3234. CopyAllHeaders('panda/src/bullet')
  3235. CopyAllHeaders('panda/metalibs/pandabullet')
  3236. if (PkgSkip("SPEEDTREE")==0):
  3237. CopyAllHeaders('panda/src/speedtree')
  3238. if (PkgSkip("DIRECT")==0):
  3239. CopyAllHeaders('direct/src/directbase')
  3240. CopyAllHeaders('direct/src/dcparser')
  3241. CopyAllHeaders('direct/src/deadrec')
  3242. CopyAllHeaders('direct/src/distributed')
  3243. CopyAllHeaders('direct/src/interval')
  3244. CopyAllHeaders('direct/src/showbase')
  3245. CopyAllHeaders('direct/src/motiontrail')
  3246. CopyAllHeaders('direct/src/dcparse')
  3247. if (RUNTIME or RTDIST):
  3248. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3249. if (RUNTIME):
  3250. CopyAllHeaders('direct/src/plugin_npapi')
  3251. CopyAllHeaders('direct/src/plugin_standalone')
  3252. if (PkgSkip("PANDATOOL")==0):
  3253. CopyAllHeaders('pandatool/src/pandatoolbase')
  3254. CopyAllHeaders('pandatool/src/converter')
  3255. CopyAllHeaders('pandatool/src/progbase')
  3256. CopyAllHeaders('pandatool/src/eggbase')
  3257. CopyAllHeaders('pandatool/src/bam')
  3258. CopyAllHeaders('pandatool/src/cvscopy')
  3259. CopyAllHeaders('pandatool/src/daeegg')
  3260. CopyAllHeaders('pandatool/src/daeprogs')
  3261. CopyAllHeaders('pandatool/src/dxf')
  3262. CopyAllHeaders('pandatool/src/dxfegg')
  3263. CopyAllHeaders('pandatool/src/dxfprogs')
  3264. CopyAllHeaders('pandatool/src/palettizer')
  3265. CopyAllHeaders('pandatool/src/egg-mkfont')
  3266. CopyAllHeaders('pandatool/src/eggcharbase')
  3267. CopyAllHeaders('pandatool/src/egg-optchar')
  3268. CopyAllHeaders('pandatool/src/egg-palettize')
  3269. CopyAllHeaders('pandatool/src/egg-qtess')
  3270. CopyAllHeaders('pandatool/src/eggprogs')
  3271. CopyAllHeaders('pandatool/src/flt')
  3272. CopyAllHeaders('pandatool/src/fltegg')
  3273. CopyAllHeaders('pandatool/src/fltprogs')
  3274. CopyAllHeaders('pandatool/src/imagebase')
  3275. CopyAllHeaders('pandatool/src/imageprogs')
  3276. CopyAllHeaders('pandatool/src/pfmprogs')
  3277. CopyAllHeaders('pandatool/src/lwo')
  3278. CopyAllHeaders('pandatool/src/lwoegg')
  3279. CopyAllHeaders('pandatool/src/lwoprogs')
  3280. CopyAllHeaders('pandatool/src/maya')
  3281. CopyAllHeaders('pandatool/src/mayaegg')
  3282. CopyAllHeaders('pandatool/src/maxegg')
  3283. CopyAllHeaders('pandatool/src/maxprogs')
  3284. CopyAllHeaders('pandatool/src/objegg')
  3285. CopyAllHeaders('pandatool/src/objprogs')
  3286. CopyAllHeaders('pandatool/src/vrml')
  3287. CopyAllHeaders('pandatool/src/vrmlegg')
  3288. CopyAllHeaders('pandatool/src/xfile')
  3289. CopyAllHeaders('pandatool/src/xfileegg')
  3290. CopyAllHeaders('pandatool/src/ptloader')
  3291. CopyAllHeaders('pandatool/src/miscprogs')
  3292. CopyAllHeaders('pandatool/src/pstatserver')
  3293. CopyAllHeaders('pandatool/src/text-stats')
  3294. CopyAllHeaders('pandatool/src/vrmlprogs')
  3295. CopyAllHeaders('pandatool/src/win-stats')
  3296. CopyAllHeaders('pandatool/src/xfileprogs')
  3297. if (PkgSkip("CONTRIB")==0):
  3298. CopyAllHeaders('contrib/src/contribbase')
  3299. CopyAllHeaders('contrib/src/ai')
  3300. ########################################################################
  3301. #
  3302. # These definitions are syntactic shorthand. They make it easy
  3303. # to link with the usual libraries without listing them all.
  3304. #
  3305. ########################################################################
  3306. COMMON_DTOOL_LIBS=[
  3307. 'libp3dtool.dll',
  3308. 'libp3dtoolconfig.dll',
  3309. ]
  3310. COMMON_PANDA_LIBS=[
  3311. 'libpanda.dll',
  3312. 'libpandaexpress.dll'
  3313. ] + COMMON_DTOOL_LIBS
  3314. COMMON_EGG2X_LIBS=[
  3315. 'libp3eggbase.lib',
  3316. 'libp3progbase.lib',
  3317. 'libp3converter.lib',
  3318. 'libp3pandatoolbase.lib',
  3319. 'libpandaegg.dll',
  3320. ] + COMMON_PANDA_LIBS
  3321. ########################################################################
  3322. #
  3323. # This section contains a list of all the files that need to be compiled.
  3324. #
  3325. ########################################################################
  3326. print("Generating dependencies...")
  3327. sys.stdout.flush()
  3328. #
  3329. # Compile Panda icon resource file.
  3330. # We do it first because we need it at
  3331. # the time we compile an executable.
  3332. #
  3333. if GetTarget() == 'windows':
  3334. OPTS=['DIR:panda/src/configfiles']
  3335. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3336. #
  3337. # DIRECTORY: dtool/src/dtoolbase/
  3338. #
  3339. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL', 'MIMALLOC']
  3340. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3341. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3342. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3343. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3344. #
  3345. # DIRECTORY: dtool/src/dtoolutil/
  3346. #
  3347. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3348. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3349. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3350. if GetTarget() == 'darwin':
  3351. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3352. #
  3353. # DIRECTORY: dtool/metalibs/dtool/
  3354. #
  3355. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3356. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3357. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3358. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3359. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3360. if GetTarget() == 'darwin':
  3361. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3362. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3363. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3364. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3365. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3366. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL','MIMALLOC'])
  3367. #
  3368. # DIRECTORY: dtool/src/cppparser/
  3369. #
  3370. if (not RUNTIME):
  3371. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3372. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3373. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3374. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3375. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3376. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3377. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3378. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3379. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3380. #
  3381. # DIRECTORY: dtool/src/prc/
  3382. #
  3383. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3384. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3385. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3386. #
  3387. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3388. #
  3389. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3390. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3391. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3392. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3393. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3394. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3395. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3396. #
  3397. # DIRECTORY: dtool/src/interrogatedb/
  3398. #
  3399. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3400. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3401. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3402. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3403. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3404. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3405. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3406. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3407. # stuff, so it has been renamed appropriately.
  3408. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3409. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3410. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3411. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3412. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3413. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3414. #
  3415. # DIRECTORY: dtool/src/pystub/
  3416. #
  3417. if not RUNTIME and not RTDIST:
  3418. OPTS=['DIR:dtool/src/pystub']
  3419. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3420. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3421. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3422. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3423. #
  3424. # DIRECTORY: dtool/src/interrogate/
  3425. #
  3426. if (not RUNTIME):
  3427. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3428. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3429. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3430. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3431. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3432. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3433. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3434. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3435. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3436. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3437. 'dtool/src/interrogatedb/py_panda.cxx',
  3438. 'dtool/src/interrogatedb/py_compat.cxx',
  3439. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3440. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3441. ])
  3442. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3443. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3444. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3445. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3446. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3447. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3448. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3449. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3450. if (not RTDIST):
  3451. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3452. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3453. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3454. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3455. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3456. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3457. #
  3458. # DIRECTORY: dtool/src/prckeys/
  3459. #
  3460. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3461. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3462. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3463. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3464. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3465. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3466. #
  3467. # DIRECTORY: dtool/src/test_interrogate/
  3468. #
  3469. if (not RTDIST and not RUNTIME):
  3470. OPTS=['DIR:dtool/src/test_interrogate']
  3471. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3472. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3473. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3474. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3475. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3476. #
  3477. # DIRECTORY: dtool/src/dtoolbase/
  3478. #
  3479. OPTS=['DIR:dtool/src/dtoolbase']
  3480. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3481. IGATEFILES += [
  3482. "typeHandle.h",
  3483. "typeHandle_ext.h",
  3484. "typeRegistry.h",
  3485. "typedObject.h",
  3486. "neverFreeMemory.h",
  3487. ]
  3488. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3489. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3490. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3491. #
  3492. # DIRECTORY: dtool/src/dtoolutil/
  3493. #
  3494. OPTS=['DIR:dtool/src/dtoolutil']
  3495. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3496. IGATEFILES += [
  3497. "config_dtoolutil.h",
  3498. "pandaSystem.h",
  3499. "dSearchPath.h",
  3500. "executionEnvironment.h",
  3501. "textEncoder.h",
  3502. "textEncoder_ext.h",
  3503. "filename.h",
  3504. "filename_ext.h",
  3505. "globPattern.h",
  3506. "globPattern_ext.h",
  3507. "pandaFileStream.h",
  3508. "lineStream.h",
  3509. ]
  3510. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3511. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3512. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3513. #
  3514. # DIRECTORY: dtool/src/prc/
  3515. #
  3516. OPTS=['DIR:dtool/src/prc']
  3517. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3518. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3519. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3520. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3521. #
  3522. # DIRECTORY: panda/src/pandabase/
  3523. #
  3524. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3525. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3526. #
  3527. # DIRECTORY: panda/src/express/
  3528. #
  3529. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3530. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3531. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3532. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3533. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3534. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3535. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3536. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3537. #
  3538. # DIRECTORY: panda/src/downloader/
  3539. #
  3540. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3541. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3542. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3543. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3544. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3545. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3546. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3547. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3548. #
  3549. # DIRECTORY: panda/metalibs/pandaexpress/
  3550. #
  3551. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3552. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3553. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3554. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3555. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3556. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3557. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3558. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3559. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3560. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3561. #
  3562. # DIRECTORY: panda/src/pipeline/
  3563. #
  3564. if (not RUNTIME):
  3565. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3566. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3567. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3568. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3569. OPTS=['DIR:panda/src/pipeline']
  3570. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3571. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3572. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3573. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3574. #
  3575. # DIRECTORY: panda/src/linmath/
  3576. #
  3577. if (not RUNTIME):
  3578. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3579. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3580. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3581. OPTS=['DIR:panda/src/linmath']
  3582. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3583. for ifile in IGATEFILES[:]:
  3584. if "_src." in ifile:
  3585. IGATEFILES.remove(ifile)
  3586. IGATEFILES.remove('cast_to_double.h')
  3587. IGATEFILES.remove('lmat_ops.h')
  3588. IGATEFILES.remove('cast_to_float.h')
  3589. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3590. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3591. #
  3592. # DIRECTORY: panda/src/putil/
  3593. #
  3594. if (not RUNTIME):
  3595. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3596. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3597. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3598. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3599. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3600. IGATEFILES.remove("test_bam.h")
  3601. IGATEFILES.remove("config_util.h")
  3602. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3603. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3604. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3605. #
  3606. # DIRECTORY: panda/src/audio/
  3607. #
  3608. if (not RUNTIME):
  3609. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3610. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3611. OPTS=['DIR:panda/src/audio']
  3612. IGATEFILES=["audio.h"]
  3613. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3614. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3615. #
  3616. # DIRECTORY: panda/src/event/
  3617. #
  3618. if (not RUNTIME):
  3619. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3620. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3621. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3622. OPTS=['DIR:panda/src/event']
  3623. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3624. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3625. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3626. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3627. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3628. #
  3629. # DIRECTORY: panda/src/mathutil/
  3630. #
  3631. if (not RUNTIME):
  3632. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3633. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3634. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3635. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3636. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3637. for ifile in IGATEFILES[:]:
  3638. if "_src." in ifile:
  3639. IGATEFILES.remove(ifile)
  3640. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3641. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3642. #
  3643. # DIRECTORY: panda/src/gsgbase/
  3644. #
  3645. if (not RUNTIME):
  3646. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3647. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3648. OPTS=['DIR:panda/src/gsgbase']
  3649. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3650. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3651. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3652. #
  3653. # DIRECTORY: panda/src/pnmimage/
  3654. #
  3655. if (not RUNTIME):
  3656. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3657. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3658. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3659. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3660. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3661. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3662. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3663. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3664. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3665. #
  3666. # DIRECTORY: panda/src/nativenet/
  3667. #
  3668. if (not RUNTIME):
  3669. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3670. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3671. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3672. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3673. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3674. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3675. #
  3676. # DIRECTORY: panda/src/net/
  3677. #
  3678. if (not RUNTIME):
  3679. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3680. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3681. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3682. OPTS=['DIR:panda/src/net']
  3683. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3684. IGATEFILES.remove("datagram_ui.h")
  3685. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3686. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3687. #
  3688. # DIRECTORY: panda/src/pstatclient/
  3689. #
  3690. if (not RUNTIME):
  3691. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3692. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3693. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3694. OPTS=['DIR:panda/src/pstatclient']
  3695. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3696. IGATEFILES.remove("config_pstats.h")
  3697. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3698. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3699. PyTargetAdd('p3pstatclient_pStatClient_ext.obj', opts=OPTS, input='pStatClient_ext.cxx')
  3700. #
  3701. # DIRECTORY: panda/src/gobj/
  3702. #
  3703. if (not RUNTIME):
  3704. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3705. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3706. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3707. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3708. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3709. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3710. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3711. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3712. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3713. #
  3714. # DIRECTORY: panda/src/pgraphnodes/
  3715. #
  3716. if (not RUNTIME):
  3717. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3718. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3719. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3720. OPTS=['DIR:panda/src/pgraphnodes']
  3721. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3722. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3723. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3724. #
  3725. # DIRECTORY: panda/src/pgraph/
  3726. #
  3727. if (not RUNTIME):
  3728. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3729. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3730. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3731. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3732. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3733. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3734. OPTS=['DIR:panda/src/pgraph']
  3735. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3736. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3737. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3738. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3739. #
  3740. # DIRECTORY: panda/src/cull/
  3741. #
  3742. if (not RUNTIME):
  3743. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3744. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3745. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3746. OPTS=['DIR:panda/src/cull']
  3747. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3748. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3749. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3750. #
  3751. # DIRECTORY: panda/src/dgraph/
  3752. #
  3753. if (not RUNTIME):
  3754. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3755. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3756. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3757. OPTS=['DIR:panda/src/dgraph']
  3758. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3759. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3760. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3761. #
  3762. # DIRECTORY: panda/src/device/
  3763. #
  3764. if (not RUNTIME):
  3765. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3766. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3767. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3768. OPTS=['DIR:panda/src/device']
  3769. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3770. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3771. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3772. #
  3773. # DIRECTORY: panda/src/display/
  3774. #
  3775. if (not RUNTIME):
  3776. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3777. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3778. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3779. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3780. OPTS=['DIR:panda/src/display', 'X11']
  3781. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3782. IGATEFILES.remove("renderBuffer.h")
  3783. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3784. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3785. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3786. if RTDIST and GetTarget() == 'darwin':
  3787. OPTS=['DIR:panda/src/display']
  3788. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3789. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3790. #
  3791. # DIRECTORY: panda/src/chan/
  3792. #
  3793. if (not RUNTIME):
  3794. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3795. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3796. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3797. OPTS=['DIR:panda/src/chan']
  3798. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3799. IGATEFILES.remove('movingPart.h')
  3800. IGATEFILES.remove('animChannelFixed.h')
  3801. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3802. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3803. # DIRECTORY: panda/src/char/
  3804. #
  3805. if (not RUNTIME):
  3806. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3807. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3808. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3809. OPTS=['DIR:panda/src/char']
  3810. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3811. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3812. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3813. #
  3814. # DIRECTORY: panda/src/pnmtext/
  3815. #
  3816. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3817. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3818. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3819. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3820. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3821. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3822. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3823. #
  3824. # DIRECTORY: panda/src/text/
  3825. #
  3826. if (not RUNTIME):
  3827. if not PkgSkip("HARFBUZZ"):
  3828. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3829. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3830. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3831. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3832. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3833. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3834. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3835. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3836. #
  3837. # DIRECTORY: panda/src/movies/
  3838. #
  3839. if (not RUNTIME):
  3840. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3841. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3842. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3843. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3844. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3845. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3846. #
  3847. # DIRECTORY: panda/src/grutil/
  3848. #
  3849. if (not RUNTIME):
  3850. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3851. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3852. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3853. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3854. OPTS=['DIR:panda/src/grutil']
  3855. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3856. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3857. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3858. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3859. #
  3860. # DIRECTORY: panda/src/tform/
  3861. #
  3862. if (not RUNTIME):
  3863. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3864. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3865. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3866. OPTS=['DIR:panda/src/tform']
  3867. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3868. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3869. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3870. #
  3871. # DIRECTORY: panda/src/collide/
  3872. #
  3873. if (not RUNTIME):
  3874. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3875. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3876. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3877. OPTS=['DIR:panda/src/collide']
  3878. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3879. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3880. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3881. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3882. #
  3883. # DIRECTORY: panda/src/parametrics/
  3884. #
  3885. if (not RUNTIME):
  3886. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3887. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3888. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3889. OPTS=['DIR:panda/src/parametrics']
  3890. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3891. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3892. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3893. #
  3894. # DIRECTORY: panda/src/pgui/
  3895. #
  3896. if (not RUNTIME):
  3897. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3898. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3899. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3900. OPTS=['DIR:panda/src/pgui']
  3901. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3902. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3903. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3904. #
  3905. # DIRECTORY: panda/src/pnmimagetypes/
  3906. #
  3907. if (not RUNTIME):
  3908. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3909. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3910. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3911. #
  3912. # DIRECTORY: panda/src/recorder/
  3913. #
  3914. if (not RUNTIME):
  3915. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3916. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3917. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3918. OPTS=['DIR:panda/src/recorder']
  3919. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3920. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3921. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3922. #
  3923. # DIRECTORY: panda/src/dxml/
  3924. #
  3925. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3926. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3927. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3928. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3929. if (not RUNTIME):
  3930. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3931. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3932. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3933. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3934. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3935. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3936. #
  3937. # DIRECTORY: panda/metalibs/panda/
  3938. #
  3939. if (not RUNTIME):
  3940. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3941. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3942. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3943. 'SETUPAPI', 'INOTIFY']
  3944. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3945. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3946. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3947. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3948. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3949. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3950. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3951. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3952. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3953. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3954. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3955. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3956. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3957. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3958. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3959. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3960. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3961. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3962. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3963. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3964. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3965. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3966. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3967. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3968. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3969. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3970. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3971. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3972. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3973. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3974. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3975. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3976. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3977. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3978. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3979. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3980. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3981. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3982. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3983. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3984. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3985. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3986. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3987. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3988. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3989. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3990. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3991. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3992. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3993. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3994. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3995. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3996. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3997. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3998. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3999. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  4000. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  4001. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  4002. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  4003. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  4004. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  4005. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  4006. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  4007. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  4008. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  4009. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  4010. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  4011. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  4012. if PkgSkip("FREETYPE")==0:
  4013. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  4014. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  4015. TargetAdd('libpanda.dll', opts=OPTS)
  4016. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  4017. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  4018. PyTargetAdd('core_module.obj', input='libp3prc.in')
  4019. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  4020. PyTargetAdd('core_module.obj', input='libp3express.in')
  4021. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  4022. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  4023. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  4024. PyTargetAdd('core_module.obj', input='libp3cull.in')
  4025. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  4026. PyTargetAdd('core_module.obj', input='libp3chan.in')
  4027. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  4028. PyTargetAdd('core_module.obj', input='libp3char.in')
  4029. PyTargetAdd('core_module.obj', input='libp3collide.in')
  4030. PyTargetAdd('core_module.obj', input='libp3device.in')
  4031. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  4032. PyTargetAdd('core_module.obj', input='libp3display.in')
  4033. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  4034. PyTargetAdd('core_module.obj', input='libp3event.in')
  4035. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  4036. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  4037. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  4038. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  4039. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  4040. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  4041. PyTargetAdd('core_module.obj', input='libp3text.in')
  4042. PyTargetAdd('core_module.obj', input='libp3tform.in')
  4043. PyTargetAdd('core_module.obj', input='libp3putil.in')
  4044. PyTargetAdd('core_module.obj', input='libp3audio.in')
  4045. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  4046. PyTargetAdd('core_module.obj', input='libp3net.in')
  4047. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  4048. PyTargetAdd('core_module.obj', input='libp3movies.in')
  4049. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  4050. if PkgSkip("FREETYPE")==0:
  4051. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  4052. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  4053. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  4054. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  4055. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  4056. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  4057. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  4058. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  4059. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  4060. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  4061. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  4062. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  4063. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  4064. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  4065. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  4066. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  4067. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  4068. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  4069. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  4070. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  4071. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  4072. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  4073. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  4074. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  4075. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  4076. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  4077. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  4078. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  4079. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  4080. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  4081. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  4082. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  4083. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  4084. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  4085. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  4086. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4087. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4088. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4089. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4090. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4091. if PkgSkip("FREETYPE")==0:
  4092. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4093. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4094. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4095. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4096. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4097. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4098. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4099. PyTargetAdd('core.pyd', input='p3pstatclient_pStatClient_ext.obj')
  4100. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4101. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4102. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4103. PyTargetAdd('core.pyd', input='core_module.obj')
  4104. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4105. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4106. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4107. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4108. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4109. #
  4110. # DIRECTORY: panda/src/vision/
  4111. #
  4112. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4113. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4114. if not PkgSkip("FFMPEG"):
  4115. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4116. if not PkgSkip("OPENCV"):
  4117. DefSymbol("OPENCV", "HAVE_OPENCV")
  4118. if OPENCV_VER_23:
  4119. DefSymbol("OPENCV", "OPENCV_VER_23")
  4120. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4121. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4122. 'dtool_have_ffmpeg.dat',
  4123. 'dtool_have_opencv.dat',
  4124. 'dtool_have_directcam.dat',
  4125. ])
  4126. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4127. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4128. TargetAdd('libp3vision.dll', opts=OPTS)
  4129. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4130. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4131. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4132. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4133. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4134. PyTargetAdd('vision_module.obj', opts=OPTS)
  4135. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4136. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4137. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4138. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4139. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4140. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4141. #
  4142. # DIRECTORY: panda/src/rocket/
  4143. #
  4144. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4145. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4146. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4147. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4148. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4149. TargetAdd('libp3rocket.dll', opts=OPTS)
  4150. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4151. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4152. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4153. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4154. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4155. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4156. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4157. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4158. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4159. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4160. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4161. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4162. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4163. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4164. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4165. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4166. #
  4167. # DIRECTORY: panda/src/p3skel
  4168. #
  4169. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4170. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4171. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4172. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4173. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4174. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4175. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4176. #
  4177. # DIRECTORY: panda/src/p3skel
  4178. #
  4179. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4180. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4181. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4182. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4183. TargetAdd('libpandaskel.dll', opts=OPTS)
  4184. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4185. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4186. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4187. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4188. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4189. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4190. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4191. #
  4192. # DIRECTORY: panda/src/distort/
  4193. #
  4194. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4195. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4196. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4197. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4198. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4199. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4200. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4201. #
  4202. # DIRECTORY: panda/metalibs/pandafx/
  4203. #
  4204. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4205. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4206. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4207. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4208. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4209. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4210. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4211. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4212. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4213. PyTargetAdd('fx_module.obj', opts=OPTS)
  4214. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4215. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4216. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4217. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4218. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4219. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4220. #
  4221. # DIRECTORY: panda/src/vrpn/
  4222. #
  4223. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4224. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4225. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4226. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4227. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4228. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4229. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4230. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4231. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4232. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4233. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4234. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4235. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4236. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4237. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4238. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4239. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4240. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4241. #
  4242. # DIRECTORY: panda/src/ffmpeg
  4243. #
  4244. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4245. if not PkgSkip("SWSCALE"):
  4246. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4247. if not PkgSkip("SWRESAMPLE"):
  4248. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4249. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4250. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4251. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4252. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4253. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4254. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4255. #
  4256. # DIRECTORY: panda/src/audiotraits/
  4257. #
  4258. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4259. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4260. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4261. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4262. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4263. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4264. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4265. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4266. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4267. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4268. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4269. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4270. #
  4271. # DIRECTORY: panda/src/downloadertools/
  4272. #
  4273. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4274. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4275. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4276. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4277. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4278. TargetAdd('apply_patch.exe', opts=OPTS)
  4279. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4280. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4281. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4282. TargetAdd('build_patch.exe', opts=OPTS)
  4283. if not PkgSkip("ZLIB"):
  4284. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4285. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4286. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4287. TargetAdd('check_adler.exe', opts=OPTS)
  4288. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4289. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4290. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4291. TargetAdd('check_crc.exe', opts=OPTS)
  4292. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4293. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4294. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4295. TargetAdd('check_md5.exe', opts=OPTS)
  4296. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4297. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4298. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4299. TargetAdd('pdecrypt.exe', opts=OPTS)
  4300. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4301. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4302. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4303. TargetAdd('pencrypt.exe', opts=OPTS)
  4304. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4305. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4306. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4307. TargetAdd('show_ddb.exe', opts=OPTS)
  4308. #
  4309. # DIRECTORY: panda/src/downloadertools/
  4310. #
  4311. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4312. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4313. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4314. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4315. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4316. TargetAdd('multify.exe', opts=OPTS)
  4317. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4318. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4319. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4320. TargetAdd('pzip.exe', opts=OPTS)
  4321. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4322. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4323. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4324. TargetAdd('punzip.exe', opts=OPTS)
  4325. #
  4326. # DIRECTORY: panda/src/windisplay/
  4327. #
  4328. if (GetTarget() == 'windows' and not RUNTIME):
  4329. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4330. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4331. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4332. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4333. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4334. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4335. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4336. #
  4337. # DIRECTORY: panda/metalibs/pandadx9/
  4338. #
  4339. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4340. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4341. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4342. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4343. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4344. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4345. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4346. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4347. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4348. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4349. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4350. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4351. #
  4352. # DIRECTORY: panda/src/egg/
  4353. #
  4354. if not RUNTIME and not PkgSkip("EGG"):
  4355. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4356. CreateFile(GetOutputDir()+"/include/parser.h")
  4357. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4358. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4359. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4360. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4361. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4362. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4363. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4364. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4365. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4366. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4367. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4368. #
  4369. # DIRECTORY: panda/src/egg2pg/
  4370. #
  4371. if not RUNTIME and not PkgSkip("EGG"):
  4372. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4373. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4374. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4375. OPTS=['DIR:panda/src/egg2pg']
  4376. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4377. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4378. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4379. #
  4380. # DIRECTORY: panda/src/framework/
  4381. #
  4382. if (not RUNTIME):
  4383. deps = []
  4384. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4385. if GetLinkAllStatic():
  4386. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4387. if not PkgSkip("GL"):
  4388. DefSymbol("FRAMEWORK", "HAVE_GL")
  4389. if not PkgSkip("TINYDISPLAY"):
  4390. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4391. if not PkgSkip("EGG"):
  4392. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4393. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4394. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4395. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4396. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4397. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4398. #
  4399. # DIRECTORY: panda/src/glgsg/
  4400. #
  4401. if (not RUNTIME and PkgSkip("GL")==0):
  4402. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4403. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4404. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4405. #
  4406. # DIRECTORY: panda/src/glesgsg/
  4407. #
  4408. if (not RUNTIME and PkgSkip("GLES")==0):
  4409. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4410. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4411. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4412. #
  4413. # DIRECTORY: panda/src/gles2gsg/
  4414. #
  4415. if (not RUNTIME and PkgSkip("GLES2")==0):
  4416. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4417. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4418. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4419. #
  4420. # DIRECTORY: panda/metalibs/pandaegg/
  4421. #
  4422. if not RUNTIME and not PkgSkip("EGG"):
  4423. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4424. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4425. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4426. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4427. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4428. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4429. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4430. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4431. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4432. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4433. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4434. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4435. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4436. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4437. PyTargetAdd('egg_module.obj', opts=OPTS)
  4438. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4439. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4440. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4441. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4442. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4443. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4444. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4445. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4446. #
  4447. # DIRECTORY: panda/src/x11display/
  4448. #
  4449. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4450. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4451. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4452. #
  4453. # DIRECTORY: panda/src/glxdisplay/
  4454. #
  4455. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4456. DefSymbol('GLX', 'HAVE_GLX', '')
  4457. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4458. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4459. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4460. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4461. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4462. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4463. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4464. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4465. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4466. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4467. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4468. #
  4469. # DIRECTORY: panda/src/cocoadisplay/
  4470. #
  4471. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4472. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4473. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4474. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4475. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4476. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4477. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4478. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4479. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4480. if (PkgSkip('PANDAFX')==0):
  4481. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4482. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4483. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4484. #
  4485. # DIRECTORY: panda/src/osxdisplay/
  4486. #
  4487. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4488. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4489. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4490. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4491. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4492. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4493. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4494. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4495. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4496. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4497. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4498. if (PkgSkip('PANDAFX')==0):
  4499. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4500. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4501. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4502. #
  4503. # DIRECTORY: panda/src/wgldisplay/
  4504. #
  4505. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4506. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4507. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4508. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4509. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4510. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4511. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4512. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4513. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4514. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4515. if (PkgSkip('PANDAFX')==0):
  4516. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4517. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4518. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4519. #
  4520. # DIRECTORY: panda/src/egldisplay/
  4521. #
  4522. # If we're not compiling with any windowing system at all, but we do have EGL,
  4523. # we can use that to create a headless libpandagl instead.
  4524. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4525. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4526. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4527. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4528. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4529. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4530. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4531. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4532. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4533. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4534. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4535. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4536. # As a temporary solution for #1086, build this module, which we can use as a
  4537. # fallback to OpenGL for headless systems.
  4538. DefSymbol('EGL', 'HAVE_EGL', '')
  4539. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4540. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4541. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4542. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4543. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4544. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4545. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4546. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4547. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4548. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4549. #
  4550. # DIRECTORY: panda/src/egldisplay/
  4551. #
  4552. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4553. DefSymbol('GLES', 'OPENGLES_1', '')
  4554. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4555. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4556. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4557. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4558. if not PkgSkip("X11"):
  4559. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4560. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4561. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4562. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4563. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4564. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4565. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4566. #
  4567. # DIRECTORY: panda/src/egldisplay/
  4568. #
  4569. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4570. DefSymbol('GLES2', 'OPENGLES_2', '')
  4571. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4572. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4573. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4574. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4575. if not PkgSkip("X11"):
  4576. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4577. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4578. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4579. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4580. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4581. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4582. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4583. #
  4584. # DIRECTORY: panda/src/ode/
  4585. #
  4586. if (PkgSkip("ODE")==0 and not RUNTIME):
  4587. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4588. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4589. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4590. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4591. OPTS=['DIR:panda/src/ode', 'ODE']
  4592. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4593. IGATEFILES.remove("odeConvexGeom.h")
  4594. IGATEFILES.remove("odeHelperStructs.h")
  4595. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4596. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4597. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4598. #
  4599. # DIRECTORY: panda/metalibs/pandaode/
  4600. #
  4601. if (PkgSkip("ODE")==0 and not RUNTIME):
  4602. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4603. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4604. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4605. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4606. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4607. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4608. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4609. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4610. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4611. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4612. PyTargetAdd('ode_module.obj', opts=OPTS)
  4613. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4614. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4615. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4616. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4617. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4618. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4619. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4620. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4621. #
  4622. # DIRECTORY: panda/src/bullet/
  4623. #
  4624. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4625. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4626. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4627. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4628. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4629. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4630. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4631. #
  4632. # DIRECTORY: panda/metalibs/pandabullet/
  4633. #
  4634. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4635. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4636. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4637. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4638. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4639. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4640. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4641. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4642. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4643. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4644. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4645. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4646. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4647. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4648. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4649. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4650. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4651. #
  4652. # DIRECTORY: panda/src/physx/
  4653. #
  4654. if (PkgSkip("PHYSX")==0):
  4655. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4656. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4657. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4658. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4659. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4660. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4661. #
  4662. # DIRECTORY: panda/metalibs/pandaphysx/
  4663. #
  4664. if (PkgSkip("PHYSX")==0):
  4665. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4666. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4667. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4668. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4669. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4670. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4671. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4672. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4673. PyTargetAdd('physx_module.obj', opts=OPTS)
  4674. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4675. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4676. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4677. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4678. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4679. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4680. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4681. #
  4682. # DIRECTORY: panda/src/physics/
  4683. #
  4684. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4685. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4686. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4687. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4688. OPTS=['DIR:panda/src/physics']
  4689. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4690. IGATEFILES.remove("forces.h")
  4691. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4692. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4693. #
  4694. # DIRECTORY: panda/src/particlesystem/
  4695. #
  4696. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4697. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4698. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4699. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4700. OPTS=['DIR:panda/src/particlesystem']
  4701. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4702. IGATEFILES.remove('orientedParticle.h')
  4703. IGATEFILES.remove('orientedParticleFactory.h')
  4704. IGATEFILES.remove('particlefactories.h')
  4705. IGATEFILES.remove('emitters.h')
  4706. IGATEFILES.remove('particles.h')
  4707. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4708. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4709. #
  4710. # DIRECTORY: panda/metalibs/pandaphysics/
  4711. #
  4712. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4713. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4714. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4715. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4716. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4717. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4718. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4719. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4720. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4721. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4722. OPTS=['DIR:panda/metalibs/pandaphysics']
  4723. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4724. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4725. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4726. PyTargetAdd('physics_module.obj', opts=OPTS)
  4727. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4728. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4729. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4730. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4731. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4732. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4733. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4734. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4735. #
  4736. # DIRECTORY: panda/src/speedtree/
  4737. #
  4738. if (PkgSkip("SPEEDTREE")==0):
  4739. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4740. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4741. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4742. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4743. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4744. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4745. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4746. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4747. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4748. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4749. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4750. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4751. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4752. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4753. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4754. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4755. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4756. #
  4757. # DIRECTORY: panda/src/testbed/
  4758. #
  4759. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4760. OPTS=['DIR:panda/src/testbed']
  4761. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4762. TargetAdd('pview.exe', input='pview_pview.obj')
  4763. TargetAdd('pview.exe', input='libp3framework.dll')
  4764. if not PkgSkip("EGG"):
  4765. TargetAdd('pview.exe', input='libpandaegg.dll')
  4766. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4767. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4768. if GetLinkAllStatic() and not PkgSkip("GL"):
  4769. TargetAdd('pview.exe', input='libpandagl.dll')
  4770. #
  4771. # DIRECTORY: panda/src/android/
  4772. #
  4773. if (not RUNTIME and GetTarget() == 'android'):
  4774. OPTS=['DIR:panda/src/android']
  4775. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4776. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4777. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4778. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4779. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4780. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4781. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4782. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4783. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4784. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4785. if (not RTDIST and PkgSkip("PVIEW")==0):
  4786. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4787. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4788. TargetAdd('libpview.dll', input='android_main.obj')
  4789. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4790. TargetAdd('libpview.dll', input='libp3framework.dll')
  4791. if not PkgSkip("EGG"):
  4792. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4793. TargetAdd('libpview.dll', input='libp3android.dll')
  4794. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4795. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4796. if (not RTDIST and PkgSkip("PYTHON")==0):
  4797. OPTS += ['PYTHON']
  4798. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4799. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4800. TargetAdd('libppython.dll', input='android_main.obj')
  4801. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4802. TargetAdd('libppython.dll', input='libp3framework.dll')
  4803. TargetAdd('libppython.dll', input='libp3android.dll')
  4804. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4805. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4806. #
  4807. # DIRECTORY: panda/src/androiddisplay/
  4808. #
  4809. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4810. DefSymbol('GLES', 'OPENGLES_1', '')
  4811. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4812. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4813. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4814. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4815. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4816. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4817. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4818. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4819. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4820. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4821. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4822. #
  4823. # DIRECTORY: panda/src/tinydisplay/
  4824. #
  4825. if not RUNTIME and not PkgSkip("TINYDISPLAY"):
  4826. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4827. if not PkgSkip("X11"):
  4828. OPTS += ['X11']
  4829. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4830. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4831. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4832. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4833. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4834. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4835. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4836. if GetTarget() == 'darwin':
  4837. if frozenset(OSX_ARCHS) - frozenset(('x86_64', 'arm64')):
  4838. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4839. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4840. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4841. elif GetTarget() == 'windows':
  4842. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4843. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4844. elif not PkgSkip("X11"):
  4845. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4846. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4847. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4848. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4849. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4850. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4851. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4852. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4853. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4854. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4855. #
  4856. # DIRECTORY: direct/src/directbase/
  4857. #
  4858. if (PkgSkip("DIRECT")==0):
  4859. OPTS=['DIR:direct/src/directbase']
  4860. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4861. #
  4862. # DIRECTORY: direct/src/dcparser/
  4863. #
  4864. if (PkgSkip("DIRECT")==0):
  4865. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4866. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4867. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4868. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4869. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4870. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4871. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4872. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4873. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4874. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4875. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4876. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4877. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4878. #
  4879. # DIRECTORY: direct/src/deadrec/
  4880. #
  4881. if (PkgSkip("DIRECT")==0):
  4882. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4883. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4884. OPTS=['DIR:direct/src/deadrec']
  4885. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4886. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4887. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4888. #
  4889. # DIRECTORY: direct/src/distributed/
  4890. #
  4891. if (PkgSkip("DIRECT")==0):
  4892. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4893. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4894. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4895. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4896. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4897. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4898. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4899. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4900. #
  4901. # DIRECTORY: direct/src/interval/
  4902. #
  4903. if (PkgSkip("DIRECT")==0):
  4904. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4905. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4906. OPTS=['DIR:direct/src/interval']
  4907. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4908. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4909. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4910. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4911. #
  4912. # DIRECTORY: direct/src/showbase/
  4913. #
  4914. if (PkgSkip("DIRECT")==0):
  4915. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4916. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4917. if GetTarget() == 'darwin':
  4918. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4919. OPTS=['DIR:direct/src/showbase']
  4920. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4921. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4922. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4923. #
  4924. # DIRECTORY: direct/src/motiontrail/
  4925. #
  4926. if (PkgSkip("DIRECT")==0):
  4927. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4928. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4929. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4930. OPTS=['DIR:direct/src/motiontrail']
  4931. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4932. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4933. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4934. #
  4935. # DIRECTORY: direct/metalibs/direct/
  4936. #
  4937. if (PkgSkip("DIRECT")==0):
  4938. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4939. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4940. if GetTarget() == 'darwin':
  4941. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4942. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4943. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4944. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4945. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4946. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4947. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4948. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4949. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4950. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4951. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4952. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4953. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4954. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4955. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4956. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4957. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4958. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4959. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4960. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4961. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4962. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4963. # the Python libraries. If a C++ user needs these modules, we can move them
  4964. # back and filter out the Python-specific code.
  4965. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4966. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4967. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4968. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4969. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4970. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4971. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4972. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4973. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4974. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4975. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4976. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4977. #
  4978. # DIRECTORY: direct/src/dcparse/
  4979. #
  4980. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4981. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4982. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4983. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4984. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4985. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4986. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4987. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4988. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4989. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4990. #PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4991. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4992. #
  4993. # DIRECTORY: direct/src/plugin/
  4994. #
  4995. if (RTDIST or RUNTIME):
  4996. # Explicitly define this as we don't include dtool_config.h here.
  4997. if GetTarget() not in ('windows', 'darwin'):
  4998. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4999. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  5000. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  5001. OPTS += ['ZLIB', 'MSIMG']
  5002. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  5003. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  5004. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  5005. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  5006. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  5007. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  5008. if GetTarget() == 'darwin':
  5009. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  5010. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  5011. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  5012. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  5013. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  5014. if (RTDIST):
  5015. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  5016. TargetAdd(fname, input='plugin_plugin.obj')
  5017. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  5018. TargetAdd(fname, input='plugin_wstring_encode.obj')
  5019. TargetAdd(fname, input='plugin_parse_color.obj')
  5020. TargetAdd(fname, input='plugin_find_root_dir.obj')
  5021. if GetTarget() == 'darwin':
  5022. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  5023. TargetAdd(fname, input='plugin_fileSpec.obj')
  5024. TargetAdd(fname, input='plugin_binaryXml.obj')
  5025. TargetAdd(fname, input='plugin_handleStream.obj')
  5026. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  5027. TargetAdd(fname, input='libp3tinyxml.ilb')
  5028. if GetTarget() == 'darwin':
  5029. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  5030. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  5031. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  5032. if (PkgSkip("PYTHON")==0 and RTDIST):
  5033. # Freeze VFSImporter and its dependency modules into p3dpython.
  5034. # Mark panda3d.core as a dependency to make sure to build that first.
  5035. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  5036. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  5037. OPTS += ['PYTHON']
  5038. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5039. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5040. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  5041. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  5042. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  5043. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  5044. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  5045. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  5046. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  5047. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  5048. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  5049. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  5050. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  5051. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  5052. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  5053. if GetTarget() == 'windows':
  5054. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  5055. OPTS.append("NON_CONSOLE")
  5056. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5057. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5058. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  5059. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  5060. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  5061. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  5062. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  5063. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  5064. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  5065. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  5066. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  5067. if GetTarget() == 'darwin':
  5068. OPTS += ['OPT:2']
  5069. if (PkgSkip("FLTK")==0):
  5070. OPTS.append("FLTK")
  5071. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  5072. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  5073. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5074. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5075. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5076. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  5077. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  5078. if GetTarget() == 'darwin':
  5079. OPTS += ['OPT:2']
  5080. TargetAdd('p3dcert.exe', opts=OPTS)
  5081. elif (PkgSkip("WX")==0):
  5082. OPTS += ["WX", "RTTI"]
  5083. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  5084. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5085. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5086. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5087. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  5088. if GetTarget() == "darwin":
  5089. OPTS += ['GL', 'OPT:2']
  5090. TargetAdd('p3dcert.exe', opts=OPTS)
  5091. #
  5092. # DIRECTORY: direct/src/plugin_npapi/
  5093. #
  5094. if RUNTIME:
  5095. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  5096. if GetTarget() == 'windows':
  5097. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5098. "version" : VERSION,
  5099. "description" : "Runs 3-D games and interactive applets",
  5100. "filename" : "nppanda3d.dll",
  5101. "mimetype" : "application/x-panda3d",
  5102. "extension" : "p3d",
  5103. "filedesc" : "Panda3D applet"}
  5104. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5105. elif GetTarget() == 'darwin':
  5106. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5107. OPTS += ['GTK2']
  5108. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5109. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5110. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5111. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5112. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5113. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5114. if GetTarget() == 'windows':
  5115. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5116. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5117. elif GetTarget() == 'darwin':
  5118. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5119. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5120. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5121. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5122. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5123. #
  5124. # DIRECTORY: direct/src/plugin_activex/
  5125. #
  5126. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5127. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5128. DefSymbol('ACTIVEX', '_USRDLL', '')
  5129. DefSymbol('ACTIVEX', '_WINDLL', '')
  5130. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5131. DefSymbol('ACTIVEX', '_MBCS', '')
  5132. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5133. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5134. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5135. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5136. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5137. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5138. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5139. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5140. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5141. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5142. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5143. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5144. #
  5145. # DIRECTORY: direct/src/plugin_standalone/
  5146. #
  5147. if (RUNTIME):
  5148. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5149. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5150. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5151. if GetTarget() == 'windows':
  5152. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5153. "version" : VERSION,
  5154. "description" : "Runs 3-D games and interactive applets",
  5155. "filename" : "panda3d.exe",
  5156. "mimetype" : "application/x-panda3d",
  5157. "extension" : "p3d",
  5158. "filedesc" : "Panda3D applet",
  5159. "icon" : "panda3d.ico"}
  5160. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5161. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5162. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5163. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5164. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5165. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5166. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5167. if GetTarget() == 'darwin':
  5168. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5169. elif GetTarget() == 'windows':
  5170. TargetAdd('panda3d.exe', input='panda3d.res')
  5171. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5172. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5173. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5174. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5175. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5176. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5177. if (GetTarget() == 'darwin'):
  5178. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5179. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5180. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5181. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5182. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5183. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5184. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5185. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5186. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5187. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5188. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5189. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5190. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5191. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5192. elif (GetTarget() == 'windows'):
  5193. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5194. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5195. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5196. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5197. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5198. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5199. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5200. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5201. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5202. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5203. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5204. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5205. if (RTDIST):
  5206. OPTS=['BUILDING:P3D_PLUGIN', 'DIR:direct/src/plugin_standalone', 'DIR:direct/src/plugin', 'DIR:dtool/src/dtoolbase', 'DIR:dtool/src/dtoolutil', 'DIR:dtool/src/pystub', 'DIR:dtool/src/prc', 'DIR:dtool/src/dconfig', 'DIR:panda/src/express', 'DIR:panda/src/downloader', 'RUNTIME', 'P3DEMBED', 'OPENSSL', 'ZLIB']
  5207. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5208. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5209. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5210. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5211. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5212. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5213. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5214. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5215. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5216. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5217. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5218. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5219. if (GetTarget() == 'darwin'):
  5220. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5221. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5222. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5223. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5224. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5225. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5226. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5227. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5228. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5229. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5230. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5231. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5232. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5233. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5234. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5235. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5236. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5237. if GetTarget() == 'darwin':
  5238. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5239. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5240. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5241. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5242. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5243. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5244. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5245. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5246. if GetTarget() == 'darwin':
  5247. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5248. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5249. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5250. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5251. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5252. if GetTarget() == 'windows':
  5253. OPTS.append("P3DEMBEDW")
  5254. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5255. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5256. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5257. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5258. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5259. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5260. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5261. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5262. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5263. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5264. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5265. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5266. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5267. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5268. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5269. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5270. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5271. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5272. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5273. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5274. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5275. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5276. #
  5277. # DIRECTORY: pandatool/src/pandatoolbase/
  5278. #
  5279. if (PkgSkip("PANDATOOL")==0):
  5280. OPTS=['DIR:pandatool/src/pandatoolbase']
  5281. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5282. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5283. #
  5284. # DIRECTORY: pandatool/src/converter/
  5285. #
  5286. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5287. OPTS=['DIR:pandatool/src/converter']
  5288. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5289. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5290. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5291. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5292. #
  5293. # DIRECTORY: pandatool/src/progbase/
  5294. #
  5295. if not PkgSkip("PANDATOOL"):
  5296. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5297. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5298. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5299. #
  5300. # DIRECTORY: pandatool/src/eggbase/
  5301. #
  5302. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5303. OPTS=['DIR:pandatool/src/eggbase']
  5304. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5305. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5306. #
  5307. # DIRECTORY: pandatool/src/bam/
  5308. #
  5309. if not PkgSkip("PANDATOOL"):
  5310. OPTS=['DIR:pandatool/src/bam']
  5311. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5312. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5313. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5314. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5315. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5316. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5317. if not PkgSkip("EGG"):
  5318. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5319. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5320. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5321. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5322. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5323. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5324. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5325. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5326. #
  5327. # DIRECTORY: pandatool/src/cvscopy/
  5328. #
  5329. if not PkgSkip("PANDATOOL"):
  5330. OPTS=['DIR:pandatool/src/cvscopy']
  5331. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5332. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5333. #
  5334. # DIRECTORY: pandatool/src/daeegg/
  5335. #
  5336. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5337. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5338. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5339. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5340. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5341. #
  5342. # DIRECTORY: pandatool/src/assimp
  5343. #
  5344. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5345. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5346. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5347. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5348. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5349. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5350. #
  5351. # DIRECTORY: pandatool/src/daeprogs/
  5352. #
  5353. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5354. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5355. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5356. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5357. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5358. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5359. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5360. #
  5361. # DIRECTORY: pandatool/src/dxf/
  5362. #
  5363. if not PkgSkip("PANDATOOL"):
  5364. OPTS=['DIR:pandatool/src/dxf']
  5365. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5366. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5367. #
  5368. # DIRECTORY: pandatool/src/dxfegg/
  5369. #
  5370. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5371. OPTS=['DIR:pandatool/src/dxfegg']
  5372. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5373. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5374. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5375. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5376. #
  5377. # DIRECTORY: pandatool/src/dxfprogs/
  5378. #
  5379. if not PkgSkip("PANDATOOL"):
  5380. OPTS=['DIR:pandatool/src/dxfprogs']
  5381. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5382. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5383. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5384. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5385. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5386. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5387. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5388. if not PkgSkip("EGG"):
  5389. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5390. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5391. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5392. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5393. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5394. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5395. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5396. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5397. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5398. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5399. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5400. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5401. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5402. #
  5403. # DIRECTORY: pandatool/src/objegg/
  5404. #
  5405. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5406. OPTS=['DIR:pandatool/src/objegg']
  5407. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5408. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5409. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5410. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5411. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5412. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5413. #
  5414. # DIRECTORY: pandatool/src/objprogs/
  5415. #
  5416. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5417. OPTS=['DIR:pandatool/src/objprogs']
  5418. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5419. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5420. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5421. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5422. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5423. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5424. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5425. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5426. #
  5427. # DIRECTORY: pandatool/src/palettizer/
  5428. #
  5429. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5430. OPTS=['DIR:pandatool/src/palettizer']
  5431. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5432. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5433. #
  5434. # DIRECTORY: pandatool/src/egg-mkfont/
  5435. #
  5436. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5437. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5438. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5439. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5440. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5441. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5442. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5443. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5444. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5445. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5446. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5447. #
  5448. # DIRECTORY: pandatool/src/eggcharbase/
  5449. #
  5450. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5451. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5452. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5453. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5454. #
  5455. # DIRECTORY: pandatool/src/egg-optchar/
  5456. #
  5457. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5458. OPTS=['DIR:pandatool/src/egg-optchar']
  5459. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5460. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5461. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5462. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5463. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5464. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5465. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5466. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5467. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5468. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5469. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5470. #
  5471. # DIRECTORY: pandatool/src/egg-palettize/
  5472. #
  5473. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5474. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5475. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5476. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5477. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5478. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5479. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5480. #
  5481. # DIRECTORY: pandatool/src/egg-qtess/
  5482. #
  5483. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5484. OPTS=['DIR:pandatool/src/egg-qtess']
  5485. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5486. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5487. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5488. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5489. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5490. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5491. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5492. #
  5493. # DIRECTORY: pandatool/src/eggprogs/
  5494. #
  5495. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5496. OPTS=['DIR:pandatool/src/eggprogs']
  5497. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5498. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5499. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5500. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5501. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5502. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5503. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5504. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5505. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5506. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5507. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5508. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5509. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5510. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5511. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5512. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5513. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5514. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5515. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5516. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5517. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5518. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5519. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5520. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5521. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5522. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5523. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5524. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5525. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5526. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5527. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5528. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5529. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5530. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5531. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5532. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5533. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5534. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5535. #
  5536. # DIRECTORY: pandatool/src/flt/
  5537. #
  5538. if not PkgSkip("PANDATOOL"):
  5539. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5540. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5541. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5542. #
  5543. # DIRECTORY: pandatool/src/fltegg/
  5544. #
  5545. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5546. OPTS=['DIR:pandatool/src/fltegg']
  5547. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5548. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5549. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5550. #
  5551. # DIRECTORY: pandatool/src/fltprogs/
  5552. #
  5553. if not PkgSkip("PANDATOOL"):
  5554. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5555. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5556. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5557. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5558. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5559. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5560. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5561. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5562. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5563. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5564. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5565. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5566. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5567. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5568. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5569. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5570. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5571. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5572. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5573. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5574. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5575. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5576. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5577. if not PkgSkip("EGG"):
  5578. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5579. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5580. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5581. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5582. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5583. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5584. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5585. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5586. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5587. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5588. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5589. #
  5590. # DIRECTORY: pandatool/src/imagebase/
  5591. #
  5592. if not PkgSkip("PANDATOOL"):
  5593. OPTS=['DIR:pandatool/src/imagebase']
  5594. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5595. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5596. #
  5597. # DIRECTORY: pandatool/src/imageprogs/
  5598. #
  5599. if not PkgSkip("PANDATOOL"):
  5600. OPTS=['DIR:pandatool/src/imageprogs']
  5601. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5602. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5603. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5604. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5605. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5606. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5607. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5608. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5609. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5610. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5611. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5612. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5613. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5614. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5615. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5616. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5617. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5618. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5619. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5620. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5621. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5622. #
  5623. # DIRECTORY: pandatool/src/pfmprogs/
  5624. #
  5625. if not PkgSkip("PANDATOOL"):
  5626. OPTS=['DIR:pandatool/src/pfmprogs']
  5627. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5628. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5629. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5630. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5631. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5632. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5633. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5634. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5635. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5636. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5637. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5638. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5639. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5640. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5641. #
  5642. # DIRECTORY: pandatool/src/lwo/
  5643. #
  5644. if not PkgSkip("PANDATOOL"):
  5645. OPTS=['DIR:pandatool/src/lwo']
  5646. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5647. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5648. #
  5649. # DIRECTORY: pandatool/src/lwoegg/
  5650. #
  5651. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5652. OPTS=['DIR:pandatool/src/lwoegg']
  5653. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5654. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5655. #
  5656. # DIRECTORY: pandatool/src/lwoprogs/
  5657. #
  5658. if not PkgSkip("PANDATOOL"):
  5659. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5660. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5661. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5662. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5663. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5664. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5665. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5666. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5667. if not PkgSkip("EGG"):
  5668. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5669. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5670. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5671. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5672. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5673. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5674. #
  5675. # DIRECTORY: pandatool/src/maya/
  5676. #
  5677. for VER in MAYAVERSIONS:
  5678. VNUM=VER[4:]
  5679. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5680. OPTS=['DIR:pandatool/src/maya', VER]
  5681. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5682. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5683. #
  5684. # DIRECTORY: pandatool/src/mayaegg/
  5685. #
  5686. for VER in MAYAVERSIONS:
  5687. VNUM=VER[4:]
  5688. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5689. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5690. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5691. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5692. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5693. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5694. #
  5695. # DIRECTORY: pandatool/src/maxegg/
  5696. #
  5697. for VER in MAXVERSIONS:
  5698. VNUM=VER[3:]
  5699. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5700. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5701. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5702. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5703. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5704. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5705. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5706. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5707. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5708. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5709. #
  5710. # DIRECTORY: pandatool/src/maxprogs/
  5711. #
  5712. for VER in MAXVERSIONS:
  5713. VNUM=VER[3:]
  5714. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5715. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5716. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5717. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5718. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5719. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5720. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5721. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5722. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5723. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5724. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5725. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5726. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5727. #
  5728. # DIRECTORY: pandatool/src/vrml/
  5729. #
  5730. if not PkgSkip("PANDATOOL"):
  5731. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5732. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5733. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5734. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5735. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5736. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5737. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5738. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5739. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5740. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5741. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5742. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5743. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5744. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5745. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5746. #
  5747. # DIRECTORY: pandatool/src/vrmlegg/
  5748. #
  5749. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5750. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5751. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5752. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5753. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5754. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5755. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5756. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5757. #
  5758. # DIRECTORY: pandatool/src/xfile/
  5759. #
  5760. if not PkgSkip("PANDATOOL"):
  5761. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5762. CreateFile(GetOutputDir()+"/include/xParser.h")
  5763. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5764. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5765. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5766. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5767. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5768. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5769. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5770. #
  5771. # DIRECTORY: pandatool/src/xfileegg/
  5772. #
  5773. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5774. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5775. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5776. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5777. #
  5778. # DIRECTORY: pandatool/src/ptloader/
  5779. #
  5780. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5781. if not PkgSkip("FCOLLADA"):
  5782. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5783. OPTS=['DIR:pandatool/src/ptloader', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/lwo', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/daeegg', 'BUILDING:PTLOADER', 'FCOLLADA']
  5784. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5785. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5786. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5787. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5788. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5789. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5790. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5791. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5792. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5793. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5794. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5795. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5796. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5797. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5798. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5799. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5800. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5801. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5802. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5803. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5804. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5805. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5806. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5807. #
  5808. # DIRECTORY: pandatool/src/miscprogs/
  5809. #
  5810. # This is a bit of an esoteric tool, and it causes issues because
  5811. # it conflicts with tools of the same name in different packages.
  5812. #if (PkgSkip("PANDATOOL")==0):
  5813. # OPTS=['DIR:pandatool/src/miscprogs']
  5814. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5815. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5816. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5817. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5818. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5819. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5820. #
  5821. # DIRECTORY: pandatool/src/pstatserver/
  5822. #
  5823. if (PkgSkip("PANDATOOL")==0):
  5824. OPTS=['DIR:pandatool/src/pstatserver']
  5825. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5826. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5827. #
  5828. # DIRECTORY: pandatool/src/text-stats/
  5829. #
  5830. if (PkgSkip("PANDATOOL")==0):
  5831. OPTS=['DIR:pandatool/src/text-stats']
  5832. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5833. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5834. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5835. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5836. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5837. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5838. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5839. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5840. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5841. #
  5842. # DIRECTORY: pandatool/src/vrmlprogs/
  5843. #
  5844. if not PkgSkip("PANDATOOL"):
  5845. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5846. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5847. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5848. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5849. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5850. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5851. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5852. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5853. if not PkgSkip("EGG"):
  5854. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5855. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5856. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5857. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5858. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5859. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5860. #
  5861. # DIRECTORY: pandatool/src/win-stats/
  5862. # DIRECTORY: pandatool/src/gtk-stats/
  5863. #
  5864. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5865. if GetTarget() == 'windows':
  5866. OPTS=['DIR:pandatool/src/win-stats']
  5867. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5868. else:
  5869. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5870. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5871. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5872. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5873. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5874. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5875. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5876. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5877. #
  5878. # DIRECTORY: pandatool/src/xfileprogs/
  5879. #
  5880. if not PkgSkip("PANDATOOL"):
  5881. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5882. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5883. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5884. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5885. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5886. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5887. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5888. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5889. if not PkgSkip("EGG"):
  5890. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5891. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5892. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5893. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5894. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5895. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5896. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5897. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5898. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5899. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5900. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5901. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5902. #
  5903. # DIRECTORY: pandatool/src/mayaprogs/
  5904. #
  5905. for VER in MAYAVERSIONS:
  5906. VNUM = VER[4:]
  5907. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5908. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5909. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5910. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5911. continue
  5912. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5913. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5914. elif GetTarget() == 'darwin':
  5915. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5916. else:
  5917. ARCH_OPTS = []
  5918. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5919. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5920. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5921. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5922. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5923. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5924. #if GetTarget() == 'windows':
  5925. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5926. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5927. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5928. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5929. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5930. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5931. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5932. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5933. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5934. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5935. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5936. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5937. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5938. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5939. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5940. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5941. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5942. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5943. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5944. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5945. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5946. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5947. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5948. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5949. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5950. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5951. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5952. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5953. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5954. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5955. if GetTarget() == 'windows':
  5956. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5957. else:
  5958. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5959. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5960. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5961. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5962. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5963. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5964. if GetTarget() == 'windows':
  5965. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5966. else:
  5967. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5968. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5969. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5970. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5971. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5972. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5973. if GetTarget() == 'windows':
  5974. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5975. else:
  5976. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5977. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5978. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5979. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5980. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5981. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5982. if GetTarget() == 'windows':
  5983. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5984. else:
  5985. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5986. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5987. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5988. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5989. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5990. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5991. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5992. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5993. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5994. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5995. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5996. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5997. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5998. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5999. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  6000. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  6001. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  6002. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  6003. #
  6004. # DIRECTORY: contrib/src/ai/
  6005. #
  6006. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  6007. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  6008. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  6009. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  6010. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  6011. OPTS=['DIR:contrib/src/ai']
  6012. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  6013. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  6014. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  6015. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  6016. PyTargetAdd('ai_module.obj', opts=OPTS)
  6017. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  6018. PyTargetAdd('ai.pyd', input='ai_module.obj')
  6019. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  6020. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  6021. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  6022. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  6023. #
  6024. # DIRECTORY: contrib/src/rplight/
  6025. #
  6026. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  6027. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  6028. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  6029. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  6030. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  6031. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  6032. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  6033. PyTargetAdd('rplight_module.obj', opts=OPTS)
  6034. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  6035. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  6036. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  6037. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  6038. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  6039. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  6040. #
  6041. # DIRECTORY: pandatool/src/deploy-stub
  6042. #
  6043. if PkgSkip("PYTHON") == 0:
  6044. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  6045. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  6046. if GetTarget() == 'windows':
  6047. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  6048. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  6049. # Setup rpath so libs can be found in the same directory as the deployed game
  6050. LibName('DEPLOYSTUB', "-Wl,--disable-new-dtags,-rpath,\\$ORIGIN")
  6051. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  6052. LibName('DEPLOYSTUB', "-rdynamic")
  6053. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  6054. if GetTarget() == 'windows':
  6055. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  6056. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6057. if GetTarget() == 'windows':
  6058. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  6059. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  6060. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6061. elif GetTarget() == 'darwin':
  6062. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  6063. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  6064. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  6065. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  6066. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  6067. #
  6068. # Generate the models directory and samples directory
  6069. #
  6070. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  6071. model_extensions = ["*.egg"]
  6072. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  6073. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  6074. model_extensions.append("*.flt")
  6075. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  6076. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6077. newname = model[:-4] + ".egg.pz"
  6078. else:
  6079. newname = model[:-4] + ".egg"
  6080. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  6081. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  6082. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6083. newname = model[:-4] + ".egg.pz"
  6084. else:
  6085. newname = model[:-4] + ".egg"
  6086. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  6087. for model in GetDirectoryContents("models", model_extensions):
  6088. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6089. newname = model[:-4] + ".egg.pz"
  6090. else:
  6091. newname = model[:-4] + ".egg"
  6092. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  6093. if not PkgSkip("DIRECT") and not RUNTIME:
  6094. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  6095. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  6096. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  6097. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  6098. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  6099. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  6100. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  6101. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  6102. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  6103. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6104. #
  6105. # Build the rtdist.
  6106. #
  6107. if (RTDIST):
  6108. OPTS=['DIR:direct/src/p3d']
  6109. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6110. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6111. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6112. #
  6113. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6114. #
  6115. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6116. OPTS=['DIR:direct/src/p3d']
  6117. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6118. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6119. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6120. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6121. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6122. ##########################################################################################
  6123. #
  6124. # Dependency-Based Distributed Build System.
  6125. #
  6126. ##########################################################################################
  6127. DEPENDENCYQUEUE=[]
  6128. for target in TARGET_LIST:
  6129. name = target.name
  6130. inputs = target.inputs
  6131. opts = target.opts
  6132. deps = target.deps
  6133. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6134. def BuildWorker(taskqueue, donequeue):
  6135. while True:
  6136. try:
  6137. task = taskqueue.get(timeout=1)
  6138. except:
  6139. ProgressOutput(None, "Waiting for tasks...")
  6140. task = taskqueue.get()
  6141. sys.stdout.flush()
  6142. if (task == 0): return
  6143. try:
  6144. task[0](*task[1])
  6145. donequeue.put(task)
  6146. except:
  6147. donequeue.put(0)
  6148. def AllSourcesReady(task, pending):
  6149. sources = task[3]
  6150. for x in sources:
  6151. if (x in pending):
  6152. return 0
  6153. sources = task[1][1]
  6154. for x in sources:
  6155. if (x in pending):
  6156. return 0
  6157. altsources = task[4]
  6158. for x in altsources:
  6159. if (x in pending):
  6160. return 0
  6161. return 1
  6162. def ParallelMake(tasklist):
  6163. # Create the communication queues.
  6164. donequeue = queue.Queue()
  6165. taskqueue = queue.Queue()
  6166. # Build up a table listing all the pending targets
  6167. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6168. # task[2] = [name]
  6169. # task[3] = deps
  6170. # The python tool package, in particular fltegg seems to throw parallelmake off
  6171. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6172. # and another subpart to be built sequentially. The most time consuming part of the process
  6173. # is the c++ code generation anyways.
  6174. tasklist_seq = []
  6175. i = 0
  6176. while i < len(tasklist):
  6177. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6178. break
  6179. i += 1
  6180. if i < len(tasklist):
  6181. tasklist_seq = tasklist[i:]
  6182. tasklist = tasklist[:i]
  6183. iNumStartingTasks = len(tasklist)
  6184. pending = {}
  6185. for task in tasklist:
  6186. for target in task[2]:
  6187. pending[target] = 1
  6188. # Create the workers
  6189. for slave in range(THREADCOUNT):
  6190. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6191. th.daemon = True
  6192. th.start()
  6193. # Feed tasks to the workers.
  6194. tasksqueued = 0
  6195. while True:
  6196. if (tasksqueued < THREADCOUNT):
  6197. extras = []
  6198. for task in tasklist:
  6199. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6200. if (NeedsBuild(task[2], task[3])):
  6201. tasksqueued += 1
  6202. taskqueue.put(task)
  6203. else:
  6204. for target in task[2]:
  6205. del pending[target]
  6206. else:
  6207. extras.append(task)
  6208. tasklist = extras
  6209. sys.stdout.flush()
  6210. if (tasksqueued == 0): break
  6211. donetask = donequeue.get()
  6212. if (donetask == 0):
  6213. exit("Build process aborting.")
  6214. sys.stdout.flush()
  6215. tasksqueued -= 1
  6216. JustBuilt(donetask[2], donetask[3])
  6217. for target in donetask[2]:
  6218. del pending[target]
  6219. # Kill the workers.
  6220. for slave in range(THREADCOUNT):
  6221. taskqueue.put(0)
  6222. # Make sure there aren't any unsatisfied tasks
  6223. if len(tasklist) > 0:
  6224. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6225. SequentialMake(tasklist_seq)
  6226. def SequentialMake(tasklist):
  6227. i = 0
  6228. for task in tasklist:
  6229. if (NeedsBuild(task[2], task[3])):
  6230. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6231. JustBuilt(task[2], task[3])
  6232. i += 1
  6233. def RunDependencyQueue(tasklist):
  6234. if (THREADCOUNT!=0):
  6235. ParallelMake(tasklist)
  6236. else:
  6237. SequentialMake(tasklist)
  6238. try:
  6239. RunDependencyQueue(DEPENDENCYQUEUE)
  6240. finally:
  6241. SaveDependencyCache()
  6242. # Run the test suite.
  6243. if RUNTESTS:
  6244. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6245. if sys.version_info >= (2, 6):
  6246. cmdstr += " -B"
  6247. cmdstr += " -m pytest tests"
  6248. if GetVerbose():
  6249. cmdstr += " --verbose"
  6250. oscmd(cmdstr)
  6251. # Write out information about the Python versions in the built dir.
  6252. python_version_info = GetCurrentPythonVersionInfo()
  6253. UpdatePythonVersionInfoFile(python_version_info)
  6254. ##########################################################################################
  6255. #
  6256. # The Installers
  6257. #
  6258. # Under windows, we can build an 'exe' package using NSIS
  6259. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6260. # Under OSX, we can make a 'dmg' package.
  6261. #
  6262. ##########################################################################################
  6263. if INSTALLER:
  6264. ProgressOutput(100.0, "Building installer")
  6265. from makepackage import MakeInstaller
  6266. # When using the --installer flag, only install for the current version.
  6267. python_versions = []
  6268. if python_version_info:
  6269. python_versions.append(python_version_info)
  6270. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6271. optimize=GetOptimize(), compressor=COMPRESSOR,
  6272. debversion=DEBVERSION, rpmversion=RPMVERSION, rpmrelease=RPMRELEASE,
  6273. runtime=RUNTIME, python_versions=python_versions)
  6274. if WHEEL:
  6275. ProgressOutput(100.0, "Building wheel")
  6276. from makewheel import makewheel
  6277. makewheel(WHLVERSION, GetOutputDir())
  6278. ##########################################################################################
  6279. #
  6280. # Print final status report.
  6281. #
  6282. ##########################################################################################
  6283. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6284. printStatus("Makepanda Final Status Report", WARNINGS)
  6285. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())