makepanda.py 320 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173
  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. GENMAN=0
  40. COMPRESSOR="zlib"
  41. THREADCOUNT=0
  42. CFLAGS=""
  43. CXXFLAGS=""
  44. LDFLAGS=""
  45. RTDIST=0
  46. RTDIST_VERSION=None
  47. RUNTIME=0
  48. DISTRIBUTOR=""
  49. VERSION=None
  50. DEBVERSION=None
  51. RPMRELEASE="1"
  52. GIT_COMMIT=None
  53. P3DSUFFIX=None
  54. MAJOR_VERSION=None
  55. COREAPI_VERSION=None
  56. PLUGIN_VERSION=None
  57. OSXTARGET=None
  58. OSX_ARCHS=[]
  59. HOST_URL=None
  60. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  61. STRDXSDKVERSION = 'default'
  62. WINDOWS_SDK = None
  63. MSVC_VERSION = None
  64. BOOUSEINTELCOMPILER = False
  65. OPENCV_VER_23 = False
  66. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  67. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  68. PkgListSet(["PYTHON", "DIRECT", # Python support
  69. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  70. "EGL", # OpenGL (ES) integration
  71. "EIGEN", # Linear algebra acceleration
  72. "OPENAL", "FMODEX", # Audio playback
  73. "VORBIS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  74. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  75. "SPEEDTREE", # SpeedTree
  76. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", "FREETYPE", # 2D Formats support
  77. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", # 3D Formats support
  78. "VRPN", "OPENSSL", # Transport
  79. "FFTW", # Algorithm helpers
  80. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  81. "GTK2", # GTK2 is used for PStats on Unix
  82. "MFC", "WX", "FLTK", # Used for web plug-in only
  83. "ROCKET", "AWESOMIUM", # GUI libraries
  84. "CARBON", "COCOA", # Mac OS X toolkits
  85. "X11", "XF86DGA", "XRANDR", "XCURSOR", # Unix platform support
  86. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  87. "SKEL", # Example SKEL project
  88. "PANDAFX", # Some distortion special lenses
  89. "PANDAPARTICLESYSTEM", # Built in particle system
  90. "CONTRIB", # Experimental
  91. "SSE2", "NEON", # Compiler features
  92. "TOUCHINPUT", # Touchinput interface (requires Windows 7)
  93. ])
  94. CheckPandaSourceTree()
  95. def keyboardInterruptHandler(x,y):
  96. exit("keyboard interrupt")
  97. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  98. ########################################################################
  99. ##
  100. ## Command-line parser.
  101. ##
  102. ## You can type "makepanda --help" to see all the options.
  103. ##
  104. ########################################################################
  105. def usage(problem):
  106. if (problem):
  107. print("")
  108. print("Error parsing command-line input: %s" % (problem))
  109. print("")
  110. print("Makepanda generates a 'built' subdirectory containing a")
  111. print("compiled copy of Panda3D. Command-line arguments are:")
  112. print("")
  113. print(" --help (print the help message you're reading now)")
  114. print(" --verbose (print out more information)")
  115. print(" --runtime (build a runtime build instead of an SDK build)")
  116. print(" --installer (build an installer)")
  117. print(" --optimize X (optimization level can be 1,2,3,4)")
  118. print(" --version X (set the panda version number)")
  119. print(" --lzma (use lzma compression when building Windows installer)")
  120. print(" --distributor X (short string identifying the distributor of the build)")
  121. print(" --outputdir X (use the specified directory instead of 'built')")
  122. print(" --host URL (set the host url (runtime build only))")
  123. print(" --threads N (use the multithreaded build system. see manual)")
  124. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  125. print(" --universal (build universal binaries (OS X only))")
  126. print(" --override \"O=V\" (override dtool_config/prc option value)")
  127. print(" --static (builds libraries for static linking)")
  128. print(" --target X (experimental cross-compilation (android only))")
  129. print(" --arch X (target architecture for cross-compilation)")
  130. print("")
  131. for pkg in PkgListGet():
  132. p = pkg.lower()
  133. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  134. if sys.platform != 'win32':
  135. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  136. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  137. print("")
  138. print(" --nothing (disable every third-party lib)")
  139. print(" --everything (enable every third-party lib)")
  140. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  141. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  142. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
  143. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  144. print("")
  145. print("The simplest way to compile panda is to just type:")
  146. print("")
  147. print(" makepanda --everything")
  148. print("")
  149. os._exit(1)
  150. def parseopts(args):
  151. global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  152. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  153. global DEBVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  154. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  155. longopts = [
  156. "help","distributor=","verbose","runtime","osxtarget=",
  157. "optimize=","everything","nothing","installer","rtdist","nocolor",
  158. "version=","lzma","no-python","threads=","outputdir=","override=",
  159. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  160. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  161. "universal", "target=", "arch=", "git-commit="]
  162. anything = 0
  163. optimize = ""
  164. target = None
  165. target_arch = None
  166. universal = False
  167. clean_build = False
  168. for pkg in PkgListGet():
  169. longopts.append("use-" + pkg.lower())
  170. longopts.append("no-" + pkg.lower())
  171. longopts.append(pkg.lower() + "-incdir=")
  172. longopts.append(pkg.lower() + "-libdir=")
  173. try:
  174. opts, extras = getopt.getopt(args, "", longopts)
  175. for option, value in opts:
  176. if (option=="--help"): raise Exception
  177. elif (option=="--optimize"): optimize=value
  178. elif (option=="--installer"): INSTALLER=1
  179. elif (option=="--verbose"): SetVerbose(True)
  180. elif (option=="--distributor"): DISTRIBUTOR=value
  181. elif (option=="--rtdist"): RTDIST=1
  182. elif (option=="--runtime"): RUNTIME=1
  183. elif (option=="--genman"): GENMAN=1
  184. elif (option=="--everything"): PkgEnableAll()
  185. elif (option=="--nothing"): PkgDisableAll()
  186. elif (option=="--threads"): THREADCOUNT=int(value)
  187. elif (option=="--outputdir"): SetOutputDir(value.strip())
  188. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  189. elif (option=="--universal"): universal = True
  190. elif (option=="--target"): target = value.strip()
  191. elif (option=="--arch"): target_arch = value.strip()
  192. elif (option=="--nocolor"): DisableColors()
  193. elif (option=="--version"):
  194. VERSION=value
  195. if (len(VERSION.split(".")) != 3): raise Exception
  196. elif (option=="--lzma"): COMPRESSOR="lzma"
  197. elif (option=="--override"): AddOverride(value.strip())
  198. elif (option=="--static"): SetLinkAllStatic(True)
  199. elif (option=="--host"): HOST_URL=value
  200. elif (option=="--debversion"): DEBVERSION=value
  201. elif (option=="--rpmrelease"): RPMRELEASE=value
  202. elif (option=="--git-commit"): GIT_COMMIT=value
  203. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  204. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  205. # Backward compatibility, OPENGL was renamed to GL
  206. elif (option=="--use-opengl"): PkgEnable("GL")
  207. elif (option=="--no-opengl"): PkgDisable("GL")
  208. elif (option=="--directx-sdk"):
  209. STRDXSDKVERSION = value.strip().lower()
  210. if STRDXSDKVERSION == '':
  211. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  212. STRDXSDKVERSION = 'default'
  213. elif (option=="--windows-sdk"):
  214. WINDOWS_SDK = value.strip().lower()
  215. elif (option=="--msvc-version"):
  216. MSVC_VERSION = value.strip().lower()
  217. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  218. elif (option=="--clean"): clean_build = True
  219. else:
  220. for pkg in PkgListGet():
  221. if option == "--use-" + pkg.lower():
  222. PkgEnable(pkg)
  223. break
  224. elif option == "--no-" + pkg.lower():
  225. PkgDisable(pkg)
  226. break
  227. elif option == "--" + pkg.lower() + "-incdir":
  228. PkgSetCustomLocation(pkg)
  229. IncDirectory(pkg, value)
  230. break
  231. elif option == "--" + pkg.lower() + "-libdir":
  232. PkgSetCustomLocation(pkg)
  233. LibDirectory(pkg, value)
  234. break
  235. if (option == "--everything" or option.startswith("--use-")
  236. or option == "--nothing" or option.startswith("--no-")):
  237. anything = 1
  238. except:
  239. usage(sys.exc_info()[1])
  240. if not anything:
  241. if RUNTIME:
  242. PkgEnableAll()
  243. else:
  244. usage("You should specify a list of packages to use or --everything to enable all packages.")
  245. if (RTDIST and RUNTIME):
  246. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  247. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  248. elif (optimize==""): optimize = "3"
  249. if OSXTARGET:
  250. try:
  251. maj, min = OSXTARGET.strip().split('.')
  252. OSXTARGET = int(maj), int(min)
  253. assert OSXTARGET[0] == 10
  254. except:
  255. usage("Invalid setting for OSXTARGET")
  256. else:
  257. OSXTARGET = None
  258. if target is not None or target_arch is not None:
  259. SetTarget(target, target_arch)
  260. if universal:
  261. if target_arch:
  262. exit("--universal is incompatible with --arch")
  263. OSX_ARCHS.append("i386")
  264. if OSXTARGET:
  265. osxver = OSXTARGET
  266. else:
  267. maj, min = platform.mac_ver()[0].split('.')[:2]
  268. osxver = int(maj), int(min)
  269. if osxver[1] < 6:
  270. OSX_ARCHS.append("ppc")
  271. else:
  272. OSX_ARCHS.append("x86_64")
  273. elif HasTargetArch():
  274. OSX_ARCHS.append(GetTargetArch())
  275. try:
  276. SetOptimize(int(optimize))
  277. assert GetOptimize() in [1, 2, 3, 4]
  278. except:
  279. usage("Invalid setting for OPTIMIZE")
  280. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  281. usage("Invalid SHA-1 hash given for --git-commit option!")
  282. if GetTarget() == 'windows':
  283. if not MSVC_VERSION:
  284. print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
  285. MSVC_VERSION = 10
  286. try:
  287. MSVC_VERSION = int(MSVC_VERSION)
  288. except:
  289. usage("Invalid setting for --msvc-version")
  290. if not WINDOWS_SDK:
  291. print("No Windows SDK version specified. Defaulting to '7.1'.")
  292. WINDOWS_SDK = '7.1'
  293. is_win7 = False
  294. if sys.platform == 'win32':
  295. # Note: not available in cygwin.
  296. winver = sys.getwindowsversion()
  297. if winver[0] >= 6 and winver[1] >= 1:
  298. is_win7 = True
  299. if RUNTIME or not is_win7:
  300. PkgDisable("TOUCHINPUT")
  301. else:
  302. PkgDisable("TOUCHINPUT")
  303. if clean_build and os.path.isdir(GetOutputDir()):
  304. print("Deleting %s" % (GetOutputDir()))
  305. shutil.rmtree(GetOutputDir())
  306. parseopts(sys.argv[1:])
  307. ########################################################################
  308. ##
  309. ## Handle environment variables.
  310. ##
  311. ########################################################################
  312. if ("CFLAGS" in os.environ):
  313. CFLAGS = os.environ["CFLAGS"].strip()
  314. if ("CXXFLAGS" in os.environ):
  315. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  316. if ("RPM_OPT_FLAGS" in os.environ):
  317. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  318. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  319. if ("LDFLAGS" in os.environ):
  320. LDFLAGS = os.environ["LDFLAGS"].strip()
  321. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  322. if GetHost() == "darwin" and OSXTARGET is not None:
  323. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  324. ########################################################################
  325. ##
  326. ## Configure things based on the command-line parameters.
  327. ##
  328. ########################################################################
  329. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  330. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  331. if VERSION is None:
  332. if RUNTIME:
  333. VERSION = PLUGIN_VERSION
  334. else:
  335. VERSION = ParsePandaVersion("dtool/PandaVersion.pp")
  336. print("Version: %s" % VERSION)
  337. if RUNTIME or RTDIST:
  338. print("Core API Version: %s" % COREAPI_VERSION)
  339. if DEBVERSION is None:
  340. DEBVERSION = VERSION
  341. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  342. if P3DSUFFIX is None:
  343. P3DSUFFIX = MAJOR_VERSION
  344. outputdir_suffix = ""
  345. if (RUNTIME or RTDIST):
  346. # Compiling Maya/Max is pointless in rtdist build
  347. for ver in MAYAVERSIONS + MAXVERSIONS:
  348. PkgDisable(ver)
  349. if (DISTRIBUTOR.strip() == ""):
  350. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  351. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  352. if (RUNTIME):
  353. outputdir_suffix += "_rt"
  354. if DISTRIBUTOR == "":
  355. DISTRIBUTOR = "makepanda"
  356. elif not RTDIST_VERSION:
  357. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  358. if not RTDIST_VERSION:
  359. RTDIST_VERSION = "dev"
  360. if not IsCustomOutputDir():
  361. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  362. outputdir_suffix += '_x64'
  363. SetOutputDir("built" + outputdir_suffix)
  364. if (RUNTIME):
  365. for pkg in PkgListGet():
  366. if pkg in ["GTK2", "MFC"]:
  367. # Optional package(s) for runtime.
  368. pass
  369. elif pkg in ["OPENSSL", "ZLIB"]:
  370. # Required packages for runtime.
  371. if (PkgSkip(pkg)==1):
  372. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  373. else:
  374. # Unused packages for runtime.
  375. PkgDisable(pkg)
  376. if (INSTALLER and RTDIST):
  377. exit("Cannot build an installer for the rtdist build!")
  378. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  379. exit("Cannot build installer on Windows without python")
  380. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  381. exit("Cannot build rtdist without wx or fltk")
  382. if (RUNTIME):
  383. SetLinkAllStatic(True)
  384. if not os.path.isdir("contrib"):
  385. PkgDisable("CONTRIB")
  386. ########################################################################
  387. ##
  388. ## Load the dependency cache.
  389. ##
  390. ########################################################################
  391. LoadDependencyCache()
  392. ########################################################################
  393. ##
  394. ## Locate various SDKs.
  395. ##
  396. ########################################################################
  397. MakeBuildTree()
  398. SdkLocateDirectX(STRDXSDKVERSION)
  399. SdkLocateMaya()
  400. SdkLocateMax()
  401. SdkLocateMacOSX(OSXTARGET)
  402. SdkLocatePython(RTDIST)
  403. SdkLocateWindows(WINDOWS_SDK)
  404. SdkLocatePhysX()
  405. SdkLocateSpeedTree()
  406. SdkLocateAndroid()
  407. SdkAutoDisableDirectX()
  408. SdkAutoDisableMaya()
  409. SdkAutoDisableMax()
  410. SdkAutoDisablePhysX()
  411. SdkAutoDisableSpeedTree()
  412. if RTDIST and DISTRIBUTOR == "cmu":
  413. # Some validation checks for the CMU builds.
  414. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  415. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  416. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  417. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  418. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  419. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  420. if RTDIST and not HOST_URL:
  421. exit("You must specify a host URL when building the rtdist!")
  422. if RUNTIME and not HOST_URL:
  423. # Set this to a nice default.
  424. HOST_URL = "https://runtime.panda3d.org/"
  425. ########################################################################
  426. ##
  427. ## Choose a Compiler.
  428. ##
  429. ## This should also set up any environment variables needed to make
  430. ## the compiler work.
  431. ##
  432. ########################################################################
  433. if GetHost() == 'windows' and GetTarget() == 'windows':
  434. COMPILER = "MSVC"
  435. SdkLocateVisualStudio(MSVC_VERSION)
  436. else:
  437. COMPILER = "GCC"
  438. SetupBuildEnvironment(COMPILER)
  439. ########################################################################
  440. ##
  441. ## External includes, external libraries, and external defsyms.
  442. ##
  443. ########################################################################
  444. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  445. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  446. if (COMPILER == "MSVC"):
  447. PkgDisable("X11")
  448. PkgDisable("XRANDR")
  449. PkgDisable("XF86DGA")
  450. PkgDisable("XCURSOR")
  451. PkgDisable("GLES")
  452. PkgDisable("GLES2")
  453. PkgDisable("EGL")
  454. PkgDisable("CARBON")
  455. PkgDisable("COCOA")
  456. if (PkgSkip("PYTHON")==0):
  457. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  458. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  459. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  460. for pkg in PkgListGet():
  461. if (PkgSkip(pkg)==0):
  462. if (pkg[:4]=="MAYA"):
  463. IncDirectory(pkg, SDK[pkg] + "/include")
  464. DefSymbol(pkg, "MAYAVERSION", pkg)
  465. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  466. elif (pkg[:3]=="MAX"):
  467. IncDirectory(pkg, SDK[pkg] + "/include")
  468. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  469. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  470. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  471. DefSymbol(pkg, "MAX", pkg)
  472. if (int(pkg[3:]) >= 2013):
  473. DefSymbol(pkg, "UNICODE", "")
  474. DefSymbol(pkg, "_UNICODE", "")
  475. elif (pkg[:2]=="DX"):
  476. IncDirectory(pkg, SDK[pkg] + "/include")
  477. elif GetThirdpartyDir() is not None:
  478. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  479. for pkg in DXVERSIONS:
  480. if (PkgSkip(pkg)==0):
  481. vnum=pkg[2:]
  482. if GetTargetArch() == 'x64':
  483. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  484. else:
  485. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  486. LibDirectory(pkg, SDK[pkg] + '/lib')
  487. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  488. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  489. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  490. LibName(pkg, 'dxerr.lib')
  491. else:
  492. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  493. #LibName(pkg, 'ddraw.lib')
  494. LibName(pkg, 'dxguid.lib')
  495. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  496. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  497. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  498. LibName("WINSOCK", "wsock32.lib")
  499. LibName("WINSOCK2", "wsock32.lib")
  500. LibName("WINSOCK2", "ws2_32.lib")
  501. LibName("WINCOMCTL", "comctl32.lib")
  502. LibName("WINCOMDLG", "comdlg32.lib")
  503. LibName("WINUSER", "user32.lib")
  504. LibName("WINMM", "winmm.lib")
  505. LibName("WINIMM", "imm32.lib")
  506. LibName("WINKERNEL", "kernel32.lib")
  507. LibName("WINOLE", "ole32.lib")
  508. LibName("WINOLEAUT", "oleaut32.lib")
  509. LibName("WINOLDNAMES", "oldnames.lib")
  510. LibName("WINSHELL", "shell32.lib")
  511. LibName("WINGDI", "gdi32.lib")
  512. LibName("ADVAPI", "advapi32.lib")
  513. LibName("IPHLPAPI", "iphlpapi.lib")
  514. LibName("GL", "opengl32.lib")
  515. LibName("GLES", "libgles_cm.lib")
  516. LibName("GLES2", "libGLESv2.lib")
  517. LibName("EGL", "libEGL.lib")
  518. LibName("MSIMG", "msimg32.lib")
  519. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  520. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  521. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  522. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  523. if (PkgSkip("OPENSSL")==0):
  524. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  525. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  526. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  527. else:
  528. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  529. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  530. if (PkgSkip("PNG")==0):
  531. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  532. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  533. else:
  534. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  535. if (PkgSkip("TIFF")==0):
  536. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  537. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  538. else:
  539. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  540. if (PkgSkip("OPENEXR")==0):
  541. suffix = ""
  542. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  543. suffix = "-2_2"
  544. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  545. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  546. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  547. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  548. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  549. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  550. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  551. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  552. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  553. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  554. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  555. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  556. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  557. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  558. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  559. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  560. if (PkgSkip("ASSIMP")==0): PkgDisable("ASSIMP") # Not yet supported
  561. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  562. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  563. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  564. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  565. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  566. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM",GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  567. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  568. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  569. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  570. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  571. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  572. if (PkgSkip("FCOLLADA")==0):
  573. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  574. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  575. if (PkgSkip("SQUISH")==0):
  576. if GetOptimize() <= 2:
  577. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  578. else:
  579. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  580. if (PkgSkip("ROCKET")==0):
  581. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  582. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  583. if (PkgSkip("PYTHON")==0):
  584. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  585. if (GetOptimize() <= 3):
  586. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  587. if (PkgSkip("OPENAL")==0):
  588. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  589. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  590. # Link OpenAL Soft statically.
  591. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  592. if (PkgSkip("ODE")==0):
  593. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  594. DefSymbol("ODE", "dSINGLE", "")
  595. if (PkgSkip("FMODEX")==0):
  596. if (GetTargetArch() == 'x64'):
  597. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  598. else:
  599. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  600. if (PkgSkip("FLTK")==0 and RTDIST):
  601. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  602. if not PkgSkip("FLTK"):
  603. # If we have fltk, we don't need wx
  604. PkgDisable("WX")
  605. if (PkgSkip("WX")==0 and RTDIST):
  606. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  607. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  608. DefSymbol("WX", "__WXMSW__", "")
  609. DefSymbol("WX", "_UNICODE", "")
  610. DefSymbol("WX", "UNICODE", "")
  611. if (PkgSkip("VORBIS")==0):
  612. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libogg_static.lib")
  613. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbis_static.lib")
  614. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbisfile_static.lib")
  615. for pkg in MAYAVERSIONS:
  616. if (PkgSkip(pkg)==0):
  617. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  618. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  619. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  620. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  621. for pkg in MAXVERSIONS:
  622. if (PkgSkip(pkg)==0):
  623. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  624. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  625. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  626. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  627. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  628. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  629. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  630. if (PkgSkip("PHYSX")==0):
  631. if GetTargetArch() == 'x64':
  632. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  633. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  634. else:
  635. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  636. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  637. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  638. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  639. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  640. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  641. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  642. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  643. if (PkgSkip("SPEEDTREE")==0):
  644. if GetTargetArch() == 'x64':
  645. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  646. p64ext = '64'
  647. else:
  648. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  649. p64ext = ''
  650. debugext = ''
  651. if (GetOptimize() <= 2): debugext = "_d"
  652. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  653. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  654. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  655. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  656. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  657. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  658. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  659. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  660. LibName("SPEEDTREE", "glu32.lib")
  661. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  662. if (PkgSkip("BULLET")==0):
  663. suffix = '.lib'
  664. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  665. suffix = '_x64.lib'
  666. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  667. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  668. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  669. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  670. if (COMPILER=="GCC"):
  671. PkgDisable("AWESOMIUM")
  672. if GetTarget() != "darwin":
  673. PkgDisable("CARBON")
  674. PkgDisable("COCOA")
  675. elif RUNTIME:
  676. # We don't support Cocoa in the runtime yet.
  677. PkgDisable("COCOA")
  678. if 'x86_64' in OSX_ARCHS:
  679. # 64-bits OS X doesn't have Carbon.
  680. PkgDisable("CARBON")
  681. #if (PkgSkip("PYTHON")==0):
  682. # IncDirectory("PYTHON", SDK["PYTHON"])
  683. if (GetHost() == "darwin"):
  684. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  685. IncDirectory("FREETYPE", "/usr/X11/include")
  686. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  687. LibDirectory("FREETYPE", "/usr/X11/lib")
  688. if (GetHost() == "freebsd"):
  689. IncDirectory("ALWAYS", "/usr/local/include")
  690. LibDirectory("ALWAYS", "/usr/local/lib")
  691. if (os.path.isdir("/usr/PCBSD")):
  692. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  693. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  694. if GetTarget() != "windows":
  695. PkgDisable("DIRECTCAM")
  696. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  697. # WARNING! The order of the ffmpeg libraries matters!
  698. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  699. # Name pkg-config libs, include(dir)s
  700. if (not RUNTIME):
  701. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  702. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  703. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  704. SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp")
  705. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  706. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  707. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  708. SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
  709. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  710. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  711. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  712. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  713. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  714. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  715. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  716. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  717. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  718. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  719. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  720. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  721. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  722. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  723. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  724. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  725. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  726. if GetTarget() == "darwin" and not PkgSkip("FFMPEG"):
  727. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  728. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  729. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  730. if cv_lib == "opencv_core":
  731. OPENCV_VER_23 = True
  732. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  733. else:
  734. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  735. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  736. rocket_libs = ("RocketCore", "RocketControls")
  737. if (GetOptimize() <= 3):
  738. rocket_libs += ("RocketDebugger",)
  739. rocket_libs += ("boost_python",)
  740. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  741. if not PkgSkip("PYTHON"):
  742. SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config")
  743. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  744. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  745. SmartPkgEnable("GTK2", "gtk+-2.0")
  746. if (RTDIST):
  747. SmartPkgEnable("WX", tool = "wx-config")
  748. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  749. if GetTarget() != 'darwin':
  750. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  751. if not PkgSkip("NVIDIACG") and not RUNTIME:
  752. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h")
  753. if not RUNTIME:
  754. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h"))
  755. SmartPkgEnable("XRANDR", "xrandr", "Xrandr", "X11/extensions/Xrandr.h")
  756. SmartPkgEnable("XF86DGA", "xxf86dga", "Xxf86dga", "X11/extensions/xf86dga.h")
  757. SmartPkgEnable("XCURSOR", "xcursor", "Xcursor", "X11/Xcursor/Xcursor.h")
  758. if GetHost() != "darwin":
  759. # Workaround for an issue where pkg-config does not include this path
  760. if GetTargetArch() in ("x86_64", "amd64"):
  761. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  762. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  763. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  764. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  765. if not PkgSkip("X11"):
  766. if (os.path.isdir("/usr/X11R6/lib64")):
  767. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  768. else:
  769. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  770. elif not PkgSkip("X11"):
  771. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  772. if RUNTIME:
  773. # For the runtime, these packages are required
  774. for pkg in ["OPENSSL", "ZLIB"]:
  775. skips = []
  776. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  777. skips.append(pkg)
  778. if skips:
  779. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  780. for pkg in MAYAVERSIONS:
  781. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  782. if (GetHost() == "darwin"):
  783. # Sheesh, Autodesk really can't make up their mind
  784. # regarding the location of the Maya devkit on OS X.
  785. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  786. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  787. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  788. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  789. if (os.path.isdir(SDK[pkg] + "/lib")):
  790. LibDirectory(pkg, SDK[pkg] + "/lib")
  791. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  792. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  793. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  794. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  795. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  796. IncDirectory(pkg, SDK[pkg] + "/include")
  797. else:
  798. LibDirectory(pkg, SDK[pkg] + "/lib")
  799. IncDirectory(pkg, SDK[pkg] + "/include")
  800. DefSymbol(pkg, "MAYAVERSION", pkg)
  801. if GetTarget() == 'darwin':
  802. LibName("ALWAYS", "-framework AppKit")
  803. if (PkgSkip("OPENCV")==0):
  804. LibName("OPENCV", "-framework QuickTime")
  805. LibName("AGL", "-framework AGL")
  806. LibName("CARBON", "-framework Carbon")
  807. LibName("COCOA", "-framework Cocoa")
  808. # Fix for a bug in OSX Leopard:
  809. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  810. if GetTarget() == 'android':
  811. LibName("ALWAYS", '-llog')
  812. LibName("ALWAYS", '-landroid')
  813. LibName("JNIGRAPHICS", '-ljnigraphics')
  814. for pkg in MAYAVERSIONS:
  815. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  816. if GetTarget() == 'darwin':
  817. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  818. else:
  819. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  820. LibName(pkg, "-lOpenMaya")
  821. LibName(pkg, "-lOpenMayaAnim")
  822. LibName(pkg, "-lAnimSlice")
  823. LibName(pkg, "-lDeformSlice")
  824. LibName(pkg, "-lModifiers")
  825. LibName(pkg, "-lDynSlice")
  826. LibName(pkg, "-lKinSlice")
  827. LibName(pkg, "-lModelSlice")
  828. LibName(pkg, "-lNurbsSlice")
  829. LibName(pkg, "-lPolySlice")
  830. LibName(pkg, "-lProjectSlice")
  831. LibName(pkg, "-lImage")
  832. LibName(pkg, "-lShared")
  833. LibName(pkg, "-lTranslators")
  834. LibName(pkg, "-lDataModel")
  835. LibName(pkg, "-lRenderModel")
  836. LibName(pkg, "-lNurbsEngine")
  837. LibName(pkg, "-lDependEngine")
  838. LibName(pkg, "-lCommandEngine")
  839. LibName(pkg, "-lFoundation")
  840. LibName(pkg, "-lIMFbase")
  841. if GetTarget() != 'darwin':
  842. LibName(pkg, "-lOpenMayalib")
  843. else:
  844. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  845. if (PkgSkip("PHYSX")==0):
  846. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  847. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  848. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  849. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  850. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  851. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  852. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  853. if (GetHost() == "darwin"):
  854. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  855. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  856. else:
  857. LibName("PHYSX", "-lPhysXLoader")
  858. LibName("PHYSX", "-lNxCharacter")
  859. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  860. if GetLinkAllStatic():
  861. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  862. if GetTarget() == 'android':
  863. DefSymbol("ALWAYS", "ANDROID")
  864. if not PkgSkip("EIGEN"):
  865. DefSymbol("ALWAYS", "EIGEN_MPL2_ONLY")
  866. if GetOptimize() >= 3:
  867. DefSymbol("ALWAYS", "EIGEN_NO_DEBUG")
  868. if COMPILER == "MSVC":
  869. # Squeeze out a bit more performance on MSVC builds...
  870. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  871. # will turn them into runtime assertions.
  872. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  873. ########################################################################
  874. ##
  875. ## Give a Status Report on Command-Line Options
  876. ##
  877. ########################################################################
  878. def printStatus(header,warnings):
  879. if GetVerbose():
  880. print("")
  881. print("-------------------------------------------------------------------")
  882. print(header)
  883. tkeep = ""
  884. tomit = ""
  885. for x in PkgListGet():
  886. if PkgSkip(x):
  887. tomit = tomit + x + " "
  888. else:
  889. tkeep = tkeep + x + " "
  890. if RTDIST:
  891. print("Makepanda: Runtime distribution build")
  892. elif RUNTIME:
  893. print("Makepanda: Runtime build")
  894. else:
  895. print("Makepanda: Regular build")
  896. print("Makepanda: Compiler: %s" % (COMPILER))
  897. print("Makepanda: Optimize: %d" % (GetOptimize()))
  898. print("Makepanda: Keep Pkg: %s" % (tkeep))
  899. print("Makepanda: Omit Pkg: %s" % (tomit))
  900. if GENMAN:
  901. print("Makepanda: Generate API reference manual")
  902. else:
  903. print("Makepanda: Don't generate API reference manual")
  904. if GetHost() == "windows" and not RTDIST:
  905. if INSTALLER:
  906. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  907. else:
  908. print("Makepanda: Don't build installer")
  909. print("Makepanda: Version ID: %s" % (VERSION))
  910. for x in warnings:
  911. print("Makepanda: %s" % (x))
  912. print("-------------------------------------------------------------------")
  913. print("")
  914. sys.stdout.flush()
  915. ########################################################################
  916. ##
  917. ## BracketNameWithQuotes
  918. ##
  919. ########################################################################
  920. def BracketNameWithQuotes(name):
  921. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  922. if (name.startswith("-framework")): return name
  923. if (name.startswith("-dylib_file")): return name
  924. # Don't add quotes when it's not necessary.
  925. if " " not in name: return name
  926. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  927. if (name.startswith('"') and name.endswith('"')): return name
  928. else: return '"' + name + '"'
  929. ########################################################################
  930. ##
  931. ## CompileCxx
  932. ##
  933. ########################################################################
  934. def CompileCxx(obj,src,opts):
  935. ipath = GetListOption(opts, "DIR:")
  936. optlevel = GetOptimizeOption(opts)
  937. if (COMPILER=="MSVC"):
  938. if not BOOUSEINTELCOMPILER:
  939. cmd = "cl "
  940. if GetTargetArch() == 'x64':
  941. cmd += "/favor:blend "
  942. cmd += "/wd4996 /wd4275 /wd4273 "
  943. # Enable Windows 7 interfaces if we need Touchinput.
  944. if PkgSkip("TOUCHINPUT") == 0:
  945. cmd += "/DWINVER=0x601 "
  946. else:
  947. cmd += "/DWINVER=0x501 "
  948. cmd += "/Fo" + obj + " /nologo /c"
  949. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  950. cmd += " /arch:SSE2"
  951. for x in ipath: cmd += " /I" + x
  952. for (opt,dir) in INCDIRECTORIES:
  953. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  954. for (opt,var,val) in DEFSYMBOLS:
  955. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  956. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  957. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  958. if (optlevel==2): cmd += " /MDd /Zi"
  959. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  960. if (optlevel==4):
  961. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  962. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  963. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  964. building = GetValueOption(opts, "BUILDING:")
  965. if (building):
  966. cmd += " /DBUILDING_" + building
  967. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  968. cmd += " /bigobj"
  969. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  970. if 'EXCEPTIONS' in opts:
  971. cmd += " /EHsc"
  972. else:
  973. cmd += " /D_HAS_EXCEPTIONS=0"
  974. if 'RTTI' not in opts:
  975. cmd += " /GR-"
  976. if GetTargetArch() == 'x64':
  977. cmd += " /DWIN64_VC /DWIN64"
  978. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10:
  979. # To preserve Windows XP compatibility.
  980. cmd += " /D_USING_V110_SDK71_"
  981. cmd += " /W3 " + BracketNameWithQuotes(src)
  982. oscmd(cmd)
  983. else:
  984. cmd = "icl "
  985. if GetTargetArch() == 'x64':
  986. cmd += "/favor:blend "
  987. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  988. # Enable Windows 7 interfaces if we need Touchinput.
  989. if PkgSkip("TOUCHINPUT") == 0:
  990. cmd += "/DWINVER=0x601 "
  991. else:
  992. cmd += "/DWINVER=0x501 "
  993. cmd += "/Fo" + obj + " /c"
  994. for x in ipath: cmd += " /I" + x
  995. for (opt,dir) in INCDIRECTORIES:
  996. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  997. for (opt,var,val) in DEFSYMBOLS:
  998. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  999. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1000. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1001. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1002. # core changes from jean-claude (dec 2011)
  1003. # ----------------------------------------
  1004. # performance will be seeked at level 3 & 4
  1005. # -----------------------------------------
  1006. if (optlevel==3):
  1007. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1008. cmd += " /Ob0"
  1009. cmd += " /Qipo-" # beware of IPO !!!
  1010. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1011. ## ----------------------------------------------------------------
  1012. if (optlevel==4):
  1013. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1014. cmd += " /Qipo" # optimization multi file
  1015. # for 3 & 4 optimization levels
  1016. # -----------------------------
  1017. if (optlevel>=3):
  1018. cmd += " /fp:fast=2"
  1019. cmd += " /Qftz"
  1020. cmd += " /Qfp-speculation:fast"
  1021. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1022. cmd += " /Qprec-div-"
  1023. cmd += " /Qsimd"
  1024. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1025. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1026. cmd += " /Qparallel" # enable parallelization
  1027. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1028. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1029. ## PCH files with a .pchi filename suffix and reduce build time.
  1030. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1031. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1032. cmd += " /Qpchi-" # keep it this way!
  1033. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1034. ## ------------------------------------
  1035. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1036. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1037. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1038. ## Ctor displacement /vd0 : Disable constructor displacement.
  1039. ## Choose this option only if no class constructors or destructors call virtual functions.
  1040. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1041. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1042. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1043. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1044. ## Alternate: #pragma pointers_to_members
  1045. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1046. building = GetValueOption(opts, "BUILDING:")
  1047. if (building): cmd += " /DBUILDING_" + building
  1048. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1049. cmd += " /bigobj"
  1050. # level of warnings and optimization reports
  1051. if GetVerbose():
  1052. cmd += " /W3 " # or /W4 or /Wall
  1053. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1054. else:
  1055. cmd += " /W1 "
  1056. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1057. if GetTargetArch() == 'x64':
  1058. cmd += " /DWIN64_VC /DWIN64"
  1059. cmd += " " + BracketNameWithQuotes(src)
  1060. oscmd(cmd)
  1061. if (COMPILER=="GCC"):
  1062. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1063. else: cmd = GetCXX()+' -ftemplate-depth-70 -fPIC -c -o ' + obj
  1064. for (opt, dir) in INCDIRECTORIES:
  1065. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1066. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1067. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1068. for (opt,var,val) in DEFSYMBOLS:
  1069. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1070. for x in ipath: cmd += ' -I' + x
  1071. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1072. cmd += ' -fvisibility=hidden'
  1073. # Mac-specific flags.
  1074. if GetTarget() == "darwin":
  1075. cmd += " -Wno-deprecated-declarations"
  1076. if OSXTARGET is not None:
  1077. cmd += " -isysroot " + SDK["MACOSX"]
  1078. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1079. for arch in OSX_ARCHS:
  1080. if 'NOARCH:' + arch.upper() not in opts:
  1081. cmd += " -arch %s" % arch
  1082. if "SYSROOT" in SDK:
  1083. cmd += ' --sysroot=%s -no-canonical-prefixes' % (SDK["SYSROOT"])
  1084. # Android-specific flags.
  1085. arch = GetTargetArch()
  1086. if GetTarget() == "android":
  1087. # Most of the specific optimization flags here were
  1088. # just copied from the default Android Makefiles.
  1089. cmd += ' -I%s/include' % (SDK["ANDROID_STL"])
  1090. cmd += ' -I%s/libs/%s/include' % (SDK["ANDROID_STL"], SDK["ANDROID_ABI"])
  1091. cmd += ' -ffunction-sections -funwind-tables'
  1092. if arch == 'armv7a':
  1093. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1094. cmd += ' -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1095. elif arch == 'arm':
  1096. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1097. cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float'
  1098. elif arch == 'mips':
  1099. cmd += ' -finline-functions -fmessage-length=0'
  1100. cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
  1101. cmd += ' -frerun-cse-after-loop -frename-registers'
  1102. cmd += " -Wa,--noexecstack"
  1103. # Now add specific release/debug flags.
  1104. if optlevel >= 3:
  1105. cmd += " -fomit-frame-pointer"
  1106. if arch.startswith('arm'):
  1107. cmd += ' -finline-limit=64 -mthumb'
  1108. elif arch == 'mips':
  1109. cmd += ' -funswitch-loops -finline-limit=300'
  1110. else:
  1111. cmd += ' -fno-omit-frame-pointer'
  1112. if arch.startswith('arm'):
  1113. cmd += ' -marm'
  1114. # Enable SIMD instructions if requested
  1115. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1116. cmd += ' -mfpu=neon'
  1117. else:
  1118. cmd += " -pthread"
  1119. if not src.endswith(".c"):
  1120. # We don't use exceptions for most modules.
  1121. if 'EXCEPTIONS' in opts:
  1122. cmd += " -fexceptions"
  1123. else:
  1124. cmd += " -fno-exceptions"
  1125. if src.endswith(".mm"):
  1126. # Work around Apple compiler bug.
  1127. cmd += " -U__EXCEPTIONS"
  1128. if 'RTTI' not in opts:
  1129. # We always disable RTTI on Android for memory usage reasons.
  1130. if optlevel >= 4 or GetTarget() == "android":
  1131. cmd += " -fno-rtti"
  1132. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"):
  1133. cmd += " -msse2"
  1134. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1135. cmd += " -fno-strict-aliasing"
  1136. if optlevel >= 3:
  1137. cmd += " -ffast-math"
  1138. if optlevel == 3:
  1139. # Fast math is nice, but we'd like to see NaN in dev builds.
  1140. cmd += " -fno-finite-math-only"
  1141. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1142. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1143. if (optlevel==3): cmd += " -O2"
  1144. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1145. if src.endswith(".c"):
  1146. cmd += ' ' + CFLAGS
  1147. else:
  1148. cmd += ' ' + CXXFLAGS
  1149. cmd = cmd.rstrip()
  1150. building = GetValueOption(opts, "BUILDING:")
  1151. if (building): cmd += " -DBUILDING_" + building
  1152. cmd += ' ' + BracketNameWithQuotes(src)
  1153. oscmd(cmd)
  1154. ########################################################################
  1155. ##
  1156. ## CompileBison
  1157. ##
  1158. ########################################################################
  1159. def CompileBison(wobj, wsrc, opts):
  1160. ifile = os.path.basename(wsrc)
  1161. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1162. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1163. pre = GetValueOption(opts, "BISONPREFIX_")
  1164. bison = GetBison()
  1165. if bison is None:
  1166. # We don't have bison. See if there is a prebuilt file.
  1167. base, ext = os.path.splitext(wsrc)
  1168. if os.path.isfile(base + '.h.prebuilt') and \
  1169. os.path.isfile(base + '.cxx.prebuilt'):
  1170. CopyFile(wdstc, base + '.cxx.prebuilt')
  1171. CopyFile(wdsth, base + '.h.prebuilt')
  1172. else:
  1173. exit('Could not find bison!')
  1174. else:
  1175. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1176. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1177. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1178. # Finally, compile the generated source file.
  1179. CompileCxx(wobj,wdstc,opts)
  1180. ########################################################################
  1181. ##
  1182. ## CompileFlex
  1183. ##
  1184. ########################################################################
  1185. def CompileFlex(wobj,wsrc,opts):
  1186. ifile = os.path.basename(wsrc)
  1187. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1188. pre = GetValueOption(opts, "BISONPREFIX_")
  1189. dashi = opts.count("FLEXDASHI")
  1190. flex = GetFlex()
  1191. if flex is None:
  1192. # We don't have flex. See if there is a prebuilt file.
  1193. base, ext = os.path.splitext(wsrc)
  1194. if os.path.isfile(base + '.cxx.prebuilt'):
  1195. CopyFile(wdst, base + '.cxx.prebuilt')
  1196. else:
  1197. exit('Could not find flex!')
  1198. else:
  1199. if (dashi):
  1200. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1201. else:
  1202. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1203. # Finally, compile the generated source file.
  1204. CompileCxx(wobj,wdst,opts)
  1205. ########################################################################
  1206. ##
  1207. ## CompileIgate
  1208. ##
  1209. ########################################################################
  1210. def CompileIgate(woutd,wsrc,opts):
  1211. outbase = os.path.basename(woutd)[:-3]
  1212. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1213. wobj = FindLocation(outbase + "_igate.obj", [])
  1214. srcdir = GetValueOption(opts, "SRCDIR:")
  1215. module = GetValueOption(opts, "IMOD:")
  1216. library = GetValueOption(opts, "ILIB:")
  1217. ipath = GetListOption(opts, "DIR:")
  1218. if (PkgSkip("PYTHON")):
  1219. WriteFile(woutc, "")
  1220. WriteFile(woutd, "")
  1221. ConditionalWriteFile(woutd, "")
  1222. return (wobj, woutc, opts)
  1223. if not CrossCompiling():
  1224. # If we're compiling for this platform, we can use the one we've built.
  1225. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1226. else:
  1227. # Assume that interrogate is on the PATH somewhere.
  1228. cmd = 'interrogate'
  1229. if GetVerbose():
  1230. cmd += ' -v'
  1231. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1232. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1233. if (COMPILER=="MSVC"):
  1234. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1235. if GetTargetArch() == 'x64':
  1236. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1237. else:
  1238. cmd += ' -D_M_IX86'
  1239. # NOTE: this 1600 value is the version number for VC2010.
  1240. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1241. if (COMPILER=="GCC"):
  1242. cmd += ' -D__attribute__\(x\)='
  1243. if GetTargetArch() in ("x86_64", "amd64"):
  1244. cmd += ' -D_LP64'
  1245. else:
  1246. cmd += ' -D__i386__'
  1247. if GetTarget() == 'darwin':
  1248. cmd += ' -D__APPLE__'
  1249. optlevel = GetOptimizeOption(opts)
  1250. if (optlevel==1): cmd += ' -D_DEBUG'
  1251. if (optlevel==2): cmd += ' -D_DEBUG'
  1252. if (optlevel==3): pass
  1253. if (optlevel==4): cmd += ' -DNDEBUG'
  1254. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1255. cmd += ' -fnames -string -refcount -assert -python-native'
  1256. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1257. # Add -I, -S and -D flags
  1258. for x in ipath:
  1259. cmd += ' -I' + BracketNameWithQuotes(x)
  1260. for (opt,dir) in INCDIRECTORIES:
  1261. if (opt=="ALWAYS") or (opt in opts):
  1262. cmd += ' -S' + BracketNameWithQuotes(dir)
  1263. for (opt,var,val) in DEFSYMBOLS:
  1264. if (opt=="ALWAYS") or (opt in opts):
  1265. cmd += ' -D' + var + '=' + val
  1266. #building = GetValueOption(opts, "BUILDING:")
  1267. #if (building): cmd += " -DBUILDING_"+building
  1268. cmd += ' -module ' + module + ' -library ' + library
  1269. for x in wsrc:
  1270. if (x.startswith("/")):
  1271. cmd += ' ' + BracketNameWithQuotes(x)
  1272. else:
  1273. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1274. oscmd(cmd)
  1275. return (wobj, woutc, opts)
  1276. ########################################################################
  1277. ##
  1278. ## CompileImod
  1279. ##
  1280. ########################################################################
  1281. def CompileImod(wobj, wsrc, opts):
  1282. module = GetValueOption(opts, "IMOD:")
  1283. library = GetValueOption(opts, "ILIB:")
  1284. if (COMPILER=="MSVC"):
  1285. woutc = wobj[:-4]+".cxx"
  1286. if (COMPILER=="GCC"):
  1287. woutc = wobj[:-2]+".cxx"
  1288. if (PkgSkip("PYTHON")):
  1289. WriteFile(woutc, "")
  1290. CompileCxx(wobj, woutc, opts)
  1291. return
  1292. if not CrossCompiling():
  1293. # If we're compiling for this platform, we can use the one we've built.
  1294. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1295. else:
  1296. # Assume that interrogate_module is on the PATH somewhere.
  1297. cmd = 'interrogate_module'
  1298. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1299. importmod = GetValueOption(opts, "IMPORT:")
  1300. if importmod:
  1301. cmd += ' -import ' + importmod
  1302. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1303. oscmd(cmd)
  1304. CompileCxx(wobj,woutc,opts)
  1305. return
  1306. ########################################################################
  1307. ##
  1308. ## CompileLib
  1309. ##
  1310. ########################################################################
  1311. def CompileLib(lib, obj, opts):
  1312. if (COMPILER=="MSVC"):
  1313. if not BOOUSEINTELCOMPILER:
  1314. #Use MSVC Linker
  1315. cmd = 'link /lib /nologo'
  1316. if GetOptimizeOption(opts) == 4:
  1317. cmd += " /LTCG"
  1318. if HasTargetArch():
  1319. cmd += " /MACHINE:" + GetTargetArch().upper()
  1320. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1321. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1322. oscmd(cmd)
  1323. else:
  1324. # Choose Intel linker; from Jean-Claude
  1325. cmd = 'xilink /verbose:lib /lib '
  1326. if HasTargetArch():
  1327. cmd += " /MACHINE:" + GetTargetArch().upper()
  1328. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1329. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1330. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1331. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1332. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1333. oscmd(cmd)
  1334. if (COMPILER=="GCC"):
  1335. if GetTarget() == 'darwin':
  1336. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1337. else:
  1338. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1339. for x in obj:
  1340. cmd += ' ' + BracketNameWithQuotes(x)
  1341. oscmd(cmd)
  1342. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1343. ########################################################################
  1344. ##
  1345. ## CompileLink
  1346. ##
  1347. ########################################################################
  1348. def CompileLink(dll, obj, opts):
  1349. if (COMPILER=="MSVC"):
  1350. if not BOOUSEINTELCOMPILER:
  1351. cmd = "link /nologo "
  1352. if HasTargetArch():
  1353. cmd += " /MACHINE:" + GetTargetArch().upper()
  1354. if ("MFC" not in opts):
  1355. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1356. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1357. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1358. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1359. optlevel = GetOptimizeOption(opts)
  1360. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1361. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1362. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1363. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1364. if ("MFC" in opts):
  1365. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1366. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1367. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1368. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1369. # Set the subsystem. Specify that we want to target Windows XP.
  1370. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1371. cmd += " /SUBSYSTEM:" + subsystem
  1372. if GetTargetArch() == 'x64':
  1373. cmd += ",5.02"
  1374. else:
  1375. cmd += ",5.01"
  1376. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1377. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1378. for (opt, dir) in LIBDIRECTORIES:
  1379. if (opt=="ALWAYS") or (opt in opts):
  1380. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1381. for x in obj:
  1382. if x.endswith(".dll") or x.endswith(".pyd"):
  1383. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1384. elif x.endswith(".lib"):
  1385. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1386. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1387. exit("Error: in makepanda, specify "+dname+", not "+x)
  1388. cmd += ' ' + BracketNameWithQuotes(x)
  1389. elif x.endswith(".def"):
  1390. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1391. elif x.endswith(".dat"):
  1392. pass
  1393. else:
  1394. cmd += ' ' + BracketNameWithQuotes(x)
  1395. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1396. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1397. for (opt, name) in LIBNAMES:
  1398. if (opt=="ALWAYS") or (opt in opts):
  1399. cmd += " " + BracketNameWithQuotes(name)
  1400. oscmd(cmd)
  1401. else:
  1402. cmd = "xilink"
  1403. if GetVerbose(): cmd += " /verbose:lib"
  1404. if HasTargetArch():
  1405. cmd += " /MACHINE:" + GetTargetArch().upper()
  1406. if ("MFC" not in opts):
  1407. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1408. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1409. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1410. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1411. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1412. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1413. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1414. optlevel = GetOptimizeOption(opts)
  1415. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1416. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1417. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1418. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1419. if ("MFC" in opts):
  1420. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1421. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1422. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1423. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1424. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1425. if subsystem:
  1426. cmd += " /SUBSYSTEM:" + subsystem
  1427. if dll.endswith(".dll"):
  1428. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1429. for (opt, dir) in LIBDIRECTORIES:
  1430. if (opt=="ALWAYS") or (opt in opts):
  1431. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1432. for x in obj:
  1433. if x.endswith(".dll") or x.endswith(".pyd"):
  1434. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1435. elif x.endswith(".lib"):
  1436. dname = os.path.splitext(dll)[0]+".dll"
  1437. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1438. exit("Error: in makepanda, specify "+dname+", not "+x)
  1439. cmd += ' ' + BracketNameWithQuotes(x)
  1440. elif x.endswith(".def"):
  1441. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1442. elif x.endswith(".dat"):
  1443. pass
  1444. else:
  1445. cmd += ' ' + BracketNameWithQuotes(x)
  1446. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1447. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1448. for (opt, name) in LIBNAMES:
  1449. if (opt=="ALWAYS") or (opt in opts):
  1450. cmd += " " + BracketNameWithQuotes(name)
  1451. oscmd(cmd)
  1452. if COMPILER == "GCC":
  1453. cxx = GetCXX()
  1454. if GetOrigExt(dll) == ".exe" and GetTarget() != 'android':
  1455. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1456. else:
  1457. if (GetTarget() == "darwin"):
  1458. cmd = cxx + ' -undefined dynamic_lookup'
  1459. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1460. cmd += ' -bundle '
  1461. else:
  1462. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1463. cmd += ' -dynamiclib -install_name ' + install_name
  1464. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1465. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1466. else:
  1467. cmd = cxx + ' -shared'
  1468. if "MODULE" not in opts or GetTarget() == 'android':
  1469. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1470. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1471. for x in obj:
  1472. if GetOrigExt(x) != ".dat":
  1473. cmd += ' ' + x
  1474. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1475. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1476. # Mac OS X specific flags.
  1477. if GetTarget() == 'darwin':
  1478. cmd += " -headerpad_max_install_names"
  1479. if OSXTARGET is not None:
  1480. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1481. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1482. for arch in OSX_ARCHS:
  1483. if 'NOARCH:' + arch.upper() not in opts:
  1484. cmd += " -arch %s" % arch
  1485. if "SYSROOT" in SDK:
  1486. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1487. # Android-specific flags.
  1488. if GetTarget() == 'android':
  1489. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1490. if GetTargetArch() == 'armv7a':
  1491. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1492. cmd += ' -lc -lm'
  1493. else:
  1494. cmd += " -pthread"
  1495. if LDFLAGS != "":
  1496. cmd += " " + LDFLAGS
  1497. for (opt, dir) in LIBDIRECTORIES:
  1498. if (opt=="ALWAYS") or (opt in opts):
  1499. cmd += ' -L' + BracketNameWithQuotes(dir)
  1500. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1501. if (opt=="ALWAYS") or (opt in opts):
  1502. cmd += ' -F' + BracketNameWithQuotes(dir)
  1503. for (opt, name) in LIBNAMES:
  1504. if (opt=="ALWAYS") or (opt in opts):
  1505. cmd += ' ' + BracketNameWithQuotes(name)
  1506. if GetTarget() != 'freebsd':
  1507. cmd += " -ldl"
  1508. oscmd(cmd)
  1509. if GetTarget() == 'android':
  1510. # Copy the library to built/libs/$ANDROID_ABI and strip it.
  1511. # This is the format that Android NDK projects should use.
  1512. new_path = '%s/libs/%s/%s' % (GetOutputDir(), SDK["ANDROID_ABI"], os.path.basename(dll))
  1513. CopyFile(new_path, dll)
  1514. oscmd('%s --strip-unneeded %s' % (GetStrip(), BracketNameWithQuotes(new_path)))
  1515. elif (GetOptimizeOption(opts)==4 and GetTarget() == 'linux'):
  1516. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1517. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1518. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1519. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1520. if os.path.isfile(newdll):
  1521. os.remove(newdll)
  1522. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1523. elif dll.endswith("." + MAJOR_VERSION):
  1524. newdll = dll[:-len(MAJOR_VERSION)-1]
  1525. if os.path.isfile(newdll):
  1526. os.remove(newdll)
  1527. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1528. ##########################################################################################
  1529. #
  1530. # CompileEgg
  1531. #
  1532. ##########################################################################################
  1533. def CompileEgg(eggfile, src, opts):
  1534. pz = False
  1535. if eggfile.endswith(".pz"):
  1536. pz = True
  1537. eggfile = eggfile[:-3]
  1538. # Determine the location of the pzip and flt2egg tools.
  1539. if CrossCompiling():
  1540. # We may not be able to use our generated versions of these tools,
  1541. # so we'll expect them to already be present in the PATH.
  1542. pzip = 'pzip'
  1543. flt2egg = 'flt2egg'
  1544. else:
  1545. # If we're compiling for this machine, we can use the binaries we've built.
  1546. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1547. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1548. if not os.path.isfile(pzip):
  1549. pzip = 'pzip'
  1550. if not os.path.isfile(flt2egg):
  1551. flt2egg = 'flt2egg'
  1552. if src.endswith(".egg"):
  1553. CopyFile(eggfile, src)
  1554. elif src.endswith(".flt"):
  1555. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1556. if pz:
  1557. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1558. ##########################################################################################
  1559. #
  1560. # CompileRes, CompileRsrc
  1561. #
  1562. ##########################################################################################
  1563. def CompileRes(target, src, opts):
  1564. """Compiles a Windows .rc file into a .res file."""
  1565. ipath = GetListOption(opts, "DIR:")
  1566. if (COMPILER == "MSVC"):
  1567. cmd = "rc"
  1568. cmd += " /Fo" + BracketNameWithQuotes(target)
  1569. for x in ipath: cmd += " /I" + x
  1570. for (opt,dir) in INCDIRECTORIES:
  1571. if (opt=="ALWAYS") or (opt in opts):
  1572. cmd += " /I" + BracketNameWithQuotes(dir)
  1573. for (opt,var,val) in DEFSYMBOLS:
  1574. if (opt=="ALWAYS") or (opt in opts):
  1575. cmd += " /D" + var + "=" + val
  1576. cmd += " " + BracketNameWithQuotes(src)
  1577. else:
  1578. cmd = "windres"
  1579. for x in ipath: cmd += " -I" + x
  1580. for (opt,dir) in INCDIRECTORIES:
  1581. if (opt=="ALWAYS") or (opt in opts):
  1582. cmd += " -I" + BracketNameWithQuotes(dir)
  1583. for (opt,var,val) in DEFSYMBOLS:
  1584. if (opt=="ALWAYS") or (opt in opts):
  1585. cmd += " -D" + var + "=" + val
  1586. cmd += " -i " + BracketNameWithQuotes(src)
  1587. cmd += " -o " + BracketNameWithQuotes(target)
  1588. oscmd(cmd)
  1589. def CompileRsrc(target, src, opts):
  1590. """Compiles a Mac OS .r file into an .rsrc file."""
  1591. ipath = GetListOption(opts, "DIR:")
  1592. if os.path.isfile("/usr/bin/Rez"):
  1593. cmd = "Rez -useDF"
  1594. else:
  1595. cmd = "/Developer/Tools/Rez -useDF"
  1596. cmd += " -o " + BracketNameWithQuotes(target)
  1597. for x in ipath:
  1598. cmd += " -i " + x
  1599. for (opt,dir) in INCDIRECTORIES:
  1600. if (opt=="ALWAYS") or (opt in opts):
  1601. cmd += " -i " + BracketNameWithQuotes(dir)
  1602. for (opt,var,val) in DEFSYMBOLS:
  1603. if (opt=="ALWAYS") or (opt in opts):
  1604. if (val == ""):
  1605. cmd += " -d " + var
  1606. else:
  1607. cmd += " -d " + var + " = " + val
  1608. cmd += " " + BracketNameWithQuotes(src)
  1609. oscmd(cmd)
  1610. ##########################################################################################
  1611. #
  1612. # FreezePy
  1613. #
  1614. ##########################################################################################
  1615. def FreezePy(target, inputs, opts):
  1616. assert len(inputs) > 0
  1617. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1618. if sys.version_info >= (2, 6):
  1619. cmdstr += "-B "
  1620. cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py")
  1621. if 'FREEZE_STARTUP' in opts:
  1622. cmdstr += " -s"
  1623. if GetOrigExt(target) == '.exe':
  1624. src = inputs.pop(0)
  1625. else:
  1626. src = ""
  1627. for i in inputs:
  1628. i = os.path.splitext(i)[0]
  1629. i = i.replace('/', '.')
  1630. if i.startswith('direct.src'):
  1631. i = i.replace('.src.', '.')
  1632. cmdstr += " -i " + i
  1633. cmdstr += " -o " + target + " " + src
  1634. if ("LINK_PYTHON_STATIC" in opts):
  1635. os.environ["LINK_PYTHON_STATIC"] = "1"
  1636. oscmd(cmdstr)
  1637. if ("LINK_PYTHON_STATIC" in os.environ):
  1638. del os.environ["LINK_PYTHON_STATIC"]
  1639. if (not os.path.exists(target)):
  1640. exit("FREEZER_ERROR")
  1641. ##########################################################################################
  1642. #
  1643. # Package
  1644. #
  1645. ##########################################################################################
  1646. def Package(target, inputs, opts):
  1647. assert len(inputs) == 1
  1648. # Invoke the ppackage script.
  1649. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1650. if GetOptimizeOption(opts) >= 4:
  1651. command += "-OO "
  1652. if sys.version_info >= (2, 6):
  1653. command += "-B "
  1654. command += "direct/src/p3d/ppackage.py"
  1655. if not RTDIST:
  1656. # Don't compile Python sources, because we might not running in the same
  1657. # Python version as the selected host.
  1658. command += " -N"
  1659. if GetTarget() == "darwin":
  1660. if SDK.get("MACOSX"):
  1661. command += " -R \"%s\"" % SDK["MACOSX"]
  1662. for arch in OSX_ARCHS:
  1663. if arch == "x86_64":
  1664. arch = "amd64"
  1665. command += " -P osx_%s" % arch
  1666. command += " -i \"" + GetOutputDir() + "/stage\""
  1667. if (P3DSUFFIX):
  1668. command += ' -a "' + P3DSUFFIX + '"'
  1669. command += " " + inputs[0]
  1670. if GetOrigExt(target) == '.p3d':
  1671. # Build a specific .p3d file.
  1672. basename = os.path.basename(os.path.splitext(target)[0])
  1673. command += " " + basename
  1674. oscmd(command)
  1675. if GetTarget() == 'windows':
  1676. # Make an .exe that calls this .p3d.
  1677. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1678. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1679. exefile = FindLocation(basename + '.exe', [])
  1680. CompileLink(exefile, [objfile], ['ADVAPI'])
  1681. # Move it to the bin directory.
  1682. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1683. if sys.platform != 'win32':
  1684. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1685. else:
  1686. # This is presumably a package or set of packages.
  1687. oscmd(command)
  1688. ##########################################################################################
  1689. #
  1690. # CompileBundle
  1691. #
  1692. ##########################################################################################
  1693. def CompileBundle(target, inputs, opts):
  1694. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1695. plist = None
  1696. resources = []
  1697. objects = []
  1698. for i in inputs:
  1699. if (i.endswith(".plist")):
  1700. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1701. plist = i
  1702. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1703. resources.append(i)
  1704. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1705. objects.append(i)
  1706. else:
  1707. exit("Don't know how to bundle file %s" % i)
  1708. # Now link the object files to form the bundle.
  1709. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1710. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1711. oscmd("rm -rf %s" % target)
  1712. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1713. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1714. if target.endswith(".app"):
  1715. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1716. else:
  1717. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1718. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1719. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1720. for r in resources:
  1721. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1722. ##########################################################################################
  1723. #
  1724. # CompileMIDL
  1725. #
  1726. ##########################################################################################
  1727. def CompileMIDL(target, src, opts):
  1728. ipath = GetListOption(opts, "DIR:")
  1729. if (COMPILER=="MSVC"):
  1730. cmd = "midl"
  1731. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1732. for x in ipath: cmd += " /I" + x
  1733. for (opt,dir) in INCDIRECTORIES:
  1734. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1735. for (opt,var,val) in DEFSYMBOLS:
  1736. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1737. cmd += " " + BracketNameWithQuotes(src)
  1738. oscmd(cmd)
  1739. ##########################################################################################
  1740. #
  1741. # CompileAnything
  1742. #
  1743. ##########################################################################################
  1744. def CompileAnything(target, inputs, opts, progress = None):
  1745. if (opts.count("DEPENDENCYONLY")):
  1746. return
  1747. if (len(inputs)==0):
  1748. exit("No input files for target "+target)
  1749. infile = inputs[0]
  1750. origsuffix = GetOrigExt(target)
  1751. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1752. # It must be a simple copy operation.
  1753. ProgressOutput(progress, "Copying file", target)
  1754. CopyFile(target, infile)
  1755. if (origsuffix==".exe" and GetHost() != "windows"):
  1756. os.system("chmod +x \"%s\"" % target)
  1757. return
  1758. elif (infile.endswith(".py")):
  1759. if origsuffix == ".obj":
  1760. source = os.path.splitext(target)[0] + ".c"
  1761. SetOrigExt(source, ".c")
  1762. ProgressOutput(progress, "Building frozen source", source)
  1763. FreezePy(source, inputs, opts)
  1764. ProgressOutput(progress, "Building C++ object", target)
  1765. return CompileCxx(target, source, opts)
  1766. if origsuffix == ".exe":
  1767. ProgressOutput(progress, "Building frozen executable", target)
  1768. else:
  1769. ProgressOutput(progress, "Building frozen library", target)
  1770. return FreezePy(target, inputs, opts)
  1771. elif (infile.endswith(".idl")):
  1772. ProgressOutput(progress, "Compiling MIDL file", infile)
  1773. return CompileMIDL(target, infile, opts)
  1774. elif (infile.endswith(".pdef")):
  1775. if origsuffix == '.p3d':
  1776. ProgressOutput(progress, "Building package", target)
  1777. else:
  1778. ProgressOutput(progress, "Building package from pdef file", infile)
  1779. return Package(target, inputs, opts)
  1780. elif origsuffix in SUFFIX_LIB:
  1781. ProgressOutput(progress, "Linking static library", target)
  1782. return CompileLib(target, inputs, opts)
  1783. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1784. if (origsuffix==".exe"):
  1785. ProgressOutput(progress, "Linking executable", target)
  1786. else:
  1787. ProgressOutput(progress, "Linking dynamic library", target)
  1788. # Add version number to the dynamic library, on unix
  1789. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  1790. tplatform = GetTarget()
  1791. if tplatform == "darwin":
  1792. # On Mac, libraries are named like libpanda.1.2.dylib
  1793. if target.lower().endswith(".dylib"):
  1794. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1795. SetOrigExt(target, origsuffix)
  1796. elif tplatform != "windows" and tplatform != "android":
  1797. # On Linux, libraries are named like libpanda.so.1.2
  1798. target += "." + MAJOR_VERSION
  1799. SetOrigExt(target, origsuffix)
  1800. return CompileLink(target, inputs, opts)
  1801. elif (origsuffix==".in"):
  1802. ProgressOutput(progress, "Building Interrogate database", target)
  1803. args = CompileIgate(target, inputs, opts)
  1804. ProgressOutput(progress, "Building C++ object", args[0])
  1805. return CompileCxx(*args)
  1806. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  1807. ProgressOutput(progress, "Building plugin bundle", target)
  1808. return CompileBundle(target, inputs, opts)
  1809. elif (origsuffix==".app"):
  1810. ProgressOutput(progress, "Building application bundle", target)
  1811. return CompileBundle(target, inputs, opts)
  1812. elif (origsuffix==".pz"):
  1813. ProgressOutput(progress, "Compressing", target)
  1814. return CompileEgg(target, infile, opts)
  1815. elif (origsuffix==".egg"):
  1816. ProgressOutput(progress, "Converting", target)
  1817. return CompileEgg(target, infile, opts)
  1818. elif (origsuffix==".res"):
  1819. ProgressOutput(progress, "Building resource object", target)
  1820. return CompileRes(target, infile, opts)
  1821. elif (origsuffix==".rsrc"):
  1822. ProgressOutput(progress, "Building resource object", target)
  1823. return CompileRsrc(target, infile, opts)
  1824. elif (origsuffix==".obj"):
  1825. if (infile.endswith(".cxx")):
  1826. ProgressOutput(progress, "Building C++ object", target)
  1827. return CompileCxx(target, infile, opts)
  1828. elif (infile.endswith(".c")):
  1829. ProgressOutput(progress, "Building C object", target)
  1830. return CompileCxx(target, infile, opts)
  1831. elif (infile.endswith(".mm")):
  1832. ProgressOutput(progress, "Building Objective-C++ object", target)
  1833. return CompileCxx(target, infile, opts)
  1834. elif (infile.endswith(".yxx")):
  1835. ProgressOutput(progress, "Building Bison object", target)
  1836. return CompileBison(target, infile, opts)
  1837. elif (infile.endswith(".lxx")):
  1838. ProgressOutput(progress, "Building Flex object", target)
  1839. return CompileFlex(target, infile, opts)
  1840. elif (infile.endswith(".in")):
  1841. ProgressOutput(progress, "Building Interrogate object", target)
  1842. return CompileImod(target, inputs, opts)
  1843. elif (infile.endswith(".rc")):
  1844. ProgressOutput(progress, "Building resource object", target)
  1845. return CompileRes(target, infile, opts)
  1846. elif (infile.endswith(".r")):
  1847. ProgressOutput(progress, "Building resource object", target)
  1848. return CompileRsrc(target, infile, opts)
  1849. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1850. ##########################################################################################
  1851. #
  1852. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1853. #
  1854. ##########################################################################################
  1855. DTOOL_CONFIG=[
  1856. #_Variable_________________________Windows___________________Unix__________
  1857. ("HAVE_PYTHON", '1', '1'),
  1858. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1859. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1860. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1861. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1862. ("HAVE_MAYA", '1', '1'),
  1863. ("MAYA_PRE_5_0", 'UNDEF', 'UNDEF'),
  1864. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1865. ("SSL_097", 'UNDEF', 'UNDEF'),
  1866. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1867. ("USE_PANDAFILESTREAM", '1', '1'),
  1868. ("USE_DELETED_CHAIN", '1', '1'),
  1869. ("HAVE_WIN_TOUCHINPUT", 'UNDEF', 'UNDEF'),
  1870. ("HAVE_GLX", 'UNDEF', '1'),
  1871. ("HAVE_WGL", '1', 'UNDEF'),
  1872. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1873. ("HAVE_CHROMIUM", 'UNDEF', 'UNDEF'),
  1874. ("HAVE_THREADS", '1', '1'),
  1875. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1876. ("OS_SIMPLE_THREADS", '1', '1'),
  1877. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1878. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1879. ("HAVE_AUDIO", '1', '1'),
  1880. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1881. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1882. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  1883. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1884. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  1885. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  1886. ("TRACK_IN_INTERPRETER", 'UNDEF', 'UNDEF'),
  1887. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1888. ("DO_PIPELINING", '1', '1'),
  1889. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1890. ("LINK_IN_GL", 'UNDEF', 'UNDEF'),
  1891. ("LINK_IN_PHYSICS", 'UNDEF', 'UNDEF'),
  1892. ("DEFAULT_PATHSEP", '";"', '":"'),
  1893. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1894. ("HAVE_NAMESPACE", '1', '1'),
  1895. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1896. ("HAVE_LOCKF", '1', '1'),
  1897. ("HAVE_WCHAR_T", '1', '1'),
  1898. ("HAVE_WSTRING", '1', '1'),
  1899. ("HAVE_TYPENAME", '1', '1'),
  1900. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1901. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1902. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1903. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1904. ("HAVE_GETOPT", 'UNDEF', '1'),
  1905. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1906. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1907. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1908. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1909. ("HAVE_STREAMSIZE", '1', '1'),
  1910. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1911. ("HAVE_IOS_BINARY", '1', '1'),
  1912. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1913. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1914. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1915. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1916. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1917. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1918. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1919. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1920. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1921. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1922. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1923. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1924. ("PHAVE_IO_H", '1', 'UNDEF'),
  1925. ("PHAVE_IOSTREAM", '1', '1'),
  1926. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1927. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1928. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1929. ("PHAVE_MALLOC_H", '1', '1'),
  1930. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1931. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1932. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1933. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1934. ("PHAVE_SSTREAM", '1', '1'),
  1935. ("PHAVE_NEW", '1', '1'),
  1936. ("PHAVE_SYS_TYPES_H", '1', '1'),
  1937. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  1938. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  1939. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  1940. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  1941. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  1942. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  1943. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  1944. ("PHAVE_STDINT_H", '1', '1'),
  1945. ("HAVE_RTTI", '1', '1'),
  1946. ("HAVE_X11", 'UNDEF', '1'),
  1947. ("HAVE_XRANDR", 'UNDEF', '1'),
  1948. ("HAVE_XF86DGA", 'UNDEF', '1'),
  1949. ("HAVE_XCURSOR", 'UNDEF', '1'),
  1950. ("IS_LINUX", 'UNDEF', '1'),
  1951. ("IS_OSX", 'UNDEF', 'UNDEF'),
  1952. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  1953. ("GLOBAL_OPERATOR_NEW_EXCEPTIONS", 'UNDEF', '1'),
  1954. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  1955. ("LINMATH_ALIGN", '1', '1'),
  1956. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  1957. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  1958. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  1959. ("PHAVE_JPEGINT_H", '1', '1'),
  1960. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  1961. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  1962. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  1963. ("HAVE_SGI_RGB", '1', '1'),
  1964. ("HAVE_TGA", '1', '1'),
  1965. ("HAVE_IMG", '1', '1'),
  1966. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  1967. ("HAVE_BMP", '1', '1'),
  1968. ("HAVE_PNM", '1', '1'),
  1969. ("HAVE_STB_IMAGE", '1', '1'),
  1970. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  1971. ("HAVE_NVIDIACG", 'UNDEF', 'UNDEF'),
  1972. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  1973. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  1974. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  1975. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  1976. ("HAVE_EGG", '1', '1'),
  1977. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  1978. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  1979. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  1980. ("HAVE_FFMPEG", 'UNDEF', 'UNDEF'),
  1981. ("HAVE_SWSCALE", 'UNDEF', 'UNDEF'),
  1982. ("HAVE_SWRESAMPLE", 'UNDEF', 'UNDEF'),
  1983. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  1984. ("HAVE_OPENCV", 'UNDEF', 'UNDEF'),
  1985. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  1986. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  1987. ("HAVE_FCOLLADA", 'UNDEF', 'UNDEF'),
  1988. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  1989. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  1990. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1991. ("HAVE_ROCKET_PYTHON", '1', '1'),
  1992. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  1993. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  1994. # ("_SECURE_SCL", '0', 'UNDEF'),
  1995. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  1996. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  1997. ]
  1998. PRC_PARAMETERS=[
  1999. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2000. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2001. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2002. ("PRC_PATH2_ENVVARS", '""', '""'),
  2003. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2004. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2005. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2006. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2007. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2008. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2009. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2010. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2011. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2012. ]
  2013. def WriteConfigSettings():
  2014. dtool_config={}
  2015. prc_parameters={}
  2016. speedtree_parameters={}
  2017. plugin_config={}
  2018. if (GetTarget() == 'windows'):
  2019. for key,win,unix in DTOOL_CONFIG:
  2020. dtool_config[key] = win
  2021. for key,win,unix in PRC_PARAMETERS:
  2022. prc_parameters[key] = win
  2023. else:
  2024. for key,win,unix in DTOOL_CONFIG:
  2025. dtool_config[key] = unix
  2026. for key,win,unix in PRC_PARAMETERS:
  2027. prc_parameters[key] = unix
  2028. for x in PkgListGet():
  2029. if ("HAVE_"+x in dtool_config):
  2030. if (PkgSkip(x)==0):
  2031. dtool_config["HAVE_"+x] = '1'
  2032. else:
  2033. dtool_config["HAVE_"+x] = 'UNDEF'
  2034. if not PkgSkip("OPENCV"):
  2035. dtool_config["OPENCV_VER_23"] = '1' if OPENCV_VER_23 else 'UNDEF'
  2036. dtool_config["HAVE_NET"] = '1'
  2037. if (PkgSkip("NVIDIACG")==0):
  2038. dtool_config["HAVE_CG"] = '1'
  2039. dtool_config["HAVE_CGGL"] = '1'
  2040. dtool_config["HAVE_CGDX9"] = '1'
  2041. if (GetTarget() != "linux"):
  2042. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2043. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2044. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2045. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2046. if (GetTarget() == "darwin"):
  2047. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2048. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2049. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2050. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2051. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2052. dtool_config["HAVE_XRANDR"] = 'UNDEF'
  2053. dtool_config["HAVE_XF86DGA"] = 'UNDEF'
  2054. dtool_config["HAVE_XCURSOR"] = 'UNDEF'
  2055. dtool_config["HAVE_GLX"] = 'UNDEF'
  2056. dtool_config["IS_LINUX"] = 'UNDEF'
  2057. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2058. dtool_config["IS_OSX"] = '1'
  2059. # 10.4 had a broken ucontext implementation
  2060. if int(platform.mac_ver()[0][3]) <= 4:
  2061. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2062. if (GetTarget() == "freebsd"):
  2063. dtool_config["IS_LINUX"] = 'UNDEF'
  2064. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2065. dtool_config["IS_FREEBSD"] = '1'
  2066. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2067. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2068. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2069. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2070. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2071. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2072. if (GetTarget() == "android"):
  2073. # Android does have RTTI, but we disable it anyway.
  2074. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2075. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2076. dtool_config["HAVE_LOCKF"] = 'UNDEF'
  2077. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2078. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2079. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2080. # This should probably be more sophisticated, such as based
  2081. # on whether the libRocket Python modules are available.
  2082. if (PkgSkip("PYTHON") != 0):
  2083. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2084. if (PkgSkip("TOUCHINPUT") == 0 and GetTarget() == "windows"):
  2085. dtool_config["HAVE_WIN_TOUCHINPUT"] = '1'
  2086. if (GetOptimize() <= 3):
  2087. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2088. if (GetOptimize() <= 3):
  2089. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2090. dtool_config["DO_PSTATS"] = '1'
  2091. if (GetOptimize() <= 3):
  2092. dtool_config["DO_DCAST"] = '1'
  2093. if (GetOptimize() <= 3):
  2094. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2095. #if (GetOptimize() <= 2):
  2096. # dtool_config["TRACK_IN_INTERPRETER"] = '1'
  2097. if (GetOptimize() <= 3):
  2098. dtool_config["DO_MEMORY_USAGE"] = '1'
  2099. if (GetOptimize() <= 3):
  2100. dtool_config["NOTIFY_DEBUG"] = '1'
  2101. if (GetOptimize() >= 4):
  2102. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2103. if (GetOptimize() >= 4):
  2104. # Disable RTTI on release builds.
  2105. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2106. # Now that we have OS_SIMPLE_THREADS, we can support
  2107. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2108. # longer need to disable it for this platform.
  2109. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2110. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2111. if (RTDIST or RUNTIME):
  2112. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2113. if HOST_URL:
  2114. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2115. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2116. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2117. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2118. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2119. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2120. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2121. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2122. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2123. if PkgSkip("GTK2") == 0:
  2124. plugin_config["HAVE_GTK"] = '1'
  2125. if (RUNTIME):
  2126. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2127. # Whether it's present on the system doesn't matter here,
  2128. # as the runtime itself doesn't include or link with X11.
  2129. if (RUNTIME and GetTarget() == 'linux'):
  2130. dtool_config["HAVE_X11"] = '1'
  2131. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2132. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2133. else:
  2134. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2135. if (PkgSkip("SPEEDTREE")==0):
  2136. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2137. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2138. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2139. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2140. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2141. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2142. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2143. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2144. for key in sorted(prc_parameters.keys()):
  2145. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2146. val = OverrideValue(key, prc_parameters[key])
  2147. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2148. else: conf = conf + "#define " + key + " " + val + "\n"
  2149. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2150. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2151. for key in sorted(dtool_config.keys()):
  2152. val = OverrideValue(key, dtool_config[key])
  2153. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2154. else: conf = conf + "#define " + key + " " + val + "\n"
  2155. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2156. if (RTDIST or RUNTIME):
  2157. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2158. for key in sorted(plugin_config.keys()):
  2159. val = plugin_config[key]
  2160. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2161. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2162. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2163. if (PkgSkip("SPEEDTREE")==0):
  2164. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2165. for key in sorted(speedtree_parameters.keys()):
  2166. val = OverrideValue(key, speedtree_parameters[key])
  2167. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2168. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2169. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2170. for x in PkgListGet():
  2171. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2172. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2173. WriteConfigSettings()
  2174. WarnConflictingFiles()
  2175. if SystemLibraryExists("dtoolbase"):
  2176. print("%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor()))
  2177. if SystemLibraryExists("p3dtoolconfig"):
  2178. print("%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor()))
  2179. ##########################################################################################
  2180. #
  2181. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2182. #
  2183. ##########################################################################################
  2184. PANDAVERSION_H="""
  2185. #define PANDA_MAJOR_VERSION $VERSION1
  2186. #define PANDA_MINOR_VERSION $VERSION2
  2187. #define PANDA_SEQUENCE_VERSION $VERSION3
  2188. #define PANDA_VERSION $NVERSION
  2189. #define PANDA_NUMERIC_VERSION $NVERSION
  2190. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2191. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2192. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2193. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2194. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2195. """
  2196. PANDAVERSION_H_RUNTIME="""
  2197. #define PANDA_MAJOR_VERSION 0
  2198. #define PANDA_MINOR_VERSION 0
  2199. #define PANDA_SEQUENCE_VERSION 0
  2200. #define PANDA_VERSION_STR "0.0.0"
  2201. #define PANDA_ABI_VERSION_STR "0.0"
  2202. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2203. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2204. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2205. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2206. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2207. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2208. #define PANDA_PACKAGE_VERSION_STR ""
  2209. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2210. """
  2211. CHECKPANDAVERSION_CXX="""
  2212. # include "dtoolbase.h"
  2213. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  2214. """
  2215. CHECKPANDAVERSION_H="""
  2216. # include "dtoolbase.h"
  2217. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  2218. # ifndef WIN32
  2219. /* For Windows, exporting the symbol from the DLL is sufficient; the
  2220. DLL will not load unless all expected public symbols are defined.
  2221. Other systems may not mind if the symbol is absent unless we
  2222. explictly write code that references it. */
  2223. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  2224. # endif
  2225. """
  2226. P3DACTIVEX_RC="""#include "resource.h"
  2227. #define APSTUDIO_READONLY_SYMBOLS
  2228. #include "afxres.h"
  2229. #undef APSTUDIO_READONLY_SYMBOLS
  2230. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2231. #ifdef _WIN32
  2232. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2233. #pragma code_page(1252)
  2234. #endif
  2235. #ifdef APSTUDIO_INVOKED
  2236. 1 TEXTINCLUDE
  2237. BEGIN
  2238. "resource.h\\0"
  2239. END
  2240. 2 TEXTINCLUDE
  2241. BEGIN
  2242. "#include ""afxres.h""\\r\\n"
  2243. "\\0"
  2244. END
  2245. 3 TEXTINCLUDE
  2246. BEGIN
  2247. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2248. "\\0"
  2249. END
  2250. #endif
  2251. %s
  2252. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2253. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2254. STYLE DS_SETFONT | WS_CHILD
  2255. FONT 8, "MS Sans Serif"
  2256. BEGIN
  2257. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2258. IDC_STATIC,7,25,229,16
  2259. END
  2260. #ifdef APSTUDIO_INVOKED
  2261. GUIDELINES DESIGNINFO
  2262. BEGIN
  2263. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2264. BEGIN
  2265. LEFTMARGIN, 7
  2266. RIGHTMARGIN, 243
  2267. TOPMARGIN, 7
  2268. BOTTOMMARGIN, 55
  2269. END
  2270. END
  2271. #endif
  2272. STRINGTABLE
  2273. BEGIN
  2274. IDS_P3DACTIVEX "P3DActiveX Control"
  2275. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2276. END
  2277. STRINGTABLE
  2278. BEGIN
  2279. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2280. END
  2281. #endif
  2282. #ifndef APSTUDIO_INVOKED
  2283. 1 TYPELIB "P3DActiveX.tlb"
  2284. #endif"""
  2285. def CreatePandaVersionFiles():
  2286. version1=int(VERSION.split(".")[0])
  2287. version2=int(VERSION.split(".")[1])
  2288. version3=int(VERSION.split(".")[2])
  2289. nversion=version1*1000000+version2*1000+version3
  2290. if (DISTRIBUTOR != "cmu"):
  2291. # Subtract 1 if we are not an official version.
  2292. nversion -= 1
  2293. if (RUNTIME):
  2294. pandaversion_h = PANDAVERSION_H_RUNTIME
  2295. else:
  2296. pandaversion_h = PANDAVERSION_H
  2297. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2298. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2299. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2300. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2301. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2302. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2303. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2304. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2305. if (DISTRIBUTOR == "cmu"):
  2306. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2307. else:
  2308. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2309. if GIT_COMMIT:
  2310. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2311. if not RUNTIME:
  2312. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2313. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2314. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2315. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2316. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2317. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2318. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2319. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2320. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2321. if RUNTIME:
  2322. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2323. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2324. else:
  2325. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2326. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2327. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2328. if RUNTIME:
  2329. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2330. "version" : VERSION,
  2331. "description" : "Runs 3-D games and interactive applets",
  2332. "filename" : "p3dactivex.ocx",
  2333. "mimetype" : "application/x-panda3d",
  2334. "extension" : "p3d",
  2335. "filedesc" : "Panda3D applet"}
  2336. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2337. CreatePandaVersionFiles()
  2338. ##########################################################################################
  2339. #
  2340. # Copy the "direct" tree
  2341. #
  2342. ##########################################################################################
  2343. if (PkgSkip("DIRECT")==0):
  2344. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2345. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2346. # This file used to be copied, but would nowadays cause conflicts.
  2347. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2348. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2349. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2350. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2351. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2352. # This directory doesn't exist at all any more.
  2353. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2354. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2355. # These files used to exist; remove them to avoid conflicts.
  2356. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2357. '_core.pyd', '_core.so',
  2358. 'direct.py', 'direct.pyc', 'direct.pyo',
  2359. '_direct.pyd', '_direct.so',
  2360. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2361. for basename in del_files:
  2362. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2363. if os.path.isfile(path):
  2364. print("Removing %s" % (path))
  2365. os.remove(path)
  2366. # Write an appropriate panda3d/__init__.py
  2367. p3d_init = """"Python bindings for the Panda3D libraries"
  2368. """
  2369. if GetTarget() == 'windows':
  2370. p3d_init += """
  2371. import os
  2372. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2373. if os.path.isfile(os.path.join(bindir, 'libpanda.dll')):
  2374. if not os.environ.get('PATH'):
  2375. os.environ['PATH'] = bindir
  2376. else:
  2377. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2378. del os, bindir
  2379. """
  2380. if not PkgSkip("PYTHON"):
  2381. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2382. # Also add this file, for backward compatibility.
  2383. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2384. if __debug__:
  2385. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2386. from .interrogatedb import *
  2387. """)
  2388. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2389. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2390. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2391. os.remove(fn)
  2392. panda_modules = ['core']
  2393. if not PkgSkip("PANDAPHYSICS"):
  2394. panda_modules.append('physics')
  2395. if not PkgSkip('PANDAFX'):
  2396. panda_modules.append('fx')
  2397. if not PkgSkip("DIRECT"):
  2398. panda_modules.append('direct')
  2399. if not PkgSkip("VISION"):
  2400. panda_modules.append('vision')
  2401. if not PkgSkip("SKEL"):
  2402. panda_modules.append('skel')
  2403. panda_modules.append('egg')
  2404. if not PkgSkip("AWESOMIUM"):
  2405. panda_modules.append('awesomium')
  2406. if not PkgSkip("ODE"):
  2407. panda_modules.append('ode')
  2408. if not PkgSkip("VRPN"):
  2409. panda_modules.append('vrpn')
  2410. panda_modules_code = """
  2411. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2412. if __debug__:
  2413. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2414. """
  2415. for module in panda_modules:
  2416. panda_modules_code += """
  2417. try:
  2418. from panda3d.%s import *
  2419. except ImportError as err:
  2420. if "No module named %s" not in str(err):
  2421. raise""" % (module, module)
  2422. if not PkgSkip("PYTHON"):
  2423. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2424. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2425. ##########################################################################################
  2426. #
  2427. # Generate the PRC files into the ETC directory.
  2428. #
  2429. ##########################################################################################
  2430. confautoprc = ReadFile("makepanda/confauto.in")
  2431. if (PkgSkip("SPEEDTREE")==0):
  2432. # If SpeedTree is available, enable it in the config file
  2433. confautoprc = confautoprc.replace('#st#', '')
  2434. else:
  2435. # otherwise, disable it.
  2436. confautoprc = confautoprc.replace('#st#', '#')
  2437. if (os.path.isfile("makepanda/myconfig.in")):
  2438. configprc = ReadFile("makepanda/myconfig.in")
  2439. else:
  2440. configprc = ReadFile("makepanda/config.in")
  2441. if (GetTarget() == 'windows'):
  2442. configprc = configprc.replace("$HOME/.panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2443. else:
  2444. configprc = configprc.replace("aux-display pandadx9", "")
  2445. if (GetTarget() == 'darwin'):
  2446. configprc = configprc.replace(".panda3d/cache", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2447. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2448. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  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"):
  2529. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2530. if (GetOptimize() <= 2): pydll += "_d.dll"
  2531. else: pydll += ".dll"
  2532. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2533. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2534. CopyFile(GetOutputDir() + "/bin/", fn)
  2535. if not RTDIST:
  2536. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2537. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2538. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2539. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2540. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2541. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2542. ########################################################################
  2543. ##
  2544. ## Copy various stuff into the build.
  2545. ##
  2546. ########################################################################
  2547. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2548. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2549. if (PkgSkip("PANDATOOL")==0):
  2550. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2551. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2552. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2553. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2554. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2555. # Since Eigen is included by all sorts of core headers, as a convenience
  2556. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2557. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2558. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2559. ########################################################################
  2560. #
  2561. # Copy header files to the built/include/parser-inc directory.
  2562. #
  2563. ########################################################################
  2564. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2565. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2566. ########################################################################
  2567. #
  2568. # Transfer all header files to the built/include directory.
  2569. #
  2570. ########################################################################
  2571. CopyAllHeaders('dtool/src/dtoolbase')
  2572. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2573. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2574. CopyAllHeaders('dtool/metalibs/dtool')
  2575. CopyAllHeaders('dtool/src/cppparser')
  2576. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2577. CopyAllHeaders('dtool/src/dconfig')
  2578. CopyAllHeaders('dtool/src/interrogatedb')
  2579. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2580. CopyAllHeaders('dtool/src/pystub')
  2581. CopyAllHeaders('dtool/src/interrogate')
  2582. CopyAllHeaders('dtool/src/test_interrogate')
  2583. CopyAllHeaders('panda/src/putil')
  2584. CopyAllHeaders('panda/src/pandabase')
  2585. CopyAllHeaders('panda/src/express')
  2586. CopyAllHeaders('panda/src/downloader')
  2587. CopyAllHeaders('panda/metalibs/pandaexpress')
  2588. CopyAllHeaders('panda/src/pipeline')
  2589. CopyAllHeaders('panda/src/linmath')
  2590. CopyAllHeaders('panda/src/putil')
  2591. CopyAllHeaders('dtool/src/prckeys')
  2592. CopyAllHeaders('panda/src/audio')
  2593. CopyAllHeaders('panda/src/event')
  2594. CopyAllHeaders('panda/src/mathutil')
  2595. CopyAllHeaders('panda/src/gsgbase')
  2596. CopyAllHeaders('panda/src/pnmimage')
  2597. CopyAllHeaders('panda/src/nativenet')
  2598. CopyAllHeaders('panda/src/net')
  2599. CopyAllHeaders('panda/src/pstatclient')
  2600. CopyAllHeaders('panda/src/gobj')
  2601. CopyAllHeaders('panda/src/movies')
  2602. CopyAllHeaders('panda/src/pgraphnodes')
  2603. CopyAllHeaders('panda/src/pgraph')
  2604. CopyAllHeaders('panda/src/cull')
  2605. CopyAllHeaders('panda/src/chan')
  2606. CopyAllHeaders('panda/src/char')
  2607. CopyAllHeaders('panda/src/dgraph')
  2608. CopyAllHeaders('panda/src/display')
  2609. CopyAllHeaders('panda/src/device')
  2610. CopyAllHeaders('panda/src/pnmtext')
  2611. CopyAllHeaders('panda/src/text')
  2612. CopyAllHeaders('panda/src/grutil')
  2613. if (PkgSkip("VISION")==0):
  2614. CopyAllHeaders('panda/src/vision')
  2615. CopyAllHeaders('panda/src/awesomium')
  2616. if (PkgSkip("FFMPEG")==0):
  2617. CopyAllHeaders('panda/src/ffmpeg')
  2618. CopyAllHeaders('panda/src/tform')
  2619. CopyAllHeaders('panda/src/collide')
  2620. CopyAllHeaders('panda/src/parametrics')
  2621. CopyAllHeaders('panda/src/pgui')
  2622. CopyAllHeaders('panda/src/pnmimagetypes')
  2623. CopyAllHeaders('panda/src/recorder')
  2624. if (PkgSkip("ROCKET")==0):
  2625. CopyAllHeaders('panda/src/rocket')
  2626. if (PkgSkip("VRPN")==0):
  2627. CopyAllHeaders('panda/src/vrpn')
  2628. CopyAllHeaders('panda/src/wgldisplay')
  2629. CopyAllHeaders('panda/src/ode')
  2630. CopyAllHeaders('panda/metalibs/pandaode')
  2631. if (PkgSkip("PANDAPHYSICS")==0):
  2632. CopyAllHeaders('panda/src/physics')
  2633. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2634. CopyAllHeaders('panda/src/particlesystem')
  2635. CopyAllHeaders('panda/src/dxml')
  2636. CopyAllHeaders('panda/metalibs/panda')
  2637. CopyAllHeaders('panda/src/audiotraits')
  2638. CopyAllHeaders('panda/src/audiotraits')
  2639. CopyAllHeaders('panda/src/distort')
  2640. CopyAllHeaders('panda/src/downloadertools')
  2641. CopyAllHeaders('panda/src/windisplay')
  2642. CopyAllHeaders('panda/src/dxgsg9')
  2643. CopyAllHeaders('panda/metalibs/pandadx9')
  2644. CopyAllHeaders('panda/src/egg')
  2645. CopyAllHeaders('panda/src/egg2pg')
  2646. CopyAllHeaders('panda/src/framework')
  2647. CopyAllHeaders('panda/metalibs/pandafx')
  2648. CopyAllHeaders('panda/src/glstuff')
  2649. CopyAllHeaders('panda/src/glgsg')
  2650. CopyAllHeaders('panda/src/glesgsg')
  2651. CopyAllHeaders('panda/src/gles2gsg')
  2652. CopyAllHeaders('panda/metalibs/pandaegg')
  2653. if GetTarget() == 'windows':
  2654. CopyAllHeaders('panda/src/wgldisplay')
  2655. elif GetTarget() == 'darwin':
  2656. CopyAllHeaders('panda/src/osxdisplay')
  2657. CopyAllHeaders('panda/src/cocoadisplay')
  2658. elif GetTarget() == 'android':
  2659. CopyAllHeaders('panda/src/android')
  2660. CopyAllHeaders('panda/src/androiddisplay')
  2661. else:
  2662. CopyAllHeaders('panda/src/x11display')
  2663. CopyAllHeaders('panda/src/glxdisplay')
  2664. CopyAllHeaders('panda/src/egldisplay')
  2665. CopyAllHeaders('panda/metalibs/pandagl')
  2666. CopyAllHeaders('panda/metalibs/pandagles')
  2667. CopyAllHeaders('panda/metalibs/pandagles2')
  2668. CopyAllHeaders('panda/metalibs/pandaphysics')
  2669. CopyAllHeaders('panda/src/testbed')
  2670. if (PkgSkip("PHYSX")==0):
  2671. CopyAllHeaders('panda/src/physx')
  2672. CopyAllHeaders('panda/metalibs/pandaphysx')
  2673. if (PkgSkip("BULLET")==0):
  2674. CopyAllHeaders('panda/src/bullet')
  2675. CopyAllHeaders('panda/metalibs/pandabullet')
  2676. if (PkgSkip("SPEEDTREE")==0):
  2677. CopyAllHeaders('panda/src/speedtree')
  2678. if (PkgSkip("DIRECT")==0):
  2679. CopyAllHeaders('direct/src/directbase')
  2680. CopyAllHeaders('direct/src/dcparser')
  2681. CopyAllHeaders('direct/src/deadrec')
  2682. CopyAllHeaders('direct/src/distributed')
  2683. CopyAllHeaders('direct/src/interval')
  2684. CopyAllHeaders('direct/src/showbase')
  2685. CopyAllHeaders('direct/metalibs/direct')
  2686. CopyAllHeaders('direct/src/dcparse')
  2687. if (RUNTIME or RTDIST):
  2688. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2689. if (RUNTIME):
  2690. CopyAllHeaders('direct/src/plugin_npapi')
  2691. CopyAllHeaders('direct/src/plugin_standalone')
  2692. if (PkgSkip("PANDATOOL")==0):
  2693. CopyAllHeaders('pandatool/src/pandatoolbase')
  2694. CopyAllHeaders('pandatool/src/converter')
  2695. CopyAllHeaders('pandatool/src/progbase')
  2696. CopyAllHeaders('pandatool/src/eggbase')
  2697. CopyAllHeaders('pandatool/src/bam')
  2698. CopyAllHeaders('pandatool/src/cvscopy')
  2699. CopyAllHeaders('pandatool/src/daeegg')
  2700. CopyAllHeaders('pandatool/src/daeprogs')
  2701. CopyAllHeaders('pandatool/src/dxf')
  2702. CopyAllHeaders('pandatool/src/dxfegg')
  2703. CopyAllHeaders('pandatool/src/dxfprogs')
  2704. CopyAllHeaders('pandatool/src/palettizer')
  2705. CopyAllHeaders('pandatool/src/egg-mkfont')
  2706. CopyAllHeaders('pandatool/src/eggcharbase')
  2707. CopyAllHeaders('pandatool/src/egg-optchar')
  2708. CopyAllHeaders('pandatool/src/egg-palettize')
  2709. CopyAllHeaders('pandatool/src/egg-qtess')
  2710. CopyAllHeaders('pandatool/src/eggprogs')
  2711. CopyAllHeaders('pandatool/src/flt')
  2712. CopyAllHeaders('pandatool/src/fltegg')
  2713. CopyAllHeaders('pandatool/src/fltprogs')
  2714. CopyAllHeaders('pandatool/src/imagebase')
  2715. CopyAllHeaders('pandatool/src/imageprogs')
  2716. CopyAllHeaders('pandatool/src/pfmprogs')
  2717. CopyAllHeaders('pandatool/src/lwo')
  2718. CopyAllHeaders('pandatool/src/lwoegg')
  2719. CopyAllHeaders('pandatool/src/lwoprogs')
  2720. CopyAllHeaders('pandatool/src/maya')
  2721. CopyAllHeaders('pandatool/src/mayaegg')
  2722. CopyAllHeaders('pandatool/src/maxegg')
  2723. CopyAllHeaders('pandatool/src/maxprogs')
  2724. CopyAllHeaders('pandatool/src/objegg')
  2725. CopyAllHeaders('pandatool/src/objprogs')
  2726. CopyAllHeaders('pandatool/src/vrml')
  2727. CopyAllHeaders('pandatool/src/vrmlegg')
  2728. CopyAllHeaders('pandatool/src/xfile')
  2729. CopyAllHeaders('pandatool/src/xfileegg')
  2730. CopyAllHeaders('pandatool/src/ptloader')
  2731. CopyAllHeaders('pandatool/src/miscprogs')
  2732. CopyAllHeaders('pandatool/src/pstatserver')
  2733. CopyAllHeaders('pandatool/src/softprogs')
  2734. CopyAllHeaders('pandatool/src/text-stats')
  2735. CopyAllHeaders('pandatool/src/vrmlprogs')
  2736. CopyAllHeaders('pandatool/src/win-stats')
  2737. CopyAllHeaders('pandatool/src/xfileprogs')
  2738. if (PkgSkip("CONTRIB")==0):
  2739. CopyAllHeaders('contrib/src/contribbase')
  2740. CopyAllHeaders('contrib/src/ai')
  2741. ########################################################################
  2742. #
  2743. # Copy Java files, if applicable
  2744. #
  2745. ########################################################################
  2746. if GetTarget() == 'android':
  2747. CopyAllJavaSources('panda/src/android')
  2748. ########################################################################
  2749. #
  2750. # These definitions are syntactic shorthand. They make it easy
  2751. # to link with the usual libraries without listing them all.
  2752. #
  2753. ########################################################################
  2754. COMMON_DTOOL_LIBS=[
  2755. 'libp3dtool.dll',
  2756. 'libp3dtoolconfig.dll',
  2757. ]
  2758. COMMON_PANDA_LIBS=[
  2759. 'libpanda.dll',
  2760. 'libpandaexpress.dll'
  2761. ] + COMMON_DTOOL_LIBS
  2762. COMMON_EGG2X_LIBS=[
  2763. 'libp3eggbase.lib',
  2764. 'libp3progbase.lib',
  2765. 'libp3converter.lib',
  2766. 'libp3pandatoolbase.lib',
  2767. 'libpandaegg.dll',
  2768. ] + COMMON_PANDA_LIBS
  2769. ########################################################################
  2770. #
  2771. # This section contains a list of all the files that need to be compiled.
  2772. #
  2773. ########################################################################
  2774. print("Generating dependencies...")
  2775. sys.stdout.flush()
  2776. #
  2777. # Compile Panda icon resource file.
  2778. # We do it first because we need it at
  2779. # the time we compile an executable.
  2780. #
  2781. if GetTarget() == 'windows':
  2782. OPTS=['DIR:panda/src/configfiles']
  2783. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2784. #
  2785. # DIRECTORY: dtool/src/dtoolbase/
  2786. #
  2787. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2788. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2789. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2790. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2791. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2792. #
  2793. # DIRECTORY: dtool/src/dtoolutil/
  2794. #
  2795. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2796. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2797. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2798. if GetTarget() == 'darwin':
  2799. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2800. #
  2801. # DIRECTORY: dtool/metalibs/dtool/
  2802. #
  2803. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2804. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2805. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2806. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2807. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2808. if GetTarget() == 'darwin':
  2809. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2810. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2811. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2812. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2813. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2814. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2815. #
  2816. # DIRECTORY: dtool/src/cppparser/
  2817. #
  2818. if (not RUNTIME):
  2819. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2820. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2821. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2822. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2823. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2824. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2825. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2826. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2827. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2828. #
  2829. # DIRECTORY: dtool/src/prc/
  2830. #
  2831. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2832. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2833. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2834. #
  2835. # DIRECTORY: dtool/src/dconfig/
  2836. #
  2837. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2838. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2839. #
  2840. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2841. #
  2842. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2843. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2844. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2845. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2846. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2847. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2848. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2849. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  2850. #
  2851. # DIRECTORY: dtool/src/interrogatedb/
  2852. #
  2853. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON']
  2854. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2855. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2856. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  2857. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  2858. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  2859. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  2860. TargetAdd('libp3interrogatedb.dll', opts=['PYTHON'])
  2861. if not PkgSkip("PYTHON"):
  2862. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  2863. # stuff, so it has been renamed appropriately.
  2864. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON']
  2865. TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2866. TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  2867. TargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  2868. TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  2869. TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  2870. TargetAdd('interrogatedb.pyd', opts=['PYTHON'])
  2871. #
  2872. # DIRECTORY: dtool/src/pystub/
  2873. #
  2874. if not RUNTIME and not RTDIST:
  2875. OPTS=['DIR:dtool/src/pystub']
  2876. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2877. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  2878. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  2879. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  2880. #
  2881. # DIRECTORY: dtool/src/interrogate/
  2882. #
  2883. if (not RUNTIME):
  2884. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2885. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2886. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2887. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  2888. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  2889. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  2890. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  2891. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  2892. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2893. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  2894. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  2895. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  2896. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  2897. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  2898. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2899. if (not RTDIST):
  2900. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  2901. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  2902. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  2903. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  2904. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  2905. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2906. #
  2907. # DIRECTORY: dtool/src/prckeys/
  2908. #
  2909. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  2910. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  2911. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  2912. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  2913. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  2914. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2915. #
  2916. # DIRECTORY: dtool/src/test_interrogate/
  2917. #
  2918. if (not RTDIST and not RUNTIME):
  2919. OPTS=['DIR:dtool/src/test_interrogate']
  2920. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  2921. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  2922. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  2923. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  2924. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2925. #
  2926. # DIRECTORY: panda/src/pandabase/
  2927. #
  2928. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  2929. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  2930. #
  2931. # DIRECTORY: panda/src/express/
  2932. #
  2933. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  2934. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  2935. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  2936. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON']
  2937. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  2938. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  2939. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  2940. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  2941. TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  2942. #
  2943. # DIRECTORY: panda/src/downloader/
  2944. #
  2945. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  2946. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  2947. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  2948. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON']
  2949. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  2950. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  2951. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  2952. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  2953. TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  2954. #
  2955. # DIRECTORY: panda/metalibs/pandaexpress/
  2956. #
  2957. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  2958. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  2959. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  2960. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  2961. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  2962. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  2963. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  2964. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  2965. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  2966. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER'])
  2967. #
  2968. # DIRECTORY: panda/src/pipeline/
  2969. #
  2970. if (not RUNTIME):
  2971. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  2972. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  2973. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  2974. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  2975. OPTS=['DIR:panda/src/pipeline', 'PYTHON']
  2976. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  2977. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  2978. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  2979. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  2980. TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  2981. #
  2982. # DIRECTORY: panda/src/linmath/
  2983. #
  2984. if (not RUNTIME):
  2985. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  2986. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  2987. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  2988. OPTS=['DIR:panda/src/linmath', 'PYTHON']
  2989. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  2990. for ifile in IGATEFILES[:]:
  2991. if "_src." in ifile:
  2992. IGATEFILES.remove(ifile)
  2993. IGATEFILES.remove('cast_to_double.h')
  2994. IGATEFILES.remove('lmat_ops.h')
  2995. IGATEFILES.remove('cast_to_float.h')
  2996. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  2997. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  2998. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  2999. #
  3000. # DIRECTORY: panda/src/putil/
  3001. #
  3002. if (not RUNTIME):
  3003. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3004. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3005. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3006. OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON']
  3007. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3008. IGATEFILES.remove("test_bam.h")
  3009. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3010. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3011. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  3012. TargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3013. #
  3014. # DIRECTORY: panda/src/audio/
  3015. #
  3016. if (not RUNTIME):
  3017. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3018. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3019. OPTS=['DIR:panda/src/audio', 'PYTHON']
  3020. IGATEFILES=["audio.h"]
  3021. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3022. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3023. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  3024. #
  3025. # DIRECTORY: panda/src/event/
  3026. #
  3027. if (not RUNTIME):
  3028. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3029. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3030. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3031. OPTS=['DIR:panda/src/event', 'PYTHON']
  3032. TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3033. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3034. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3035. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3036. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  3037. #
  3038. # DIRECTORY: panda/src/mathutil/
  3039. #
  3040. if (not RUNTIME):
  3041. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3042. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3043. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3044. OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON']
  3045. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3046. for ifile in IGATEFILES[:]:
  3047. if "_src." in ifile:
  3048. IGATEFILES.remove(ifile)
  3049. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3050. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3051. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  3052. #
  3053. # DIRECTORY: panda/src/gsgbase/
  3054. #
  3055. if (not RUNTIME):
  3056. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3057. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3058. OPTS=['DIR:panda/src/gsgbase', 'PYTHON']
  3059. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3060. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3061. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3062. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  3063. #
  3064. # DIRECTORY: panda/src/pnmimage/
  3065. #
  3066. if (not RUNTIME):
  3067. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3068. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3069. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3070. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3071. OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON']
  3072. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3073. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3074. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3075. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  3076. TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3077. #
  3078. # DIRECTORY: panda/src/nativenet/
  3079. #
  3080. if (not RUNTIME):
  3081. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3082. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3083. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON']
  3084. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3085. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3086. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3087. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  3088. #
  3089. # DIRECTORY: panda/src/net/
  3090. #
  3091. if (not RUNTIME):
  3092. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3093. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3094. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3095. OPTS=['DIR:panda/src/net', 'PYTHON']
  3096. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3097. IGATEFILES.remove("datagram_ui.h")
  3098. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3099. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3100. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  3101. #
  3102. # DIRECTORY: panda/src/pstatclient/
  3103. #
  3104. if (not RUNTIME):
  3105. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3106. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3107. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3108. OPTS=['DIR:panda/src/pstatclient', 'PYTHON']
  3109. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3110. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3111. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3112. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  3113. #
  3114. # DIRECTORY: panda/src/gobj/
  3115. #
  3116. if (not RUNTIME):
  3117. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3118. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3119. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  3120. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON']
  3121. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3122. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3123. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3124. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3125. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  3126. TargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3127. #
  3128. # DIRECTORY: panda/src/pgraphnodes/
  3129. #
  3130. if (not RUNTIME):
  3131. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3132. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3133. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3134. OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON']
  3135. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3136. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3137. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3138. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  3139. #
  3140. # DIRECTORY: panda/src/pgraph/
  3141. #
  3142. if (not RUNTIME):
  3143. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3144. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3145. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3146. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3147. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3148. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3149. OPTS=['DIR:panda/src/pgraph', 'PYTHON']
  3150. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3151. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3152. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3153. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  3154. TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3155. #
  3156. # DIRECTORY: panda/src/cull/
  3157. #
  3158. if (not RUNTIME):
  3159. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3160. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3161. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3162. OPTS=['DIR:panda/src/cull', 'PYTHON']
  3163. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3164. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3165. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3166. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  3167. #
  3168. # DIRECTORY: panda/src/chan/
  3169. #
  3170. if (not RUNTIME):
  3171. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3172. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3173. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3174. OPTS=['DIR:panda/src/chan', 'PYTHON']
  3175. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3176. IGATEFILES.remove('movingPart.h')
  3177. IGATEFILES.remove('animChannelFixed.h')
  3178. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3179. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3180. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  3181. # DIRECTORY: panda/src/char/
  3182. #
  3183. if (not RUNTIME):
  3184. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3185. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3186. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3187. OPTS=['DIR:panda/src/char', 'PYTHON']
  3188. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3189. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3190. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3191. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  3192. #
  3193. # DIRECTORY: panda/src/dgraph/
  3194. #
  3195. if (not RUNTIME):
  3196. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3197. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3198. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3199. OPTS=['DIR:panda/src/dgraph', 'PYTHON']
  3200. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3201. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3202. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3203. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  3204. #
  3205. # DIRECTORY: panda/src/display/
  3206. #
  3207. if (not RUNTIME):
  3208. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA']
  3209. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3210. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3211. OPTS=['DIR:panda/src/display', 'PYTHON']
  3212. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3213. IGATEFILES.remove("renderBuffer.h")
  3214. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3215. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3216. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  3217. TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
  3218. TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx')
  3219. TargetAdd('p3display_pythonGraphicsWindowProc.obj', opts=OPTS, input='pythonGraphicsWindowProc.cxx')
  3220. if RTDIST and GetTarget() == 'darwin':
  3221. OPTS=['DIR:panda/src/display']
  3222. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3223. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3224. #
  3225. # DIRECTORY: panda/src/device/
  3226. #
  3227. if (not RUNTIME):
  3228. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3229. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3230. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3231. OPTS=['DIR:panda/src/device', 'PYTHON']
  3232. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3233. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3234. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3235. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  3236. #
  3237. # DIRECTORY: panda/src/pnmtext/
  3238. #
  3239. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3240. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3241. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3242. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON']
  3243. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3244. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3245. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3246. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  3247. #
  3248. # DIRECTORY: panda/src/text/
  3249. #
  3250. if (not RUNTIME):
  3251. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE']
  3252. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3253. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3254. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON']
  3255. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3256. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3257. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3258. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  3259. #
  3260. # DIRECTORY: panda/src/movies/
  3261. #
  3262. if (not RUNTIME):
  3263. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS']
  3264. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3265. OPTS=['DIR:panda/src/movies', 'VORBIS', 'PYTHON']
  3266. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3267. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3268. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3269. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  3270. #
  3271. # DIRECTORY: panda/src/grutil/
  3272. #
  3273. if (not RUNTIME):
  3274. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3275. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3276. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3277. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3278. OPTS=['DIR:panda/src/grutil', 'PYTHON']
  3279. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3280. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3281. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3282. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3283. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  3284. #
  3285. # DIRECTORY: panda/src/tform/
  3286. #
  3287. if (not RUNTIME):
  3288. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3289. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3290. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3291. OPTS=['DIR:panda/src/tform', 'PYTHON']
  3292. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3293. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3294. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3295. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  3296. #
  3297. # DIRECTORY: panda/src/collide/
  3298. #
  3299. if (not RUNTIME):
  3300. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3301. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3302. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3303. OPTS=['DIR:panda/src/collide', 'PYTHON']
  3304. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3305. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3306. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3307. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  3308. #
  3309. # DIRECTORY: panda/src/parametrics/
  3310. #
  3311. if (not RUNTIME):
  3312. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3313. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3314. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3315. OPTS=['DIR:panda/src/parametrics', 'PYTHON']
  3316. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3317. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3318. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3319. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  3320. #
  3321. # DIRECTORY: panda/src/pgui/
  3322. #
  3323. if (not RUNTIME):
  3324. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3325. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3326. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3327. OPTS=['DIR:panda/src/pgui', 'PYTHON']
  3328. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3329. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3330. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3331. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  3332. #
  3333. # DIRECTORY: panda/src/pnmimagetypes/
  3334. #
  3335. if (not RUNTIME):
  3336. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3337. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3338. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3339. #
  3340. # DIRECTORY: panda/src/recorder/
  3341. #
  3342. if (not RUNTIME):
  3343. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3344. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3345. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3346. OPTS=['DIR:panda/src/recorder', 'PYTHON']
  3347. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3348. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3349. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3350. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  3351. #
  3352. # DIRECTORY: panda/src/dxml/
  3353. #
  3354. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3355. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3356. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3357. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3358. if (not RUNTIME):
  3359. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3360. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3361. OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON']
  3362. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3363. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3364. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3365. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  3366. #
  3367. # DIRECTORY: panda/metalibs/panda/
  3368. #
  3369. if (not RUNTIME):
  3370. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG',
  3371. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3372. 'SQUISH', 'NVIDIACG', 'VORBIS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI']
  3373. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3374. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3375. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3376. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3377. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3378. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3379. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3380. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3381. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3382. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3383. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3384. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3385. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3386. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3387. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3388. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3389. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3390. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3391. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3392. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3393. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3394. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3395. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3396. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3397. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3398. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3399. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3400. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3401. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3402. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3403. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3404. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3405. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3406. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3407. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3408. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3409. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3410. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3411. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3412. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3413. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3414. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3415. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3416. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3417. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3418. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3419. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3420. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3421. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3422. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3423. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3424. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3425. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3426. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3427. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3428. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3429. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3430. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3431. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3432. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3433. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3434. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3435. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3436. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3437. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3438. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3439. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3440. if PkgSkip("FREETYPE")==0:
  3441. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3442. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3443. TargetAdd('libpanda.dll', opts=OPTS)
  3444. TargetAdd('core_module.obj', input='libp3downloader.in')
  3445. TargetAdd('core_module.obj', input='libp3express.in')
  3446. TargetAdd('core_module.obj', input='libp3recorder.in')
  3447. TargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3448. TargetAdd('core_module.obj', input='libp3pgraph.in')
  3449. TargetAdd('core_module.obj', input='libp3cull.in')
  3450. TargetAdd('core_module.obj', input='libp3grutil.in')
  3451. TargetAdd('core_module.obj', input='libp3chan.in')
  3452. TargetAdd('core_module.obj', input='libp3pstatclient.in')
  3453. TargetAdd('core_module.obj', input='libp3char.in')
  3454. TargetAdd('core_module.obj', input='libp3collide.in')
  3455. TargetAdd('core_module.obj', input='libp3device.in')
  3456. TargetAdd('core_module.obj', input='libp3dgraph.in')
  3457. TargetAdd('core_module.obj', input='libp3display.in')
  3458. TargetAdd('core_module.obj', input='libp3pipeline.in')
  3459. TargetAdd('core_module.obj', input='libp3event.in')
  3460. TargetAdd('core_module.obj', input='libp3gobj.in')
  3461. TargetAdd('core_module.obj', input='libp3gsgbase.in')
  3462. TargetAdd('core_module.obj', input='libp3linmath.in')
  3463. TargetAdd('core_module.obj', input='libp3mathutil.in')
  3464. TargetAdd('core_module.obj', input='libp3parametrics.in')
  3465. TargetAdd('core_module.obj', input='libp3pnmimage.in')
  3466. TargetAdd('core_module.obj', input='libp3text.in')
  3467. TargetAdd('core_module.obj', input='libp3tform.in')
  3468. TargetAdd('core_module.obj', input='libp3putil.in')
  3469. TargetAdd('core_module.obj', input='libp3audio.in')
  3470. TargetAdd('core_module.obj', input='libp3nativenet.in')
  3471. TargetAdd('core_module.obj', input='libp3net.in')
  3472. TargetAdd('core_module.obj', input='libp3pgui.in')
  3473. TargetAdd('core_module.obj', input='libp3movies.in')
  3474. TargetAdd('core_module.obj', input='libp3dxml.in')
  3475. if PkgSkip("FREETYPE")==0:
  3476. TargetAdd('core_module.obj', input='libp3pnmtext.in')
  3477. TargetAdd('core_module.obj', opts=['PYTHON'])
  3478. TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3479. TargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3480. TargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3481. TargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3482. TargetAdd('core.pyd', input='libp3express_igate.obj')
  3483. TargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3484. TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3485. TargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3486. TargetAdd('core.pyd', input='libp3movies_igate.obj')
  3487. TargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3488. TargetAdd('core.pyd', input='libp3chan_igate.obj')
  3489. TargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3490. TargetAdd('core.pyd', input='libp3char_igate.obj')
  3491. TargetAdd('core.pyd', input='libp3collide_igate.obj')
  3492. TargetAdd('core.pyd', input='libp3device_igate.obj')
  3493. TargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3494. TargetAdd('core.pyd', input='libp3display_igate.obj')
  3495. TargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3496. TargetAdd('core.pyd', input='libp3event_igate.obj')
  3497. TargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3498. TargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3499. TargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3500. TargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3501. TargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3502. TargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3503. TargetAdd('core.pyd', input='libp3text_igate.obj')
  3504. TargetAdd('core.pyd', input='libp3tform_igate.obj')
  3505. TargetAdd('core.pyd', input='libp3putil_igate.obj')
  3506. TargetAdd('core.pyd', input='libp3audio_igate.obj')
  3507. TargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3508. TargetAdd('core.pyd', input='libp3net_igate.obj')
  3509. TargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3510. TargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3511. if PkgSkip("FREETYPE")==0:
  3512. TargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3513. TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3514. TargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3515. TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3516. TargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3517. TargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3518. TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3519. TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj')
  3520. TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj')
  3521. TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj')
  3522. TargetAdd('core.pyd', input='core_module.obj')
  3523. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3524. TargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3525. TargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3526. TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3527. TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2'])
  3528. #
  3529. # DIRECTORY: panda/src/vision/
  3530. #
  3531. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3532. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3533. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx')
  3534. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3535. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3536. TargetAdd('libp3vision.dll', opts=OPTS)
  3537. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON']
  3538. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3539. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3540. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3541. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  3542. TargetAdd('vision_module.obj', input='libp3vision.in')
  3543. TargetAdd('vision_module.obj', opts=OPTS)
  3544. TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3545. TargetAdd('vision.pyd', input='vision_module.obj')
  3546. TargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3547. TargetAdd('vision.pyd', input='libp3vision.dll')
  3548. TargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3549. TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3550. TargetAdd('vision.pyd', opts=['PYTHON'])
  3551. #
  3552. # DIRECTORY: panda/src/rocket/
  3553. #
  3554. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3555. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3556. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3557. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3558. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3559. TargetAdd('libp3rocket.dll', opts=OPTS)
  3560. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON']
  3561. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3562. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3563. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3564. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3565. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  3566. TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3567. TargetAdd('rocket_module.obj', input='libp3rocket.in')
  3568. TargetAdd('rocket_module.obj', opts=OPTS)
  3569. TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3570. TargetAdd('rocket.pyd', input='rocket_module.obj')
  3571. TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3572. TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3573. TargetAdd('rocket.pyd', input='libp3rocket.dll')
  3574. TargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3575. TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3576. TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET'])
  3577. #
  3578. # DIRECTORY: panda/src/p3awesomium
  3579. #
  3580. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  3581. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  3582. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  3583. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  3584. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  3585. TargetAdd('libp3awesomium.dll', opts=OPTS)
  3586. OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON']
  3587. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  3588. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  3589. TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  3590. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  3591. TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
  3592. TargetAdd('awesomium_module.obj', opts=OPTS)
  3593. TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core'])
  3594. TargetAdd('awesomium.pyd', input='awesomium_module.obj')
  3595. TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
  3596. TargetAdd('awesomium.pyd', input='libp3awesomium.dll')
  3597. TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll')
  3598. TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS)
  3599. TargetAdd('awesomium.pyd', opts=['PYTHON'])
  3600. #
  3601. # DIRECTORY: panda/src/p3skel
  3602. #
  3603. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3604. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3605. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3606. OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON']
  3607. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3608. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3609. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3610. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  3611. #
  3612. # DIRECTORY: panda/src/p3skel
  3613. #
  3614. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3615. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3616. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3617. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3618. TargetAdd('libpandaskel.dll', opts=OPTS)
  3619. OPTS=['PYTHON']
  3620. TargetAdd('skel_module.obj', input='libp3skel.in')
  3621. TargetAdd('skel_module.obj', opts=OPTS)
  3622. TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3623. TargetAdd('skel.pyd', input='skel_module.obj')
  3624. TargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3625. TargetAdd('skel.pyd', input='libpandaskel.dll')
  3626. TargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3627. TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3628. TargetAdd('skel.pyd', opts=['PYTHON'])
  3629. #
  3630. # DIRECTORY: panda/src/distort/
  3631. #
  3632. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3633. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3634. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3635. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3636. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3637. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3638. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3639. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  3640. #
  3641. # DIRECTORY: panda/metalibs/pandafx/
  3642. #
  3643. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3644. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3645. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3646. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3647. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3648. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3649. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3650. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3651. TargetAdd('fx_module.obj', input='libp3distort.in')
  3652. TargetAdd('fx_module.obj', opts=OPTS)
  3653. TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3654. TargetAdd('fx.pyd', input='fx_module.obj')
  3655. TargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3656. TargetAdd('fx.pyd', input='libpandafx.dll')
  3657. TargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3658. TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3659. TargetAdd('fx.pyd', opts=['PYTHON'])
  3660. #
  3661. # DIRECTORY: panda/src/vrpn/
  3662. #
  3663. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3664. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3665. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3666. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3667. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3668. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3669. OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON']
  3670. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3671. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3672. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3673. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  3674. TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3675. TargetAdd('vrpn_module.obj', opts=OPTS)
  3676. TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3677. TargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3678. TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3679. TargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3680. TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3681. TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3682. TargetAdd('vrpn.pyd', opts=['PYTHON'])
  3683. #
  3684. # DIRECTORY: panda/src/ffmpeg
  3685. #
  3686. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3687. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3688. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx')
  3689. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3690. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3691. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3692. #
  3693. # DIRECTORY: panda/src/audiotraits/
  3694. #
  3695. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3696. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3697. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3698. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3699. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3700. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3701. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3702. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3703. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3704. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3705. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3706. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  3707. #
  3708. # DIRECTORY: panda/src/downloadertools/
  3709. #
  3710. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3711. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3712. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3713. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3714. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  3715. TargetAdd('apply_patch.exe', opts=OPTS)
  3716. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3717. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3718. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  3719. TargetAdd('build_patch.exe', opts=OPTS)
  3720. if not PkgSkip("ZLIB"):
  3721. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3722. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3723. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  3724. TargetAdd('check_adler.exe', opts=OPTS)
  3725. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3726. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3727. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  3728. TargetAdd('check_crc.exe', opts=OPTS)
  3729. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3730. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3731. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  3732. TargetAdd('check_md5.exe', opts=OPTS)
  3733. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3734. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3735. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3736. TargetAdd('pdecrypt.exe', opts=OPTS)
  3737. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3738. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3739. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3740. TargetAdd('pencrypt.exe', opts=OPTS)
  3741. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3742. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3743. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  3744. TargetAdd('show_ddb.exe', opts=OPTS)
  3745. #
  3746. # DIRECTORY: panda/src/downloadertools/
  3747. #
  3748. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3749. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3750. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3751. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3752. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3753. TargetAdd('multify.exe', opts=OPTS)
  3754. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3755. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3756. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3757. TargetAdd('pzip.exe', opts=OPTS)
  3758. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3759. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3760. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3761. TargetAdd('punzip.exe', opts=OPTS)
  3762. #
  3763. # DIRECTORY: panda/src/windisplay/
  3764. #
  3765. if (GetTarget() == 'windows' and not RUNTIME):
  3766. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3767. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3768. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3769. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3770. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3771. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3772. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3773. #
  3774. # DIRECTORY: panda/metalibs/pandadx9/
  3775. #
  3776. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  3777. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3778. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3779. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3780. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3781. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3782. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3783. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3784. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3785. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3786. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3787. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3788. #
  3789. # DIRECTORY: panda/src/egg/
  3790. #
  3791. if (not RUNTIME):
  3792. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3793. CreateFile(GetOutputDir()+"/include/parser.h")
  3794. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3795. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3796. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3797. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3798. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3799. OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON']
  3800. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3801. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3802. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3803. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3804. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3805. TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  3806. #
  3807. # DIRECTORY: panda/src/egg2pg/
  3808. #
  3809. if (not RUNTIME):
  3810. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3811. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3812. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3813. OPTS=['DIR:panda/src/egg2pg', 'PYTHON']
  3814. IGATEFILES=['load_egg_file.h']
  3815. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3816. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3817. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  3818. #
  3819. # DIRECTORY: panda/src/framework/
  3820. #
  3821. if (not RUNTIME):
  3822. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK']
  3823. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx')
  3824. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  3825. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  3826. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  3827. #
  3828. # DIRECTORY: panda/src/glgsg/
  3829. #
  3830. if (not RUNTIME and PkgSkip("GL")==0):
  3831. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  3832. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  3833. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  3834. #
  3835. # DIRECTORY: panda/src/glesgsg/
  3836. #
  3837. if (not RUNTIME and PkgSkip("GLES")==0):
  3838. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  3839. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  3840. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  3841. #
  3842. # DIRECTORY: panda/src/gles2gsg/
  3843. #
  3844. if (not RUNTIME and PkgSkip("GLES2")==0):
  3845. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  3846. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  3847. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  3848. #
  3849. # DIRECTORY: panda/metalibs/pandaegg/
  3850. #
  3851. if (not RUNTIME):
  3852. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  3853. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  3854. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  3855. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  3856. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  3857. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  3858. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  3859. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  3860. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  3861. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  3862. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  3863. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON']
  3864. TargetAdd('egg_module.obj', input='libp3egg2pg.in')
  3865. TargetAdd('egg_module.obj', input='libp3egg.in')
  3866. TargetAdd('egg_module.obj', opts=OPTS)
  3867. TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  3868. TargetAdd('egg.pyd', input='egg_module.obj')
  3869. TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  3870. TargetAdd('egg.pyd', input='libp3egg_igate.obj')
  3871. TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  3872. TargetAdd('egg.pyd', input='libpandaegg.dll')
  3873. TargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  3874. TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  3875. TargetAdd('egg.pyd', opts=['PYTHON'])
  3876. #
  3877. # DIRECTORY: panda/src/x11display/
  3878. #
  3879. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  3880. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  3881. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  3882. #
  3883. # DIRECTORY: panda/src/glxdisplay/
  3884. #
  3885. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3886. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3887. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  3888. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3889. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3890. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  3891. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3892. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3893. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3894. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  3895. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3896. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3897. #
  3898. # DIRECTORY: panda/src/cocoadisplay/
  3899. #
  3900. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  3901. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3902. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  3903. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3904. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3905. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3906. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3907. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3908. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  3909. if (PkgSkip('PANDAFX')==0):
  3910. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  3911. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3912. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA'])
  3913. #
  3914. # DIRECTORY: panda/src/osxdisplay/
  3915. #
  3916. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  3917. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3918. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  3919. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  3920. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3921. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3922. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3923. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3924. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3925. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  3926. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  3927. if (PkgSkip('PANDAFX')==0):
  3928. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  3929. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3930. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  3931. #
  3932. # DIRECTORY: panda/src/wgldisplay/
  3933. #
  3934. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  3935. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  3936. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  3937. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  3938. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3939. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3940. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3941. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3942. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  3943. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  3944. if (PkgSkip('PANDAFX')==0):
  3945. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  3946. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3947. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  3948. #
  3949. # DIRECTORY: panda/src/egldisplay/
  3950. #
  3951. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3952. DefSymbol('GLES', 'OPENGLES_1', '')
  3953. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  3954. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  3955. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  3956. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  3957. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  3958. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  3959. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  3960. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  3961. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  3962. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  3963. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3964. #
  3965. # DIRECTORY: panda/src/egldisplay/
  3966. #
  3967. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3968. DefSymbol('GLES2', 'OPENGLES_2', '')
  3969. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  3970. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  3971. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  3972. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  3973. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  3974. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  3975. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  3976. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  3977. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  3978. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  3979. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3980. #
  3981. # DIRECTORY: panda/src/ode/
  3982. #
  3983. if (PkgSkip("ODE")==0 and not RUNTIME):
  3984. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON']
  3985. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  3986. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  3987. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  3988. OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON']
  3989. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  3990. IGATEFILES.remove("odeConvexGeom.h")
  3991. IGATEFILES.remove("odeHeightFieldGeom.h")
  3992. IGATEFILES.remove("odeHelperStructs.h")
  3993. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  3994. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  3995. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  3996. TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  3997. #
  3998. # DIRECTORY: panda/metalibs/pandaode/
  3999. #
  4000. if (PkgSkip("ODE")==0 and not RUNTIME):
  4001. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4002. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4003. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4004. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4005. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4006. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4007. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4008. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4009. OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON']
  4010. TargetAdd('ode_module.obj', input='libpandaode.in')
  4011. TargetAdd('ode_module.obj', opts=OPTS)
  4012. TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4013. TargetAdd('ode.pyd', input='ode_module.obj')
  4014. TargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4015. TargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4016. TargetAdd('ode.pyd', input='libpandaode.dll')
  4017. TargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4018. TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4019. TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE'])
  4020. #
  4021. # DIRECTORY: panda/src/bullet/
  4022. #
  4023. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4024. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4025. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4026. OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON']
  4027. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4028. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4029. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4030. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  4031. #
  4032. # DIRECTORY: panda/metalibs/pandabullet/
  4033. #
  4034. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4035. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4036. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4037. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4038. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4039. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4040. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4041. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON']
  4042. TargetAdd('bullet_module.obj', input='libpandabullet.in')
  4043. TargetAdd('bullet_module.obj', opts=OPTS)
  4044. TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4045. TargetAdd('bullet.pyd', input='bullet_module.obj')
  4046. TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4047. TargetAdd('bullet.pyd', input='libpandabullet.dll')
  4048. TargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4049. TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4050. TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET'])
  4051. #
  4052. # DIRECTORY: panda/src/physx/
  4053. #
  4054. if (PkgSkip("PHYSX")==0):
  4055. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4056. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4057. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4058. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4059. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4060. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4061. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  4062. #
  4063. # DIRECTORY: panda/metalibs/pandaphysx/
  4064. #
  4065. if (PkgSkip("PHYSX")==0):
  4066. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4067. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4068. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4069. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4070. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4071. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4072. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4073. TargetAdd('physx_module.obj', input='libpandaphysx.in')
  4074. TargetAdd('physx_module.obj', opts=OPTS)
  4075. TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4076. TargetAdd('physx.pyd', input='physx_module.obj')
  4077. TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4078. TargetAdd('physx.pyd', input='libpandaphysx.dll')
  4079. TargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4080. TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4081. TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4082. #
  4083. # DIRECTORY: panda/src/physics/
  4084. #
  4085. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4086. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4087. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4088. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4089. OPTS=['DIR:panda/src/physics', 'PYTHON']
  4090. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4091. IGATEFILES.remove("forces.h")
  4092. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4093. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4094. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  4095. #
  4096. # DIRECTORY: panda/src/particlesystem/
  4097. #
  4098. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4099. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4100. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4101. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4102. OPTS=['DIR:panda/src/particlesystem', 'PYTHON']
  4103. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4104. IGATEFILES.remove('orientedParticle.h')
  4105. IGATEFILES.remove('orientedParticleFactory.h')
  4106. IGATEFILES.remove('particlefactories.h')
  4107. IGATEFILES.remove('emitters.h')
  4108. IGATEFILES.remove('particles.h')
  4109. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4110. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4111. TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
  4112. #
  4113. # DIRECTORY: panda/metalibs/pandaphysics/
  4114. #
  4115. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4116. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4117. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4118. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4119. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4120. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4121. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4122. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4123. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4124. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4125. OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON']
  4126. TargetAdd('physics_module.obj', input='libp3physics.in')
  4127. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4128. TargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4129. TargetAdd('physics_module.obj', opts=OPTS)
  4130. TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4131. TargetAdd('physics.pyd', input='physics_module.obj')
  4132. TargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4133. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4134. TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4135. TargetAdd('physics.pyd', input='libpandaphysics.dll')
  4136. TargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4137. TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4138. TargetAdd('physics.pyd', opts=['PYTHON'])
  4139. #
  4140. # DIRECTORY: panda/src/speedtree/
  4141. #
  4142. if (PkgSkip("SPEEDTREE")==0):
  4143. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON']
  4144. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4145. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4146. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4147. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4148. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  4149. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4150. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4151. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4152. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4153. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4154. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4155. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4156. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4157. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4158. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4159. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4160. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4161. #
  4162. # DIRECTORY: panda/src/testbed/
  4163. #
  4164. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'android'):
  4165. OPTS=['DIR:panda/src/testbed']
  4166. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4167. TargetAdd('pview.exe', input='pview_pview.obj')
  4168. TargetAdd('pview.exe', input='libp3framework.dll')
  4169. TargetAdd('pview.exe', input='libpandaegg.dll')
  4170. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4171. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4172. #
  4173. # DIRECTORY: panda/src/android/
  4174. #
  4175. if (not RUNTIME and GetTarget() == 'android'):
  4176. native_app_glue = os.path.join(SDK['ANDROID_NDK'], 'sources', 'android', 'native_app_glue')
  4177. OPTS=['DIR:panda/src/android', 'DIR:' + native_app_glue]
  4178. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4179. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4180. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4181. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4182. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4183. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4184. if (not RTDIST and PkgSkip("PVIEW")==0):
  4185. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4186. TargetAdd('pview.exe', input='android_native_app_glue.obj')
  4187. TargetAdd('pview.exe', input='android_main.obj')
  4188. TargetAdd('pview.exe', input='pview_pview.obj')
  4189. TargetAdd('pview.exe', input='libp3framework.dll')
  4190. TargetAdd('pview.exe', input='libpandaegg.dll')
  4191. TargetAdd('pview.exe', input='libp3android.dll')
  4192. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4193. TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml')
  4194. #
  4195. # DIRECTORY: panda/src/androiddisplay/
  4196. #
  4197. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4198. DefSymbol('GLES', 'OPENGLES_1', '')
  4199. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'DIR:' + native_app_glue, 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4200. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4201. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4202. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4203. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4204. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4205. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4206. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4207. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4208. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4209. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4210. #
  4211. # DIRECTORY: panda/src/tinydisplay/
  4212. #
  4213. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4214. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4215. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4216. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4217. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4218. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4219. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4220. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4221. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4222. if GetTarget() == 'darwin':
  4223. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4224. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4225. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4226. elif GetTarget() == 'windows':
  4227. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4228. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4229. else:
  4230. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4231. TargetAdd('libp3tinydisplay.dll', opts=['X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  4232. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4233. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4234. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4235. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4236. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4237. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4238. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4239. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4240. #
  4241. # DIRECTORY: direct/src/directbase/
  4242. #
  4243. if (PkgSkip("DIRECT")==0):
  4244. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  4245. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4246. if (PkgSkip("PYTHON")==0 and not RTDIST and not RUNTIME):
  4247. DefSymbol("BUILDING:PACKPANDA", "IMPORT_MODULE", "direct.directscripts.packpanda")
  4248. TargetAdd('packpanda.obj', opts=OPTS+['BUILDING:PACKPANDA'], input='ppython.cxx')
  4249. TargetAdd('packpanda.exe', input='packpanda.obj')
  4250. TargetAdd('packpanda.exe', opts=['PYTHON'])
  4251. DefSymbol("BUILDING:EGGCACHER", "IMPORT_MODULE", "direct.directscripts.eggcacher")
  4252. TargetAdd('eggcacher.obj', opts=OPTS+['BUILDING:EGGCACHER'], input='ppython.cxx')
  4253. TargetAdd('eggcacher.exe', input='eggcacher.obj')
  4254. TargetAdd('eggcacher.exe', opts=['PYTHON'])
  4255. #
  4256. # DIRECTORY: direct/src/dcparser/
  4257. #
  4258. if (PkgSkip("DIRECT")==0):
  4259. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON']
  4260. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4261. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4262. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4263. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4264. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4265. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4266. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON']
  4267. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4268. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4269. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4270. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4271. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4272. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  4273. #
  4274. # DIRECTORY: direct/src/deadrec/
  4275. #
  4276. if (PkgSkip("DIRECT")==0):
  4277. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4278. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4279. OPTS=['DIR:direct/src/deadrec', 'PYTHON']
  4280. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4281. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4282. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4283. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  4284. #
  4285. # DIRECTORY: direct/src/distributed/
  4286. #
  4287. if (PkgSkip("DIRECT")==0):
  4288. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON']
  4289. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4290. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4291. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4292. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON']
  4293. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4294. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4295. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4296. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  4297. #
  4298. # DIRECTORY: direct/src/interval/
  4299. #
  4300. if (PkgSkip("DIRECT")==0):
  4301. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4302. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4303. OPTS=['DIR:direct/src/interval', 'PYTHON']
  4304. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4305. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4306. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4307. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  4308. #
  4309. # DIRECTORY: direct/src/showbase/
  4310. #
  4311. if (PkgSkip("DIRECT")==0):
  4312. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4313. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4314. if GetTarget() == 'darwin':
  4315. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4316. OPTS=['DIR:direct/src/showbase', 'PYTHON']
  4317. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4318. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4319. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4320. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  4321. #
  4322. # DIRECTORY: direct/src/motiontrail/
  4323. #
  4324. if (PkgSkip("DIRECT")==0):
  4325. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4326. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4327. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4328. OPTS=['DIR:direct/src/motiontrail', 'PYTHON']
  4329. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4330. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4331. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4332. TargetAdd('libp3motiontrail_igate.obj', input='libp3motiontrail.in', opts=["DEPENDENCYONLY"])
  4333. #
  4334. # DIRECTORY: direct/metalibs/direct/
  4335. #
  4336. if (PkgSkip("DIRECT")==0):
  4337. OPTS=['DIR:direct/metalibs/direct', 'BUILDING:DIRECT']
  4338. TargetAdd('p3direct_direct.obj', opts=OPTS, input='direct.cxx')
  4339. TargetAdd('libp3direct.dll', input='p3direct_direct.obj')
  4340. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4341. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4342. if GetTarget() == 'darwin':
  4343. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4344. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4345. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4346. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4347. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4348. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4349. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4350. OPTS=['DIR:direct/metalibs/direct', 'PYTHON']
  4351. TargetAdd('direct_module.obj', input='libp3dcparser.in')
  4352. TargetAdd('direct_module.obj', input='libp3showbase.in')
  4353. TargetAdd('direct_module.obj', input='libp3deadrec.in')
  4354. TargetAdd('direct_module.obj', input='libp3interval.in')
  4355. TargetAdd('direct_module.obj', input='libp3distributed.in')
  4356. TargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4357. TargetAdd('direct_module.obj', opts=OPTS)
  4358. TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4359. TargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4360. TargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4361. TargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4362. TargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4363. TargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4364. TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4365. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4366. # the Python libraries. If a C++ user needs these modules, we can move them
  4367. # back and filter out the Python-specific code.
  4368. TargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4369. TargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4370. TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4371. TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4372. TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4373. TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4374. TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4375. TargetAdd('direct.pyd', input='direct_module.obj')
  4376. TargetAdd('direct.pyd', input='libp3direct.dll')
  4377. TargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4378. TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4379. TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4380. #
  4381. # DIRECTORY: direct/src/dcparse/
  4382. #
  4383. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4384. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON']
  4385. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4386. TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4387. TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4388. TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4389. TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4390. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4391. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4392. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4393. TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON'])
  4394. #
  4395. # DIRECTORY: direct/src/plugin/
  4396. #
  4397. if (RTDIST or RUNTIME):
  4398. # Explicitly define this as we don't include dtool_config.h here.
  4399. if GetTarget() not in ('windows', 'darwin'):
  4400. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4401. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4402. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4403. OPTS += ['ZLIB', 'MSIMG']
  4404. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4405. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4406. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4407. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4408. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4409. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4410. if GetTarget() == 'darwin':
  4411. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4412. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4413. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4414. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4415. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4416. if (RTDIST):
  4417. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4418. TargetAdd(fname, input='plugin_plugin.obj')
  4419. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4420. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4421. TargetAdd(fname, input='plugin_parse_color.obj')
  4422. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4423. if GetTarget() == 'darwin':
  4424. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4425. TargetAdd(fname, input='plugin_fileSpec.obj')
  4426. TargetAdd(fname, input='plugin_binaryXml.obj')
  4427. TargetAdd(fname, input='plugin_handleStream.obj')
  4428. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4429. TargetAdd(fname, input='libp3tinyxml.ilb')
  4430. if GetTarget() == 'darwin':
  4431. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4432. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4433. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4434. if (PkgSkip("PYTHON")==0 and RTDIST):
  4435. # Freeze VFSImporter and its dependency modules into p3dpython.
  4436. # Mark panda3d.core as a dependency to make sure to build that first.
  4437. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON'])
  4438. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4439. OPTS += ['PYTHON']
  4440. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4441. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4442. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4443. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4444. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4445. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4446. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4447. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4448. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4449. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4450. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4451. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4452. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4453. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4454. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4455. if GetTarget() == 'windows':
  4456. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4457. OPTS.append("NON_CONSOLE")
  4458. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4459. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4460. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4461. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4462. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4463. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4464. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4465. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4466. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  4467. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4468. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4469. if GetTarget() == 'darwin':
  4470. OPTS += ['OPT:2']
  4471. if (PkgSkip("FLTK")==0):
  4472. OPTS.append("FLTK")
  4473. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4474. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4475. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4476. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4477. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4478. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4479. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4480. if GetTarget() == 'darwin':
  4481. OPTS += ['OPT:2']
  4482. TargetAdd('p3dcert.exe', opts=OPTS)
  4483. elif (PkgSkip("WX")==0):
  4484. OPTS += ["WX", "RTTI"]
  4485. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4486. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4487. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4488. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4489. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4490. if GetTarget() == "darwin":
  4491. OPTS += ['GL', 'OPT:2']
  4492. TargetAdd('p3dcert.exe', opts=OPTS)
  4493. #
  4494. # DIRECTORY: direct/src/plugin_npapi/
  4495. #
  4496. if RUNTIME:
  4497. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4498. if GetTarget() == 'windows':
  4499. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4500. "version" : VERSION,
  4501. "description" : "Runs 3-D games and interactive applets",
  4502. "filename" : "nppanda3d.dll",
  4503. "mimetype" : "application/x-panda3d",
  4504. "extension" : "p3d",
  4505. "filedesc" : "Panda3D applet"}
  4506. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4507. elif GetTarget() == 'darwin':
  4508. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4509. OPTS += ['GTK2']
  4510. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4511. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4512. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4513. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4514. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4515. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4516. if GetTarget() == 'windows':
  4517. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4518. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4519. elif GetTarget() == 'darwin':
  4520. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4521. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4522. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4523. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4524. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4525. #
  4526. # DIRECTORY: direct/src/plugin_activex/
  4527. #
  4528. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4529. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4530. DefSymbol('ACTIVEX', '_USRDLL', '')
  4531. DefSymbol('ACTIVEX', '_WINDLL', '')
  4532. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4533. DefSymbol('ACTIVEX', '_MBCS', '')
  4534. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4535. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4536. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4537. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4538. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4539. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4540. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4541. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4542. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4543. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4544. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4545. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4546. #
  4547. # DIRECTORY: direct/src/plugin_standalone/
  4548. #
  4549. if (RUNTIME):
  4550. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4551. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4552. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4553. if GetTarget() == 'windows':
  4554. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4555. "version" : VERSION,
  4556. "description" : "Runs 3-D games and interactive applets",
  4557. "filename" : "panda3d.exe",
  4558. "mimetype" : "application/x-panda3d",
  4559. "extension" : "p3d",
  4560. "filedesc" : "Panda3D applet",
  4561. "icon" : "panda3d.ico"}
  4562. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4563. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4564. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4565. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4566. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4567. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4568. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4569. if GetTarget() == 'darwin':
  4570. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4571. elif GetTarget() == 'windows':
  4572. TargetAdd('panda3d.exe', input='panda3d.res')
  4573. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4574. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4575. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4576. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4577. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4578. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4579. if (GetTarget() == 'darwin'):
  4580. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4581. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4582. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4583. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4584. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4585. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4586. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4587. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4588. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4589. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4590. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4591. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4592. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4593. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4594. elif (GetTarget() == 'windows'):
  4595. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4596. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4597. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4598. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4599. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4600. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4601. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4602. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4603. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4604. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4605. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4606. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4607. if (RTDIST):
  4608. 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']
  4609. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4610. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4611. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4612. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4613. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4614. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4615. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4616. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4617. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4618. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4619. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4620. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4621. if (GetTarget() == 'darwin'):
  4622. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4623. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4624. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4625. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  4626. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4627. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4628. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4629. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4630. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4631. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4632. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4633. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4634. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4635. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4636. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4637. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4638. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4639. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4640. if GetTarget() == 'darwin':
  4641. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4642. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4643. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4644. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  4645. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4646. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4647. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4648. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4649. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4650. if GetTarget() == 'darwin':
  4651. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4652. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4653. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4654. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4655. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4656. if GetTarget() == 'windows':
  4657. OPTS.append("P3DEMBEDW")
  4658. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4659. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4660. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4661. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4662. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4663. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4664. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4665. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4666. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4667. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4668. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4669. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4670. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4671. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4672. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  4673. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4674. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4675. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4676. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4677. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4678. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4679. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4680. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4681. #
  4682. # DIRECTORY: pandatool/src/pandatoolbase/
  4683. #
  4684. if (PkgSkip("PANDATOOL")==0):
  4685. OPTS=['DIR:pandatool/src/pandatoolbase']
  4686. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4687. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4688. #
  4689. # DIRECTORY: pandatool/src/converter/
  4690. #
  4691. if (PkgSkip("PANDATOOL")==0):
  4692. OPTS=['DIR:pandatool/src/converter']
  4693. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4694. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4695. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4696. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4697. #
  4698. # DIRECTORY: pandatool/src/progbase/
  4699. #
  4700. if (PkgSkip("PANDATOOL")==0):
  4701. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4702. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4703. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4704. #
  4705. # DIRECTORY: pandatool/src/eggbase/
  4706. #
  4707. if (PkgSkip("PANDATOOL")==0):
  4708. OPTS=['DIR:pandatool/src/eggbase']
  4709. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4710. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4711. #
  4712. # DIRECTORY: pandatool/src/bam/
  4713. #
  4714. if (PkgSkip("PANDATOOL")==0):
  4715. OPTS=['DIR:pandatool/src/bam']
  4716. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4717. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4718. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4719. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4720. TargetAdd('bam-info.exe', input='libpandaegg.dll')
  4721. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4722. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4723. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4724. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4725. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4726. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4727. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4728. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4729. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4730. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4731. #
  4732. # DIRECTORY: pandatool/src/cvscopy/
  4733. #
  4734. if (PkgSkip("PANDATOOL")==0):
  4735. OPTS=['DIR:pandatool/src/cvscopy']
  4736. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  4737. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  4738. #
  4739. # DIRECTORY: pandatool/src/daeegg/
  4740. #
  4741. if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0):
  4742. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4743. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4744. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4745. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4746. #
  4747. # DIRECTORY: pandatool/src/assimp
  4748. #
  4749. if (PkgSkip("PANDATOOL") == 0 and PkgSkip("ASSIMP")==0):
  4750. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4751. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4752. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4753. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4754. TargetAdd('libp3assimp.dll', opts=OPTS)
  4755. #
  4756. # DIRECTORY: pandatool/src/daeprogs/
  4757. #
  4758. if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0):
  4759. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4760. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4761. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4762. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4763. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4764. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4765. #
  4766. # DIRECTORY: pandatool/src/dxf/
  4767. #
  4768. if (PkgSkip("PANDATOOL")==0):
  4769. OPTS=['DIR:pandatool/src/dxf']
  4770. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4771. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4772. #
  4773. # DIRECTORY: pandatool/src/dxfegg/
  4774. #
  4775. if (PkgSkip("PANDATOOL")==0):
  4776. OPTS=['DIR:pandatool/src/dxfegg']
  4777. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4778. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4779. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4780. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4781. #
  4782. # DIRECTORY: pandatool/src/dxfprogs/
  4783. #
  4784. if (PkgSkip("PANDATOOL")==0):
  4785. OPTS=['DIR:pandatool/src/dxfprogs']
  4786. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4787. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4788. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4789. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4790. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4791. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4792. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4793. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4794. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4795. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4796. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4797. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4798. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4799. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4800. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4801. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4802. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4803. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4804. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  4805. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  4806. #
  4807. # DIRECTORY: pandatool/src/objegg/
  4808. #
  4809. if (PkgSkip("PANDATOOL")==0):
  4810. OPTS=['DIR:pandatool/src/objegg']
  4811. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  4812. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  4813. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  4814. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  4815. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  4816. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  4817. #
  4818. # DIRECTORY: pandatool/src/objprogs/
  4819. #
  4820. if (PkgSkip("PANDATOOL")==0):
  4821. OPTS=['DIR:pandatool/src/objprogs']
  4822. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  4823. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  4824. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  4825. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  4826. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  4827. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  4828. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  4829. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  4830. #
  4831. # DIRECTORY: pandatool/src/palettizer/
  4832. #
  4833. if (PkgSkip("PANDATOOL")==0):
  4834. OPTS=['DIR:pandatool/src/palettizer']
  4835. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  4836. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  4837. #
  4838. # DIRECTORY: pandatool/src/egg-mkfont/
  4839. #
  4840. if (PkgSkip("FREETYPE")==0) and (PkgSkip("PANDATOOL")==0):
  4841. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  4842. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  4843. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  4844. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  4845. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  4846. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  4847. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  4848. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  4849. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  4850. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  4851. #
  4852. # DIRECTORY: pandatool/src/eggcharbase/
  4853. #
  4854. if (PkgSkip("PANDATOOL")==0):
  4855. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  4856. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  4857. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  4858. #
  4859. # DIRECTORY: pandatool/src/egg-optchar/
  4860. #
  4861. if (PkgSkip("PANDATOOL")==0):
  4862. OPTS=['DIR:pandatool/src/egg-optchar']
  4863. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  4864. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  4865. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  4866. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  4867. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  4868. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  4869. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  4870. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  4871. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  4872. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  4873. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  4874. #
  4875. # DIRECTORY: pandatool/src/egg-palettize/
  4876. #
  4877. if (PkgSkip("PANDATOOL")==0):
  4878. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  4879. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  4880. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  4881. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  4882. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  4883. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  4884. #
  4885. # DIRECTORY: pandatool/src/egg-qtess/
  4886. #
  4887. if (PkgSkip("PANDATOOL")==0):
  4888. OPTS=['DIR:pandatool/src/egg-qtess']
  4889. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  4890. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  4891. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  4892. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  4893. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  4894. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  4895. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  4896. #
  4897. # DIRECTORY: pandatool/src/eggprogs/
  4898. #
  4899. if (PkgSkip("PANDATOOL")==0):
  4900. OPTS=['DIR:pandatool/src/eggprogs']
  4901. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  4902. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  4903. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  4904. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  4905. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  4906. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  4907. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  4908. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  4909. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  4910. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  4911. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  4912. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  4913. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  4914. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  4915. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  4916. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  4917. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  4918. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  4919. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  4920. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  4921. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  4922. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  4923. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  4924. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  4925. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  4926. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  4927. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  4928. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  4929. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  4930. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  4931. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  4932. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  4933. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  4934. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  4935. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  4936. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  4937. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  4938. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  4939. #
  4940. # DIRECTORY: pandatool/src/flt/
  4941. #
  4942. if (PkgSkip("PANDATOOL")==0):
  4943. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  4944. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  4945. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  4946. #
  4947. # DIRECTORY: pandatool/src/fltegg/
  4948. #
  4949. if (PkgSkip("PANDATOOL")==0):
  4950. OPTS=['DIR:pandatool/src/fltegg']
  4951. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  4952. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  4953. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  4954. #
  4955. # DIRECTORY: pandatool/src/fltprogs/
  4956. #
  4957. if (PkgSkip("PANDATOOL")==0):
  4958. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  4959. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  4960. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  4961. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  4962. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  4963. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  4964. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  4965. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  4966. TargetAdd('flt-info.exe', input='libp3flt.lib')
  4967. TargetAdd('flt-info.exe', input=COMMON_EGG2X_LIBS)
  4968. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  4969. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  4970. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  4971. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  4972. TargetAdd('flt-trans.exe', input=COMMON_EGG2X_LIBS)
  4973. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  4974. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  4975. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  4976. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  4977. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  4978. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  4979. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  4980. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  4981. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  4982. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  4983. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  4984. TargetAdd('fltcopy.exe', input=COMMON_EGG2X_LIBS)
  4985. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  4986. #
  4987. # DIRECTORY: pandatool/src/imagebase/
  4988. #
  4989. if (PkgSkip("PANDATOOL")==0):
  4990. OPTS=['DIR:pandatool/src/imagebase']
  4991. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  4992. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  4993. #
  4994. # DIRECTORY: pandatool/src/imageprogs/
  4995. #
  4996. if (PkgSkip("PANDATOOL")==0):
  4997. OPTS=['DIR:pandatool/src/imageprogs']
  4998. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  4999. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5000. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5001. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5002. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5003. TargetAdd('image-info.exe', input='libpandaegg.dll')
  5004. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5005. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5006. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5007. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5008. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5009. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5010. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5011. TargetAdd('image-resize.exe', input='libpandaegg.dll')
  5012. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5013. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5014. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5015. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5016. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5017. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5018. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5019. TargetAdd('image-trans.exe', input='libpandaegg.dll')
  5020. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5021. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5022. #
  5023. # DIRECTORY: pandatool/src/pfmprogs/
  5024. #
  5025. if (PkgSkip("PANDATOOL")==0):
  5026. OPTS=['DIR:pandatool/src/pfmprogs']
  5027. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5028. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5029. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5030. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5031. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5032. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5033. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5034. TargetAdd('pfm-bba_config_pfm.obj', opts=OPTS, input='config_pfm.cxx')
  5035. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5036. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfm.obj')
  5037. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5038. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5039. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5040. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5041. #
  5042. # DIRECTORY: pandatool/src/lwo/
  5043. #
  5044. if (PkgSkip("PANDATOOL")==0):
  5045. OPTS=['DIR:pandatool/src/lwo']
  5046. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5047. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5048. #
  5049. # DIRECTORY: pandatool/src/lwoegg/
  5050. #
  5051. if (PkgSkip("PANDATOOL")==0):
  5052. OPTS=['DIR:pandatool/src/lwoegg']
  5053. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5054. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5055. #
  5056. # DIRECTORY: pandatool/src/lwoprogs/
  5057. #
  5058. if (PkgSkip("PANDATOOL")==0):
  5059. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5060. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5061. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5062. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5063. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5064. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5065. TargetAdd('lwo-scan.exe', input='libpandaegg.dll')
  5066. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5067. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5068. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5069. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5070. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5071. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5072. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5073. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5074. #
  5075. # DIRECTORY: pandatool/src/maya/
  5076. #
  5077. for VER in MAYAVERSIONS:
  5078. VNUM=VER[4:]
  5079. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  5080. OPTS=['DIR:pandatool/src/maya', VER]
  5081. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5082. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5083. #
  5084. # DIRECTORY: pandatool/src/mayaegg/
  5085. #
  5086. for VER in MAYAVERSIONS:
  5087. VNUM=VER[4:]
  5088. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  5089. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5090. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5091. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5092. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5093. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5094. #
  5095. # DIRECTORY: pandatool/src/maxegg/
  5096. #
  5097. for VER in MAXVERSIONS:
  5098. VNUM=VER[3:]
  5099. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  5100. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5101. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5102. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5103. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5104. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5105. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5106. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5107. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5108. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5109. #
  5110. # DIRECTORY: pandatool/src/maxprogs/
  5111. #
  5112. for VER in MAXVERSIONS:
  5113. VNUM=VER[3:]
  5114. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  5115. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5116. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5117. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5118. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5119. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5120. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5121. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5122. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5123. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5124. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5125. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5126. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5127. #
  5128. # DIRECTORY: pandatool/src/vrml/
  5129. #
  5130. if (PkgSkip("PANDATOOL")==0):
  5131. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5132. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5133. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5134. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5135. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5136. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5137. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5138. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5139. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5140. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5141. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5142. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5143. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5144. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5145. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5146. #
  5147. # DIRECTORY: pandatool/src/vrmlegg/
  5148. #
  5149. if (PkgSkip("PANDATOOL")==0):
  5150. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5151. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5152. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5153. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5154. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5155. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5156. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5157. #
  5158. # DIRECTORY: pandatool/src/xfile/
  5159. #
  5160. if (PkgSkip("PANDATOOL")==0):
  5161. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5162. CreateFile(GetOutputDir()+"/include/xParser.h")
  5163. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5164. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5165. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5166. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5167. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5168. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5169. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5170. #
  5171. # DIRECTORY: pandatool/src/xfileegg/
  5172. #
  5173. if (PkgSkip("PANDATOOL")==0):
  5174. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5175. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5176. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5177. #
  5178. # DIRECTORY: pandatool/src/ptloader/
  5179. #
  5180. if (PkgSkip("PANDATOOL")==0):
  5181. 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']
  5182. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx')
  5183. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5184. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5185. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5186. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5187. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5188. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5189. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5190. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5191. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5192. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5193. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5194. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5195. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5196. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5197. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5198. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5199. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5200. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5201. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5202. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5203. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5204. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5205. #
  5206. # DIRECTORY: pandatool/src/miscprogs/
  5207. #
  5208. # This is a bit of an esoteric tool, and it causes issues because
  5209. # it conflicts with tools of the same name in different packages.
  5210. #if (PkgSkip("PANDATOOL")==0):
  5211. # OPTS=['DIR:pandatool/src/miscprogs']
  5212. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5213. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5214. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5215. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5216. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5217. # TargetAdd('bin2c.exe', input='libp3pystub.lib')
  5218. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5219. #
  5220. # DIRECTORY: pandatool/src/pstatserver/
  5221. #
  5222. if (PkgSkip("PANDATOOL")==0):
  5223. OPTS=['DIR:pandatool/src/pstatserver']
  5224. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5225. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5226. #
  5227. # DIRECTORY: pandatool/src/softprogs/
  5228. #
  5229. if (PkgSkip("PANDATOOL")==0):
  5230. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  5231. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  5232. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  5233. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  5234. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  5235. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  5236. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  5237. TargetAdd('softcvs.exe', input='libpandaegg.dll')
  5238. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  5239. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  5240. #
  5241. # DIRECTORY: pandatool/src/text-stats/
  5242. #
  5243. if (PkgSkip("PANDATOOL")==0):
  5244. OPTS=['DIR:pandatool/src/text-stats']
  5245. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5246. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5247. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5248. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5249. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5250. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5251. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5252. TargetAdd('text-stats.exe', input='libpandaegg.dll')
  5253. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5254. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5255. #
  5256. # DIRECTORY: pandatool/src/vrmlprogs/
  5257. #
  5258. if (PkgSkip("PANDATOOL")==0):
  5259. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5260. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5261. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5262. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5263. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5264. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5265. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5266. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5267. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5268. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5269. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5270. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5271. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5272. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5273. #
  5274. # DIRECTORY: pandatool/src/win-stats/
  5275. # DIRECTORY: pandatool/src/gtk-stats/
  5276. #
  5277. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5278. if GetTarget() == 'windows':
  5279. OPTS=['DIR:pandatool/src/win-stats']
  5280. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5281. else:
  5282. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5283. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5284. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5285. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5286. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5287. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5288. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5289. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5290. #
  5291. # DIRECTORY: pandatool/src/xfileprogs/
  5292. #
  5293. if (PkgSkip("PANDATOOL")==0):
  5294. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5295. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5296. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5297. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5298. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5299. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5300. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5301. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5302. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5303. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5304. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5305. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5306. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5307. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5308. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5309. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5310. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5311. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5312. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5313. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5314. #
  5315. # DIRECTORY: pandatool/src/mayaprogs/
  5316. #
  5317. for VER in MAYAVERSIONS:
  5318. VNUM = VER[4:]
  5319. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5320. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5321. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5322. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5323. continue
  5324. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5325. ARCH_OPTS = ['NOARCH:PPC']
  5326. else:
  5327. ARCH_OPTS = []
  5328. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5329. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5330. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5331. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5332. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5333. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5334. #if GetTarget() == 'windows':
  5335. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5336. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5337. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5338. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5339. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5340. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5341. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5342. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5343. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5344. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5345. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5346. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5347. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5348. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5349. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5350. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5351. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5352. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5353. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5354. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5355. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5356. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5357. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5358. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5359. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5360. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5361. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5362. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5363. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5364. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5365. if GetTarget() == 'windows':
  5366. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5367. else:
  5368. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5369. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5370. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5371. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5372. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5373. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5374. if GetTarget() == 'windows':
  5375. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5376. else:
  5377. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5378. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5379. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5380. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5381. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5382. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5383. if GetTarget() == 'windows':
  5384. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5385. else:
  5386. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5387. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5388. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5389. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5390. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5391. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5392. if GetTarget() == 'windows':
  5393. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5394. else:
  5395. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5396. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5397. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5398. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5399. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5400. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5401. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5402. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5403. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5404. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5405. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5406. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5407. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5408. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5409. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5410. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5411. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5412. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5413. #
  5414. # DIRECTORY: contrib/src/ai/
  5415. #
  5416. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5417. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5418. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5419. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5420. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5421. OPTS=['DIR:contrib/src/ai', 'PYTHON']
  5422. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5423. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5424. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5425. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  5426. TargetAdd('ai_module.obj', input='libpandaai.in')
  5427. TargetAdd('ai_module.obj', opts=OPTS)
  5428. TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5429. TargetAdd('ai.pyd', input='ai_module.obj')
  5430. TargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5431. TargetAdd('ai.pyd', input='libpandaai.dll')
  5432. TargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5433. TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5434. TargetAdd('ai.pyd', opts=['PYTHON'])
  5435. #
  5436. # Generate the models directory and samples directory
  5437. #
  5438. if (PkgSkip("DIRECT")==0 and not RUNTIME):
  5439. model_extensions = ["*.egg"]
  5440. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5441. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5442. model_extensions.append("*.flt")
  5443. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5444. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5445. newname = model[:-4] + ".egg.pz"
  5446. else:
  5447. newname = model[:-4] + ".egg"
  5448. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5449. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5450. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5451. newname = model[:-4] + ".egg.pz"
  5452. else:
  5453. newname = model[:-4] + ".egg"
  5454. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5455. for model in GetDirectoryContents("models", model_extensions):
  5456. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5457. newname = model[:-4] + ".egg.pz"
  5458. else:
  5459. newname = model[:-4] + ".egg"
  5460. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5461. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5462. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5463. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5464. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5465. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5466. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5467. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5468. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5469. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5470. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5471. #
  5472. # Build the rtdist.
  5473. #
  5474. if (RTDIST):
  5475. OPTS=['DIR:direct/src/p3d']
  5476. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5477. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5478. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5479. #
  5480. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5481. #
  5482. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5483. OPTS=['DIR:direct/src/p3d']
  5484. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5485. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5486. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5487. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5488. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5489. ##########################################################################################
  5490. #
  5491. # Dependency-Based Distributed Build System.
  5492. #
  5493. ##########################################################################################
  5494. DEPENDENCYQUEUE=[]
  5495. for target in TARGET_LIST:
  5496. name = target.name
  5497. inputs = target.inputs
  5498. opts = target.opts
  5499. deps = target.deps
  5500. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5501. def BuildWorker(taskqueue, donequeue):
  5502. while True:
  5503. try:
  5504. task = taskqueue.get(timeout=1)
  5505. except:
  5506. ProgressOutput(None, "Waiting for tasks...")
  5507. task = taskqueue.get()
  5508. sys.stdout.flush()
  5509. if (task == 0): return
  5510. try:
  5511. task[0](*task[1])
  5512. donequeue.put(task)
  5513. except:
  5514. donequeue.put(0)
  5515. def AllSourcesReady(task, pending):
  5516. sources = task[3]
  5517. for x in sources:
  5518. if (x in pending):
  5519. return 0
  5520. sources = task[1][1]
  5521. for x in sources:
  5522. if (x in pending):
  5523. return 0
  5524. altsources = task[4]
  5525. for x in altsources:
  5526. if (x in pending):
  5527. return 0
  5528. return 1
  5529. def ParallelMake(tasklist):
  5530. # Create the communication queues.
  5531. donequeue = queue.Queue()
  5532. taskqueue = queue.Queue()
  5533. # Build up a table listing all the pending targets
  5534. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5535. # task[2] = [name]
  5536. # task[3] = deps
  5537. # The python tool package, in particular fltegg seems to throw parallelmake off
  5538. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5539. # and another subpart to be built sequentially. The most time consuming part of the process
  5540. # is the c++ code generation anyways.
  5541. tasklist_seq = []
  5542. i = 0
  5543. while i < len(tasklist):
  5544. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5545. break
  5546. i += 1
  5547. if i < len(tasklist):
  5548. tasklist_seq = tasklist[i:]
  5549. tasklist = tasklist[:i]
  5550. iNumStartingTasks = len(tasklist)
  5551. pending = {}
  5552. for task in tasklist:
  5553. for target in task[2]:
  5554. pending[target] = 1
  5555. # Create the workers
  5556. for slave in range(THREADCOUNT):
  5557. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5558. th.setDaemon(1)
  5559. th.start()
  5560. # Feed tasks to the workers.
  5561. tasksqueued = 0
  5562. while True:
  5563. if (tasksqueued < THREADCOUNT):
  5564. extras = []
  5565. for task in tasklist:
  5566. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5567. if (NeedsBuild(task[2], task[3])):
  5568. tasksqueued += 1
  5569. taskqueue.put(task)
  5570. else:
  5571. for target in task[2]:
  5572. del pending[target]
  5573. else:
  5574. extras.append(task)
  5575. tasklist = extras
  5576. sys.stdout.flush()
  5577. if (tasksqueued == 0): break
  5578. donetask = donequeue.get()
  5579. if (donetask == 0):
  5580. exit("Build process aborting.")
  5581. sys.stdout.flush()
  5582. tasksqueued -= 1
  5583. JustBuilt(donetask[2], donetask[3])
  5584. for target in donetask[2]:
  5585. del pending[target]
  5586. # Kill the workers.
  5587. for slave in range(THREADCOUNT):
  5588. taskqueue.put(0)
  5589. # Make sure there aren't any unsatisfied tasks
  5590. if len(tasklist) > 0:
  5591. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5592. SequentialMake(tasklist_seq)
  5593. def SequentialMake(tasklist):
  5594. i = 0
  5595. for task in tasklist:
  5596. if (NeedsBuild(task[2], task[3])):
  5597. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5598. JustBuilt(task[2], task[3])
  5599. i += 1
  5600. def RunDependencyQueue(tasklist):
  5601. if (THREADCOUNT!=0):
  5602. ParallelMake(tasklist)
  5603. else:
  5604. SequentialMake(tasklist)
  5605. try:
  5606. RunDependencyQueue(DEPENDENCYQUEUE)
  5607. except:
  5608. SaveDependencyCache()
  5609. raise
  5610. ##########################################################################################
  5611. #
  5612. # The Installers
  5613. #
  5614. # Under windows, we can build an 'exe' package using NSIS
  5615. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5616. # Under OSX, we can make a 'dmg' package.
  5617. #
  5618. ##########################################################################################
  5619. def MakeInstallerNSIS(file, title, installdir):
  5620. if (os.path.isfile(file)):
  5621. os.remove(file)
  5622. elif (os.path.isdir(file)):
  5623. shutil.rmtree(file)
  5624. if GetTargetArch() == 'x64':
  5625. regview = '64'
  5626. else:
  5627. regview = '32'
  5628. if (RUNTIME):
  5629. # Invoke the make_installer script.
  5630. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  5631. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  5632. cmd = sys.executable + " -B -u direct\\src\\plugin_installer\\make_installer.py"
  5633. cmd += " --version %s --regview %s" % (VERSION, regview)
  5634. if GetTargetArch() == 'x64':
  5635. cmd += " --install \"$PROGRAMFILES64\\Panda3D\" "
  5636. else:
  5637. cmd += " --install \"$PROGRAMFILES32\\Panda3D\" "
  5638. oscmd(cmd)
  5639. shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
  5640. return
  5641. print("Building "+title+" installer at %s" % (file))
  5642. if (COMPRESSOR != "lzma"):
  5643. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  5644. if (os.path.exists("nsis-output.exe")):
  5645. os.remove("nsis-output.exe")
  5646. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  5647. psource = os.path.abspath(".")
  5648. panda = os.path.abspath(GetOutputDir())
  5649. nsis_defs = {
  5650. 'COMPRESSOR' : COMPRESSOR,
  5651. 'TITLE' : title,
  5652. 'INSTALLDIR' : installdir,
  5653. 'OUTFILE' : os.path.join(psource, 'nsis-output.exe'),
  5654. 'LICENSE' : os.path.join(panda, 'LICENSE'),
  5655. 'BUILT' : panda,
  5656. 'SOURCE' : psource,
  5657. 'PYVER' : SDK["PYTHONVERSION"][6:9],
  5658. 'REGVIEW' : regview,
  5659. }
  5660. if GetHost() == 'windows':
  5661. cmd = os.path.join(GetThirdpartyBase(), 'win-nsis', 'makensis') + ' /V2'
  5662. for item in nsis_defs.items():
  5663. cmd += ' /D%s="%s"' % item
  5664. else:
  5665. cmd = 'makensis -V2'
  5666. for item in nsis_defs.items():
  5667. cmd += ' -D%s="%s"' % item
  5668. cmd += ' "%s"' % (os.path.join(psource, 'makepanda', 'installer.nsi'))
  5669. oscmd(cmd)
  5670. os.rename("nsis-output.exe", file)
  5671. INSTALLER_DEB_FILE="""
  5672. Package: panda3dMAJOR
  5673. Version: VERSION
  5674. Section: libdevel
  5675. Priority: optional
  5676. Architecture: ARCH
  5677. Essential: no
  5678. Depends: DEPENDS
  5679. Recommends: RECOMMENDS
  5680. Suggests: panda3d-runtime
  5681. Provides: panda3d
  5682. Conflicts: panda3d
  5683. Replaces: panda3d
  5684. Maintainer: rdb <[email protected]>
  5685. Installed-Size: INSTSIZE
  5686. Description: Panda3D free 3D engine SDK
  5687. 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.
  5688. 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.
  5689. .
  5690. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5691. """
  5692. RUNTIME_INSTALLER_DEB_FILE="""
  5693. Package: panda3d-runtime
  5694. Version: VERSION
  5695. Section: web
  5696. Priority: optional
  5697. Architecture: ARCH
  5698. Essential: no
  5699. Depends: DEPENDS
  5700. Provides: panda3d-runtime
  5701. Maintainer: rdb <[email protected]>
  5702. Installed-Size: INSTSIZE
  5703. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  5704. 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.
  5705. """
  5706. # We're not putting "python" in the "Requires" field,
  5707. # since the rpm-based distros don't have a common
  5708. # naming for the Python package.
  5709. INSTALLER_SPEC_FILE="""
  5710. Summary: The Panda3D free 3D engine SDK
  5711. Name: panda3d
  5712. Version: VERSION
  5713. Release: RPMRELEASE
  5714. License: BSD License
  5715. Group: Development/Libraries
  5716. BuildRoot: PANDASOURCE/targetroot
  5717. %description
  5718. 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.
  5719. 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.
  5720. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5721. %post
  5722. /sbin/ldconfig
  5723. %postun
  5724. /sbin/ldconfig
  5725. %files
  5726. %defattr(-,root,root)
  5727. /etc/Confauto.prc
  5728. /etc/Config.prc
  5729. /usr/share/panda3d
  5730. /usr/share/mime-info/panda3d.mime
  5731. /usr/share/mime-info/panda3d.keys
  5732. /usr/share/mime/packages/panda3d.xml
  5733. /usr/share/application-registry/panda3d.applications
  5734. /usr/share/applications/*.desktop
  5735. /etc/ld.so.conf.d/panda3d.conf
  5736. /usr/%_lib/panda3d
  5737. """ + PYTHON_SITEPACKAGES + """
  5738. /usr/include/panda3d
  5739. """
  5740. RUNTIME_INSTALLER_SPEC_FILE="""
  5741. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  5742. Name: panda3d-runtime
  5743. Version: VERSION
  5744. Release: RPMRELEASE
  5745. License: BSD License
  5746. Group: Productivity/Graphics/Other
  5747. BuildRoot: PANDASOURCE/targetroot
  5748. %description
  5749. 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.
  5750. %files
  5751. %defattr(-,root,root)
  5752. /usr/bin/panda3d
  5753. /usr/%_lib/nppanda3d.so
  5754. /usr/%_lib/mozilla/plugins/nppanda3d.so
  5755. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  5756. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  5757. /usr/share/mime-info/panda3d-runtime.mime
  5758. /usr/share/mime-info/panda3d-runtime.keys
  5759. /usr/share/mime/packages/panda3d-runtime.xml
  5760. /usr/share/application-registry/panda3d-runtime.applications
  5761. /usr/share/applications/*.desktop
  5762. """
  5763. # plist file for Mac OSX
  5764. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  5765. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  5766. <plist version="1.0">
  5767. <dict>
  5768. <key>CFBundleIdentifier</key>
  5769. <string>%(package_id)s</string>
  5770. <key>CFBundleShortVersionString</key>
  5771. <string>%(version)s</string>
  5772. <key>IFPkgFlagRelocatable</key>
  5773. <false/>
  5774. <key>IFPkgFlagAuthorizationAction</key>
  5775. <string>RootAuthorization</string>
  5776. <key>IFPkgFlagAllowBackRev</key>
  5777. <true/>
  5778. </dict>
  5779. </plist>
  5780. """
  5781. # FreeBSD pkg-descr
  5782. INSTALLER_PKG_DESCR_FILE = """
  5783. 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.
  5784. 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.
  5785. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5786. WWW: http://www.panda3d.org/
  5787. """
  5788. # FreeBSD pkg-descr
  5789. RUNTIME_INSTALLER_PKG_DESCR_FILE = """
  5790. Runtime binary and browser plugin for the Panda3D Game Engine
  5791. 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.
  5792. WWW: http://www.panda3d.org/
  5793. """
  5794. # FreeBSD PKG Manifest template file
  5795. INSTALLER_PKG_MANIFEST_FILE = """
  5796. name: NAME
  5797. version: VERSION
  5798. arch: ARCH
  5799. origin: ORIGIN
  5800. comment: "Panda 3D Engine"
  5801. www: http://www.panda3d.org
  5802. maintainer: rdb <[email protected]>
  5803. prefix: /usr/local
  5804. flatsize: INSTSIZEMB
  5805. deps: {DEPENDS}
  5806. """
  5807. def MakeInstallerLinux():
  5808. if not RUNTIME and not PkgSkip("PYTHON"):
  5809. PYTHONV = SDK["PYTHONVERSION"]
  5810. else:
  5811. PYTHONV = "python"
  5812. PV = PYTHONV.replace("python", "")
  5813. # Clean and set up a directory to install Panda3D into
  5814. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  5815. oscmd("mkdir --mode=0755 targetroot")
  5816. dpkg_present = False
  5817. if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"):
  5818. dpkg_present = True
  5819. rpmbuild_present = False
  5820. if os.path.exists("/usr/bin/rpmbuild"):
  5821. rpmbuild_present = True
  5822. if dpkg_present and rpmbuild_present:
  5823. print("Warning: both dpkg and rpmbuild present.")
  5824. if dpkg_present:
  5825. # Invoke installpanda.py to install it into a temporary dir
  5826. lib_dir = GetDebLibDir()
  5827. if RUNTIME:
  5828. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  5829. else:
  5830. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  5831. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  5832. oscmd("mkdir -p targetroot/usr/share/man/man1")
  5833. oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/")
  5834. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  5835. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  5836. if (RUNTIME):
  5837. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  5838. else:
  5839. txt = INSTALLER_DEB_FILE[1:]
  5840. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  5841. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  5842. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  5843. oscmd("cd targetroot ; (find usr -type f -exec md5sum {} \;) > DEBIAN/md5sums")
  5844. if (not RUNTIME):
  5845. oscmd("cd targetroot ; (find etc -type f -exec md5sum {} \;) >> DEBIAN/md5sums")
  5846. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  5847. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  5848. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  5849. # Determine the package name and the locations that
  5850. # dpkg-shlibdeps should look in for executables.
  5851. pkg_version = DEBVERSION
  5852. if RUNTIME:
  5853. pkg_name = "panda3d-runtime"
  5854. lib_pattern = "debian/%s/usr/%s/*.so" % (pkg_name, lib_dir)
  5855. else:
  5856. pkg_name = "panda3d" + MAJOR_VERSION
  5857. lib_pattern = "debian/%s/usr/%s/panda3d/*.so*" % (pkg_name, lib_dir)
  5858. bin_pattern = "debian/%s/usr/bin/*" % (pkg_name)
  5859. # dpkg-shlibdeps looks in the debian/{pkg_name}/DEBIAN/shlibs directory
  5860. # and also expects a debian/control file, so we create this dummy set-up.
  5861. oscmd("mkdir targetroot/debian")
  5862. oscmd("ln -s .. targetroot/debian/" + pkg_name)
  5863. WriteFile("targetroot/debian/control", "")
  5864. dpkg_shlibdeps = "dpkg-shlibdeps"
  5865. if GetVerbose():
  5866. dpkg_shlibdeps += " -v"
  5867. if RUNTIME:
  5868. # The runtime doesn't export any useful symbols, so just query the dependencies.
  5869. oscmd("cd targetroot; %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals())
  5870. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  5871. recommends = ""
  5872. else:
  5873. pkg_name = "panda3d" + MAJOR_VERSION
  5874. pkg_dir = "debian/panda3d" + MAJOR_VERSION
  5875. # Generate a symbols file so that other packages can know which symbols we export.
  5876. oscmd("cd targetroot; dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals())
  5877. # Library dependencies are required, binary dependencies are recommended.
  5878. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX.
  5879. 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())
  5880. 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())
  5881. # Parse the substvars files generated by dpkg-shlibdeps.
  5882. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  5883. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  5884. if PkgSkip("PYTHON")==0:
  5885. depends += ", " + PYTHONV
  5886. recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")"
  5887. if PkgSkip("NVIDIACG")==0:
  5888. depends += ", nvidia-cg-toolkit"
  5889. # Write back the dependencies, and delete the dummy set-up.
  5890. txt = txt.replace("DEPENDS", depends.strip(', '))
  5891. txt = txt.replace("RECOMMENDS", recommends.strip(', '))
  5892. WriteFile("targetroot/DEBIAN/control", txt)
  5893. oscmd("rm -rf targetroot/debian")
  5894. # Package it all up into a .deb file.
  5895. oscmd("chmod -R 755 targetroot/DEBIAN")
  5896. oscmd("chmod 644 targetroot/DEBIAN/control targetroot/DEBIAN/md5sums")
  5897. if not RUNTIME:
  5898. oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols")
  5899. oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch))
  5900. elif rpmbuild_present:
  5901. # Invoke installpanda.py to install it into a temporary dir
  5902. if RUNTIME:
  5903. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  5904. else:
  5905. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  5906. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  5907. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  5908. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  5909. pandasource = os.path.abspath(os.getcwd())
  5910. if RUNTIME:
  5911. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  5912. else:
  5913. txt = INSTALLER_SPEC_FILE[1:]
  5914. # Add the binaries in /usr/bin explicitly to the spec file
  5915. for base in os.listdir(GetOutputDir() + "/bin"):
  5916. txt += "/usr/bin/%s\n" % (base)
  5917. # Write out the spec file.
  5918. txt = txt.replace("VERSION", VERSION)
  5919. txt = txt.replace("RPMRELEASE", RPMRELEASE)
  5920. txt = txt.replace("PANDASOURCE", pandasource)
  5921. txt = txt.replace("PV", PV)
  5922. WriteFile("panda3d.spec", txt)
  5923. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  5924. if (RUNTIME):
  5925. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  5926. else:
  5927. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  5928. oscmd("rm -rf "+ARCH, True)
  5929. else:
  5930. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  5931. def MakeInstallerOSX():
  5932. if (RUNTIME):
  5933. # Invoke the make_installer script.
  5934. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  5935. cmdstr = sys.executable + " "
  5936. if sys.version_info >= (2, 6):
  5937. cmdstr += "-B "
  5938. cmdstr += "direct/src/plugin_installer/make_installer.py --version %s" % VERSION
  5939. oscmd(cmdstr)
  5940. return
  5941. import compileall
  5942. if (os.path.isfile("Panda3D-%s.dmg" % VERSION)): oscmd("rm -f Panda3D-%s.dmg" % VERSION)
  5943. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  5944. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  5945. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  5946. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  5947. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  5948. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  5949. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  5950. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  5951. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  5952. oscmd("cp -R %s/Frameworks dstroot/base/Developer/Panda3D/Frameworks" % GetOutputDir())
  5953. if os.path.isdir(GetOutputDir()+"/plugins"):
  5954. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  5955. # Libraries that shouldn't be in base, but are instead in other modules.
  5956. no_base_libs = ['libp3ffmpeg', 'libp3fmod_audio', 'libfmodex', 'libfmodexL']
  5957. for base in os.listdir(GetOutputDir()+"/lib"):
  5958. if not base.endswith(".a") and base.split('.')[0] not in no_base_libs:
  5959. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  5960. # We really need to specify -R in order not to follow symlinks
  5961. # On OSX, just specifying -P is not enough to do that.
  5962. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  5963. oscmd("mkdir -p dstroot/tools/Developer/Panda3D/bin")
  5964. oscmd("mkdir -p dstroot/tools/Developer/Tools")
  5965. oscmd("ln -s ../Panda3D/bin dstroot/tools/Developer/Tools/Panda3D")
  5966. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  5967. # Trailing newline is important, works around a bug in OSX
  5968. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Panda3D/bin\n")
  5969. oscmd("mkdir -p dstroot/tools/usr/local/share/man/man1")
  5970. oscmd("cp doc/man/*.1 dstroot/tools/usr/local/share/man/man1/")
  5971. for base in os.listdir(GetOutputDir()+"/bin"):
  5972. binname = "dstroot/tools/Developer/Panda3D/bin/" + base
  5973. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  5974. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  5975. if PkgSkip("PYTHON")==0:
  5976. PV = SDK["PYTHONVERSION"].replace("python", "")
  5977. oscmd("mkdir -p dstroot/pythoncode/usr/local/bin")
  5978. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/panda3d")
  5979. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  5980. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D")
  5981. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/pandac" % GetOutputDir())
  5982. oscmd("cp -R %s/direct dstroot/pythoncode/Developer/Panda3D/direct" % GetOutputDir())
  5983. oscmd("ln -s %s dstroot/pythoncode/usr/local/bin/ppython" % SDK["PYTHONEXEC"])
  5984. oscmd("cp -R %s/*.so dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  5985. oscmd("cp -R %s/*.py dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  5986. if os.path.isdir(GetOutputDir()+"/Pmw"):
  5987. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/Pmw" % GetOutputDir())
  5988. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/Pmw")
  5989. WriteFile("dstroot/pythoncode/Developer/Panda3D/direct/__init__.py", "")
  5990. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/direct"):
  5991. if ((base != "extensions") and (base != "extensions_native")):
  5992. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/direct/"+base)
  5993. for base in os.listdir(GetOutputDir()+"/panda3d"):
  5994. if base.endswith('.py') or base.endswith('.so'):
  5995. libname = "dstroot/pythoncode/Developer/Panda3D/panda3d/" + base
  5996. # We really need to specify -R in order not to follow symlinks
  5997. # On OSX, just specifying -P is not enough to do that.
  5998. oscmd("cp -R -P " + GetOutputDir() + "/panda3d/" + base + " " + libname)
  5999. if not PkgSkip("FFMPEG"):
  6000. oscmd("mkdir -p dstroot/ffmpeg/Developer/Panda3D/lib")
  6001. oscmd("cp -R %s/lib/libp3ffmpeg.* dstroot/ffmpeg/Developer/Panda3D/lib/" % GetOutputDir())
  6002. #if not PkgSkip("OPENAL"):
  6003. # oscmd("mkdir -p dstroot/openal/Developer/Panda3D/lib")
  6004. # oscmd("cp -R %s/lib/libp3openal_audio.* dstroot/openal/Developer/Panda3D/lib/" % GetOutputDir())
  6005. if not PkgSkip("FMODEX"):
  6006. oscmd("mkdir -p dstroot/fmodex/Developer/Panda3D/lib")
  6007. oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6008. oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6009. oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib")
  6010. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  6011. if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"):
  6012. oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir())
  6013. if os.path.isdir("samples"):
  6014. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  6015. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  6016. oscmd("chmod -R 0775 dstroot/*")
  6017. DeleteVCS("dstroot")
  6018. DeleteBuildFiles("dstroot")
  6019. # We need to be root to perform a chown. Bleh.
  6020. # Fortunately PackageMaker does it for us, on 10.5 and above.
  6021. #oscmd("chown -R root:admin dstroot/*", True)
  6022. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  6023. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  6024. pkgs = ["base", "tools", "headers"]
  6025. if not PkgSkip("PYTHON"): pkgs.append("pythoncode")
  6026. if not PkgSkip("FFMPEG"): pkgs.append("ffmpeg")
  6027. #if not PkgSkip("OPENAL"): pkgs.append("openal")
  6028. if not PkgSkip("FMODEX"): pkgs.append("fmodex")
  6029. if os.path.isdir("samples"): pkgs.append("samples")
  6030. for pkg in pkgs:
  6031. identifier = "org.panda3d.panda3d.%s.pkg" % pkg
  6032. plist = open("/tmp/Info_plist", "w")
  6033. plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION })
  6034. plist.close()
  6035. if not os.path.isdir("dstroot/" + pkg):
  6036. os.makedirs("dstroot/" + pkg)
  6037. if OSXTARGET and OSXTARGET <= (10, 5):
  6038. target = '--target %d.%d' % (OSXTARGET)
  6039. else:
  6040. target = ''
  6041. if os.path.exists("/usr/bin/pkgbuild"):
  6042. # This new package builder is used in Lion and above.
  6043. cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg'
  6044. # In older versions, we use PackageMaker. Apple keeps changing its location.
  6045. elif os.path.exists("/Developer/usr/bin/packagemaker"):
  6046. 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'
  6047. elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6048. 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'
  6049. elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6050. 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'
  6051. elif os.path.exists("/Developer/Tools/packagemaker"):
  6052. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  6053. elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6054. 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'
  6055. else:
  6056. exit("Neither pkgbuild nor PackageMaker could be found!")
  6057. oscmd(cmd)
  6058. if os.path.isfile("/tmp/Info_plist"):
  6059. oscmd("rm -f /tmp/Info_plist")
  6060. # Now that we've built all of the individual packages, build the metapackage.
  6061. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  6062. dist.write('<?xml version="1.0" encoding="utf-8"?>\n')
  6063. dist.write('<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">\n')
  6064. dist.write(' <title>Panda3D SDK %s</title>\n' % (VERSION))
  6065. dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>\n')
  6066. dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
  6067. dist.write(' <choices-outline>\n')
  6068. for pkg in pkgs:
  6069. dist.write(' <line choice="%s"/>\n' % (pkg))
  6070. dist.write(' </choices-outline>\n')
  6071. 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')
  6072. dist.write(' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>\n')
  6073. dist.write(' </choice>\n')
  6074. 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')
  6075. dist.write(' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>\n')
  6076. dist.write(' </choice>\n')
  6077. if not PkgSkip("PYTHON"):
  6078. 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')
  6079. dist.write(' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>\n')
  6080. dist.write(' </choice>\n')
  6081. if not PkgSkip("FFMPEG"):
  6082. 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.')
  6083. if PkgSkip("VORBIS"):
  6084. dist.write(' It is not required for loading .wav files, which Panda3D can read out of the box.">\n')
  6085. else:
  6086. dist.write(' It is not required for loading .wav or .ogg files, which Panda3D can read out of the box.">\n')
  6087. dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
  6088. dist.write(' </choice>\n')
  6089. #if not PkgSkip("OPENAL"):
  6090. # 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')
  6091. # dist.write(' <pkg-ref id="org.panda3d.panda3d.openal.pkg"/>\n')
  6092. # dist.write(' </choice>\n')
  6093. if not PkgSkip("FMODEX"):
  6094. 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')
  6095. dist.write(' <pkg-ref id="org.panda3d.panda3d.fmodex.pkg"/>\n')
  6096. dist.write(' </choice>\n')
  6097. if os.path.isdir("samples"):
  6098. 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')
  6099. dist.write(' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>\n')
  6100. dist.write(' </choice>\n')
  6101. 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')
  6102. dist.write(' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>\n')
  6103. dist.write(' </choice>\n')
  6104. for pkg in pkgs:
  6105. size = GetDirectorySize("dstroot/" + pkg) // 1024
  6106. 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))
  6107. dist.write('</installer-script>\n')
  6108. dist.close()
  6109. oscmd('hdiutil create Panda3D-rw.dmg -volname "Panda3D SDK %s" -srcfolder dstroot/Panda3D' % (VERSION))
  6110. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o Panda3D-%s.dmg' % (VERSION))
  6111. oscmd('rm -f Panda3D-rw.dmg')
  6112. def MakeInstallerFreeBSD():
  6113. oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
  6114. oscmd("mkdir targetroot")
  6115. # Invoke installpanda.py to install it into a temporary dir
  6116. if RUNTIME:
  6117. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6118. else:
  6119. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6120. if not os.path.exists("/usr/sbin/pkg"):
  6121. exit("Cannot create an installer without pkg")
  6122. plist_txt = ''
  6123. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  6124. for f in files:
  6125. plist_txt += os.path.join(root, f)[21:] + "\n"
  6126. if not RUNTIME:
  6127. plist_txt += "@exec /sbin/ldconfig -m /usr/local/lib\n"
  6128. plist_txt += "@unexec /sbin/ldconfig -R\n"
  6129. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  6130. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  6131. for d in dirs:
  6132. plist_txt += "@dir %s\n" % os.path.join(root, d)[21:]
  6133. plist_txt += "@dir %s\n" % remdir
  6134. oscmd("echo \"`pkg config abi | tr '[:upper:]' '[:lower:]' | cut -d: -f1,2`:*\" > " + GetOutputDir() + "/tmp/architecture.txt")
  6135. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6136. dependencies = ''
  6137. if PkgSkip("PYTHON") == 0:
  6138. # If this version of Python was installed from a package or ports, let's mark it as dependency.
  6139. oscmd("rm -f %s/tmp/python_dep" % GetOutputDir())
  6140. 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)
  6141. if os.path.isfile(GetOutputDir() + "/tmp/python_dep"):
  6142. python_pkg = ReadFile(GetOutputDir() + "/tmp/python_dep")
  6143. if python_pkg:
  6144. dependencies += python_pkg
  6145. manifest_txt = INSTALLER_PKG_MANIFEST_FILE[1:].replace("NAME", 'Panda3D' if not RUNTIME else 'Panda3D-Runtime')
  6146. manifest_txt = manifest_txt.replace("VERSION", VERSION)
  6147. manifest_txt = manifest_txt.replace("ARCH", pkg_arch)
  6148. manifest_txt = manifest_txt.replace("ORIGIN", 'devel/panda3d' if not RUNTIME else 'graphics/panda3d-runtime')
  6149. manifest_txt = manifest_txt.replace("DEPENDS", dependencies)
  6150. manifest_txt = manifest_txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024 / 1024))
  6151. WriteFile("pkg-plist", plist_txt)
  6152. WriteFile("+DESC", INSTALLER_PKG_DESCR_FILE[1:] if not RUNTIME else RUNTIME_INSTALLER_PKG_DESCR_FILE[1:])
  6153. WriteFile("+MANIFEST", manifest_txt)
  6154. oscmd("pkg create -p pkg-plist -r %s -m . -o . %s" % (os.path.abspath("targetroot"), "--verbose" if GetVerbose() else "--quiet"))
  6155. try:
  6156. if INSTALLER:
  6157. ProgressOutput(100.0, "Building installer")
  6158. target = GetTarget()
  6159. if target == 'windows':
  6160. fn = "Panda3D-"
  6161. dir = "C:\\Panda3D-" + VERSION
  6162. if RUNTIME:
  6163. fn += "Runtime-"
  6164. title = "Panda3D " + VERSION
  6165. else:
  6166. title = "Panda3D SDK " + VERSION
  6167. fn += VERSION
  6168. if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7":
  6169. fn += '-py' + SDK["PYTHONVERSION"][6:]
  6170. if GetOptimize() <= 2:
  6171. fn += "-dbg"
  6172. if GetTargetArch() == 'x64':
  6173. fn += '-x64'
  6174. dir += '-x64'
  6175. fn += '.exe'
  6176. MakeInstallerNSIS(fn, title, dir)
  6177. elif (target == 'linux'):
  6178. MakeInstallerLinux()
  6179. elif (target == 'darwin'):
  6180. MakeInstallerOSX()
  6181. elif (target == 'freebsd'):
  6182. MakeInstallerFreeBSD()
  6183. else:
  6184. exit("Do not know how to make an installer for this platform")
  6185. finally:
  6186. SaveDependencyCache()
  6187. ##########################################################################################
  6188. #
  6189. # Print final status report.
  6190. #
  6191. ##########################################################################################
  6192. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6193. printStatus("Makepanda Final Status Report", WARNINGS)
  6194. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())