makepanda.py 326 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317
  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. GENMAN=0
  41. COMPRESSOR="zlib"
  42. THREADCOUNT=0
  43. CFLAGS=""
  44. CXXFLAGS=""
  45. LDFLAGS=""
  46. RTDIST=0
  47. RTDIST_VERSION=None
  48. RUNTIME=0
  49. DISTRIBUTOR=""
  50. VERSION=None
  51. DEBVERSION=None
  52. WHLVERSION=None
  53. RPMRELEASE="1"
  54. GIT_COMMIT=None
  55. P3DSUFFIX=None
  56. MAJOR_VERSION=None
  57. COREAPI_VERSION=None
  58. PLUGIN_VERSION=None
  59. OSXTARGET=None
  60. OSX_ARCHS=[]
  61. HOST_URL=None
  62. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  63. STRDXSDKVERSION = 'default'
  64. WINDOWS_SDK = None
  65. MSVC_VERSION = None
  66. BOOUSEINTELCOMPILER = False
  67. OPENCV_VER_23 = False
  68. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  69. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  70. PkgListSet(["PYTHON", "DIRECT", # Python support
  71. "GL", "VULKAN"] + DXVERSIONS + ["TINYDISPLAY", # 3D graphics
  72. "EGL", "GLES", "GLES2", # OpenGL (ES) integration
  73. "NVIDIACG", # Shaders
  74. "EIGEN", # Linear algebra acceleration
  75. "OPENAL", "FMODEX", # Audio playback
  76. "VORBIS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  77. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  78. "SPEEDTREE", # SpeedTree
  79. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", "FREETYPE", # 2D Formats support
  80. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  81. "VRPN", "OPENSSL", # Transport
  82. "FFTW", # Algorithm helpers
  83. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  84. "GTK2", # GTK2 is used for PStats on Unix
  85. "MFC", "WX", "FLTK", # Used for web plug-in only
  86. "ROCKET", "AWESOMIUM", # GUI libraries
  87. "CARBON", "COCOA", # Mac OS X toolkits
  88. "X11", # Unix platform support
  89. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  90. "SKEL", # Example SKEL project
  91. "PANDAFX", # Some distortion special lenses
  92. "PANDAPARTICLESYSTEM", # Built in particle system
  93. "CONTRIB", # Experimental
  94. "SSE2", "NEON", # Compiler features
  95. ])
  96. CheckPandaSourceTree()
  97. def keyboardInterruptHandler(x,y):
  98. exit("keyboard interrupt")
  99. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  100. ########################################################################
  101. ##
  102. ## Command-line parser.
  103. ##
  104. ## You can type "makepanda --help" to see all the options.
  105. ##
  106. ########################################################################
  107. def usage(problem):
  108. if (problem):
  109. print("")
  110. print("Error parsing command-line input: %s" % (problem))
  111. print("")
  112. print("Makepanda generates a 'built' subdirectory containing a")
  113. print("compiled copy of Panda3D. Command-line arguments are:")
  114. print("")
  115. print(" --help (print the help message you're reading now)")
  116. print(" --verbose (print out more information)")
  117. print(" --runtime (build a runtime build instead of an SDK build)")
  118. print(" --installer (build an installer)")
  119. print(" --wheel (build a pip-installable .whl)")
  120. print(" --optimize X (optimization level can be 1,2,3,4)")
  121. print(" --version X (set the panda version number)")
  122. print(" --lzma (use lzma compression when building Windows installer)")
  123. print(" --distributor X (short string identifying the distributor of the build)")
  124. print(" --outputdir X (use the specified directory instead of 'built')")
  125. print(" --host URL (set the host url (runtime build only))")
  126. print(" --threads N (use the multithreaded build system. see manual)")
  127. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  128. print(" --universal (build universal binaries (OS X only))")
  129. print(" --override \"O=V\" (override dtool_config/prc option value)")
  130. print(" --static (builds libraries for static linking)")
  131. print(" --target X (experimental cross-compilation (android only))")
  132. print(" --arch X (target architecture for cross-compilation)")
  133. print("")
  134. for pkg in PkgListGet():
  135. p = pkg.lower()
  136. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  137. if sys.platform != 'win32':
  138. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  139. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  140. print("")
  141. print(" --nothing (disable every third-party lib)")
  142. print(" --everything (enable every third-party lib)")
  143. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  144. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  145. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
  146. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  147. print("")
  148. print("The simplest way to compile panda is to just type:")
  149. print("")
  150. print(" makepanda --everything")
  151. print("")
  152. os._exit(1)
  153. def parseopts(args):
  154. global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  155. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  156. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  157. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  158. longopts = [
  159. "help","distributor=","verbose","runtime","osxtarget=",
  160. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  161. "version=","lzma","no-python","threads=","outputdir=","override=",
  162. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  163. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  164. "universal", "target=", "arch=", "git-commit=", "no-directscripts",
  165. "use-touchinput", "no-touchinput"]
  166. anything = 0
  167. optimize = ""
  168. target = None
  169. target_arch = None
  170. universal = False
  171. clean_build = False
  172. for pkg in PkgListGet():
  173. longopts.append("use-" + pkg.lower())
  174. longopts.append("no-" + pkg.lower())
  175. longopts.append(pkg.lower() + "-incdir=")
  176. longopts.append(pkg.lower() + "-libdir=")
  177. try:
  178. opts, extras = getopt.getopt(args, "", longopts)
  179. for option, value in opts:
  180. if (option=="--help"): raise Exception
  181. elif (option=="--optimize"): optimize=value
  182. elif (option=="--installer"): INSTALLER=1
  183. elif (option=="--wheel"): WHEEL=1
  184. elif (option=="--verbose"): SetVerbose(True)
  185. elif (option=="--distributor"): DISTRIBUTOR=value
  186. elif (option=="--rtdist"): RTDIST=1
  187. elif (option=="--runtime"): RUNTIME=1
  188. elif (option=="--genman"): GENMAN=1
  189. elif (option=="--everything"): PkgEnableAll()
  190. elif (option=="--nothing"): PkgDisableAll()
  191. elif (option=="--threads"): THREADCOUNT=int(value)
  192. elif (option=="--outputdir"): SetOutputDir(value.strip())
  193. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  194. elif (option=="--universal"): universal = True
  195. elif (option=="--target"): target = value.strip()
  196. elif (option=="--arch"): target_arch = value.strip()
  197. elif (option=="--nocolor"): DisableColors()
  198. elif (option=="--version"):
  199. match = re.match(r'^\d+\.\d+\.\d+', value)
  200. if not match:
  201. usage("version requires three digits")
  202. WHLVERSION = value
  203. VERSION = match.group()
  204. elif (option=="--lzma"): COMPRESSOR="lzma"
  205. elif (option=="--override"): AddOverride(value.strip())
  206. elif (option=="--static"): SetLinkAllStatic(True)
  207. elif (option=="--host"): HOST_URL=value
  208. elif (option=="--debversion"): DEBVERSION=value
  209. elif (option=="--rpmrelease"): RPMRELEASE=value
  210. elif (option=="--git-commit"): GIT_COMMIT=value
  211. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  212. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  213. # Backward compatibility, OPENGL was renamed to GL
  214. elif (option=="--use-opengl"): PkgEnable("GL")
  215. elif (option=="--no-opengl"): PkgDisable("GL")
  216. elif (option=="--no-directscripts"): pass
  217. elif (option=="--directx-sdk"):
  218. STRDXSDKVERSION = value.strip().lower()
  219. if STRDXSDKVERSION == '':
  220. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  221. STRDXSDKVERSION = 'default'
  222. elif (option=="--windows-sdk"):
  223. WINDOWS_SDK = value.strip().lower()
  224. elif (option=="--msvc-version"):
  225. MSVC_VERSION = value.strip().lower()
  226. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  227. elif (option=="--clean"): clean_build = True
  228. else:
  229. for pkg in PkgListGet():
  230. if option == "--use-" + pkg.lower():
  231. PkgEnable(pkg)
  232. break
  233. elif option == "--no-" + pkg.lower():
  234. PkgDisable(pkg)
  235. break
  236. elif option == "--" + pkg.lower() + "-incdir":
  237. PkgSetCustomLocation(pkg)
  238. IncDirectory(pkg, value)
  239. break
  240. elif option == "--" + pkg.lower() + "-libdir":
  241. PkgSetCustomLocation(pkg)
  242. LibDirectory(pkg, value)
  243. break
  244. if (option == "--everything" or option.startswith("--use-")
  245. or option == "--nothing" or option.startswith("--no-")):
  246. anything = 1
  247. except:
  248. usage(sys.exc_info()[1])
  249. if not anything:
  250. if RUNTIME:
  251. PkgEnableAll()
  252. else:
  253. usage("You should specify a list of packages to use or --everything to enable all packages.")
  254. if (RTDIST and RUNTIME):
  255. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  256. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  257. elif (optimize==""): optimize = "3"
  258. if OSXTARGET:
  259. try:
  260. maj, min = OSXTARGET.strip().split('.')
  261. OSXTARGET = int(maj), int(min)
  262. assert OSXTARGET[0] == 10
  263. except:
  264. usage("Invalid setting for OSXTARGET")
  265. else:
  266. OSXTARGET = None
  267. if target is not None or target_arch is not None:
  268. SetTarget(target, target_arch)
  269. if universal:
  270. if target_arch:
  271. exit("--universal is incompatible with --arch")
  272. OSX_ARCHS.append("i386")
  273. if OSXTARGET:
  274. osxver = OSXTARGET
  275. else:
  276. maj, min = platform.mac_ver()[0].split('.')[:2]
  277. osxver = int(maj), int(min)
  278. if osxver[1] < 6:
  279. OSX_ARCHS.append("ppc")
  280. else:
  281. OSX_ARCHS.append("x86_64")
  282. elif HasTargetArch():
  283. OSX_ARCHS.append(GetTargetArch())
  284. try:
  285. SetOptimize(int(optimize))
  286. assert GetOptimize() in [1, 2, 3, 4]
  287. except:
  288. usage("Invalid setting for OPTIMIZE")
  289. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  290. usage("Invalid SHA-1 hash given for --git-commit option!")
  291. if GetTarget() == 'windows':
  292. if not MSVC_VERSION:
  293. print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
  294. MSVC_VERSION = 10
  295. try:
  296. MSVC_VERSION = int(MSVC_VERSION)
  297. except:
  298. usage("Invalid setting for --msvc-version")
  299. if not WINDOWS_SDK:
  300. print("No Windows SDK version specified. Defaulting to '7.1'.")
  301. WINDOWS_SDK = '7.1'
  302. if clean_build and os.path.isdir(GetOutputDir()):
  303. print("Deleting %s" % (GetOutputDir()))
  304. shutil.rmtree(GetOutputDir())
  305. parseopts(sys.argv[1:])
  306. ########################################################################
  307. ##
  308. ## Handle environment variables.
  309. ##
  310. ########################################################################
  311. if ("CFLAGS" in os.environ):
  312. CFLAGS = os.environ["CFLAGS"].strip()
  313. if ("CXXFLAGS" in os.environ):
  314. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  315. if ("RPM_OPT_FLAGS" in os.environ):
  316. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  317. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  318. if ("LDFLAGS" in os.environ):
  319. LDFLAGS = os.environ["LDFLAGS"].strip()
  320. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  321. if GetHost() == "darwin" and OSXTARGET is not None:
  322. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  323. ########################################################################
  324. ##
  325. ## Configure things based on the command-line parameters.
  326. ##
  327. ########################################################################
  328. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  329. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  330. if VERSION is None:
  331. if RUNTIME:
  332. VERSION = PLUGIN_VERSION
  333. else:
  334. VERSION = ParsePandaVersion("dtool/PandaVersion.pp")
  335. if WHLVERSION is None:
  336. WHLVERSION = VERSION
  337. print("Version: %s" % VERSION)
  338. if RUNTIME or RTDIST:
  339. print("Core API Version: %s" % COREAPI_VERSION)
  340. if DEBVERSION is None:
  341. DEBVERSION = VERSION
  342. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  343. if P3DSUFFIX is None:
  344. P3DSUFFIX = MAJOR_VERSION
  345. outputdir_suffix = ""
  346. if (RUNTIME or RTDIST):
  347. # Compiling Maya/Max is pointless in rtdist build
  348. for ver in MAYAVERSIONS + MAXVERSIONS:
  349. PkgDisable(ver)
  350. if (DISTRIBUTOR.strip() == ""):
  351. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  352. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  353. if (RUNTIME):
  354. outputdir_suffix += "_rt"
  355. if DISTRIBUTOR == "":
  356. DISTRIBUTOR = "makepanda"
  357. elif not RTDIST_VERSION:
  358. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  359. if not RTDIST_VERSION:
  360. RTDIST_VERSION = "dev"
  361. if not IsCustomOutputDir():
  362. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  363. outputdir_suffix += '_x64'
  364. SetOutputDir("built" + outputdir_suffix)
  365. if (RUNTIME):
  366. for pkg in PkgListGet():
  367. if pkg in ["GTK2", "MFC"]:
  368. # Optional package(s) for runtime.
  369. pass
  370. elif pkg in ["OPENSSL", "ZLIB"]:
  371. # Required packages for runtime.
  372. if (PkgSkip(pkg)==1):
  373. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  374. else:
  375. # Unused packages for runtime.
  376. PkgDisable(pkg)
  377. if (INSTALLER and RTDIST):
  378. exit("Cannot build an installer for the rtdist build!")
  379. if (WHEEL and RUNTIME):
  380. exit("Cannot build a wheel for the runtime build!")
  381. if (WHEEL and RTDIST):
  382. exit("Cannot build a wheel for the rtdist build!")
  383. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  384. exit("Cannot build installer on Windows without python")
  385. if WHEEL and PkgSkip("PYTHON"):
  386. exit("Cannot build wheel without Python")
  387. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  388. exit("Cannot build rtdist without wx or fltk")
  389. if (RUNTIME):
  390. SetLinkAllStatic(True)
  391. if not os.path.isdir("contrib"):
  392. PkgDisable("CONTRIB")
  393. ########################################################################
  394. ##
  395. ## Load the dependency cache.
  396. ##
  397. ########################################################################
  398. LoadDependencyCache()
  399. ########################################################################
  400. ##
  401. ## Locate various SDKs.
  402. ##
  403. ########################################################################
  404. MakeBuildTree()
  405. SdkLocateDirectX(STRDXSDKVERSION)
  406. SdkLocateMaya()
  407. SdkLocateMax()
  408. SdkLocateMacOSX(OSXTARGET)
  409. SdkLocatePython(RTDIST)
  410. SdkLocateWindows(WINDOWS_SDK)
  411. SdkLocatePhysX()
  412. SdkLocateSpeedTree()
  413. SdkLocateAndroid()
  414. SdkLocateVulkan()
  415. SdkAutoDisableDirectX()
  416. SdkAutoDisableMaya()
  417. SdkAutoDisableMax()
  418. SdkAutoDisablePhysX()
  419. SdkAutoDisableSpeedTree()
  420. if RTDIST and DISTRIBUTOR == "cmu":
  421. # Some validation checks for the CMU builds.
  422. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  423. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  424. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  425. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  426. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  427. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  428. if RTDIST and not HOST_URL:
  429. exit("You must specify a host URL when building the rtdist!")
  430. if RUNTIME and not HOST_URL:
  431. # Set this to a nice default.
  432. HOST_URL = "https://runtime.panda3d.org/"
  433. ########################################################################
  434. ##
  435. ## Choose a Compiler.
  436. ##
  437. ## This should also set up any environment variables needed to make
  438. ## the compiler work.
  439. ##
  440. ########################################################################
  441. if GetHost() == 'windows' and GetTarget() == 'windows':
  442. COMPILER = "MSVC"
  443. SdkLocateVisualStudio(MSVC_VERSION)
  444. else:
  445. COMPILER = "GCC"
  446. SetupBuildEnvironment(COMPILER)
  447. ########################################################################
  448. ##
  449. ## External includes, external libraries, and external defsyms.
  450. ##
  451. ########################################################################
  452. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  453. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  454. if (COMPILER == "MSVC"):
  455. PkgDisable("X11")
  456. PkgDisable("GLES")
  457. PkgDisable("GLES2")
  458. PkgDisable("EGL")
  459. PkgDisable("CARBON")
  460. PkgDisable("COCOA")
  461. if (PkgSkip("PYTHON")==0):
  462. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  463. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  464. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  465. for pkg in PkgListGet():
  466. if (PkgSkip(pkg)==0):
  467. if (pkg[:4]=="MAYA"):
  468. IncDirectory(pkg, SDK[pkg] + "/include")
  469. DefSymbol(pkg, "MAYAVERSION", pkg)
  470. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  471. elif (pkg[:3]=="MAX"):
  472. IncDirectory(pkg, SDK[pkg] + "/include")
  473. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  474. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  475. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  476. DefSymbol(pkg, "MAX", pkg)
  477. if (int(pkg[3:]) >= 2013):
  478. DefSymbol(pkg, "UNICODE", "")
  479. DefSymbol(pkg, "_UNICODE", "")
  480. elif (pkg[:2]=="DX"):
  481. IncDirectory(pkg, SDK[pkg] + "/include")
  482. elif pkg == "VULKAN":
  483. IncDirectory(pkg, SDK[pkg] + "/Include")
  484. LibName(pkg, SDK[pkg] + "/Source/lib/vulkan-1.lib")
  485. elif GetThirdpartyDir() is not None:
  486. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  487. for pkg in DXVERSIONS:
  488. if (PkgSkip(pkg)==0):
  489. vnum=pkg[2:]
  490. if GetTargetArch() == 'x64':
  491. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  492. else:
  493. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  494. LibDirectory(pkg, SDK[pkg] + '/lib')
  495. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  496. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  497. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  498. LibName(pkg, 'dxerr.lib')
  499. else:
  500. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  501. #LibName(pkg, 'ddraw.lib')
  502. LibName(pkg, 'dxguid.lib')
  503. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  504. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  505. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  506. LibName("WINSOCK", "wsock32.lib")
  507. LibName("WINSOCK2", "wsock32.lib")
  508. LibName("WINSOCK2", "ws2_32.lib")
  509. LibName("WINCOMCTL", "comctl32.lib")
  510. LibName("WINCOMDLG", "comdlg32.lib")
  511. LibName("WINUSER", "user32.lib")
  512. LibName("WINMM", "winmm.lib")
  513. LibName("WINIMM", "imm32.lib")
  514. LibName("WINKERNEL", "kernel32.lib")
  515. LibName("WINOLE", "ole32.lib")
  516. LibName("WINOLEAUT", "oleaut32.lib")
  517. LibName("WINOLDNAMES", "oldnames.lib")
  518. LibName("WINSHELL", "shell32.lib")
  519. LibName("WINGDI", "gdi32.lib")
  520. LibName("ADVAPI", "advapi32.lib")
  521. LibName("IPHLPAPI", "iphlpapi.lib")
  522. LibName("GL", "opengl32.lib")
  523. LibName("GLES", "libgles_cm.lib")
  524. LibName("GLES2", "libGLESv2.lib")
  525. LibName("EGL", "libEGL.lib")
  526. LibName("MSIMG", "msimg32.lib")
  527. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  528. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  529. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  530. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  531. if (PkgSkip("OPENSSL")==0):
  532. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  533. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  534. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  535. else:
  536. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  537. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  538. if (PkgSkip("PNG")==0):
  539. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  540. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  541. else:
  542. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  543. if (PkgSkip("TIFF")==0):
  544. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  545. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  546. else:
  547. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  548. if (PkgSkip("OPENEXR")==0):
  549. suffix = ""
  550. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  551. suffix = "-2_2"
  552. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  553. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  554. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  555. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  556. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  557. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  558. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  559. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  560. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  561. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  562. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  563. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  564. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  565. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  566. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  567. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  568. if (PkgSkip("ASSIMP")==0): PkgDisable("ASSIMP") # Not yet supported
  569. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  570. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  571. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  572. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  573. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  574. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM",GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  575. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  576. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  577. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  578. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  579. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  580. if (PkgSkip("FCOLLADA")==0):
  581. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  582. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  583. if (PkgSkip("SQUISH")==0):
  584. if GetOptimize() <= 2:
  585. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  586. else:
  587. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  588. if (PkgSkip("ROCKET")==0):
  589. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  590. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  591. if (PkgSkip("PYTHON")==0):
  592. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  593. if (GetOptimize() <= 3):
  594. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  595. if (PkgSkip("OPENAL")==0):
  596. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  597. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  598. # Link OpenAL Soft statically.
  599. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  600. if (PkgSkip("ODE")==0):
  601. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  602. DefSymbol("ODE", "dSINGLE", "")
  603. if (PkgSkip("FMODEX")==0):
  604. if (GetTargetArch() == 'x64'):
  605. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  606. else:
  607. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  608. if (PkgSkip("FLTK")==0 and RTDIST):
  609. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  610. if not PkgSkip("FLTK"):
  611. # If we have fltk, we don't need wx
  612. PkgDisable("WX")
  613. if (PkgSkip("WX")==0 and RTDIST):
  614. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  615. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  616. DefSymbol("WX", "__WXMSW__", "")
  617. DefSymbol("WX", "_UNICODE", "")
  618. DefSymbol("WX", "UNICODE", "")
  619. if (PkgSkip("VORBIS")==0):
  620. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libogg_static.lib")
  621. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbis_static.lib")
  622. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbisfile_static.lib")
  623. for pkg in MAYAVERSIONS:
  624. if (PkgSkip(pkg)==0):
  625. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  626. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  627. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  628. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  629. for pkg in MAXVERSIONS:
  630. if (PkgSkip(pkg)==0):
  631. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  632. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  633. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  634. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  635. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  636. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  637. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  638. if (PkgSkip("PHYSX")==0):
  639. if GetTargetArch() == 'x64':
  640. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  641. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  642. else:
  643. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  644. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  645. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  646. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  647. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  648. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  649. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  650. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  651. if (PkgSkip("SPEEDTREE")==0):
  652. if GetTargetArch() == 'x64':
  653. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  654. p64ext = '64'
  655. else:
  656. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  657. p64ext = ''
  658. debugext = ''
  659. if (GetOptimize() <= 2): debugext = "_d"
  660. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  661. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  662. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  663. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  664. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  665. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  666. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  667. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  668. LibName("SPEEDTREE", "glu32.lib")
  669. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  670. if (PkgSkip("BULLET")==0):
  671. suffix = '.lib'
  672. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  673. suffix = '_x64.lib'
  674. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  675. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  676. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  677. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  678. if (COMPILER=="GCC"):
  679. PkgDisable("AWESOMIUM")
  680. if GetTarget() != "darwin":
  681. PkgDisable("CARBON")
  682. PkgDisable("COCOA")
  683. elif RUNTIME:
  684. # We don't support Cocoa in the runtime yet.
  685. PkgDisable("COCOA")
  686. if 'x86_64' in OSX_ARCHS:
  687. # 64-bits OS X doesn't have Carbon.
  688. PkgDisable("CARBON")
  689. #if (PkgSkip("PYTHON")==0):
  690. # IncDirectory("PYTHON", SDK["PYTHON"])
  691. if (GetHost() == "darwin"):
  692. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  693. IncDirectory("FREETYPE", "/usr/X11/include")
  694. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  695. LibDirectory("FREETYPE", "/usr/X11/lib")
  696. if (GetHost() == "freebsd"):
  697. IncDirectory("ALWAYS", "/usr/local/include")
  698. LibDirectory("ALWAYS", "/usr/local/lib")
  699. if (os.path.isdir("/usr/PCBSD")):
  700. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  701. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  702. if GetTarget() != "windows":
  703. PkgDisable("DIRECTCAM")
  704. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  705. # WARNING! The order of the ffmpeg libraries matters!
  706. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  707. # Name pkg-config libs, include(dir)s
  708. if (not RUNTIME):
  709. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  710. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  711. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  712. SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp")
  713. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  714. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  715. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  716. SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
  717. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  718. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  719. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  720. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  721. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  722. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  723. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  724. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  725. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  726. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  727. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  728. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  729. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  730. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  731. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  732. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  733. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  734. SmartPkgEnable("VULKAN", "", ("vulkan"), "vulkan/vulkan.h")
  735. if not PkgSkip("FFMPEG"):
  736. if GetTarget() == "darwin":
  737. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  738. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  739. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  740. # Needed when linking ffmpeg statically on Linux.
  741. LibName("FFMPEG", "-Wl,-Bsymbolic")
  742. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  743. if cv_lib == "opencv_core":
  744. OPENCV_VER_23 = True
  745. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  746. else:
  747. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  748. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  749. rocket_libs = ("RocketCore", "RocketControls")
  750. if (GetOptimize() <= 3):
  751. rocket_libs += ("RocketDebugger",)
  752. rocket_libs += ("boost_python",)
  753. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  754. if not PkgSkip("PYTHON"):
  755. python_lib = SDK["PYTHONVERSION"]
  756. if not RTDIST:
  757. # We don't link anything in the SDK with libpython.
  758. python_lib = ""
  759. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  760. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  761. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  762. SmartPkgEnable("GTK2", "gtk+-2.0")
  763. if (RTDIST):
  764. SmartPkgEnable("WX", tool = "wx-config")
  765. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  766. if GetTarget() != 'darwin':
  767. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  768. if not PkgSkip("NVIDIACG") and not RUNTIME:
  769. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  770. if not RUNTIME:
  771. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h"))
  772. if GetHost() != "darwin":
  773. # Workaround for an issue where pkg-config does not include this path
  774. if GetTargetArch() in ("x86_64", "amd64"):
  775. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  776. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  777. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  778. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  779. if not PkgSkip("X11"):
  780. if (os.path.isdir("/usr/X11R6/lib64")):
  781. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  782. else:
  783. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  784. elif not PkgSkip("X11"):
  785. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  786. if RUNTIME:
  787. # For the runtime, these packages are required
  788. for pkg in ["OPENSSL", "ZLIB"]:
  789. skips = []
  790. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  791. skips.append(pkg)
  792. if skips:
  793. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  794. for pkg in MAYAVERSIONS:
  795. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  796. if (GetHost() == "darwin"):
  797. # Sheesh, Autodesk really can't make up their mind
  798. # regarding the location of the Maya devkit on OS X.
  799. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  800. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  801. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  802. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  803. if (os.path.isdir(SDK[pkg] + "/lib")):
  804. LibDirectory(pkg, SDK[pkg] + "/lib")
  805. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  806. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  807. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  808. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  809. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  810. IncDirectory(pkg, SDK[pkg] + "/include")
  811. else:
  812. LibDirectory(pkg, SDK[pkg] + "/lib")
  813. IncDirectory(pkg, SDK[pkg] + "/include")
  814. DefSymbol(pkg, "MAYAVERSION", pkg)
  815. if GetTarget() == 'darwin':
  816. LibName("ALWAYS", "-framework AppKit")
  817. if (PkgSkip("OPENCV")==0):
  818. LibName("OPENCV", "-framework QuickTime")
  819. LibName("AGL", "-framework AGL")
  820. LibName("CARBON", "-framework Carbon")
  821. LibName("COCOA", "-framework Cocoa")
  822. # Fix for a bug in OSX Leopard:
  823. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  824. if GetTarget() == 'android':
  825. LibName("ALWAYS", '-llog')
  826. LibName("ALWAYS", '-landroid')
  827. LibName("JNIGRAPHICS", '-ljnigraphics')
  828. for pkg in MAYAVERSIONS:
  829. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  830. if GetTarget() == 'darwin':
  831. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  832. else:
  833. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  834. LibName(pkg, "-lOpenMaya")
  835. LibName(pkg, "-lOpenMayaAnim")
  836. LibName(pkg, "-lAnimSlice")
  837. LibName(pkg, "-lDeformSlice")
  838. LibName(pkg, "-lModifiers")
  839. LibName(pkg, "-lDynSlice")
  840. LibName(pkg, "-lKinSlice")
  841. LibName(pkg, "-lModelSlice")
  842. LibName(pkg, "-lNurbsSlice")
  843. LibName(pkg, "-lPolySlice")
  844. LibName(pkg, "-lProjectSlice")
  845. LibName(pkg, "-lImage")
  846. LibName(pkg, "-lShared")
  847. LibName(pkg, "-lTranslators")
  848. LibName(pkg, "-lDataModel")
  849. LibName(pkg, "-lRenderModel")
  850. LibName(pkg, "-lNurbsEngine")
  851. LibName(pkg, "-lDependEngine")
  852. LibName(pkg, "-lCommandEngine")
  853. LibName(pkg, "-lFoundation")
  854. LibName(pkg, "-lIMFbase")
  855. if GetTarget() != 'darwin':
  856. LibName(pkg, "-lOpenMayalib")
  857. else:
  858. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  859. if (PkgSkip("PHYSX")==0):
  860. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  861. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  862. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  863. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  864. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  865. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  866. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  867. if (GetHost() == "darwin"):
  868. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  869. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  870. else:
  871. LibName("PHYSX", "-lPhysXLoader")
  872. LibName("PHYSX", "-lNxCharacter")
  873. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  874. if GetLinkAllStatic():
  875. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  876. if GetTarget() == 'android':
  877. DefSymbol("ALWAYS", "ANDROID")
  878. if not PkgSkip("EIGEN"):
  879. DefSymbol("ALWAYS", "EIGEN_MPL2_ONLY")
  880. if GetOptimize() >= 3:
  881. DefSymbol("ALWAYS", "EIGEN_NO_DEBUG")
  882. if COMPILER == "MSVC":
  883. # Squeeze out a bit more performance on MSVC builds...
  884. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  885. # will turn them into runtime assertions.
  886. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  887. ########################################################################
  888. ##
  889. ## Give a Status Report on Command-Line Options
  890. ##
  891. ########################################################################
  892. def printStatus(header,warnings):
  893. if GetVerbose():
  894. print("")
  895. print("-------------------------------------------------------------------")
  896. print(header)
  897. tkeep = ""
  898. tomit = ""
  899. for x in PkgListGet():
  900. if PkgSkip(x):
  901. tomit = tomit + x + " "
  902. else:
  903. tkeep = tkeep + x + " "
  904. if RTDIST:
  905. print("Makepanda: Runtime distribution build")
  906. elif RUNTIME:
  907. print("Makepanda: Runtime build")
  908. else:
  909. print("Makepanda: Regular build")
  910. print("Makepanda: Compiler: %s" % (COMPILER))
  911. print("Makepanda: Optimize: %d" % (GetOptimize()))
  912. print("Makepanda: Keep Pkg: %s" % (tkeep))
  913. print("Makepanda: Omit Pkg: %s" % (tomit))
  914. if GENMAN:
  915. print("Makepanda: Generate API reference manual")
  916. else:
  917. print("Makepanda: Don't generate API reference manual")
  918. if GetHost() == "windows" and not RTDIST:
  919. if INSTALLER:
  920. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  921. else:
  922. print("Makepanda: Don't build installer")
  923. print("Makepanda: Version ID: %s" % (VERSION))
  924. for x in warnings:
  925. print("Makepanda: %s" % (x))
  926. print("-------------------------------------------------------------------")
  927. print("")
  928. sys.stdout.flush()
  929. ########################################################################
  930. ##
  931. ## BracketNameWithQuotes
  932. ##
  933. ########################################################################
  934. def BracketNameWithQuotes(name):
  935. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  936. if (name.startswith("-framework")): return name
  937. if (name.startswith("-dylib_file")): return name
  938. # Don't add quotes when it's not necessary.
  939. if " " not in name: return name
  940. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  941. if (name.startswith('"') and name.endswith('"')): return name
  942. else: return '"' + name + '"'
  943. ########################################################################
  944. ##
  945. ## CompileCxx
  946. ##
  947. ########################################################################
  948. def CompileCxx(obj,src,opts):
  949. ipath = GetListOption(opts, "DIR:")
  950. optlevel = GetOptimizeOption(opts)
  951. if (COMPILER=="MSVC"):
  952. if not BOOUSEINTELCOMPILER:
  953. cmd = "cl "
  954. if GetTargetArch() == 'x64':
  955. cmd += "/favor:blend "
  956. cmd += "/wd4996 /wd4275 /wd4273 "
  957. # We still target Windows XP.
  958. cmd += "/DWINVER=0x501 "
  959. # Work around a WinXP/2003 bug when using VS 2015+.
  960. if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
  961. cmd += "/Zc:threadSafeInit- "
  962. cmd += "/Fo" + obj + " /nologo /c"
  963. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  964. cmd += " /arch:SSE2"
  965. for x in ipath: cmd += " /I" + x
  966. for (opt,dir) in INCDIRECTORIES:
  967. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  968. for (opt,var,val) in DEFSYMBOLS:
  969. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  970. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  971. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  972. if (optlevel==2): cmd += " /MDd /Zi"
  973. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  974. if (optlevel==4):
  975. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  976. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  977. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  978. building = GetValueOption(opts, "BUILDING:")
  979. if (building):
  980. cmd += " /DBUILDING_" + building
  981. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  982. cmd += " /bigobj"
  983. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  984. if 'EXCEPTIONS' in opts:
  985. cmd += " /EHsc"
  986. else:
  987. cmd += " /D_HAS_EXCEPTIONS=0"
  988. if 'RTTI' not in opts:
  989. cmd += " /GR-"
  990. if GetTargetArch() == 'x64':
  991. cmd += " /DWIN64_VC /DWIN64"
  992. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10:
  993. # To preserve Windows XP compatibility.
  994. cmd += " /D_USING_V110_SDK71_"
  995. cmd += " /W3 " + BracketNameWithQuotes(src)
  996. oscmd(cmd)
  997. else:
  998. cmd = "icl "
  999. if GetTargetArch() == 'x64':
  1000. cmd += "/favor:blend "
  1001. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1002. cmd += "/DWINVER=0x501 "
  1003. cmd += "/Fo" + obj + " /c"
  1004. for x in ipath: cmd += " /I" + x
  1005. for (opt,dir) in INCDIRECTORIES:
  1006. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1007. for (opt,var,val) in DEFSYMBOLS:
  1008. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1009. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1010. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1011. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1012. # core changes from jean-claude (dec 2011)
  1013. # ----------------------------------------
  1014. # performance will be seeked at level 3 & 4
  1015. # -----------------------------------------
  1016. if (optlevel==3):
  1017. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1018. cmd += " /Ob0"
  1019. cmd += " /Qipo-" # beware of IPO !!!
  1020. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1021. ## ----------------------------------------------------------------
  1022. if (optlevel==4):
  1023. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1024. cmd += " /Qipo" # optimization multi file
  1025. # for 3 & 4 optimization levels
  1026. # -----------------------------
  1027. if (optlevel>=3):
  1028. cmd += " /fp:fast=2"
  1029. cmd += " /Qftz"
  1030. cmd += " /Qfp-speculation:fast"
  1031. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1032. cmd += " /Qprec-div-"
  1033. cmd += " /Qsimd"
  1034. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1035. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1036. cmd += " /Qparallel" # enable parallelization
  1037. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1038. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1039. ## PCH files with a .pchi filename suffix and reduce build time.
  1040. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1041. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1042. cmd += " /Qpchi-" # keep it this way!
  1043. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1044. ## ------------------------------------
  1045. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1046. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1047. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1048. ## Ctor displacement /vd0 : Disable constructor displacement.
  1049. ## Choose this option only if no class constructors or destructors call virtual functions.
  1050. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1051. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1052. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1053. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1054. ## Alternate: #pragma pointers_to_members
  1055. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1056. building = GetValueOption(opts, "BUILDING:")
  1057. if (building): cmd += " /DBUILDING_" + building
  1058. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1059. cmd += " /bigobj"
  1060. # level of warnings and optimization reports
  1061. if GetVerbose():
  1062. cmd += " /W3 " # or /W4 or /Wall
  1063. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1064. else:
  1065. cmd += " /W1 "
  1066. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1067. if GetTargetArch() == 'x64':
  1068. cmd += " /DWIN64_VC /DWIN64"
  1069. cmd += " " + BracketNameWithQuotes(src)
  1070. oscmd(cmd)
  1071. if (COMPILER=="GCC"):
  1072. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1073. else: cmd = GetCXX()+' -std=gnu++0x -ftemplate-depth-70 -fPIC -c -o ' + obj
  1074. for (opt, dir) in INCDIRECTORIES:
  1075. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1076. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1077. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1078. for (opt,var,val) in DEFSYMBOLS:
  1079. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1080. for x in ipath: cmd += ' -I' + x
  1081. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1082. cmd += ' -fvisibility=hidden'
  1083. # Mac-specific flags.
  1084. if GetTarget() == "darwin":
  1085. cmd += " -Wno-deprecated-declarations"
  1086. if OSXTARGET is not None:
  1087. cmd += " -isysroot " + SDK["MACOSX"]
  1088. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1089. for arch in OSX_ARCHS:
  1090. if 'NOARCH:' + arch.upper() not in opts:
  1091. cmd += " -arch %s" % arch
  1092. if "SYSROOT" in SDK:
  1093. cmd += ' --sysroot=%s -no-canonical-prefixes' % (SDK["SYSROOT"])
  1094. # Android-specific flags.
  1095. arch = GetTargetArch()
  1096. if GetTarget() == "android":
  1097. # Most of the specific optimization flags here were
  1098. # just copied from the default Android Makefiles.
  1099. cmd += ' -I%s/include' % (SDK["ANDROID_STL"])
  1100. cmd += ' -I%s/libs/%s/include' % (SDK["ANDROID_STL"], SDK["ANDROID_ABI"])
  1101. cmd += ' -ffunction-sections -funwind-tables'
  1102. if arch == 'armv7a':
  1103. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1104. cmd += ' -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1105. elif arch == 'arm':
  1106. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1107. cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float'
  1108. elif arch == 'mips':
  1109. cmd += ' -finline-functions -fmessage-length=0'
  1110. cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
  1111. cmd += ' -frerun-cse-after-loop -frename-registers'
  1112. cmd += " -Wa,--noexecstack"
  1113. # Now add specific release/debug flags.
  1114. if optlevel >= 3:
  1115. cmd += " -fomit-frame-pointer"
  1116. if arch.startswith('arm'):
  1117. cmd += ' -finline-limit=64 -mthumb'
  1118. elif arch == 'mips':
  1119. cmd += ' -funswitch-loops -finline-limit=300'
  1120. else:
  1121. cmd += ' -fno-omit-frame-pointer'
  1122. if arch.startswith('arm'):
  1123. cmd += ' -marm'
  1124. # Enable SIMD instructions if requested
  1125. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1126. cmd += ' -mfpu=neon'
  1127. else:
  1128. cmd += " -pthread"
  1129. if not src.endswith(".c"):
  1130. # We don't use exceptions for most modules.
  1131. if 'EXCEPTIONS' in opts:
  1132. cmd += " -fexceptions"
  1133. else:
  1134. cmd += " -fno-exceptions"
  1135. if src.endswith(".mm"):
  1136. # Work around Apple compiler bug.
  1137. cmd += " -U__EXCEPTIONS"
  1138. if 'RTTI' not in opts:
  1139. # We always disable RTTI on Android for memory usage reasons.
  1140. if optlevel >= 4 or GetTarget() == "android":
  1141. cmd += " -fno-rtti"
  1142. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"):
  1143. cmd += " -msse2"
  1144. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1145. cmd += " -fno-strict-aliasing"
  1146. if optlevel >= 3:
  1147. cmd += " -ffast-math"
  1148. if optlevel == 3:
  1149. # Fast math is nice, but we'd like to see NaN in dev builds.
  1150. cmd += " -fno-finite-math-only"
  1151. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1152. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1153. if (optlevel==3): cmd += " -O2"
  1154. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1155. if src.endswith(".c"):
  1156. cmd += ' ' + CFLAGS
  1157. else:
  1158. cmd += ' ' + CXXFLAGS
  1159. cmd = cmd.rstrip()
  1160. building = GetValueOption(opts, "BUILDING:")
  1161. if (building): cmd += " -DBUILDING_" + building
  1162. cmd += ' ' + BracketNameWithQuotes(src)
  1163. oscmd(cmd)
  1164. ########################################################################
  1165. ##
  1166. ## CompileBison
  1167. ##
  1168. ########################################################################
  1169. def CompileBison(wobj, wsrc, opts):
  1170. ifile = os.path.basename(wsrc)
  1171. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1172. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1173. pre = GetValueOption(opts, "BISONPREFIX_")
  1174. bison = GetBison()
  1175. if bison is None:
  1176. # We don't have bison. See if there is a prebuilt file.
  1177. base, ext = os.path.splitext(wsrc)
  1178. if os.path.isfile(base + '.h.prebuilt') and \
  1179. os.path.isfile(base + '.cxx.prebuilt'):
  1180. CopyFile(wdstc, base + '.cxx.prebuilt')
  1181. CopyFile(wdsth, base + '.h.prebuilt')
  1182. else:
  1183. exit('Could not find bison!')
  1184. else:
  1185. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1186. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1187. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1188. # Finally, compile the generated source file.
  1189. CompileCxx(wobj,wdstc,opts)
  1190. ########################################################################
  1191. ##
  1192. ## CompileFlex
  1193. ##
  1194. ########################################################################
  1195. def CompileFlex(wobj,wsrc,opts):
  1196. ifile = os.path.basename(wsrc)
  1197. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1198. pre = GetValueOption(opts, "BISONPREFIX_")
  1199. dashi = opts.count("FLEXDASHI")
  1200. flex = GetFlex()
  1201. if flex is None:
  1202. # We don't have flex. See if there is a prebuilt file.
  1203. base, ext = os.path.splitext(wsrc)
  1204. if os.path.isfile(base + '.cxx.prebuilt'):
  1205. CopyFile(wdst, base + '.cxx.prebuilt')
  1206. else:
  1207. exit('Could not find flex!')
  1208. else:
  1209. if (dashi):
  1210. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1211. else:
  1212. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1213. # Finally, compile the generated source file.
  1214. CompileCxx(wobj,wdst,opts)
  1215. ########################################################################
  1216. ##
  1217. ## CompileIgate
  1218. ##
  1219. ########################################################################
  1220. def CompileIgate(woutd,wsrc,opts):
  1221. outbase = os.path.basename(woutd)[:-3]
  1222. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1223. wobj = FindLocation(outbase + "_igate.obj", [])
  1224. srcdir = GetValueOption(opts, "SRCDIR:")
  1225. module = GetValueOption(opts, "IMOD:")
  1226. library = GetValueOption(opts, "ILIB:")
  1227. ipath = GetListOption(opts, "DIR:")
  1228. if (PkgSkip("PYTHON")):
  1229. WriteFile(woutc, "")
  1230. WriteFile(woutd, "")
  1231. ConditionalWriteFile(woutd, "")
  1232. return (wobj, woutc, opts)
  1233. if not CrossCompiling():
  1234. # If we're compiling for this platform, we can use the one we've built.
  1235. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1236. else:
  1237. # Assume that interrogate is on the PATH somewhere.
  1238. cmd = 'interrogate'
  1239. if GetVerbose():
  1240. cmd += ' -v'
  1241. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1242. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1243. if (COMPILER=="MSVC"):
  1244. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1245. if GetTargetArch() == 'x64':
  1246. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1247. else:
  1248. cmd += ' -D_M_IX86'
  1249. # NOTE: this 1600 value is the version number for VC2010.
  1250. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1251. if (COMPILER=="GCC"):
  1252. cmd += ' -D__attribute__\(x\)='
  1253. if GetTargetArch() in ("x86_64", "amd64"):
  1254. cmd += ' -D_LP64'
  1255. else:
  1256. cmd += ' -D__i386__'
  1257. if GetTarget() == 'darwin':
  1258. cmd += ' -D__APPLE__'
  1259. optlevel = GetOptimizeOption(opts)
  1260. if (optlevel==1): cmd += ' -D_DEBUG'
  1261. if (optlevel==2): cmd += ' -D_DEBUG'
  1262. if (optlevel==3): pass
  1263. if (optlevel==4): cmd += ' -DNDEBUG'
  1264. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1265. cmd += ' -fnames -string -refcount -assert -python-native'
  1266. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1267. # Add -I, -S and -D flags
  1268. for x in ipath:
  1269. cmd += ' -I' + BracketNameWithQuotes(x)
  1270. for (opt,dir) in INCDIRECTORIES:
  1271. if (opt=="ALWAYS") or (opt in opts):
  1272. cmd += ' -S' + BracketNameWithQuotes(dir)
  1273. for (opt,var,val) in DEFSYMBOLS:
  1274. if (opt=="ALWAYS") or (opt in opts):
  1275. cmd += ' -D' + var + '=' + val
  1276. #building = GetValueOption(opts, "BUILDING:")
  1277. #if (building): cmd += " -DBUILDING_"+building
  1278. cmd += ' -module ' + module + ' -library ' + library
  1279. for x in wsrc:
  1280. if (x.startswith("/")):
  1281. cmd += ' ' + BracketNameWithQuotes(x)
  1282. else:
  1283. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1284. oscmd(cmd)
  1285. return (wobj, woutc, opts)
  1286. ########################################################################
  1287. ##
  1288. ## CompileImod
  1289. ##
  1290. ########################################################################
  1291. def CompileImod(wobj, wsrc, opts):
  1292. module = GetValueOption(opts, "IMOD:")
  1293. library = GetValueOption(opts, "ILIB:")
  1294. if (COMPILER=="MSVC"):
  1295. woutc = wobj[:-4]+".cxx"
  1296. if (COMPILER=="GCC"):
  1297. woutc = wobj[:-2]+".cxx"
  1298. if (PkgSkip("PYTHON")):
  1299. WriteFile(woutc, "")
  1300. CompileCxx(wobj, woutc, opts)
  1301. return
  1302. if not CrossCompiling():
  1303. # If we're compiling for this platform, we can use the one we've built.
  1304. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1305. else:
  1306. # Assume that interrogate_module is on the PATH somewhere.
  1307. cmd = 'interrogate_module'
  1308. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1309. importmod = GetValueOption(opts, "IMPORT:")
  1310. if importmod:
  1311. cmd += ' -import ' + importmod
  1312. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1313. oscmd(cmd)
  1314. CompileCxx(wobj,woutc,opts)
  1315. return
  1316. ########################################################################
  1317. ##
  1318. ## CompileLib
  1319. ##
  1320. ########################################################################
  1321. def CompileLib(lib, obj, opts):
  1322. if (COMPILER=="MSVC"):
  1323. if not BOOUSEINTELCOMPILER:
  1324. #Use MSVC Linker
  1325. cmd = 'link /lib /nologo'
  1326. if GetOptimizeOption(opts) == 4:
  1327. cmd += " /LTCG"
  1328. if HasTargetArch():
  1329. cmd += " /MACHINE:" + GetTargetArch().upper()
  1330. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1331. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1332. oscmd(cmd)
  1333. else:
  1334. # Choose Intel linker; from Jean-Claude
  1335. cmd = 'xilink /verbose:lib /lib '
  1336. if HasTargetArch():
  1337. cmd += " /MACHINE:" + GetTargetArch().upper()
  1338. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1339. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1340. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1341. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1342. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1343. oscmd(cmd)
  1344. if (COMPILER=="GCC"):
  1345. if GetTarget() == 'darwin':
  1346. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1347. else:
  1348. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1349. for x in obj:
  1350. cmd += ' ' + BracketNameWithQuotes(x)
  1351. oscmd(cmd)
  1352. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1353. ########################################################################
  1354. ##
  1355. ## CompileLink
  1356. ##
  1357. ########################################################################
  1358. def CompileLink(dll, obj, opts):
  1359. if (COMPILER=="MSVC"):
  1360. if not BOOUSEINTELCOMPILER:
  1361. cmd = "link /nologo "
  1362. if HasTargetArch():
  1363. cmd += " /MACHINE:" + GetTargetArch().upper()
  1364. if ("MFC" not in opts):
  1365. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1366. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1367. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1368. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1369. optlevel = GetOptimizeOption(opts)
  1370. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1371. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1372. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1373. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1374. if ("MFC" in opts):
  1375. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1376. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1377. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1378. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1379. # Set the subsystem. Specify that we want to target Windows XP.
  1380. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1381. cmd += " /SUBSYSTEM:" + subsystem
  1382. if GetTargetArch() == 'x64':
  1383. cmd += ",5.02"
  1384. else:
  1385. cmd += ",5.01"
  1386. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1387. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1388. for (opt, dir) in LIBDIRECTORIES:
  1389. if (opt=="ALWAYS") or (opt in opts):
  1390. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1391. for x in obj:
  1392. if x.endswith(".dll") or x.endswith(".pyd"):
  1393. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1394. elif x.endswith(".lib"):
  1395. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1396. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1397. exit("Error: in makepanda, specify "+dname+", not "+x)
  1398. cmd += ' ' + BracketNameWithQuotes(x)
  1399. elif x.endswith(".def"):
  1400. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1401. elif x.endswith(".dat"):
  1402. pass
  1403. else:
  1404. cmd += ' ' + BracketNameWithQuotes(x)
  1405. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1406. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1407. for (opt, name) in LIBNAMES:
  1408. if (opt=="ALWAYS") or (opt in opts):
  1409. cmd += " " + BracketNameWithQuotes(name)
  1410. oscmd(cmd)
  1411. else:
  1412. cmd = "xilink"
  1413. if GetVerbose(): cmd += " /verbose:lib"
  1414. if HasTargetArch():
  1415. cmd += " /MACHINE:" + GetTargetArch().upper()
  1416. if ("MFC" not in opts):
  1417. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1418. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1419. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1420. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1421. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1422. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1423. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1424. optlevel = GetOptimizeOption(opts)
  1425. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1426. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1427. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1428. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1429. if ("MFC" in opts):
  1430. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1431. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1432. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1433. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1434. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1435. if subsystem:
  1436. cmd += " /SUBSYSTEM:" + subsystem
  1437. if dll.endswith(".dll"):
  1438. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1439. for (opt, dir) in LIBDIRECTORIES:
  1440. if (opt=="ALWAYS") or (opt in opts):
  1441. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1442. for x in obj:
  1443. if x.endswith(".dll") or x.endswith(".pyd"):
  1444. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1445. elif x.endswith(".lib"):
  1446. dname = os.path.splitext(dll)[0]+".dll"
  1447. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1448. exit("Error: in makepanda, specify "+dname+", not "+x)
  1449. cmd += ' ' + BracketNameWithQuotes(x)
  1450. elif x.endswith(".def"):
  1451. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1452. elif x.endswith(".dat"):
  1453. pass
  1454. else:
  1455. cmd += ' ' + BracketNameWithQuotes(x)
  1456. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1457. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1458. for (opt, name) in LIBNAMES:
  1459. if (opt=="ALWAYS") or (opt in opts):
  1460. cmd += " " + BracketNameWithQuotes(name)
  1461. oscmd(cmd)
  1462. if COMPILER == "GCC":
  1463. cxx = GetCXX()
  1464. if GetOrigExt(dll) == ".exe" and GetTarget() != 'android':
  1465. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1466. else:
  1467. if (GetTarget() == "darwin"):
  1468. cmd = cxx + ' -undefined dynamic_lookup'
  1469. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1470. cmd += ' -bundle '
  1471. else:
  1472. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1473. cmd += ' -dynamiclib -install_name ' + install_name
  1474. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1475. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1476. else:
  1477. cmd = cxx + ' -shared'
  1478. if "MODULE" not in opts or GetTarget() == 'android':
  1479. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1480. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1481. for x in obj:
  1482. if GetOrigExt(x) != ".dat":
  1483. cmd += ' ' + x
  1484. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1485. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1486. # Mac OS X specific flags.
  1487. if GetTarget() == 'darwin':
  1488. cmd += " -headerpad_max_install_names"
  1489. if OSXTARGET is not None:
  1490. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1491. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1492. for arch in OSX_ARCHS:
  1493. if 'NOARCH:' + arch.upper() not in opts:
  1494. cmd += " -arch %s" % arch
  1495. elif GetTarget() == 'android':
  1496. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1497. if GetTargetArch() == 'armv7a':
  1498. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1499. cmd += ' -lc -lm'
  1500. else:
  1501. cmd += " -pthread"
  1502. if "SYSROOT" in SDK:
  1503. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1504. if LDFLAGS != "":
  1505. cmd += " " + LDFLAGS
  1506. # Don't link libraries with Python.
  1507. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST:
  1508. opts = opts[:]
  1509. opts.remove("PYTHON")
  1510. for (opt, dir) in LIBDIRECTORIES:
  1511. if (opt=="ALWAYS") or (opt in opts):
  1512. cmd += ' -L' + BracketNameWithQuotes(dir)
  1513. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1514. if (opt=="ALWAYS") or (opt in opts):
  1515. cmd += ' -F' + BracketNameWithQuotes(dir)
  1516. for (opt, name) in LIBNAMES:
  1517. if (opt=="ALWAYS") or (opt in opts):
  1518. cmd += ' ' + BracketNameWithQuotes(name)
  1519. if GetTarget() != 'freebsd':
  1520. cmd += " -ldl"
  1521. oscmd(cmd)
  1522. if GetTarget() == 'android':
  1523. # Copy the library to built/libs/$ANDROID_ABI and strip it.
  1524. # This is the format that Android NDK projects should use.
  1525. new_path = '%s/libs/%s/%s' % (GetOutputDir(), SDK["ANDROID_ABI"], os.path.basename(dll))
  1526. CopyFile(new_path, dll)
  1527. oscmd('%s --strip-unneeded %s' % (GetStrip(), BracketNameWithQuotes(new_path)))
  1528. elif (GetOptimizeOption(opts)==4 and GetTarget() == 'linux'):
  1529. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1530. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1531. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1532. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1533. if os.path.isfile(newdll):
  1534. os.remove(newdll)
  1535. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1536. elif dll.endswith("." + MAJOR_VERSION):
  1537. newdll = dll[:-len(MAJOR_VERSION)-1]
  1538. if os.path.isfile(newdll):
  1539. os.remove(newdll)
  1540. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1541. ##########################################################################################
  1542. #
  1543. # CompileEgg
  1544. #
  1545. ##########################################################################################
  1546. def CompileEgg(eggfile, src, opts):
  1547. pz = False
  1548. if eggfile.endswith(".pz"):
  1549. pz = True
  1550. eggfile = eggfile[:-3]
  1551. # Determine the location of the pzip and flt2egg tools.
  1552. if CrossCompiling():
  1553. # We may not be able to use our generated versions of these tools,
  1554. # so we'll expect them to already be present in the PATH.
  1555. pzip = 'pzip'
  1556. flt2egg = 'flt2egg'
  1557. else:
  1558. # If we're compiling for this machine, we can use the binaries we've built.
  1559. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1560. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1561. if not os.path.isfile(pzip):
  1562. pzip = 'pzip'
  1563. if not os.path.isfile(flt2egg):
  1564. flt2egg = 'flt2egg'
  1565. if src.endswith(".egg"):
  1566. CopyFile(eggfile, src)
  1567. elif src.endswith(".flt"):
  1568. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1569. if pz:
  1570. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1571. ##########################################################################################
  1572. #
  1573. # CompileRes, CompileRsrc
  1574. #
  1575. ##########################################################################################
  1576. def CompileRes(target, src, opts):
  1577. """Compiles a Windows .rc file into a .res file."""
  1578. ipath = GetListOption(opts, "DIR:")
  1579. if (COMPILER == "MSVC"):
  1580. cmd = "rc"
  1581. cmd += " /Fo" + BracketNameWithQuotes(target)
  1582. for x in ipath: cmd += " /I" + x
  1583. for (opt,dir) in INCDIRECTORIES:
  1584. if (opt=="ALWAYS") or (opt in opts):
  1585. cmd += " /I" + BracketNameWithQuotes(dir)
  1586. for (opt,var,val) in DEFSYMBOLS:
  1587. if (opt=="ALWAYS") or (opt in opts):
  1588. cmd += " /D" + var + "=" + val
  1589. cmd += " " + BracketNameWithQuotes(src)
  1590. else:
  1591. cmd = "windres"
  1592. for x in ipath: cmd += " -I" + x
  1593. for (opt,dir) in INCDIRECTORIES:
  1594. if (opt=="ALWAYS") or (opt in opts):
  1595. cmd += " -I" + BracketNameWithQuotes(dir)
  1596. for (opt,var,val) in DEFSYMBOLS:
  1597. if (opt=="ALWAYS") or (opt in opts):
  1598. cmd += " -D" + var + "=" + val
  1599. cmd += " -i " + BracketNameWithQuotes(src)
  1600. cmd += " -o " + BracketNameWithQuotes(target)
  1601. oscmd(cmd)
  1602. def CompileRsrc(target, src, opts):
  1603. """Compiles a Mac OS .r file into an .rsrc file."""
  1604. ipath = GetListOption(opts, "DIR:")
  1605. if os.path.isfile("/usr/bin/Rez"):
  1606. cmd = "Rez -useDF"
  1607. else:
  1608. cmd = "/Developer/Tools/Rez -useDF"
  1609. cmd += " -o " + BracketNameWithQuotes(target)
  1610. for x in ipath:
  1611. cmd += " -i " + x
  1612. for (opt,dir) in INCDIRECTORIES:
  1613. if (opt=="ALWAYS") or (opt in opts):
  1614. cmd += " -i " + BracketNameWithQuotes(dir)
  1615. for (opt,var,val) in DEFSYMBOLS:
  1616. if (opt=="ALWAYS") or (opt in opts):
  1617. if (val == ""):
  1618. cmd += " -d " + var
  1619. else:
  1620. cmd += " -d " + var + " = " + val
  1621. cmd += " " + BracketNameWithQuotes(src)
  1622. oscmd(cmd)
  1623. ##########################################################################################
  1624. #
  1625. # FreezePy
  1626. #
  1627. ##########################################################################################
  1628. def FreezePy(target, inputs, opts):
  1629. assert len(inputs) > 0
  1630. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1631. if sys.version_info >= (2, 6):
  1632. cmdstr += "-B "
  1633. cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py")
  1634. if 'FREEZE_STARTUP' in opts:
  1635. cmdstr += " -s"
  1636. if GetOrigExt(target) == '.exe':
  1637. src = inputs.pop(0)
  1638. else:
  1639. src = ""
  1640. for i in inputs:
  1641. i = os.path.splitext(i)[0]
  1642. i = i.replace('/', '.')
  1643. if i.startswith('direct.src'):
  1644. i = i.replace('.src.', '.')
  1645. cmdstr += " -i " + i
  1646. cmdstr += " -o " + target + " " + src
  1647. if ("LINK_PYTHON_STATIC" in opts):
  1648. os.environ["LINK_PYTHON_STATIC"] = "1"
  1649. oscmd(cmdstr)
  1650. if ("LINK_PYTHON_STATIC" in os.environ):
  1651. del os.environ["LINK_PYTHON_STATIC"]
  1652. if (not os.path.exists(target)):
  1653. exit("FREEZER_ERROR")
  1654. ##########################################################################################
  1655. #
  1656. # Package
  1657. #
  1658. ##########################################################################################
  1659. def Package(target, inputs, opts):
  1660. assert len(inputs) == 1
  1661. # Invoke the ppackage script.
  1662. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1663. if GetOptimizeOption(opts) >= 4:
  1664. command += "-OO "
  1665. if sys.version_info >= (2, 6):
  1666. command += "-B "
  1667. command += "direct/src/p3d/ppackage.py"
  1668. if not RTDIST:
  1669. # Don't compile Python sources, because we might not running in the same
  1670. # Python version as the selected host.
  1671. command += " -N"
  1672. if GetTarget() == "darwin":
  1673. if SDK.get("MACOSX"):
  1674. command += " -R \"%s\"" % SDK["MACOSX"]
  1675. for arch in OSX_ARCHS:
  1676. if arch == "x86_64":
  1677. arch = "amd64"
  1678. command += " -P osx_%s" % arch
  1679. command += " -i \"" + GetOutputDir() + "/stage\""
  1680. if (P3DSUFFIX):
  1681. command += ' -a "' + P3DSUFFIX + '"'
  1682. command += " " + inputs[0]
  1683. if GetOrigExt(target) == '.p3d':
  1684. # Build a specific .p3d file.
  1685. basename = os.path.basename(os.path.splitext(target)[0])
  1686. command += " " + basename
  1687. oscmd(command)
  1688. if GetTarget() == 'windows':
  1689. # Make an .exe that calls this .p3d.
  1690. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1691. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1692. exefile = FindLocation(basename + '.exe', [])
  1693. CompileLink(exefile, [objfile], ['ADVAPI'])
  1694. # Move it to the bin directory.
  1695. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1696. if sys.platform != 'win32':
  1697. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1698. else:
  1699. # This is presumably a package or set of packages.
  1700. oscmd(command)
  1701. ##########################################################################################
  1702. #
  1703. # CompileBundle
  1704. #
  1705. ##########################################################################################
  1706. def CompileBundle(target, inputs, opts):
  1707. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1708. plist = None
  1709. resources = []
  1710. objects = []
  1711. for i in inputs:
  1712. if (i.endswith(".plist")):
  1713. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1714. plist = i
  1715. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1716. resources.append(i)
  1717. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1718. objects.append(i)
  1719. else:
  1720. exit("Don't know how to bundle file %s" % i)
  1721. # Now link the object files to form the bundle.
  1722. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1723. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1724. oscmd("rm -rf %s" % target)
  1725. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1726. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1727. if target.endswith(".app"):
  1728. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1729. else:
  1730. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1731. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1732. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1733. for r in resources:
  1734. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1735. ##########################################################################################
  1736. #
  1737. # CompileMIDL
  1738. #
  1739. ##########################################################################################
  1740. def CompileMIDL(target, src, opts):
  1741. ipath = GetListOption(opts, "DIR:")
  1742. if (COMPILER=="MSVC"):
  1743. cmd = "midl"
  1744. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1745. for x in ipath: cmd += " /I" + x
  1746. for (opt,dir) in INCDIRECTORIES:
  1747. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1748. for (opt,var,val) in DEFSYMBOLS:
  1749. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1750. cmd += " " + BracketNameWithQuotes(src)
  1751. oscmd(cmd)
  1752. ##########################################################################################
  1753. #
  1754. # CompileAnything
  1755. #
  1756. ##########################################################################################
  1757. def CompileAnything(target, inputs, opts, progress = None):
  1758. if (opts.count("DEPENDENCYONLY")):
  1759. return
  1760. if (len(inputs)==0):
  1761. exit("No input files for target "+target)
  1762. infile = inputs[0]
  1763. origsuffix = GetOrigExt(target)
  1764. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1765. # It must be a simple copy operation.
  1766. ProgressOutput(progress, "Copying file", target)
  1767. CopyFile(target, infile)
  1768. if (origsuffix==".exe" and GetHost() != "windows"):
  1769. os.system("chmod +x \"%s\"" % target)
  1770. return
  1771. elif (infile.endswith(".py")):
  1772. if origsuffix == ".obj":
  1773. source = os.path.splitext(target)[0] + ".c"
  1774. SetOrigExt(source, ".c")
  1775. ProgressOutput(progress, "Building frozen source", source)
  1776. FreezePy(source, inputs, opts)
  1777. ProgressOutput(progress, "Building C++ object", target)
  1778. return CompileCxx(target, source, opts)
  1779. if origsuffix == ".exe":
  1780. ProgressOutput(progress, "Building frozen executable", target)
  1781. else:
  1782. ProgressOutput(progress, "Building frozen library", target)
  1783. return FreezePy(target, inputs, opts)
  1784. elif (infile.endswith(".idl")):
  1785. ProgressOutput(progress, "Compiling MIDL file", infile)
  1786. return CompileMIDL(target, infile, opts)
  1787. elif (infile.endswith(".pdef")):
  1788. if origsuffix == '.p3d':
  1789. ProgressOutput(progress, "Building package", target)
  1790. else:
  1791. ProgressOutput(progress, "Building package from pdef file", infile)
  1792. return Package(target, inputs, opts)
  1793. elif origsuffix in SUFFIX_LIB:
  1794. ProgressOutput(progress, "Linking static library", target)
  1795. return CompileLib(target, inputs, opts)
  1796. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1797. if (origsuffix==".exe"):
  1798. ProgressOutput(progress, "Linking executable", target)
  1799. else:
  1800. ProgressOutput(progress, "Linking dynamic library", target)
  1801. # Add version number to the dynamic library, on unix
  1802. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  1803. tplatform = GetTarget()
  1804. if tplatform == "darwin":
  1805. # On Mac, libraries are named like libpanda.1.2.dylib
  1806. if target.lower().endswith(".dylib"):
  1807. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1808. SetOrigExt(target, origsuffix)
  1809. elif tplatform != "windows" and tplatform != "android":
  1810. # On Linux, libraries are named like libpanda.so.1.2
  1811. target += "." + MAJOR_VERSION
  1812. SetOrigExt(target, origsuffix)
  1813. return CompileLink(target, inputs, opts)
  1814. elif (origsuffix==".in"):
  1815. ProgressOutput(progress, "Building Interrogate database", target)
  1816. args = CompileIgate(target, inputs, opts)
  1817. ProgressOutput(progress, "Building C++ object", args[0])
  1818. return CompileCxx(*args)
  1819. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  1820. ProgressOutput(progress, "Building plugin bundle", target)
  1821. return CompileBundle(target, inputs, opts)
  1822. elif (origsuffix==".app"):
  1823. ProgressOutput(progress, "Building application bundle", target)
  1824. return CompileBundle(target, inputs, opts)
  1825. elif (origsuffix==".pz"):
  1826. ProgressOutput(progress, "Compressing", target)
  1827. return CompileEgg(target, infile, opts)
  1828. elif (origsuffix==".egg"):
  1829. ProgressOutput(progress, "Converting", target)
  1830. return CompileEgg(target, infile, opts)
  1831. elif (origsuffix==".res"):
  1832. ProgressOutput(progress, "Building resource object", target)
  1833. return CompileRes(target, infile, opts)
  1834. elif (origsuffix==".rsrc"):
  1835. ProgressOutput(progress, "Building resource object", target)
  1836. return CompileRsrc(target, infile, opts)
  1837. elif (origsuffix==".obj"):
  1838. if (infile.endswith(".cxx")):
  1839. ProgressOutput(progress, "Building C++ object", target)
  1840. return CompileCxx(target, infile, opts)
  1841. elif (infile.endswith(".c")):
  1842. ProgressOutput(progress, "Building C object", target)
  1843. return CompileCxx(target, infile, opts)
  1844. elif (infile.endswith(".mm")):
  1845. ProgressOutput(progress, "Building Objective-C++ object", target)
  1846. return CompileCxx(target, infile, opts)
  1847. elif (infile.endswith(".yxx")):
  1848. ProgressOutput(progress, "Building Bison object", target)
  1849. return CompileBison(target, infile, opts)
  1850. elif (infile.endswith(".lxx")):
  1851. ProgressOutput(progress, "Building Flex object", target)
  1852. return CompileFlex(target, infile, opts)
  1853. elif (infile.endswith(".in")):
  1854. ProgressOutput(progress, "Building Interrogate object", target)
  1855. return CompileImod(target, inputs, opts)
  1856. elif (infile.endswith(".rc")):
  1857. ProgressOutput(progress, "Building resource object", target)
  1858. return CompileRes(target, infile, opts)
  1859. elif (infile.endswith(".r")):
  1860. ProgressOutput(progress, "Building resource object", target)
  1861. return CompileRsrc(target, infile, opts)
  1862. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1863. ##########################################################################################
  1864. #
  1865. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1866. #
  1867. ##########################################################################################
  1868. DTOOL_CONFIG=[
  1869. #_Variable_________________________Windows___________________Unix__________
  1870. ("HAVE_PYTHON", '1', '1'),
  1871. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1872. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1873. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1874. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1875. ("HAVE_MAYA", '1', '1'),
  1876. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1877. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1878. ("USE_PANDAFILESTREAM", '1', '1'),
  1879. ("USE_DELETED_CHAIN", '1', '1'),
  1880. ("HAVE_GLX", 'UNDEF', '1'),
  1881. ("HAVE_WGL", '1', 'UNDEF'),
  1882. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1883. ("HAVE_THREADS", '1', '1'),
  1884. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1885. ("OS_SIMPLE_THREADS", '1', '1'),
  1886. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1887. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1888. ("HAVE_AUDIO", '1', '1'),
  1889. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1890. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1891. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  1892. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1893. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  1894. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  1895. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1896. ("DO_PIPELINING", '1', '1'),
  1897. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1898. ("DEFAULT_PATHSEP", '";"', '":"'),
  1899. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1900. ("HAVE_NAMESPACE", '1', '1'),
  1901. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1902. ("HAVE_LOCKF", '1', '1'),
  1903. ("HAVE_WCHAR_T", '1', '1'),
  1904. ("HAVE_WSTRING", '1', '1'),
  1905. ("HAVE_TYPENAME", '1', '1'),
  1906. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1907. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1908. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1909. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1910. ("HAVE_GETOPT", 'UNDEF', '1'),
  1911. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1912. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1913. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1914. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1915. ("HAVE_STREAMSIZE", '1', '1'),
  1916. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1917. ("HAVE_IOS_BINARY", '1', '1'),
  1918. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1919. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1920. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1921. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1922. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1923. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1924. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1925. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1926. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1927. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1928. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1929. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1930. ("PHAVE_IO_H", '1', 'UNDEF'),
  1931. ("PHAVE_IOSTREAM", '1', '1'),
  1932. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1933. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1934. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1935. ("PHAVE_MALLOC_H", '1', '1'),
  1936. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1937. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1938. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1939. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1940. ("PHAVE_SSTREAM", '1', '1'),
  1941. ("PHAVE_NEW", '1', '1'),
  1942. ("PHAVE_SYS_TYPES_H", '1', '1'),
  1943. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  1944. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  1945. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  1946. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  1947. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  1948. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  1949. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  1950. ("PHAVE_STDINT_H", '1', '1'),
  1951. ("HAVE_RTTI", '1', '1'),
  1952. ("HAVE_X11", 'UNDEF', '1'),
  1953. ("IS_LINUX", 'UNDEF', '1'),
  1954. ("IS_OSX", 'UNDEF', 'UNDEF'),
  1955. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  1956. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  1957. ("LINMATH_ALIGN", '1', '1'),
  1958. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  1959. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  1960. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  1961. ("PHAVE_JPEGINT_H", '1', '1'),
  1962. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  1963. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  1964. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  1965. ("HAVE_SGI_RGB", '1', '1'),
  1966. ("HAVE_TGA", '1', '1'),
  1967. ("HAVE_IMG", '1', '1'),
  1968. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  1969. ("HAVE_BMP", '1', '1'),
  1970. ("HAVE_PNM", '1', '1'),
  1971. ("HAVE_STB_IMAGE", '1', '1'),
  1972. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  1973. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  1974. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  1975. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  1976. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  1977. ("WANT_NATIVE_NET", '1', '1'),
  1978. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  1979. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  1980. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  1981. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  1982. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  1983. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  1984. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  1985. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  1986. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  1987. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1988. ("HAVE_ROCKET_PYTHON", '1', '1'),
  1989. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  1990. ("USE_TAU", 'UNDEF', 'UNDEF'),
  1991. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  1992. # ("_SECURE_SCL", '0', 'UNDEF'),
  1993. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  1994. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  1995. ]
  1996. PRC_PARAMETERS=[
  1997. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  1998. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  1999. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2000. ("PRC_PATH2_ENVVARS", '""', '""'),
  2001. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2002. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2003. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2004. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2005. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2006. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2007. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2008. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2009. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2010. ]
  2011. def WriteConfigSettings():
  2012. dtool_config={}
  2013. prc_parameters={}
  2014. speedtree_parameters={}
  2015. plugin_config={}
  2016. if (GetTarget() == 'windows'):
  2017. for key,win,unix in DTOOL_CONFIG:
  2018. dtool_config[key] = win
  2019. for key,win,unix in PRC_PARAMETERS:
  2020. prc_parameters[key] = win
  2021. else:
  2022. for key,win,unix in DTOOL_CONFIG:
  2023. dtool_config[key] = unix
  2024. for key,win,unix in PRC_PARAMETERS:
  2025. prc_parameters[key] = unix
  2026. for x in PkgListGet():
  2027. if ("HAVE_"+x in dtool_config):
  2028. if (PkgSkip(x)==0):
  2029. dtool_config["HAVE_"+x] = '1'
  2030. else:
  2031. dtool_config["HAVE_"+x] = 'UNDEF'
  2032. dtool_config["HAVE_NET"] = '1'
  2033. if (PkgSkip("NVIDIACG")==0):
  2034. dtool_config["HAVE_CG"] = '1'
  2035. dtool_config["HAVE_CGGL"] = '1'
  2036. dtool_config["HAVE_CGDX9"] = '1'
  2037. if (GetTarget() != "linux"):
  2038. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2039. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2040. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2041. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2042. if (GetTarget() == "darwin"):
  2043. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2044. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2045. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2046. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2047. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2048. dtool_config["HAVE_GLX"] = 'UNDEF'
  2049. dtool_config["IS_LINUX"] = 'UNDEF'
  2050. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2051. dtool_config["IS_OSX"] = '1'
  2052. # 10.4 had a broken ucontext implementation
  2053. if int(platform.mac_ver()[0][3]) <= 4:
  2054. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2055. if (GetTarget() == "freebsd"):
  2056. dtool_config["IS_LINUX"] = 'UNDEF'
  2057. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2058. dtool_config["IS_FREEBSD"] = '1'
  2059. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2060. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2061. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2062. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2063. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2064. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2065. if (GetTarget() == "android"):
  2066. # Android does have RTTI, but we disable it anyway.
  2067. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2068. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2069. dtool_config["HAVE_LOCKF"] = 'UNDEF'
  2070. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2071. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2072. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2073. # This should probably be more sophisticated, such as based
  2074. # on whether the libRocket Python modules are available.
  2075. if (PkgSkip("PYTHON") != 0):
  2076. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2077. if (GetOptimize() <= 3):
  2078. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2079. if (GetOptimize() <= 3):
  2080. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2081. dtool_config["DO_PSTATS"] = '1'
  2082. if (GetOptimize() <= 3):
  2083. dtool_config["DO_DCAST"] = '1'
  2084. if (GetOptimize() <= 3):
  2085. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2086. if (GetOptimize() <= 3):
  2087. dtool_config["DO_MEMORY_USAGE"] = '1'
  2088. if (GetOptimize() <= 3):
  2089. dtool_config["NOTIFY_DEBUG"] = '1'
  2090. if (GetOptimize() >= 4):
  2091. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2092. if (GetOptimize() >= 4):
  2093. # Disable RTTI on release builds.
  2094. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2095. # Now that we have OS_SIMPLE_THREADS, we can support
  2096. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2097. # longer need to disable it for this platform.
  2098. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2099. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2100. if (RTDIST or RUNTIME):
  2101. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2102. if HOST_URL:
  2103. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2104. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2105. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2106. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2107. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2108. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2109. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2110. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2111. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2112. if PkgSkip("GTK2") == 0:
  2113. plugin_config["HAVE_GTK"] = '1'
  2114. if (RUNTIME):
  2115. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2116. # Whether it's present on the system doesn't matter here,
  2117. # as the runtime itself doesn't include or link with X11.
  2118. if (RUNTIME and GetTarget() == 'linux'):
  2119. dtool_config["HAVE_X11"] = '1'
  2120. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2121. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2122. else:
  2123. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2124. if (PkgSkip("SPEEDTREE")==0):
  2125. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2126. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2127. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2128. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2129. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2130. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2131. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2132. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2133. for key in sorted(prc_parameters.keys()):
  2134. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2135. val = OverrideValue(key, prc_parameters[key])
  2136. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2137. else: conf = conf + "#define " + key + " " + val + "\n"
  2138. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2139. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2140. for key in sorted(dtool_config.keys()):
  2141. val = OverrideValue(key, dtool_config[key])
  2142. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2143. else: conf = conf + "#define " + key + " " + val + "\n"
  2144. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2145. if (RTDIST or RUNTIME):
  2146. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2147. for key in sorted(plugin_config.keys()):
  2148. val = plugin_config[key]
  2149. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2150. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2151. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2152. if (PkgSkip("SPEEDTREE")==0):
  2153. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2154. for key in sorted(speedtree_parameters.keys()):
  2155. val = OverrideValue(key, speedtree_parameters[key])
  2156. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2157. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2158. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2159. for x in PkgListGet():
  2160. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2161. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2162. WriteConfigSettings()
  2163. WarnConflictingFiles()
  2164. if SystemLibraryExists("dtoolbase"):
  2165. print("%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor()))
  2166. if SystemLibraryExists("p3dtoolconfig"):
  2167. print("%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor()))
  2168. ##########################################################################################
  2169. #
  2170. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2171. #
  2172. ##########################################################################################
  2173. PANDAVERSION_H="""
  2174. #define PANDA_MAJOR_VERSION $VERSION1
  2175. #define PANDA_MINOR_VERSION $VERSION2
  2176. #define PANDA_SEQUENCE_VERSION $VERSION3
  2177. #define PANDA_VERSION $NVERSION
  2178. #define PANDA_NUMERIC_VERSION $NVERSION
  2179. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2180. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2181. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2182. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2183. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2184. """
  2185. PANDAVERSION_H_RUNTIME="""
  2186. #define PANDA_MAJOR_VERSION 0
  2187. #define PANDA_MINOR_VERSION 0
  2188. #define PANDA_SEQUENCE_VERSION 0
  2189. #define PANDA_VERSION_STR "0.0.0"
  2190. #define PANDA_ABI_VERSION_STR "0.0"
  2191. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2192. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2193. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2194. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2195. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2196. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2197. #define PANDA_PACKAGE_VERSION_STR ""
  2198. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2199. """
  2200. CHECKPANDAVERSION_CXX="""
  2201. # include "dtoolbase.h"
  2202. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  2203. """
  2204. CHECKPANDAVERSION_H="""
  2205. # include "dtoolbase.h"
  2206. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  2207. # ifndef WIN32
  2208. /* For Windows, exporting the symbol from the DLL is sufficient; the
  2209. DLL will not load unless all expected public symbols are defined.
  2210. Other systems may not mind if the symbol is absent unless we
  2211. explictly write code that references it. */
  2212. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  2213. # endif
  2214. """
  2215. P3DACTIVEX_RC="""#include "resource.h"
  2216. #define APSTUDIO_READONLY_SYMBOLS
  2217. #include "afxres.h"
  2218. #undef APSTUDIO_READONLY_SYMBOLS
  2219. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2220. #ifdef _WIN32
  2221. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2222. #pragma code_page(1252)
  2223. #endif
  2224. #ifdef APSTUDIO_INVOKED
  2225. 1 TEXTINCLUDE
  2226. BEGIN
  2227. "resource.h\\0"
  2228. END
  2229. 2 TEXTINCLUDE
  2230. BEGIN
  2231. "#include ""afxres.h""\\r\\n"
  2232. "\\0"
  2233. END
  2234. 3 TEXTINCLUDE
  2235. BEGIN
  2236. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2237. "\\0"
  2238. END
  2239. #endif
  2240. %s
  2241. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2242. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2243. STYLE DS_SETFONT | WS_CHILD
  2244. FONT 8, "MS Sans Serif"
  2245. BEGIN
  2246. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2247. IDC_STATIC,7,25,229,16
  2248. END
  2249. #ifdef APSTUDIO_INVOKED
  2250. GUIDELINES DESIGNINFO
  2251. BEGIN
  2252. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2253. BEGIN
  2254. LEFTMARGIN, 7
  2255. RIGHTMARGIN, 243
  2256. TOPMARGIN, 7
  2257. BOTTOMMARGIN, 55
  2258. END
  2259. END
  2260. #endif
  2261. STRINGTABLE
  2262. BEGIN
  2263. IDS_P3DACTIVEX "P3DActiveX Control"
  2264. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2265. END
  2266. STRINGTABLE
  2267. BEGIN
  2268. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2269. END
  2270. #endif
  2271. #ifndef APSTUDIO_INVOKED
  2272. 1 TYPELIB "P3DActiveX.tlb"
  2273. #endif"""
  2274. def CreatePandaVersionFiles():
  2275. version1=int(VERSION.split(".")[0])
  2276. version2=int(VERSION.split(".")[1])
  2277. version3=int(VERSION.split(".")[2])
  2278. nversion=version1*1000000+version2*1000+version3
  2279. if (DISTRIBUTOR != "cmu"):
  2280. # Subtract 1 if we are not an official version.
  2281. nversion -= 1
  2282. if (RUNTIME):
  2283. pandaversion_h = PANDAVERSION_H_RUNTIME
  2284. else:
  2285. pandaversion_h = PANDAVERSION_H
  2286. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2287. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2288. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2289. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2290. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2291. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2292. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2293. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2294. if (DISTRIBUTOR == "cmu"):
  2295. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2296. else:
  2297. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2298. if GIT_COMMIT:
  2299. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2300. if not RUNTIME:
  2301. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2302. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2303. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2304. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2305. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2306. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2307. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2308. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2309. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2310. if RUNTIME:
  2311. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2312. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2313. else:
  2314. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2315. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2316. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2317. if RUNTIME:
  2318. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2319. "version" : VERSION,
  2320. "description" : "Runs 3-D games and interactive applets",
  2321. "filename" : "p3dactivex.ocx",
  2322. "mimetype" : "application/x-panda3d",
  2323. "extension" : "p3d",
  2324. "filedesc" : "Panda3D applet"}
  2325. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2326. CreatePandaVersionFiles()
  2327. ##########################################################################################
  2328. #
  2329. # Copy the "direct" tree
  2330. #
  2331. ##########################################################################################
  2332. if (PkgSkip("DIRECT")==0):
  2333. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2334. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2335. # This file used to be copied, but would nowadays cause conflicts.
  2336. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2337. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2338. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2339. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2340. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2341. # This directory doesn't exist at all any more.
  2342. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2343. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2344. # These files used to exist; remove them to avoid conflicts.
  2345. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2346. '_core.pyd', '_core.so',
  2347. 'direct.py', 'direct.pyc', 'direct.pyo',
  2348. '_direct.pyd', '_direct.so',
  2349. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2350. for basename in del_files:
  2351. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2352. if os.path.isfile(path):
  2353. print("Removing %s" % (path))
  2354. os.remove(path)
  2355. # Write an appropriate panda3d/__init__.py
  2356. p3d_init = """"Python bindings for the Panda3D libraries"
  2357. """
  2358. if GetTarget() == 'windows':
  2359. p3d_init += """
  2360. import os
  2361. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2362. if os.path.isfile(os.path.join(bindir, 'libpanda.dll')):
  2363. if not os.environ.get('PATH'):
  2364. os.environ['PATH'] = bindir
  2365. else:
  2366. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2367. del os, bindir
  2368. """
  2369. if not PkgSkip("PYTHON"):
  2370. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2371. # Also add this file, for backward compatibility.
  2372. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2373. if __debug__:
  2374. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2375. from .interrogatedb import *
  2376. """)
  2377. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2378. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2379. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2380. os.remove(fn)
  2381. panda_modules = ['core']
  2382. if not PkgSkip("PANDAPHYSICS"):
  2383. panda_modules.append('physics')
  2384. if not PkgSkip('PANDAFX'):
  2385. panda_modules.append('fx')
  2386. if not PkgSkip("DIRECT"):
  2387. panda_modules.append('direct')
  2388. if not PkgSkip("VISION"):
  2389. panda_modules.append('vision')
  2390. if not PkgSkip("SKEL"):
  2391. panda_modules.append('skel')
  2392. if not PkgSkip("EGG"):
  2393. panda_modules.append('egg')
  2394. if not PkgSkip("AWESOMIUM"):
  2395. panda_modules.append('awesomium')
  2396. if not PkgSkip("ODE"):
  2397. panda_modules.append('ode')
  2398. if not PkgSkip("VRPN"):
  2399. panda_modules.append('vrpn')
  2400. panda_modules_code = """
  2401. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2402. if __debug__:
  2403. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2404. """
  2405. for module in panda_modules:
  2406. panda_modules_code += """
  2407. try:
  2408. from panda3d.%s import *
  2409. except ImportError as err:
  2410. if "No module named %s" not in str(err):
  2411. raise""" % (module, module)
  2412. exthelpers_code = """
  2413. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2414. from direct.extensions_native.extension_native_helpers import *
  2415. """
  2416. if not PkgSkip("PYTHON"):
  2417. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2418. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2419. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2420. ##########################################################################################
  2421. #
  2422. # Generate the PRC files into the ETC directory.
  2423. #
  2424. ##########################################################################################
  2425. confautoprc = ReadFile("makepanda/confauto.in")
  2426. if (PkgSkip("SPEEDTREE")==0):
  2427. # If SpeedTree is available, enable it in the config file
  2428. confautoprc = confautoprc.replace('#st#', '')
  2429. else:
  2430. # otherwise, disable it.
  2431. confautoprc = confautoprc.replace('#st#', '#')
  2432. if (os.path.isfile("makepanda/myconfig.in")):
  2433. configprc = ReadFile("makepanda/myconfig.in")
  2434. else:
  2435. configprc = ReadFile("makepanda/config.in")
  2436. if (GetTarget() == 'windows'):
  2437. configprc = configprc.replace("$HOME/.panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2438. else:
  2439. configprc = configprc.replace("aux-display pandadx9", "")
  2440. if (GetTarget() == 'darwin'):
  2441. configprc = configprc.replace(".panda3d/cache", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2442. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2443. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2444. if GetTarget() == 'windows':
  2445. # Convert to Windows newlines.
  2446. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2447. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2448. else:
  2449. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2450. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2451. ##########################################################################################
  2452. #
  2453. # Copy the precompiled binaries and DLLs into the build.
  2454. #
  2455. ##########################################################################################
  2456. tp_dir = GetThirdpartyDir()
  2457. if tp_dir is not None:
  2458. dylibs = set()
  2459. if GetTarget() == 'darwin':
  2460. # Make a list of all the dylibs we ship, to figure out whether we should use
  2461. # install_name_tool to correct the library reference to point to our copy.
  2462. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2463. dylibs.add(os.path.basename(lib))
  2464. if not PkgSkip("PYTHON"):
  2465. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2466. dylibs.add(os.path.basename(lib))
  2467. for pkg in PkgListGet():
  2468. if PkgSkip(pkg):
  2469. continue
  2470. tp_pkg = tp_dir + pkg.lower()
  2471. if GetTarget() == 'windows':
  2472. if os.path.exists(tp_pkg + "/bin"):
  2473. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2474. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2475. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2476. elif GetTarget() == 'darwin':
  2477. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2478. if not PkgSkip("PYTHON"):
  2479. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2480. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2481. if pkg != 'PYTHON':
  2482. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2483. for tp_lib in tp_libs:
  2484. basename = os.path.basename(tp_lib)
  2485. if basename.endswith('.dylib'):
  2486. # It's a dynamic link library. Put it in the lib directory.
  2487. target = GetOutputDir() + "/lib/" + basename
  2488. dep_prefix = "@loader_path/../lib/"
  2489. lib_id = dep_prefix + basename
  2490. else:
  2491. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2492. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2493. target = GetOutputDir() + "/" + basename
  2494. dep_prefix = "@loader_path/lib/"
  2495. lib_id = basename
  2496. if not NeedsBuild([target], [tp_lib]):
  2497. continue
  2498. CopyFile(target, tp_lib)
  2499. if os.path.islink(target) or target.endswith('.py'):
  2500. continue
  2501. # Correct the inter-library dependencies so that the build is relocatable.
  2502. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2503. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2504. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2505. line = line.strip()
  2506. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2507. continue
  2508. libdep = line.split(" ", 1)[0]
  2509. dep_basename = os.path.basename(libdep)
  2510. if dep_basename in dylibs:
  2511. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_basename, target), True)
  2512. JustBuilt([target], [tp_lib])
  2513. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2514. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2515. else: # Linux / FreeBSD case.
  2516. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2517. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2518. if not PkgSkip("PYTHON"):
  2519. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2520. base = os.path.basename(tp_lib)
  2521. if base.startswith('lib'):
  2522. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2523. else:
  2524. # It's a Python module, like _rocketcore.so.
  2525. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2526. if GetTarget() == 'windows':
  2527. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2528. if not PkgSkip("PYTHON") and not RTDIST:
  2529. # We need to copy the Python DLL to the bin directory for now.
  2530. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2531. if GetOptimize() <= 2:
  2532. pydll += "_d.dll"
  2533. else:
  2534. pydll += ".dll"
  2535. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2536. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2537. CopyFile(GetOutputDir() + "/bin/", fn)
  2538. # Copy the whole Python directory.
  2539. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2540. # NB: Python does not always ship with the correct manifest/dll.
  2541. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2542. manifest = GetOutputDir() + '/tmp/python.manifest'
  2543. if os.path.isfile(manifest):
  2544. os.unlink(manifest)
  2545. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2546. if os.path.isfile(manifest):
  2547. import xml.etree.ElementTree as ET
  2548. tree = ET.parse(manifest)
  2549. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2550. else:
  2551. idents = ()
  2552. for ident in idents:
  2553. sxs_name = '_'.join([
  2554. ident.get('processorArchitecture'),
  2555. ident.get('name').lower(),
  2556. ident.get('publicKeyToken'),
  2557. ident.get('version'),
  2558. ])
  2559. # Find the manifest matching these parameters.
  2560. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2561. manifests = glob.glob(pattern)
  2562. if not manifests:
  2563. print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern))
  2564. continue
  2565. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2566. # Also copy the corresponding msvcr dll.
  2567. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2568. for file in glob.glob(pattern):
  2569. CopyFile(GetOutputDir() + "/python/", file)
  2570. # Copy python.exe to ppython.exe.
  2571. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2572. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2573. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2574. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2575. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2576. # Copy over the MSVC runtime.
  2577. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2578. vcver = SDK["VISUALSTUDIO_VERSION"].replace('.', '')
  2579. crtname = "Microsoft.VC%s.CRT" % (vcver)
  2580. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2581. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2582. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2583. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2584. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2585. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2586. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2587. ########################################################################
  2588. ##
  2589. ## Copy various stuff into the build.
  2590. ##
  2591. ########################################################################
  2592. if GetTarget() == 'windows':
  2593. # Convert to Windows newlines so they can be opened by notepad.
  2594. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2595. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2596. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2597. else:
  2598. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2599. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2600. if (PkgSkip("PANDATOOL")==0):
  2601. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2602. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2603. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2604. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2605. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2606. # Since Eigen is included by all sorts of core headers, as a convenience
  2607. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2608. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2609. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2610. ########################################################################
  2611. #
  2612. # Copy header files to the built/include/parser-inc directory.
  2613. #
  2614. ########################################################################
  2615. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2616. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2617. ########################################################################
  2618. #
  2619. # Transfer all header files to the built/include directory.
  2620. #
  2621. ########################################################################
  2622. CopyAllHeaders('dtool/src/dtoolbase')
  2623. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2624. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2625. CopyAllHeaders('dtool/metalibs/dtool')
  2626. CopyAllHeaders('dtool/src/cppparser')
  2627. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2628. CopyAllHeaders('dtool/src/dconfig')
  2629. CopyAllHeaders('dtool/src/interrogatedb')
  2630. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2631. CopyAllHeaders('dtool/src/pystub')
  2632. CopyAllHeaders('dtool/src/interrogate')
  2633. CopyAllHeaders('dtool/src/test_interrogate')
  2634. CopyAllHeaders('panda/src/putil')
  2635. CopyAllHeaders('panda/src/pandabase')
  2636. CopyAllHeaders('panda/src/express')
  2637. CopyAllHeaders('panda/src/downloader')
  2638. CopyAllHeaders('panda/metalibs/pandaexpress')
  2639. CopyAllHeaders('panda/src/pipeline')
  2640. CopyAllHeaders('panda/src/linmath')
  2641. CopyAllHeaders('panda/src/putil')
  2642. CopyAllHeaders('dtool/src/prckeys')
  2643. CopyAllHeaders('panda/src/audio')
  2644. CopyAllHeaders('panda/src/event')
  2645. CopyAllHeaders('panda/src/mathutil')
  2646. CopyAllHeaders('panda/src/gsgbase')
  2647. CopyAllHeaders('panda/src/pnmimage')
  2648. CopyAllHeaders('panda/src/nativenet')
  2649. CopyAllHeaders('panda/src/net')
  2650. CopyAllHeaders('panda/src/pstatclient')
  2651. CopyAllHeaders('panda/src/gobj')
  2652. CopyAllHeaders('panda/src/movies')
  2653. CopyAllHeaders('panda/src/pgraphnodes')
  2654. CopyAllHeaders('panda/src/pgraph')
  2655. CopyAllHeaders('panda/src/cull')
  2656. CopyAllHeaders('panda/src/chan')
  2657. CopyAllHeaders('panda/src/char')
  2658. CopyAllHeaders('panda/src/dgraph')
  2659. CopyAllHeaders('panda/src/display')
  2660. CopyAllHeaders('panda/src/device')
  2661. CopyAllHeaders('panda/src/pnmtext')
  2662. CopyAllHeaders('panda/src/text')
  2663. CopyAllHeaders('panda/src/grutil')
  2664. if (PkgSkip("VISION")==0):
  2665. CopyAllHeaders('panda/src/vision')
  2666. CopyAllHeaders('panda/src/awesomium')
  2667. if (PkgSkip("FFMPEG")==0):
  2668. CopyAllHeaders('panda/src/ffmpeg')
  2669. CopyAllHeaders('panda/src/tform')
  2670. CopyAllHeaders('panda/src/collide')
  2671. CopyAllHeaders('panda/src/parametrics')
  2672. CopyAllHeaders('panda/src/pgui')
  2673. CopyAllHeaders('panda/src/pnmimagetypes')
  2674. CopyAllHeaders('panda/src/recorder')
  2675. if (PkgSkip("ROCKET")==0):
  2676. CopyAllHeaders('panda/src/rocket')
  2677. if (PkgSkip("VRPN")==0):
  2678. CopyAllHeaders('panda/src/vrpn')
  2679. CopyAllHeaders('panda/src/wgldisplay')
  2680. CopyAllHeaders('panda/src/ode')
  2681. CopyAllHeaders('panda/metalibs/pandaode')
  2682. if (PkgSkip("PANDAPHYSICS")==0):
  2683. CopyAllHeaders('panda/src/physics')
  2684. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2685. CopyAllHeaders('panda/src/particlesystem')
  2686. CopyAllHeaders('panda/src/dxml')
  2687. CopyAllHeaders('panda/metalibs/panda')
  2688. CopyAllHeaders('panda/src/audiotraits')
  2689. CopyAllHeaders('panda/src/audiotraits')
  2690. CopyAllHeaders('panda/src/distort')
  2691. CopyAllHeaders('panda/src/downloadertools')
  2692. CopyAllHeaders('panda/src/windisplay')
  2693. CopyAllHeaders('panda/src/dxgsg9')
  2694. CopyAllHeaders('panda/metalibs/pandadx9')
  2695. if not PkgSkip("EGG"):
  2696. CopyAllHeaders('panda/src/egg')
  2697. CopyAllHeaders('panda/src/egg2pg')
  2698. CopyAllHeaders('panda/src/framework')
  2699. CopyAllHeaders('panda/metalibs/pandafx')
  2700. CopyAllHeaders('panda/src/glstuff')
  2701. CopyAllHeaders('panda/src/glgsg')
  2702. CopyAllHeaders('panda/src/glesgsg')
  2703. CopyAllHeaders('panda/src/gles2gsg')
  2704. if not PkgSkip("EGG"):
  2705. CopyAllHeaders('panda/metalibs/pandaegg')
  2706. if GetTarget() == 'windows':
  2707. CopyAllHeaders('panda/src/wgldisplay')
  2708. elif GetTarget() == 'darwin':
  2709. CopyAllHeaders('panda/src/osxdisplay')
  2710. CopyAllHeaders('panda/src/cocoadisplay')
  2711. elif GetTarget() == 'android':
  2712. CopyAllHeaders('panda/src/android')
  2713. CopyAllHeaders('panda/src/androiddisplay')
  2714. else:
  2715. CopyAllHeaders('panda/src/x11display')
  2716. CopyAllHeaders('panda/src/glxdisplay')
  2717. CopyAllHeaders('panda/src/egldisplay')
  2718. CopyAllHeaders('panda/src/vulkandisplay')
  2719. CopyAllHeaders('panda/metalibs/pandagl')
  2720. CopyAllHeaders('panda/metalibs/pandagles')
  2721. CopyAllHeaders('panda/metalibs/pandagles2')
  2722. CopyAllHeaders('panda/metalibs/pandaphysics')
  2723. CopyAllHeaders('panda/src/testbed')
  2724. if (PkgSkip("PHYSX")==0):
  2725. CopyAllHeaders('panda/src/physx')
  2726. CopyAllHeaders('panda/metalibs/pandaphysx')
  2727. if (PkgSkip("BULLET")==0):
  2728. CopyAllHeaders('panda/src/bullet')
  2729. CopyAllHeaders('panda/metalibs/pandabullet')
  2730. if (PkgSkip("SPEEDTREE")==0):
  2731. CopyAllHeaders('panda/src/speedtree')
  2732. if (PkgSkip("DIRECT")==0):
  2733. CopyAllHeaders('direct/src/directbase')
  2734. CopyAllHeaders('direct/src/dcparser')
  2735. CopyAllHeaders('direct/src/deadrec')
  2736. CopyAllHeaders('direct/src/distributed')
  2737. CopyAllHeaders('direct/src/interval')
  2738. CopyAllHeaders('direct/src/showbase')
  2739. CopyAllHeaders('direct/metalibs/direct')
  2740. CopyAllHeaders('direct/src/dcparse')
  2741. if (RUNTIME or RTDIST):
  2742. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2743. if (RUNTIME):
  2744. CopyAllHeaders('direct/src/plugin_npapi')
  2745. CopyAllHeaders('direct/src/plugin_standalone')
  2746. if (PkgSkip("PANDATOOL")==0):
  2747. CopyAllHeaders('pandatool/src/pandatoolbase')
  2748. CopyAllHeaders('pandatool/src/converter')
  2749. CopyAllHeaders('pandatool/src/progbase')
  2750. CopyAllHeaders('pandatool/src/eggbase')
  2751. CopyAllHeaders('pandatool/src/bam')
  2752. CopyAllHeaders('pandatool/src/cvscopy')
  2753. CopyAllHeaders('pandatool/src/daeegg')
  2754. CopyAllHeaders('pandatool/src/daeprogs')
  2755. CopyAllHeaders('pandatool/src/dxf')
  2756. CopyAllHeaders('pandatool/src/dxfegg')
  2757. CopyAllHeaders('pandatool/src/dxfprogs')
  2758. CopyAllHeaders('pandatool/src/palettizer')
  2759. CopyAllHeaders('pandatool/src/egg-mkfont')
  2760. CopyAllHeaders('pandatool/src/eggcharbase')
  2761. CopyAllHeaders('pandatool/src/egg-optchar')
  2762. CopyAllHeaders('pandatool/src/egg-palettize')
  2763. CopyAllHeaders('pandatool/src/egg-qtess')
  2764. CopyAllHeaders('pandatool/src/eggprogs')
  2765. CopyAllHeaders('pandatool/src/flt')
  2766. CopyAllHeaders('pandatool/src/fltegg')
  2767. CopyAllHeaders('pandatool/src/fltprogs')
  2768. CopyAllHeaders('pandatool/src/imagebase')
  2769. CopyAllHeaders('pandatool/src/imageprogs')
  2770. CopyAllHeaders('pandatool/src/pfmprogs')
  2771. CopyAllHeaders('pandatool/src/lwo')
  2772. CopyAllHeaders('pandatool/src/lwoegg')
  2773. CopyAllHeaders('pandatool/src/lwoprogs')
  2774. CopyAllHeaders('pandatool/src/maya')
  2775. CopyAllHeaders('pandatool/src/mayaegg')
  2776. CopyAllHeaders('pandatool/src/maxegg')
  2777. CopyAllHeaders('pandatool/src/maxprogs')
  2778. CopyAllHeaders('pandatool/src/objegg')
  2779. CopyAllHeaders('pandatool/src/objprogs')
  2780. CopyAllHeaders('pandatool/src/vrml')
  2781. CopyAllHeaders('pandatool/src/vrmlegg')
  2782. CopyAllHeaders('pandatool/src/xfile')
  2783. CopyAllHeaders('pandatool/src/xfileegg')
  2784. CopyAllHeaders('pandatool/src/ptloader')
  2785. CopyAllHeaders('pandatool/src/miscprogs')
  2786. CopyAllHeaders('pandatool/src/pstatserver')
  2787. CopyAllHeaders('pandatool/src/softprogs')
  2788. CopyAllHeaders('pandatool/src/text-stats')
  2789. CopyAllHeaders('pandatool/src/vrmlprogs')
  2790. CopyAllHeaders('pandatool/src/win-stats')
  2791. CopyAllHeaders('pandatool/src/xfileprogs')
  2792. if (PkgSkip("CONTRIB")==0):
  2793. CopyAllHeaders('contrib/src/contribbase')
  2794. CopyAllHeaders('contrib/src/ai')
  2795. ########################################################################
  2796. #
  2797. # Copy Java files, if applicable
  2798. #
  2799. ########################################################################
  2800. if GetTarget() == 'android':
  2801. CopyAllJavaSources('panda/src/android')
  2802. ########################################################################
  2803. #
  2804. # These definitions are syntactic shorthand. They make it easy
  2805. # to link with the usual libraries without listing them all.
  2806. #
  2807. ########################################################################
  2808. COMMON_DTOOL_LIBS=[
  2809. 'libp3dtool.dll',
  2810. 'libp3dtoolconfig.dll',
  2811. ]
  2812. COMMON_PANDA_LIBS=[
  2813. 'libpanda.dll',
  2814. 'libpandaexpress.dll'
  2815. ] + COMMON_DTOOL_LIBS
  2816. COMMON_EGG2X_LIBS=[
  2817. 'libp3eggbase.lib',
  2818. 'libp3progbase.lib',
  2819. 'libp3converter.lib',
  2820. 'libp3pandatoolbase.lib',
  2821. 'libpandaegg.dll',
  2822. ] + COMMON_PANDA_LIBS
  2823. ########################################################################
  2824. #
  2825. # This section contains a list of all the files that need to be compiled.
  2826. #
  2827. ########################################################################
  2828. print("Generating dependencies...")
  2829. sys.stdout.flush()
  2830. #
  2831. # Compile Panda icon resource file.
  2832. # We do it first because we need it at
  2833. # the time we compile an executable.
  2834. #
  2835. if GetTarget() == 'windows':
  2836. OPTS=['DIR:panda/src/configfiles']
  2837. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2838. #
  2839. # DIRECTORY: dtool/src/dtoolbase/
  2840. #
  2841. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2842. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2843. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2844. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2845. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2846. #
  2847. # DIRECTORY: dtool/src/dtoolutil/
  2848. #
  2849. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2850. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2851. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2852. if GetTarget() == 'darwin':
  2853. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2854. #
  2855. # DIRECTORY: dtool/metalibs/dtool/
  2856. #
  2857. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2858. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2859. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2860. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2861. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2862. if GetTarget() == 'darwin':
  2863. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2864. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2865. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2866. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2867. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2868. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2869. #
  2870. # DIRECTORY: dtool/src/cppparser/
  2871. #
  2872. if (not RUNTIME):
  2873. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2874. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2875. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2876. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2877. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2878. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2879. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2880. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2881. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2882. #
  2883. # DIRECTORY: dtool/src/prc/
  2884. #
  2885. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2886. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2887. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2888. #
  2889. # DIRECTORY: dtool/src/dconfig/
  2890. #
  2891. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2892. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2893. #
  2894. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2895. #
  2896. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2897. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2898. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2899. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2900. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2901. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2902. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2903. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  2904. #
  2905. # DIRECTORY: dtool/src/interrogatedb/
  2906. #
  2907. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON']
  2908. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2909. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2910. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  2911. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  2912. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  2913. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  2914. TargetAdd('libp3interrogatedb.dll', opts=['PYTHON'])
  2915. if not PkgSkip("PYTHON"):
  2916. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  2917. # stuff, so it has been renamed appropriately.
  2918. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON']
  2919. TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2920. TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  2921. TargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  2922. TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  2923. TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  2924. TargetAdd('interrogatedb.pyd', opts=['PYTHON'])
  2925. #
  2926. # DIRECTORY: dtool/src/pystub/
  2927. #
  2928. if not RUNTIME and not RTDIST:
  2929. OPTS=['DIR:dtool/src/pystub']
  2930. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2931. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  2932. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  2933. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  2934. #
  2935. # DIRECTORY: dtool/src/interrogate/
  2936. #
  2937. if (not RUNTIME):
  2938. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2939. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2940. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2941. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  2942. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  2943. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  2944. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  2945. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  2946. TargetAdd('interrogate.exe', input='libp3pystub.lib')
  2947. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2948. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  2949. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  2950. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  2951. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  2952. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  2953. TargetAdd('interrogate_module.exe', input='libp3pystub.lib')
  2954. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2955. if (not RTDIST):
  2956. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  2957. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  2958. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  2959. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  2960. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  2961. TargetAdd('parse_file.exe', input='libp3pystub.lib')
  2962. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2963. #
  2964. # DIRECTORY: dtool/src/prckeys/
  2965. #
  2966. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  2967. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  2968. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  2969. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  2970. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  2971. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2972. #
  2973. # DIRECTORY: dtool/src/test_interrogate/
  2974. #
  2975. if (not RTDIST and not RUNTIME):
  2976. OPTS=['DIR:dtool/src/test_interrogate']
  2977. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  2978. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  2979. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  2980. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  2981. TargetAdd('test_interrogate.exe', input='libp3pystub.lib')
  2982. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2983. #
  2984. # DIRECTORY: panda/src/pandabase/
  2985. #
  2986. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  2987. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  2988. #
  2989. # DIRECTORY: panda/src/express/
  2990. #
  2991. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  2992. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  2993. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  2994. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON']
  2995. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  2996. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  2997. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  2998. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  2999. TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3000. #
  3001. # DIRECTORY: panda/src/downloader/
  3002. #
  3003. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3004. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3005. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3006. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON']
  3007. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3008. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3009. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3010. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  3011. TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3012. #
  3013. # DIRECTORY: panda/metalibs/pandaexpress/
  3014. #
  3015. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3016. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3017. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3018. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3019. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3020. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3021. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3022. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3023. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3024. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER'])
  3025. #
  3026. # DIRECTORY: panda/src/pipeline/
  3027. #
  3028. if (not RUNTIME):
  3029. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3030. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3031. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3032. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3033. OPTS=['DIR:panda/src/pipeline', 'PYTHON']
  3034. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3035. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3036. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3037. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  3038. TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3039. #
  3040. # DIRECTORY: panda/src/linmath/
  3041. #
  3042. if (not RUNTIME):
  3043. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3044. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3045. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3046. OPTS=['DIR:panda/src/linmath', 'PYTHON']
  3047. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3048. for ifile in IGATEFILES[:]:
  3049. if "_src." in ifile:
  3050. IGATEFILES.remove(ifile)
  3051. IGATEFILES.remove('cast_to_double.h')
  3052. IGATEFILES.remove('lmat_ops.h')
  3053. IGATEFILES.remove('cast_to_float.h')
  3054. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3055. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3056. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  3057. #
  3058. # DIRECTORY: panda/src/putil/
  3059. #
  3060. if (not RUNTIME):
  3061. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3062. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3063. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3064. OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON']
  3065. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3066. IGATEFILES.remove("test_bam.h")
  3067. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3068. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3069. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  3070. TargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3071. #
  3072. # DIRECTORY: panda/src/audio/
  3073. #
  3074. if (not RUNTIME):
  3075. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3076. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3077. OPTS=['DIR:panda/src/audio', 'PYTHON']
  3078. IGATEFILES=["audio.h"]
  3079. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3080. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3081. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  3082. #
  3083. # DIRECTORY: panda/src/event/
  3084. #
  3085. if (not RUNTIME):
  3086. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3087. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3088. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3089. OPTS=['DIR:panda/src/event', 'PYTHON']
  3090. TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3091. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3092. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3093. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3094. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  3095. #
  3096. # DIRECTORY: panda/src/mathutil/
  3097. #
  3098. if (not RUNTIME):
  3099. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3100. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3101. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3102. OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON']
  3103. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3104. for ifile in IGATEFILES[:]:
  3105. if "_src." in ifile:
  3106. IGATEFILES.remove(ifile)
  3107. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3108. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3109. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  3110. #
  3111. # DIRECTORY: panda/src/gsgbase/
  3112. #
  3113. if (not RUNTIME):
  3114. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3115. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3116. OPTS=['DIR:panda/src/gsgbase', 'PYTHON']
  3117. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3118. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3119. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3120. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  3121. #
  3122. # DIRECTORY: panda/src/pnmimage/
  3123. #
  3124. if (not RUNTIME):
  3125. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3126. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3127. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3128. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3129. OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON']
  3130. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3131. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3132. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3133. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  3134. TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3135. #
  3136. # DIRECTORY: panda/src/nativenet/
  3137. #
  3138. if (not RUNTIME):
  3139. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3140. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3141. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON']
  3142. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3143. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3144. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3145. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  3146. #
  3147. # DIRECTORY: panda/src/net/
  3148. #
  3149. if (not RUNTIME):
  3150. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3151. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3152. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3153. OPTS=['DIR:panda/src/net', 'PYTHON']
  3154. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3155. IGATEFILES.remove("datagram_ui.h")
  3156. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3157. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3158. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  3159. #
  3160. # DIRECTORY: panda/src/pstatclient/
  3161. #
  3162. if (not RUNTIME):
  3163. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3164. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3165. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3166. OPTS=['DIR:panda/src/pstatclient', 'PYTHON']
  3167. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3168. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3169. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3170. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  3171. #
  3172. # DIRECTORY: panda/src/gobj/
  3173. #
  3174. if (not RUNTIME):
  3175. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH', 'VULKAN']
  3176. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3177. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  3178. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON']
  3179. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3180. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3181. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3182. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3183. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  3184. TargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3185. #
  3186. # DIRECTORY: panda/src/pgraphnodes/
  3187. #
  3188. if (not RUNTIME):
  3189. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3190. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3191. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3192. OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON']
  3193. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3194. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3195. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3196. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  3197. #
  3198. # DIRECTORY: panda/src/pgraph/
  3199. #
  3200. if (not RUNTIME):
  3201. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3202. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3203. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3204. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3205. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3206. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3207. OPTS=['DIR:panda/src/pgraph', 'PYTHON']
  3208. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3209. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3210. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3211. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  3212. TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3213. #
  3214. # DIRECTORY: panda/src/cull/
  3215. #
  3216. if (not RUNTIME):
  3217. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3218. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3219. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3220. OPTS=['DIR:panda/src/cull', 'PYTHON']
  3221. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3222. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3223. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3224. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  3225. #
  3226. # DIRECTORY: panda/src/chan/
  3227. #
  3228. if (not RUNTIME):
  3229. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3230. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3231. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3232. OPTS=['DIR:panda/src/chan', 'PYTHON']
  3233. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3234. IGATEFILES.remove('movingPart.h')
  3235. IGATEFILES.remove('animChannelFixed.h')
  3236. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3237. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3238. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  3239. # DIRECTORY: panda/src/char/
  3240. #
  3241. if (not RUNTIME):
  3242. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3243. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3244. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3245. OPTS=['DIR:panda/src/char', 'PYTHON']
  3246. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3247. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3248. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3249. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  3250. #
  3251. # DIRECTORY: panda/src/dgraph/
  3252. #
  3253. if (not RUNTIME):
  3254. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3255. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3256. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3257. OPTS=['DIR:panda/src/dgraph', 'PYTHON']
  3258. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3259. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3260. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3261. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  3262. #
  3263. # DIRECTORY: panda/src/display/
  3264. #
  3265. if (not RUNTIME):
  3266. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA']
  3267. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3268. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3269. OPTS=['DIR:panda/src/display', 'PYTHON']
  3270. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3271. IGATEFILES.remove("renderBuffer.h")
  3272. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3273. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3274. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  3275. TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
  3276. TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx')
  3277. TargetAdd('p3display_pythonGraphicsWindowProc.obj', opts=OPTS, input='pythonGraphicsWindowProc.cxx')
  3278. if RTDIST and GetTarget() == 'darwin':
  3279. OPTS=['DIR:panda/src/display']
  3280. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3281. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3282. #
  3283. # DIRECTORY: panda/src/device/
  3284. #
  3285. if (not RUNTIME):
  3286. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3287. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3288. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3289. OPTS=['DIR:panda/src/device', 'PYTHON']
  3290. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3291. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3292. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3293. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  3294. #
  3295. # DIRECTORY: panda/src/pnmtext/
  3296. #
  3297. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3298. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3299. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3300. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON']
  3301. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3302. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3303. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3304. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  3305. #
  3306. # DIRECTORY: panda/src/text/
  3307. #
  3308. if (not RUNTIME):
  3309. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE']
  3310. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3311. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3312. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON']
  3313. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3314. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3315. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3316. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  3317. #
  3318. # DIRECTORY: panda/src/movies/
  3319. #
  3320. if (not RUNTIME):
  3321. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS']
  3322. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3323. OPTS=['DIR:panda/src/movies', 'VORBIS', 'PYTHON']
  3324. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3325. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3326. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3327. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  3328. #
  3329. # DIRECTORY: panda/src/grutil/
  3330. #
  3331. if (not RUNTIME):
  3332. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3333. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3334. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3335. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3336. OPTS=['DIR:panda/src/grutil', 'PYTHON']
  3337. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3338. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3339. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3340. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3341. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  3342. #
  3343. # DIRECTORY: panda/src/tform/
  3344. #
  3345. if (not RUNTIME):
  3346. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3347. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3348. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3349. OPTS=['DIR:panda/src/tform', 'PYTHON']
  3350. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3351. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3352. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3353. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  3354. #
  3355. # DIRECTORY: panda/src/collide/
  3356. #
  3357. if (not RUNTIME):
  3358. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3359. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3360. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3361. OPTS=['DIR:panda/src/collide', 'PYTHON']
  3362. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3363. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3364. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3365. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  3366. #
  3367. # DIRECTORY: panda/src/parametrics/
  3368. #
  3369. if (not RUNTIME):
  3370. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3371. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3372. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3373. OPTS=['DIR:panda/src/parametrics', 'PYTHON']
  3374. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3375. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3376. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3377. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  3378. #
  3379. # DIRECTORY: panda/src/pgui/
  3380. #
  3381. if (not RUNTIME):
  3382. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3383. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3384. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3385. OPTS=['DIR:panda/src/pgui', 'PYTHON']
  3386. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3387. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3388. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3389. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  3390. #
  3391. # DIRECTORY: panda/src/pnmimagetypes/
  3392. #
  3393. if (not RUNTIME):
  3394. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3395. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3396. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3397. #
  3398. # DIRECTORY: panda/src/recorder/
  3399. #
  3400. if (not RUNTIME):
  3401. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3402. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3403. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3404. OPTS=['DIR:panda/src/recorder', 'PYTHON']
  3405. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3406. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3407. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3408. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  3409. #
  3410. # DIRECTORY: panda/src/dxml/
  3411. #
  3412. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3413. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3414. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3415. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3416. if (not RUNTIME):
  3417. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3418. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3419. OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON']
  3420. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3421. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3422. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3423. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  3424. #
  3425. # DIRECTORY: panda/metalibs/panda/
  3426. #
  3427. if (not RUNTIME):
  3428. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG',
  3429. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3430. 'SQUISH', 'NVIDIACG', 'VORBIS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI']
  3431. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3432. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3433. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3434. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3435. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3436. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3437. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3438. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3439. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3440. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3441. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3442. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3443. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3444. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3445. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3446. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3447. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3448. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3449. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3450. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3451. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3452. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3453. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3454. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3455. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3456. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3457. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3458. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3459. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3460. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3461. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3462. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3463. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3464. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3465. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3466. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3467. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3468. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3469. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3470. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3471. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3472. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3473. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3474. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3475. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3476. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3477. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3478. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3479. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3480. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3481. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3482. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3483. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3484. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3485. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3486. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3487. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3488. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3489. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3490. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3491. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3492. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3493. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3494. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3495. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3496. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3497. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3498. if PkgSkip("FREETYPE")==0:
  3499. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3500. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3501. TargetAdd('libpanda.dll', opts=OPTS)
  3502. TargetAdd('core_module.obj', input='libp3downloader.in')
  3503. TargetAdd('core_module.obj', input='libp3express.in')
  3504. TargetAdd('core_module.obj', input='libp3recorder.in')
  3505. TargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3506. TargetAdd('core_module.obj', input='libp3pgraph.in')
  3507. TargetAdd('core_module.obj', input='libp3cull.in')
  3508. TargetAdd('core_module.obj', input='libp3grutil.in')
  3509. TargetAdd('core_module.obj', input='libp3chan.in')
  3510. TargetAdd('core_module.obj', input='libp3pstatclient.in')
  3511. TargetAdd('core_module.obj', input='libp3char.in')
  3512. TargetAdd('core_module.obj', input='libp3collide.in')
  3513. TargetAdd('core_module.obj', input='libp3device.in')
  3514. TargetAdd('core_module.obj', input='libp3dgraph.in')
  3515. TargetAdd('core_module.obj', input='libp3display.in')
  3516. TargetAdd('core_module.obj', input='libp3pipeline.in')
  3517. TargetAdd('core_module.obj', input='libp3event.in')
  3518. TargetAdd('core_module.obj', input='libp3gobj.in')
  3519. TargetAdd('core_module.obj', input='libp3gsgbase.in')
  3520. TargetAdd('core_module.obj', input='libp3linmath.in')
  3521. TargetAdd('core_module.obj', input='libp3mathutil.in')
  3522. TargetAdd('core_module.obj', input='libp3parametrics.in')
  3523. TargetAdd('core_module.obj', input='libp3pnmimage.in')
  3524. TargetAdd('core_module.obj', input='libp3text.in')
  3525. TargetAdd('core_module.obj', input='libp3tform.in')
  3526. TargetAdd('core_module.obj', input='libp3putil.in')
  3527. TargetAdd('core_module.obj', input='libp3audio.in')
  3528. TargetAdd('core_module.obj', input='libp3nativenet.in')
  3529. TargetAdd('core_module.obj', input='libp3net.in')
  3530. TargetAdd('core_module.obj', input='libp3pgui.in')
  3531. TargetAdd('core_module.obj', input='libp3movies.in')
  3532. TargetAdd('core_module.obj', input='libp3dxml.in')
  3533. if PkgSkip("FREETYPE")==0:
  3534. TargetAdd('core_module.obj', input='libp3pnmtext.in')
  3535. TargetAdd('core_module.obj', opts=['PYTHON'])
  3536. TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3537. TargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3538. TargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3539. TargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3540. TargetAdd('core.pyd', input='libp3express_igate.obj')
  3541. TargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3542. TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3543. TargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3544. TargetAdd('core.pyd', input='libp3movies_igate.obj')
  3545. TargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3546. TargetAdd('core.pyd', input='libp3chan_igate.obj')
  3547. TargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3548. TargetAdd('core.pyd', input='libp3char_igate.obj')
  3549. TargetAdd('core.pyd', input='libp3collide_igate.obj')
  3550. TargetAdd('core.pyd', input='libp3device_igate.obj')
  3551. TargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3552. TargetAdd('core.pyd', input='libp3display_igate.obj')
  3553. TargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3554. TargetAdd('core.pyd', input='libp3event_igate.obj')
  3555. TargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3556. TargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3557. TargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3558. TargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3559. TargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3560. TargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3561. TargetAdd('core.pyd', input='libp3text_igate.obj')
  3562. TargetAdd('core.pyd', input='libp3tform_igate.obj')
  3563. TargetAdd('core.pyd', input='libp3putil_igate.obj')
  3564. TargetAdd('core.pyd', input='libp3audio_igate.obj')
  3565. TargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3566. TargetAdd('core.pyd', input='libp3net_igate.obj')
  3567. TargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3568. TargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3569. if PkgSkip("FREETYPE")==0:
  3570. TargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3571. TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3572. TargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3573. TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3574. TargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3575. TargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3576. TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3577. TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj')
  3578. TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj')
  3579. TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj')
  3580. TargetAdd('core.pyd', input='core_module.obj')
  3581. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3582. TargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3583. TargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3584. TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3585. TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2'])
  3586. #
  3587. # DIRECTORY: panda/src/vision/
  3588. #
  3589. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3590. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3591. if not PkgSkip("FFMPEG"):
  3592. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3593. if not PkgSkip("OPENCV"):
  3594. DefSymbol("OPENCV", "HAVE_OPENCV")
  3595. if OPENCV_VER_23:
  3596. DefSymbol("OPENCV", "OPENCV_VER_23")
  3597. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3598. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3599. 'dtool_have_ffmpeg.dat',
  3600. 'dtool_have_opencv.dat',
  3601. 'dtool_have_directcam.dat',
  3602. ])
  3603. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3604. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3605. TargetAdd('libp3vision.dll', opts=OPTS)
  3606. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON']
  3607. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3608. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3609. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3610. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  3611. TargetAdd('vision_module.obj', input='libp3vision.in')
  3612. TargetAdd('vision_module.obj', opts=OPTS)
  3613. TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3614. TargetAdd('vision.pyd', input='vision_module.obj')
  3615. TargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3616. TargetAdd('vision.pyd', input='libp3vision.dll')
  3617. TargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3618. TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3619. TargetAdd('vision.pyd', opts=['PYTHON'])
  3620. #
  3621. # DIRECTORY: panda/src/rocket/
  3622. #
  3623. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3624. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3625. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3626. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3627. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3628. TargetAdd('libp3rocket.dll', opts=OPTS)
  3629. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON']
  3630. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3631. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3632. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3633. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3634. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  3635. TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3636. TargetAdd('rocket_module.obj', input='libp3rocket.in')
  3637. TargetAdd('rocket_module.obj', opts=OPTS)
  3638. TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3639. TargetAdd('rocket.pyd', input='rocket_module.obj')
  3640. TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3641. TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3642. TargetAdd('rocket.pyd', input='libp3rocket.dll')
  3643. TargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3644. TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3645. TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET'])
  3646. #
  3647. # DIRECTORY: panda/src/p3awesomium
  3648. #
  3649. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  3650. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  3651. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  3652. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  3653. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  3654. TargetAdd('libp3awesomium.dll', opts=OPTS)
  3655. OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON']
  3656. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  3657. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  3658. TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  3659. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  3660. TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
  3661. TargetAdd('awesomium_module.obj', opts=OPTS)
  3662. TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core'])
  3663. TargetAdd('awesomium.pyd', input='awesomium_module.obj')
  3664. TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
  3665. TargetAdd('awesomium.pyd', input='libp3awesomium.dll')
  3666. TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll')
  3667. TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS)
  3668. TargetAdd('awesomium.pyd', opts=['PYTHON'])
  3669. #
  3670. # DIRECTORY: panda/src/p3skel
  3671. #
  3672. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3673. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3674. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3675. OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON']
  3676. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3677. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3678. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3679. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  3680. #
  3681. # DIRECTORY: panda/src/p3skel
  3682. #
  3683. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3684. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3685. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3686. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3687. TargetAdd('libpandaskel.dll', opts=OPTS)
  3688. OPTS=['PYTHON']
  3689. TargetAdd('skel_module.obj', input='libp3skel.in')
  3690. TargetAdd('skel_module.obj', opts=OPTS)
  3691. TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3692. TargetAdd('skel.pyd', input='skel_module.obj')
  3693. TargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3694. TargetAdd('skel.pyd', input='libpandaskel.dll')
  3695. TargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3696. TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3697. TargetAdd('skel.pyd', opts=['PYTHON'])
  3698. #
  3699. # DIRECTORY: panda/src/distort/
  3700. #
  3701. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3702. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3703. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3704. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3705. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3706. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3707. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3708. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  3709. #
  3710. # DIRECTORY: panda/metalibs/pandafx/
  3711. #
  3712. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3713. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3714. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3715. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3716. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3717. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3718. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3719. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3720. TargetAdd('fx_module.obj', input='libp3distort.in')
  3721. TargetAdd('fx_module.obj', opts=OPTS)
  3722. TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3723. TargetAdd('fx.pyd', input='fx_module.obj')
  3724. TargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3725. TargetAdd('fx.pyd', input='libpandafx.dll')
  3726. TargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3727. TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3728. TargetAdd('fx.pyd', opts=['PYTHON'])
  3729. #
  3730. # DIRECTORY: panda/src/vrpn/
  3731. #
  3732. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3733. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3734. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3735. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3736. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3737. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3738. OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON']
  3739. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3740. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3741. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3742. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  3743. TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3744. TargetAdd('vrpn_module.obj', opts=OPTS)
  3745. TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3746. TargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3747. TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3748. TargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3749. TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3750. TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3751. TargetAdd('vrpn.pyd', opts=['PYTHON'])
  3752. #
  3753. # DIRECTORY: panda/src/ffmpeg
  3754. #
  3755. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3756. if not PkgSkip("SWSCALE"):
  3757. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3758. if not PkgSkip("SWRESAMPLE"):
  3759. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3760. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3761. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3762. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3763. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3764. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3765. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3766. #
  3767. # DIRECTORY: panda/src/audiotraits/
  3768. #
  3769. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3770. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3771. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3772. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3773. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3774. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3775. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3776. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3777. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3778. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3779. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3780. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  3781. #
  3782. # DIRECTORY: panda/src/downloadertools/
  3783. #
  3784. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3785. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3786. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3787. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3788. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  3789. TargetAdd('apply_patch.exe', opts=OPTS)
  3790. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3791. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3792. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  3793. TargetAdd('build_patch.exe', opts=OPTS)
  3794. if not PkgSkip("ZLIB"):
  3795. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3796. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3797. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  3798. TargetAdd('check_adler.exe', opts=OPTS)
  3799. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3800. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3801. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  3802. TargetAdd('check_crc.exe', opts=OPTS)
  3803. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3804. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3805. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  3806. TargetAdd('check_md5.exe', opts=OPTS)
  3807. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3808. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3809. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3810. TargetAdd('pdecrypt.exe', opts=OPTS)
  3811. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3812. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3813. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3814. TargetAdd('pencrypt.exe', opts=OPTS)
  3815. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3816. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3817. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  3818. TargetAdd('show_ddb.exe', opts=OPTS)
  3819. #
  3820. # DIRECTORY: panda/src/downloadertools/
  3821. #
  3822. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3823. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3824. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3825. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3826. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3827. TargetAdd('multify.exe', opts=OPTS)
  3828. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3829. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3830. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3831. TargetAdd('pzip.exe', opts=OPTS)
  3832. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3833. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3834. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3835. TargetAdd('punzip.exe', opts=OPTS)
  3836. #
  3837. # DIRECTORY: panda/src/windisplay/
  3838. #
  3839. if (GetTarget() == 'windows' and not RUNTIME):
  3840. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3841. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3842. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3843. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3844. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3845. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3846. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3847. #
  3848. # DIRECTORY: panda/metalibs/pandadx9/
  3849. #
  3850. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  3851. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3852. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3853. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3854. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3855. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3856. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3857. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3858. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3859. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3860. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3861. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3862. #
  3863. # DIRECTORY: panda/src/egg/
  3864. #
  3865. if not RUNTIME and not PkgSkip("EGG"):
  3866. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3867. CreateFile(GetOutputDir()+"/include/parser.h")
  3868. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3869. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3870. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3871. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3872. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3873. OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON']
  3874. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3875. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3876. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3877. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3878. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3879. TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  3880. #
  3881. # DIRECTORY: panda/src/egg2pg/
  3882. #
  3883. if not RUNTIME and not PkgSkip("EGG"):
  3884. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3885. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3886. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3887. OPTS=['DIR:panda/src/egg2pg', 'PYTHON']
  3888. IGATEFILES=['load_egg_file.h']
  3889. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3890. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3891. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  3892. #
  3893. # DIRECTORY: panda/src/framework/
  3894. #
  3895. if (not RUNTIME):
  3896. deps = []
  3897. # Framework wants to link in a renderer when building statically, so tell it what is available.
  3898. if GetLinkAllStatic():
  3899. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  3900. if not PkgSkip("GL"):
  3901. DefSymbol("FRAMEWORK", "HAVE_GL")
  3902. if not PkgSkip("TINYDISPLAY"):
  3903. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  3904. if not PkgSkip("EGG"):
  3905. DefSymbol("FRAMEWORK", "HAVE_EGG")
  3906. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  3907. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  3908. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  3909. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  3910. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  3911. #
  3912. # DIRECTORY: panda/src/glgsg/
  3913. #
  3914. if (not RUNTIME and PkgSkip("GL")==0):
  3915. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  3916. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  3917. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  3918. #
  3919. # DIRECTORY: panda/src/glesgsg/
  3920. #
  3921. if (not RUNTIME and PkgSkip("GLES")==0):
  3922. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  3923. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  3924. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  3925. #
  3926. # DIRECTORY: panda/src/gles2gsg/
  3927. #
  3928. if (not RUNTIME and PkgSkip("GLES2")==0):
  3929. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  3930. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  3931. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  3932. #
  3933. # DIRECTORY: panda/metalibs/pandaegg/
  3934. #
  3935. if not RUNTIME and not PkgSkip("EGG"):
  3936. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  3937. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  3938. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  3939. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  3940. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  3941. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  3942. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  3943. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  3944. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  3945. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  3946. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  3947. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON']
  3948. TargetAdd('egg_module.obj', input='libp3egg2pg.in')
  3949. TargetAdd('egg_module.obj', input='libp3egg.in')
  3950. TargetAdd('egg_module.obj', opts=OPTS)
  3951. TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  3952. TargetAdd('egg.pyd', input='egg_module.obj')
  3953. TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  3954. TargetAdd('egg.pyd', input='libp3egg_igate.obj')
  3955. TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  3956. TargetAdd('egg.pyd', input='libpandaegg.dll')
  3957. TargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  3958. TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  3959. TargetAdd('egg.pyd', opts=['PYTHON'])
  3960. #
  3961. # DIRECTORY: panda/src/x11display/
  3962. #
  3963. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  3964. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  3965. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  3966. #
  3967. # DIRECTORY: panda/src/glxdisplay/
  3968. #
  3969. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3970. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3971. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  3972. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3973. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3974. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  3975. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3976. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3977. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3978. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  3979. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3980. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  3981. #
  3982. # DIRECTORY: panda/src/cocoadisplay/
  3983. #
  3984. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  3985. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3986. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  3987. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3988. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3989. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3990. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3991. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3992. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  3993. if (PkgSkip('PANDAFX')==0):
  3994. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  3995. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3996. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  3997. #
  3998. # DIRECTORY: panda/src/osxdisplay/
  3999. #
  4000. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4001. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4002. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4003. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4004. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4005. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4006. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4007. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4008. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4009. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4010. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4011. if (PkgSkip('PANDAFX')==0):
  4012. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4013. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4014. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4015. #
  4016. # DIRECTORY: panda/src/wgldisplay/
  4017. #
  4018. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4019. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4020. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4021. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4022. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4023. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4024. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4025. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4026. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4027. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4028. if (PkgSkip('PANDAFX')==0):
  4029. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4030. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4031. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4032. #
  4033. # DIRECTORY: panda/src/egldisplay/
  4034. #
  4035. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4036. DefSymbol('GLES', 'OPENGLES_1', '')
  4037. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4038. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4039. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4040. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4041. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4042. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4043. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4044. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4045. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4046. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4047. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4048. #
  4049. # DIRECTORY: panda/src/egldisplay/
  4050. #
  4051. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4052. DefSymbol('GLES2', 'OPENGLES_2', '')
  4053. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4054. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4055. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4056. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4057. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4058. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4059. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4060. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4061. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4062. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4063. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4064. #
  4065. # DIRECTORY: panda/src/vulkandisplay/
  4066. #
  4067. if not PkgSkip("VULKAN") and not RUNTIME:
  4068. OPTS=['DIR:panda/src/vulkandisplay', 'DIR:panda/src/vulkandisplay', 'BUILDING:VULKANDISPLAY', 'VULKAN']
  4069. TargetAdd('p3vulkandisplay_composite1.obj', opts=OPTS, input='p3vulkandisplay_composite1.cxx')
  4070. TargetAdd('libp3vulkandisplay.dll', input='p3vulkandisplay_composite1.obj')
  4071. if GetTarget() == 'windows':
  4072. TargetAdd('libp3vulkandisplay.dll', input='libp3windisplay.dll')
  4073. TargetAdd('libp3vulkandisplay.dll', opts=['MODULE', 'VULKAN'])
  4074. else:
  4075. TargetAdd('libp3vulkandisplay.dll', input='p3x11display_composite1.obj')
  4076. TargetAdd('libp3vulkandisplay.dll', opts=['MODULE', 'VULKAN', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  4077. TargetAdd('libp3vulkandisplay.dll', input=COMMON_PANDA_LIBS)
  4078. #
  4079. # DIRECTORY: panda/src/ode/
  4080. #
  4081. if (PkgSkip("ODE")==0 and not RUNTIME):
  4082. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON']
  4083. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4084. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4085. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4086. OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON']
  4087. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4088. IGATEFILES.remove("odeConvexGeom.h")
  4089. IGATEFILES.remove("odeHeightFieldGeom.h")
  4090. IGATEFILES.remove("odeHelperStructs.h")
  4091. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4092. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4093. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  4094. TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4095. #
  4096. # DIRECTORY: panda/metalibs/pandaode/
  4097. #
  4098. if (PkgSkip("ODE")==0 and not RUNTIME):
  4099. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4100. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4101. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4102. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4103. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4104. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4105. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4106. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4107. OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON']
  4108. TargetAdd('ode_module.obj', input='libpandaode.in')
  4109. TargetAdd('ode_module.obj', opts=OPTS)
  4110. TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4111. TargetAdd('ode.pyd', input='ode_module.obj')
  4112. TargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4113. TargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4114. TargetAdd('ode.pyd', input='libpandaode.dll')
  4115. TargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4116. TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4117. TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE'])
  4118. #
  4119. # DIRECTORY: panda/src/bullet/
  4120. #
  4121. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4122. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4123. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4124. OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON']
  4125. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4126. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4127. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4128. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  4129. #
  4130. # DIRECTORY: panda/metalibs/pandabullet/
  4131. #
  4132. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4133. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4134. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4135. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4136. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4137. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4138. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4139. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON']
  4140. TargetAdd('bullet_module.obj', input='libpandabullet.in')
  4141. TargetAdd('bullet_module.obj', opts=OPTS)
  4142. TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4143. TargetAdd('bullet.pyd', input='bullet_module.obj')
  4144. TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4145. TargetAdd('bullet.pyd', input='libpandabullet.dll')
  4146. TargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4147. TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4148. TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET'])
  4149. #
  4150. # DIRECTORY: panda/src/physx/
  4151. #
  4152. if (PkgSkip("PHYSX")==0):
  4153. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4154. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4155. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4156. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4157. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4158. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4159. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  4160. #
  4161. # DIRECTORY: panda/metalibs/pandaphysx/
  4162. #
  4163. if (PkgSkip("PHYSX")==0):
  4164. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4165. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4166. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4167. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4168. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4169. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4170. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4171. TargetAdd('physx_module.obj', input='libpandaphysx.in')
  4172. TargetAdd('physx_module.obj', opts=OPTS)
  4173. TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4174. TargetAdd('physx.pyd', input='physx_module.obj')
  4175. TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4176. TargetAdd('physx.pyd', input='libpandaphysx.dll')
  4177. TargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4178. TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4179. TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4180. #
  4181. # DIRECTORY: panda/src/physics/
  4182. #
  4183. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4184. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4185. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4186. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4187. OPTS=['DIR:panda/src/physics', 'PYTHON']
  4188. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4189. IGATEFILES.remove("forces.h")
  4190. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4191. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4192. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  4193. #
  4194. # DIRECTORY: panda/src/particlesystem/
  4195. #
  4196. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4197. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4198. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4199. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4200. OPTS=['DIR:panda/src/particlesystem', 'PYTHON']
  4201. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4202. IGATEFILES.remove('orientedParticle.h')
  4203. IGATEFILES.remove('orientedParticleFactory.h')
  4204. IGATEFILES.remove('particlefactories.h')
  4205. IGATEFILES.remove('emitters.h')
  4206. IGATEFILES.remove('particles.h')
  4207. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4208. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4209. TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
  4210. #
  4211. # DIRECTORY: panda/metalibs/pandaphysics/
  4212. #
  4213. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4214. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4215. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4216. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4217. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4218. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4219. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4220. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4221. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4222. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4223. OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON']
  4224. TargetAdd('physics_module.obj', input='libp3physics.in')
  4225. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4226. TargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4227. TargetAdd('physics_module.obj', opts=OPTS)
  4228. TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4229. TargetAdd('physics.pyd', input='physics_module.obj')
  4230. TargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4231. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4232. TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4233. TargetAdd('physics.pyd', input='libpandaphysics.dll')
  4234. TargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4235. TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4236. TargetAdd('physics.pyd', opts=['PYTHON'])
  4237. #
  4238. # DIRECTORY: panda/src/speedtree/
  4239. #
  4240. if (PkgSkip("SPEEDTREE")==0):
  4241. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON']
  4242. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4243. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4244. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4245. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4246. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  4247. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4248. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4249. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4250. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4251. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4252. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4253. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4254. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4255. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4256. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4257. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4258. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4259. #
  4260. # DIRECTORY: panda/src/testbed/
  4261. #
  4262. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'android'):
  4263. OPTS=['DIR:panda/src/testbed']
  4264. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4265. TargetAdd('pview.exe', input='pview_pview.obj')
  4266. TargetAdd('pview.exe', input='libp3framework.dll')
  4267. if not PkgSkip("EGG"):
  4268. TargetAdd('pview.exe', input='libpandaegg.dll')
  4269. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4270. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4271. #
  4272. # DIRECTORY: panda/src/android/
  4273. #
  4274. if (not RUNTIME and GetTarget() == 'android'):
  4275. native_app_glue = os.path.join(SDK['ANDROID_NDK'], 'sources', 'android', 'native_app_glue')
  4276. OPTS=['DIR:panda/src/android', 'DIR:' + native_app_glue]
  4277. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4278. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4279. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4280. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4281. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4282. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4283. if (not RTDIST and PkgSkip("PVIEW")==0):
  4284. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4285. TargetAdd('pview.exe', input='android_native_app_glue.obj')
  4286. TargetAdd('pview.exe', input='android_main.obj')
  4287. TargetAdd('pview.exe', input='pview_pview.obj')
  4288. TargetAdd('pview.exe', input='libp3framework.dll')
  4289. if not PkgSkip("EGG"):
  4290. TargetAdd('pview.exe', input='libpandaegg.dll')
  4291. TargetAdd('pview.exe', input='libp3android.dll')
  4292. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4293. TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml')
  4294. #
  4295. # DIRECTORY: panda/src/androiddisplay/
  4296. #
  4297. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4298. DefSymbol('GLES', 'OPENGLES_1', '')
  4299. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'DIR:' + native_app_glue, 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4300. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4301. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4302. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4303. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4304. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4305. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4306. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4307. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4308. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4309. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4310. #
  4311. # DIRECTORY: panda/src/tinydisplay/
  4312. #
  4313. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4314. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4315. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4316. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4317. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4318. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4319. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4320. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4321. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4322. if GetTarget() == 'darwin':
  4323. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4324. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4325. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4326. elif GetTarget() == 'windows':
  4327. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4328. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4329. else:
  4330. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4331. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4332. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4333. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4334. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4335. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4336. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4337. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4338. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4339. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4340. #
  4341. # DIRECTORY: direct/src/directbase/
  4342. #
  4343. if (PkgSkip("DIRECT")==0):
  4344. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  4345. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4346. #
  4347. # DIRECTORY: direct/src/dcparser/
  4348. #
  4349. if (PkgSkip("DIRECT")==0):
  4350. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON']
  4351. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4352. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4353. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4354. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4355. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4356. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4357. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON']
  4358. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4359. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4360. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4361. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4362. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4363. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  4364. #
  4365. # DIRECTORY: direct/src/deadrec/
  4366. #
  4367. if (PkgSkip("DIRECT")==0):
  4368. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4369. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4370. OPTS=['DIR:direct/src/deadrec', 'PYTHON']
  4371. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4372. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4373. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4374. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  4375. #
  4376. # DIRECTORY: direct/src/distributed/
  4377. #
  4378. if (PkgSkip("DIRECT")==0):
  4379. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON']
  4380. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4381. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4382. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4383. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON']
  4384. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4385. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4386. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4387. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  4388. #
  4389. # DIRECTORY: direct/src/interval/
  4390. #
  4391. if (PkgSkip("DIRECT")==0):
  4392. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4393. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4394. OPTS=['DIR:direct/src/interval', 'PYTHON']
  4395. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4396. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4397. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4398. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  4399. #
  4400. # DIRECTORY: direct/src/showbase/
  4401. #
  4402. if (PkgSkip("DIRECT")==0):
  4403. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4404. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4405. if GetTarget() == 'darwin':
  4406. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4407. OPTS=['DIR:direct/src/showbase', 'PYTHON']
  4408. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4409. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4410. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4411. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  4412. #
  4413. # DIRECTORY: direct/src/motiontrail/
  4414. #
  4415. if (PkgSkip("DIRECT")==0):
  4416. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4417. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4418. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4419. OPTS=['DIR:direct/src/motiontrail', 'PYTHON']
  4420. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4421. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4422. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4423. TargetAdd('libp3motiontrail_igate.obj', input='libp3motiontrail.in', opts=["DEPENDENCYONLY"])
  4424. #
  4425. # DIRECTORY: direct/metalibs/direct/
  4426. #
  4427. if (PkgSkip("DIRECT")==0):
  4428. OPTS=['DIR:direct/metalibs/direct', 'BUILDING:DIRECT']
  4429. TargetAdd('p3direct_direct.obj', opts=OPTS, input='direct.cxx')
  4430. TargetAdd('libp3direct.dll', input='p3direct_direct.obj')
  4431. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4432. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4433. if GetTarget() == 'darwin':
  4434. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4435. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4436. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4437. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4438. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4439. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4440. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4441. OPTS=['DIR:direct/metalibs/direct', 'PYTHON']
  4442. TargetAdd('direct_module.obj', input='libp3dcparser.in')
  4443. TargetAdd('direct_module.obj', input='libp3showbase.in')
  4444. TargetAdd('direct_module.obj', input='libp3deadrec.in')
  4445. TargetAdd('direct_module.obj', input='libp3interval.in')
  4446. TargetAdd('direct_module.obj', input='libp3distributed.in')
  4447. TargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4448. TargetAdd('direct_module.obj', opts=OPTS)
  4449. TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4450. TargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4451. TargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4452. TargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4453. TargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4454. TargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4455. TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4456. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4457. # the Python libraries. If a C++ user needs these modules, we can move them
  4458. # back and filter out the Python-specific code.
  4459. TargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4460. TargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4461. TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4462. TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4463. TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4464. TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4465. TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4466. TargetAdd('direct.pyd', input='direct_module.obj')
  4467. TargetAdd('direct.pyd', input='libp3direct.dll')
  4468. TargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4469. TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4470. TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2'])
  4471. #
  4472. # DIRECTORY: direct/src/dcparse/
  4473. #
  4474. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4475. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON']
  4476. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4477. TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4478. TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4479. TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4480. TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4481. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4482. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4483. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4484. TargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4485. TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON'])
  4486. #
  4487. # DIRECTORY: direct/src/plugin/
  4488. #
  4489. if (RTDIST or RUNTIME):
  4490. # Explicitly define this as we don't include dtool_config.h here.
  4491. if GetTarget() not in ('windows', 'darwin'):
  4492. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4493. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4494. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4495. OPTS += ['ZLIB', 'MSIMG']
  4496. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4497. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4498. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4499. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4500. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4501. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4502. if GetTarget() == 'darwin':
  4503. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4504. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4505. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4506. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4507. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4508. if (RTDIST):
  4509. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4510. TargetAdd(fname, input='plugin_plugin.obj')
  4511. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4512. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4513. TargetAdd(fname, input='plugin_parse_color.obj')
  4514. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4515. if GetTarget() == 'darwin':
  4516. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4517. TargetAdd(fname, input='plugin_fileSpec.obj')
  4518. TargetAdd(fname, input='plugin_binaryXml.obj')
  4519. TargetAdd(fname, input='plugin_handleStream.obj')
  4520. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4521. TargetAdd(fname, input='libp3tinyxml.ilb')
  4522. if GetTarget() == 'darwin':
  4523. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4524. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4525. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4526. if (PkgSkip("PYTHON")==0 and RTDIST):
  4527. # Freeze VFSImporter and its dependency modules into p3dpython.
  4528. # Mark panda3d.core as a dependency to make sure to build that first.
  4529. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON'])
  4530. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4531. OPTS += ['PYTHON']
  4532. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4533. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4534. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4535. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4536. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4537. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4538. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4539. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4540. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4541. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4542. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4543. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4544. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4545. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4546. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4547. if GetTarget() == 'windows':
  4548. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4549. OPTS.append("NON_CONSOLE")
  4550. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4551. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4552. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4553. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4554. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4555. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4556. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4557. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4558. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  4559. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4560. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4561. if GetTarget() == 'darwin':
  4562. OPTS += ['OPT:2']
  4563. if (PkgSkip("FLTK")==0):
  4564. OPTS.append("FLTK")
  4565. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4566. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4567. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4568. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4569. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4570. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4571. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4572. if GetTarget() == 'darwin':
  4573. OPTS += ['OPT:2']
  4574. TargetAdd('p3dcert.exe', opts=OPTS)
  4575. elif (PkgSkip("WX")==0):
  4576. OPTS += ["WX", "RTTI"]
  4577. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4578. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4579. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4580. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4581. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4582. if GetTarget() == "darwin":
  4583. OPTS += ['GL', 'OPT:2']
  4584. TargetAdd('p3dcert.exe', opts=OPTS)
  4585. #
  4586. # DIRECTORY: direct/src/plugin_npapi/
  4587. #
  4588. if RUNTIME:
  4589. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4590. if GetTarget() == 'windows':
  4591. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4592. "version" : VERSION,
  4593. "description" : "Runs 3-D games and interactive applets",
  4594. "filename" : "nppanda3d.dll",
  4595. "mimetype" : "application/x-panda3d",
  4596. "extension" : "p3d",
  4597. "filedesc" : "Panda3D applet"}
  4598. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4599. elif GetTarget() == 'darwin':
  4600. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4601. OPTS += ['GTK2']
  4602. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4603. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4604. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4605. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4606. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4607. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4608. if GetTarget() == 'windows':
  4609. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4610. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4611. elif GetTarget() == 'darwin':
  4612. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4613. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4614. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4615. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4616. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4617. #
  4618. # DIRECTORY: direct/src/plugin_activex/
  4619. #
  4620. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4621. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4622. DefSymbol('ACTIVEX', '_USRDLL', '')
  4623. DefSymbol('ACTIVEX', '_WINDLL', '')
  4624. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4625. DefSymbol('ACTIVEX', '_MBCS', '')
  4626. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4627. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4628. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4629. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4630. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4631. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4632. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4633. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4634. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4635. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4636. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4637. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4638. #
  4639. # DIRECTORY: direct/src/plugin_standalone/
  4640. #
  4641. if (RUNTIME):
  4642. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4643. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4644. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4645. if GetTarget() == 'windows':
  4646. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4647. "version" : VERSION,
  4648. "description" : "Runs 3-D games and interactive applets",
  4649. "filename" : "panda3d.exe",
  4650. "mimetype" : "application/x-panda3d",
  4651. "extension" : "p3d",
  4652. "filedesc" : "Panda3D applet",
  4653. "icon" : "panda3d.ico"}
  4654. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4655. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4656. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4657. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4658. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4659. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4660. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4661. if GetTarget() == 'darwin':
  4662. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4663. elif GetTarget() == 'windows':
  4664. TargetAdd('panda3d.exe', input='panda3d.res')
  4665. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4666. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4667. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4668. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4669. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4670. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4671. if (GetTarget() == 'darwin'):
  4672. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4673. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4674. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4675. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4676. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4677. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4678. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4679. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4680. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4681. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4682. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4683. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4684. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4685. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4686. elif (GetTarget() == 'windows'):
  4687. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4688. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4689. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4690. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4691. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4692. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4693. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4694. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4695. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4696. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4697. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4698. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4699. if (RTDIST):
  4700. 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']
  4701. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4702. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4703. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4704. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4705. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4706. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4707. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4708. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4709. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4710. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4711. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4712. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4713. if (GetTarget() == 'darwin'):
  4714. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4715. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4716. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4717. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  4718. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4719. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4720. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4721. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4722. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4723. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4724. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4725. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4726. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4727. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4728. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4729. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4730. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4731. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4732. if GetTarget() == 'darwin':
  4733. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4734. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4735. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4736. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  4737. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4738. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4739. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4740. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4741. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4742. if GetTarget() == 'darwin':
  4743. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4744. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4745. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4746. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4747. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4748. if GetTarget() == 'windows':
  4749. OPTS.append("P3DEMBEDW")
  4750. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4751. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4752. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4753. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4754. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4755. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4756. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4757. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4758. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4759. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4760. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4761. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4762. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4763. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4764. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  4765. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4766. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4767. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4768. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4769. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4770. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4771. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4772. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4773. #
  4774. # DIRECTORY: pandatool/src/pandatoolbase/
  4775. #
  4776. if (PkgSkip("PANDATOOL")==0):
  4777. OPTS=['DIR:pandatool/src/pandatoolbase']
  4778. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4779. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4780. #
  4781. # DIRECTORY: pandatool/src/converter/
  4782. #
  4783. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4784. OPTS=['DIR:pandatool/src/converter']
  4785. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4786. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4787. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4788. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4789. #
  4790. # DIRECTORY: pandatool/src/progbase/
  4791. #
  4792. if not PkgSkip("PANDATOOL"):
  4793. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4794. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4795. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4796. #
  4797. # DIRECTORY: pandatool/src/eggbase/
  4798. #
  4799. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4800. OPTS=['DIR:pandatool/src/eggbase']
  4801. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4802. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4803. #
  4804. # DIRECTORY: pandatool/src/bam/
  4805. #
  4806. if not PkgSkip("PANDATOOL"):
  4807. OPTS=['DIR:pandatool/src/bam']
  4808. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4809. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4810. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4811. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4812. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4813. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4814. if not PkgSkip("EGG"):
  4815. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4816. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4817. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4818. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4819. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4820. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4821. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4822. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4823. #
  4824. # DIRECTORY: pandatool/src/cvscopy/
  4825. #
  4826. if not PkgSkip("PANDATOOL"):
  4827. OPTS=['DIR:pandatool/src/cvscopy']
  4828. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  4829. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  4830. #
  4831. # DIRECTORY: pandatool/src/daeegg/
  4832. #
  4833. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4834. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4835. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4836. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4837. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4838. #
  4839. # DIRECTORY: pandatool/src/assimp
  4840. #
  4841. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  4842. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4843. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4844. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4845. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4846. TargetAdd('libp3assimp.dll', opts=OPTS)
  4847. #
  4848. # DIRECTORY: pandatool/src/daeprogs/
  4849. #
  4850. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4851. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4852. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4853. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4854. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4855. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4856. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4857. #
  4858. # DIRECTORY: pandatool/src/dxf/
  4859. #
  4860. if not PkgSkip("PANDATOOL"):
  4861. OPTS=['DIR:pandatool/src/dxf']
  4862. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4863. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4864. #
  4865. # DIRECTORY: pandatool/src/dxfegg/
  4866. #
  4867. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4868. OPTS=['DIR:pandatool/src/dxfegg']
  4869. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4870. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4871. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4872. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4873. #
  4874. # DIRECTORY: pandatool/src/dxfprogs/
  4875. #
  4876. if not PkgSkip("PANDATOOL"):
  4877. OPTS=['DIR:pandatool/src/dxfprogs']
  4878. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4879. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4880. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4881. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4882. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4883. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4884. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4885. if not PkgSkip("EGG"):
  4886. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4887. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4888. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4889. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4890. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4891. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4892. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4893. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4894. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4895. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4896. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4897. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  4898. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  4899. #
  4900. # DIRECTORY: pandatool/src/objegg/
  4901. #
  4902. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4903. OPTS=['DIR:pandatool/src/objegg']
  4904. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  4905. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  4906. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  4907. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  4908. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  4909. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  4910. #
  4911. # DIRECTORY: pandatool/src/objprogs/
  4912. #
  4913. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4914. OPTS=['DIR:pandatool/src/objprogs']
  4915. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  4916. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  4917. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  4918. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  4919. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  4920. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  4921. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  4922. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  4923. #
  4924. # DIRECTORY: pandatool/src/palettizer/
  4925. #
  4926. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4927. OPTS=['DIR:pandatool/src/palettizer']
  4928. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  4929. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  4930. #
  4931. # DIRECTORY: pandatool/src/egg-mkfont/
  4932. #
  4933. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4934. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  4935. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  4936. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  4937. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  4938. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  4939. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  4940. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  4941. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  4942. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  4943. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  4944. #
  4945. # DIRECTORY: pandatool/src/eggcharbase/
  4946. #
  4947. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4948. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  4949. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  4950. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  4951. #
  4952. # DIRECTORY: pandatool/src/egg-optchar/
  4953. #
  4954. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4955. OPTS=['DIR:pandatool/src/egg-optchar']
  4956. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  4957. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  4958. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  4959. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  4960. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  4961. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  4962. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  4963. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  4964. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  4965. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  4966. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  4967. #
  4968. # DIRECTORY: pandatool/src/egg-palettize/
  4969. #
  4970. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4971. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  4972. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  4973. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  4974. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  4975. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  4976. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  4977. #
  4978. # DIRECTORY: pandatool/src/egg-qtess/
  4979. #
  4980. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4981. OPTS=['DIR:pandatool/src/egg-qtess']
  4982. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  4983. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  4984. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  4985. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  4986. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  4987. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  4988. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  4989. #
  4990. # DIRECTORY: pandatool/src/eggprogs/
  4991. #
  4992. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4993. OPTS=['DIR:pandatool/src/eggprogs']
  4994. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  4995. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  4996. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  4997. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  4998. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  4999. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5000. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5001. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5002. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5003. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5004. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5005. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5006. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5007. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5008. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5009. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5010. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5011. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5012. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5013. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5014. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5015. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5016. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5017. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5018. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5019. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5020. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5021. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5022. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5023. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5024. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5025. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5026. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5027. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5028. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5029. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5030. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5031. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5032. #
  5033. # DIRECTORY: pandatool/src/flt/
  5034. #
  5035. if not PkgSkip("PANDATOOL"):
  5036. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5037. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5038. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5039. #
  5040. # DIRECTORY: pandatool/src/fltegg/
  5041. #
  5042. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5043. OPTS=['DIR:pandatool/src/fltegg']
  5044. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5045. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5046. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5047. #
  5048. # DIRECTORY: pandatool/src/fltprogs/
  5049. #
  5050. if not PkgSkip("PANDATOOL"):
  5051. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5052. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5053. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5054. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5055. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5056. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5057. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5058. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5059. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5060. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5061. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5062. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5063. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5064. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5065. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5066. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5067. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5068. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5069. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5070. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5071. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5072. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5073. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5074. if not PkgSkip("EGG"):
  5075. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5076. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5077. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5078. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5079. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5080. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5081. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5082. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5083. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5084. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5085. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5086. #
  5087. # DIRECTORY: pandatool/src/imagebase/
  5088. #
  5089. if not PkgSkip("PANDATOOL"):
  5090. OPTS=['DIR:pandatool/src/imagebase']
  5091. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5092. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5093. #
  5094. # DIRECTORY: pandatool/src/imageprogs/
  5095. #
  5096. if not PkgSkip("PANDATOOL"):
  5097. OPTS=['DIR:pandatool/src/imageprogs']
  5098. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5099. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5100. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5101. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5102. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5103. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5104. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5105. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5106. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5107. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5108. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5109. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5110. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5111. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5112. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5113. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5114. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5115. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5116. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5117. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5118. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5119. #
  5120. # DIRECTORY: pandatool/src/pfmprogs/
  5121. #
  5122. if not PkgSkip("PANDATOOL"):
  5123. OPTS=['DIR:pandatool/src/pfmprogs']
  5124. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5125. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5126. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5127. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5128. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5129. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5130. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5131. TargetAdd('pfm-bba_config_pfm.obj', opts=OPTS, input='config_pfm.cxx')
  5132. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5133. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfm.obj')
  5134. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5135. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5136. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5137. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5138. #
  5139. # DIRECTORY: pandatool/src/lwo/
  5140. #
  5141. if not PkgSkip("PANDATOOL"):
  5142. OPTS=['DIR:pandatool/src/lwo']
  5143. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5144. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5145. #
  5146. # DIRECTORY: pandatool/src/lwoegg/
  5147. #
  5148. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5149. OPTS=['DIR:pandatool/src/lwoegg']
  5150. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5151. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5152. #
  5153. # DIRECTORY: pandatool/src/lwoprogs/
  5154. #
  5155. if not PkgSkip("PANDATOOL"):
  5156. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5157. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5158. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5159. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5160. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5161. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5162. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5163. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5164. if not PkgSkip("EGG"):
  5165. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5166. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5167. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5168. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5169. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5170. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5171. #
  5172. # DIRECTORY: pandatool/src/maya/
  5173. #
  5174. for VER in MAYAVERSIONS:
  5175. VNUM=VER[4:]
  5176. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5177. OPTS=['DIR:pandatool/src/maya', VER]
  5178. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5179. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5180. #
  5181. # DIRECTORY: pandatool/src/mayaegg/
  5182. #
  5183. for VER in MAYAVERSIONS:
  5184. VNUM=VER[4:]
  5185. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5186. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5187. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5188. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5189. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5190. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5191. #
  5192. # DIRECTORY: pandatool/src/maxegg/
  5193. #
  5194. for VER in MAXVERSIONS:
  5195. VNUM=VER[3:]
  5196. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5197. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5198. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5199. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5200. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5201. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5202. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5203. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5204. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5205. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5206. #
  5207. # DIRECTORY: pandatool/src/maxprogs/
  5208. #
  5209. for VER in MAXVERSIONS:
  5210. VNUM=VER[3:]
  5211. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5212. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5213. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5214. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5215. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5216. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5217. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5218. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5219. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5220. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5221. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5222. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5223. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5224. #
  5225. # DIRECTORY: pandatool/src/vrml/
  5226. #
  5227. if not PkgSkip("PANDATOOL"):
  5228. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5229. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5230. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5231. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5232. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5233. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5234. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5235. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5236. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5237. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5238. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5239. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5240. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5241. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5242. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5243. #
  5244. # DIRECTORY: pandatool/src/vrmlegg/
  5245. #
  5246. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5247. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5248. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5249. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5250. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5251. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5252. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5253. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5254. #
  5255. # DIRECTORY: pandatool/src/xfile/
  5256. #
  5257. if not PkgSkip("PANDATOOL"):
  5258. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5259. CreateFile(GetOutputDir()+"/include/xParser.h")
  5260. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5261. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5262. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5263. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5264. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5265. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5266. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5267. #
  5268. # DIRECTORY: pandatool/src/xfileegg/
  5269. #
  5270. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5271. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5272. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5273. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5274. #
  5275. # DIRECTORY: pandatool/src/ptloader/
  5276. #
  5277. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5278. if not PkgSkip("FCOLLADA"):
  5279. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5280. 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']
  5281. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5282. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5283. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5284. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5285. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5286. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5287. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5288. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5289. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5290. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5291. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5292. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5293. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5294. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5295. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5296. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5297. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5298. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5299. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5300. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5301. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5302. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5303. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5304. #
  5305. # DIRECTORY: pandatool/src/miscprogs/
  5306. #
  5307. # This is a bit of an esoteric tool, and it causes issues because
  5308. # it conflicts with tools of the same name in different packages.
  5309. #if (PkgSkip("PANDATOOL")==0):
  5310. # OPTS=['DIR:pandatool/src/miscprogs']
  5311. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5312. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5313. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5314. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5315. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5316. # TargetAdd('bin2c.exe', input='libp3pystub.lib')
  5317. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5318. #
  5319. # DIRECTORY: pandatool/src/pstatserver/
  5320. #
  5321. if (PkgSkip("PANDATOOL")==0):
  5322. OPTS=['DIR:pandatool/src/pstatserver']
  5323. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5324. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5325. #
  5326. # DIRECTORY: pandatool/src/softprogs/
  5327. #
  5328. if (PkgSkip("PANDATOOL")==0):
  5329. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  5330. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  5331. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  5332. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  5333. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  5334. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  5335. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  5336. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  5337. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  5338. #
  5339. # DIRECTORY: pandatool/src/text-stats/
  5340. #
  5341. if (PkgSkip("PANDATOOL")==0):
  5342. OPTS=['DIR:pandatool/src/text-stats']
  5343. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5344. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5345. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5346. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5347. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5348. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5349. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5350. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5351. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5352. #
  5353. # DIRECTORY: pandatool/src/vrmlprogs/
  5354. #
  5355. if not PkgSkip("PANDATOOL"):
  5356. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5357. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5358. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5359. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5360. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5361. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5362. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5363. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5364. if not PkgSkip("EGG"):
  5365. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5366. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5367. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5368. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5369. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5370. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5371. #
  5372. # DIRECTORY: pandatool/src/win-stats/
  5373. # DIRECTORY: pandatool/src/gtk-stats/
  5374. #
  5375. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5376. if GetTarget() == 'windows':
  5377. OPTS=['DIR:pandatool/src/win-stats']
  5378. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5379. else:
  5380. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5381. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5382. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5383. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5384. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5385. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5386. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5387. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5388. #
  5389. # DIRECTORY: pandatool/src/xfileprogs/
  5390. #
  5391. if not PkgSkip("PANDATOOL"):
  5392. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5393. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5394. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5395. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5396. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5397. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5398. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5399. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5400. if not PkgSkip("EGG"):
  5401. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5402. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5403. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5404. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5405. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5406. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5407. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5408. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5409. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5410. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5411. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5412. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5413. #
  5414. # DIRECTORY: pandatool/src/mayaprogs/
  5415. #
  5416. for VER in MAYAVERSIONS:
  5417. VNUM = VER[4:]
  5418. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5419. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5420. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5421. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5422. continue
  5423. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5424. ARCH_OPTS = ['NOARCH:PPC']
  5425. else:
  5426. ARCH_OPTS = []
  5427. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5428. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5429. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5430. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5431. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5432. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5433. #if GetTarget() == 'windows':
  5434. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5435. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5436. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5437. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5438. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5439. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5440. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5441. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5442. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5443. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5444. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5445. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5446. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5447. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5448. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5449. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5450. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5451. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5452. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5453. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5454. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5455. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5456. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5457. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5458. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5459. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5460. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5461. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5462. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5463. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5464. if GetTarget() == 'windows':
  5465. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5466. else:
  5467. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5468. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5469. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5470. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5471. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5472. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5473. if GetTarget() == 'windows':
  5474. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5475. else:
  5476. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5477. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5478. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5479. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5480. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5481. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5482. if GetTarget() == 'windows':
  5483. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5484. else:
  5485. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5486. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5487. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5488. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5489. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5490. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5491. if GetTarget() == 'windows':
  5492. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5493. else:
  5494. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5495. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5496. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5497. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5498. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5499. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5500. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5501. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5502. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5503. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5504. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5505. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5506. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5507. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5508. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5509. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5510. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5511. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5512. #
  5513. # DIRECTORY: contrib/src/ai/
  5514. #
  5515. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5516. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5517. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5518. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5519. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5520. OPTS=['DIR:contrib/src/ai', 'PYTHON']
  5521. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5522. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5523. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5524. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  5525. TargetAdd('ai_module.obj', input='libpandaai.in')
  5526. TargetAdd('ai_module.obj', opts=OPTS)
  5527. TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5528. TargetAdd('ai.pyd', input='ai_module.obj')
  5529. TargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5530. TargetAdd('ai.pyd', input='libpandaai.dll')
  5531. TargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5532. TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5533. TargetAdd('ai.pyd', opts=['PYTHON'])
  5534. #
  5535. # Generate the models directory and samples directory
  5536. #
  5537. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5538. model_extensions = ["*.egg"]
  5539. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5540. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5541. model_extensions.append("*.flt")
  5542. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5543. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5544. newname = model[:-4] + ".egg.pz"
  5545. else:
  5546. newname = model[:-4] + ".egg"
  5547. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5548. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5549. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5550. newname = model[:-4] + ".egg.pz"
  5551. else:
  5552. newname = model[:-4] + ".egg"
  5553. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5554. for model in GetDirectoryContents("models", model_extensions):
  5555. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5556. newname = model[:-4] + ".egg.pz"
  5557. else:
  5558. newname = model[:-4] + ".egg"
  5559. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5560. if not PkgSkip("DIRECT") and not RUNTIME:
  5561. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5562. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5563. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5564. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5565. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5566. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5567. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5568. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5569. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5570. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5571. #
  5572. # Build the rtdist.
  5573. #
  5574. if (RTDIST):
  5575. OPTS=['DIR:direct/src/p3d']
  5576. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5577. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5578. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5579. #
  5580. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5581. #
  5582. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5583. OPTS=['DIR:direct/src/p3d']
  5584. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5585. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5586. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5587. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5588. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5589. ##########################################################################################
  5590. #
  5591. # Dependency-Based Distributed Build System.
  5592. #
  5593. ##########################################################################################
  5594. DEPENDENCYQUEUE=[]
  5595. for target in TARGET_LIST:
  5596. name = target.name
  5597. inputs = target.inputs
  5598. opts = target.opts
  5599. deps = target.deps
  5600. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5601. def BuildWorker(taskqueue, donequeue):
  5602. while True:
  5603. try:
  5604. task = taskqueue.get(timeout=1)
  5605. except:
  5606. ProgressOutput(None, "Waiting for tasks...")
  5607. task = taskqueue.get()
  5608. sys.stdout.flush()
  5609. if (task == 0): return
  5610. try:
  5611. task[0](*task[1])
  5612. donequeue.put(task)
  5613. except:
  5614. donequeue.put(0)
  5615. def AllSourcesReady(task, pending):
  5616. sources = task[3]
  5617. for x in sources:
  5618. if (x in pending):
  5619. return 0
  5620. sources = task[1][1]
  5621. for x in sources:
  5622. if (x in pending):
  5623. return 0
  5624. altsources = task[4]
  5625. for x in altsources:
  5626. if (x in pending):
  5627. return 0
  5628. return 1
  5629. def ParallelMake(tasklist):
  5630. # Create the communication queues.
  5631. donequeue = queue.Queue()
  5632. taskqueue = queue.Queue()
  5633. # Build up a table listing all the pending targets
  5634. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5635. # task[2] = [name]
  5636. # task[3] = deps
  5637. # The python tool package, in particular fltegg seems to throw parallelmake off
  5638. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5639. # and another subpart to be built sequentially. The most time consuming part of the process
  5640. # is the c++ code generation anyways.
  5641. tasklist_seq = []
  5642. i = 0
  5643. while i < len(tasklist):
  5644. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5645. break
  5646. i += 1
  5647. if i < len(tasklist):
  5648. tasklist_seq = tasklist[i:]
  5649. tasklist = tasklist[:i]
  5650. iNumStartingTasks = len(tasklist)
  5651. pending = {}
  5652. for task in tasklist:
  5653. for target in task[2]:
  5654. pending[target] = 1
  5655. # Create the workers
  5656. for slave in range(THREADCOUNT):
  5657. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5658. th.setDaemon(1)
  5659. th.start()
  5660. # Feed tasks to the workers.
  5661. tasksqueued = 0
  5662. while True:
  5663. if (tasksqueued < THREADCOUNT):
  5664. extras = []
  5665. for task in tasklist:
  5666. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5667. if (NeedsBuild(task[2], task[3])):
  5668. tasksqueued += 1
  5669. taskqueue.put(task)
  5670. else:
  5671. for target in task[2]:
  5672. del pending[target]
  5673. else:
  5674. extras.append(task)
  5675. tasklist = extras
  5676. sys.stdout.flush()
  5677. if (tasksqueued == 0): break
  5678. donetask = donequeue.get()
  5679. if (donetask == 0):
  5680. exit("Build process aborting.")
  5681. sys.stdout.flush()
  5682. tasksqueued -= 1
  5683. JustBuilt(donetask[2], donetask[3])
  5684. for target in donetask[2]:
  5685. del pending[target]
  5686. # Kill the workers.
  5687. for slave in range(THREADCOUNT):
  5688. taskqueue.put(0)
  5689. # Make sure there aren't any unsatisfied tasks
  5690. if len(tasklist) > 0:
  5691. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5692. SequentialMake(tasklist_seq)
  5693. def SequentialMake(tasklist):
  5694. i = 0
  5695. for task in tasklist:
  5696. if (NeedsBuild(task[2], task[3])):
  5697. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5698. JustBuilt(task[2], task[3])
  5699. i += 1
  5700. def RunDependencyQueue(tasklist):
  5701. if (THREADCOUNT!=0):
  5702. ParallelMake(tasklist)
  5703. else:
  5704. SequentialMake(tasklist)
  5705. try:
  5706. RunDependencyQueue(DEPENDENCYQUEUE)
  5707. except:
  5708. SaveDependencyCache()
  5709. raise
  5710. ##########################################################################################
  5711. #
  5712. # The Installers
  5713. #
  5714. # Under windows, we can build an 'exe' package using NSIS
  5715. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5716. # Under OSX, we can make a 'dmg' package.
  5717. #
  5718. ##########################################################################################
  5719. def MakeInstallerNSIS(file, title, installdir):
  5720. if (os.path.isfile(file)):
  5721. os.remove(file)
  5722. elif (os.path.isdir(file)):
  5723. shutil.rmtree(file)
  5724. if GetTargetArch() == 'x64':
  5725. regview = '64'
  5726. else:
  5727. regview = '32'
  5728. if (RUNTIME):
  5729. # Invoke the make_installer script.
  5730. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  5731. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  5732. cmd = sys.executable + " -B -u " + os.path.join("direct", "src", "plugin_installer", "make_installer.py")
  5733. cmd += " --version %s --regview %s" % (VERSION, regview)
  5734. if GetTargetArch() == 'x64':
  5735. cmd += " --install \"$PROGRAMFILES64\\Panda3D\" "
  5736. else:
  5737. cmd += " --install \"$PROGRAMFILES32\\Panda3D\" "
  5738. oscmd(cmd)
  5739. shutil.move(os.path.join("direct", "src", "plugin_installer", "p3d-setup.exe"), file)
  5740. return
  5741. print("Building "+title+" installer at %s" % (file))
  5742. if (COMPRESSOR != "lzma"):
  5743. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  5744. if (os.path.exists("nsis-output.exe")):
  5745. os.remove("nsis-output.exe")
  5746. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  5747. nsis_defs = {
  5748. 'COMPRESSOR' : COMPRESSOR,
  5749. 'TITLE' : title,
  5750. 'INSTALLDIR' : installdir,
  5751. 'OUTFILE' : '..\\' + file,
  5752. 'BUILT' : '..\\' + GetOutputDir(),
  5753. 'SOURCE' : '..',
  5754. 'PYVER' : SDK["PYTHONVERSION"][6:9],
  5755. 'REGVIEW' : regview,
  5756. }
  5757. if GetHost() == 'windows':
  5758. cmd = os.path.join(GetThirdpartyBase(), 'win-nsis', 'makensis') + ' /V2'
  5759. for item in nsis_defs.items():
  5760. cmd += ' /D%s="%s"' % item
  5761. else:
  5762. cmd = 'makensis -V2'
  5763. for item in nsis_defs.items():
  5764. cmd += ' -D%s="%s"' % item
  5765. cmd += ' "makepanda\installer.nsi"'
  5766. oscmd(cmd)
  5767. def MakeDebugSymbolArchive(zipname, dirname):
  5768. import zipfile
  5769. zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)
  5770. for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')):
  5771. zip.write(fn, dirname + '/bin/' + os.path.basename(fn))
  5772. for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')):
  5773. zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn))
  5774. for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')):
  5775. zip.write(fn, dirname + '/plugins/' + os.path.basename(fn))
  5776. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')):
  5777. zip.write(fn, dirname + '/python/' + os.path.basename(fn))
  5778. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')):
  5779. zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn))
  5780. zip.close()
  5781. INSTALLER_DEB_FILE="""
  5782. Package: panda3dMAJOR
  5783. Version: VERSION
  5784. Section: libdevel
  5785. Priority: optional
  5786. Architecture: ARCH
  5787. Essential: no
  5788. Depends: DEPENDS
  5789. Recommends: RECOMMENDS
  5790. Suggests: panda3d-runtime
  5791. Provides: panda3d
  5792. Conflicts: panda3d
  5793. Replaces: panda3d
  5794. Maintainer: rdb <[email protected]>
  5795. Installed-Size: INSTSIZE
  5796. Description: Panda3D free 3D engine SDK
  5797. 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.
  5798. 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.
  5799. .
  5800. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5801. """
  5802. RUNTIME_INSTALLER_DEB_FILE="""
  5803. Package: panda3d-runtime
  5804. Version: VERSION
  5805. Section: web
  5806. Priority: optional
  5807. Architecture: ARCH
  5808. Essential: no
  5809. Depends: DEPENDS
  5810. Provides: panda3d-runtime
  5811. Maintainer: rdb <[email protected]>
  5812. Installed-Size: INSTSIZE
  5813. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  5814. 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.
  5815. """
  5816. # We're not putting "python" in the "Requires" field,
  5817. # since the rpm-based distros don't have a common
  5818. # naming for the Python package.
  5819. INSTALLER_SPEC_FILE="""
  5820. Summary: The Panda3D free 3D engine SDK
  5821. Name: panda3d
  5822. Version: VERSION
  5823. Release: RPMRELEASE
  5824. License: BSD License
  5825. Group: Development/Libraries
  5826. BuildRoot: PANDASOURCE/targetroot
  5827. %description
  5828. 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.
  5829. 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.
  5830. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5831. %post
  5832. /sbin/ldconfig
  5833. %postun
  5834. /sbin/ldconfig
  5835. %files
  5836. %defattr(-,root,root)
  5837. /etc/Confauto.prc
  5838. /etc/Config.prc
  5839. /usr/share/panda3d
  5840. /usr/share/mime-info/panda3d.mime
  5841. /usr/share/mime-info/panda3d.keys
  5842. /usr/share/mime/packages/panda3d.xml
  5843. /usr/share/application-registry/panda3d.applications
  5844. /usr/share/applications/*.desktop
  5845. /etc/ld.so.conf.d/panda3d.conf
  5846. /usr/%_lib/panda3d
  5847. """ + PYTHON_SITEPACKAGES + """
  5848. /usr/include/panda3d
  5849. """
  5850. RUNTIME_INSTALLER_SPEC_FILE="""
  5851. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  5852. Name: panda3d-runtime
  5853. Version: VERSION
  5854. Release: RPMRELEASE
  5855. License: BSD License
  5856. Group: Productivity/Graphics/Other
  5857. BuildRoot: PANDASOURCE/targetroot
  5858. %description
  5859. 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.
  5860. %files
  5861. %defattr(-,root,root)
  5862. /usr/bin/panda3d
  5863. /usr/%_lib/nppanda3d.so
  5864. /usr/%_lib/mozilla/plugins/nppanda3d.so
  5865. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  5866. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  5867. /usr/share/mime-info/panda3d-runtime.mime
  5868. /usr/share/mime-info/panda3d-runtime.keys
  5869. /usr/share/mime/packages/panda3d-runtime.xml
  5870. /usr/share/application-registry/panda3d-runtime.applications
  5871. /usr/share/applications/*.desktop
  5872. """
  5873. # plist file for Mac OSX
  5874. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  5875. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  5876. <plist version="1.0">
  5877. <dict>
  5878. <key>CFBundleIdentifier</key>
  5879. <string>%(package_id)s</string>
  5880. <key>CFBundleShortVersionString</key>
  5881. <string>%(version)s</string>
  5882. <key>IFPkgFlagRelocatable</key>
  5883. <false/>
  5884. <key>IFPkgFlagAuthorizationAction</key>
  5885. <string>RootAuthorization</string>
  5886. <key>IFPkgFlagAllowBackRev</key>
  5887. <true/>
  5888. </dict>
  5889. </plist>
  5890. """
  5891. # FreeBSD pkg-descr
  5892. INSTALLER_PKG_DESCR_FILE = """
  5893. 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.
  5894. 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.
  5895. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5896. WWW: http://www.panda3d.org/
  5897. """
  5898. # FreeBSD pkg-descr
  5899. RUNTIME_INSTALLER_PKG_DESCR_FILE = """
  5900. Runtime binary and browser plugin for the Panda3D Game Engine
  5901. 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.
  5902. WWW: http://www.panda3d.org/
  5903. """
  5904. # FreeBSD PKG Manifest template file
  5905. INSTALLER_PKG_MANIFEST_FILE = """
  5906. name: NAME
  5907. version: VERSION
  5908. arch: ARCH
  5909. origin: ORIGIN
  5910. comment: "Panda 3D Engine"
  5911. www: http://www.panda3d.org
  5912. maintainer: rdb <[email protected]>
  5913. prefix: /usr/local
  5914. flatsize: INSTSIZEMB
  5915. deps: {DEPENDS}
  5916. """
  5917. def MakeInstallerLinux():
  5918. if not RUNTIME and not PkgSkip("PYTHON"):
  5919. PYTHONV = SDK["PYTHONVERSION"].rstrip('dmu')
  5920. else:
  5921. PYTHONV = "python"
  5922. PV = PYTHONV.replace("python", "")
  5923. # Clean and set up a directory to install Panda3D into
  5924. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  5925. oscmd("mkdir --mode=0755 targetroot")
  5926. dpkg_present = False
  5927. if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"):
  5928. dpkg_present = True
  5929. rpmbuild_present = False
  5930. if os.path.exists("/usr/bin/rpmbuild"):
  5931. rpmbuild_present = True
  5932. if dpkg_present and rpmbuild_present:
  5933. print("Warning: both dpkg and rpmbuild present.")
  5934. if dpkg_present:
  5935. # Invoke installpanda.py to install it into a temporary dir
  5936. lib_dir = GetDebLibDir()
  5937. if RUNTIME:
  5938. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  5939. else:
  5940. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  5941. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  5942. oscmd("mkdir -p targetroot/usr/share/man/man1")
  5943. oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/")
  5944. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  5945. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  5946. if (RUNTIME):
  5947. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  5948. else:
  5949. txt = INSTALLER_DEB_FILE[1:]
  5950. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  5951. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  5952. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  5953. oscmd("cd targetroot && (find usr -type f -exec md5sum {} ;) > DEBIAN/md5sums")
  5954. if (not RUNTIME):
  5955. oscmd("cd targetroot && (find etc -type f -exec md5sum {} ;) >> DEBIAN/md5sums")
  5956. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  5957. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  5958. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  5959. # Determine the package name and the locations that
  5960. # dpkg-shlibdeps should look in for executables.
  5961. pkg_version = DEBVERSION
  5962. if RUNTIME:
  5963. pkg_name = "panda3d-runtime"
  5964. lib_pattern = "debian/%s/usr/%s/*.so" % (pkg_name, lib_dir)
  5965. else:
  5966. pkg_name = "panda3d" + MAJOR_VERSION
  5967. lib_pattern = "debian/%s/usr/%s/panda3d/*.so*" % (pkg_name, lib_dir)
  5968. bin_pattern = "debian/%s/usr/bin/*" % (pkg_name)
  5969. # dpkg-shlibdeps looks in the debian/{pkg_name}/DEBIAN/shlibs directory
  5970. # and also expects a debian/control file, so we create this dummy set-up.
  5971. oscmd("mkdir targetroot/debian")
  5972. oscmd("ln -s .. targetroot/debian/" + pkg_name)
  5973. WriteFile("targetroot/debian/control", "")
  5974. dpkg_shlibdeps = "dpkg-shlibdeps"
  5975. if GetVerbose():
  5976. dpkg_shlibdeps += " -v"
  5977. if RUNTIME:
  5978. # The runtime doesn't export any useful symbols, so just query the dependencies.
  5979. oscmd("cd targetroot && %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals())
  5980. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  5981. recommends = ""
  5982. else:
  5983. pkg_name = "panda3d" + MAJOR_VERSION
  5984. pkg_dir = "debian/panda3d" + MAJOR_VERSION
  5985. # Generate a symbols file so that other packages can know which symbols we export.
  5986. oscmd("cd targetroot && dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals())
  5987. # Library dependencies are required, binary dependencies are recommended.
  5988. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX.
  5989. 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())
  5990. 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())
  5991. # Parse the substvars files generated by dpkg-shlibdeps.
  5992. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  5993. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  5994. if PkgSkip("PYTHON")==0:
  5995. depends += ", " + PYTHONV
  5996. recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")"
  5997. if PkgSkip("NVIDIACG")==0:
  5998. depends += ", nvidia-cg-toolkit"
  5999. # Write back the dependencies, and delete the dummy set-up.
  6000. txt = txt.replace("DEPENDS", depends.strip(', '))
  6001. txt = txt.replace("RECOMMENDS", recommends.strip(', '))
  6002. WriteFile("targetroot/DEBIAN/control", txt)
  6003. oscmd("rm -rf targetroot/debian")
  6004. # Package it all up into a .deb file.
  6005. oscmd("chmod -R 755 targetroot/DEBIAN")
  6006. oscmd("chmod 644 targetroot/DEBIAN/control targetroot/DEBIAN/md5sums")
  6007. if not RUNTIME:
  6008. oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols")
  6009. oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch))
  6010. elif rpmbuild_present:
  6011. # Invoke installpanda.py to install it into a temporary dir
  6012. if RUNTIME:
  6013. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6014. else:
  6015. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6016. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6017. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  6018. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6019. pandasource = os.path.abspath(os.getcwd())
  6020. if RUNTIME:
  6021. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  6022. else:
  6023. txt = INSTALLER_SPEC_FILE[1:]
  6024. # Add the binaries in /usr/bin explicitly to the spec file
  6025. for base in os.listdir(GetOutputDir() + "/bin"):
  6026. txt += "/usr/bin/%s\n" % (base)
  6027. # Write out the spec file.
  6028. txt = txt.replace("VERSION", VERSION)
  6029. txt = txt.replace("RPMRELEASE", RPMRELEASE)
  6030. txt = txt.replace("PANDASOURCE", pandasource)
  6031. txt = txt.replace("PV", PV)
  6032. WriteFile("panda3d.spec", txt)
  6033. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  6034. if (RUNTIME):
  6035. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6036. else:
  6037. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6038. oscmd("rm -rf "+ARCH, True)
  6039. else:
  6040. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  6041. def MakeInstallerOSX():
  6042. if (RUNTIME):
  6043. # Invoke the make_installer script.
  6044. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  6045. cmdstr = sys.executable + " "
  6046. if sys.version_info >= (2, 6):
  6047. cmdstr += "-B "
  6048. cmdstr += "direct/src/plugin_installer/make_installer.py --version %s" % VERSION
  6049. oscmd(cmdstr)
  6050. return
  6051. dmg_name = "Panda3D-" + VERSION
  6052. if not SDK["PYTHONVERSION"].startswith("python2."):
  6053. dmg_name += '-py' + SDK["PYTHONVERSION"][6:9]
  6054. dmg_name += ".dmg"
  6055. import compileall
  6056. if (os.path.isfile(dmg_name)): oscmd("rm -f %s" % dmg_name)
  6057. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  6058. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  6059. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  6060. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  6061. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  6062. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  6063. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  6064. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  6065. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  6066. oscmd("cp -R %s/Frameworks dstroot/base/Developer/Panda3D/Frameworks" % GetOutputDir())
  6067. if os.path.isdir(GetOutputDir()+"/plugins"):
  6068. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  6069. # Libraries that shouldn't be in base, but are instead in other modules.
  6070. no_base_libs = ['libp3ffmpeg', 'libp3fmod_audio', 'libfmodex', 'libfmodexL']
  6071. for base in os.listdir(GetOutputDir()+"/lib"):
  6072. if not base.endswith(".a") and base.split('.')[0] not in no_base_libs:
  6073. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  6074. # We really need to specify -R in order not to follow symlinks
  6075. # On OSX, just specifying -P is not enough to do that.
  6076. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  6077. oscmd("mkdir -p dstroot/tools/Developer/Panda3D/bin")
  6078. oscmd("mkdir -p dstroot/tools/Developer/Tools")
  6079. oscmd("ln -s ../Panda3D/bin dstroot/tools/Developer/Tools/Panda3D")
  6080. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  6081. # Trailing newline is important, works around a bug in OSX
  6082. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Panda3D/bin\n")
  6083. oscmd("mkdir -p dstroot/tools/usr/local/share/man/man1")
  6084. oscmd("cp doc/man/*.1 dstroot/tools/usr/local/share/man/man1/")
  6085. for base in os.listdir(GetOutputDir()+"/bin"):
  6086. binname = "dstroot/tools/Developer/Panda3D/bin/" + base
  6087. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  6088. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  6089. if PkgSkip("PYTHON")==0:
  6090. PV = SDK["PYTHONVERSION"][6:9]
  6091. oscmd("mkdir -p dstroot/pythoncode/usr/local/bin")
  6092. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/panda3d")
  6093. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  6094. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D")
  6095. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/pandac" % GetOutputDir())
  6096. oscmd("cp -R %s/direct dstroot/pythoncode/Developer/Panda3D/direct" % GetOutputDir())
  6097. oscmd("ln -s %s dstroot/pythoncode/usr/local/bin/ppython" % SDK["PYTHONEXEC"])
  6098. oscmd("cp -R %s/*.so dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6099. oscmd("cp -R %s/*.py dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6100. if os.path.isdir(GetOutputDir()+"/Pmw"):
  6101. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/Pmw" % GetOutputDir())
  6102. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/Pmw")
  6103. WriteFile("dstroot/pythoncode/Developer/Panda3D/direct/__init__.py", "")
  6104. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/direct"):
  6105. if ((base != "extensions") and (base != "extensions_native")):
  6106. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/direct/"+base)
  6107. for base in os.listdir(GetOutputDir()+"/panda3d"):
  6108. if base.endswith('.py') or base.endswith('.so'):
  6109. libname = "dstroot/pythoncode/Developer/Panda3D/panda3d/" + base
  6110. # We really need to specify -R in order not to follow symlinks
  6111. # On OSX, just specifying -P is not enough to do that.
  6112. oscmd("cp -R -P " + GetOutputDir() + "/panda3d/" + base + " " + libname)
  6113. if not PkgSkip("FFMPEG"):
  6114. oscmd("mkdir -p dstroot/ffmpeg/Developer/Panda3D/lib")
  6115. oscmd("cp -R %s/lib/libp3ffmpeg.* dstroot/ffmpeg/Developer/Panda3D/lib/" % GetOutputDir())
  6116. #if not PkgSkip("OPENAL"):
  6117. # oscmd("mkdir -p dstroot/openal/Developer/Panda3D/lib")
  6118. # oscmd("cp -R %s/lib/libp3openal_audio.* dstroot/openal/Developer/Panda3D/lib/" % GetOutputDir())
  6119. if not PkgSkip("FMODEX"):
  6120. oscmd("mkdir -p dstroot/fmodex/Developer/Panda3D/lib")
  6121. oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6122. oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6123. oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib")
  6124. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  6125. if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"):
  6126. oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir())
  6127. if os.path.isdir("samples"):
  6128. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  6129. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  6130. oscmd("chmod -R 0775 dstroot/*")
  6131. DeleteVCS("dstroot")
  6132. DeleteBuildFiles("dstroot")
  6133. # We need to be root to perform a chown. Bleh.
  6134. # Fortunately PackageMaker does it for us, on 10.5 and above.
  6135. #oscmd("chown -R root:admin dstroot/*", True)
  6136. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  6137. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  6138. pkgs = ["base", "tools", "headers"]
  6139. if not PkgSkip("PYTHON"): pkgs.append("pythoncode")
  6140. if not PkgSkip("FFMPEG"): pkgs.append("ffmpeg")
  6141. #if not PkgSkip("OPENAL"): pkgs.append("openal")
  6142. if not PkgSkip("FMODEX"): pkgs.append("fmodex")
  6143. if os.path.isdir("samples"): pkgs.append("samples")
  6144. for pkg in pkgs:
  6145. identifier = "org.panda3d.panda3d.%s.pkg" % pkg
  6146. plist = open("/tmp/Info_plist", "w")
  6147. plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION })
  6148. plist.close()
  6149. if not os.path.isdir("dstroot/" + pkg):
  6150. os.makedirs("dstroot/" + pkg)
  6151. if OSXTARGET and OSXTARGET <= (10, 5):
  6152. target = '--target %d.%d' % (OSXTARGET)
  6153. else:
  6154. target = ''
  6155. if os.path.exists("/usr/bin/pkgbuild"):
  6156. # This new package builder is used in Lion and above.
  6157. cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg'
  6158. # In older versions, we use PackageMaker. Apple keeps changing its location.
  6159. elif os.path.exists("/Developer/usr/bin/packagemaker"):
  6160. 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'
  6161. elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6162. 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'
  6163. elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6164. 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'
  6165. elif os.path.exists("/Developer/Tools/packagemaker"):
  6166. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  6167. elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6168. 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'
  6169. else:
  6170. exit("Neither pkgbuild nor PackageMaker could be found!")
  6171. oscmd(cmd)
  6172. if os.path.isfile("/tmp/Info_plist"):
  6173. oscmd("rm -f /tmp/Info_plist")
  6174. # Now that we've built all of the individual packages, build the metapackage.
  6175. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  6176. dist.write('<?xml version="1.0" encoding="utf-8"?>\n')
  6177. dist.write('<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">\n')
  6178. dist.write(' <title>Panda3D SDK %s</title>\n' % (VERSION))
  6179. dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>\n')
  6180. dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
  6181. dist.write(' <choices-outline>\n')
  6182. for pkg in pkgs:
  6183. dist.write(' <line choice="%s"/>\n' % (pkg))
  6184. dist.write(' </choices-outline>\n')
  6185. 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')
  6186. dist.write(' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>\n')
  6187. dist.write(' </choice>\n')
  6188. 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')
  6189. dist.write(' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>\n')
  6190. dist.write(' </choice>\n')
  6191. if not PkgSkip("PYTHON"):
  6192. 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')
  6193. dist.write(' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>\n')
  6194. dist.write(' </choice>\n')
  6195. if not PkgSkip("FFMPEG"):
  6196. 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.')
  6197. if PkgSkip("VORBIS"):
  6198. dist.write(' It is not required for loading .wav files, which Panda3D can read out of the box.">\n')
  6199. else:
  6200. dist.write(' It is not required for loading .wav or .ogg files, which Panda3D can read out of the box.">\n')
  6201. dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
  6202. dist.write(' </choice>\n')
  6203. #if not PkgSkip("OPENAL"):
  6204. # 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')
  6205. # dist.write(' <pkg-ref id="org.panda3d.panda3d.openal.pkg"/>\n')
  6206. # dist.write(' </choice>\n')
  6207. if not PkgSkip("FMODEX"):
  6208. 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')
  6209. dist.write(' <pkg-ref id="org.panda3d.panda3d.fmodex.pkg"/>\n')
  6210. dist.write(' </choice>\n')
  6211. if os.path.isdir("samples"):
  6212. 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')
  6213. dist.write(' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>\n')
  6214. dist.write(' </choice>\n')
  6215. 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')
  6216. dist.write(' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>\n')
  6217. dist.write(' </choice>\n')
  6218. for pkg in pkgs:
  6219. size = GetDirectorySize("dstroot/" + pkg) // 1024
  6220. 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))
  6221. dist.write('</installer-script>\n')
  6222. dist.close()
  6223. oscmd('hdiutil create Panda3D-rw.dmg -volname "Panda3D SDK %s" -srcfolder dstroot/Panda3D' % (VERSION))
  6224. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o %s' % (dmg_name))
  6225. oscmd('rm -f Panda3D-rw.dmg')
  6226. def MakeInstallerFreeBSD():
  6227. oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
  6228. oscmd("mkdir targetroot")
  6229. # Invoke installpanda.py to install it into a temporary dir
  6230. if RUNTIME:
  6231. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6232. else:
  6233. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6234. if not os.path.exists("/usr/sbin/pkg"):
  6235. exit("Cannot create an installer without pkg")
  6236. plist_txt = ''
  6237. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  6238. for f in files:
  6239. plist_txt += os.path.join(root, f)[21:] + "\n"
  6240. if not RUNTIME:
  6241. plist_txt += "@exec /sbin/ldconfig -m /usr/local/lib\n"
  6242. plist_txt += "@unexec /sbin/ldconfig -R\n"
  6243. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  6244. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  6245. for d in dirs:
  6246. plist_txt += "@dir %s\n" % os.path.join(root, d)[21:]
  6247. plist_txt += "@dir %s\n" % remdir
  6248. oscmd("echo \"`pkg config abi | tr '[:upper:]' '[:lower:]' | cut -d: -f1,2`:*\" > " + GetOutputDir() + "/tmp/architecture.txt")
  6249. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6250. dependencies = ''
  6251. if PkgSkip("PYTHON") == 0:
  6252. # If this version of Python was installed from a package or ports, let's mark it as dependency.
  6253. oscmd("rm -f %s/tmp/python_dep" % GetOutputDir())
  6254. 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)
  6255. if os.path.isfile(GetOutputDir() + "/tmp/python_dep"):
  6256. python_pkg = ReadFile(GetOutputDir() + "/tmp/python_dep")
  6257. if python_pkg:
  6258. dependencies += python_pkg
  6259. manifest_txt = INSTALLER_PKG_MANIFEST_FILE[1:].replace("NAME", 'Panda3D' if not RUNTIME else 'Panda3D-Runtime')
  6260. manifest_txt = manifest_txt.replace("VERSION", VERSION)
  6261. manifest_txt = manifest_txt.replace("ARCH", pkg_arch)
  6262. manifest_txt = manifest_txt.replace("ORIGIN", 'devel/panda3d' if not RUNTIME else 'graphics/panda3d-runtime')
  6263. manifest_txt = manifest_txt.replace("DEPENDS", dependencies)
  6264. manifest_txt = manifest_txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024 / 1024))
  6265. WriteFile("pkg-plist", plist_txt)
  6266. WriteFile("+DESC", INSTALLER_PKG_DESCR_FILE[1:] if not RUNTIME else RUNTIME_INSTALLER_PKG_DESCR_FILE[1:])
  6267. WriteFile("+MANIFEST", manifest_txt)
  6268. oscmd("pkg create -p pkg-plist -r %s -m . -o . %s" % (os.path.abspath("targetroot"), "--verbose" if GetVerbose() else "--quiet"))
  6269. try:
  6270. if INSTALLER:
  6271. ProgressOutput(100.0, "Building installer")
  6272. target = GetTarget()
  6273. if target == 'windows':
  6274. fn = "Panda3D-"
  6275. dir = "Panda3D-" + VERSION
  6276. if RUNTIME:
  6277. fn += "Runtime-"
  6278. title = "Panda3D " + VERSION
  6279. else:
  6280. title = "Panda3D SDK " + VERSION
  6281. fn += VERSION
  6282. if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7":
  6283. fn += '-py' + SDK["PYTHONVERSION"][6:]
  6284. if GetOptimize() <= 2:
  6285. fn += "-dbg"
  6286. if GetTargetArch() == 'x64':
  6287. fn += '-x64'
  6288. dir += '-x64'
  6289. MakeInstallerNSIS(fn + '.exe', title, 'C:\\' + dir)
  6290. if not RUNTIME:
  6291. MakeDebugSymbolArchive(fn + '-pdb.zip', dir)
  6292. elif (target == 'linux'):
  6293. MakeInstallerLinux()
  6294. elif (target == 'darwin'):
  6295. MakeInstallerOSX()
  6296. elif (target == 'freebsd'):
  6297. MakeInstallerFreeBSD()
  6298. else:
  6299. exit("Do not know how to make an installer for this platform")
  6300. if WHEEL:
  6301. ProgressOutput(100.0, "Building wheel")
  6302. from makewheel import makewheel
  6303. makewheel(WHLVERSION, GetOutputDir())
  6304. finally:
  6305. SaveDependencyCache()
  6306. ##########################################################################################
  6307. #
  6308. # Print final status report.
  6309. #
  6310. ##########################################################################################
  6311. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6312. printStatus("Makepanda Final Status Report", WARNINGS)
  6313. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())