makepanda.py 332 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446
  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:
  19. print("You are either using an incomplete or an old version of Python!")
  20. print("Please install the development package of Python 2.x and try again.")
  21. exit(1)
  22. from makepandacore import *
  23. from installpanda import *
  24. import time
  25. import os
  26. import sys
  27. ########################################################################
  28. ##
  29. ## PARSING THE COMMAND LINE OPTIONS
  30. ##
  31. ## You might be tempted to change the defaults by editing them
  32. ## here. Don't do it. Instead, create a script that compiles
  33. ## panda with your preferred options. Or, create
  34. ## a 'makepandaPreferences' file and put it into your python path.
  35. ##
  36. ########################################################################
  37. COMPILER=0
  38. INSTALLER=0
  39. WHEEL=0
  40. RUNTESTS=0
  41. GENMAN=0
  42. COMPRESSOR="zlib"
  43. THREADCOUNT=0
  44. CFLAGS=""
  45. CXXFLAGS=""
  46. LDFLAGS=""
  47. RTDIST=0
  48. RTDIST_VERSION=None
  49. RUNTIME=0
  50. DISTRIBUTOR=""
  51. VERSION=None
  52. DEBVERSION=None
  53. WHLVERSION=None
  54. RPMRELEASE="1"
  55. GIT_COMMIT=None
  56. P3DSUFFIX=None
  57. MAJOR_VERSION=None
  58. COREAPI_VERSION=None
  59. PLUGIN_VERSION=None
  60. OSXTARGET=None
  61. OSX_ARCHS=[]
  62. HOST_URL=None
  63. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  64. STRDXSDKVERSION = 'default'
  65. WINDOWS_SDK = None
  66. MSVC_VERSION = None
  67. BOOUSEINTELCOMPILER = False
  68. OPENCV_VER_23 = False
  69. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  70. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  71. PkgListSet(["PYTHON", "DIRECT", # Python support
  72. "GL", "VULKAN"] + DXVERSIONS + ["TINYDISPLAY", # 3D graphics
  73. "EGL", "GLES", "GLES2", # OpenGL (ES) integration
  74. "NVIDIACG", # Shaders
  75. "EIGEN", # Linear algebra acceleration
  76. "OPENAL", "FMODEX", # Audio playback
  77. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  78. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  79. "SPEEDTREE", # SpeedTree
  80. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  81. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  82. "FREETYPE", "HARFBUZZ", # Text rendering
  83. "VRPN", "OPENSSL", # Transport
  84. "FFTW", # Algorithm helpers
  85. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  86. "GTK2", # GTK2 is used for PStats on Unix
  87. "MFC", "WX", "FLTK", # Used for web plug-in only
  88. "ROCKET", "AWESOMIUM", # GUI libraries
  89. "CARBON", "COCOA", # Mac OS X toolkits
  90. "X11", # Unix platform support
  91. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  92. "SKEL", # Example SKEL project
  93. "PANDAFX", # Some distortion special lenses
  94. "PANDAPARTICLESYSTEM", # Built in particle system
  95. "CONTRIB", # Experimental
  96. "SSE2", "NEON", # Compiler features
  97. ])
  98. CheckPandaSourceTree()
  99. def keyboardInterruptHandler(x,y):
  100. exit("keyboard interrupt")
  101. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  102. ########################################################################
  103. ##
  104. ## Command-line parser.
  105. ##
  106. ## You can type "makepanda --help" to see all the options.
  107. ##
  108. ########################################################################
  109. def usage(problem):
  110. if (problem):
  111. print("")
  112. print("Error parsing command-line input: %s" % (problem))
  113. print("")
  114. print("Makepanda generates a 'built' subdirectory containing a")
  115. print("compiled copy of Panda3D. Command-line arguments are:")
  116. print("")
  117. print(" --help (print the help message you're reading now)")
  118. print(" --verbose (print out more information)")
  119. print(" --runtime (build a runtime build instead of an SDK build)")
  120. print(" --tests (run the test suite)")
  121. print(" --installer (build an installer)")
  122. print(" --wheel (build a pip-installable .whl)")
  123. print(" --optimize X (optimization level can be 1,2,3,4)")
  124. print(" --version X (set the panda version number)")
  125. print(" --lzma (use lzma compression when building Windows installer)")
  126. print(" --distributor X (short string identifying the distributor of the build)")
  127. print(" --outputdir X (use the specified directory instead of 'built')")
  128. print(" --host URL (set the host url (runtime build only))")
  129. print(" --threads N (use the multithreaded build system. see manual)")
  130. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  131. print(" --universal (build universal binaries (OS X only))")
  132. print(" --override \"O=V\" (override dtool_config/prc option value)")
  133. print(" --static (builds libraries for static linking)")
  134. print(" --target X (experimental cross-compilation (android only))")
  135. print(" --arch X (target architecture for cross-compilation)")
  136. print("")
  137. for pkg in PkgListGet():
  138. p = pkg.lower()
  139. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  140. if sys.platform != 'win32':
  141. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  142. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  143. print("")
  144. print(" --nothing (disable every third-party lib)")
  145. print(" --everything (enable every third-party lib)")
  146. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  147. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  148. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
  149. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  150. print("")
  151. print("The simplest way to compile panda is to just type:")
  152. print("")
  153. print(" makepanda --everything")
  154. print("")
  155. os._exit(1)
  156. def parseopts(args):
  157. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  158. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  159. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  160. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  161. longopts = [
  162. "help","distributor=","verbose","runtime","osxtarget=","tests",
  163. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  164. "version=","lzma","no-python","threads=","outputdir=","override=",
  165. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  166. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  167. "universal", "target=", "arch=", "git-commit=", "no-directscripts",
  168. "use-touchinput", "no-touchinput"]
  169. anything = 0
  170. optimize = ""
  171. target = None
  172. target_arch = None
  173. universal = False
  174. clean_build = False
  175. for pkg in PkgListGet():
  176. longopts.append("use-" + pkg.lower())
  177. longopts.append("no-" + pkg.lower())
  178. longopts.append(pkg.lower() + "-incdir=")
  179. longopts.append(pkg.lower() + "-libdir=")
  180. try:
  181. opts, extras = getopt.getopt(args, "", longopts)
  182. for option, value in opts:
  183. if (option=="--help"): raise Exception
  184. elif (option=="--optimize"): optimize=value
  185. elif (option=="--installer"): INSTALLER=1
  186. elif (option=="--tests"): RUNTESTS=1
  187. elif (option=="--wheel"): WHEEL=1
  188. elif (option=="--verbose"): SetVerbose(True)
  189. elif (option=="--distributor"): DISTRIBUTOR=value
  190. elif (option=="--rtdist"): RTDIST=1
  191. elif (option=="--runtime"): RUNTIME=1
  192. elif (option=="--genman"): GENMAN=1
  193. elif (option=="--everything"): PkgEnableAll()
  194. elif (option=="--nothing"): PkgDisableAll()
  195. elif (option=="--threads"): THREADCOUNT=int(value)
  196. elif (option=="--outputdir"): SetOutputDir(value.strip())
  197. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  198. elif (option=="--universal"): universal = True
  199. elif (option=="--target"): target = value.strip()
  200. elif (option=="--arch"): target_arch = value.strip()
  201. elif (option=="--nocolor"): DisableColors()
  202. elif (option=="--version"):
  203. match = re.match(r'^\d+\.\d+\.\d+', value)
  204. if not match:
  205. usage("version requires three digits")
  206. WHLVERSION = value
  207. VERSION = match.group()
  208. elif (option=="--lzma"): COMPRESSOR="lzma"
  209. elif (option=="--override"): AddOverride(value.strip())
  210. elif (option=="--static"): SetLinkAllStatic(True)
  211. elif (option=="--host"): HOST_URL=value
  212. elif (option=="--debversion"): DEBVERSION=value
  213. elif (option=="--rpmrelease"): RPMRELEASE=value
  214. elif (option=="--git-commit"): GIT_COMMIT=value
  215. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  216. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  217. # Backward compatibility, OPENGL was renamed to GL
  218. elif (option=="--use-opengl"): PkgEnable("GL")
  219. elif (option=="--no-opengl"): PkgDisable("GL")
  220. elif (option=="--no-directscripts"): pass
  221. elif (option=="--directx-sdk"):
  222. STRDXSDKVERSION = value.strip().lower()
  223. if STRDXSDKVERSION == '':
  224. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  225. STRDXSDKVERSION = 'default'
  226. elif (option=="--windows-sdk"):
  227. WINDOWS_SDK = value.strip().lower()
  228. elif (option=="--msvc-version"):
  229. MSVC_VERSION = value.strip().lower()
  230. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  231. elif (option=="--clean"): clean_build = True
  232. else:
  233. for pkg in PkgListGet():
  234. if option == "--use-" + pkg.lower():
  235. PkgEnable(pkg)
  236. break
  237. elif option == "--no-" + pkg.lower():
  238. PkgDisable(pkg)
  239. break
  240. elif option == "--" + pkg.lower() + "-incdir":
  241. PkgSetCustomLocation(pkg)
  242. IncDirectory(pkg, value)
  243. break
  244. elif option == "--" + pkg.lower() + "-libdir":
  245. PkgSetCustomLocation(pkg)
  246. LibDirectory(pkg, value)
  247. break
  248. if (option == "--everything" or option.startswith("--use-")
  249. or option == "--nothing" or option.startswith("--no-")):
  250. anything = 1
  251. except:
  252. usage(sys.exc_info()[1])
  253. if not anything:
  254. if RUNTIME:
  255. PkgEnableAll()
  256. else:
  257. usage("You should specify a list of packages to use or --everything to enable all packages.")
  258. if (RTDIST and RUNTIME):
  259. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  260. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  261. elif (optimize==""): optimize = "3"
  262. if OSXTARGET:
  263. try:
  264. maj, min = OSXTARGET.strip().split('.')
  265. OSXTARGET = int(maj), int(min)
  266. assert OSXTARGET[0] == 10
  267. except:
  268. usage("Invalid setting for OSXTARGET")
  269. else:
  270. OSXTARGET = None
  271. if target is not None or target_arch is not None:
  272. SetTarget(target, target_arch)
  273. if universal:
  274. if target_arch:
  275. exit("--universal is incompatible with --arch")
  276. OSX_ARCHS.append("i386")
  277. if OSXTARGET:
  278. osxver = OSXTARGET
  279. else:
  280. maj, min = platform.mac_ver()[0].split('.')[:2]
  281. osxver = int(maj), int(min)
  282. if osxver[1] < 6:
  283. OSX_ARCHS.append("ppc")
  284. else:
  285. OSX_ARCHS.append("x86_64")
  286. elif HasTargetArch():
  287. OSX_ARCHS.append(GetTargetArch())
  288. try:
  289. SetOptimize(int(optimize))
  290. assert GetOptimize() in [1, 2, 3, 4]
  291. except:
  292. usage("Invalid setting for OPTIMIZE")
  293. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  294. usage("Invalid SHA-1 hash given for --git-commit option!")
  295. if GetTarget() == 'windows':
  296. if not MSVC_VERSION:
  297. print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
  298. MSVC_VERSION = (10, 0)
  299. else:
  300. try:
  301. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  302. if (len(MSVC_VERSION) == 1):
  303. MSVC_VERSION += (0,)
  304. except:
  305. usage("Invalid setting for --msvc-version")
  306. if not WINDOWS_SDK:
  307. print("No Windows SDK version specified. Defaulting to '7.1'.")
  308. WINDOWS_SDK = '7.1'
  309. if clean_build and os.path.isdir(GetOutputDir()):
  310. print("Deleting %s" % (GetOutputDir()))
  311. shutil.rmtree(GetOutputDir())
  312. parseopts(sys.argv[1:])
  313. ########################################################################
  314. ##
  315. ## Handle environment variables.
  316. ##
  317. ########################################################################
  318. if ("CFLAGS" in os.environ):
  319. CFLAGS = os.environ["CFLAGS"].strip()
  320. if ("CXXFLAGS" in os.environ):
  321. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  322. if ("RPM_OPT_FLAGS" in os.environ):
  323. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  324. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  325. if ("LDFLAGS" in os.environ):
  326. LDFLAGS = os.environ["LDFLAGS"].strip()
  327. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  328. if GetHost() == "darwin" and OSXTARGET is not None:
  329. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  330. ########################################################################
  331. ##
  332. ## Configure things based on the command-line parameters.
  333. ##
  334. ########################################################################
  335. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  336. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  337. if VERSION is None:
  338. if RUNTIME:
  339. VERSION = PLUGIN_VERSION
  340. else:
  341. # Take the value from the setup.cfg file.
  342. VERSION = GetMetadataValue('version')
  343. if WHLVERSION is None:
  344. WHLVERSION = VERSION
  345. print("Version: %s" % VERSION)
  346. if RUNTIME or RTDIST:
  347. print("Core API Version: %s" % COREAPI_VERSION)
  348. if DEBVERSION is None:
  349. DEBVERSION = VERSION
  350. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  351. if P3DSUFFIX is None:
  352. P3DSUFFIX = MAJOR_VERSION
  353. outputdir_suffix = ""
  354. if (RUNTIME or RTDIST):
  355. # Compiling Maya/Max is pointless in rtdist build
  356. for ver in MAYAVERSIONS + MAXVERSIONS:
  357. PkgDisable(ver)
  358. if (DISTRIBUTOR.strip() == ""):
  359. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  360. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  361. if (RUNTIME):
  362. outputdir_suffix += "_rt"
  363. if DISTRIBUTOR == "":
  364. DISTRIBUTOR = "makepanda"
  365. elif not RTDIST_VERSION:
  366. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  367. if not RTDIST_VERSION:
  368. RTDIST_VERSION = "dev"
  369. if not IsCustomOutputDir():
  370. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  371. outputdir_suffix += '_x64'
  372. SetOutputDir("built" + outputdir_suffix)
  373. if (RUNTIME):
  374. for pkg in PkgListGet():
  375. if pkg in ["GTK2", "MFC"]:
  376. # Optional package(s) for runtime.
  377. pass
  378. elif pkg in ["OPENSSL", "ZLIB"]:
  379. # Required packages for runtime.
  380. if (PkgSkip(pkg)==1):
  381. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  382. else:
  383. # Unused packages for runtime.
  384. PkgDisable(pkg)
  385. if (INSTALLER and RTDIST):
  386. exit("Cannot build an installer for the rtdist build!")
  387. if (WHEEL and RUNTIME):
  388. exit("Cannot build a wheel for the runtime build!")
  389. if (WHEEL and RTDIST):
  390. exit("Cannot build a wheel for the rtdist build!")
  391. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  392. exit("Cannot build installer on Windows without python")
  393. if WHEEL and PkgSkip("PYTHON"):
  394. exit("Cannot build wheel without Python")
  395. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  396. exit("Cannot build rtdist without wx or fltk")
  397. if (RUNTIME):
  398. SetLinkAllStatic(True)
  399. if not os.path.isdir("contrib"):
  400. PkgDisable("CONTRIB")
  401. ########################################################################
  402. ##
  403. ## Load the dependency cache.
  404. ##
  405. ########################################################################
  406. LoadDependencyCache()
  407. ########################################################################
  408. ##
  409. ## Locate various SDKs.
  410. ##
  411. ########################################################################
  412. MakeBuildTree()
  413. SdkLocateDirectX(STRDXSDKVERSION)
  414. SdkLocateMaya()
  415. SdkLocateMax()
  416. SdkLocateMacOSX(OSXTARGET)
  417. SdkLocatePython(RTDIST)
  418. SdkLocateWindows(WINDOWS_SDK)
  419. SdkLocatePhysX()
  420. SdkLocateSpeedTree()
  421. SdkLocateAndroid()
  422. SdkLocateVulkan()
  423. SdkAutoDisableDirectX()
  424. SdkAutoDisableMaya()
  425. SdkAutoDisableMax()
  426. SdkAutoDisablePhysX()
  427. SdkAutoDisableSpeedTree()
  428. if RTDIST and DISTRIBUTOR == "cmu":
  429. # Some validation checks for the CMU builds.
  430. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  431. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  432. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  433. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  434. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  435. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  436. if RTDIST and not HOST_URL:
  437. exit("You must specify a host URL when building the rtdist!")
  438. if RUNTIME and not HOST_URL:
  439. # Set this to a nice default.
  440. HOST_URL = "https://runtime.panda3d.org/"
  441. ########################################################################
  442. ##
  443. ## Choose a Compiler.
  444. ##
  445. ## This should also set up any environment variables needed to make
  446. ## the compiler work.
  447. ##
  448. ########################################################################
  449. if GetHost() == 'windows' and GetTarget() == 'windows':
  450. COMPILER = "MSVC"
  451. SdkLocateVisualStudio(MSVC_VERSION)
  452. else:
  453. COMPILER = "GCC"
  454. SetupBuildEnvironment(COMPILER)
  455. ########################################################################
  456. ##
  457. ## External includes, external libraries, and external defsyms.
  458. ##
  459. ########################################################################
  460. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  461. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  462. if (COMPILER == "MSVC"):
  463. PkgDisable("X11")
  464. PkgDisable("GLES")
  465. PkgDisable("GLES2")
  466. PkgDisable("EGL")
  467. PkgDisable("CARBON")
  468. PkgDisable("COCOA")
  469. if (PkgSkip("PYTHON")==0):
  470. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  471. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  472. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  473. for pkg in PkgListGet():
  474. if (PkgSkip(pkg)==0):
  475. if (pkg[:4]=="MAYA"):
  476. IncDirectory(pkg, SDK[pkg] + "/include")
  477. DefSymbol(pkg, "MAYAVERSION", pkg)
  478. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  479. elif (pkg[:3]=="MAX"):
  480. IncDirectory(pkg, SDK[pkg] + "/include")
  481. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  482. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  483. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  484. DefSymbol(pkg, "MAX", pkg)
  485. if (int(pkg[3:]) >= 2013):
  486. DefSymbol(pkg, "UNICODE", "")
  487. DefSymbol(pkg, "_UNICODE", "")
  488. elif (pkg[:2]=="DX"):
  489. IncDirectory(pkg, SDK[pkg] + "/include")
  490. elif pkg == "VULKAN":
  491. IncDirectory(pkg, SDK[pkg] + "/Include")
  492. LibName(pkg, SDK[pkg] + "/Source/lib/vulkan-1.lib")
  493. elif GetThirdpartyDir() is not None:
  494. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  495. for pkg in DXVERSIONS:
  496. if (PkgSkip(pkg)==0):
  497. vnum=pkg[2:]
  498. if GetTargetArch() == 'x64':
  499. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  500. else:
  501. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  502. LibDirectory(pkg, SDK[pkg] + '/lib')
  503. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  504. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  505. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  506. LibName(pkg, 'dxerr.lib')
  507. else:
  508. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  509. #LibName(pkg, 'ddraw.lib')
  510. LibName(pkg, 'dxguid.lib')
  511. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  512. # dxerr needs this for __vsnwprintf definition.
  513. LibName(pkg, 'legacy_stdio_definitions.lib')
  514. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  515. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  516. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  517. LibName("WINSOCK", "wsock32.lib")
  518. LibName("WINSOCK2", "wsock32.lib")
  519. LibName("WINSOCK2", "ws2_32.lib")
  520. LibName("WINCOMCTL", "comctl32.lib")
  521. LibName("WINCOMDLG", "comdlg32.lib")
  522. LibName("WINUSER", "user32.lib")
  523. LibName("WINMM", "winmm.lib")
  524. LibName("WINIMM", "imm32.lib")
  525. LibName("WINKERNEL", "kernel32.lib")
  526. LibName("WINOLE", "ole32.lib")
  527. LibName("WINOLEAUT", "oleaut32.lib")
  528. LibName("WINOLDNAMES", "oldnames.lib")
  529. LibName("WINSHELL", "shell32.lib")
  530. LibName("WINGDI", "gdi32.lib")
  531. LibName("ADVAPI", "advapi32.lib")
  532. LibName("IPHLPAPI", "iphlpapi.lib")
  533. LibName("GL", "opengl32.lib")
  534. LibName("GLES", "libgles_cm.lib")
  535. LibName("GLES2", "libGLESv2.lib")
  536. LibName("EGL", "libEGL.lib")
  537. LibName("MSIMG", "msimg32.lib")
  538. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  539. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  540. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  541. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  542. if (PkgSkip("OPENSSL")==0):
  543. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  544. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  545. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  546. else:
  547. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  548. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  549. if (PkgSkip("PNG")==0):
  550. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  551. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  552. else:
  553. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  554. if (PkgSkip("TIFF")==0):
  555. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  556. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  557. else:
  558. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  559. if (PkgSkip("OPENEXR")==0):
  560. suffix = ""
  561. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  562. suffix = "-2_2"
  563. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  564. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  565. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  566. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  567. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  568. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  569. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  570. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  571. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  572. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  573. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  574. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  575. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  576. if (PkgSkip("HARFBUZZ")==0):
  577. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  578. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  579. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  580. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  581. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  582. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  583. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  584. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  585. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  586. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  587. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM",GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  588. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  589. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  590. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  591. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  592. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  593. if (PkgSkip("FCOLLADA")==0):
  594. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  595. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  596. if (PkgSkip("ASSIMP")==0):
  597. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  598. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include/assimp")
  599. if (PkgSkip("SQUISH")==0):
  600. if GetOptimize() <= 2:
  601. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  602. else:
  603. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  604. if (PkgSkip("ROCKET")==0):
  605. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  606. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  607. if (PkgSkip("PYTHON")==0):
  608. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  609. if (GetOptimize() <= 3):
  610. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  611. if (PkgSkip("OPENAL")==0):
  612. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  613. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  614. # Link OpenAL Soft statically.
  615. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  616. if (PkgSkip("ODE")==0):
  617. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  618. DefSymbol("ODE", "dSINGLE", "")
  619. if (PkgSkip("FMODEX")==0):
  620. if (GetTargetArch() == 'x64'):
  621. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  622. else:
  623. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  624. if (PkgSkip("FLTK")==0 and RTDIST):
  625. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  626. if not PkgSkip("FLTK"):
  627. # If we have fltk, we don't need wx
  628. PkgDisable("WX")
  629. if (PkgSkip("WX")==0 and RTDIST):
  630. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  631. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  632. DefSymbol("WX", "__WXMSW__", "")
  633. DefSymbol("WX", "_UNICODE", "")
  634. DefSymbol("WX", "UNICODE", "")
  635. if (PkgSkip("VORBIS")==0):
  636. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  637. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  638. if not os.path.isfile(path):
  639. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  640. LibName("VORBIS", path)
  641. if (PkgSkip("OPUS")==0):
  642. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libogg_static.lib")
  643. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopus_static.lib")
  644. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopusfile_static.lib")
  645. for pkg in MAYAVERSIONS:
  646. if (PkgSkip(pkg)==0):
  647. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  648. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  649. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  650. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  651. for pkg in MAXVERSIONS:
  652. if (PkgSkip(pkg)==0):
  653. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  654. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  655. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  656. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  657. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  658. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  659. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  660. if (PkgSkip("PHYSX")==0):
  661. if GetTargetArch() == 'x64':
  662. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  663. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  664. else:
  665. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  666. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  667. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  668. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  669. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  670. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  671. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  672. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  673. if (PkgSkip("SPEEDTREE")==0):
  674. if GetTargetArch() == 'x64':
  675. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  676. p64ext = '64'
  677. else:
  678. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  679. p64ext = ''
  680. debugext = ''
  681. if (GetOptimize() <= 2): debugext = "_d"
  682. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  683. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  684. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  685. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  686. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  687. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  688. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  689. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  690. LibName("SPEEDTREE", "glu32.lib")
  691. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  692. if (PkgSkip("BULLET")==0):
  693. suffix = '.lib'
  694. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  695. suffix = '_x64.lib'
  696. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  697. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  698. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  699. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  700. if (COMPILER=="GCC"):
  701. PkgDisable("AWESOMIUM")
  702. if GetTarget() != "darwin":
  703. PkgDisable("CARBON")
  704. PkgDisable("COCOA")
  705. elif RUNTIME:
  706. # We don't support Cocoa in the runtime yet.
  707. PkgDisable("COCOA")
  708. if 'x86_64' in OSX_ARCHS:
  709. # 64-bits OS X doesn't have Carbon.
  710. PkgDisable("CARBON")
  711. #if (PkgSkip("PYTHON")==0):
  712. # IncDirectory("PYTHON", SDK["PYTHON"])
  713. if (GetHost() == "darwin"):
  714. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  715. IncDirectory("FREETYPE", "/usr/X11/include")
  716. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  717. LibDirectory("FREETYPE", "/usr/X11/lib")
  718. if (GetHost() == "freebsd"):
  719. IncDirectory("ALWAYS", "/usr/local/include")
  720. LibDirectory("ALWAYS", "/usr/local/lib")
  721. if (os.path.isdir("/usr/PCBSD")):
  722. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  723. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  724. if GetTarget() != "windows":
  725. PkgDisable("DIRECTCAM")
  726. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  727. # WARNING! The order of the ffmpeg libraries matters!
  728. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  729. # Name pkg-config libs, include(dir)s
  730. if (not RUNTIME):
  731. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  732. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  733. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  734. SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp")
  735. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  736. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  737. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  738. SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
  739. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  740. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  741. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  742. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  743. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  744. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  745. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  746. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  747. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  748. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  749. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  750. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  751. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  752. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  753. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  754. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  755. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h"))
  756. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  757. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  758. SmartPkgEnable("VULKAN", "", ("vulkan"), "vulkan/vulkan.h")
  759. if not PkgSkip("FFMPEG"):
  760. if GetTarget() == "darwin":
  761. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  762. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  763. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  764. # Needed when linking ffmpeg statically on Linux.
  765. LibName("FFMPEG", "-Wl,-Bsymbolic")
  766. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  767. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  768. if cv_lib == "opencv_core":
  769. OPENCV_VER_23 = True
  770. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  771. else:
  772. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  773. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  774. else:
  775. PkgDisable("OPENCV")
  776. rocket_libs = ("RocketCore", "RocketControls")
  777. if (GetOptimize() <= 3):
  778. rocket_libs += ("RocketDebugger",)
  779. rocket_libs += ("boost_python",)
  780. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  781. if not PkgSkip("PYTHON"):
  782. python_lib = SDK["PYTHONVERSION"]
  783. if not RTDIST:
  784. # We don't link anything in the SDK with libpython.
  785. python_lib = ""
  786. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  787. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  788. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  789. SmartPkgEnable("GTK2", "gtk+-2.0")
  790. if (RTDIST):
  791. SmartPkgEnable("WX", tool = "wx-config")
  792. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  793. if GetTarget() != 'darwin':
  794. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  795. if not PkgSkip("NVIDIACG") and not RUNTIME:
  796. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  797. if not RUNTIME:
  798. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  799. if GetHost() != "darwin":
  800. # Workaround for an issue where pkg-config does not include this path
  801. if GetTargetArch() in ("x86_64", "amd64"):
  802. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  803. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  804. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  805. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  806. if not PkgSkip("X11"):
  807. if (os.path.isdir("/usr/X11R6/lib64")):
  808. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  809. else:
  810. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  811. elif not PkgSkip("X11"):
  812. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  813. if RUNTIME:
  814. # For the runtime, these packages are required
  815. for pkg in ["OPENSSL", "ZLIB"]:
  816. skips = []
  817. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  818. skips.append(pkg)
  819. if skips:
  820. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  821. for pkg in MAYAVERSIONS:
  822. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  823. if (GetHost() == "darwin"):
  824. # Sheesh, Autodesk really can't make up their mind
  825. # regarding the location of the Maya devkit on OS X.
  826. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  827. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  828. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  829. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  830. if (os.path.isdir(SDK[pkg] + "/lib")):
  831. LibDirectory(pkg, SDK[pkg] + "/lib")
  832. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  833. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  834. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  835. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  836. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  837. IncDirectory(pkg, SDK[pkg] + "/include")
  838. else:
  839. LibDirectory(pkg, SDK[pkg] + "/lib")
  840. IncDirectory(pkg, SDK[pkg] + "/include")
  841. DefSymbol(pkg, "MAYAVERSION", pkg)
  842. if GetTarget() == 'darwin':
  843. LibName("ALWAYS", "-framework AppKit")
  844. if (PkgSkip("OPENCV")==0):
  845. LibName("OPENCV", "-framework QuickTime")
  846. LibName("AGL", "-framework AGL")
  847. LibName("CARBON", "-framework Carbon")
  848. LibName("COCOA", "-framework Cocoa")
  849. # Fix for a bug in OSX Leopard:
  850. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  851. if GetTarget() == 'android':
  852. LibName("ALWAYS", '-llog')
  853. LibName("ALWAYS", '-landroid')
  854. LibName("JNIGRAPHICS", '-ljnigraphics')
  855. for pkg in MAYAVERSIONS:
  856. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  857. if GetTarget() == 'darwin':
  858. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  859. else:
  860. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  861. LibName(pkg, "-lOpenMaya")
  862. LibName(pkg, "-lOpenMayaAnim")
  863. LibName(pkg, "-lAnimSlice")
  864. LibName(pkg, "-lDeformSlice")
  865. LibName(pkg, "-lModifiers")
  866. LibName(pkg, "-lDynSlice")
  867. LibName(pkg, "-lKinSlice")
  868. LibName(pkg, "-lModelSlice")
  869. LibName(pkg, "-lNurbsSlice")
  870. LibName(pkg, "-lPolySlice")
  871. LibName(pkg, "-lProjectSlice")
  872. LibName(pkg, "-lImage")
  873. LibName(pkg, "-lShared")
  874. LibName(pkg, "-lTranslators")
  875. LibName(pkg, "-lDataModel")
  876. LibName(pkg, "-lRenderModel")
  877. LibName(pkg, "-lNurbsEngine")
  878. LibName(pkg, "-lDependEngine")
  879. LibName(pkg, "-lCommandEngine")
  880. LibName(pkg, "-lFoundation")
  881. LibName(pkg, "-lIMFbase")
  882. if GetTarget() != 'darwin':
  883. LibName(pkg, "-lOpenMayalib")
  884. else:
  885. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  886. if (PkgSkip("PHYSX")==0):
  887. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  888. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  889. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  890. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  891. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  892. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  893. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  894. if (GetHost() == "darwin"):
  895. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  896. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  897. else:
  898. LibName("PHYSX", "-lPhysXLoader")
  899. LibName("PHYSX", "-lNxCharacter")
  900. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  901. if GetLinkAllStatic():
  902. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  903. if GetTarget() == 'android':
  904. DefSymbol("ALWAYS", "ANDROID")
  905. if not PkgSkip("EIGEN"):
  906. if GetOptimize() >= 3:
  907. if COMPILER == "MSVC":
  908. # Squeeze out a bit more performance on MSVC builds...
  909. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  910. # will turn them into runtime assertions.
  911. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  912. ########################################################################
  913. ##
  914. ## Give a Status Report on Command-Line Options
  915. ##
  916. ########################################################################
  917. def printStatus(header,warnings):
  918. if GetVerbose():
  919. print("")
  920. print("-------------------------------------------------------------------")
  921. print(header)
  922. tkeep = ""
  923. tomit = ""
  924. for x in PkgListGet():
  925. if PkgSkip(x):
  926. tomit = tomit + x + " "
  927. else:
  928. tkeep = tkeep + x + " "
  929. if RTDIST:
  930. print("Makepanda: Runtime distribution build")
  931. elif RUNTIME:
  932. print("Makepanda: Runtime build")
  933. else:
  934. print("Makepanda: Regular build")
  935. print("Makepanda: Compiler: %s" % (COMPILER))
  936. print("Makepanda: Optimize: %d" % (GetOptimize()))
  937. print("Makepanda: Keep Pkg: %s" % (tkeep))
  938. print("Makepanda: Omit Pkg: %s" % (tomit))
  939. if GENMAN:
  940. print("Makepanda: Generate API reference manual")
  941. else:
  942. print("Makepanda: Don't generate API reference manual")
  943. if GetHost() == "windows" and not RTDIST:
  944. if INSTALLER:
  945. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  946. else:
  947. print("Makepanda: Don't build installer")
  948. print("Makepanda: Version ID: %s" % (VERSION))
  949. for x in warnings:
  950. print("Makepanda: %s" % (x))
  951. print("-------------------------------------------------------------------")
  952. print("")
  953. sys.stdout.flush()
  954. ########################################################################
  955. ##
  956. ## BracketNameWithQuotes
  957. ##
  958. ########################################################################
  959. def BracketNameWithQuotes(name):
  960. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  961. if (name.startswith("-framework")): return name
  962. if (name.startswith("-dylib_file")): return name
  963. # Don't add quotes when it's not necessary.
  964. if " " not in name: return name
  965. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  966. if (name.startswith('"') and name.endswith('"')): return name
  967. else: return '"' + name + '"'
  968. ########################################################################
  969. ##
  970. ## CompileCxx
  971. ##
  972. ########################################################################
  973. def CompileCxx(obj,src,opts):
  974. ipath = GetListOption(opts, "DIR:")
  975. optlevel = GetOptimizeOption(opts)
  976. if (COMPILER=="MSVC"):
  977. if not BOOUSEINTELCOMPILER:
  978. cmd = "cl "
  979. if GetTargetArch() == 'x64':
  980. cmd += "/favor:blend "
  981. cmd += "/wd4996 /wd4275 /wd4273 "
  982. # We still target Windows XP.
  983. cmd += "/DWINVER=0x501 "
  984. # Work around a WinXP/2003 bug when using VS 2015+.
  985. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  986. cmd += "/Zc:threadSafeInit- "
  987. cmd += "/Fo" + obj + " /nologo /c"
  988. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  989. cmd += " /arch:SSE2"
  990. for x in ipath: cmd += " /I" + x
  991. for (opt,dir) in INCDIRECTORIES:
  992. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  993. for (opt,var,val) in DEFSYMBOLS:
  994. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  995. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  996. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  997. if (optlevel==2): cmd += " /MDd /Zi"
  998. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  999. if (optlevel==4):
  1000. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1001. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1002. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1003. building = GetValueOption(opts, "BUILDING:")
  1004. if (building):
  1005. cmd += " /DBUILDING_" + building
  1006. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1007. cmd += " /bigobj"
  1008. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1009. if 'EXCEPTIONS' in opts:
  1010. cmd += " /EHsc"
  1011. else:
  1012. cmd += " /D_HAS_EXCEPTIONS=0"
  1013. if 'RTTI' not in opts:
  1014. cmd += " /GR-"
  1015. if GetTargetArch() == 'x64':
  1016. cmd += " /DWIN64_VC /DWIN64"
  1017. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1018. # To preserve Windows XP compatibility.
  1019. cmd += " /D_USING_V110_SDK71_"
  1020. cmd += " /W3 " + BracketNameWithQuotes(src)
  1021. oscmd(cmd)
  1022. else:
  1023. cmd = "icl "
  1024. if GetTargetArch() == 'x64':
  1025. cmd += "/favor:blend "
  1026. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1027. cmd += "/DWINVER=0x501 "
  1028. cmd += "/Fo" + obj + " /c"
  1029. for x in ipath: cmd += " /I" + x
  1030. for (opt,dir) in INCDIRECTORIES:
  1031. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1032. for (opt,var,val) in DEFSYMBOLS:
  1033. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1034. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1035. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1036. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1037. # core changes from jean-claude (dec 2011)
  1038. # ----------------------------------------
  1039. # performance will be seeked at level 3 & 4
  1040. # -----------------------------------------
  1041. if (optlevel==3):
  1042. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1043. cmd += " /Ob0"
  1044. cmd += " /Qipo-" # beware of IPO !!!
  1045. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1046. ## ----------------------------------------------------------------
  1047. if (optlevel==4):
  1048. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1049. cmd += " /Qipo" # optimization multi file
  1050. # for 3 & 4 optimization levels
  1051. # -----------------------------
  1052. if (optlevel>=3):
  1053. cmd += " /fp:fast=2"
  1054. cmd += " /Qftz"
  1055. cmd += " /Qfp-speculation:fast"
  1056. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1057. cmd += " /Qprec-div-"
  1058. cmd += " /Qsimd"
  1059. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1060. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1061. cmd += " /Qparallel" # enable parallelization
  1062. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1063. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1064. ## PCH files with a .pchi filename suffix and reduce build time.
  1065. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1066. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1067. cmd += " /Qpchi-" # keep it this way!
  1068. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1069. ## ------------------------------------
  1070. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1071. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1072. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1073. ## Ctor displacement /vd0 : Disable constructor displacement.
  1074. ## Choose this option only if no class constructors or destructors call virtual functions.
  1075. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1076. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1077. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1078. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1079. ## Alternate: #pragma pointers_to_members
  1080. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1081. building = GetValueOption(opts, "BUILDING:")
  1082. if (building): cmd += " /DBUILDING_" + building
  1083. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1084. cmd += " /bigobj"
  1085. # level of warnings and optimization reports
  1086. if GetVerbose():
  1087. cmd += " /W3 " # or /W4 or /Wall
  1088. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1089. else:
  1090. cmd += " /W1 "
  1091. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1092. if GetTargetArch() == 'x64':
  1093. cmd += " /DWIN64_VC /DWIN64"
  1094. cmd += " " + BracketNameWithQuotes(src)
  1095. oscmd(cmd)
  1096. if (COMPILER=="GCC"):
  1097. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1098. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1099. for (opt, dir) in INCDIRECTORIES:
  1100. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1101. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1102. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1103. for (opt,var,val) in DEFSYMBOLS:
  1104. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1105. for x in ipath: cmd += ' -I' + x
  1106. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1107. cmd += ' -fvisibility=hidden'
  1108. # Mac-specific flags.
  1109. if GetTarget() == "darwin":
  1110. cmd += " -Wno-deprecated-declarations"
  1111. if OSXTARGET is not None:
  1112. cmd += " -isysroot " + SDK["MACOSX"]
  1113. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1114. for arch in OSX_ARCHS:
  1115. if 'NOARCH:' + arch.upper() not in opts:
  1116. cmd += " -arch %s" % arch
  1117. if "SYSROOT" in SDK:
  1118. cmd += ' --sysroot=%s -no-canonical-prefixes' % (SDK["SYSROOT"])
  1119. # Android-specific flags.
  1120. arch = GetTargetArch()
  1121. if GetTarget() == "android":
  1122. # Most of the specific optimization flags here were
  1123. # just copied from the default Android Makefiles.
  1124. cmd += ' -I%s/include' % (SDK["ANDROID_STL"])
  1125. cmd += ' -I%s/libs/%s/include' % (SDK["ANDROID_STL"], SDK["ANDROID_ABI"])
  1126. cmd += ' -ffunction-sections -funwind-tables'
  1127. if arch == 'armv7a':
  1128. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1129. cmd += ' -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1130. elif arch == 'arm':
  1131. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1132. cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float'
  1133. elif arch == 'mips':
  1134. cmd += ' -finline-functions -fmessage-length=0'
  1135. cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
  1136. cmd += ' -frerun-cse-after-loop -frename-registers'
  1137. cmd += " -Wa,--noexecstack"
  1138. # Now add specific release/debug flags.
  1139. if optlevel >= 3:
  1140. cmd += " -fomit-frame-pointer"
  1141. if arch.startswith('arm'):
  1142. cmd += ' -finline-limit=64 -mthumb'
  1143. elif arch == 'mips':
  1144. cmd += ' -funswitch-loops -finline-limit=300'
  1145. else:
  1146. cmd += ' -fno-omit-frame-pointer'
  1147. if arch.startswith('arm'):
  1148. cmd += ' -marm'
  1149. # Enable SIMD instructions if requested
  1150. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1151. cmd += ' -mfpu=neon'
  1152. else:
  1153. cmd += " -pthread"
  1154. if not src.endswith(".c"):
  1155. # We don't use exceptions for most modules.
  1156. if 'EXCEPTIONS' in opts:
  1157. cmd += " -fexceptions"
  1158. else:
  1159. cmd += " -fno-exceptions"
  1160. if src.endswith(".mm"):
  1161. # Work around Apple compiler bug.
  1162. cmd += " -U__EXCEPTIONS"
  1163. if 'RTTI' not in opts:
  1164. # We always disable RTTI on Android for memory usage reasons.
  1165. if optlevel >= 4 or GetTarget() == "android":
  1166. cmd += " -fno-rtti"
  1167. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"):
  1168. cmd += " -msse2"
  1169. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1170. cmd += " -fno-strict-aliasing"
  1171. if optlevel >= 3:
  1172. cmd += " -ffast-math -fno-stack-protector"
  1173. if optlevel == 3:
  1174. # Fast math is nice, but we'd like to see NaN in dev builds.
  1175. cmd += " -fno-finite-math-only"
  1176. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1177. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1178. if (optlevel==3): cmd += " -O2"
  1179. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1180. if src.endswith(".c"):
  1181. cmd += ' ' + CFLAGS
  1182. else:
  1183. cmd += ' ' + CXXFLAGS
  1184. cmd = cmd.rstrip()
  1185. building = GetValueOption(opts, "BUILDING:")
  1186. if (building): cmd += " -DBUILDING_" + building
  1187. cmd += ' ' + BracketNameWithQuotes(src)
  1188. oscmd(cmd)
  1189. ########################################################################
  1190. ##
  1191. ## CompileBison
  1192. ##
  1193. ########################################################################
  1194. def CompileBison(wobj, wsrc, opts):
  1195. ifile = os.path.basename(wsrc)
  1196. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1197. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1198. pre = GetValueOption(opts, "BISONPREFIX_")
  1199. bison = GetBison()
  1200. if bison is None:
  1201. # We don't have bison. See if there is a prebuilt file.
  1202. base, ext = os.path.splitext(wsrc)
  1203. if os.path.isfile(base + '.h.prebuilt') and \
  1204. os.path.isfile(base + '.cxx.prebuilt'):
  1205. CopyFile(wdstc, base + '.cxx.prebuilt')
  1206. CopyFile(wdsth, base + '.h.prebuilt')
  1207. else:
  1208. exit('Could not find bison!')
  1209. else:
  1210. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1211. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1212. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1213. # Finally, compile the generated source file.
  1214. CompileCxx(wobj,wdstc,opts)
  1215. ########################################################################
  1216. ##
  1217. ## CompileFlex
  1218. ##
  1219. ########################################################################
  1220. def CompileFlex(wobj,wsrc,opts):
  1221. ifile = os.path.basename(wsrc)
  1222. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1223. pre = GetValueOption(opts, "BISONPREFIX_")
  1224. dashi = opts.count("FLEXDASHI")
  1225. flex = GetFlex()
  1226. if flex is None:
  1227. # We don't have flex. See if there is a prebuilt file.
  1228. base, ext = os.path.splitext(wsrc)
  1229. if os.path.isfile(base + '.cxx.prebuilt'):
  1230. CopyFile(wdst, base + '.cxx.prebuilt')
  1231. else:
  1232. exit('Could not find flex!')
  1233. else:
  1234. if (dashi):
  1235. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1236. else:
  1237. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1238. # Finally, compile the generated source file.
  1239. CompileCxx(wobj,wdst,opts)
  1240. ########################################################################
  1241. ##
  1242. ## CompileIgate
  1243. ##
  1244. ########################################################################
  1245. def CompileIgate(woutd,wsrc,opts):
  1246. outbase = os.path.basename(woutd)[:-3]
  1247. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1248. wobj = FindLocation(outbase + "_igate.obj", [])
  1249. srcdir = GetValueOption(opts, "SRCDIR:")
  1250. module = GetValueOption(opts, "IMOD:")
  1251. library = GetValueOption(opts, "ILIB:")
  1252. ipath = GetListOption(opts, "DIR:")
  1253. if (PkgSkip("PYTHON")):
  1254. WriteFile(woutc, "")
  1255. WriteFile(woutd, "")
  1256. ConditionalWriteFile(woutd, "")
  1257. return (wobj, woutc, opts)
  1258. if not CrossCompiling():
  1259. # If we're compiling for this platform, we can use the one we've built.
  1260. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1261. else:
  1262. # Assume that interrogate is on the PATH somewhere.
  1263. cmd = 'interrogate'
  1264. if GetVerbose():
  1265. cmd += ' -v'
  1266. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1267. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1268. if (COMPILER=="MSVC"):
  1269. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1270. if GetTargetArch() == 'x64':
  1271. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1272. else:
  1273. cmd += ' -D_M_IX86'
  1274. # NOTE: this 1600 value is the version number for VC2010.
  1275. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1276. if (COMPILER=="GCC"):
  1277. cmd += ' -D__attribute__\(x\)='
  1278. if GetTargetArch() in ("x86_64", "amd64"):
  1279. cmd += ' -D_LP64'
  1280. else:
  1281. cmd += ' -D__i386__'
  1282. if GetTarget() == 'darwin':
  1283. cmd += ' -D__APPLE__'
  1284. optlevel = GetOptimizeOption(opts)
  1285. if (optlevel==1): cmd += ' -D_DEBUG'
  1286. if (optlevel==2): cmd += ' -D_DEBUG'
  1287. if (optlevel==3): pass
  1288. if (optlevel==4): cmd += ' -DNDEBUG'
  1289. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1290. cmd += ' -fnames -string -refcount -assert -python-native'
  1291. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1292. # Add -I, -S and -D flags
  1293. for x in ipath:
  1294. cmd += ' -I' + BracketNameWithQuotes(x)
  1295. for (opt,dir) in INCDIRECTORIES:
  1296. if (opt=="ALWAYS") or (opt in opts):
  1297. cmd += ' -S' + BracketNameWithQuotes(dir)
  1298. for (opt,var,val) in DEFSYMBOLS:
  1299. if (opt=="ALWAYS") or (opt in opts):
  1300. cmd += ' -D' + var + '=' + val
  1301. #building = GetValueOption(opts, "BUILDING:")
  1302. #if (building): cmd += " -DBUILDING_"+building
  1303. cmd += ' -module ' + module + ' -library ' + library
  1304. for x in wsrc:
  1305. if (x.startswith("/")):
  1306. cmd += ' ' + BracketNameWithQuotes(x)
  1307. else:
  1308. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1309. oscmd(cmd)
  1310. return (wobj, woutc, opts)
  1311. ########################################################################
  1312. ##
  1313. ## CompileImod
  1314. ##
  1315. ########################################################################
  1316. def CompileImod(wobj, wsrc, opts):
  1317. module = GetValueOption(opts, "IMOD:")
  1318. library = GetValueOption(opts, "ILIB:")
  1319. if (COMPILER=="MSVC"):
  1320. woutc = wobj[:-4]+".cxx"
  1321. if (COMPILER=="GCC"):
  1322. woutc = wobj[:-2]+".cxx"
  1323. if (PkgSkip("PYTHON")):
  1324. WriteFile(woutc, "")
  1325. CompileCxx(wobj, woutc, opts)
  1326. return
  1327. if not CrossCompiling():
  1328. # If we're compiling for this platform, we can use the one we've built.
  1329. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1330. else:
  1331. # Assume that interrogate_module is on the PATH somewhere.
  1332. cmd = 'interrogate_module'
  1333. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1334. importmod = GetValueOption(opts, "IMPORT:")
  1335. if importmod:
  1336. cmd += ' -import ' + importmod
  1337. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1338. oscmd(cmd)
  1339. CompileCxx(wobj,woutc,opts)
  1340. return
  1341. ########################################################################
  1342. ##
  1343. ## CompileLib
  1344. ##
  1345. ########################################################################
  1346. def CompileLib(lib, obj, opts):
  1347. if (COMPILER=="MSVC"):
  1348. if not BOOUSEINTELCOMPILER:
  1349. #Use MSVC Linker
  1350. cmd = 'link /lib /nologo'
  1351. if GetOptimizeOption(opts) == 4:
  1352. cmd += " /LTCG"
  1353. if HasTargetArch():
  1354. cmd += " /MACHINE:" + GetTargetArch().upper()
  1355. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1356. for x in obj:
  1357. if not x.endswith('.lib'):
  1358. cmd += ' ' + BracketNameWithQuotes(x)
  1359. oscmd(cmd)
  1360. else:
  1361. # Choose Intel linker; from Jean-Claude
  1362. cmd = 'xilink /verbose:lib /lib '
  1363. if HasTargetArch():
  1364. cmd += " /MACHINE:" + GetTargetArch().upper()
  1365. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1366. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1367. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1368. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1369. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1370. oscmd(cmd)
  1371. if (COMPILER=="GCC"):
  1372. if GetTarget() == 'darwin':
  1373. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1374. else:
  1375. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1376. for x in obj:
  1377. cmd += ' ' + BracketNameWithQuotes(x)
  1378. oscmd(cmd)
  1379. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1380. ########################################################################
  1381. ##
  1382. ## CompileLink
  1383. ##
  1384. ########################################################################
  1385. def CompileLink(dll, obj, opts):
  1386. if (COMPILER=="MSVC"):
  1387. if not BOOUSEINTELCOMPILER:
  1388. cmd = "link /nologo "
  1389. if HasTargetArch():
  1390. cmd += " /MACHINE:" + GetTargetArch().upper()
  1391. if ("MFC" not in opts):
  1392. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1393. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1394. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1395. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1396. optlevel = GetOptimizeOption(opts)
  1397. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1398. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1399. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1400. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1401. if ("MFC" in opts):
  1402. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1403. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1404. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1405. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1406. if not PkgSkip("PYTHON"):
  1407. # If we're building without Python, don't pick it up implicitly.
  1408. if "PYTHON" not in opts:
  1409. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1410. if optlevel <= 2:
  1411. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1412. else:
  1413. cmd += ' /NOD:{}.lib'.format(pythonv)
  1414. # Yes, we know we are importing "locally defined symbols".
  1415. for x in obj:
  1416. if x.endswith('libp3pystub.lib'):
  1417. cmd += ' /ignore:4049,4217'
  1418. break
  1419. # Set the subsystem. Specify that we want to target Windows XP.
  1420. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1421. cmd += " /SUBSYSTEM:" + subsystem
  1422. if GetTargetArch() == 'x64':
  1423. cmd += ",5.02"
  1424. else:
  1425. cmd += ",5.01"
  1426. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1427. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1428. for (opt, dir) in LIBDIRECTORIES:
  1429. if (opt=="ALWAYS") or (opt in opts):
  1430. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1431. for x in obj:
  1432. if x.endswith(".dll") or x.endswith(".pyd"):
  1433. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1434. elif x.endswith(".lib"):
  1435. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1436. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1437. exit("Error: in makepanda, specify "+dname+", not "+x)
  1438. cmd += ' ' + BracketNameWithQuotes(x)
  1439. elif x.endswith(".def"):
  1440. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1441. elif x.endswith(".dat"):
  1442. pass
  1443. else:
  1444. cmd += ' ' + BracketNameWithQuotes(x)
  1445. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1446. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1447. for (opt, name) in LIBNAMES:
  1448. if (opt=="ALWAYS") or (opt in opts):
  1449. cmd += " " + BracketNameWithQuotes(name)
  1450. oscmd(cmd)
  1451. else:
  1452. cmd = "xilink"
  1453. if GetVerbose(): cmd += " /verbose:lib"
  1454. if HasTargetArch():
  1455. cmd += " /MACHINE:" + GetTargetArch().upper()
  1456. if ("MFC" not in opts):
  1457. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1458. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1459. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1460. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1461. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1462. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1463. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1464. optlevel = GetOptimizeOption(opts)
  1465. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1466. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1467. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1468. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1469. if ("MFC" in opts):
  1470. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1471. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1472. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1473. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1474. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1475. if subsystem:
  1476. cmd += " /SUBSYSTEM:" + subsystem
  1477. if dll.endswith(".dll"):
  1478. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1479. for (opt, dir) in LIBDIRECTORIES:
  1480. if (opt=="ALWAYS") or (opt in opts):
  1481. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1482. for x in obj:
  1483. if x.endswith(".dll") or x.endswith(".pyd"):
  1484. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1485. elif x.endswith(".lib"):
  1486. dname = os.path.splitext(dll)[0]+".dll"
  1487. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1488. exit("Error: in makepanda, specify "+dname+", not "+x)
  1489. cmd += ' ' + BracketNameWithQuotes(x)
  1490. elif x.endswith(".def"):
  1491. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1492. elif x.endswith(".dat"):
  1493. pass
  1494. else:
  1495. cmd += ' ' + BracketNameWithQuotes(x)
  1496. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1497. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1498. for (opt, name) in LIBNAMES:
  1499. if (opt=="ALWAYS") or (opt in opts):
  1500. cmd += " " + BracketNameWithQuotes(name)
  1501. oscmd(cmd)
  1502. if COMPILER == "GCC":
  1503. cxx = GetCXX()
  1504. if GetOrigExt(dll) == ".exe" and GetTarget() != 'android':
  1505. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1506. else:
  1507. if (GetTarget() == "darwin"):
  1508. cmd = cxx + ' -undefined dynamic_lookup'
  1509. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1510. cmd += ' -bundle '
  1511. else:
  1512. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1513. cmd += ' -dynamiclib -install_name ' + install_name
  1514. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1515. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1516. else:
  1517. cmd = cxx + ' -shared'
  1518. if "MODULE" not in opts or GetTarget() == 'android':
  1519. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1520. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1521. for x in obj:
  1522. if GetOrigExt(x) != ".dat":
  1523. cmd += ' ' + x
  1524. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1525. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1526. # Mac OS X specific flags.
  1527. if GetTarget() == 'darwin':
  1528. cmd += " -headerpad_max_install_names"
  1529. if OSXTARGET is not None:
  1530. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1531. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1532. for arch in OSX_ARCHS:
  1533. if 'NOARCH:' + arch.upper() not in opts:
  1534. cmd += " -arch %s" % arch
  1535. elif GetTarget() == 'android':
  1536. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1537. if GetTargetArch() == 'armv7a':
  1538. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1539. cmd += ' -lc -lm'
  1540. else:
  1541. cmd += " -pthread"
  1542. if "SYSROOT" in SDK:
  1543. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1544. if LDFLAGS != "":
  1545. cmd += " " + LDFLAGS
  1546. # Don't link libraries with Python.
  1547. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST:
  1548. opts = opts[:]
  1549. opts.remove("PYTHON")
  1550. for (opt, dir) in LIBDIRECTORIES:
  1551. if (opt=="ALWAYS") or (opt in opts):
  1552. cmd += ' -L' + BracketNameWithQuotes(dir)
  1553. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1554. if (opt=="ALWAYS") or (opt in opts):
  1555. cmd += ' -F' + BracketNameWithQuotes(dir)
  1556. for (opt, name) in LIBNAMES:
  1557. if (opt=="ALWAYS") or (opt in opts):
  1558. cmd += ' ' + BracketNameWithQuotes(name)
  1559. if GetTarget() != 'freebsd':
  1560. cmd += " -ldl"
  1561. oscmd(cmd)
  1562. if GetTarget() == 'android':
  1563. # Copy the library to built/libs/$ANDROID_ABI and strip it.
  1564. # This is the format that Android NDK projects should use.
  1565. new_path = '%s/libs/%s/%s' % (GetOutputDir(), SDK["ANDROID_ABI"], os.path.basename(dll))
  1566. CopyFile(new_path, dll)
  1567. oscmd('%s --strip-unneeded %s' % (GetStrip(), BracketNameWithQuotes(new_path)))
  1568. elif (GetOptimizeOption(opts)==4 and GetTarget() == 'linux'):
  1569. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1570. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1571. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1572. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1573. if os.path.isfile(newdll):
  1574. os.remove(newdll)
  1575. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1576. elif dll.endswith("." + MAJOR_VERSION):
  1577. newdll = dll[:-len(MAJOR_VERSION)-1]
  1578. if os.path.isfile(newdll):
  1579. os.remove(newdll)
  1580. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1581. ##########################################################################################
  1582. #
  1583. # CompileEgg
  1584. #
  1585. ##########################################################################################
  1586. def CompileEgg(eggfile, src, opts):
  1587. pz = False
  1588. if eggfile.endswith(".pz"):
  1589. pz = True
  1590. eggfile = eggfile[:-3]
  1591. # Determine the location of the pzip and flt2egg tools.
  1592. if CrossCompiling():
  1593. # We may not be able to use our generated versions of these tools,
  1594. # so we'll expect them to already be present in the PATH.
  1595. pzip = 'pzip'
  1596. flt2egg = 'flt2egg'
  1597. else:
  1598. # If we're compiling for this machine, we can use the binaries we've built.
  1599. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1600. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1601. if not os.path.isfile(pzip):
  1602. pzip = 'pzip'
  1603. if not os.path.isfile(flt2egg):
  1604. flt2egg = 'flt2egg'
  1605. if src.endswith(".egg"):
  1606. CopyFile(eggfile, src)
  1607. elif src.endswith(".flt"):
  1608. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1609. if pz:
  1610. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1611. ##########################################################################################
  1612. #
  1613. # CompileRes, CompileRsrc
  1614. #
  1615. ##########################################################################################
  1616. def CompileRes(target, src, opts):
  1617. """Compiles a Windows .rc file into a .res file."""
  1618. ipath = GetListOption(opts, "DIR:")
  1619. if (COMPILER == "MSVC"):
  1620. cmd = "rc"
  1621. cmd += " /Fo" + BracketNameWithQuotes(target)
  1622. for x in ipath: cmd += " /I" + x
  1623. for (opt,dir) in INCDIRECTORIES:
  1624. if (opt=="ALWAYS") or (opt in opts):
  1625. cmd += " /I" + BracketNameWithQuotes(dir)
  1626. for (opt,var,val) in DEFSYMBOLS:
  1627. if (opt=="ALWAYS") or (opt in opts):
  1628. cmd += " /D" + var + "=" + val
  1629. cmd += " " + BracketNameWithQuotes(src)
  1630. else:
  1631. cmd = "windres"
  1632. for x in ipath: cmd += " -I" + x
  1633. for (opt,dir) in INCDIRECTORIES:
  1634. if (opt=="ALWAYS") or (opt in opts):
  1635. cmd += " -I" + BracketNameWithQuotes(dir)
  1636. for (opt,var,val) in DEFSYMBOLS:
  1637. if (opt=="ALWAYS") or (opt in opts):
  1638. cmd += " -D" + var + "=" + val
  1639. cmd += " -i " + BracketNameWithQuotes(src)
  1640. cmd += " -o " + BracketNameWithQuotes(target)
  1641. oscmd(cmd)
  1642. def CompileRsrc(target, src, opts):
  1643. """Compiles a Mac OS .r file into an .rsrc file."""
  1644. ipath = GetListOption(opts, "DIR:")
  1645. if os.path.isfile("/usr/bin/Rez"):
  1646. cmd = "Rez -useDF"
  1647. else:
  1648. cmd = "/Developer/Tools/Rez -useDF"
  1649. cmd += " -o " + BracketNameWithQuotes(target)
  1650. for x in ipath:
  1651. cmd += " -i " + x
  1652. for (opt,dir) in INCDIRECTORIES:
  1653. if (opt=="ALWAYS") or (opt in opts):
  1654. cmd += " -i " + BracketNameWithQuotes(dir)
  1655. for (opt,var,val) in DEFSYMBOLS:
  1656. if (opt=="ALWAYS") or (opt in opts):
  1657. if (val == ""):
  1658. cmd += " -d " + var
  1659. else:
  1660. cmd += " -d " + var + " = " + val
  1661. cmd += " " + BracketNameWithQuotes(src)
  1662. oscmd(cmd)
  1663. ##########################################################################################
  1664. #
  1665. # FreezePy
  1666. #
  1667. ##########################################################################################
  1668. def FreezePy(target, inputs, opts):
  1669. assert len(inputs) > 0
  1670. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1671. if sys.version_info >= (2, 6):
  1672. cmdstr += "-B "
  1673. cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py")
  1674. if 'FREEZE_STARTUP' in opts:
  1675. cmdstr += " -s"
  1676. if GetOrigExt(target) == '.exe':
  1677. src = inputs.pop(0)
  1678. else:
  1679. src = ""
  1680. for i in inputs:
  1681. i = os.path.splitext(i)[0]
  1682. i = i.replace('/', '.')
  1683. if i.startswith('direct.src'):
  1684. i = i.replace('.src.', '.')
  1685. cmdstr += " -i " + i
  1686. cmdstr += " -o " + target + " " + src
  1687. if ("LINK_PYTHON_STATIC" in opts):
  1688. os.environ["LINK_PYTHON_STATIC"] = "1"
  1689. oscmd(cmdstr)
  1690. if ("LINK_PYTHON_STATIC" in os.environ):
  1691. del os.environ["LINK_PYTHON_STATIC"]
  1692. if (not os.path.exists(target)):
  1693. exit("FREEZER_ERROR")
  1694. ##########################################################################################
  1695. #
  1696. # Package
  1697. #
  1698. ##########################################################################################
  1699. def Package(target, inputs, opts):
  1700. assert len(inputs) == 1
  1701. # Invoke the ppackage script.
  1702. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1703. if GetOptimizeOption(opts) >= 4:
  1704. command += "-OO "
  1705. if sys.version_info >= (2, 6):
  1706. command += "-B "
  1707. command += "direct/src/p3d/ppackage.py"
  1708. if not RTDIST:
  1709. # Don't compile Python sources, because we might not running in the same
  1710. # Python version as the selected host.
  1711. command += " -N"
  1712. if GetTarget() == "darwin":
  1713. if SDK.get("MACOSX"):
  1714. command += " -R \"%s\"" % SDK["MACOSX"]
  1715. for arch in OSX_ARCHS:
  1716. if arch == "x86_64":
  1717. arch = "amd64"
  1718. command += " -P osx_%s" % arch
  1719. command += " -i \"" + GetOutputDir() + "/stage\""
  1720. if (P3DSUFFIX):
  1721. command += ' -a "' + P3DSUFFIX + '"'
  1722. command += " " + inputs[0]
  1723. if GetOrigExt(target) == '.p3d':
  1724. # Build a specific .p3d file.
  1725. basename = os.path.basename(os.path.splitext(target)[0])
  1726. command += " " + basename
  1727. oscmd(command)
  1728. if GetTarget() == 'windows':
  1729. # Make an .exe that calls this .p3d.
  1730. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1731. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1732. exefile = FindLocation(basename + '.exe', [])
  1733. CompileLink(exefile, [objfile], ['ADVAPI'])
  1734. # Move it to the bin directory.
  1735. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1736. if sys.platform != 'win32':
  1737. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1738. else:
  1739. # This is presumably a package or set of packages.
  1740. oscmd(command)
  1741. ##########################################################################################
  1742. #
  1743. # CompileBundle
  1744. #
  1745. ##########################################################################################
  1746. def CompileBundle(target, inputs, opts):
  1747. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1748. plist = None
  1749. resources = []
  1750. objects = []
  1751. for i in inputs:
  1752. if (i.endswith(".plist")):
  1753. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1754. plist = i
  1755. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1756. resources.append(i)
  1757. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1758. objects.append(i)
  1759. else:
  1760. exit("Don't know how to bundle file %s" % i)
  1761. # Now link the object files to form the bundle.
  1762. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1763. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1764. oscmd("rm -rf %s" % target)
  1765. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1766. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1767. if target.endswith(".app"):
  1768. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1769. else:
  1770. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1771. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1772. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1773. for r in resources:
  1774. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1775. ##########################################################################################
  1776. #
  1777. # CompileMIDL
  1778. #
  1779. ##########################################################################################
  1780. def CompileMIDL(target, src, opts):
  1781. ipath = GetListOption(opts, "DIR:")
  1782. if (COMPILER=="MSVC"):
  1783. cmd = "midl"
  1784. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1785. for x in ipath: cmd += " /I" + x
  1786. for (opt,dir) in INCDIRECTORIES:
  1787. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1788. for (opt,var,val) in DEFSYMBOLS:
  1789. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1790. cmd += " " + BracketNameWithQuotes(src)
  1791. oscmd(cmd)
  1792. ##########################################################################################
  1793. #
  1794. # CompileAnything
  1795. #
  1796. ##########################################################################################
  1797. def CompileAnything(target, inputs, opts, progress = None):
  1798. if (opts.count("DEPENDENCYONLY")):
  1799. return
  1800. if (len(inputs)==0):
  1801. exit("No input files for target "+target)
  1802. infile = inputs[0]
  1803. origsuffix = GetOrigExt(target)
  1804. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1805. # It must be a simple copy operation.
  1806. ProgressOutput(progress, "Copying file", target)
  1807. CopyFile(target, infile)
  1808. if (origsuffix==".exe" and GetHost() != "windows"):
  1809. os.system("chmod +x \"%s\"" % target)
  1810. return
  1811. elif (infile.endswith(".py")):
  1812. if origsuffix == ".obj":
  1813. source = os.path.splitext(target)[0] + ".c"
  1814. SetOrigExt(source, ".c")
  1815. ProgressOutput(progress, "Building frozen source", source)
  1816. FreezePy(source, inputs, opts)
  1817. ProgressOutput(progress, "Building C++ object", target)
  1818. return CompileCxx(target, source, opts)
  1819. if origsuffix == ".exe":
  1820. ProgressOutput(progress, "Building frozen executable", target)
  1821. else:
  1822. ProgressOutput(progress, "Building frozen library", target)
  1823. return FreezePy(target, inputs, opts)
  1824. elif (infile.endswith(".idl")):
  1825. ProgressOutput(progress, "Compiling MIDL file", infile)
  1826. return CompileMIDL(target, infile, opts)
  1827. elif (infile.endswith(".pdef")):
  1828. if origsuffix == '.p3d':
  1829. ProgressOutput(progress, "Building package", target)
  1830. else:
  1831. ProgressOutput(progress, "Building package from pdef file", infile)
  1832. return Package(target, inputs, opts)
  1833. elif origsuffix in SUFFIX_LIB:
  1834. ProgressOutput(progress, "Linking static library", target)
  1835. return CompileLib(target, inputs, opts)
  1836. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1837. if (origsuffix==".exe"):
  1838. ProgressOutput(progress, "Linking executable", target)
  1839. else:
  1840. ProgressOutput(progress, "Linking dynamic library", target)
  1841. # Add version number to the dynamic library, on unix
  1842. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  1843. tplatform = GetTarget()
  1844. if tplatform == "darwin":
  1845. # On Mac, libraries are named like libpanda.1.2.dylib
  1846. if target.lower().endswith(".dylib"):
  1847. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1848. SetOrigExt(target, origsuffix)
  1849. elif tplatform != "windows" and tplatform != "android":
  1850. # On Linux, libraries are named like libpanda.so.1.2
  1851. target += "." + MAJOR_VERSION
  1852. SetOrigExt(target, origsuffix)
  1853. return CompileLink(target, inputs, opts)
  1854. elif (origsuffix==".in"):
  1855. ProgressOutput(progress, "Building Interrogate database", target)
  1856. args = CompileIgate(target, inputs, opts)
  1857. ProgressOutput(progress, "Building C++ object", args[0])
  1858. return CompileCxx(*args)
  1859. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  1860. ProgressOutput(progress, "Building plugin bundle", target)
  1861. return CompileBundle(target, inputs, opts)
  1862. elif (origsuffix==".app"):
  1863. ProgressOutput(progress, "Building application bundle", target)
  1864. return CompileBundle(target, inputs, opts)
  1865. elif (origsuffix==".pz"):
  1866. ProgressOutput(progress, "Compressing", target)
  1867. return CompileEgg(target, infile, opts)
  1868. elif (origsuffix==".egg"):
  1869. ProgressOutput(progress, "Converting", target)
  1870. return CompileEgg(target, infile, opts)
  1871. elif (origsuffix==".res"):
  1872. ProgressOutput(progress, "Building resource object", target)
  1873. return CompileRes(target, infile, opts)
  1874. elif (origsuffix==".rsrc"):
  1875. ProgressOutput(progress, "Building resource object", target)
  1876. return CompileRsrc(target, infile, opts)
  1877. elif (origsuffix==".obj"):
  1878. if (infile.endswith(".cxx")):
  1879. ProgressOutput(progress, "Building C++ object", target)
  1880. return CompileCxx(target, infile, opts)
  1881. elif (infile.endswith(".c")):
  1882. ProgressOutput(progress, "Building C object", target)
  1883. return CompileCxx(target, infile, opts)
  1884. elif (infile.endswith(".mm")):
  1885. ProgressOutput(progress, "Building Objective-C++ object", target)
  1886. return CompileCxx(target, infile, opts)
  1887. elif (infile.endswith(".yxx")):
  1888. ProgressOutput(progress, "Building Bison object", target)
  1889. return CompileBison(target, infile, opts)
  1890. elif (infile.endswith(".lxx")):
  1891. ProgressOutput(progress, "Building Flex object", target)
  1892. return CompileFlex(target, infile, opts)
  1893. elif (infile.endswith(".in")):
  1894. ProgressOutput(progress, "Building Interrogate object", target)
  1895. return CompileImod(target, inputs, opts)
  1896. elif (infile.endswith(".rc")):
  1897. ProgressOutput(progress, "Building resource object", target)
  1898. return CompileRes(target, infile, opts)
  1899. elif (infile.endswith(".r")):
  1900. ProgressOutput(progress, "Building resource object", target)
  1901. return CompileRsrc(target, infile, opts)
  1902. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1903. ##########################################################################################
  1904. #
  1905. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1906. #
  1907. ##########################################################################################
  1908. DTOOL_CONFIG=[
  1909. #_Variable_________________________Windows___________________Unix__________
  1910. ("HAVE_PYTHON", '1', '1'),
  1911. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1912. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1913. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1914. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1915. ("HAVE_MAYA", '1', '1'),
  1916. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1917. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1918. ("USE_PANDAFILESTREAM", '1', '1'),
  1919. ("USE_DELETED_CHAIN", '1', '1'),
  1920. ("HAVE_GLX", 'UNDEF', '1'),
  1921. ("HAVE_WGL", '1', 'UNDEF'),
  1922. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1923. ("HAVE_THREADS", '1', '1'),
  1924. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1925. ("OS_SIMPLE_THREADS", '1', '1'),
  1926. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1927. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1928. ("HAVE_AUDIO", '1', '1'),
  1929. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1930. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1931. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  1932. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1933. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  1934. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  1935. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1936. ("DO_PIPELINING", '1', '1'),
  1937. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1938. ("DEFAULT_PATHSEP", '";"', '":"'),
  1939. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1940. ("HAVE_NAMESPACE", '1', '1'),
  1941. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1942. ("HAVE_LOCKF", '1', '1'),
  1943. ("HAVE_WCHAR_T", '1', '1'),
  1944. ("HAVE_WSTRING", '1', '1'),
  1945. ("HAVE_TYPENAME", '1', '1'),
  1946. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1947. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1948. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1949. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1950. ("HAVE_GETOPT", 'UNDEF', '1'),
  1951. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1952. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1953. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1954. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1955. ("HAVE_STREAMSIZE", '1', '1'),
  1956. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1957. ("HAVE_IOS_BINARY", '1', '1'),
  1958. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1959. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1960. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1961. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1962. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1963. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1964. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1965. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1966. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1967. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1968. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1969. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1970. ("PHAVE_IO_H", '1', 'UNDEF'),
  1971. ("PHAVE_IOSTREAM", '1', '1'),
  1972. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1973. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1974. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1975. ("PHAVE_MALLOC_H", '1', '1'),
  1976. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1977. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1978. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1979. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1980. ("PHAVE_SSTREAM", '1', '1'),
  1981. ("PHAVE_NEW", '1', '1'),
  1982. ("PHAVE_SYS_TYPES_H", '1', '1'),
  1983. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  1984. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  1985. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  1986. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  1987. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  1988. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  1989. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  1990. ("PHAVE_STDINT_H", '1', '1'),
  1991. ("HAVE_RTTI", '1', '1'),
  1992. ("HAVE_X11", 'UNDEF', '1'),
  1993. ("IS_LINUX", 'UNDEF', '1'),
  1994. ("IS_OSX", 'UNDEF', 'UNDEF'),
  1995. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  1996. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  1997. ("LINMATH_ALIGN", '1', '1'),
  1998. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  1999. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2000. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2001. ("PHAVE_JPEGINT_H", '1', '1'),
  2002. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2003. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2004. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2005. ("HAVE_SGI_RGB", '1', '1'),
  2006. ("HAVE_TGA", '1', '1'),
  2007. ("HAVE_IMG", '1', '1'),
  2008. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2009. ("HAVE_BMP", '1', '1'),
  2010. ("HAVE_PNM", '1', '1'),
  2011. ("HAVE_STB_IMAGE", '1', '1'),
  2012. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2013. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2014. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2015. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2016. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2017. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2018. ("WANT_NATIVE_NET", '1', '1'),
  2019. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2020. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2021. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2022. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2023. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2024. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2025. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2026. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2027. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2028. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2029. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2030. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2031. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2032. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2033. # ("_SECURE_SCL", '0', 'UNDEF'),
  2034. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2035. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2036. ]
  2037. PRC_PARAMETERS=[
  2038. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2039. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2040. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2041. ("PRC_PATH2_ENVVARS", '""', '""'),
  2042. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2043. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2044. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2045. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2046. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2047. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2048. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2049. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2050. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2051. ]
  2052. def WriteConfigSettings():
  2053. dtool_config={}
  2054. prc_parameters={}
  2055. speedtree_parameters={}
  2056. plugin_config={}
  2057. if (GetTarget() == 'windows'):
  2058. for key,win,unix in DTOOL_CONFIG:
  2059. dtool_config[key] = win
  2060. for key,win,unix in PRC_PARAMETERS:
  2061. prc_parameters[key] = win
  2062. else:
  2063. for key,win,unix in DTOOL_CONFIG:
  2064. dtool_config[key] = unix
  2065. for key,win,unix in PRC_PARAMETERS:
  2066. prc_parameters[key] = unix
  2067. for x in PkgListGet():
  2068. if ("HAVE_"+x in dtool_config):
  2069. if (PkgSkip(x)==0):
  2070. dtool_config["HAVE_"+x] = '1'
  2071. else:
  2072. dtool_config["HAVE_"+x] = 'UNDEF'
  2073. dtool_config["HAVE_NET"] = '1'
  2074. if (PkgSkip("NVIDIACG")==0):
  2075. dtool_config["HAVE_CG"] = '1'
  2076. dtool_config["HAVE_CGGL"] = '1'
  2077. dtool_config["HAVE_CGDX9"] = '1'
  2078. if (GetTarget() != "linux"):
  2079. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2080. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2081. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2082. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2083. if (GetTarget() == "darwin"):
  2084. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2085. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2086. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2087. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2088. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2089. dtool_config["HAVE_GLX"] = 'UNDEF'
  2090. dtool_config["IS_LINUX"] = 'UNDEF'
  2091. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2092. dtool_config["IS_OSX"] = '1'
  2093. # 10.4 had a broken ucontext implementation
  2094. if int(platform.mac_ver()[0][3]) <= 4:
  2095. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2096. if (GetTarget() == "freebsd"):
  2097. dtool_config["IS_LINUX"] = 'UNDEF'
  2098. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2099. dtool_config["IS_FREEBSD"] = '1'
  2100. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2101. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2102. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2103. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2104. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2105. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2106. if (GetTarget() == "android"):
  2107. # Android does have RTTI, but we disable it anyway.
  2108. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2109. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2110. dtool_config["HAVE_LOCKF"] = 'UNDEF'
  2111. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2112. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2113. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2114. # This should probably be more sophisticated, such as based
  2115. # on whether the libRocket Python modules are available.
  2116. if (PkgSkip("PYTHON") != 0):
  2117. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2118. if (GetOptimize() <= 3):
  2119. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2120. if (GetOptimize() <= 3):
  2121. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2122. dtool_config["DO_PSTATS"] = '1'
  2123. if (GetOptimize() <= 3):
  2124. dtool_config["DO_DCAST"] = '1'
  2125. if (GetOptimize() <= 3):
  2126. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2127. if (GetOptimize() <= 3):
  2128. dtool_config["DO_MEMORY_USAGE"] = '1'
  2129. if (GetOptimize() <= 3):
  2130. dtool_config["NOTIFY_DEBUG"] = '1'
  2131. if (GetOptimize() >= 4):
  2132. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2133. if (GetOptimize() >= 4):
  2134. # Disable RTTI on release builds.
  2135. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2136. # Now that we have OS_SIMPLE_THREADS, we can support
  2137. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2138. # longer need to disable it for this platform.
  2139. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2140. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2141. if (RTDIST or RUNTIME):
  2142. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2143. if HOST_URL:
  2144. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2145. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2146. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2147. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2148. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2149. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2150. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2151. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2152. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2153. if PkgSkip("GTK2") == 0:
  2154. plugin_config["HAVE_GTK"] = '1'
  2155. if (RUNTIME):
  2156. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2157. # Whether it's present on the system doesn't matter here,
  2158. # as the runtime itself doesn't include or link with X11.
  2159. if (RUNTIME and GetTarget() == 'linux'):
  2160. dtool_config["HAVE_X11"] = '1'
  2161. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2162. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2163. else:
  2164. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2165. if (PkgSkip("SPEEDTREE")==0):
  2166. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2167. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2168. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2169. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2170. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2171. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2172. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2173. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2174. for key in sorted(prc_parameters.keys()):
  2175. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2176. val = OverrideValue(key, prc_parameters[key])
  2177. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2178. else: conf = conf + "#define " + key + " " + val + "\n"
  2179. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2180. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2181. for key in sorted(dtool_config.keys()):
  2182. val = OverrideValue(key, dtool_config[key])
  2183. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2184. else: conf = conf + "#define " + key + " " + val + "\n"
  2185. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2186. if (RTDIST or RUNTIME):
  2187. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2188. for key in sorted(plugin_config.keys()):
  2189. val = plugin_config[key]
  2190. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2191. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2192. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2193. if (PkgSkip("SPEEDTREE")==0):
  2194. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2195. for key in sorted(speedtree_parameters.keys()):
  2196. val = OverrideValue(key, speedtree_parameters[key])
  2197. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2198. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2199. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2200. for x in PkgListGet():
  2201. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2202. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2203. WriteConfigSettings()
  2204. WarnConflictingFiles()
  2205. if SystemLibraryExists("dtoolbase"):
  2206. print("%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor()))
  2207. if SystemLibraryExists("p3dtoolconfig"):
  2208. print("%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor()))
  2209. ##########################################################################################
  2210. #
  2211. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2212. #
  2213. ##########################################################################################
  2214. PANDAVERSION_H="""
  2215. #define PANDA_MAJOR_VERSION $VERSION1
  2216. #define PANDA_MINOR_VERSION $VERSION2
  2217. #define PANDA_SEQUENCE_VERSION $VERSION3
  2218. #define PANDA_VERSION $NVERSION
  2219. #define PANDA_NUMERIC_VERSION $NVERSION
  2220. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2221. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2222. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2223. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2224. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2225. """
  2226. PANDAVERSION_H_RUNTIME="""
  2227. #define PANDA_MAJOR_VERSION 0
  2228. #define PANDA_MINOR_VERSION 0
  2229. #define PANDA_SEQUENCE_VERSION 0
  2230. #define PANDA_VERSION_STR "0.0.0"
  2231. #define PANDA_ABI_VERSION_STR "0.0"
  2232. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2233. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2234. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2235. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2236. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2237. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2238. #define PANDA_PACKAGE_VERSION_STR ""
  2239. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2240. """
  2241. CHECKPANDAVERSION_CXX="""
  2242. # include "dtoolbase.h"
  2243. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  2244. """
  2245. CHECKPANDAVERSION_H="""
  2246. # include "dtoolbase.h"
  2247. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  2248. # ifndef WIN32
  2249. /* For Windows, exporting the symbol from the DLL is sufficient; the
  2250. DLL will not load unless all expected public symbols are defined.
  2251. Other systems may not mind if the symbol is absent unless we
  2252. explictly write code that references it. */
  2253. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  2254. # endif
  2255. """
  2256. P3DACTIVEX_RC="""#include "resource.h"
  2257. #define APSTUDIO_READONLY_SYMBOLS
  2258. #include "afxres.h"
  2259. #undef APSTUDIO_READONLY_SYMBOLS
  2260. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2261. #ifdef _WIN32
  2262. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2263. #pragma code_page(1252)
  2264. #endif
  2265. #ifdef APSTUDIO_INVOKED
  2266. 1 TEXTINCLUDE
  2267. BEGIN
  2268. "resource.h\\0"
  2269. END
  2270. 2 TEXTINCLUDE
  2271. BEGIN
  2272. "#include ""afxres.h""\\r\\n"
  2273. "\\0"
  2274. END
  2275. 3 TEXTINCLUDE
  2276. BEGIN
  2277. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2278. "\\0"
  2279. END
  2280. #endif
  2281. %s
  2282. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2283. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2284. STYLE DS_SETFONT | WS_CHILD
  2285. FONT 8, "MS Sans Serif"
  2286. BEGIN
  2287. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2288. IDC_STATIC,7,25,229,16
  2289. END
  2290. #ifdef APSTUDIO_INVOKED
  2291. GUIDELINES DESIGNINFO
  2292. BEGIN
  2293. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2294. BEGIN
  2295. LEFTMARGIN, 7
  2296. RIGHTMARGIN, 243
  2297. TOPMARGIN, 7
  2298. BOTTOMMARGIN, 55
  2299. END
  2300. END
  2301. #endif
  2302. STRINGTABLE
  2303. BEGIN
  2304. IDS_P3DACTIVEX "P3DActiveX Control"
  2305. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2306. END
  2307. STRINGTABLE
  2308. BEGIN
  2309. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2310. END
  2311. #endif
  2312. #ifndef APSTUDIO_INVOKED
  2313. 1 TYPELIB "P3DActiveX.tlb"
  2314. #endif"""
  2315. def CreatePandaVersionFiles():
  2316. version1=int(VERSION.split(".")[0])
  2317. version2=int(VERSION.split(".")[1])
  2318. version3=int(VERSION.split(".")[2])
  2319. nversion=version1*1000000+version2*1000+version3
  2320. if (DISTRIBUTOR != "cmu"):
  2321. # Subtract 1 if we are not an official version.
  2322. nversion -= 1
  2323. if (RUNTIME):
  2324. pandaversion_h = PANDAVERSION_H_RUNTIME
  2325. else:
  2326. pandaversion_h = PANDAVERSION_H
  2327. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2328. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2329. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2330. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2331. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2332. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2333. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2334. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2335. if (DISTRIBUTOR == "cmu"):
  2336. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2337. else:
  2338. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2339. if GIT_COMMIT:
  2340. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2341. if not RUNTIME:
  2342. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2343. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2344. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2345. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2346. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2347. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2348. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2349. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2350. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2351. if RUNTIME:
  2352. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2353. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2354. else:
  2355. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2356. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2357. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2358. if RUNTIME:
  2359. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2360. "version" : VERSION,
  2361. "description" : "Runs 3-D games and interactive applets",
  2362. "filename" : "p3dactivex.ocx",
  2363. "mimetype" : "application/x-panda3d",
  2364. "extension" : "p3d",
  2365. "filedesc" : "Panda3D applet"}
  2366. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2367. CreatePandaVersionFiles()
  2368. ##########################################################################################
  2369. #
  2370. # Copy the "direct" tree
  2371. #
  2372. ##########################################################################################
  2373. if (PkgSkip("DIRECT")==0):
  2374. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2375. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2376. # This file used to be copied, but would nowadays cause conflicts.
  2377. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2378. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2379. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2380. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2381. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2382. # This directory doesn't exist at all any more.
  2383. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2384. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2385. # These files used to exist; remove them to avoid conflicts.
  2386. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2387. '_core.pyd', '_core.so',
  2388. 'direct.py', 'direct.pyc', 'direct.pyo',
  2389. '_direct.pyd', '_direct.so',
  2390. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2391. for basename in del_files:
  2392. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2393. if os.path.isfile(path):
  2394. print("Removing %s" % (path))
  2395. os.remove(path)
  2396. # Write an appropriate panda3d/__init__.py
  2397. p3d_init = """"Python bindings for the Panda3D libraries"
  2398. __version__ = '%s'
  2399. """ % (WHLVERSION)
  2400. if GetTarget() == 'windows':
  2401. p3d_init += """
  2402. import os
  2403. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2404. if os.path.isdir(bindir):
  2405. if not os.environ.get('PATH'):
  2406. os.environ['PATH'] = bindir
  2407. else:
  2408. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2409. del os, bindir
  2410. """
  2411. if not PkgSkip("PYTHON"):
  2412. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2413. # Also add this file, for backward compatibility.
  2414. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2415. if __debug__:
  2416. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2417. from .interrogatedb import *
  2418. """)
  2419. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2420. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2421. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2422. os.remove(fn)
  2423. panda_modules = ['core']
  2424. if not PkgSkip("PANDAPHYSICS"):
  2425. panda_modules.append('physics')
  2426. if not PkgSkip('PANDAFX'):
  2427. panda_modules.append('fx')
  2428. if not PkgSkip("DIRECT"):
  2429. panda_modules.append('direct')
  2430. if not PkgSkip("VISION"):
  2431. panda_modules.append('vision')
  2432. if not PkgSkip("SKEL"):
  2433. panda_modules.append('skel')
  2434. if not PkgSkip("EGG"):
  2435. panda_modules.append('egg')
  2436. if not PkgSkip("AWESOMIUM"):
  2437. panda_modules.append('awesomium')
  2438. if not PkgSkip("ODE"):
  2439. panda_modules.append('ode')
  2440. if not PkgSkip("VRPN"):
  2441. panda_modules.append('vrpn')
  2442. panda_modules_code = """
  2443. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2444. if __debug__:
  2445. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2446. """
  2447. for module in panda_modules:
  2448. panda_modules_code += """
  2449. try:
  2450. from panda3d.%s import *
  2451. except ImportError as err:
  2452. if "No module named %s" not in str(err):
  2453. raise""" % (module, module)
  2454. exthelpers_code = """
  2455. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2456. from direct.extensions_native.extension_native_helpers import *
  2457. """
  2458. if not PkgSkip("PYTHON"):
  2459. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2460. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2461. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2462. ##########################################################################################
  2463. #
  2464. # Generate the PRC files into the ETC directory.
  2465. #
  2466. ##########################################################################################
  2467. confautoprc = ReadFile("makepanda/confauto.in")
  2468. if (PkgSkip("SPEEDTREE")==0):
  2469. # If SpeedTree is available, enable it in the config file
  2470. confautoprc = confautoprc.replace('#st#', '')
  2471. else:
  2472. # otherwise, disable it.
  2473. confautoprc = confautoprc.replace('#st#', '#')
  2474. if (os.path.isfile("makepanda/myconfig.in")):
  2475. configprc = ReadFile("makepanda/myconfig.in")
  2476. else:
  2477. configprc = ReadFile("makepanda/config.in")
  2478. if (GetTarget() == 'windows'):
  2479. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2480. else:
  2481. configprc = configprc.replace("aux-display pandadx9", "")
  2482. if (GetTarget() == 'darwin'):
  2483. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2484. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2485. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2486. if GetTarget() == 'windows':
  2487. # Convert to Windows newlines.
  2488. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2489. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2490. else:
  2491. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2492. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2493. ##########################################################################################
  2494. #
  2495. # Copy the precompiled binaries and DLLs into the build.
  2496. #
  2497. ##########################################################################################
  2498. tp_dir = GetThirdpartyDir()
  2499. if tp_dir is not None:
  2500. dylibs = {}
  2501. if GetTarget() == 'darwin':
  2502. # Make a list of all the dylibs we ship, to figure out whether we should use
  2503. # install_name_tool to correct the library reference to point to our copy.
  2504. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2505. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2506. if not PkgSkip("PYTHON"):
  2507. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2508. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2509. for pkg in PkgListGet():
  2510. if PkgSkip(pkg):
  2511. continue
  2512. tp_pkg = tp_dir + pkg.lower()
  2513. if GetTarget() == 'windows':
  2514. if os.path.exists(tp_pkg + "/bin"):
  2515. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2516. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2517. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2518. elif GetTarget() == 'darwin':
  2519. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2520. if not PkgSkip("PYTHON"):
  2521. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2522. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2523. if pkg != 'PYTHON':
  2524. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2525. for tp_lib in tp_libs:
  2526. basename = os.path.basename(tp_lib)
  2527. if basename.endswith('.dylib'):
  2528. # It's a dynamic link library. Put it in the lib directory.
  2529. target = GetOutputDir() + "/lib/" + basename
  2530. dep_prefix = "@loader_path/../lib/"
  2531. lib_id = dep_prefix + basename
  2532. else:
  2533. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2534. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2535. target = GetOutputDir() + "/" + basename
  2536. dep_prefix = "@loader_path/lib/"
  2537. lib_id = basename
  2538. if not NeedsBuild([target], [tp_lib]):
  2539. continue
  2540. CopyFile(target, tp_lib)
  2541. if os.path.islink(target) or target.endswith('.py'):
  2542. continue
  2543. # Correct the inter-library dependencies so that the build is relocatable.
  2544. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2545. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2546. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2547. line = line.strip()
  2548. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2549. continue
  2550. libdep = line.split(" ", 1)[0]
  2551. dep_basename = os.path.basename(libdep)
  2552. if dep_basename in dylibs:
  2553. dep_target = dylibs[dep_basename]
  2554. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2555. JustBuilt([target], [tp_lib])
  2556. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2557. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2558. else: # Linux / FreeBSD case.
  2559. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2560. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2561. if not PkgSkip("PYTHON"):
  2562. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2563. base = os.path.basename(tp_lib)
  2564. if base.startswith('lib'):
  2565. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2566. else:
  2567. # It's a Python module, like _rocketcore.so.
  2568. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2569. if GetTarget() == 'windows':
  2570. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2571. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2572. if not PkgSkip("PYTHON") and not RTDIST:
  2573. # We need to copy the Python DLL to the bin directory for now.
  2574. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2575. if GetOptimize() <= 2:
  2576. pydll += "_d.dll"
  2577. else:
  2578. pydll += ".dll"
  2579. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2580. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2581. CopyFile(GetOutputDir() + "/bin/", fn)
  2582. # Copy the whole Python directory.
  2583. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2584. # NB: Python does not always ship with the correct manifest/dll.
  2585. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2586. manifest = GetOutputDir() + '/tmp/python.manifest'
  2587. if os.path.isfile(manifest):
  2588. os.unlink(manifest)
  2589. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2590. if os.path.isfile(manifest):
  2591. import xml.etree.ElementTree as ET
  2592. tree = ET.parse(manifest)
  2593. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2594. else:
  2595. idents = ()
  2596. for ident in idents:
  2597. sxs_name = '_'.join([
  2598. ident.get('processorArchitecture'),
  2599. ident.get('name').lower(),
  2600. ident.get('publicKeyToken'),
  2601. ident.get('version'),
  2602. ])
  2603. # Find the manifest matching these parameters.
  2604. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2605. manifests = glob.glob(pattern)
  2606. if not manifests:
  2607. print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern))
  2608. continue
  2609. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2610. # Also copy the corresponding msvcr dll.
  2611. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2612. for file in glob.glob(pattern):
  2613. CopyFile(GetOutputDir() + "/python/", file)
  2614. # Copy python.exe to ppython.exe.
  2615. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2616. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2617. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2618. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2619. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2620. # Copy over the MSVC runtime.
  2621. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2622. vsver = "%s%s" % SDK["VISUALSTUDIO_VERSION"]
  2623. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2624. crtname = "Microsoft.VC%s.CRT" % (vsver)
  2625. if ("VCTOOLSVERSION" in SDK):
  2626. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  2627. else:
  2628. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2629. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2630. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2631. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2632. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2633. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2634. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2635. ########################################################################
  2636. ##
  2637. ## Copy various stuff into the build.
  2638. ##
  2639. ########################################################################
  2640. if GetTarget() == 'windows':
  2641. # Convert to Windows newlines so they can be opened by notepad.
  2642. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2643. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2644. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2645. else:
  2646. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2647. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2648. if (PkgSkip("PANDATOOL")==0):
  2649. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2650. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2651. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2652. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2653. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2654. # Since Eigen is included by all sorts of core headers, as a convenience
  2655. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2656. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2657. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2658. ########################################################################
  2659. #
  2660. # Copy header files to the built/include/parser-inc directory.
  2661. #
  2662. ########################################################################
  2663. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2664. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2665. ########################################################################
  2666. #
  2667. # Transfer all header files to the built/include directory.
  2668. #
  2669. ########################################################################
  2670. CopyAllHeaders('dtool/src/dtoolbase')
  2671. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2672. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2673. CopyAllHeaders('dtool/metalibs/dtool')
  2674. CopyAllHeaders('dtool/src/cppparser')
  2675. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2676. CopyAllHeaders('dtool/src/dconfig')
  2677. CopyAllHeaders('dtool/src/interrogatedb')
  2678. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2679. CopyAllHeaders('dtool/src/pystub')
  2680. CopyAllHeaders('dtool/src/interrogate')
  2681. CopyAllHeaders('dtool/src/test_interrogate')
  2682. CopyAllHeaders('panda/src/putil')
  2683. CopyAllHeaders('panda/src/pandabase')
  2684. CopyAllHeaders('panda/src/express')
  2685. CopyAllHeaders('panda/src/downloader')
  2686. CopyAllHeaders('panda/metalibs/pandaexpress')
  2687. CopyAllHeaders('panda/src/pipeline')
  2688. CopyAllHeaders('panda/src/linmath')
  2689. CopyAllHeaders('panda/src/putil')
  2690. CopyAllHeaders('dtool/src/prckeys')
  2691. CopyAllHeaders('panda/src/audio')
  2692. CopyAllHeaders('panda/src/event')
  2693. CopyAllHeaders('panda/src/mathutil')
  2694. CopyAllHeaders('panda/src/gsgbase')
  2695. CopyAllHeaders('panda/src/pnmimage')
  2696. CopyAllHeaders('panda/src/nativenet')
  2697. CopyAllHeaders('panda/src/net')
  2698. CopyAllHeaders('panda/src/pstatclient')
  2699. CopyAllHeaders('panda/src/gobj')
  2700. CopyAllHeaders('panda/src/movies')
  2701. CopyAllHeaders('panda/src/pgraphnodes')
  2702. CopyAllHeaders('panda/src/pgraph')
  2703. CopyAllHeaders('panda/src/cull')
  2704. CopyAllHeaders('panda/src/chan')
  2705. CopyAllHeaders('panda/src/char')
  2706. CopyAllHeaders('panda/src/dgraph')
  2707. CopyAllHeaders('panda/src/display')
  2708. CopyAllHeaders('panda/src/device')
  2709. CopyAllHeaders('panda/src/pnmtext')
  2710. CopyAllHeaders('panda/src/text')
  2711. CopyAllHeaders('panda/src/grutil')
  2712. if (PkgSkip("VISION")==0):
  2713. CopyAllHeaders('panda/src/vision')
  2714. CopyAllHeaders('panda/src/awesomium')
  2715. if (PkgSkip("FFMPEG")==0):
  2716. CopyAllHeaders('panda/src/ffmpeg')
  2717. CopyAllHeaders('panda/src/tform')
  2718. CopyAllHeaders('panda/src/collide')
  2719. CopyAllHeaders('panda/src/parametrics')
  2720. CopyAllHeaders('panda/src/pgui')
  2721. CopyAllHeaders('panda/src/pnmimagetypes')
  2722. CopyAllHeaders('panda/src/recorder')
  2723. if (PkgSkip("ROCKET")==0):
  2724. CopyAllHeaders('panda/src/rocket')
  2725. if (PkgSkip("VRPN")==0):
  2726. CopyAllHeaders('panda/src/vrpn')
  2727. CopyAllHeaders('panda/src/wgldisplay')
  2728. CopyAllHeaders('panda/src/ode')
  2729. CopyAllHeaders('panda/metalibs/pandaode')
  2730. if (PkgSkip("PANDAPHYSICS")==0):
  2731. CopyAllHeaders('panda/src/physics')
  2732. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2733. CopyAllHeaders('panda/src/particlesystem')
  2734. CopyAllHeaders('panda/src/dxml')
  2735. CopyAllHeaders('panda/metalibs/panda')
  2736. CopyAllHeaders('panda/src/audiotraits')
  2737. CopyAllHeaders('panda/src/audiotraits')
  2738. CopyAllHeaders('panda/src/distort')
  2739. CopyAllHeaders('panda/src/downloadertools')
  2740. CopyAllHeaders('panda/src/windisplay')
  2741. CopyAllHeaders('panda/src/dxgsg9')
  2742. CopyAllHeaders('panda/metalibs/pandadx9')
  2743. if not PkgSkip("EGG"):
  2744. CopyAllHeaders('panda/src/egg')
  2745. CopyAllHeaders('panda/src/egg2pg')
  2746. CopyAllHeaders('panda/src/framework')
  2747. CopyAllHeaders('panda/metalibs/pandafx')
  2748. CopyAllHeaders('panda/src/glstuff')
  2749. CopyAllHeaders('panda/src/glgsg')
  2750. CopyAllHeaders('panda/src/glesgsg')
  2751. CopyAllHeaders('panda/src/gles2gsg')
  2752. if not PkgSkip("EGG"):
  2753. CopyAllHeaders('panda/metalibs/pandaegg')
  2754. if GetTarget() == 'windows':
  2755. CopyAllHeaders('panda/src/wgldisplay')
  2756. elif GetTarget() == 'darwin':
  2757. CopyAllHeaders('panda/src/osxdisplay')
  2758. CopyAllHeaders('panda/src/cocoadisplay')
  2759. elif GetTarget() == 'android':
  2760. CopyAllHeaders('panda/src/android')
  2761. CopyAllHeaders('panda/src/androiddisplay')
  2762. else:
  2763. CopyAllHeaders('panda/src/x11display')
  2764. CopyAllHeaders('panda/src/glxdisplay')
  2765. CopyAllHeaders('panda/src/egldisplay')
  2766. CopyAllHeaders('panda/src/vulkandisplay')
  2767. CopyAllHeaders('panda/metalibs/pandagl')
  2768. CopyAllHeaders('panda/metalibs/pandagles')
  2769. CopyAllHeaders('panda/metalibs/pandagles2')
  2770. CopyAllHeaders('panda/metalibs/pandaphysics')
  2771. CopyAllHeaders('panda/src/testbed')
  2772. if (PkgSkip("PHYSX")==0):
  2773. CopyAllHeaders('panda/src/physx')
  2774. CopyAllHeaders('panda/metalibs/pandaphysx')
  2775. if (PkgSkip("BULLET")==0):
  2776. CopyAllHeaders('panda/src/bullet')
  2777. CopyAllHeaders('panda/metalibs/pandabullet')
  2778. if (PkgSkip("SPEEDTREE")==0):
  2779. CopyAllHeaders('panda/src/speedtree')
  2780. if (PkgSkip("DIRECT")==0):
  2781. CopyAllHeaders('direct/src/directbase')
  2782. CopyAllHeaders('direct/src/dcparser')
  2783. CopyAllHeaders('direct/src/deadrec')
  2784. CopyAllHeaders('direct/src/distributed')
  2785. CopyAllHeaders('direct/src/interval')
  2786. CopyAllHeaders('direct/src/showbase')
  2787. CopyAllHeaders('direct/src/dcparse')
  2788. if (RUNTIME or RTDIST):
  2789. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2790. if (RUNTIME):
  2791. CopyAllHeaders('direct/src/plugin_npapi')
  2792. CopyAllHeaders('direct/src/plugin_standalone')
  2793. if (PkgSkip("PANDATOOL")==0):
  2794. CopyAllHeaders('pandatool/src/pandatoolbase')
  2795. CopyAllHeaders('pandatool/src/converter')
  2796. CopyAllHeaders('pandatool/src/progbase')
  2797. CopyAllHeaders('pandatool/src/eggbase')
  2798. CopyAllHeaders('pandatool/src/bam')
  2799. CopyAllHeaders('pandatool/src/cvscopy')
  2800. CopyAllHeaders('pandatool/src/daeegg')
  2801. CopyAllHeaders('pandatool/src/daeprogs')
  2802. CopyAllHeaders('pandatool/src/dxf')
  2803. CopyAllHeaders('pandatool/src/dxfegg')
  2804. CopyAllHeaders('pandatool/src/dxfprogs')
  2805. CopyAllHeaders('pandatool/src/palettizer')
  2806. CopyAllHeaders('pandatool/src/egg-mkfont')
  2807. CopyAllHeaders('pandatool/src/eggcharbase')
  2808. CopyAllHeaders('pandatool/src/egg-optchar')
  2809. CopyAllHeaders('pandatool/src/egg-palettize')
  2810. CopyAllHeaders('pandatool/src/egg-qtess')
  2811. CopyAllHeaders('pandatool/src/eggprogs')
  2812. CopyAllHeaders('pandatool/src/flt')
  2813. CopyAllHeaders('pandatool/src/fltegg')
  2814. CopyAllHeaders('pandatool/src/fltprogs')
  2815. CopyAllHeaders('pandatool/src/imagebase')
  2816. CopyAllHeaders('pandatool/src/imageprogs')
  2817. CopyAllHeaders('pandatool/src/pfmprogs')
  2818. CopyAllHeaders('pandatool/src/lwo')
  2819. CopyAllHeaders('pandatool/src/lwoegg')
  2820. CopyAllHeaders('pandatool/src/lwoprogs')
  2821. CopyAllHeaders('pandatool/src/maya')
  2822. CopyAllHeaders('pandatool/src/mayaegg')
  2823. CopyAllHeaders('pandatool/src/maxegg')
  2824. CopyAllHeaders('pandatool/src/maxprogs')
  2825. CopyAllHeaders('pandatool/src/objegg')
  2826. CopyAllHeaders('pandatool/src/objprogs')
  2827. CopyAllHeaders('pandatool/src/vrml')
  2828. CopyAllHeaders('pandatool/src/vrmlegg')
  2829. CopyAllHeaders('pandatool/src/xfile')
  2830. CopyAllHeaders('pandatool/src/xfileegg')
  2831. CopyAllHeaders('pandatool/src/ptloader')
  2832. CopyAllHeaders('pandatool/src/miscprogs')
  2833. CopyAllHeaders('pandatool/src/pstatserver')
  2834. CopyAllHeaders('pandatool/src/softprogs')
  2835. CopyAllHeaders('pandatool/src/text-stats')
  2836. CopyAllHeaders('pandatool/src/vrmlprogs')
  2837. CopyAllHeaders('pandatool/src/win-stats')
  2838. CopyAllHeaders('pandatool/src/xfileprogs')
  2839. if (PkgSkip("CONTRIB")==0):
  2840. CopyAllHeaders('contrib/src/contribbase')
  2841. CopyAllHeaders('contrib/src/ai')
  2842. ########################################################################
  2843. #
  2844. # Copy Java files, if applicable
  2845. #
  2846. ########################################################################
  2847. if GetTarget() == 'android':
  2848. CopyAllJavaSources('panda/src/android')
  2849. ########################################################################
  2850. #
  2851. # These definitions are syntactic shorthand. They make it easy
  2852. # to link with the usual libraries without listing them all.
  2853. #
  2854. ########################################################################
  2855. COMMON_DTOOL_LIBS=[
  2856. 'libp3dtool.dll',
  2857. 'libp3dtoolconfig.dll',
  2858. ]
  2859. COMMON_PANDA_LIBS=[
  2860. 'libpanda.dll',
  2861. 'libpandaexpress.dll'
  2862. ] + COMMON_DTOOL_LIBS
  2863. COMMON_EGG2X_LIBS=[
  2864. 'libp3eggbase.lib',
  2865. 'libp3progbase.lib',
  2866. 'libp3converter.lib',
  2867. 'libp3pandatoolbase.lib',
  2868. 'libpandaegg.dll',
  2869. ] + COMMON_PANDA_LIBS
  2870. ########################################################################
  2871. #
  2872. # This section contains a list of all the files that need to be compiled.
  2873. #
  2874. ########################################################################
  2875. print("Generating dependencies...")
  2876. sys.stdout.flush()
  2877. #
  2878. # Compile Panda icon resource file.
  2879. # We do it first because we need it at
  2880. # the time we compile an executable.
  2881. #
  2882. if GetTarget() == 'windows':
  2883. OPTS=['DIR:panda/src/configfiles']
  2884. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2885. #
  2886. # DIRECTORY: dtool/src/dtoolbase/
  2887. #
  2888. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2889. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2890. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2891. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2892. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2893. #
  2894. # DIRECTORY: dtool/src/dtoolutil/
  2895. #
  2896. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2897. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2898. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2899. if GetTarget() == 'darwin':
  2900. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2901. #
  2902. # DIRECTORY: dtool/metalibs/dtool/
  2903. #
  2904. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2905. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2906. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2907. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2908. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2909. if GetTarget() == 'darwin':
  2910. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2911. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2912. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2913. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2914. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2915. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2916. #
  2917. # DIRECTORY: dtool/src/cppparser/
  2918. #
  2919. if (not RUNTIME):
  2920. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2921. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2922. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2923. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2924. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2925. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2926. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2927. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2928. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2929. #
  2930. # DIRECTORY: dtool/src/prc/
  2931. #
  2932. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2933. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2934. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2935. #
  2936. # DIRECTORY: dtool/src/dconfig/
  2937. #
  2938. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2939. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2940. #
  2941. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2942. #
  2943. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2944. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2945. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2946. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2947. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2948. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2949. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2950. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  2951. #
  2952. # DIRECTORY: dtool/src/interrogatedb/
  2953. #
  2954. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON']
  2955. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2956. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2957. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  2958. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  2959. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  2960. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  2961. TargetAdd('libp3interrogatedb.dll', opts=['PYTHON'])
  2962. if not PkgSkip("PYTHON"):
  2963. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  2964. # stuff, so it has been renamed appropriately.
  2965. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON']
  2966. TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2967. TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  2968. TargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  2969. TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  2970. TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  2971. TargetAdd('interrogatedb.pyd', opts=['PYTHON'])
  2972. #
  2973. # DIRECTORY: dtool/src/pystub/
  2974. #
  2975. if not RUNTIME and not RTDIST:
  2976. OPTS=['DIR:dtool/src/pystub']
  2977. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2978. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  2979. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  2980. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  2981. #
  2982. # DIRECTORY: dtool/src/interrogate/
  2983. #
  2984. if (not RUNTIME):
  2985. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2986. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2987. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2988. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  2989. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  2990. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  2991. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  2992. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  2993. TargetAdd('interrogate.exe', input='libp3pystub.lib')
  2994. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2995. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  2996. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  2997. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  2998. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  2999. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3000. TargetAdd('interrogate_module.exe', input='libp3pystub.lib')
  3001. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3002. if (not RTDIST):
  3003. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3004. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3005. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3006. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3007. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3008. TargetAdd('parse_file.exe', input='libp3pystub.lib')
  3009. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3010. #
  3011. # DIRECTORY: dtool/src/prckeys/
  3012. #
  3013. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3014. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3015. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3016. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3017. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3018. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3019. #
  3020. # DIRECTORY: dtool/src/test_interrogate/
  3021. #
  3022. if (not RTDIST and not RUNTIME):
  3023. OPTS=['DIR:dtool/src/test_interrogate']
  3024. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3025. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3026. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3027. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3028. TargetAdd('test_interrogate.exe', input='libp3pystub.lib')
  3029. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3030. #
  3031. # DIRECTORY: dtool/src/dtoolbase/
  3032. #
  3033. OPTS=['DIR:dtool/src/dtoolbase', 'PYTHON']
  3034. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3035. IGATEFILES += [
  3036. "typeHandle.h",
  3037. "typeHandle_ext.h",
  3038. "typeRegistry.h",
  3039. "typedObject.h",
  3040. "neverFreeMemory.h",
  3041. ]
  3042. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3043. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3044. TargetAdd('libp3dtoolbase_igate.obj', input='libp3dtoolbase.in', opts=["DEPENDENCYONLY"])
  3045. TargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3046. #
  3047. # DIRECTORY: dtool/src/dtoolutil/
  3048. #
  3049. OPTS=['DIR:dtool/src/dtoolutil', 'PYTHON']
  3050. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3051. IGATEFILES += [
  3052. "config_dtoolutil.h",
  3053. "pandaSystem.h",
  3054. "dSearchPath.h",
  3055. "executionEnvironment.h",
  3056. "textEncoder.h",
  3057. "filename.h",
  3058. "filename_ext.h",
  3059. "globPattern.h",
  3060. "globPattern_ext.h",
  3061. "pandaFileStream.h",
  3062. "lineStream.h",
  3063. ]
  3064. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3065. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3066. TargetAdd('libp3dtoolutil_igate.obj', input='libp3dtoolutil.in', opts=["DEPENDENCYONLY"])
  3067. TargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3068. #
  3069. # DIRECTORY: dtool/src/prc/
  3070. #
  3071. OPTS=['DIR:dtool/src/prc', 'PYTHON']
  3072. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3073. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3074. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3075. TargetAdd('libp3prc_igate.obj', input='libp3prc.in', opts=["DEPENDENCYONLY"])
  3076. TargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3077. #
  3078. # DIRECTORY: panda/src/pandabase/
  3079. #
  3080. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3081. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3082. #
  3083. # DIRECTORY: panda/src/express/
  3084. #
  3085. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3086. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3087. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3088. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON']
  3089. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3090. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3091. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3092. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  3093. TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3094. #
  3095. # DIRECTORY: panda/src/downloader/
  3096. #
  3097. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3098. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3099. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3100. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON']
  3101. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3102. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3103. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3104. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  3105. TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3106. #
  3107. # DIRECTORY: panda/metalibs/pandaexpress/
  3108. #
  3109. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3110. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3111. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3112. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3113. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3114. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3115. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3116. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3117. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3118. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER'])
  3119. #
  3120. # DIRECTORY: panda/src/pipeline/
  3121. #
  3122. if (not RUNTIME):
  3123. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3124. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3125. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3126. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3127. OPTS=['DIR:panda/src/pipeline', 'PYTHON']
  3128. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3129. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3130. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3131. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  3132. TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3133. #
  3134. # DIRECTORY: panda/src/linmath/
  3135. #
  3136. if (not RUNTIME):
  3137. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3138. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3139. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3140. OPTS=['DIR:panda/src/linmath', 'PYTHON']
  3141. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3142. for ifile in IGATEFILES[:]:
  3143. if "_src." in ifile:
  3144. IGATEFILES.remove(ifile)
  3145. IGATEFILES.remove('cast_to_double.h')
  3146. IGATEFILES.remove('lmat_ops.h')
  3147. IGATEFILES.remove('cast_to_float.h')
  3148. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3149. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3150. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  3151. #
  3152. # DIRECTORY: panda/src/putil/
  3153. #
  3154. if (not RUNTIME):
  3155. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3156. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3157. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3158. OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON']
  3159. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3160. IGATEFILES.remove("test_bam.h")
  3161. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3162. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3163. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  3164. TargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3165. #
  3166. # DIRECTORY: panda/src/audio/
  3167. #
  3168. if (not RUNTIME):
  3169. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3170. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3171. OPTS=['DIR:panda/src/audio', 'PYTHON']
  3172. IGATEFILES=["audio.h"]
  3173. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3174. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3175. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  3176. #
  3177. # DIRECTORY: panda/src/event/
  3178. #
  3179. if (not RUNTIME):
  3180. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3181. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3182. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3183. OPTS=['DIR:panda/src/event', 'PYTHON']
  3184. TargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3185. TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3186. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3187. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3188. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3189. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  3190. #
  3191. # DIRECTORY: panda/src/mathutil/
  3192. #
  3193. if (not RUNTIME):
  3194. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3195. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3196. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3197. OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON']
  3198. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3199. for ifile in IGATEFILES[:]:
  3200. if "_src." in ifile:
  3201. IGATEFILES.remove(ifile)
  3202. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3203. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3204. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  3205. #
  3206. # DIRECTORY: panda/src/gsgbase/
  3207. #
  3208. if (not RUNTIME):
  3209. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3210. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3211. OPTS=['DIR:panda/src/gsgbase', 'PYTHON']
  3212. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3213. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3214. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3215. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  3216. #
  3217. # DIRECTORY: panda/src/pnmimage/
  3218. #
  3219. if (not RUNTIME):
  3220. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3221. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3222. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3223. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3224. OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON']
  3225. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3226. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3227. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3228. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  3229. TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3230. #
  3231. # DIRECTORY: panda/src/nativenet/
  3232. #
  3233. if (not RUNTIME):
  3234. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3235. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3236. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON']
  3237. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3238. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3239. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3240. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  3241. #
  3242. # DIRECTORY: panda/src/net/
  3243. #
  3244. if (not RUNTIME):
  3245. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3246. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3247. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3248. OPTS=['DIR:panda/src/net', 'PYTHON']
  3249. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3250. IGATEFILES.remove("datagram_ui.h")
  3251. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3252. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3253. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  3254. #
  3255. # DIRECTORY: panda/src/pstatclient/
  3256. #
  3257. if (not RUNTIME):
  3258. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3259. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3260. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3261. OPTS=['DIR:panda/src/pstatclient', 'PYTHON']
  3262. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3263. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3264. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3265. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  3266. #
  3267. # DIRECTORY: panda/src/gobj/
  3268. #
  3269. if (not RUNTIME):
  3270. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH', 'VULKAN']
  3271. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3272. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  3273. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON']
  3274. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3275. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3276. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3277. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3278. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  3279. TargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3280. #
  3281. # DIRECTORY: panda/src/pgraphnodes/
  3282. #
  3283. if (not RUNTIME):
  3284. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3285. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3286. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3287. OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON']
  3288. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3289. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3290. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3291. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  3292. #
  3293. # DIRECTORY: panda/src/pgraph/
  3294. #
  3295. if (not RUNTIME):
  3296. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3297. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3298. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3299. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3300. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3301. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3302. OPTS=['DIR:panda/src/pgraph', 'PYTHON']
  3303. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3304. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3305. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3306. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  3307. TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3308. #
  3309. # DIRECTORY: panda/src/cull/
  3310. #
  3311. if (not RUNTIME):
  3312. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3313. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3314. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3315. OPTS=['DIR:panda/src/cull', 'PYTHON']
  3316. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3317. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3318. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3319. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  3320. #
  3321. # DIRECTORY: panda/src/chan/
  3322. #
  3323. if (not RUNTIME):
  3324. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3325. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3326. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3327. OPTS=['DIR:panda/src/chan', 'PYTHON']
  3328. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3329. IGATEFILES.remove('movingPart.h')
  3330. IGATEFILES.remove('animChannelFixed.h')
  3331. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3332. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3333. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  3334. # DIRECTORY: panda/src/char/
  3335. #
  3336. if (not RUNTIME):
  3337. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3338. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3339. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3340. OPTS=['DIR:panda/src/char', 'PYTHON']
  3341. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3342. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3343. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3344. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  3345. #
  3346. # DIRECTORY: panda/src/dgraph/
  3347. #
  3348. if (not RUNTIME):
  3349. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3350. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3351. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3352. OPTS=['DIR:panda/src/dgraph', 'PYTHON']
  3353. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3354. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3355. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3356. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  3357. #
  3358. # DIRECTORY: panda/src/display/
  3359. #
  3360. if (not RUNTIME):
  3361. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA']
  3362. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3363. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3364. OPTS=['DIR:panda/src/display', 'PYTHON']
  3365. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3366. IGATEFILES.remove("renderBuffer.h")
  3367. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3368. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3369. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  3370. TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
  3371. TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx')
  3372. TargetAdd('p3display_pythonGraphicsWindowProc.obj', opts=OPTS, input='pythonGraphicsWindowProc.cxx')
  3373. if RTDIST and GetTarget() == 'darwin':
  3374. OPTS=['DIR:panda/src/display']
  3375. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3376. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3377. #
  3378. # DIRECTORY: panda/src/device/
  3379. #
  3380. if (not RUNTIME):
  3381. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3382. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3383. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3384. OPTS=['DIR:panda/src/device', 'PYTHON']
  3385. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3386. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3387. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3388. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  3389. #
  3390. # DIRECTORY: panda/src/pnmtext/
  3391. #
  3392. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3393. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3394. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3395. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON']
  3396. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3397. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3398. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3399. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  3400. #
  3401. # DIRECTORY: panda/src/text/
  3402. #
  3403. if (not RUNTIME):
  3404. if not PkgSkip("HARFBUZZ"):
  3405. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3406. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3407. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3408. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3409. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON']
  3410. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3411. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3412. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3413. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  3414. #
  3415. # DIRECTORY: panda/src/movies/
  3416. #
  3417. if (not RUNTIME):
  3418. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3419. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3420. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS', 'PYTHON']
  3421. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3422. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3423. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3424. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  3425. #
  3426. # DIRECTORY: panda/src/grutil/
  3427. #
  3428. if (not RUNTIME):
  3429. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3430. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3431. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3432. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3433. OPTS=['DIR:panda/src/grutil', 'PYTHON']
  3434. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3435. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3436. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3437. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3438. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  3439. #
  3440. # DIRECTORY: panda/src/tform/
  3441. #
  3442. if (not RUNTIME):
  3443. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3444. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3445. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3446. OPTS=['DIR:panda/src/tform', 'PYTHON']
  3447. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3448. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3449. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3450. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  3451. #
  3452. # DIRECTORY: panda/src/collide/
  3453. #
  3454. if (not RUNTIME):
  3455. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3456. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3457. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3458. OPTS=['DIR:panda/src/collide', 'PYTHON']
  3459. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3460. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3461. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3462. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  3463. #
  3464. # DIRECTORY: panda/src/parametrics/
  3465. #
  3466. if (not RUNTIME):
  3467. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3468. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3469. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3470. OPTS=['DIR:panda/src/parametrics', 'PYTHON']
  3471. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3472. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3473. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3474. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  3475. #
  3476. # DIRECTORY: panda/src/pgui/
  3477. #
  3478. if (not RUNTIME):
  3479. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3480. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3481. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3482. OPTS=['DIR:panda/src/pgui', 'PYTHON']
  3483. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3484. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3485. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3486. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  3487. #
  3488. # DIRECTORY: panda/src/pnmimagetypes/
  3489. #
  3490. if (not RUNTIME):
  3491. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3492. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3493. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3494. #
  3495. # DIRECTORY: panda/src/recorder/
  3496. #
  3497. if (not RUNTIME):
  3498. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3499. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3500. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3501. OPTS=['DIR:panda/src/recorder', 'PYTHON']
  3502. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3503. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3504. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3505. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  3506. #
  3507. # DIRECTORY: panda/src/dxml/
  3508. #
  3509. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3510. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3511. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3512. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3513. if (not RUNTIME):
  3514. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3515. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3516. OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON']
  3517. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3518. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3519. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3520. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  3521. #
  3522. # DIRECTORY: panda/metalibs/panda/
  3523. #
  3524. if (not RUNTIME):
  3525. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3526. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3527. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI']
  3528. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3529. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3530. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3531. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3532. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3533. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3534. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3535. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3536. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3537. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3538. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3539. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3540. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3541. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3542. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3543. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3544. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3545. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3546. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3547. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3548. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3549. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3550. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3551. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3552. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3553. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3554. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3555. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3556. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3557. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3558. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3559. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3560. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3561. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3562. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3563. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3564. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3565. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3566. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3567. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3568. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3569. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3570. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3571. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3572. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3573. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3574. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3575. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3576. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3577. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3578. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3579. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3580. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3581. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3582. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3583. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3584. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3585. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3586. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3587. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3588. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3589. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3590. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3591. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3592. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3593. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3594. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3595. if PkgSkip("FREETYPE")==0:
  3596. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3597. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3598. TargetAdd('libpanda.dll', opts=OPTS)
  3599. TargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3600. TargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3601. TargetAdd('core_module.obj', input='libp3prc.in')
  3602. TargetAdd('core_module.obj', input='libp3downloader.in')
  3603. TargetAdd('core_module.obj', input='libp3express.in')
  3604. TargetAdd('core_module.obj', input='libp3recorder.in')
  3605. TargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3606. TargetAdd('core_module.obj', input='libp3pgraph.in')
  3607. TargetAdd('core_module.obj', input='libp3cull.in')
  3608. TargetAdd('core_module.obj', input='libp3grutil.in')
  3609. TargetAdd('core_module.obj', input='libp3chan.in')
  3610. TargetAdd('core_module.obj', input='libp3pstatclient.in')
  3611. TargetAdd('core_module.obj', input='libp3char.in')
  3612. TargetAdd('core_module.obj', input='libp3collide.in')
  3613. TargetAdd('core_module.obj', input='libp3device.in')
  3614. TargetAdd('core_module.obj', input='libp3dgraph.in')
  3615. TargetAdd('core_module.obj', input='libp3display.in')
  3616. TargetAdd('core_module.obj', input='libp3pipeline.in')
  3617. TargetAdd('core_module.obj', input='libp3event.in')
  3618. TargetAdd('core_module.obj', input='libp3gobj.in')
  3619. TargetAdd('core_module.obj', input='libp3gsgbase.in')
  3620. TargetAdd('core_module.obj', input='libp3linmath.in')
  3621. TargetAdd('core_module.obj', input='libp3mathutil.in')
  3622. TargetAdd('core_module.obj', input='libp3parametrics.in')
  3623. TargetAdd('core_module.obj', input='libp3pnmimage.in')
  3624. TargetAdd('core_module.obj', input='libp3text.in')
  3625. TargetAdd('core_module.obj', input='libp3tform.in')
  3626. TargetAdd('core_module.obj', input='libp3putil.in')
  3627. TargetAdd('core_module.obj', input='libp3audio.in')
  3628. TargetAdd('core_module.obj', input='libp3nativenet.in')
  3629. TargetAdd('core_module.obj', input='libp3net.in')
  3630. TargetAdd('core_module.obj', input='libp3pgui.in')
  3631. TargetAdd('core_module.obj', input='libp3movies.in')
  3632. TargetAdd('core_module.obj', input='libp3dxml.in')
  3633. if PkgSkip("FREETYPE")==0:
  3634. TargetAdd('core_module.obj', input='libp3pnmtext.in')
  3635. TargetAdd('core_module.obj', opts=['PYTHON'])
  3636. TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3637. TargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3638. TargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3639. TargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3640. TargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3641. TargetAdd('core.pyd', input='libp3prc_igate.obj')
  3642. TargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3643. TargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3644. TargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3645. TargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3646. TargetAdd('core.pyd', input='libp3express_igate.obj')
  3647. TargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3648. TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3649. TargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3650. TargetAdd('core.pyd', input='libp3movies_igate.obj')
  3651. TargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3652. TargetAdd('core.pyd', input='libp3chan_igate.obj')
  3653. TargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3654. TargetAdd('core.pyd', input='libp3char_igate.obj')
  3655. TargetAdd('core.pyd', input='libp3collide_igate.obj')
  3656. TargetAdd('core.pyd', input='libp3device_igate.obj')
  3657. TargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3658. TargetAdd('core.pyd', input='libp3display_igate.obj')
  3659. TargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3660. TargetAdd('core.pyd', input='libp3event_igate.obj')
  3661. TargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3662. TargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3663. TargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3664. TargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3665. TargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3666. TargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3667. TargetAdd('core.pyd', input='libp3text_igate.obj')
  3668. TargetAdd('core.pyd', input='libp3tform_igate.obj')
  3669. TargetAdd('core.pyd', input='libp3putil_igate.obj')
  3670. TargetAdd('core.pyd', input='libp3audio_igate.obj')
  3671. TargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3672. TargetAdd('core.pyd', input='libp3net_igate.obj')
  3673. TargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3674. TargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3675. if PkgSkip("FREETYPE")==0:
  3676. TargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3677. TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3678. TargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3679. TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3680. TargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  3681. TargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3682. TargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3683. TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3684. TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj')
  3685. TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj')
  3686. TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj')
  3687. TargetAdd('core.pyd', input='core_module.obj')
  3688. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3689. TargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3690. TargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3691. TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3692. TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2'])
  3693. #
  3694. # DIRECTORY: panda/src/vision/
  3695. #
  3696. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3697. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3698. if not PkgSkip("FFMPEG"):
  3699. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3700. if not PkgSkip("OPENCV"):
  3701. DefSymbol("OPENCV", "HAVE_OPENCV")
  3702. if OPENCV_VER_23:
  3703. DefSymbol("OPENCV", "OPENCV_VER_23")
  3704. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3705. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3706. 'dtool_have_ffmpeg.dat',
  3707. 'dtool_have_opencv.dat',
  3708. 'dtool_have_directcam.dat',
  3709. ])
  3710. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3711. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3712. TargetAdd('libp3vision.dll', opts=OPTS)
  3713. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON']
  3714. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3715. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3716. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3717. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  3718. TargetAdd('vision_module.obj', input='libp3vision.in')
  3719. TargetAdd('vision_module.obj', opts=OPTS)
  3720. TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3721. TargetAdd('vision.pyd', input='vision_module.obj')
  3722. TargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3723. TargetAdd('vision.pyd', input='libp3vision.dll')
  3724. TargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3725. TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3726. TargetAdd('vision.pyd', opts=['PYTHON'])
  3727. #
  3728. # DIRECTORY: panda/src/rocket/
  3729. #
  3730. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3731. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3732. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3733. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3734. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3735. TargetAdd('libp3rocket.dll', opts=OPTS)
  3736. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON']
  3737. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3738. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3739. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3740. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3741. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  3742. TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3743. TargetAdd('rocket_module.obj', input='libp3rocket.in')
  3744. TargetAdd('rocket_module.obj', opts=OPTS)
  3745. TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3746. TargetAdd('rocket.pyd', input='rocket_module.obj')
  3747. TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3748. TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3749. TargetAdd('rocket.pyd', input='libp3rocket.dll')
  3750. TargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3751. TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3752. TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET'])
  3753. #
  3754. # DIRECTORY: panda/src/p3awesomium
  3755. #
  3756. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  3757. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  3758. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  3759. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  3760. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  3761. TargetAdd('libp3awesomium.dll', opts=OPTS)
  3762. OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON']
  3763. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  3764. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  3765. TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  3766. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  3767. TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
  3768. TargetAdd('awesomium_module.obj', opts=OPTS)
  3769. TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core'])
  3770. TargetAdd('awesomium.pyd', input='awesomium_module.obj')
  3771. TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
  3772. TargetAdd('awesomium.pyd', input='libp3awesomium.dll')
  3773. TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll')
  3774. TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS)
  3775. TargetAdd('awesomium.pyd', opts=['PYTHON'])
  3776. #
  3777. # DIRECTORY: panda/src/p3skel
  3778. #
  3779. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3780. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3781. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3782. OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON']
  3783. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3784. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3785. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3786. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  3787. #
  3788. # DIRECTORY: panda/src/p3skel
  3789. #
  3790. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3791. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3792. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3793. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3794. TargetAdd('libpandaskel.dll', opts=OPTS)
  3795. OPTS=['PYTHON']
  3796. TargetAdd('skel_module.obj', input='libp3skel.in')
  3797. TargetAdd('skel_module.obj', opts=OPTS)
  3798. TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3799. TargetAdd('skel.pyd', input='skel_module.obj')
  3800. TargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3801. TargetAdd('skel.pyd', input='libpandaskel.dll')
  3802. TargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3803. TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3804. TargetAdd('skel.pyd', opts=['PYTHON'])
  3805. #
  3806. # DIRECTORY: panda/src/distort/
  3807. #
  3808. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3809. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3810. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3811. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3812. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3813. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3814. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3815. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  3816. #
  3817. # DIRECTORY: panda/metalibs/pandafx/
  3818. #
  3819. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3820. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3821. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3822. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3823. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3824. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3825. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3826. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3827. TargetAdd('fx_module.obj', input='libp3distort.in')
  3828. TargetAdd('fx_module.obj', opts=OPTS)
  3829. TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3830. TargetAdd('fx.pyd', input='fx_module.obj')
  3831. TargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3832. TargetAdd('fx.pyd', input='libpandafx.dll')
  3833. TargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3834. TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3835. TargetAdd('fx.pyd', opts=['PYTHON'])
  3836. #
  3837. # DIRECTORY: panda/src/vrpn/
  3838. #
  3839. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3840. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3841. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3842. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3843. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3844. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3845. OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON']
  3846. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3847. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3848. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3849. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  3850. TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3851. TargetAdd('vrpn_module.obj', opts=OPTS)
  3852. TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3853. TargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3854. TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3855. TargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3856. TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3857. TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3858. TargetAdd('vrpn.pyd', opts=['PYTHON'])
  3859. #
  3860. # DIRECTORY: panda/src/ffmpeg
  3861. #
  3862. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3863. if not PkgSkip("SWSCALE"):
  3864. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3865. if not PkgSkip("SWRESAMPLE"):
  3866. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3867. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3868. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3869. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3870. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3871. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3872. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3873. #
  3874. # DIRECTORY: panda/src/audiotraits/
  3875. #
  3876. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3877. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3878. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3879. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3880. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3881. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3882. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3883. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3884. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3885. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3886. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3887. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  3888. #
  3889. # DIRECTORY: panda/src/downloadertools/
  3890. #
  3891. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3892. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3893. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3894. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3895. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  3896. TargetAdd('apply_patch.exe', opts=OPTS)
  3897. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3898. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3899. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  3900. TargetAdd('build_patch.exe', opts=OPTS)
  3901. if not PkgSkip("ZLIB"):
  3902. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3903. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3904. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  3905. TargetAdd('check_adler.exe', opts=OPTS)
  3906. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3907. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3908. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  3909. TargetAdd('check_crc.exe', opts=OPTS)
  3910. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3911. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3912. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  3913. TargetAdd('check_md5.exe', opts=OPTS)
  3914. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3915. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3916. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3917. TargetAdd('pdecrypt.exe', opts=OPTS)
  3918. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3919. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3920. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3921. TargetAdd('pencrypt.exe', opts=OPTS)
  3922. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3923. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3924. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  3925. TargetAdd('show_ddb.exe', opts=OPTS)
  3926. #
  3927. # DIRECTORY: panda/src/downloadertools/
  3928. #
  3929. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3930. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3931. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3932. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3933. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3934. TargetAdd('multify.exe', opts=OPTS)
  3935. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3936. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3937. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3938. TargetAdd('pzip.exe', opts=OPTS)
  3939. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3940. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3941. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3942. TargetAdd('punzip.exe', opts=OPTS)
  3943. #
  3944. # DIRECTORY: panda/src/windisplay/
  3945. #
  3946. if (GetTarget() == 'windows' and not RUNTIME):
  3947. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3948. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3949. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3950. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3951. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3952. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3953. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3954. #
  3955. # DIRECTORY: panda/metalibs/pandadx9/
  3956. #
  3957. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  3958. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3959. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3960. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3961. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3962. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3963. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3964. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3965. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3966. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3967. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3968. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3969. #
  3970. # DIRECTORY: panda/src/egg/
  3971. #
  3972. if not RUNTIME and not PkgSkip("EGG"):
  3973. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3974. CreateFile(GetOutputDir()+"/include/parser.h")
  3975. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3976. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3977. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3978. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3979. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3980. OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON']
  3981. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3982. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3983. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3984. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3985. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3986. TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  3987. #
  3988. # DIRECTORY: panda/src/egg2pg/
  3989. #
  3990. if not RUNTIME and not PkgSkip("EGG"):
  3991. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3992. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3993. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3994. OPTS=['DIR:panda/src/egg2pg', 'PYTHON']
  3995. IGATEFILES=['load_egg_file.h']
  3996. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3997. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3998. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  3999. #
  4000. # DIRECTORY: panda/src/framework/
  4001. #
  4002. if (not RUNTIME):
  4003. deps = []
  4004. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4005. if GetLinkAllStatic():
  4006. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4007. if not PkgSkip("GL"):
  4008. DefSymbol("FRAMEWORK", "HAVE_GL")
  4009. if not PkgSkip("TINYDISPLAY"):
  4010. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4011. if not PkgSkip("EGG"):
  4012. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4013. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4014. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4015. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4016. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4017. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4018. #
  4019. # DIRECTORY: panda/src/glgsg/
  4020. #
  4021. if (not RUNTIME and PkgSkip("GL")==0):
  4022. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4023. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4024. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4025. #
  4026. # DIRECTORY: panda/src/glesgsg/
  4027. #
  4028. if (not RUNTIME and PkgSkip("GLES")==0):
  4029. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4030. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4031. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4032. #
  4033. # DIRECTORY: panda/src/gles2gsg/
  4034. #
  4035. if (not RUNTIME and PkgSkip("GLES2")==0):
  4036. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4037. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4038. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4039. #
  4040. # DIRECTORY: panda/metalibs/pandaegg/
  4041. #
  4042. if not RUNTIME and not PkgSkip("EGG"):
  4043. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4044. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4045. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4046. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4047. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4048. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4049. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4050. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4051. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4052. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4053. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4054. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON']
  4055. TargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4056. TargetAdd('egg_module.obj', input='libp3egg.in')
  4057. TargetAdd('egg_module.obj', opts=OPTS)
  4058. TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4059. TargetAdd('egg.pyd', input='egg_module.obj')
  4060. TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4061. TargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4062. TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4063. TargetAdd('egg.pyd', input='libpandaegg.dll')
  4064. TargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4065. TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4066. TargetAdd('egg.pyd', opts=['PYTHON'])
  4067. #
  4068. # DIRECTORY: panda/src/x11display/
  4069. #
  4070. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4071. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4072. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4073. #
  4074. # DIRECTORY: panda/src/glxdisplay/
  4075. #
  4076. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4077. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4078. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4079. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4080. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4081. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4082. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4083. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4084. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4085. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4086. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4087. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4088. #
  4089. # DIRECTORY: panda/src/cocoadisplay/
  4090. #
  4091. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4092. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4093. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4094. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4095. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4096. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4097. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4098. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4099. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4100. if (PkgSkip('PANDAFX')==0):
  4101. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4102. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4103. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4104. #
  4105. # DIRECTORY: panda/src/osxdisplay/
  4106. #
  4107. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4108. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4109. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4110. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4111. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4112. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4113. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4114. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4115. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4116. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4117. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4118. if (PkgSkip('PANDAFX')==0):
  4119. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4120. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4121. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4122. #
  4123. # DIRECTORY: panda/src/wgldisplay/
  4124. #
  4125. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4126. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4127. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4128. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4129. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4130. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4131. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4132. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4133. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4134. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4135. if (PkgSkip('PANDAFX')==0):
  4136. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4137. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4138. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4139. #
  4140. # DIRECTORY: panda/src/egldisplay/
  4141. #
  4142. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4143. DefSymbol('GLES', 'OPENGLES_1', '')
  4144. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4145. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4146. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4147. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4148. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4149. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4150. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4151. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4152. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4153. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4154. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4155. #
  4156. # DIRECTORY: panda/src/egldisplay/
  4157. #
  4158. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4159. DefSymbol('GLES2', 'OPENGLES_2', '')
  4160. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4161. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4162. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4163. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4164. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4165. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4166. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4167. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4168. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4169. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4170. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4171. #
  4172. # DIRECTORY: panda/src/vulkandisplay/
  4173. #
  4174. if not PkgSkip("VULKAN") and not RUNTIME:
  4175. OPTS=['DIR:panda/src/vulkandisplay', 'DIR:panda/src/vulkandisplay', 'BUILDING:VULKANDISPLAY', 'VULKAN']
  4176. TargetAdd('p3vulkandisplay_composite1.obj', opts=OPTS, input='p3vulkandisplay_composite1.cxx')
  4177. TargetAdd('libp3vulkandisplay.dll', input='p3vulkandisplay_composite1.obj')
  4178. if GetTarget() == 'windows':
  4179. TargetAdd('libp3vulkandisplay.dll', input='libp3windisplay.dll')
  4180. TargetAdd('libp3vulkandisplay.dll', opts=['MODULE', 'VULKAN'])
  4181. else:
  4182. TargetAdd('libp3vulkandisplay.dll', input='p3x11display_composite1.obj')
  4183. TargetAdd('libp3vulkandisplay.dll', opts=['MODULE', 'VULKAN', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  4184. TargetAdd('libp3vulkandisplay.dll', input=COMMON_PANDA_LIBS)
  4185. #
  4186. # DIRECTORY: panda/src/ode/
  4187. #
  4188. if (PkgSkip("ODE")==0 and not RUNTIME):
  4189. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON']
  4190. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4191. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4192. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4193. OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON']
  4194. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4195. IGATEFILES.remove("odeConvexGeom.h")
  4196. IGATEFILES.remove("odeHeightFieldGeom.h")
  4197. IGATEFILES.remove("odeHelperStructs.h")
  4198. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4199. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4200. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  4201. TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4202. #
  4203. # DIRECTORY: panda/metalibs/pandaode/
  4204. #
  4205. if (PkgSkip("ODE")==0 and not RUNTIME):
  4206. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4207. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4208. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4209. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4210. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4211. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4212. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4213. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4214. OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON']
  4215. TargetAdd('ode_module.obj', input='libpandaode.in')
  4216. TargetAdd('ode_module.obj', opts=OPTS)
  4217. TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4218. TargetAdd('ode.pyd', input='ode_module.obj')
  4219. TargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4220. TargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4221. TargetAdd('ode.pyd', input='libpandaode.dll')
  4222. TargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4223. TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4224. TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE'])
  4225. #
  4226. # DIRECTORY: panda/src/bullet/
  4227. #
  4228. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4229. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4230. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4231. OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON']
  4232. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4233. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4234. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4235. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  4236. #
  4237. # DIRECTORY: panda/metalibs/pandabullet/
  4238. #
  4239. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4240. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4241. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4242. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4243. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4244. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4245. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4246. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON']
  4247. TargetAdd('bullet_module.obj', input='libpandabullet.in')
  4248. TargetAdd('bullet_module.obj', opts=OPTS)
  4249. TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4250. TargetAdd('bullet.pyd', input='bullet_module.obj')
  4251. TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4252. TargetAdd('bullet.pyd', input='libpandabullet.dll')
  4253. TargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4254. TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4255. TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET'])
  4256. #
  4257. # DIRECTORY: panda/src/physx/
  4258. #
  4259. if (PkgSkip("PHYSX")==0):
  4260. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4261. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4262. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4263. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4264. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4265. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4266. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  4267. #
  4268. # DIRECTORY: panda/metalibs/pandaphysx/
  4269. #
  4270. if (PkgSkip("PHYSX")==0):
  4271. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4272. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4273. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4274. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4275. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4276. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'PYTHON'])
  4277. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4278. TargetAdd('physx_module.obj', input='libpandaphysx.in')
  4279. TargetAdd('physx_module.obj', opts=OPTS)
  4280. TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4281. TargetAdd('physx.pyd', input='physx_module.obj')
  4282. TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4283. TargetAdd('physx.pyd', input='libpandaphysx.dll')
  4284. TargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4285. TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4286. TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4287. #
  4288. # DIRECTORY: panda/src/physics/
  4289. #
  4290. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4291. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4292. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4293. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4294. OPTS=['DIR:panda/src/physics', 'PYTHON']
  4295. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4296. IGATEFILES.remove("forces.h")
  4297. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4298. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4299. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  4300. #
  4301. # DIRECTORY: panda/src/particlesystem/
  4302. #
  4303. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4304. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4305. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4306. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4307. OPTS=['DIR:panda/src/particlesystem', 'PYTHON']
  4308. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4309. IGATEFILES.remove('orientedParticle.h')
  4310. IGATEFILES.remove('orientedParticleFactory.h')
  4311. IGATEFILES.remove('particlefactories.h')
  4312. IGATEFILES.remove('emitters.h')
  4313. IGATEFILES.remove('particles.h')
  4314. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4315. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4316. TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
  4317. #
  4318. # DIRECTORY: panda/metalibs/pandaphysics/
  4319. #
  4320. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4321. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4322. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4323. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4324. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4325. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4326. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4327. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4328. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4329. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4330. OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON']
  4331. TargetAdd('physics_module.obj', input='libp3physics.in')
  4332. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4333. TargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4334. TargetAdd('physics_module.obj', opts=OPTS)
  4335. TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4336. TargetAdd('physics.pyd', input='physics_module.obj')
  4337. TargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4338. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4339. TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4340. TargetAdd('physics.pyd', input='libpandaphysics.dll')
  4341. TargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4342. TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4343. TargetAdd('physics.pyd', opts=['PYTHON'])
  4344. #
  4345. # DIRECTORY: panda/src/speedtree/
  4346. #
  4347. if (PkgSkip("SPEEDTREE")==0):
  4348. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON']
  4349. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4350. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4351. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4352. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4353. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  4354. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4355. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4356. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4357. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4358. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4359. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4360. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4361. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4362. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4363. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4364. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4365. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4366. #
  4367. # DIRECTORY: panda/src/testbed/
  4368. #
  4369. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'android'):
  4370. OPTS=['DIR:panda/src/testbed']
  4371. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4372. TargetAdd('pview.exe', input='pview_pview.obj')
  4373. TargetAdd('pview.exe', input='libp3framework.dll')
  4374. if not PkgSkip("EGG"):
  4375. TargetAdd('pview.exe', input='libpandaegg.dll')
  4376. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4377. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4378. #
  4379. # DIRECTORY: panda/src/android/
  4380. #
  4381. if (not RUNTIME and GetTarget() == 'android'):
  4382. native_app_glue = os.path.join(SDK['ANDROID_NDK'], 'sources', 'android', 'native_app_glue')
  4383. OPTS=['DIR:panda/src/android', 'DIR:' + native_app_glue]
  4384. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4385. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4386. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4387. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4388. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4389. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4390. if (not RTDIST and PkgSkip("PVIEW")==0):
  4391. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4392. TargetAdd('pview.exe', input='android_native_app_glue.obj')
  4393. TargetAdd('pview.exe', input='android_main.obj')
  4394. TargetAdd('pview.exe', input='pview_pview.obj')
  4395. TargetAdd('pview.exe', input='libp3framework.dll')
  4396. if not PkgSkip("EGG"):
  4397. TargetAdd('pview.exe', input='libpandaegg.dll')
  4398. TargetAdd('pview.exe', input='libp3android.dll')
  4399. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4400. TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml')
  4401. #
  4402. # DIRECTORY: panda/src/androiddisplay/
  4403. #
  4404. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4405. DefSymbol('GLES', 'OPENGLES_1', '')
  4406. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'DIR:' + native_app_glue, 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4407. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4408. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4409. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4410. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4411. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4412. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4413. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4414. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4415. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4416. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4417. #
  4418. # DIRECTORY: panda/src/tinydisplay/
  4419. #
  4420. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4421. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4422. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4423. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4424. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4425. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4426. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4427. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4428. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4429. if GetTarget() == 'darwin':
  4430. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4431. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4432. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4433. elif GetTarget() == 'windows':
  4434. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4435. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4436. else:
  4437. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4438. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4439. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4440. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4441. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4442. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4443. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4444. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4445. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4446. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4447. #
  4448. # DIRECTORY: direct/src/directbase/
  4449. #
  4450. if (PkgSkip("DIRECT")==0):
  4451. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  4452. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4453. #
  4454. # DIRECTORY: direct/src/dcparser/
  4455. #
  4456. if (PkgSkip("DIRECT")==0):
  4457. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON']
  4458. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4459. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4460. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4461. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4462. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4463. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4464. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON']
  4465. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4466. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4467. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4468. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4469. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4470. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  4471. #
  4472. # DIRECTORY: direct/src/deadrec/
  4473. #
  4474. if (PkgSkip("DIRECT")==0):
  4475. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4476. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4477. OPTS=['DIR:direct/src/deadrec', 'PYTHON']
  4478. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4479. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4480. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4481. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  4482. #
  4483. # DIRECTORY: direct/src/distributed/
  4484. #
  4485. if (PkgSkip("DIRECT")==0):
  4486. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON']
  4487. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4488. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4489. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4490. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON']
  4491. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4492. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4493. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4494. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  4495. #
  4496. # DIRECTORY: direct/src/interval/
  4497. #
  4498. if (PkgSkip("DIRECT")==0):
  4499. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4500. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4501. OPTS=['DIR:direct/src/interval', 'PYTHON']
  4502. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4503. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4504. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4505. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  4506. #
  4507. # DIRECTORY: direct/src/showbase/
  4508. #
  4509. if (PkgSkip("DIRECT")==0):
  4510. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4511. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4512. if GetTarget() == 'darwin':
  4513. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4514. OPTS=['DIR:direct/src/showbase', 'PYTHON']
  4515. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4516. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4517. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4518. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  4519. #
  4520. # DIRECTORY: direct/src/motiontrail/
  4521. #
  4522. if (PkgSkip("DIRECT")==0):
  4523. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4524. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4525. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4526. OPTS=['DIR:direct/src/motiontrail', 'PYTHON']
  4527. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4528. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4529. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4530. TargetAdd('libp3motiontrail_igate.obj', input='libp3motiontrail.in', opts=["DEPENDENCYONLY"])
  4531. #
  4532. # DIRECTORY: direct/metalibs/direct/
  4533. #
  4534. if (PkgSkip("DIRECT")==0):
  4535. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4536. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4537. if GetTarget() == 'darwin':
  4538. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4539. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4540. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4541. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4542. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4543. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4544. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4545. OPTS=['PYTHON']
  4546. TargetAdd('direct_module.obj', input='libp3dcparser.in')
  4547. TargetAdd('direct_module.obj', input='libp3showbase.in')
  4548. TargetAdd('direct_module.obj', input='libp3deadrec.in')
  4549. TargetAdd('direct_module.obj', input='libp3interval.in')
  4550. TargetAdd('direct_module.obj', input='libp3distributed.in')
  4551. TargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4552. TargetAdd('direct_module.obj', opts=OPTS)
  4553. TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4554. TargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4555. TargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4556. TargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4557. TargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4558. TargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4559. TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4560. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4561. # the Python libraries. If a C++ user needs these modules, we can move them
  4562. # back and filter out the Python-specific code.
  4563. TargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4564. TargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4565. TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4566. TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4567. TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4568. TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4569. TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4570. TargetAdd('direct.pyd', input='direct_module.obj')
  4571. TargetAdd('direct.pyd', input='libp3direct.dll')
  4572. TargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4573. TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4574. TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2'])
  4575. #
  4576. # DIRECTORY: direct/src/dcparse/
  4577. #
  4578. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4579. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON']
  4580. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4581. TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4582. TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4583. TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4584. TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4585. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4586. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4587. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4588. TargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4589. TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON'])
  4590. #
  4591. # DIRECTORY: direct/src/plugin/
  4592. #
  4593. if (RTDIST or RUNTIME):
  4594. # Explicitly define this as we don't include dtool_config.h here.
  4595. if GetTarget() not in ('windows', 'darwin'):
  4596. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4597. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4598. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4599. OPTS += ['ZLIB', 'MSIMG']
  4600. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4601. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4602. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4603. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4604. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4605. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4606. if GetTarget() == 'darwin':
  4607. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4608. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4609. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4610. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4611. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4612. if (RTDIST):
  4613. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4614. TargetAdd(fname, input='plugin_plugin.obj')
  4615. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4616. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4617. TargetAdd(fname, input='plugin_parse_color.obj')
  4618. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4619. if GetTarget() == 'darwin':
  4620. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4621. TargetAdd(fname, input='plugin_fileSpec.obj')
  4622. TargetAdd(fname, input='plugin_binaryXml.obj')
  4623. TargetAdd(fname, input='plugin_handleStream.obj')
  4624. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4625. TargetAdd(fname, input='libp3tinyxml.ilb')
  4626. if GetTarget() == 'darwin':
  4627. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4628. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4629. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4630. if (PkgSkip("PYTHON")==0 and RTDIST):
  4631. # Freeze VFSImporter and its dependency modules into p3dpython.
  4632. # Mark panda3d.core as a dependency to make sure to build that first.
  4633. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON'])
  4634. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4635. OPTS += ['PYTHON']
  4636. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4637. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4638. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4639. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4640. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4641. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4642. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4643. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4644. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4645. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4646. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4647. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4648. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4649. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4650. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4651. if GetTarget() == 'windows':
  4652. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4653. OPTS.append("NON_CONSOLE")
  4654. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4655. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4656. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4657. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4658. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4659. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4660. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4661. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4662. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  4663. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4664. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4665. if GetTarget() == 'darwin':
  4666. OPTS += ['OPT:2']
  4667. if (PkgSkip("FLTK")==0):
  4668. OPTS.append("FLTK")
  4669. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4670. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4671. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4672. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4673. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4674. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4675. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4676. if GetTarget() == 'darwin':
  4677. OPTS += ['OPT:2']
  4678. TargetAdd('p3dcert.exe', opts=OPTS)
  4679. elif (PkgSkip("WX")==0):
  4680. OPTS += ["WX", "RTTI"]
  4681. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4682. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4683. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4684. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4685. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4686. if GetTarget() == "darwin":
  4687. OPTS += ['GL', 'OPT:2']
  4688. TargetAdd('p3dcert.exe', opts=OPTS)
  4689. #
  4690. # DIRECTORY: direct/src/plugin_npapi/
  4691. #
  4692. if RUNTIME:
  4693. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4694. if GetTarget() == 'windows':
  4695. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4696. "version" : VERSION,
  4697. "description" : "Runs 3-D games and interactive applets",
  4698. "filename" : "nppanda3d.dll",
  4699. "mimetype" : "application/x-panda3d",
  4700. "extension" : "p3d",
  4701. "filedesc" : "Panda3D applet"}
  4702. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4703. elif GetTarget() == 'darwin':
  4704. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4705. OPTS += ['GTK2']
  4706. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4707. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4708. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4709. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4710. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4711. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4712. if GetTarget() == 'windows':
  4713. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4714. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4715. elif GetTarget() == 'darwin':
  4716. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4717. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4718. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4719. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4720. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4721. #
  4722. # DIRECTORY: direct/src/plugin_activex/
  4723. #
  4724. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4725. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4726. DefSymbol('ACTIVEX', '_USRDLL', '')
  4727. DefSymbol('ACTIVEX', '_WINDLL', '')
  4728. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4729. DefSymbol('ACTIVEX', '_MBCS', '')
  4730. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4731. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4732. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4733. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4734. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4735. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4736. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4737. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4738. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4739. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4740. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4741. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4742. #
  4743. # DIRECTORY: direct/src/plugin_standalone/
  4744. #
  4745. if (RUNTIME):
  4746. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4747. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4748. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4749. if GetTarget() == 'windows':
  4750. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4751. "version" : VERSION,
  4752. "description" : "Runs 3-D games and interactive applets",
  4753. "filename" : "panda3d.exe",
  4754. "mimetype" : "application/x-panda3d",
  4755. "extension" : "p3d",
  4756. "filedesc" : "Panda3D applet",
  4757. "icon" : "panda3d.ico"}
  4758. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4759. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4760. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4761. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4762. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4763. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4764. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4765. if GetTarget() == 'darwin':
  4766. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4767. elif GetTarget() == 'windows':
  4768. TargetAdd('panda3d.exe', input='panda3d.res')
  4769. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4770. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4771. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4772. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4773. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4774. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4775. if (GetTarget() == 'darwin'):
  4776. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4777. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4778. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4779. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4780. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4781. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4782. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4783. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4784. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4785. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4786. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4787. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4788. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4789. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4790. elif (GetTarget() == 'windows'):
  4791. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4792. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4793. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4794. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4795. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4796. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4797. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4798. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4799. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4800. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4801. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4802. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4803. if (RTDIST):
  4804. 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']
  4805. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4806. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4807. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4808. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4809. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4810. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4811. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4812. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4813. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4814. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4815. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4816. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4817. if (GetTarget() == 'darwin'):
  4818. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4819. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4820. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4821. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  4822. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4823. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4824. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4825. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4826. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4827. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4828. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4829. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4830. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4831. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4832. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4833. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4834. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4835. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4836. if GetTarget() == 'darwin':
  4837. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4838. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4839. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4840. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  4841. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4842. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4843. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4844. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4845. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4846. if GetTarget() == 'darwin':
  4847. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4848. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4849. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4850. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4851. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4852. if GetTarget() == 'windows':
  4853. OPTS.append("P3DEMBEDW")
  4854. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4855. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4856. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4857. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4858. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4859. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4860. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4861. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4862. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4863. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4864. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4865. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4866. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4867. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4868. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  4869. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4870. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4871. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4872. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4873. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4874. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4875. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4876. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4877. #
  4878. # DIRECTORY: pandatool/src/pandatoolbase/
  4879. #
  4880. if (PkgSkip("PANDATOOL")==0):
  4881. OPTS=['DIR:pandatool/src/pandatoolbase']
  4882. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4883. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4884. #
  4885. # DIRECTORY: pandatool/src/converter/
  4886. #
  4887. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4888. OPTS=['DIR:pandatool/src/converter']
  4889. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4890. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4891. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4892. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4893. #
  4894. # DIRECTORY: pandatool/src/progbase/
  4895. #
  4896. if not PkgSkip("PANDATOOL"):
  4897. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4898. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4899. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4900. #
  4901. # DIRECTORY: pandatool/src/eggbase/
  4902. #
  4903. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4904. OPTS=['DIR:pandatool/src/eggbase']
  4905. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4906. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4907. #
  4908. # DIRECTORY: pandatool/src/bam/
  4909. #
  4910. if not PkgSkip("PANDATOOL"):
  4911. OPTS=['DIR:pandatool/src/bam']
  4912. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4913. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4914. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4915. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4916. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4917. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4918. if not PkgSkip("EGG"):
  4919. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4920. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4921. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4922. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4923. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4924. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4925. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4926. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4927. #
  4928. # DIRECTORY: pandatool/src/cvscopy/
  4929. #
  4930. if not PkgSkip("PANDATOOL"):
  4931. OPTS=['DIR:pandatool/src/cvscopy']
  4932. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  4933. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  4934. #
  4935. # DIRECTORY: pandatool/src/daeegg/
  4936. #
  4937. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4938. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4939. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4940. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4941. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4942. #
  4943. # DIRECTORY: pandatool/src/assimp
  4944. #
  4945. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  4946. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4947. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4948. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4949. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4950. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB'])
  4951. #
  4952. # DIRECTORY: pandatool/src/daeprogs/
  4953. #
  4954. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4955. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4956. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4957. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4958. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4959. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4960. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4961. #
  4962. # DIRECTORY: pandatool/src/dxf/
  4963. #
  4964. if not PkgSkip("PANDATOOL"):
  4965. OPTS=['DIR:pandatool/src/dxf']
  4966. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4967. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4968. #
  4969. # DIRECTORY: pandatool/src/dxfegg/
  4970. #
  4971. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4972. OPTS=['DIR:pandatool/src/dxfegg']
  4973. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4974. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4975. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4976. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4977. #
  4978. # DIRECTORY: pandatool/src/dxfprogs/
  4979. #
  4980. if not PkgSkip("PANDATOOL"):
  4981. OPTS=['DIR:pandatool/src/dxfprogs']
  4982. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4983. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4984. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4985. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4986. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4987. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4988. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4989. if not PkgSkip("EGG"):
  4990. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4991. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4992. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4993. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4994. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4995. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4996. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4997. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4998. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4999. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5000. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5001. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5002. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5003. #
  5004. # DIRECTORY: pandatool/src/objegg/
  5005. #
  5006. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5007. OPTS=['DIR:pandatool/src/objegg']
  5008. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5009. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5010. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5011. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5012. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5013. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5014. #
  5015. # DIRECTORY: pandatool/src/objprogs/
  5016. #
  5017. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5018. OPTS=['DIR:pandatool/src/objprogs']
  5019. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5020. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5021. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5022. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5023. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5024. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5025. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5026. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5027. #
  5028. # DIRECTORY: pandatool/src/palettizer/
  5029. #
  5030. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5031. OPTS=['DIR:pandatool/src/palettizer']
  5032. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5033. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5034. #
  5035. # DIRECTORY: pandatool/src/egg-mkfont/
  5036. #
  5037. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5038. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5039. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5040. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5041. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5042. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5043. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5044. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5045. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5046. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5047. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5048. #
  5049. # DIRECTORY: pandatool/src/eggcharbase/
  5050. #
  5051. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5052. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5053. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5054. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5055. #
  5056. # DIRECTORY: pandatool/src/egg-optchar/
  5057. #
  5058. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5059. OPTS=['DIR:pandatool/src/egg-optchar']
  5060. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5061. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5062. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5063. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5064. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5065. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5066. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5067. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5068. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5069. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5070. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5071. #
  5072. # DIRECTORY: pandatool/src/egg-palettize/
  5073. #
  5074. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5075. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5076. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5077. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5078. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5079. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5080. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5081. #
  5082. # DIRECTORY: pandatool/src/egg-qtess/
  5083. #
  5084. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5085. OPTS=['DIR:pandatool/src/egg-qtess']
  5086. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5087. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5088. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5089. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5090. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5091. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5092. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5093. #
  5094. # DIRECTORY: pandatool/src/eggprogs/
  5095. #
  5096. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5097. OPTS=['DIR:pandatool/src/eggprogs']
  5098. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5099. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5100. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5101. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5102. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5103. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5104. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5105. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5106. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5107. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5108. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5109. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5110. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5111. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5112. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5113. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5114. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5115. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5116. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5117. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5118. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5119. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5120. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5121. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5122. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5123. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5124. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5125. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5126. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5127. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5128. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5129. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5130. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5131. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5132. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5133. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5134. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5135. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5136. #
  5137. # DIRECTORY: pandatool/src/flt/
  5138. #
  5139. if not PkgSkip("PANDATOOL"):
  5140. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5141. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5142. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5143. #
  5144. # DIRECTORY: pandatool/src/fltegg/
  5145. #
  5146. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5147. OPTS=['DIR:pandatool/src/fltegg']
  5148. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5149. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5150. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5151. #
  5152. # DIRECTORY: pandatool/src/fltprogs/
  5153. #
  5154. if not PkgSkip("PANDATOOL"):
  5155. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5156. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5157. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5158. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5159. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5160. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5161. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5162. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5163. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5164. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5165. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5166. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5167. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5168. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5169. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5170. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5171. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5172. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5173. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5174. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5175. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5176. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5177. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5178. if not PkgSkip("EGG"):
  5179. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5180. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5181. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5182. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5183. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5184. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5185. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5186. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5187. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5188. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5189. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5190. #
  5191. # DIRECTORY: pandatool/src/imagebase/
  5192. #
  5193. if not PkgSkip("PANDATOOL"):
  5194. OPTS=['DIR:pandatool/src/imagebase']
  5195. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5196. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5197. #
  5198. # DIRECTORY: pandatool/src/imageprogs/
  5199. #
  5200. if not PkgSkip("PANDATOOL"):
  5201. OPTS=['DIR:pandatool/src/imageprogs']
  5202. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5203. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5204. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5205. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5206. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5207. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5208. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5209. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5210. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5211. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5212. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5213. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5214. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5215. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5216. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5217. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5218. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5219. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5220. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5221. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5222. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5223. #
  5224. # DIRECTORY: pandatool/src/pfmprogs/
  5225. #
  5226. if not PkgSkip("PANDATOOL"):
  5227. OPTS=['DIR:pandatool/src/pfmprogs']
  5228. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5229. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5230. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5231. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5232. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5233. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5234. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5235. TargetAdd('pfm-bba_config_pfm.obj', opts=OPTS, input='config_pfm.cxx')
  5236. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5237. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfm.obj')
  5238. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5239. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5240. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5241. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5242. #
  5243. # DIRECTORY: pandatool/src/lwo/
  5244. #
  5245. if not PkgSkip("PANDATOOL"):
  5246. OPTS=['DIR:pandatool/src/lwo']
  5247. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5248. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5249. #
  5250. # DIRECTORY: pandatool/src/lwoegg/
  5251. #
  5252. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5253. OPTS=['DIR:pandatool/src/lwoegg']
  5254. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5255. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5256. #
  5257. # DIRECTORY: pandatool/src/lwoprogs/
  5258. #
  5259. if not PkgSkip("PANDATOOL"):
  5260. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5261. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5262. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5263. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5264. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5265. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5266. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5267. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5268. if not PkgSkip("EGG"):
  5269. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5270. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5271. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5272. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5273. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5274. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5275. #
  5276. # DIRECTORY: pandatool/src/maya/
  5277. #
  5278. for VER in MAYAVERSIONS:
  5279. VNUM=VER[4:]
  5280. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5281. OPTS=['DIR:pandatool/src/maya', VER]
  5282. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5283. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5284. #
  5285. # DIRECTORY: pandatool/src/mayaegg/
  5286. #
  5287. for VER in MAYAVERSIONS:
  5288. VNUM=VER[4:]
  5289. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5290. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5291. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5292. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5293. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5294. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5295. #
  5296. # DIRECTORY: pandatool/src/maxegg/
  5297. #
  5298. for VER in MAXVERSIONS:
  5299. VNUM=VER[3:]
  5300. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5301. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5302. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5303. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5304. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5305. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5306. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5307. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5308. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5309. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5310. #
  5311. # DIRECTORY: pandatool/src/maxprogs/
  5312. #
  5313. for VER in MAXVERSIONS:
  5314. VNUM=VER[3:]
  5315. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5316. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5317. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5318. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5319. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5320. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5321. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5322. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5323. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5324. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5325. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5326. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5327. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5328. #
  5329. # DIRECTORY: pandatool/src/vrml/
  5330. #
  5331. if not PkgSkip("PANDATOOL"):
  5332. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5333. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5334. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5335. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5336. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5337. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5338. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5339. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5340. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5341. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5342. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5343. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5344. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5345. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5346. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5347. #
  5348. # DIRECTORY: pandatool/src/vrmlegg/
  5349. #
  5350. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5351. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5352. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5353. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5354. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5355. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5356. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5357. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5358. #
  5359. # DIRECTORY: pandatool/src/xfile/
  5360. #
  5361. if not PkgSkip("PANDATOOL"):
  5362. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5363. CreateFile(GetOutputDir()+"/include/xParser.h")
  5364. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5365. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5366. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5367. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5368. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5369. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5370. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5371. #
  5372. # DIRECTORY: pandatool/src/xfileegg/
  5373. #
  5374. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5375. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5376. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5377. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5378. #
  5379. # DIRECTORY: pandatool/src/ptloader/
  5380. #
  5381. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5382. if not PkgSkip("FCOLLADA"):
  5383. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5384. 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']
  5385. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5386. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5387. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5388. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5389. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5390. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5391. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5392. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5393. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5394. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5395. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5396. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5397. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5398. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5399. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5400. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5401. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5402. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5403. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5404. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5405. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5406. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5407. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5408. #
  5409. # DIRECTORY: pandatool/src/miscprogs/
  5410. #
  5411. # This is a bit of an esoteric tool, and it causes issues because
  5412. # it conflicts with tools of the same name in different packages.
  5413. #if (PkgSkip("PANDATOOL")==0):
  5414. # OPTS=['DIR:pandatool/src/miscprogs']
  5415. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5416. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5417. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5418. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5419. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5420. # TargetAdd('bin2c.exe', input='libp3pystub.lib')
  5421. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5422. #
  5423. # DIRECTORY: pandatool/src/pstatserver/
  5424. #
  5425. if (PkgSkip("PANDATOOL")==0):
  5426. OPTS=['DIR:pandatool/src/pstatserver']
  5427. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5428. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5429. #
  5430. # DIRECTORY: pandatool/src/softprogs/
  5431. #
  5432. if (PkgSkip("PANDATOOL")==0):
  5433. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  5434. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  5435. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  5436. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  5437. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  5438. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  5439. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  5440. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  5441. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  5442. #
  5443. # DIRECTORY: pandatool/src/text-stats/
  5444. #
  5445. if (PkgSkip("PANDATOOL")==0):
  5446. OPTS=['DIR:pandatool/src/text-stats']
  5447. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5448. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5449. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5450. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5451. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5452. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5453. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5454. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5455. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5456. #
  5457. # DIRECTORY: pandatool/src/vrmlprogs/
  5458. #
  5459. if not PkgSkip("PANDATOOL"):
  5460. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5461. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5462. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5463. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5464. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5465. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5466. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5467. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5468. if not PkgSkip("EGG"):
  5469. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5470. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5471. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5472. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5473. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5474. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5475. #
  5476. # DIRECTORY: pandatool/src/win-stats/
  5477. # DIRECTORY: pandatool/src/gtk-stats/
  5478. #
  5479. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5480. if GetTarget() == 'windows':
  5481. OPTS=['DIR:pandatool/src/win-stats']
  5482. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5483. else:
  5484. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5485. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5486. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5487. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5488. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5489. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5490. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5491. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5492. #
  5493. # DIRECTORY: pandatool/src/xfileprogs/
  5494. #
  5495. if not PkgSkip("PANDATOOL"):
  5496. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5497. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5498. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5499. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5500. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5501. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5502. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5503. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5504. if not PkgSkip("EGG"):
  5505. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5506. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5507. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5508. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5509. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5510. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5511. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5512. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5513. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5514. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5515. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5516. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5517. #
  5518. # DIRECTORY: pandatool/src/mayaprogs/
  5519. #
  5520. for VER in MAYAVERSIONS:
  5521. VNUM = VER[4:]
  5522. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5523. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5524. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5525. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5526. continue
  5527. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5528. ARCH_OPTS = ['NOARCH:PPC']
  5529. else:
  5530. ARCH_OPTS = []
  5531. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5532. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5533. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5534. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5535. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5536. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5537. #if GetTarget() == 'windows':
  5538. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5539. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5540. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5541. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5542. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5543. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5544. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5545. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5546. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5547. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5548. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5549. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5550. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5551. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5552. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5553. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5554. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5555. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5556. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5557. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5558. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5559. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5560. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5561. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5562. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5563. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5564. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5565. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5566. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5567. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5568. if GetTarget() == 'windows':
  5569. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5570. else:
  5571. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5572. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5573. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5574. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5575. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5576. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5577. if GetTarget() == 'windows':
  5578. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5579. else:
  5580. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5581. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5582. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5583. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5584. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5585. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5586. if GetTarget() == 'windows':
  5587. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5588. else:
  5589. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5590. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5591. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5592. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5593. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5594. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5595. if GetTarget() == 'windows':
  5596. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5597. else:
  5598. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5599. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5600. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5601. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5602. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5603. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5604. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5605. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5606. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5607. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5608. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5609. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5610. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5611. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5612. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5613. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5614. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5615. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5616. #
  5617. # DIRECTORY: contrib/src/ai/
  5618. #
  5619. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5620. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5621. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5622. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5623. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5624. OPTS=['DIR:contrib/src/ai', 'PYTHON']
  5625. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5626. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5627. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5628. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  5629. TargetAdd('ai_module.obj', input='libpandaai.in')
  5630. TargetAdd('ai_module.obj', opts=OPTS)
  5631. TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5632. TargetAdd('ai.pyd', input='ai_module.obj')
  5633. TargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5634. TargetAdd('ai.pyd', input='libpandaai.dll')
  5635. TargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5636. TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5637. TargetAdd('ai.pyd', opts=['PYTHON'])
  5638. #
  5639. # Generate the models directory and samples directory
  5640. #
  5641. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5642. model_extensions = ["*.egg"]
  5643. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5644. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5645. model_extensions.append("*.flt")
  5646. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5647. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5648. newname = model[:-4] + ".egg.pz"
  5649. else:
  5650. newname = model[:-4] + ".egg"
  5651. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5652. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5653. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5654. newname = model[:-4] + ".egg.pz"
  5655. else:
  5656. newname = model[:-4] + ".egg"
  5657. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5658. for model in GetDirectoryContents("models", model_extensions):
  5659. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5660. newname = model[:-4] + ".egg.pz"
  5661. else:
  5662. newname = model[:-4] + ".egg"
  5663. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5664. if not PkgSkip("DIRECT") and not RUNTIME:
  5665. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5666. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5667. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5668. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5669. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5670. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5671. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5672. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5673. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5674. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5675. #
  5676. # Build the rtdist.
  5677. #
  5678. if (RTDIST):
  5679. OPTS=['DIR:direct/src/p3d']
  5680. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5681. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5682. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5683. #
  5684. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5685. #
  5686. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5687. OPTS=['DIR:direct/src/p3d']
  5688. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5689. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5690. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5691. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5692. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5693. ##########################################################################################
  5694. #
  5695. # Dependency-Based Distributed Build System.
  5696. #
  5697. ##########################################################################################
  5698. DEPENDENCYQUEUE=[]
  5699. for target in TARGET_LIST:
  5700. name = target.name
  5701. inputs = target.inputs
  5702. opts = target.opts
  5703. deps = target.deps
  5704. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5705. def BuildWorker(taskqueue, donequeue):
  5706. while True:
  5707. try:
  5708. task = taskqueue.get(timeout=1)
  5709. except:
  5710. ProgressOutput(None, "Waiting for tasks...")
  5711. task = taskqueue.get()
  5712. sys.stdout.flush()
  5713. if (task == 0): return
  5714. try:
  5715. task[0](*task[1])
  5716. donequeue.put(task)
  5717. except:
  5718. donequeue.put(0)
  5719. def AllSourcesReady(task, pending):
  5720. sources = task[3]
  5721. for x in sources:
  5722. if (x in pending):
  5723. return 0
  5724. sources = task[1][1]
  5725. for x in sources:
  5726. if (x in pending):
  5727. return 0
  5728. altsources = task[4]
  5729. for x in altsources:
  5730. if (x in pending):
  5731. return 0
  5732. return 1
  5733. def ParallelMake(tasklist):
  5734. # Create the communication queues.
  5735. donequeue = queue.Queue()
  5736. taskqueue = queue.Queue()
  5737. # Build up a table listing all the pending targets
  5738. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5739. # task[2] = [name]
  5740. # task[3] = deps
  5741. # The python tool package, in particular fltegg seems to throw parallelmake off
  5742. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5743. # and another subpart to be built sequentially. The most time consuming part of the process
  5744. # is the c++ code generation anyways.
  5745. tasklist_seq = []
  5746. i = 0
  5747. while i < len(tasklist):
  5748. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5749. break
  5750. i += 1
  5751. if i < len(tasklist):
  5752. tasklist_seq = tasklist[i:]
  5753. tasklist = tasklist[:i]
  5754. iNumStartingTasks = len(tasklist)
  5755. pending = {}
  5756. for task in tasklist:
  5757. for target in task[2]:
  5758. pending[target] = 1
  5759. # Create the workers
  5760. for slave in range(THREADCOUNT):
  5761. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5762. th.setDaemon(1)
  5763. th.start()
  5764. # Feed tasks to the workers.
  5765. tasksqueued = 0
  5766. while True:
  5767. if (tasksqueued < THREADCOUNT):
  5768. extras = []
  5769. for task in tasklist:
  5770. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5771. if (NeedsBuild(task[2], task[3])):
  5772. tasksqueued += 1
  5773. taskqueue.put(task)
  5774. else:
  5775. for target in task[2]:
  5776. del pending[target]
  5777. else:
  5778. extras.append(task)
  5779. tasklist = extras
  5780. sys.stdout.flush()
  5781. if (tasksqueued == 0): break
  5782. donetask = donequeue.get()
  5783. if (donetask == 0):
  5784. exit("Build process aborting.")
  5785. sys.stdout.flush()
  5786. tasksqueued -= 1
  5787. JustBuilt(donetask[2], donetask[3])
  5788. for target in donetask[2]:
  5789. del pending[target]
  5790. # Kill the workers.
  5791. for slave in range(THREADCOUNT):
  5792. taskqueue.put(0)
  5793. # Make sure there aren't any unsatisfied tasks
  5794. if len(tasklist) > 0:
  5795. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5796. SequentialMake(tasklist_seq)
  5797. def SequentialMake(tasklist):
  5798. i = 0
  5799. for task in tasklist:
  5800. if (NeedsBuild(task[2], task[3])):
  5801. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5802. JustBuilt(task[2], task[3])
  5803. i += 1
  5804. def RunDependencyQueue(tasklist):
  5805. if (THREADCOUNT!=0):
  5806. ParallelMake(tasklist)
  5807. else:
  5808. SequentialMake(tasklist)
  5809. try:
  5810. RunDependencyQueue(DEPENDENCYQUEUE)
  5811. except:
  5812. SaveDependencyCache()
  5813. raise
  5814. # Run the test suite.
  5815. if RUNTESTS:
  5816. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  5817. if sys.version_info >= (2, 6):
  5818. cmdstr += " -B"
  5819. cmdstr += " -m pytest tests"
  5820. if GetVerbose():
  5821. cmdstr += " --verbose"
  5822. oscmd(cmdstr)
  5823. ##########################################################################################
  5824. #
  5825. # The Installers
  5826. #
  5827. # Under windows, we can build an 'exe' package using NSIS
  5828. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5829. # Under OSX, we can make a 'dmg' package.
  5830. #
  5831. ##########################################################################################
  5832. def MakeInstallerNSIS(file, title, installdir):
  5833. if (os.path.isfile(file)):
  5834. os.remove(file)
  5835. elif (os.path.isdir(file)):
  5836. shutil.rmtree(file)
  5837. if GetTargetArch() == 'x64':
  5838. regview = '64'
  5839. else:
  5840. regview = '32'
  5841. if (RUNTIME):
  5842. # Invoke the make_installer script.
  5843. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  5844. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  5845. cmd = sys.executable + " -B -u " + os.path.join("direct", "src", "plugin_installer", "make_installer.py")
  5846. cmd += " --version %s --regview %s" % (VERSION, regview)
  5847. if GetTargetArch() == 'x64':
  5848. cmd += " --install \"$PROGRAMFILES64\\Panda3D\" "
  5849. else:
  5850. cmd += " --install \"$PROGRAMFILES32\\Panda3D\" "
  5851. oscmd(cmd)
  5852. shutil.move(os.path.join("direct", "src", "plugin_installer", "p3d-setup.exe"), file)
  5853. return
  5854. print("Building "+title+" installer at %s" % (file))
  5855. if (COMPRESSOR != "lzma"):
  5856. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  5857. if (os.path.exists("nsis-output.exe")):
  5858. os.remove("nsis-output.exe")
  5859. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  5860. nsis_defs = {
  5861. 'COMPRESSOR' : COMPRESSOR,
  5862. 'TITLE' : title,
  5863. 'INSTALLDIR' : installdir,
  5864. 'OUTFILE' : '..\\' + file,
  5865. 'BUILT' : '..\\' + GetOutputDir(),
  5866. 'SOURCE' : '..',
  5867. 'PYVER' : SDK["PYTHONVERSION"][6:9],
  5868. 'REGVIEW' : regview,
  5869. }
  5870. if GetHost() == 'windows':
  5871. cmd = os.path.join(GetThirdpartyBase(), 'win-nsis', 'makensis') + ' /V2'
  5872. for item in nsis_defs.items():
  5873. cmd += ' /D%s="%s"' % item
  5874. else:
  5875. cmd = 'makensis -V2'
  5876. for item in nsis_defs.items():
  5877. cmd += ' -D%s="%s"' % item
  5878. cmd += ' "makepanda\installer.nsi"'
  5879. oscmd(cmd)
  5880. def MakeDebugSymbolArchive(zipname, dirname):
  5881. import zipfile
  5882. zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)
  5883. for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')):
  5884. zip.write(fn, dirname + '/bin/' + os.path.basename(fn))
  5885. for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')):
  5886. zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn))
  5887. for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')):
  5888. zip.write(fn, dirname + '/plugins/' + os.path.basename(fn))
  5889. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')):
  5890. zip.write(fn, dirname + '/python/' + os.path.basename(fn))
  5891. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')):
  5892. zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn))
  5893. zip.close()
  5894. INSTALLER_DEB_FILE="""
  5895. Package: panda3dMAJOR
  5896. Version: VERSION
  5897. Section: libdevel
  5898. Priority: optional
  5899. Architecture: ARCH
  5900. Essential: no
  5901. Depends: DEPENDS
  5902. Recommends: RECOMMENDS
  5903. Suggests: panda3d-runtime
  5904. Provides: panda3d
  5905. Conflicts: panda3d
  5906. Replaces: panda3d
  5907. Maintainer: rdb <[email protected]>
  5908. Installed-Size: INSTSIZE
  5909. Description: Panda3D free 3D engine SDK
  5910. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
  5911. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
  5912. .
  5913. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5914. """
  5915. RUNTIME_INSTALLER_DEB_FILE="""
  5916. Package: panda3d-runtime
  5917. Version: VERSION
  5918. Section: web
  5919. Priority: optional
  5920. Architecture: ARCH
  5921. Essential: no
  5922. Depends: DEPENDS
  5923. Provides: panda3d-runtime
  5924. Maintainer: rdb <[email protected]>
  5925. Installed-Size: INSTSIZE
  5926. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  5927. This package contains the runtime distribution and browser plugin of the Panda3D engine. It allows you view webpages that contain Panda3D content and to run games created with Panda3D that are packaged as .p3d file.
  5928. """
  5929. # We're not putting "python" in the "Requires" field,
  5930. # since the rpm-based distros don't have a common
  5931. # naming for the Python package.
  5932. INSTALLER_SPEC_FILE="""
  5933. Summary: The Panda3D free 3D engine SDK
  5934. Name: panda3d
  5935. Version: VERSION
  5936. Release: RPMRELEASE
  5937. License: BSD License
  5938. Group: Development/Libraries
  5939. BuildRoot: PANDASOURCE/targetroot
  5940. %description
  5941. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
  5942. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
  5943. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5944. %post
  5945. /sbin/ldconfig
  5946. %postun
  5947. /sbin/ldconfig
  5948. %files
  5949. %defattr(-,root,root)
  5950. /etc/Confauto.prc
  5951. /etc/Config.prc
  5952. /usr/share/panda3d
  5953. /usr/share/mime-info/panda3d.mime
  5954. /usr/share/mime-info/panda3d.keys
  5955. /usr/share/mime/packages/panda3d.xml
  5956. /usr/share/application-registry/panda3d.applications
  5957. /usr/share/applications/*.desktop
  5958. /etc/ld.so.conf.d/panda3d.conf
  5959. /usr/%_lib/panda3d
  5960. """ + PYTHON_SITEPACKAGES + """
  5961. /usr/include/panda3d
  5962. """
  5963. RUNTIME_INSTALLER_SPEC_FILE="""
  5964. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  5965. Name: panda3d-runtime
  5966. Version: VERSION
  5967. Release: RPMRELEASE
  5968. License: BSD License
  5969. Group: Productivity/Graphics/Other
  5970. BuildRoot: PANDASOURCE/targetroot
  5971. %description
  5972. This package contains the runtime distribution and browser plugin of the Panda3D engine. It allows you view webpages that contain Panda3D content and to run games created with Panda3D that are packaged as .p3d file.
  5973. %files
  5974. %defattr(-,root,root)
  5975. /usr/bin/panda3d
  5976. /usr/%_lib/nppanda3d.so
  5977. /usr/%_lib/mozilla/plugins/nppanda3d.so
  5978. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  5979. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  5980. /usr/share/mime-info/panda3d-runtime.mime
  5981. /usr/share/mime-info/panda3d-runtime.keys
  5982. /usr/share/mime/packages/panda3d-runtime.xml
  5983. /usr/share/application-registry/panda3d-runtime.applications
  5984. /usr/share/applications/*.desktop
  5985. """
  5986. # plist file for Mac OSX
  5987. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  5988. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  5989. <plist version="1.0">
  5990. <dict>
  5991. <key>CFBundleIdentifier</key>
  5992. <string>%(package_id)s</string>
  5993. <key>CFBundleShortVersionString</key>
  5994. <string>%(version)s</string>
  5995. <key>IFPkgFlagRelocatable</key>
  5996. <false/>
  5997. <key>IFPkgFlagAuthorizationAction</key>
  5998. <string>RootAuthorization</string>
  5999. <key>IFPkgFlagAllowBackRev</key>
  6000. <true/>
  6001. </dict>
  6002. </plist>
  6003. """
  6004. # FreeBSD pkg-descr
  6005. INSTALLER_PKG_DESCR_FILE = """
  6006. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
  6007. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
  6008. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  6009. WWW: https://www.panda3d.org/
  6010. """
  6011. # FreeBSD pkg-descr
  6012. RUNTIME_INSTALLER_PKG_DESCR_FILE = """
  6013. Runtime binary and browser plugin for the Panda3D Game Engine
  6014. This package contains the runtime distribution and browser plugin of the Panda3D engine. It allows you view webpages that contain Panda3D content and to run games created with Panda3D that are packaged as .p3d file.
  6015. WWW: https://www.panda3d.org/
  6016. """
  6017. # FreeBSD PKG Manifest template file
  6018. INSTALLER_PKG_MANIFEST_FILE = """
  6019. name: NAME
  6020. version: VERSION
  6021. arch: ARCH
  6022. origin: ORIGIN
  6023. comment: "Panda3D free 3D engine SDK"
  6024. www: https://www.panda3d.org
  6025. maintainer: rdb <[email protected]>
  6026. prefix: /usr/local
  6027. flatsize: INSTSIZEMB
  6028. deps: {DEPENDS}
  6029. """
  6030. def MakeInstallerLinux():
  6031. if not RUNTIME and not PkgSkip("PYTHON"):
  6032. PYTHONV = SDK["PYTHONVERSION"].rstrip('dmu')
  6033. else:
  6034. PYTHONV = "python"
  6035. PV = PYTHONV.replace("python", "")
  6036. # Clean and set up a directory to install Panda3D into
  6037. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  6038. oscmd("mkdir --mode=0755 targetroot")
  6039. dpkg_present = False
  6040. if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"):
  6041. dpkg_present = True
  6042. rpmbuild_present = False
  6043. if os.path.exists("/usr/bin/rpmbuild"):
  6044. rpmbuild_present = True
  6045. if dpkg_present and rpmbuild_present:
  6046. print("Warning: both dpkg and rpmbuild present.")
  6047. if dpkg_present:
  6048. # Invoke installpanda.py to install it into a temporary dir
  6049. lib_dir = GetDebLibDir()
  6050. if RUNTIME:
  6051. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6052. else:
  6053. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6054. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6055. oscmd("mkdir -p targetroot/usr/share/man/man1")
  6056. oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/")
  6057. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  6058. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6059. if (RUNTIME):
  6060. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  6061. else:
  6062. txt = INSTALLER_DEB_FILE[1:]
  6063. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  6064. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  6065. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  6066. oscmd("cd targetroot && (find usr -type f -exec md5sum {} ;) > DEBIAN/md5sums")
  6067. if (not RUNTIME):
  6068. oscmd("cd targetroot && (find etc -type f -exec md5sum {} ;) >> DEBIAN/md5sums")
  6069. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  6070. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  6071. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  6072. # Determine the package name and the locations that
  6073. # dpkg-shlibdeps should look in for executables.
  6074. pkg_version = DEBVERSION
  6075. if RUNTIME:
  6076. pkg_name = "panda3d-runtime"
  6077. lib_pattern = "debian/%s/usr/%s/*.so" % (pkg_name, lib_dir)
  6078. else:
  6079. pkg_name = "panda3d" + MAJOR_VERSION
  6080. lib_pattern = "debian/%s/usr/%s/panda3d/*.so*" % (pkg_name, lib_dir)
  6081. bin_pattern = "debian/%s/usr/bin/*" % (pkg_name)
  6082. # dpkg-shlibdeps looks in the debian/{pkg_name}/DEBIAN/shlibs directory
  6083. # and also expects a debian/control file, so we create this dummy set-up.
  6084. oscmd("mkdir targetroot/debian")
  6085. oscmd("ln -s .. targetroot/debian/" + pkg_name)
  6086. WriteFile("targetroot/debian/control", "")
  6087. dpkg_shlibdeps = "dpkg-shlibdeps"
  6088. if GetVerbose():
  6089. dpkg_shlibdeps += " -v"
  6090. if RUNTIME:
  6091. # The runtime doesn't export any useful symbols, so just query the dependencies.
  6092. oscmd("cd targetroot && %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals())
  6093. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  6094. recommends = ""
  6095. else:
  6096. pkg_name = "panda3d" + MAJOR_VERSION
  6097. pkg_dir = "debian/panda3d" + MAJOR_VERSION
  6098. # Generate a symbols file so that other packages can know which symbols we export.
  6099. oscmd("cd targetroot && dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals())
  6100. # Library dependencies are required, binary dependencies are recommended.
  6101. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX.
  6102. oscmd("cd targetroot && LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_dep --ignore-missing-info -x%(pkg_name)s -xlibphysx-extras %(lib_pattern)s" % locals())
  6103. oscmd("cd targetroot && LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_rec --ignore-missing-info -x%(pkg_name)s %(bin_pattern)s" % locals())
  6104. # Parse the substvars files generated by dpkg-shlibdeps.
  6105. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  6106. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  6107. if PkgSkip("PYTHON")==0:
  6108. depends += ", " + PYTHONV
  6109. recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")"
  6110. if PkgSkip("NVIDIACG")==0:
  6111. depends += ", nvidia-cg-toolkit"
  6112. # Write back the dependencies, and delete the dummy set-up.
  6113. txt = txt.replace("DEPENDS", depends.strip(', '))
  6114. txt = txt.replace("RECOMMENDS", recommends.strip(', '))
  6115. WriteFile("targetroot/DEBIAN/control", txt)
  6116. oscmd("rm -rf targetroot/debian")
  6117. # Package it all up into a .deb file.
  6118. oscmd("chmod -R 755 targetroot/DEBIAN")
  6119. oscmd("chmod 644 targetroot/DEBIAN/control targetroot/DEBIAN/md5sums")
  6120. if not RUNTIME:
  6121. oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols")
  6122. oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch))
  6123. elif rpmbuild_present:
  6124. # Invoke installpanda.py to install it into a temporary dir
  6125. if RUNTIME:
  6126. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6127. else:
  6128. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6129. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6130. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  6131. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6132. pandasource = os.path.abspath(os.getcwd())
  6133. if RUNTIME:
  6134. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  6135. else:
  6136. txt = INSTALLER_SPEC_FILE[1:]
  6137. # Add the binaries in /usr/bin explicitly to the spec file
  6138. for base in os.listdir(GetOutputDir() + "/bin"):
  6139. txt += "/usr/bin/%s\n" % (base)
  6140. # Write out the spec file.
  6141. txt = txt.replace("VERSION", VERSION)
  6142. txt = txt.replace("RPMRELEASE", RPMRELEASE)
  6143. txt = txt.replace("PANDASOURCE", pandasource)
  6144. txt = txt.replace("PV", PV)
  6145. WriteFile("panda3d.spec", txt)
  6146. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  6147. if (RUNTIME):
  6148. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6149. else:
  6150. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6151. oscmd("rm -rf "+ARCH, True)
  6152. else:
  6153. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  6154. def MakeInstallerOSX():
  6155. if (RUNTIME):
  6156. # Invoke the make_installer script.
  6157. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  6158. cmdstr = sys.executable + " "
  6159. if sys.version_info >= (2, 6):
  6160. cmdstr += "-B "
  6161. cmdstr += "direct/src/plugin_installer/make_installer.py --version %s" % VERSION
  6162. oscmd(cmdstr)
  6163. return
  6164. dmg_name = "Panda3D-" + VERSION
  6165. if not SDK["PYTHONVERSION"].startswith("python2."):
  6166. dmg_name += '-py' + SDK["PYTHONVERSION"][6:9]
  6167. dmg_name += ".dmg"
  6168. import compileall
  6169. if (os.path.isfile(dmg_name)): oscmd("rm -f %s" % dmg_name)
  6170. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  6171. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  6172. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  6173. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  6174. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  6175. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  6176. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  6177. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  6178. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  6179. oscmd("cp -R %s/Frameworks dstroot/base/Developer/Panda3D/Frameworks" % GetOutputDir())
  6180. if os.path.isdir(GetOutputDir()+"/plugins"):
  6181. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  6182. # Libraries that shouldn't be in base, but are instead in other modules.
  6183. no_base_libs = ['libp3ffmpeg', 'libp3fmod_audio', 'libfmodex', 'libfmodexL']
  6184. for base in os.listdir(GetOutputDir()+"/lib"):
  6185. if not base.endswith(".a") and base.split('.')[0] not in no_base_libs:
  6186. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  6187. # We really need to specify -R in order not to follow symlinks
  6188. # On OSX, just specifying -P is not enough to do that.
  6189. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  6190. oscmd("mkdir -p dstroot/tools/Developer/Panda3D/bin")
  6191. oscmd("mkdir -p dstroot/tools/Developer/Tools")
  6192. oscmd("ln -s ../Panda3D/bin dstroot/tools/Developer/Tools/Panda3D")
  6193. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  6194. # Trailing newline is important, works around a bug in OSX
  6195. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Panda3D/bin\n")
  6196. oscmd("mkdir -p dstroot/tools/usr/local/share/man/man1")
  6197. oscmd("cp doc/man/*.1 dstroot/tools/usr/local/share/man/man1/")
  6198. for base in os.listdir(GetOutputDir()+"/bin"):
  6199. binname = "dstroot/tools/Developer/Panda3D/bin/" + base
  6200. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  6201. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  6202. if PkgSkip("PYTHON")==0:
  6203. PV = SDK["PYTHONVERSION"][6:9]
  6204. oscmd("mkdir -p dstroot/pythoncode/usr/local/bin")
  6205. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/panda3d")
  6206. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  6207. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D")
  6208. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/pandac" % GetOutputDir())
  6209. oscmd("cp -R %s/direct dstroot/pythoncode/Developer/Panda3D/direct" % GetOutputDir())
  6210. oscmd("ln -s %s dstroot/pythoncode/usr/local/bin/ppython" % SDK["PYTHONEXEC"])
  6211. oscmd("cp -R %s/*.so dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6212. oscmd("cp -R %s/*.py dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6213. if os.path.isdir(GetOutputDir()+"/Pmw"):
  6214. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/Pmw" % GetOutputDir())
  6215. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/Pmw")
  6216. WriteFile("dstroot/pythoncode/Developer/Panda3D/direct/__init__.py", "")
  6217. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/direct"):
  6218. if ((base != "extensions") and (base != "extensions_native")):
  6219. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/direct/"+base)
  6220. for base in os.listdir(GetOutputDir()+"/panda3d"):
  6221. if base.endswith('.py') or base.endswith('.so'):
  6222. libname = "dstroot/pythoncode/Developer/Panda3D/panda3d/" + base
  6223. # We really need to specify -R in order not to follow symlinks
  6224. # On OSX, just specifying -P is not enough to do that.
  6225. oscmd("cp -R -P " + GetOutputDir() + "/panda3d/" + base + " " + libname)
  6226. if not PkgSkip("FFMPEG"):
  6227. oscmd("mkdir -p dstroot/ffmpeg/Developer/Panda3D/lib")
  6228. oscmd("cp -R %s/lib/libp3ffmpeg.* dstroot/ffmpeg/Developer/Panda3D/lib/" % GetOutputDir())
  6229. #if not PkgSkip("OPENAL"):
  6230. # oscmd("mkdir -p dstroot/openal/Developer/Panda3D/lib")
  6231. # oscmd("cp -R %s/lib/libp3openal_audio.* dstroot/openal/Developer/Panda3D/lib/" % GetOutputDir())
  6232. if not PkgSkip("FMODEX"):
  6233. oscmd("mkdir -p dstroot/fmodex/Developer/Panda3D/lib")
  6234. oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6235. oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6236. oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib")
  6237. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  6238. if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"):
  6239. oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir())
  6240. if os.path.isdir("samples"):
  6241. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  6242. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  6243. oscmd("chmod -R 0775 dstroot/*")
  6244. DeleteVCS("dstroot")
  6245. DeleteBuildFiles("dstroot")
  6246. # We need to be root to perform a chown. Bleh.
  6247. # Fortunately PackageMaker does it for us, on 10.5 and above.
  6248. #oscmd("chown -R root:admin dstroot/*", True)
  6249. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  6250. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  6251. pkgs = ["base", "tools", "headers"]
  6252. if not PkgSkip("PYTHON"): pkgs.append("pythoncode")
  6253. if not PkgSkip("FFMPEG"): pkgs.append("ffmpeg")
  6254. #if not PkgSkip("OPENAL"): pkgs.append("openal")
  6255. if not PkgSkip("FMODEX"): pkgs.append("fmodex")
  6256. if os.path.isdir("samples"): pkgs.append("samples")
  6257. for pkg in pkgs:
  6258. identifier = "org.panda3d.panda3d.%s.pkg" % pkg
  6259. plist = open("/tmp/Info_plist", "w")
  6260. plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION })
  6261. plist.close()
  6262. if not os.path.isdir("dstroot/" + pkg):
  6263. os.makedirs("dstroot/" + pkg)
  6264. if OSXTARGET and OSXTARGET <= (10, 5):
  6265. target = '--target %d.%d' % (OSXTARGET)
  6266. else:
  6267. target = ''
  6268. if os.path.exists("/usr/bin/pkgbuild"):
  6269. # This new package builder is used in Lion and above.
  6270. cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg'
  6271. # In older versions, we use PackageMaker. Apple keeps changing its location.
  6272. elif os.path.exists("/Developer/usr/bin/packagemaker"):
  6273. cmd = '/Developer/usr/bin/packagemaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6274. elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6275. cmd = '/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6276. elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6277. cmd = '/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6278. elif os.path.exists("/Developer/Tools/packagemaker"):
  6279. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  6280. elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6281. cmd = '/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6282. else:
  6283. exit("Neither pkgbuild nor PackageMaker could be found!")
  6284. oscmd(cmd)
  6285. if os.path.isfile("/tmp/Info_plist"):
  6286. oscmd("rm -f /tmp/Info_plist")
  6287. # Now that we've built all of the individual packages, build the metapackage.
  6288. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  6289. dist.write('<?xml version="1.0" encoding="utf-8"?>\n')
  6290. dist.write('<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">\n')
  6291. dist.write(' <title>Panda3D SDK %s</title>\n' % (VERSION))
  6292. dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>\n')
  6293. dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
  6294. dist.write(' <choices-outline>\n')
  6295. for pkg in pkgs:
  6296. dist.write(' <line choice="%s"/>\n' % (pkg))
  6297. dist.write(' </choices-outline>\n')
  6298. dist.write(' <choice id="base" title="Panda3D Base Installation" description="This package contains the Panda3D libraries, configuration files and models/textures that are needed to use Panda3D. Location: /Developer/Panda3D/" start_enabled="false">\n')
  6299. dist.write(' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>\n')
  6300. dist.write(' </choice>\n')
  6301. dist.write(' <choice id="tools" title="Tools" tooltip="Useful tools and model converters to help with Panda3D development" description="This package contains the various utilities that ship with Panda3D, including packaging tools, model converters, and many more. Location: /Developer/Panda3D/bin/">\n')
  6302. dist.write(' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>\n')
  6303. dist.write(' </choice>\n')
  6304. if not PkgSkip("PYTHON"):
  6305. dist.write(' <choice id="pythoncode" title="Python Support" tooltip="Python bindings for the Panda3D libraries" description="This package contains the \'direct\', \'pandac\' and \'panda3d\' python packages that are needed to do Python development with Panda3D. Location: /Developer/Panda3D/">\n')
  6306. dist.write(' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>\n')
  6307. dist.write(' </choice>\n')
  6308. if not PkgSkip("FFMPEG"):
  6309. dist.write(' <choice id="ffmpeg" title="FFMpeg Plug-In" tooltip="FFMpeg video and audio decoding plug-in" description="This package contains the FFMpeg plug-in, which is used for decoding video and audio files with OpenAL.')
  6310. if PkgSkip("VORBIS") and PkgSkip("OPUS"):
  6311. dist.write(' It is not required for loading .wav files, which Panda3D can read out of the box.">\n')
  6312. elif PkgSkip("VORBIS"):
  6313. dist.write(' It is not required for loading .wav or .opus files, which Panda3D can read out of the box.">\n')
  6314. elif PkgSkip("OPUS"):
  6315. dist.write(' It is not required for loading .wav or .ogg files, which Panda3D can read out of the box.">\n')
  6316. else:
  6317. dist.write(' It is not required for loading .wav, .ogg or .opus files, which Panda3D can read out of the box.">\n')
  6318. dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
  6319. dist.write(' </choice>\n')
  6320. #if not PkgSkip("OPENAL"):
  6321. # dist.write(' <choice id="openal" title="OpenAL Audio Plug-In" tooltip="OpenAL audio output plug-in" description="This package contains the OpenAL audio plug-in, which is an open-source library for playing sounds.">\n')
  6322. # dist.write(' <pkg-ref id="org.panda3d.panda3d.openal.pkg"/>\n')
  6323. # dist.write(' </choice>\n')
  6324. if not PkgSkip("FMODEX"):
  6325. dist.write(' <choice id="fmodex" title="FMOD Ex Plug-In" tooltip="FMOD Ex audio output plug-in" description="This package contains the FMOD Ex audio plug-in, which is a commercial library for playing sounds. It is an optional component as Panda3D can use the open-source alternative OpenAL instead.">\n')
  6326. dist.write(' <pkg-ref id="org.panda3d.panda3d.fmodex.pkg"/>\n')
  6327. dist.write(' </choice>\n')
  6328. if os.path.isdir("samples"):
  6329. dist.write(' <choice id="samples" title="Sample Programs" tooltip="Python sample programs that use Panda3D" description="This package contains the Python sample programs that can help you with learning how to use Panda3D. Location: /Developer/Examples/Panda3D/">\n')
  6330. dist.write(' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>\n')
  6331. dist.write(' </choice>\n')
  6332. dist.write(' <choice id="headers" title="C++ Header Files" tooltip="Header files for C++ development with Panda3D" description="This package contains the C++ header files that are needed in order to do C++ development with Panda3D. You don\'t need this if you want to develop in Python. Location: /Developer/Panda3D/include/" start_selected="false">\n')
  6333. dist.write(' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>\n')
  6334. dist.write(' </choice>\n')
  6335. for pkg in pkgs:
  6336. size = GetDirectorySize("dstroot/" + pkg) // 1024
  6337. dist.write(' <pkg-ref id="org.panda3d.panda3d.%s.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/%s.pkg</pkg-ref>\n' % (pkg, size, pkg))
  6338. dist.write('</installer-script>\n')
  6339. dist.close()
  6340. oscmd('hdiutil create Panda3D-rw.dmg -volname "Panda3D SDK %s" -srcfolder dstroot/Panda3D' % (VERSION))
  6341. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o %s' % (dmg_name))
  6342. oscmd('rm -f Panda3D-rw.dmg')
  6343. def MakeInstallerFreeBSD():
  6344. oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
  6345. oscmd("mkdir targetroot")
  6346. # Invoke installpanda.py to install it into a temporary dir
  6347. if RUNTIME:
  6348. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6349. else:
  6350. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6351. if not os.path.exists("/usr/sbin/pkg"):
  6352. exit("Cannot create an installer without pkg")
  6353. plist_txt = ''
  6354. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  6355. for f in files:
  6356. plist_txt += os.path.join(root, f)[21:] + "\n"
  6357. if not RUNTIME:
  6358. plist_txt += "@postexec /sbin/ldconfig -m /usr/local/lib/panda3d\n"
  6359. plist_txt += "@postunexec /sbin/ldconfig -R\n"
  6360. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  6361. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  6362. for d in dirs:
  6363. plist_txt += "@dir %s\n" % os.path.join(root, d)[21:]
  6364. plist_txt += "@dir %s\n" % remdir
  6365. oscmd("echo \"`pkg config abi | tr '[:upper:]' '[:lower:]' | cut -d: -f1,2`:*\" > " + GetOutputDir() + "/tmp/architecture.txt")
  6366. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6367. dependencies = ''
  6368. if PkgSkip("PYTHON") == 0:
  6369. # If this version of Python was installed from a package or ports, let's mark it as dependency.
  6370. oscmd("rm -f %s/tmp/python_dep" % GetOutputDir())
  6371. oscmd("pkg query \"\n\t%%n : {\n\t\torigin : %%o,\n\t\tversion : %%v\n\t},\n\" python%s > %s/tmp/python_dep" % (SDK["PYTHONVERSION"][6:9:2], GetOutputDir()), True)
  6372. if os.path.isfile(GetOutputDir() + "/tmp/python_dep"):
  6373. python_pkg = ReadFile(GetOutputDir() + "/tmp/python_dep")
  6374. if python_pkg:
  6375. dependencies += python_pkg
  6376. manifest_txt = INSTALLER_PKG_MANIFEST_FILE[1:].replace("NAME", 'panda3d' if not RUNTIME else 'panda3d-runtime')
  6377. manifest_txt = manifest_txt.replace("VERSION", VERSION)
  6378. manifest_txt = manifest_txt.replace("ARCH", pkg_arch)
  6379. manifest_txt = manifest_txt.replace("ORIGIN", 'devel/panda3d' if not RUNTIME else 'graphics/panda3d-runtime')
  6380. manifest_txt = manifest_txt.replace("DEPENDS", dependencies)
  6381. manifest_txt = manifest_txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024 / 1024))
  6382. WriteFile("pkg-plist", plist_txt)
  6383. WriteFile("+DESC", INSTALLER_PKG_DESCR_FILE[1:] if not RUNTIME else RUNTIME_INSTALLER_PKG_DESCR_FILE[1:])
  6384. WriteFile("+MANIFEST", manifest_txt)
  6385. oscmd("pkg create -p pkg-plist -r %s -m . -o . %s" % (os.path.abspath("targetroot"), "--verbose" if GetVerbose() else "--quiet"))
  6386. try:
  6387. if INSTALLER:
  6388. ProgressOutput(100.0, "Building installer")
  6389. target = GetTarget()
  6390. if target == 'windows':
  6391. fn = "Panda3D-"
  6392. dir = "Panda3D-" + VERSION
  6393. if RUNTIME:
  6394. fn += "Runtime-"
  6395. title = "Panda3D " + VERSION
  6396. else:
  6397. title = "Panda3D SDK " + VERSION
  6398. fn += VERSION
  6399. if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7":
  6400. fn += '-py' + SDK["PYTHONVERSION"][6:]
  6401. if GetOptimize() <= 2:
  6402. fn += "-dbg"
  6403. if GetTargetArch() == 'x64':
  6404. fn += '-x64'
  6405. dir += '-x64'
  6406. MakeInstallerNSIS(fn + '.exe', title, 'C:\\' + dir)
  6407. if not RUNTIME:
  6408. MakeDebugSymbolArchive(fn + '-pdb.zip', dir)
  6409. elif (target == 'linux'):
  6410. MakeInstallerLinux()
  6411. elif (target == 'darwin'):
  6412. MakeInstallerOSX()
  6413. elif (target == 'freebsd'):
  6414. MakeInstallerFreeBSD()
  6415. else:
  6416. exit("Do not know how to make an installer for this platform")
  6417. if WHEEL:
  6418. ProgressOutput(100.0, "Building wheel")
  6419. from makewheel import makewheel
  6420. makewheel(WHLVERSION, GetOutputDir())
  6421. finally:
  6422. SaveDependencyCache()
  6423. ##########################################################################################
  6424. #
  6425. # Print final status report.
  6426. #
  6427. ##########################################################################################
  6428. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6429. printStatus("Makepanda Final Status Report", WARNINGS)
  6430. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())