makepanda.py 301 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as queue
  18. except KeyboardInterrupt:
  19. raise
  20. except:
  21. print("You are either using an incomplete or an old version of Python!")
  22. print("Please install the development package of Python and try again.")
  23. exit(1)
  24. from makepandacore import *
  25. from distutils.util import get_platform
  26. import time
  27. import os
  28. import sys
  29. ########################################################################
  30. ##
  31. ## PARSING THE COMMAND LINE OPTIONS
  32. ##
  33. ## You might be tempted to change the defaults by editing them
  34. ## here. Don't do it. Instead, create a script that compiles
  35. ## panda with your preferred options. Or, create
  36. ## a 'makepandaPreferences' file and put it into your python path.
  37. ##
  38. ########################################################################
  39. COMPILER=0
  40. INSTALLER=0
  41. WHEEL=0
  42. RUNTESTS=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. CXXFLAGS=""
  48. LDFLAGS=""
  49. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMRELEASE="1"
  57. GIT_COMMIT=None
  58. P3DSUFFIX=None
  59. MAJOR_VERSION=None
  60. COREAPI_VERSION=None
  61. PLUGIN_VERSION=None
  62. OSXTARGET=None
  63. OSX_ARCHS=[]
  64. HOST_URL=None
  65. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  66. STRDXSDKVERSION = 'default'
  67. WINDOWS_SDK = None
  68. MSVC_VERSION = None
  69. BOOUSEINTELCOMPILER = False
  70. OPENCV_VER_23 = False
  71. PLATFORM = None
  72. COPY_PYTHON = True
  73. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  74. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  75. PkgListSet(["PYTHON", "DIRECT", # Python support
  76. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  77. "EGL", # OpenGL (ES) integration
  78. "EIGEN", # Linear algebra acceleration
  79. "OPENAL", "FMODEX", # Audio playback
  80. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  81. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  82. "SPEEDTREE", # SpeedTree
  83. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  84. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  85. "FREETYPE", "HARFBUZZ", # Text rendering
  86. "VRPN", "OPENSSL", # Transport
  87. "FFTW", # Algorithm helpers
  88. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  89. "GTK2", # GTK2 is used for PStats on Unix
  90. "MFC", "WX", "FLTK", # Used for web plug-in only
  91. "ROCKET", # GUI libraries
  92. "CARBON", "COCOA", # Mac OS X toolkits
  93. "X11", # Unix platform support
  94. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  95. "SKEL", # Example SKEL project
  96. "PANDAFX", # Some distortion special lenses
  97. "PANDAPARTICLESYSTEM", # Built in particle system
  98. "CONTRIB", # Experimental
  99. "SSE2", "NEON", # Compiler features
  100. ])
  101. CheckPandaSourceTree()
  102. def keyboardInterruptHandler(x,y):
  103. exit("keyboard interrupt")
  104. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  105. ########################################################################
  106. ##
  107. ## Command-line parser.
  108. ##
  109. ## You can type "makepanda --help" to see all the options.
  110. ##
  111. ########################################################################
  112. def usage(problem):
  113. if (problem):
  114. print("")
  115. print("Error parsing command-line input: %s" % (problem))
  116. print("")
  117. print("Makepanda generates a 'built' subdirectory containing a")
  118. print("compiled copy of Panda3D. Command-line arguments are:")
  119. print("")
  120. print(" --help (print the help message you're reading now)")
  121. print(" --verbose (print out more information)")
  122. print(" --runtime (build a runtime build instead of an SDK build)")
  123. print(" --tests (run the test suite)")
  124. print(" --installer (build an installer)")
  125. print(" --wheel (build a pip-installable .whl)")
  126. print(" --optimize X (optimization level can be 1,2,3,4)")
  127. print(" --version X (set the panda version number)")
  128. print(" --lzma (use lzma compression when building Windows installer)")
  129. print(" --distributor X (short string identifying the distributor of the build)")
  130. print(" --outputdir X (use the specified directory instead of 'built')")
  131. print(" --host URL (set the host url (runtime build only))")
  132. print(" --threads N (use the multithreaded build system. see manual)")
  133. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  134. print(" --universal (build universal binaries (OS X only))")
  135. print(" --override \"O=V\" (override dtool_config/prc option value)")
  136. print(" --static (builds libraries for static linking)")
  137. print(" --target X (experimental cross-compilation (android only))")
  138. print(" --arch X (target architecture for cross-compilation)")
  139. print("")
  140. for pkg in PkgListGet():
  141. p = pkg.lower()
  142. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  143. if sys.platform != 'win32':
  144. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  145. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  146. print("")
  147. print(" --nothing (disable every third-party lib)")
  148. print(" --everything (enable every third-party lib)")
  149. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  150. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  151. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)")
  152. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  153. print("")
  154. print("The simplest way to compile panda is to just type:")
  155. print("")
  156. print(" makepanda --everything")
  157. print("")
  158. os._exit(1)
  159. def parseopts(args):
  160. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  161. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  162. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  163. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  164. global COPY_PYTHON
  165. # Options for which to display a deprecation warning.
  166. removedopts = [
  167. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  168. ]
  169. # All recognized options.
  170. longopts = [
  171. "help","distributor=","verbose","runtime","osxtarget=","tests",
  172. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  173. "version=","lzma","no-python","threads=","outputdir=","override=",
  174. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  175. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  176. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  177. ] + removedopts
  178. anything = 0
  179. optimize = ""
  180. target = None
  181. target_arch = None
  182. universal = False
  183. clean_build = False
  184. for pkg in PkgListGet():
  185. longopts.append("use-" + pkg.lower())
  186. longopts.append("no-" + pkg.lower())
  187. longopts.append(pkg.lower() + "-incdir=")
  188. longopts.append(pkg.lower() + "-libdir=")
  189. try:
  190. opts, extras = getopt.getopt(args, "", longopts)
  191. for option, value in opts:
  192. if (option=="--help"): raise Exception
  193. elif (option=="--optimize"): optimize=value
  194. elif (option=="--installer"): INSTALLER=1
  195. elif (option=="--tests"): RUNTESTS=1
  196. elif (option=="--wheel"): WHEEL=1
  197. elif (option=="--verbose"): SetVerbose(True)
  198. elif (option=="--distributor"): DISTRIBUTOR=value
  199. elif (option=="--rtdist"): RTDIST=1
  200. elif (option=="--runtime"): RUNTIME=1
  201. elif (option=="--genman"): GENMAN=1
  202. elif (option=="--everything"): PkgEnableAll()
  203. elif (option=="--nothing"): PkgDisableAll()
  204. elif (option=="--threads"): THREADCOUNT=int(value)
  205. elif (option=="--outputdir"): SetOutputDir(value.strip())
  206. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  207. elif (option=="--universal"): universal = True
  208. elif (option=="--target"): target = value.strip()
  209. elif (option=="--arch"): target_arch = value.strip()
  210. elif (option=="--nocolor"): DisableColors()
  211. elif (option=="--version"):
  212. match = re.match(r'^\d+\.\d+\.\d+', value)
  213. if not match:
  214. usage("version requires three digits")
  215. WHLVERSION = value
  216. VERSION = match.group()
  217. elif (option=="--lzma"): COMPRESSOR="lzma"
  218. elif (option=="--override"): AddOverride(value.strip())
  219. elif (option=="--static"): SetLinkAllStatic(True)
  220. elif (option=="--host"): HOST_URL=value
  221. elif (option=="--debversion"): DEBVERSION=value
  222. elif (option=="--rpmrelease"): RPMRELEASE=value
  223. elif (option=="--git-commit"): GIT_COMMIT=value
  224. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  225. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  226. # Backward compatibility, OPENGL was renamed to GL
  227. elif (option=="--use-opengl"): PkgEnable("GL")
  228. elif (option=="--no-opengl"): PkgDisable("GL")
  229. elif (option=="--directx-sdk"):
  230. STRDXSDKVERSION = value.strip().lower()
  231. if STRDXSDKVERSION == '':
  232. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  233. STRDXSDKVERSION = 'default'
  234. elif (option=="--windows-sdk"):
  235. WINDOWS_SDK = value.strip().lower()
  236. elif (option=="--msvc-version"):
  237. MSVC_VERSION = value.strip().lower()
  238. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  239. elif (option=="--clean"): clean_build = True
  240. elif (option=="--no-copy-python"): COPY_PYTHON = False
  241. elif (option[2:] in removedopts):
  242. Warn("Ignoring removed option %s" % (option))
  243. else:
  244. for pkg in PkgListGet():
  245. if option == "--use-" + pkg.lower():
  246. PkgEnable(pkg)
  247. break
  248. elif option == "--no-" + pkg.lower():
  249. PkgDisable(pkg)
  250. break
  251. elif option == "--" + pkg.lower() + "-incdir":
  252. PkgSetCustomLocation(pkg)
  253. IncDirectory(pkg, value)
  254. break
  255. elif option == "--" + pkg.lower() + "-libdir":
  256. PkgSetCustomLocation(pkg)
  257. LibDirectory(pkg, value)
  258. break
  259. if (option == "--everything" or option.startswith("--use-")
  260. or option == "--nothing" or option.startswith("--no-")):
  261. anything = 1
  262. except:
  263. usage(sys.exc_info()[1])
  264. if not anything:
  265. if RUNTIME:
  266. PkgEnableAll()
  267. else:
  268. usage("You should specify a list of packages to use or --everything to enable all packages.")
  269. if (RTDIST and RUNTIME):
  270. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  271. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  272. elif (optimize==""): optimize = "3"
  273. if OSXTARGET:
  274. try:
  275. maj, min = OSXTARGET.strip().split('.')
  276. OSXTARGET = int(maj), int(min)
  277. assert OSXTARGET[0] == 10
  278. except:
  279. usage("Invalid setting for OSXTARGET")
  280. else:
  281. OSXTARGET = None
  282. if target is not None or target_arch is not None:
  283. SetTarget(target, target_arch)
  284. if universal:
  285. if target_arch:
  286. exit("--universal is incompatible with --arch")
  287. OSX_ARCHS.append("i386")
  288. if OSXTARGET:
  289. osxver = OSXTARGET
  290. else:
  291. maj, min = platform.mac_ver()[0].split('.')[:2]
  292. osxver = int(maj), int(min)
  293. if osxver[1] < 6:
  294. OSX_ARCHS.append("ppc")
  295. else:
  296. OSX_ARCHS.append("x86_64")
  297. elif HasTargetArch():
  298. OSX_ARCHS.append(GetTargetArch())
  299. try:
  300. SetOptimize(int(optimize))
  301. assert GetOptimize() in [1, 2, 3, 4]
  302. except:
  303. usage("Invalid setting for OPTIMIZE")
  304. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  305. usage("Invalid SHA-1 hash given for --git-commit option!")
  306. if GetTarget() == 'windows':
  307. if not MSVC_VERSION:
  308. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  309. MSVC_VERSION = (14, 0)
  310. else:
  311. try:
  312. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  313. if (len(MSVC_VERSION) == 1):
  314. MSVC_VERSION += (0,)
  315. except:
  316. usage("Invalid setting for --msvc-version")
  317. if MSVC_VERSION < (14, 0):
  318. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  319. print("=========================================================================")
  320. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  321. print(warn_prefix + "For more information, or any questions, please visit:")
  322. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  323. print("=========================================================================")
  324. sys.stdout.flush()
  325. time.sleep(1.0)
  326. sys.exit(1)
  327. if not WINDOWS_SDK:
  328. print("No Windows SDK version specified. Defaulting to '7.1'.")
  329. WINDOWS_SDK = '7.1'
  330. if clean_build and os.path.isdir(GetOutputDir()):
  331. print("Deleting %s" % (GetOutputDir()))
  332. shutil.rmtree(GetOutputDir())
  333. parseopts(sys.argv[1:])
  334. ########################################################################
  335. ##
  336. ## Handle environment variables.
  337. ##
  338. ########################################################################
  339. if ("CFLAGS" in os.environ):
  340. CFLAGS = os.environ["CFLAGS"].strip()
  341. if ("CXXFLAGS" in os.environ):
  342. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  343. if ("RPM_OPT_FLAGS" in os.environ):
  344. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  345. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  346. if ("LDFLAGS" in os.environ):
  347. LDFLAGS = os.environ["LDFLAGS"].strip()
  348. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  349. if GetHost() == "darwin" and OSXTARGET is not None:
  350. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  351. ########################################################################
  352. ##
  353. ## Configure things based on the command-line parameters.
  354. ##
  355. ########################################################################
  356. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  357. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  358. if VERSION is None:
  359. if RUNTIME:
  360. VERSION = PLUGIN_VERSION
  361. else:
  362. # Take the value from the setup.cfg file.
  363. VERSION = GetMetadataValue('version')
  364. if WHLVERSION is None:
  365. WHLVERSION = VERSION
  366. print("Version: %s" % VERSION)
  367. if RUNTIME or RTDIST:
  368. print("Core API Version: %s" % COREAPI_VERSION)
  369. if DEBVERSION is None:
  370. DEBVERSION = VERSION
  371. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  372. if P3DSUFFIX is None:
  373. P3DSUFFIX = MAJOR_VERSION
  374. # Now determine the distutils-style platform tag for the target system.
  375. target = GetTarget()
  376. if target == 'windows':
  377. if GetTargetArch() == 'x64':
  378. PLATFORM = 'win-amd64'
  379. else:
  380. PLATFORM = 'win32'
  381. elif target == 'darwin':
  382. if OSXTARGET:
  383. osxver = OSXTARGET
  384. else:
  385. maj, min = platform.mac_ver()[0].split('.')[:2]
  386. osxver = int(maj), int(min)
  387. arch_tag = None
  388. if not OSX_ARCHS:
  389. arch_tag = GetTargetArch()
  390. elif len(OSX_ARCHS) == 1:
  391. arch_tag = OSX_ARCHS[0]
  392. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  393. arch_tag = 'fat'
  394. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  395. arch_tag = 'intel'
  396. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  397. arch_tag = 'fat64'
  398. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  399. arch_tag = 'fat32'
  400. else:
  401. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  402. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  403. elif target == 'linux' and (os.path.isfile("/lib/libc-2.5.so") or os.path.isfile("/lib64/libc-2.5.so")) and os.path.isdir("/opt/python"):
  404. # This is manylinux1. A bit of a sloppy check, though.
  405. if GetTargetArch() in ('x86_64', 'amd64'):
  406. PLATFORM = 'manylinux1-x86_64'
  407. else:
  408. PLATFORM = 'manylinux1-i686'
  409. elif not CrossCompiling():
  410. if HasTargetArch():
  411. # Replace the architecture in the platform string.
  412. platform_parts = get_platform().rsplit('-', 1)
  413. target_arch = GetTargetArch()
  414. if target_arch == 'amd64':
  415. target_arch = 'x86_64'
  416. PLATFORM = platform_parts[0] + '-' + target_arch
  417. else:
  418. # We're not cross-compiling; just take the host arch.
  419. PLATFORM = get_platform()
  420. else:
  421. target_arch = GetTargetArch()
  422. if target_arch == 'amd64':
  423. target_arch = 'x86_64'
  424. PLATFORM = '{0}-{1}'.format(target, target_arch)
  425. print("Platform: %s" % PLATFORM)
  426. outputdir_suffix = ""
  427. if (RUNTIME or RTDIST):
  428. # Compiling Maya/Max is pointless in rtdist build
  429. for ver in MAYAVERSIONS + MAXVERSIONS:
  430. PkgDisable(ver)
  431. if (DISTRIBUTOR.strip() == ""):
  432. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  433. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  434. if (RUNTIME):
  435. outputdir_suffix += "_rt"
  436. if DISTRIBUTOR == "":
  437. DISTRIBUTOR = "makepanda"
  438. elif not RTDIST_VERSION:
  439. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  440. if not RTDIST_VERSION:
  441. RTDIST_VERSION = "dev"
  442. if not IsCustomOutputDir():
  443. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  444. outputdir_suffix += '_x64'
  445. SetOutputDir("built" + outputdir_suffix)
  446. if (RUNTIME):
  447. for pkg in PkgListGet():
  448. if pkg in ["GTK2", "MFC"]:
  449. # Optional package(s) for runtime.
  450. pass
  451. elif pkg in ["OPENSSL", "ZLIB"]:
  452. # Required packages for runtime.
  453. if (PkgSkip(pkg)==1):
  454. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  455. else:
  456. # Unused packages for runtime.
  457. PkgDisable(pkg)
  458. if (INSTALLER and RTDIST):
  459. exit("Cannot build an installer for the rtdist build!")
  460. if (WHEEL and RUNTIME):
  461. exit("Cannot build a wheel for the runtime build!")
  462. if (WHEEL and RTDIST):
  463. exit("Cannot build a wheel for the rtdist build!")
  464. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  465. exit("Cannot build installer on Windows without python")
  466. if WHEEL and PkgSkip("PYTHON"):
  467. exit("Cannot build wheel without Python")
  468. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  469. exit("Cannot build rtdist without wx or fltk")
  470. if (RUNTIME):
  471. SetLinkAllStatic(True)
  472. if not os.path.isdir("contrib"):
  473. PkgDisable("CONTRIB")
  474. ########################################################################
  475. ##
  476. ## Load the dependency cache.
  477. ##
  478. ########################################################################
  479. LoadDependencyCache()
  480. ########################################################################
  481. ##
  482. ## Locate various SDKs.
  483. ##
  484. ########################################################################
  485. MakeBuildTree()
  486. SdkLocateDirectX(STRDXSDKVERSION)
  487. SdkLocateMaya()
  488. SdkLocateMax()
  489. SdkLocateMacOSX(OSXTARGET)
  490. SdkLocatePython(RTDIST)
  491. SdkLocateWindows(WINDOWS_SDK)
  492. SdkLocatePhysX()
  493. SdkLocateSpeedTree()
  494. SdkLocateAndroid()
  495. SdkAutoDisableDirectX()
  496. SdkAutoDisableMaya()
  497. SdkAutoDisableMax()
  498. SdkAutoDisablePhysX()
  499. SdkAutoDisableSpeedTree()
  500. if RTDIST and DISTRIBUTOR == "cmu":
  501. # Some validation checks for the CMU builds.
  502. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  503. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  504. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  505. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  506. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  507. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  508. if RTDIST and not HOST_URL:
  509. exit("You must specify a host URL when building the rtdist!")
  510. if RUNTIME and not HOST_URL:
  511. # Set this to a nice default.
  512. HOST_URL = "https://runtime.panda3d.org/"
  513. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  514. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  515. print("=========================================================================")
  516. print(warn_prefix + "Python 2.7 will reach EOL after December 31, 2019, and will not")
  517. print(warn_prefix + "be supported after that date. Please ensure you are prepared")
  518. print(warn_prefix + "by planning your upgrade to Python 3 now.")
  519. print("=========================================================================")
  520. sys.stdout.flush()
  521. # Give the user some time to contemplate their sins
  522. time.sleep(6.0)
  523. ########################################################################
  524. ##
  525. ## Choose a Compiler.
  526. ##
  527. ## This should also set up any environment variables needed to make
  528. ## the compiler work.
  529. ##
  530. ########################################################################
  531. if GetHost() == 'windows' and GetTarget() == 'windows':
  532. COMPILER = "MSVC"
  533. SdkLocateVisualStudio(MSVC_VERSION)
  534. else:
  535. COMPILER = "GCC"
  536. SetupBuildEnvironment(COMPILER)
  537. ########################################################################
  538. ##
  539. ## External includes, external libraries, and external defsyms.
  540. ##
  541. ########################################################################
  542. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  543. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  544. if (COMPILER == "MSVC"):
  545. PkgDisable("X11")
  546. PkgDisable("GLES")
  547. PkgDisable("GLES2")
  548. PkgDisable("EGL")
  549. PkgDisable("CARBON")
  550. PkgDisable("COCOA")
  551. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  552. if (PkgSkip("PYTHON")==0):
  553. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  554. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  555. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  556. for pkg in PkgListGet():
  557. if (PkgSkip(pkg)==0):
  558. if (pkg[:4]=="MAYA"):
  559. IncDirectory(pkg, SDK[pkg] + "/include")
  560. DefSymbol(pkg, "MAYAVERSION", pkg)
  561. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  562. elif (pkg[:3]=="MAX"):
  563. IncDirectory(pkg, SDK[pkg] + "/include")
  564. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  565. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  566. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  567. DefSymbol(pkg, "MAX", pkg)
  568. if (int(pkg[3:]) >= 2013):
  569. DefSymbol(pkg, "UNICODE", "")
  570. DefSymbol(pkg, "_UNICODE", "")
  571. elif (pkg[:2]=="DX"):
  572. IncDirectory(pkg, SDK[pkg] + "/include")
  573. elif GetThirdpartyDir() is not None:
  574. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  575. for pkg in DXVERSIONS:
  576. if (PkgSkip(pkg)==0):
  577. vnum=pkg[2:]
  578. if GetTargetArch() == 'x64':
  579. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  580. else:
  581. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  582. LibDirectory(pkg, SDK[pkg] + '/lib')
  583. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  584. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  585. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  586. LibName(pkg, 'dxerr.lib')
  587. else:
  588. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  589. #LibName(pkg, 'ddraw.lib')
  590. LibName(pkg, 'dxguid.lib')
  591. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  592. # dxerr needs this for __vsnwprintf definition.
  593. LibName(pkg, 'legacy_stdio_definitions.lib')
  594. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  595. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  596. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  597. LibName("WINSOCK", "wsock32.lib")
  598. LibName("WINSOCK2", "wsock32.lib")
  599. LibName("WINSOCK2", "ws2_32.lib")
  600. LibName("WINCOMCTL", "comctl32.lib")
  601. LibName("WINCOMDLG", "comdlg32.lib")
  602. LibName("WINUSER", "user32.lib")
  603. LibName("WINMM", "winmm.lib")
  604. LibName("WINIMM", "imm32.lib")
  605. LibName("WINKERNEL", "kernel32.lib")
  606. LibName("WINOLE", "ole32.lib")
  607. LibName("WINOLEAUT", "oleaut32.lib")
  608. LibName("WINOLDNAMES", "oldnames.lib")
  609. LibName("WINSHELL", "shell32.lib")
  610. LibName("WINGDI", "gdi32.lib")
  611. LibName("ADVAPI", "advapi32.lib")
  612. LibName("IPHLPAPI", "iphlpapi.lib")
  613. LibName("SETUPAPI", "setupapi.lib")
  614. LibName("GL", "opengl32.lib")
  615. LibName("GLES", "libgles_cm.lib")
  616. LibName("GLES2", "libGLESv2.lib")
  617. LibName("EGL", "libEGL.lib")
  618. LibName("MSIMG", "msimg32.lib")
  619. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  620. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  621. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  622. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  623. if (PkgSkip("OPENSSL")==0):
  624. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  625. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  626. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  627. else:
  628. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  629. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  630. if (PkgSkip("PNG")==0):
  631. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  632. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  633. else:
  634. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  635. if (PkgSkip("TIFF")==0):
  636. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  637. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  638. else:
  639. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  640. if (PkgSkip("OPENEXR")==0):
  641. suffix = ""
  642. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  643. suffix = "-2_2"
  644. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  645. suffix = "-2_3"
  646. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  647. suffix += "_s"
  648. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  649. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  650. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  651. if suffix == "-2_2":
  652. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  653. else:
  654. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  655. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  656. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  657. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  658. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  659. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  660. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  661. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  662. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  663. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  664. if (PkgSkip("HARFBUZZ")==0):
  665. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  666. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  667. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  668. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  669. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  670. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  671. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  672. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  673. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  674. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  675. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  676. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  677. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  678. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  679. if (PkgSkip("FCOLLADA")==0):
  680. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  681. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  682. if (PkgSkip("ASSIMP")==0):
  683. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  684. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  685. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  686. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  687. if (PkgSkip("SQUISH")==0):
  688. if GetOptimize() <= 2:
  689. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  690. else:
  691. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  692. if (PkgSkip("ROCKET")==0):
  693. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  694. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  695. if (PkgSkip("PYTHON")==0):
  696. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  697. if (GetOptimize() <= 3):
  698. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  699. if (PkgSkip("OPENAL")==0):
  700. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  701. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  702. # Link OpenAL Soft statically.
  703. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  704. if (PkgSkip("ODE")==0):
  705. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  706. DefSymbol("ODE", "dSINGLE", "")
  707. if (PkgSkip("FMODEX")==0):
  708. if (GetTargetArch() == 'x64'):
  709. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  710. else:
  711. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  712. if (PkgSkip("FLTK")==0 and RTDIST):
  713. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  714. if not PkgSkip("FLTK"):
  715. # If we have fltk, we don't need wx
  716. PkgDisable("WX")
  717. if (PkgSkip("WX")==0 and RTDIST):
  718. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  719. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  720. DefSymbol("WX", "__WXMSW__", "")
  721. DefSymbol("WX", "_UNICODE", "")
  722. DefSymbol("WX", "UNICODE", "")
  723. if (PkgSkip("VORBIS")==0):
  724. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  725. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  726. if not os.path.isfile(path):
  727. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  728. LibName("VORBIS", path)
  729. if (PkgSkip("OPUS")==0):
  730. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  731. for lib in ('ogg', 'opus', 'opusfile'):
  732. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  733. if not os.path.isfile(path):
  734. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  735. LibName("OPUS", path)
  736. for pkg in MAYAVERSIONS:
  737. if (PkgSkip(pkg)==0):
  738. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  739. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  740. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  741. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  742. for pkg in MAXVERSIONS:
  743. if (PkgSkip(pkg)==0):
  744. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  745. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  746. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  747. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  748. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  749. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  750. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  751. if (PkgSkip("PHYSX")==0):
  752. if GetTargetArch() == 'x64':
  753. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  754. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  755. else:
  756. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  757. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  758. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  759. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  760. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  761. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  762. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  763. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  764. if (PkgSkip("SPEEDTREE")==0):
  765. if GetTargetArch() == 'x64':
  766. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  767. p64ext = '64'
  768. else:
  769. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  770. p64ext = ''
  771. debugext = ''
  772. if (GetOptimize() <= 2): debugext = "_d"
  773. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  774. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  775. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  776. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  777. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  778. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  779. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  780. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  781. LibName("SPEEDTREE", "glu32.lib")
  782. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  783. if (PkgSkip("BULLET")==0):
  784. suffix = '.lib'
  785. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  786. suffix = '_x64.lib'
  787. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  788. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  789. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  790. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  791. if (COMPILER=="GCC"):
  792. if GetTarget() != "darwin":
  793. PkgDisable("CARBON")
  794. PkgDisable("COCOA")
  795. elif RUNTIME:
  796. # We don't support Cocoa in the runtime yet.
  797. PkgDisable("COCOA")
  798. if 'x86_64' in OSX_ARCHS:
  799. # 64-bits OS X doesn't have Carbon.
  800. PkgDisable("CARBON")
  801. #if (PkgSkip("PYTHON")==0):
  802. # IncDirectory("PYTHON", SDK["PYTHON"])
  803. if (GetHost() == "darwin"):
  804. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  805. IncDirectory("FREETYPE", "/usr/X11/include")
  806. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  807. LibDirectory("FREETYPE", "/usr/X11/lib")
  808. if (GetHost() == "freebsd"):
  809. IncDirectory("ALWAYS", "/usr/local/include")
  810. LibDirectory("ALWAYS", "/usr/local/lib")
  811. if (os.path.isdir("/usr/PCBSD")):
  812. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  813. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  814. if GetTarget() != "windows":
  815. PkgDisable("DIRECTCAM")
  816. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  817. # WARNING! The order of the ffmpeg libraries matters!
  818. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  819. assimp_libs = ("libassimp", "libassimpd")
  820. # Name pkg-config libs, include(dir)s
  821. if (not RUNTIME):
  822. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  823. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  824. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  825. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  826. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  827. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  828. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  829. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  830. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  831. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  832. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  833. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  834. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  835. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  836. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  837. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  838. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  839. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  840. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  841. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  842. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  843. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  844. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  845. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  846. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  847. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  848. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  849. if not PkgSkip("FFMPEG"):
  850. if GetTarget() == "darwin":
  851. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  852. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  853. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  854. # Needed when linking ffmpeg statically on Linux.
  855. LibName("FFMPEG", "-Wl,-Bsymbolic")
  856. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  857. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  858. if cv_lib == "opencv_core":
  859. OPENCV_VER_23 = True
  860. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  861. else:
  862. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  863. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  864. else:
  865. PkgDisable("OPENCV")
  866. if not PkgSkip("ASSIMP") and \
  867. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  868. # Also pick up IrrXML, which is needed when linking statically.
  869. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  870. if os.path.isfile(irrxml):
  871. LibName("ASSIMP", irrxml)
  872. rocket_libs = ("RocketCore", "RocketControls")
  873. if (GetOptimize() <= 3):
  874. rocket_libs += ("RocketDebugger",)
  875. rocket_libs += ("boost_python",)
  876. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  877. if not PkgSkip("PYTHON"):
  878. python_lib = SDK["PYTHONVERSION"]
  879. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  880. if GetTarget() == "linux":
  881. LibName("PYTHON", "-lutil")
  882. LibName("PYTHON", "-lrt")
  883. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  884. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  885. SmartPkgEnable("GTK2", "gtk+-2.0")
  886. if (RTDIST):
  887. SmartPkgEnable("WX", tool = "wx-config")
  888. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  889. if GetTarget() != 'darwin':
  890. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  891. if not PkgSkip("NVIDIACG") and not RUNTIME:
  892. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  893. if not RUNTIME:
  894. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  895. if GetHost() != "darwin":
  896. # Workaround for an issue where pkg-config does not include this path
  897. if GetTargetArch() in ("x86_64", "amd64"):
  898. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  899. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  900. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  901. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  902. if not PkgSkip("X11"):
  903. if (os.path.isdir("/usr/X11R6/lib64")):
  904. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  905. else:
  906. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  907. elif not PkgSkip("X11"):
  908. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  909. if RUNTIME:
  910. # For the runtime, these packages are required
  911. for pkg in ["OPENSSL", "ZLIB"]:
  912. skips = []
  913. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  914. skips.append(pkg)
  915. if skips:
  916. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  917. for pkg in MAYAVERSIONS:
  918. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  919. if (GetHost() == "darwin"):
  920. # Sheesh, Autodesk really can't make up their mind
  921. # regarding the location of the Maya devkit on OS X.
  922. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  923. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  924. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  925. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  926. if (os.path.isdir(SDK[pkg] + "/lib")):
  927. LibDirectory(pkg, SDK[pkg] + "/lib")
  928. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  929. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  930. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  931. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  932. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  933. IncDirectory(pkg, SDK[pkg] + "/include")
  934. else:
  935. LibDirectory(pkg, SDK[pkg] + "/lib")
  936. IncDirectory(pkg, SDK[pkg] + "/include")
  937. DefSymbol(pkg, "MAYAVERSION", pkg)
  938. if GetTarget() == 'darwin':
  939. LibName("ALWAYS", "-framework AppKit")
  940. LibName("AGL", "-framework AGL")
  941. LibName("CARBON", "-framework Carbon")
  942. LibName("COCOA", "-framework Cocoa")
  943. # Fix for a bug in OSX Leopard:
  944. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  945. if GetTarget() == 'android':
  946. LibName("ALWAYS", '-llog')
  947. LibName("ANDROID", '-landroid')
  948. LibName("JNIGRAPHICS", '-ljnigraphics')
  949. for pkg in MAYAVERSIONS:
  950. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  951. if GetTarget() == 'darwin':
  952. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  953. else:
  954. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  955. LibName(pkg, "-lOpenMaya")
  956. LibName(pkg, "-lOpenMayaAnim")
  957. LibName(pkg, "-lAnimSlice")
  958. LibName(pkg, "-lDeformSlice")
  959. LibName(pkg, "-lModifiers")
  960. LibName(pkg, "-lDynSlice")
  961. LibName(pkg, "-lKinSlice")
  962. LibName(pkg, "-lModelSlice")
  963. LibName(pkg, "-lNurbsSlice")
  964. LibName(pkg, "-lPolySlice")
  965. LibName(pkg, "-lProjectSlice")
  966. LibName(pkg, "-lImage")
  967. LibName(pkg, "-lShared")
  968. LibName(pkg, "-lTranslators")
  969. LibName(pkg, "-lDataModel")
  970. LibName(pkg, "-lRenderModel")
  971. LibName(pkg, "-lNurbsEngine")
  972. LibName(pkg, "-lDependEngine")
  973. LibName(pkg, "-lCommandEngine")
  974. LibName(pkg, "-lFoundation")
  975. LibName(pkg, "-lIMFbase")
  976. if GetTarget() != 'darwin':
  977. LibName(pkg, "-lOpenMayalib")
  978. else:
  979. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  980. if (PkgSkip("PHYSX")==0):
  981. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  982. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  983. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  984. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  985. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  986. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  987. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  988. if (GetHost() == "darwin"):
  989. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  990. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  991. else:
  992. LibName("PHYSX", "-lPhysXLoader")
  993. LibName("PHYSX", "-lNxCharacter")
  994. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  995. if GetLinkAllStatic():
  996. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  997. if GetTarget() == 'android':
  998. DefSymbol("ALWAYS", "ANDROID")
  999. if not PkgSkip("EIGEN"):
  1000. if GetOptimize() >= 3:
  1001. if COMPILER == "MSVC":
  1002. # Squeeze out a bit more performance on MSVC builds...
  1003. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1004. # will turn them into runtime assertions.
  1005. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1006. ########################################################################
  1007. ##
  1008. ## Give a Status Report on Command-Line Options
  1009. ##
  1010. ########################################################################
  1011. def printStatus(header,warnings):
  1012. if GetVerbose():
  1013. print("")
  1014. print("-------------------------------------------------------------------")
  1015. print(header)
  1016. tkeep = ""
  1017. tomit = ""
  1018. for x in PkgListGet():
  1019. if PkgSkip(x):
  1020. tomit = tomit + x + " "
  1021. else:
  1022. tkeep = tkeep + x + " "
  1023. if RTDIST:
  1024. print("Makepanda: Runtime distribution build")
  1025. elif RUNTIME:
  1026. print("Makepanda: Runtime build")
  1027. else:
  1028. print("Makepanda: Regular build")
  1029. print("Makepanda: Compiler: %s" % (COMPILER))
  1030. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1031. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1032. print("Makepanda: Omit Pkg: %s" % (tomit))
  1033. if GENMAN:
  1034. print("Makepanda: Generate API reference manual")
  1035. else:
  1036. print("Makepanda: Don't generate API reference manual")
  1037. if GetHost() == "windows" and not RTDIST:
  1038. if INSTALLER:
  1039. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1040. else:
  1041. print("Makepanda: Don't build installer")
  1042. print("Makepanda: Version ID: %s" % (VERSION))
  1043. for x in warnings:
  1044. print("Makepanda: %s" % (x))
  1045. print("-------------------------------------------------------------------")
  1046. print("")
  1047. sys.stdout.flush()
  1048. ########################################################################
  1049. ##
  1050. ## BracketNameWithQuotes
  1051. ##
  1052. ########################################################################
  1053. def BracketNameWithQuotes(name):
  1054. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1055. if (name.startswith("-framework")): return name
  1056. if (name.startswith("-dylib_file")): return name
  1057. # Don't add quotes when it's not necessary.
  1058. if " " not in name: return name
  1059. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1060. if (name.startswith('"') and name.endswith('"')): return name
  1061. else: return '"' + name + '"'
  1062. ########################################################################
  1063. ##
  1064. ## CompileCxx
  1065. ##
  1066. ########################################################################
  1067. def CompileCxx(obj,src,opts):
  1068. ipath = GetListOption(opts, "DIR:")
  1069. optlevel = GetOptimizeOption(opts)
  1070. if (COMPILER=="MSVC"):
  1071. if not BOOUSEINTELCOMPILER:
  1072. cmd = "cl "
  1073. if GetTargetArch() == 'x64':
  1074. cmd += "/favor:blend "
  1075. cmd += "/wd4996 /wd4275 /wd4273 "
  1076. # We still target Windows XP.
  1077. cmd += "/DWINVER=0x501 "
  1078. # Work around a WinXP/2003 bug when using VS 2015+.
  1079. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1080. cmd += "/Zc:threadSafeInit- "
  1081. cmd += "/Fo" + obj + " /nologo /c"
  1082. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  1083. cmd += " /arch:SSE2"
  1084. for x in ipath: cmd += " /I" + x
  1085. for (opt,dir) in INCDIRECTORIES:
  1086. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1087. for (opt,var,val) in DEFSYMBOLS:
  1088. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1089. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1090. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1091. if (optlevel==2): cmd += " /MDd /Zi"
  1092. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1093. if (optlevel==4):
  1094. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1095. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1096. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1097. building = GetValueOption(opts, "BUILDING:")
  1098. if (building):
  1099. cmd += " /DBUILDING_" + building
  1100. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1101. cmd += " /bigobj"
  1102. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1103. if 'EXCEPTIONS' in opts:
  1104. cmd += " /EHsc"
  1105. else:
  1106. cmd += " /D_HAS_EXCEPTIONS=0"
  1107. if 'RTTI' not in opts:
  1108. cmd += " /GR-"
  1109. if GetTargetArch() == 'x64':
  1110. cmd += " /DWIN64_VC /DWIN64"
  1111. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1112. # To preserve Windows XP compatibility.
  1113. cmd += " /D_USING_V110_SDK71_"
  1114. cmd += " /W3 " + BracketNameWithQuotes(src)
  1115. oscmd(cmd)
  1116. else:
  1117. cmd = "icl "
  1118. if GetTargetArch() == 'x64':
  1119. cmd += "/favor:blend "
  1120. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1121. cmd += "/DWINVER=0x501 "
  1122. cmd += "/Fo" + obj + " /c"
  1123. for x in ipath: cmd += " /I" + x
  1124. for (opt,dir) in INCDIRECTORIES:
  1125. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1126. for (opt,var,val) in DEFSYMBOLS:
  1127. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1128. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1129. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1130. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1131. # core changes from jean-claude (dec 2011)
  1132. # ----------------------------------------
  1133. # performance will be seeked at level 3 & 4
  1134. # -----------------------------------------
  1135. if (optlevel==3):
  1136. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1137. cmd += " /Ob0"
  1138. cmd += " /Qipo-" # beware of IPO !!!
  1139. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1140. ## ----------------------------------------------------------------
  1141. if (optlevel==4):
  1142. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1143. cmd += " /Qipo" # optimization multi file
  1144. # for 3 & 4 optimization levels
  1145. # -----------------------------
  1146. if (optlevel>=3):
  1147. cmd += " /fp:fast=2"
  1148. cmd += " /Qftz"
  1149. cmd += " /Qfp-speculation:fast"
  1150. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1151. cmd += " /Qprec-div-"
  1152. cmd += " /Qsimd"
  1153. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1154. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1155. cmd += " /Qparallel" # enable parallelization
  1156. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1157. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1158. ## PCH files with a .pchi filename suffix and reduce build time.
  1159. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1160. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1161. cmd += " /Qpchi-" # keep it this way!
  1162. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1163. ## ------------------------------------
  1164. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1165. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1166. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1167. ## Ctor displacement /vd0 : Disable constructor displacement.
  1168. ## Choose this option only if no class constructors or destructors call virtual functions.
  1169. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1170. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1171. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1172. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1173. ## Alternate: #pragma pointers_to_members
  1174. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1175. building = GetValueOption(opts, "BUILDING:")
  1176. if (building): cmd += " /DBUILDING_" + building
  1177. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1178. cmd += " /bigobj"
  1179. # level of warnings and optimization reports
  1180. if GetVerbose():
  1181. cmd += " /W3 " # or /W4 or /Wall
  1182. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1183. else:
  1184. cmd += " /W1 "
  1185. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1186. if GetTargetArch() == 'x64':
  1187. cmd += " /DWIN64_VC /DWIN64"
  1188. cmd += " " + BracketNameWithQuotes(src)
  1189. oscmd(cmd)
  1190. if (COMPILER=="GCC"):
  1191. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1192. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1193. for (opt, dir) in INCDIRECTORIES:
  1194. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1195. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1196. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1197. for (opt,var,val) in DEFSYMBOLS:
  1198. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1199. for x in ipath: cmd += ' -I' + x
  1200. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1201. cmd += ' -fvisibility=hidden'
  1202. # Mac-specific flags.
  1203. if GetTarget() == "darwin":
  1204. cmd += " -Wno-deprecated-declarations"
  1205. if OSXTARGET is not None:
  1206. cmd += " -isysroot " + SDK["MACOSX"]
  1207. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1208. for arch in OSX_ARCHS:
  1209. if 'NOARCH:' + arch.upper() not in opts:
  1210. cmd += " -arch %s" % arch
  1211. if "SYSROOT" in SDK:
  1212. if GetTarget() != "android":
  1213. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1214. else:
  1215. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1216. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1217. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1218. cmd += ' -no-canonical-prefixes'
  1219. # Android-specific flags.
  1220. arch = GetTargetArch()
  1221. if GetTarget() == "android":
  1222. # Most of the specific optimization flags here were
  1223. # just copied from the default Android Makefiles.
  1224. if "ANDROID_API" in SDK:
  1225. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1226. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1227. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1228. cmd += ' -ffunction-sections -funwind-tables'
  1229. if arch == 'armv7a':
  1230. cmd += ' -target armv7-none-linux-androideabi'
  1231. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1232. cmd += ' -fno-integrated-as'
  1233. elif arch == 'arm':
  1234. cmd += ' -target armv5te-none-linux-androideabi'
  1235. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1236. cmd += ' -fno-integrated-as'
  1237. elif arch == 'aarch64':
  1238. cmd += ' -target aarch64-none-linux-android'
  1239. elif arch == 'mips':
  1240. cmd += ' -target mipsel-none-linux-android'
  1241. cmd += ' -mips32'
  1242. elif arch == 'mips64':
  1243. cmd += ' -target mips64el-none-linux-android'
  1244. cmd += ' -fintegrated-as'
  1245. elif arch == 'x86':
  1246. cmd += ' -target i686-none-linux-android'
  1247. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1248. cmd += ' -mstackrealign'
  1249. elif arch == 'x86_64':
  1250. cmd += ' -target x86_64-none-linux-android'
  1251. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1252. cmd += " -Wa,--noexecstack"
  1253. # Do we want thumb or arm instructions?
  1254. if arch.startswith('arm'):
  1255. if optlevel >= 3:
  1256. cmd += ' -mthumb'
  1257. else:
  1258. cmd += ' -marm'
  1259. # Enable SIMD instructions if requested
  1260. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1261. cmd += ' -mfpu=neon'
  1262. else:
  1263. cmd += " -pthread"
  1264. if not src.endswith(".c"):
  1265. # We don't use exceptions for most modules.
  1266. if 'EXCEPTIONS' in opts:
  1267. cmd += " -fexceptions"
  1268. else:
  1269. cmd += " -fno-exceptions"
  1270. if src.endswith(".mm"):
  1271. # Work around Apple compiler bug.
  1272. cmd += " -U__EXCEPTIONS"
  1273. target = GetTarget()
  1274. if 'RTTI' not in opts and target != "darwin":
  1275. # We always disable RTTI on Android for memory usage reasons.
  1276. if optlevel >= 4 or target == "android":
  1277. cmd += " -fno-rtti"
  1278. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1279. cmd += " -msse2"
  1280. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1281. cmd += " -fno-strict-aliasing"
  1282. if optlevel >= 3:
  1283. cmd += " -ffast-math -fno-stack-protector"
  1284. if optlevel == 3:
  1285. # Fast math is nice, but we'd like to see NaN in dev builds.
  1286. cmd += " -fno-finite-math-only"
  1287. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1288. cmd += " -fno-unsafe-math-optimizations"
  1289. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1290. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1291. if (optlevel==3): cmd += " -O2"
  1292. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1293. # Enable more warnings.
  1294. cmd += " -Wall -Wno-unused-function"
  1295. if not src.endswith(".c"):
  1296. cmd += " -Wno-reorder"
  1297. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1298. if optlevel == 4:
  1299. cmd += " -Wno-unused-variable"
  1300. if src.endswith(".c"):
  1301. cmd += ' ' + CFLAGS
  1302. else:
  1303. cmd += ' ' + CXXFLAGS
  1304. cmd = cmd.rstrip()
  1305. building = GetValueOption(opts, "BUILDING:")
  1306. if (building): cmd += " -DBUILDING_" + building
  1307. cmd += ' ' + BracketNameWithQuotes(src)
  1308. oscmd(cmd)
  1309. ########################################################################
  1310. ##
  1311. ## CompileBison
  1312. ##
  1313. ########################################################################
  1314. def CompileBison(wobj, wsrc, opts):
  1315. ifile = os.path.basename(wsrc)
  1316. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1317. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1318. pre = GetValueOption(opts, "BISONPREFIX_")
  1319. bison = GetBison()
  1320. if bison is None:
  1321. # We don't have bison. See if there is a prebuilt file.
  1322. base, ext = os.path.splitext(wsrc)
  1323. if os.path.isfile(base + '.h.prebuilt') and \
  1324. os.path.isfile(base + '.cxx.prebuilt'):
  1325. CopyFile(wdstc, base + '.cxx.prebuilt')
  1326. CopyFile(wdsth, base + '.h.prebuilt')
  1327. else:
  1328. exit('Could not find bison!')
  1329. else:
  1330. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1331. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1332. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1333. # Finally, compile the generated source file.
  1334. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1335. ########################################################################
  1336. ##
  1337. ## CompileFlex
  1338. ##
  1339. ########################################################################
  1340. def CompileFlex(wobj,wsrc,opts):
  1341. ifile = os.path.basename(wsrc)
  1342. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1343. pre = GetValueOption(opts, "BISONPREFIX_")
  1344. dashi = opts.count("FLEXDASHI")
  1345. flex = GetFlex()
  1346. if flex is None:
  1347. # We don't have flex. See if there is a prebuilt file.
  1348. base, ext = os.path.splitext(wsrc)
  1349. if os.path.isfile(base + '.cxx.prebuilt'):
  1350. CopyFile(wdst, base + '.cxx.prebuilt')
  1351. else:
  1352. exit('Could not find flex!')
  1353. else:
  1354. if (dashi):
  1355. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1356. else:
  1357. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1358. # Finally, compile the generated source file.
  1359. CompileCxx(wobj,wdst,opts)
  1360. ########################################################################
  1361. ##
  1362. ## CompileIgate
  1363. ##
  1364. ########################################################################
  1365. def CompileIgate(woutd,wsrc,opts):
  1366. outbase = os.path.basename(woutd)[:-3]
  1367. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1368. srcdir = GetValueOption(opts, "SRCDIR:")
  1369. module = GetValueOption(opts, "IMOD:")
  1370. library = GetValueOption(opts, "ILIB:")
  1371. ipath = GetListOption(opts, "DIR:")
  1372. if (PkgSkip("PYTHON")):
  1373. WriteFile(woutc, "")
  1374. WriteFile(woutd, "")
  1375. ConditionalWriteFile(woutd, "")
  1376. return
  1377. if not CrossCompiling():
  1378. # If we're compiling for this platform, we can use the one we've built.
  1379. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1380. else:
  1381. # Assume that interrogate is on the PATH somewhere.
  1382. cmd = 'interrogate'
  1383. if GetVerbose():
  1384. cmd += ' -v'
  1385. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1386. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1387. if (COMPILER=="MSVC"):
  1388. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1389. if GetTargetArch() == 'x64':
  1390. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1391. else:
  1392. cmd += ' -D_M_IX86'
  1393. # NOTE: this 1600 value is the version number for VC2010.
  1394. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1395. if (COMPILER=="GCC"):
  1396. cmd += ' -D__attribute__\\(x\\)='
  1397. target_arch = GetTargetArch()
  1398. if target_arch in ("x86_64", "amd64"):
  1399. cmd += ' -D_LP64'
  1400. elif target_arch == 'aarch64':
  1401. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1402. else:
  1403. cmd += ' -D__i386__'
  1404. target = GetTarget()
  1405. if target == 'darwin':
  1406. cmd += ' -D__APPLE__'
  1407. elif target == 'android':
  1408. cmd += ' -D__ANDROID__'
  1409. optlevel = GetOptimizeOption(opts)
  1410. if (optlevel==1): cmd += ' -D_DEBUG'
  1411. if (optlevel==2): cmd += ' -D_DEBUG'
  1412. if (optlevel==3): pass
  1413. if (optlevel==4): cmd += ' -DNDEBUG'
  1414. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1415. cmd += ' -fnames -string -refcount -assert -python-native'
  1416. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1417. # Add -I, -S and -D flags
  1418. for x in ipath:
  1419. cmd += ' -I' + BracketNameWithQuotes(x)
  1420. for (opt,dir) in INCDIRECTORIES:
  1421. if (opt=="ALWAYS") or (opt in opts):
  1422. cmd += ' -S' + BracketNameWithQuotes(dir)
  1423. for (opt,var,val) in DEFSYMBOLS:
  1424. if (opt=="ALWAYS") or (opt in opts):
  1425. cmd += ' -D' + var + '=' + val
  1426. #building = GetValueOption(opts, "BUILDING:")
  1427. #if (building): cmd += " -DBUILDING_"+building
  1428. cmd += ' -module ' + module + ' -library ' + library
  1429. for x in wsrc:
  1430. if (x.startswith("/")):
  1431. cmd += ' ' + BracketNameWithQuotes(x)
  1432. else:
  1433. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1434. oscmd(cmd)
  1435. ########################################################################
  1436. ##
  1437. ## CompileImod
  1438. ##
  1439. ########################################################################
  1440. def CompileImod(wobj, wsrc, opts):
  1441. module = GetValueOption(opts, "IMOD:")
  1442. library = GetValueOption(opts, "ILIB:")
  1443. if (COMPILER=="MSVC"):
  1444. woutc = wobj[:-4]+".cxx"
  1445. if (COMPILER=="GCC"):
  1446. woutc = wobj[:-2]+".cxx"
  1447. if (PkgSkip("PYTHON")):
  1448. WriteFile(woutc, "")
  1449. CompileCxx(wobj, woutc, opts)
  1450. return
  1451. if not CrossCompiling():
  1452. # If we're compiling for this platform, we can use the one we've built.
  1453. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1454. else:
  1455. # Assume that interrogate_module is on the PATH somewhere.
  1456. cmd = 'interrogate_module'
  1457. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1458. importmod = GetValueOption(opts, "IMPORT:")
  1459. if importmod:
  1460. cmd += ' -import ' + importmod
  1461. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1462. oscmd(cmd)
  1463. CompileCxx(wobj,woutc,opts)
  1464. return
  1465. ########################################################################
  1466. ##
  1467. ## CompileLib
  1468. ##
  1469. ########################################################################
  1470. def CompileLib(lib, obj, opts):
  1471. if (COMPILER=="MSVC"):
  1472. if not BOOUSEINTELCOMPILER:
  1473. #Use MSVC Linker
  1474. cmd = 'link /lib /nologo'
  1475. if GetOptimizeOption(opts) == 4:
  1476. cmd += " /LTCG"
  1477. if HasTargetArch():
  1478. cmd += " /MACHINE:" + GetTargetArch().upper()
  1479. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1480. for x in obj:
  1481. if not x.endswith('.lib'):
  1482. cmd += ' ' + BracketNameWithQuotes(x)
  1483. oscmd(cmd)
  1484. else:
  1485. # Choose Intel linker; from Jean-Claude
  1486. cmd = 'xilink /verbose:lib /lib '
  1487. if HasTargetArch():
  1488. cmd += " /MACHINE:" + GetTargetArch().upper()
  1489. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1490. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1491. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1492. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1493. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1494. oscmd(cmd)
  1495. if (COMPILER=="GCC"):
  1496. if GetTarget() == 'darwin':
  1497. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1498. else:
  1499. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1500. for x in obj:
  1501. if GetLinkAllStatic() and x.endswith('.a'):
  1502. continue
  1503. cmd += ' ' + BracketNameWithQuotes(x)
  1504. oscmd(cmd)
  1505. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1506. ########################################################################
  1507. ##
  1508. ## CompileLink
  1509. ##
  1510. ########################################################################
  1511. def CompileLink(dll, obj, opts):
  1512. if (COMPILER=="MSVC"):
  1513. if not BOOUSEINTELCOMPILER:
  1514. cmd = "link /nologo "
  1515. if HasTargetArch():
  1516. cmd += " /MACHINE:" + GetTargetArch().upper()
  1517. if ("MFC" not in opts):
  1518. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1519. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1520. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1521. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1522. optlevel = GetOptimizeOption(opts)
  1523. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1524. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1525. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1526. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1527. if ("MFC" in opts):
  1528. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1529. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1530. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1531. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1532. if not PkgSkip("PYTHON"):
  1533. # If we're building without Python, don't pick it up implicitly.
  1534. if "PYTHON" not in opts:
  1535. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1536. if optlevel <= 2:
  1537. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1538. else:
  1539. cmd += ' /NOD:{}.lib'.format(pythonv)
  1540. # Yes, we know we are importing "locally defined symbols".
  1541. for x in obj:
  1542. if x.endswith('libp3pystub.lib'):
  1543. cmd += ' /ignore:4049,4217'
  1544. break
  1545. # Set the subsystem. Specify that we want to target Windows XP.
  1546. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1547. cmd += " /SUBSYSTEM:" + subsystem
  1548. if GetTargetArch() == 'x64':
  1549. cmd += ",5.02"
  1550. else:
  1551. cmd += ",5.01"
  1552. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1553. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1554. for (opt, dir) in LIBDIRECTORIES:
  1555. if (opt=="ALWAYS") or (opt in opts):
  1556. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1557. for x in obj:
  1558. if x.endswith(".dll") or x.endswith(".pyd"):
  1559. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1560. elif x.endswith(".lib"):
  1561. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1562. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1563. exit("Error: in makepanda, specify "+dname+", not "+x)
  1564. cmd += ' ' + BracketNameWithQuotes(x)
  1565. elif x.endswith(".def"):
  1566. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1567. elif x.endswith(".dat"):
  1568. pass
  1569. else:
  1570. cmd += ' ' + BracketNameWithQuotes(x)
  1571. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1572. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1573. for (opt, name) in LIBNAMES:
  1574. if (opt=="ALWAYS") or (opt in opts):
  1575. cmd += " " + BracketNameWithQuotes(name)
  1576. oscmd(cmd)
  1577. else:
  1578. cmd = "xilink"
  1579. if GetVerbose(): cmd += " /verbose:lib"
  1580. if HasTargetArch():
  1581. cmd += " /MACHINE:" + GetTargetArch().upper()
  1582. if ("MFC" not in opts):
  1583. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1584. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1585. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1586. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1587. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1588. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1589. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1590. optlevel = GetOptimizeOption(opts)
  1591. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1592. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1593. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1594. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1595. if ("MFC" in opts):
  1596. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1597. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1598. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1599. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1600. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1601. if subsystem:
  1602. cmd += " /SUBSYSTEM:" + subsystem
  1603. if dll.endswith(".dll"):
  1604. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1605. for (opt, dir) in LIBDIRECTORIES:
  1606. if (opt=="ALWAYS") or (opt in opts):
  1607. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1608. for x in obj:
  1609. if x.endswith(".dll") or x.endswith(".pyd"):
  1610. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1611. elif x.endswith(".lib"):
  1612. dname = os.path.splitext(dll)[0]+".dll"
  1613. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1614. exit("Error: in makepanda, specify "+dname+", not "+x)
  1615. cmd += ' ' + BracketNameWithQuotes(x)
  1616. elif x.endswith(".def"):
  1617. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1618. elif x.endswith(".dat"):
  1619. pass
  1620. else:
  1621. cmd += ' ' + BracketNameWithQuotes(x)
  1622. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1623. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1624. for (opt, name) in LIBNAMES:
  1625. if (opt=="ALWAYS") or (opt in opts):
  1626. cmd += " " + BracketNameWithQuotes(name)
  1627. oscmd(cmd)
  1628. if COMPILER == "GCC":
  1629. cxx = GetCXX()
  1630. if GetOrigExt(dll) == ".exe":
  1631. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1632. if GetTarget() == "android":
  1633. # Necessary to work around an issue with libandroid depending on vendor libraries
  1634. cmd += ' -Wl,--allow-shlib-undefined'
  1635. else:
  1636. if (GetTarget() == "darwin"):
  1637. cmd = cxx + ' -undefined dynamic_lookup'
  1638. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1639. cmd += ' -bundle '
  1640. else:
  1641. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1642. cmd += ' -dynamiclib -install_name ' + install_name
  1643. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1644. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1645. else:
  1646. cmd = cxx + ' -shared'
  1647. # Always set soname on Android to avoid a linker warning when loading the library.
  1648. if "MODULE" not in opts or GetTarget() == 'android':
  1649. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1650. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1651. for x in obj:
  1652. if GetOrigExt(x) != ".dat":
  1653. cmd += ' ' + x
  1654. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1655. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1656. # Mac OS X specific flags.
  1657. if GetTarget() == 'darwin':
  1658. cmd += " -headerpad_max_install_names"
  1659. if OSXTARGET is not None:
  1660. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1661. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1662. for arch in OSX_ARCHS:
  1663. if 'NOARCH:' + arch.upper() not in opts:
  1664. cmd += " -arch %s" % arch
  1665. elif GetTarget() == 'android':
  1666. arch = GetTargetArch()
  1667. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1668. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1669. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1670. if arch == 'armv7a':
  1671. cmd += ' -target armv7-none-linux-androideabi'
  1672. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1673. elif arch == 'arm':
  1674. cmd += ' -target armv5te-none-linux-androideabi'
  1675. elif arch == 'aarch64':
  1676. cmd += ' -target aarch64-none-linux-android'
  1677. elif arch == 'mips':
  1678. cmd += ' -target mipsel-none-linux-android'
  1679. cmd += ' -mips32'
  1680. elif arch == 'mips64':
  1681. cmd += ' -target mips64el-none-linux-android'
  1682. elif arch == 'x86':
  1683. cmd += ' -target i686-none-linux-android'
  1684. elif arch == 'x86_64':
  1685. cmd += ' -target x86_64-none-linux-android'
  1686. cmd += ' -lc -lm'
  1687. else:
  1688. cmd += " -pthread"
  1689. if "SYSROOT" in SDK:
  1690. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1691. if LDFLAGS != "":
  1692. cmd += " " + LDFLAGS
  1693. # Don't link libraries with Python, except on Android.
  1694. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1695. opts = opts[:]
  1696. opts.remove("PYTHON")
  1697. for (opt, dir) in LIBDIRECTORIES:
  1698. if (opt=="ALWAYS") or (opt in opts):
  1699. cmd += ' -L' + BracketNameWithQuotes(dir)
  1700. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1701. if (opt=="ALWAYS") or (opt in opts):
  1702. cmd += ' -F' + BracketNameWithQuotes(dir)
  1703. for (opt, name) in LIBNAMES:
  1704. if (opt=="ALWAYS") or (opt in opts):
  1705. cmd += ' ' + BracketNameWithQuotes(name)
  1706. if GetTarget() != 'freebsd':
  1707. cmd += " -ldl"
  1708. oscmd(cmd)
  1709. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1710. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1711. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1712. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1713. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1714. if os.path.isfile(newdll):
  1715. os.remove(newdll)
  1716. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1717. elif dll.endswith("." + MAJOR_VERSION):
  1718. newdll = dll[:-len(MAJOR_VERSION)-1]
  1719. if os.path.isfile(newdll):
  1720. os.remove(newdll)
  1721. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1722. ##########################################################################################
  1723. #
  1724. # CompileEgg
  1725. #
  1726. ##########################################################################################
  1727. def CompileEgg(eggfile, src, opts):
  1728. pz = False
  1729. if eggfile.endswith(".pz"):
  1730. pz = True
  1731. eggfile = eggfile[:-3]
  1732. # Determine the location of the pzip and flt2egg tools.
  1733. if CrossCompiling():
  1734. # We may not be able to use our generated versions of these tools,
  1735. # so we'll expect them to already be present in the PATH.
  1736. pzip = 'pzip'
  1737. flt2egg = 'flt2egg'
  1738. else:
  1739. # If we're compiling for this machine, we can use the binaries we've built.
  1740. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1741. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1742. if not os.path.isfile(pzip):
  1743. pzip = 'pzip'
  1744. if not os.path.isfile(flt2egg):
  1745. flt2egg = 'flt2egg'
  1746. if src.endswith(".egg"):
  1747. CopyFile(eggfile, src)
  1748. elif src.endswith(".flt"):
  1749. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1750. if pz:
  1751. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1752. ##########################################################################################
  1753. #
  1754. # CompileRes, CompileRsrc
  1755. #
  1756. ##########################################################################################
  1757. def CompileRes(target, src, opts):
  1758. """Compiles a Windows .rc file into a .res file."""
  1759. ipath = GetListOption(opts, "DIR:")
  1760. if (COMPILER == "MSVC"):
  1761. cmd = "rc"
  1762. cmd += " /Fo" + BracketNameWithQuotes(target)
  1763. for x in ipath: cmd += " /I" + x
  1764. for (opt,dir) in INCDIRECTORIES:
  1765. if (opt=="ALWAYS") or (opt in opts):
  1766. cmd += " /I" + BracketNameWithQuotes(dir)
  1767. for (opt,var,val) in DEFSYMBOLS:
  1768. if (opt=="ALWAYS") or (opt in opts):
  1769. cmd += " /D" + var + "=" + val
  1770. cmd += " " + BracketNameWithQuotes(src)
  1771. else:
  1772. cmd = "windres"
  1773. for x in ipath: cmd += " -I" + x
  1774. for (opt,dir) in INCDIRECTORIES:
  1775. if (opt=="ALWAYS") or (opt in opts):
  1776. cmd += " -I" + BracketNameWithQuotes(dir)
  1777. for (opt,var,val) in DEFSYMBOLS:
  1778. if (opt=="ALWAYS") or (opt in opts):
  1779. cmd += " -D" + var + "=" + val
  1780. cmd += " -i " + BracketNameWithQuotes(src)
  1781. cmd += " -o " + BracketNameWithQuotes(target)
  1782. oscmd(cmd)
  1783. def CompileRsrc(target, src, opts):
  1784. """Compiles a Mac OS .r file into an .rsrc file."""
  1785. ipath = GetListOption(opts, "DIR:")
  1786. if os.path.isfile("/usr/bin/Rez"):
  1787. cmd = "Rez -useDF"
  1788. else:
  1789. cmd = "/Developer/Tools/Rez -useDF"
  1790. cmd += " -o " + BracketNameWithQuotes(target)
  1791. for x in ipath:
  1792. cmd += " -i " + x
  1793. for (opt,dir) in INCDIRECTORIES:
  1794. if (opt=="ALWAYS") or (opt in opts):
  1795. cmd += " -i " + BracketNameWithQuotes(dir)
  1796. for (opt,var,val) in DEFSYMBOLS:
  1797. if (opt=="ALWAYS") or (opt in opts):
  1798. if (val == ""):
  1799. cmd += " -d " + var
  1800. else:
  1801. cmd += " -d " + var + " = " + val
  1802. cmd += " " + BracketNameWithQuotes(src)
  1803. oscmd(cmd)
  1804. ##########################################################################################
  1805. #
  1806. # CompileJava (Android only)
  1807. #
  1808. ##########################################################################################
  1809. def CompileJava(target, src, opts):
  1810. """Compiles a .java file into a .class file."""
  1811. if GetHost() == 'android':
  1812. cmd = "ecj "
  1813. else:
  1814. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1815. optlevel = GetOptimizeOption(opts)
  1816. if optlevel >= 4:
  1817. cmd += "-debug:none "
  1818. cmd += "-cp " + GetOutputDir() + "/classes "
  1819. cmd += "-d " + GetOutputDir() + "/classes "
  1820. cmd += BracketNameWithQuotes(src)
  1821. oscmd(cmd)
  1822. ##########################################################################################
  1823. #
  1824. # FreezePy
  1825. #
  1826. ##########################################################################################
  1827. def FreezePy(target, inputs, opts):
  1828. assert len(inputs) > 0
  1829. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1830. if sys.version_info >= (2, 6):
  1831. cmdstr += "-B "
  1832. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1833. if 'FREEZE_STARTUP' in opts:
  1834. cmdstr += " -s"
  1835. if GetOrigExt(target) == '.exe':
  1836. src = inputs.pop(0)
  1837. else:
  1838. src = ""
  1839. for i in inputs:
  1840. i = os.path.splitext(i)[0]
  1841. i = i.replace('/', '.')
  1842. if i.startswith('direct.src'):
  1843. i = i.replace('.src.', '.')
  1844. cmdstr += " -i " + i
  1845. cmdstr += " -o " + target + " " + src
  1846. if ("LINK_PYTHON_STATIC" in opts):
  1847. os.environ["LINK_PYTHON_STATIC"] = "1"
  1848. oscmd(cmdstr)
  1849. if ("LINK_PYTHON_STATIC" in os.environ):
  1850. del os.environ["LINK_PYTHON_STATIC"]
  1851. if (not os.path.exists(target)):
  1852. exit("FREEZER_ERROR")
  1853. ##########################################################################################
  1854. #
  1855. # Package
  1856. #
  1857. ##########################################################################################
  1858. def Package(target, inputs, opts):
  1859. assert len(inputs) == 1
  1860. # Invoke the ppackage script.
  1861. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1862. if GetOptimizeOption(opts) >= 4:
  1863. command += "-OO "
  1864. if sys.version_info >= (2, 6):
  1865. command += "-B "
  1866. command += "direct/src/p3d/ppackage.py"
  1867. if not RTDIST:
  1868. # Don't compile Python sources, because we might not running in the same
  1869. # Python version as the selected host.
  1870. command += " -N"
  1871. if GetTarget() == "darwin":
  1872. if SDK.get("MACOSX"):
  1873. command += " -R \"%s\"" % SDK["MACOSX"]
  1874. for arch in OSX_ARCHS:
  1875. if arch == "x86_64":
  1876. arch = "amd64"
  1877. command += " -P osx_%s" % arch
  1878. command += " -i \"" + GetOutputDir() + "/stage\""
  1879. if (P3DSUFFIX):
  1880. command += ' -a "' + P3DSUFFIX + '"'
  1881. command += " " + inputs[0]
  1882. if GetOrigExt(target) == '.p3d':
  1883. # Build a specific .p3d file.
  1884. basename = os.path.basename(os.path.splitext(target)[0])
  1885. command += " " + basename
  1886. oscmd(command)
  1887. if GetTarget() == 'windows':
  1888. # Make an .exe that calls this .p3d.
  1889. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1890. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1891. exefile = FindLocation(basename + '.exe', [])
  1892. CompileLink(exefile, [objfile], ['ADVAPI'])
  1893. # Move it to the bin directory.
  1894. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1895. if sys.platform != 'win32':
  1896. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1897. else:
  1898. # This is presumably a package or set of packages.
  1899. oscmd(command)
  1900. ##########################################################################################
  1901. #
  1902. # CompileBundle
  1903. #
  1904. ##########################################################################################
  1905. def CompileBundle(target, inputs, opts):
  1906. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1907. plist = None
  1908. resources = []
  1909. objects = []
  1910. for i in inputs:
  1911. if (i.endswith(".plist")):
  1912. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1913. plist = i
  1914. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1915. resources.append(i)
  1916. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1917. objects.append(i)
  1918. else:
  1919. exit("Don't know how to bundle file %s" % i)
  1920. # Now link the object files to form the bundle.
  1921. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1922. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1923. oscmd("rm -rf %s" % target)
  1924. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1925. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1926. if target.endswith(".app"):
  1927. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1928. else:
  1929. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1930. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1931. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1932. for r in resources:
  1933. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1934. ##########################################################################################
  1935. #
  1936. # CompileMIDL
  1937. #
  1938. ##########################################################################################
  1939. def CompileMIDL(target, src, opts):
  1940. ipath = GetListOption(opts, "DIR:")
  1941. if (COMPILER=="MSVC"):
  1942. cmd = "midl"
  1943. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1944. for x in ipath: cmd += " /I" + x
  1945. for (opt,dir) in INCDIRECTORIES:
  1946. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1947. for (opt,var,val) in DEFSYMBOLS:
  1948. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1949. cmd += " " + BracketNameWithQuotes(src)
  1950. oscmd(cmd)
  1951. ##########################################################################################
  1952. #
  1953. # CompileAnything
  1954. #
  1955. ##########################################################################################
  1956. def CompileAnything(target, inputs, opts, progress = None):
  1957. if (opts.count("DEPENDENCYONLY")):
  1958. return
  1959. if (len(inputs)==0):
  1960. exit("No input files for target "+target)
  1961. infile = inputs[0]
  1962. origsuffix = GetOrigExt(target)
  1963. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1964. # It must be a simple copy operation.
  1965. ProgressOutput(progress, "Copying file", target)
  1966. CopyFile(target, infile)
  1967. if (origsuffix==".exe" and GetHost() != "windows"):
  1968. os.system("chmod +x \"%s\"" % target)
  1969. return
  1970. elif (infile.endswith(".py")):
  1971. if origsuffix == ".obj":
  1972. source = os.path.splitext(target)[0] + ".c"
  1973. SetOrigExt(source, ".c")
  1974. ProgressOutput(progress, "Building frozen source", source)
  1975. FreezePy(source, inputs, opts)
  1976. ProgressOutput(progress, "Building C++ object", target)
  1977. return CompileCxx(target, source, opts)
  1978. if origsuffix == ".exe":
  1979. ProgressOutput(progress, "Building frozen executable", target)
  1980. else:
  1981. ProgressOutput(progress, "Building frozen library", target)
  1982. return FreezePy(target, inputs, opts)
  1983. elif (infile.endswith(".idl")):
  1984. ProgressOutput(progress, "Compiling MIDL file", infile)
  1985. return CompileMIDL(target, infile, opts)
  1986. elif (infile.endswith(".pdef")):
  1987. if origsuffix == '.p3d':
  1988. ProgressOutput(progress, "Building package", target)
  1989. else:
  1990. ProgressOutput(progress, "Building package from pdef file", infile)
  1991. return Package(target, inputs, opts)
  1992. elif origsuffix in SUFFIX_LIB:
  1993. ProgressOutput(progress, "Linking static library", target)
  1994. return CompileLib(target, inputs, opts)
  1995. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1996. if (origsuffix==".exe"):
  1997. ProgressOutput(progress, "Linking executable", target)
  1998. else:
  1999. ProgressOutput(progress, "Linking dynamic library", target)
  2000. # Add version number to the dynamic library, on unix
  2001. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2002. tplatform = GetTarget()
  2003. if tplatform == "darwin":
  2004. # On Mac, libraries are named like libpanda.1.2.dylib
  2005. if target.lower().endswith(".dylib"):
  2006. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2007. SetOrigExt(target, origsuffix)
  2008. elif tplatform != "windows" and tplatform != "android":
  2009. # On Linux, libraries are named like libpanda.so.1.2
  2010. target += "." + MAJOR_VERSION
  2011. SetOrigExt(target, origsuffix)
  2012. return CompileLink(target, inputs, opts)
  2013. elif (origsuffix==".in"):
  2014. ProgressOutput(progress, "Building Interrogate database", target)
  2015. return CompileIgate(target, inputs, opts)
  2016. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2017. ProgressOutput(progress, "Building plugin bundle", target)
  2018. return CompileBundle(target, inputs, opts)
  2019. elif (origsuffix==".app"):
  2020. ProgressOutput(progress, "Building application bundle", target)
  2021. return CompileBundle(target, inputs, opts)
  2022. elif (origsuffix==".pz"):
  2023. ProgressOutput(progress, "Compressing", target)
  2024. return CompileEgg(target, infile, opts)
  2025. elif (origsuffix==".egg"):
  2026. ProgressOutput(progress, "Converting", target)
  2027. return CompileEgg(target, infile, opts)
  2028. elif (origsuffix==".res"):
  2029. ProgressOutput(progress, "Building resource object", target)
  2030. return CompileRes(target, infile, opts)
  2031. elif (origsuffix==".rsrc"):
  2032. ProgressOutput(progress, "Building resource object", target)
  2033. return CompileRsrc(target, infile, opts)
  2034. elif (origsuffix==".class"):
  2035. ProgressOutput(progress, "Building Java class", target)
  2036. return CompileJava(target, infile, opts)
  2037. elif (origsuffix==".obj"):
  2038. if (infile.endswith(".cxx")):
  2039. ProgressOutput(progress, "Building C++ object", target)
  2040. return CompileCxx(target, infile, opts)
  2041. elif (infile.endswith(".c")):
  2042. ProgressOutput(progress, "Building C object", target)
  2043. return CompileCxx(target, infile, opts)
  2044. elif (infile.endswith(".mm")):
  2045. ProgressOutput(progress, "Building Objective-C++ object", target)
  2046. return CompileCxx(target, infile, opts)
  2047. elif (infile.endswith(".yxx")):
  2048. ProgressOutput(progress, "Building Bison object", target)
  2049. return CompileBison(target, infile, opts)
  2050. elif (infile.endswith(".lxx")):
  2051. ProgressOutput(progress, "Building Flex object", target)
  2052. return CompileFlex(target, infile, opts)
  2053. elif (infile.endswith(".in")):
  2054. ProgressOutput(progress, "Building Interrogate object", target)
  2055. return CompileImod(target, inputs, opts)
  2056. elif (infile.endswith(".rc")):
  2057. ProgressOutput(progress, "Building resource object", target)
  2058. return CompileRes(target, infile, opts)
  2059. elif (infile.endswith(".r")):
  2060. ProgressOutput(progress, "Building resource object", target)
  2061. return CompileRsrc(target, infile, opts)
  2062. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2063. ##########################################################################################
  2064. #
  2065. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2066. #
  2067. ##########################################################################################
  2068. DTOOL_CONFIG=[
  2069. #_Variable_________________________Windows___________________Unix__________
  2070. ("HAVE_PYTHON", '1', '1'),
  2071. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2072. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2073. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2074. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2075. ("HAVE_MAYA", '1', '1'),
  2076. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2077. ("USE_PANDAFILESTREAM", '1', '1'),
  2078. ("USE_DELETED_CHAIN", '1', '1'),
  2079. ("HAVE_GLX", 'UNDEF', '1'),
  2080. ("HAVE_WGL", '1', 'UNDEF'),
  2081. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2082. ("HAVE_THREADS", '1', '1'),
  2083. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2084. ("OS_SIMPLE_THREADS", '1', '1'),
  2085. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2086. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2087. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2088. ("HAVE_AUDIO", '1', '1'),
  2089. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2090. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2091. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2092. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2093. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2094. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2095. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2096. ("DO_PIPELINING", '1', '1'),
  2097. ("DEFAULT_PATHSEP", '";"', '":"'),
  2098. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2099. ("PHAVE_LOCKF", '1', '1'),
  2100. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2101. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2102. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2103. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2104. ("HAVE_GETOPT", 'UNDEF', '1'),
  2105. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2106. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2107. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2108. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2109. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2110. ("HAVE_IOS_BINARY", '1', '1'),
  2111. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2112. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2113. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2114. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2115. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2116. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2117. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2118. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2119. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2120. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2121. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2122. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2123. ("PHAVE_IO_H", '1', 'UNDEF'),
  2124. ("PHAVE_IOSTREAM", '1', '1'),
  2125. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2126. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2127. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2128. ("PHAVE_MALLOC_H", '1', '1'),
  2129. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2130. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2131. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2132. ("PHAVE_SSTREAM", '1', '1'),
  2133. ("PHAVE_NEW", '1', '1'),
  2134. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2135. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2136. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2137. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2138. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2139. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2140. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2141. ("PHAVE_STDINT_H", '1', '1'),
  2142. ("HAVE_RTTI", '1', '1'),
  2143. ("HAVE_X11", 'UNDEF', '1'),
  2144. ("IS_LINUX", 'UNDEF', '1'),
  2145. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2146. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2147. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2148. ("LINMATH_ALIGN", '1', '1'),
  2149. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2150. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2151. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2152. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2153. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2154. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2155. ("HAVE_SGI_RGB", '1', '1'),
  2156. ("HAVE_TGA", '1', '1'),
  2157. ("HAVE_IMG", '1', '1'),
  2158. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2159. ("HAVE_BMP", '1', '1'),
  2160. ("HAVE_PNM", '1', '1'),
  2161. ("HAVE_STB_IMAGE", '1', '1'),
  2162. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2163. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2164. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2165. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2166. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2167. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2168. ("WANT_NATIVE_NET", '1', '1'),
  2169. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2170. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2171. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2172. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2173. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2174. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2175. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2176. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2177. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2178. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2179. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2180. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2181. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2182. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2183. # ("_SECURE_SCL", '0', 'UNDEF'),
  2184. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2185. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2186. ]
  2187. PRC_PARAMETERS=[
  2188. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2189. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2190. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2191. ("PRC_PATH2_ENVVARS", '""', '""'),
  2192. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2193. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2194. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2195. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2196. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2197. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2198. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2199. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2200. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2201. ]
  2202. def WriteConfigSettings():
  2203. dtool_config={}
  2204. prc_parameters={}
  2205. speedtree_parameters={}
  2206. plugin_config={}
  2207. if (GetTarget() == 'windows'):
  2208. for key,win,unix in DTOOL_CONFIG:
  2209. dtool_config[key] = win
  2210. for key,win,unix in PRC_PARAMETERS:
  2211. prc_parameters[key] = win
  2212. else:
  2213. for key,win,unix in DTOOL_CONFIG:
  2214. dtool_config[key] = unix
  2215. for key,win,unix in PRC_PARAMETERS:
  2216. prc_parameters[key] = unix
  2217. for x in PkgListGet():
  2218. if ("HAVE_"+x in dtool_config):
  2219. if (PkgSkip(x)==0):
  2220. dtool_config["HAVE_"+x] = '1'
  2221. else:
  2222. dtool_config["HAVE_"+x] = 'UNDEF'
  2223. dtool_config["HAVE_NET"] = '1'
  2224. if (PkgSkip("NVIDIACG")==0):
  2225. dtool_config["HAVE_CG"] = '1'
  2226. dtool_config["HAVE_CGGL"] = '1'
  2227. dtool_config["HAVE_CGDX9"] = '1'
  2228. if GetTarget() not in ("linux", "android"):
  2229. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2230. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2231. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2232. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2233. if (GetTarget() == "darwin"):
  2234. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2235. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2236. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2237. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2238. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2239. dtool_config["HAVE_GLX"] = 'UNDEF'
  2240. dtool_config["IS_LINUX"] = 'UNDEF'
  2241. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2242. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2243. dtool_config["IS_OSX"] = '1'
  2244. # 10.4 had a broken ucontext implementation
  2245. if int(platform.mac_ver()[0][3]) <= 4:
  2246. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2247. if (GetTarget() == "freebsd"):
  2248. dtool_config["IS_LINUX"] = 'UNDEF'
  2249. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2250. dtool_config["IS_FREEBSD"] = '1'
  2251. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2252. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2253. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2254. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2255. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2256. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2257. if (GetTarget() == "android"):
  2258. # Android does have RTTI, but we disable it anyway.
  2259. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2260. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2261. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2262. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2263. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2264. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2265. # This should probably be more sophisticated, such as based
  2266. # on whether the libRocket Python modules are available.
  2267. if (PkgSkip("PYTHON") != 0):
  2268. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2269. if (GetOptimize() <= 3):
  2270. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2271. if (GetOptimize() <= 3):
  2272. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2273. dtool_config["DO_PSTATS"] = '1'
  2274. if (GetOptimize() <= 3):
  2275. dtool_config["DO_DCAST"] = '1'
  2276. if (GetOptimize() <= 3):
  2277. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2278. if (GetOptimize() <= 3):
  2279. dtool_config["DO_MEMORY_USAGE"] = '1'
  2280. if (GetOptimize() <= 3):
  2281. dtool_config["NOTIFY_DEBUG"] = '1'
  2282. if (GetOptimize() >= 4):
  2283. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2284. if (GetOptimize() >= 4):
  2285. # Disable RTTI on release builds.
  2286. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2287. # Now that we have OS_SIMPLE_THREADS, we can support
  2288. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2289. # longer need to disable it for this platform.
  2290. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2291. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2292. if (RTDIST or RUNTIME):
  2293. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2294. if HOST_URL:
  2295. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2296. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2297. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2298. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2299. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2300. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2301. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2302. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2303. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2304. if PkgSkip("GTK2") == 0:
  2305. plugin_config["HAVE_GTK"] = '1'
  2306. if (RUNTIME):
  2307. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2308. # Whether it's present on the system doesn't matter here,
  2309. # as the runtime itself doesn't include or link with X11.
  2310. if (RUNTIME and GetTarget() == 'linux'):
  2311. dtool_config["HAVE_X11"] = '1'
  2312. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2313. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2314. else:
  2315. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2316. if (PkgSkip("SPEEDTREE")==0):
  2317. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2318. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2319. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2320. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2321. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2322. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2323. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2324. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2325. for key in sorted(prc_parameters.keys()):
  2326. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2327. val = OverrideValue(key, prc_parameters[key])
  2328. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2329. else: conf = conf + "#define " + key + " " + val + "\n"
  2330. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2331. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2332. for key in sorted(dtool_config.keys()):
  2333. val = OverrideValue(key, dtool_config[key])
  2334. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2335. else: conf = conf + "#define " + key + " " + val + "\n"
  2336. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2337. if (RTDIST or RUNTIME):
  2338. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2339. for key in sorted(plugin_config.keys()):
  2340. val = plugin_config[key]
  2341. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2342. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2343. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2344. if (PkgSkip("SPEEDTREE")==0):
  2345. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2346. for key in sorted(speedtree_parameters.keys()):
  2347. val = OverrideValue(key, speedtree_parameters[key])
  2348. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2349. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2350. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2351. for x in PkgListGet():
  2352. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2353. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2354. # Finally, write a platform.dat with the platform we are compiling for.
  2355. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2356. # This is useful for tools like makepackage that need to know things about
  2357. # the build parameters.
  2358. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2359. WriteConfigSettings()
  2360. WarnConflictingFiles()
  2361. if SystemLibraryExists("dtoolbase"):
  2362. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2363. if SystemLibraryExists("p3dtoolconfig"):
  2364. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2365. ##########################################################################################
  2366. #
  2367. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2368. #
  2369. ##########################################################################################
  2370. PANDAVERSION_H="""
  2371. #define PANDA_MAJOR_VERSION $VERSION1
  2372. #define PANDA_MINOR_VERSION $VERSION2
  2373. #define PANDA_SEQUENCE_VERSION $VERSION3
  2374. #define PANDA_VERSION $NVERSION
  2375. #define PANDA_NUMERIC_VERSION $NVERSION
  2376. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2377. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2378. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2379. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2380. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2381. """
  2382. PANDAVERSION_H_RUNTIME="""
  2383. #define PANDA_MAJOR_VERSION 0
  2384. #define PANDA_MINOR_VERSION 0
  2385. #define PANDA_SEQUENCE_VERSION 0
  2386. #define PANDA_VERSION_STR "0.0.0"
  2387. #define PANDA_ABI_VERSION_STR "0.0"
  2388. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2389. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2390. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2391. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2392. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2393. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2394. #define PANDA_PACKAGE_VERSION_STR ""
  2395. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2396. """
  2397. CHECKPANDAVERSION_CXX="""
  2398. # include "dtoolbase.h"
  2399. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2400. """
  2401. CHECKPANDAVERSION_H="""
  2402. # ifndef CHECKPANDAVERSION_H
  2403. # define CHECKPANDAVERSION_H
  2404. # include "dtoolbase.h"
  2405. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2406. // Hack to forcibly depend on the check
  2407. template<typename T>
  2408. class CheckPandaVersion {
  2409. public:
  2410. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2411. };
  2412. template class CheckPandaVersion<void>;
  2413. # endif
  2414. """
  2415. P3DACTIVEX_RC="""#include "resource.h"
  2416. #define APSTUDIO_READONLY_SYMBOLS
  2417. #include "afxres.h"
  2418. #undef APSTUDIO_READONLY_SYMBOLS
  2419. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2420. #ifdef _WIN32
  2421. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2422. #pragma code_page(1252)
  2423. #endif
  2424. #ifdef APSTUDIO_INVOKED
  2425. 1 TEXTINCLUDE
  2426. BEGIN
  2427. "resource.h\\0"
  2428. END
  2429. 2 TEXTINCLUDE
  2430. BEGIN
  2431. "#include ""afxres.h""\\r\\n"
  2432. "\\0"
  2433. END
  2434. 3 TEXTINCLUDE
  2435. BEGIN
  2436. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2437. "\\0"
  2438. END
  2439. #endif
  2440. %s
  2441. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2442. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2443. STYLE DS_SETFONT | WS_CHILD
  2444. FONT 8, "MS Sans Serif"
  2445. BEGIN
  2446. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2447. IDC_STATIC,7,25,229,16
  2448. END
  2449. #ifdef APSTUDIO_INVOKED
  2450. GUIDELINES DESIGNINFO
  2451. BEGIN
  2452. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2453. BEGIN
  2454. LEFTMARGIN, 7
  2455. RIGHTMARGIN, 243
  2456. TOPMARGIN, 7
  2457. BOTTOMMARGIN, 55
  2458. END
  2459. END
  2460. #endif
  2461. STRINGTABLE
  2462. BEGIN
  2463. IDS_P3DACTIVEX "P3DActiveX Control"
  2464. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2465. END
  2466. STRINGTABLE
  2467. BEGIN
  2468. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2469. END
  2470. #endif
  2471. #ifndef APSTUDIO_INVOKED
  2472. 1 TYPELIB "P3DActiveX.tlb"
  2473. #endif"""
  2474. def CreatePandaVersionFiles():
  2475. version1=int(VERSION.split(".")[0])
  2476. version2=int(VERSION.split(".")[1])
  2477. version3=int(VERSION.split(".")[2])
  2478. nversion=version1*1000000+version2*1000+version3
  2479. if (DISTRIBUTOR != "cmu"):
  2480. # Subtract 1 if we are not an official version.
  2481. nversion -= 1
  2482. if (RUNTIME):
  2483. pandaversion_h = PANDAVERSION_H_RUNTIME
  2484. else:
  2485. pandaversion_h = PANDAVERSION_H
  2486. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2487. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2488. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2489. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2490. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2491. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2492. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2493. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2494. if (DISTRIBUTOR == "cmu"):
  2495. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2496. else:
  2497. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2498. if GIT_COMMIT:
  2499. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2500. if not RUNTIME:
  2501. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2502. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2503. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2504. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2505. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2506. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2507. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2508. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2509. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2510. if RUNTIME:
  2511. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2512. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2513. else:
  2514. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2515. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2516. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2517. if RUNTIME:
  2518. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2519. "version" : VERSION,
  2520. "description" : "Runs 3-D games and interactive applets",
  2521. "filename" : "p3dactivex.ocx",
  2522. "mimetype" : "application/x-panda3d",
  2523. "extension" : "p3d",
  2524. "filedesc" : "Panda3D applet"}
  2525. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2526. CreatePandaVersionFiles()
  2527. ##########################################################################################
  2528. #
  2529. # Copy the "direct" tree
  2530. #
  2531. ##########################################################################################
  2532. if (PkgSkip("DIRECT")==0):
  2533. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2534. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2535. # This file used to be copied, but would nowadays cause conflicts.
  2536. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2537. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2538. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2539. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2540. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2541. # This directory doesn't exist at all any more.
  2542. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2543. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2544. # These files used to exist; remove them to avoid conflicts.
  2545. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2546. '_core.pyd', '_core.so',
  2547. 'direct.py', 'direct.pyc', 'direct.pyo',
  2548. '_direct.pyd', '_direct.so',
  2549. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2550. for basename in del_files:
  2551. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2552. if os.path.isfile(path):
  2553. print("Removing %s" % (path))
  2554. os.remove(path)
  2555. # Write an appropriate panda3d/__init__.py
  2556. p3d_init = """"Python bindings for the Panda3D libraries"
  2557. __version__ = '%s'
  2558. """ % (WHLVERSION)
  2559. if GetTarget() == 'windows':
  2560. p3d_init += """
  2561. if '__file__' in locals():
  2562. import os
  2563. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2564. if os.path.isdir(bindir):
  2565. if not os.environ.get('PATH'):
  2566. os.environ['PATH'] = bindir
  2567. else:
  2568. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2569. del os, bindir
  2570. """
  2571. if not PkgSkip("PYTHON"):
  2572. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2573. # Also add this file, for backward compatibility.
  2574. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2575. if __debug__:
  2576. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2577. from .interrogatedb import *
  2578. """)
  2579. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2580. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2581. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2582. os.remove(fn)
  2583. panda_modules = ['core']
  2584. if not PkgSkip("PANDAPHYSICS"):
  2585. panda_modules.append('physics')
  2586. if not PkgSkip('PANDAFX'):
  2587. panda_modules.append('fx')
  2588. if not PkgSkip("DIRECT"):
  2589. panda_modules.append('direct')
  2590. if not PkgSkip("VISION"):
  2591. panda_modules.append('vision')
  2592. if not PkgSkip("SKEL"):
  2593. panda_modules.append('skel')
  2594. if not PkgSkip("EGG"):
  2595. panda_modules.append('egg')
  2596. if not PkgSkip("ODE"):
  2597. panda_modules.append('ode')
  2598. if not PkgSkip("VRPN"):
  2599. panda_modules.append('vrpn')
  2600. panda_modules_code = """
  2601. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2602. if __debug__:
  2603. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2604. """
  2605. for module in panda_modules:
  2606. panda_modules_code += """
  2607. try:
  2608. from panda3d.%s import *
  2609. except ImportError as err:
  2610. if "No module named %s" not in str(err):
  2611. raise""" % (module, module)
  2612. panda_modules_code += """
  2613. from direct.showbase import DConfig
  2614. def get_config_showbase():
  2615. return DConfig
  2616. def get_config_express():
  2617. return DConfig
  2618. getConfigShowbase = get_config_showbase
  2619. getConfigExpress = get_config_express
  2620. """
  2621. exthelpers_code = """
  2622. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2623. from direct.extensions_native.extension_native_helpers import *
  2624. """
  2625. if not PkgSkip("PYTHON"):
  2626. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2627. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2628. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2629. ##########################################################################################
  2630. #
  2631. # Write the dist-info directory.
  2632. #
  2633. ##########################################################################################
  2634. # This is just some basic stuff since setuptools just needs this file to
  2635. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2636. # eventually want to merge this with the metadata generator in makewheel.py.
  2637. METADATA = """Metadata-Version: 2.0
  2638. Name: Panda3D
  2639. Version: {version}
  2640. License: BSD
  2641. Home-page: https://www.panda3d.org/
  2642. Author: Panda3D Team
  2643. Author-email: [email protected]
  2644. """
  2645. ENTRY_POINTS = """[distutils.commands]
  2646. build_apps = direct.dist.commands:build_apps
  2647. bdist_apps = direct.dist.commands:bdist_apps
  2648. """
  2649. if not PkgSkip("DIRECT"):
  2650. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2651. MakeDirectory(dist_dir)
  2652. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2653. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2654. ##########################################################################################
  2655. #
  2656. # Generate the PRC files into the ETC directory.
  2657. #
  2658. ##########################################################################################
  2659. confautoprc = ReadFile("makepanda/confauto.in")
  2660. if (PkgSkip("SPEEDTREE")==0):
  2661. # If SpeedTree is available, enable it in the config file
  2662. confautoprc = confautoprc.replace('#st#', '')
  2663. else:
  2664. # otherwise, disable it.
  2665. confautoprc = confautoprc.replace('#st#', '#')
  2666. if PkgSkip("ASSIMP"):
  2667. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2668. if (os.path.isfile("makepanda/myconfig.in")):
  2669. configprc = ReadFile("makepanda/myconfig.in")
  2670. else:
  2671. configprc = ReadFile("makepanda/config.in")
  2672. if (GetTarget() == 'windows'):
  2673. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2674. else:
  2675. configprc = configprc.replace("aux-display pandadx9", "")
  2676. if (GetTarget() == 'darwin'):
  2677. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2678. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2679. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2680. if GetTarget() == 'windows':
  2681. # Convert to Windows newlines.
  2682. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2683. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2684. else:
  2685. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2686. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2687. ##########################################################################################
  2688. #
  2689. # Copy the precompiled binaries and DLLs into the build.
  2690. #
  2691. ##########################################################################################
  2692. tp_dir = GetThirdpartyDir()
  2693. if tp_dir is not None:
  2694. dylibs = {}
  2695. if GetTarget() == 'darwin':
  2696. # Make a list of all the dylibs we ship, to figure out whether we should use
  2697. # install_name_tool to correct the library reference to point to our copy.
  2698. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2699. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2700. if not PkgSkip("PYTHON"):
  2701. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2702. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2703. for pkg in PkgListGet():
  2704. if PkgSkip(pkg):
  2705. continue
  2706. tp_pkg = tp_dir + pkg.lower()
  2707. if GetTarget() == 'windows':
  2708. if os.path.exists(tp_pkg + "/bin"):
  2709. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2710. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2711. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2712. elif GetTarget() == 'darwin':
  2713. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2714. if not PkgSkip("PYTHON"):
  2715. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2716. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2717. if pkg != 'PYTHON':
  2718. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2719. for tp_lib in tp_libs:
  2720. basename = os.path.basename(tp_lib)
  2721. if basename.endswith('.dylib'):
  2722. # It's a dynamic link library. Put it in the lib directory.
  2723. target = GetOutputDir() + "/lib/" + basename
  2724. dep_prefix = "@loader_path/../lib/"
  2725. lib_id = dep_prefix + basename
  2726. else:
  2727. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2728. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2729. target = GetOutputDir() + "/" + basename
  2730. dep_prefix = "@loader_path/lib/"
  2731. lib_id = basename
  2732. if not NeedsBuild([target], [tp_lib]):
  2733. continue
  2734. CopyFile(target, tp_lib)
  2735. if os.path.islink(target) or target.endswith('.py'):
  2736. continue
  2737. # Correct the inter-library dependencies so that the build is relocatable.
  2738. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2739. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2740. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2741. line = line.strip()
  2742. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2743. continue
  2744. libdep = line.split(" ", 1)[0]
  2745. dep_basename = os.path.basename(libdep)
  2746. if dep_basename in dylibs:
  2747. dep_target = dylibs[dep_basename]
  2748. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2749. JustBuilt([target], [tp_lib])
  2750. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2751. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2752. else: # Linux / FreeBSD case.
  2753. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2754. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2755. if not PkgSkip("PYTHON"):
  2756. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2757. base = os.path.basename(tp_lib)
  2758. if base.startswith('lib'):
  2759. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2760. else:
  2761. # It's a Python module, like _rocketcore.so.
  2762. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2763. if GetTarget() == 'windows':
  2764. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2765. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2766. if not PkgSkip("PYTHON") and not RTDIST:
  2767. # We need to copy the Python DLL to the bin directory for now.
  2768. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2769. if GetOptimize() <= 2:
  2770. pydll += "_d.dll"
  2771. else:
  2772. pydll += ".dll"
  2773. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2774. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2775. CopyFile(GetOutputDir() + "/bin/", fn)
  2776. # Copy the whole Python directory.
  2777. if COPY_PYTHON:
  2778. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2779. # NB: Python does not always ship with the correct manifest/dll.
  2780. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2781. manifest = GetOutputDir() + '/tmp/python.manifest'
  2782. if os.path.isfile(manifest):
  2783. os.unlink(manifest)
  2784. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2785. if COPY_PYTHON and os.path.isfile(manifest):
  2786. import xml.etree.ElementTree as ET
  2787. tree = ET.parse(manifest)
  2788. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2789. else:
  2790. idents = ()
  2791. for ident in idents:
  2792. sxs_name = '_'.join([
  2793. ident.get('processorArchitecture'),
  2794. ident.get('name').lower(),
  2795. ident.get('publicKeyToken'),
  2796. ident.get('version'),
  2797. ])
  2798. # Find the manifest matching these parameters.
  2799. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2800. manifests = glob.glob(pattern)
  2801. if not manifests:
  2802. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2803. continue
  2804. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2805. # Also copy the corresponding msvcr dll.
  2806. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2807. for file in glob.glob(pattern):
  2808. CopyFile(GetOutputDir() + "/python/", file)
  2809. # Copy python.exe to ppython.exe.
  2810. if COPY_PYTHON:
  2811. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2812. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2813. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2814. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2815. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2816. # Copy over the MSVC runtime.
  2817. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2818. vsver = "%s%s" % SDK["VISUALSTUDIO_VERSION"]
  2819. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2820. crtname = "Microsoft.VC%s.CRT" % (vsver)
  2821. if ("VCTOOLSVERSION" in SDK):
  2822. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  2823. else:
  2824. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2825. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2826. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2827. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2828. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2829. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2830. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2831. ########################################################################
  2832. ##
  2833. ## Copy various stuff into the build.
  2834. ##
  2835. ########################################################################
  2836. if GetTarget() == 'windows':
  2837. # Convert to Windows newlines so they can be opened by notepad.
  2838. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2839. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2840. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2841. else:
  2842. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2843. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2844. if (PkgSkip("PANDATOOL")==0):
  2845. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2846. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2847. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2848. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2849. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2850. # Since Eigen is included by all sorts of core headers, as a convenience
  2851. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2852. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2853. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2854. ########################################################################
  2855. #
  2856. # Copy header files to the built/include/parser-inc directory.
  2857. #
  2858. ########################################################################
  2859. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2860. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2861. ########################################################################
  2862. #
  2863. # Transfer all header files to the built/include directory.
  2864. #
  2865. ########################################################################
  2866. CopyAllHeaders('dtool/src/dtoolbase')
  2867. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2868. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2869. CopyAllHeaders('dtool/metalibs/dtool')
  2870. CopyAllHeaders('dtool/src/cppparser')
  2871. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2872. CopyAllHeaders('dtool/src/dconfig')
  2873. CopyAllHeaders('dtool/src/interrogatedb')
  2874. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2875. CopyAllHeaders('dtool/src/pystub')
  2876. CopyAllHeaders('dtool/src/interrogate')
  2877. CopyAllHeaders('dtool/src/test_interrogate')
  2878. CopyAllHeaders('panda/src/putil')
  2879. CopyAllHeaders('panda/src/pandabase')
  2880. CopyAllHeaders('panda/src/express')
  2881. CopyAllHeaders('panda/src/downloader')
  2882. CopyAllHeaders('panda/metalibs/pandaexpress')
  2883. CopyAllHeaders('panda/src/pipeline')
  2884. CopyAllHeaders('panda/src/linmath')
  2885. CopyAllHeaders('panda/src/putil')
  2886. CopyAllHeaders('dtool/src/prckeys')
  2887. CopyAllHeaders('panda/src/audio')
  2888. CopyAllHeaders('panda/src/event')
  2889. CopyAllHeaders('panda/src/mathutil')
  2890. CopyAllHeaders('panda/src/gsgbase')
  2891. CopyAllHeaders('panda/src/pnmimage')
  2892. CopyAllHeaders('panda/src/nativenet')
  2893. CopyAllHeaders('panda/src/net')
  2894. CopyAllHeaders('panda/src/pstatclient')
  2895. CopyAllHeaders('panda/src/gobj')
  2896. CopyAllHeaders('panda/src/movies')
  2897. CopyAllHeaders('panda/src/pgraphnodes')
  2898. CopyAllHeaders('panda/src/pgraph')
  2899. CopyAllHeaders('panda/src/cull')
  2900. CopyAllHeaders('panda/src/display')
  2901. CopyAllHeaders('panda/src/chan')
  2902. CopyAllHeaders('panda/src/char')
  2903. CopyAllHeaders('panda/src/dgraph')
  2904. CopyAllHeaders('panda/src/device')
  2905. CopyAllHeaders('panda/src/pnmtext')
  2906. CopyAllHeaders('panda/src/text')
  2907. CopyAllHeaders('panda/src/grutil')
  2908. if (PkgSkip("VISION")==0):
  2909. CopyAllHeaders('panda/src/vision')
  2910. if (PkgSkip("FFMPEG")==0):
  2911. CopyAllHeaders('panda/src/ffmpeg')
  2912. CopyAllHeaders('panda/src/tform')
  2913. CopyAllHeaders('panda/src/collide')
  2914. CopyAllHeaders('panda/src/parametrics')
  2915. CopyAllHeaders('panda/src/pgui')
  2916. CopyAllHeaders('panda/src/pnmimagetypes')
  2917. CopyAllHeaders('panda/src/recorder')
  2918. if (PkgSkip("ROCKET")==0):
  2919. CopyAllHeaders('panda/src/rocket')
  2920. if (PkgSkip("VRPN")==0):
  2921. CopyAllHeaders('panda/src/vrpn')
  2922. CopyAllHeaders('panda/src/wgldisplay')
  2923. CopyAllHeaders('panda/src/ode')
  2924. CopyAllHeaders('panda/metalibs/pandaode')
  2925. if (PkgSkip("PANDAPHYSICS")==0):
  2926. CopyAllHeaders('panda/src/physics')
  2927. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2928. CopyAllHeaders('panda/src/particlesystem')
  2929. CopyAllHeaders('panda/src/dxml')
  2930. CopyAllHeaders('panda/metalibs/panda')
  2931. CopyAllHeaders('panda/src/audiotraits')
  2932. CopyAllHeaders('panda/src/audiotraits')
  2933. CopyAllHeaders('panda/src/distort')
  2934. CopyAllHeaders('panda/src/downloadertools')
  2935. CopyAllHeaders('panda/src/windisplay')
  2936. CopyAllHeaders('panda/src/dxgsg9')
  2937. CopyAllHeaders('panda/metalibs/pandadx9')
  2938. if not PkgSkip("EGG"):
  2939. CopyAllHeaders('panda/src/egg')
  2940. CopyAllHeaders('panda/src/egg2pg')
  2941. CopyAllHeaders('panda/src/framework')
  2942. CopyAllHeaders('panda/metalibs/pandafx')
  2943. CopyAllHeaders('panda/src/glstuff')
  2944. CopyAllHeaders('panda/src/glgsg')
  2945. CopyAllHeaders('panda/src/glesgsg')
  2946. CopyAllHeaders('panda/src/gles2gsg')
  2947. if not PkgSkip("EGG"):
  2948. CopyAllHeaders('panda/metalibs/pandaegg')
  2949. if GetTarget() == 'windows':
  2950. CopyAllHeaders('panda/src/wgldisplay')
  2951. elif GetTarget() == 'darwin':
  2952. CopyAllHeaders('panda/src/osxdisplay')
  2953. CopyAllHeaders('panda/src/cocoadisplay')
  2954. elif GetTarget() == 'android':
  2955. CopyAllHeaders('panda/src/android')
  2956. CopyAllHeaders('panda/src/androiddisplay')
  2957. else:
  2958. CopyAllHeaders('panda/src/x11display')
  2959. CopyAllHeaders('panda/src/glxdisplay')
  2960. CopyAllHeaders('panda/src/egldisplay')
  2961. CopyAllHeaders('panda/metalibs/pandagl')
  2962. CopyAllHeaders('panda/metalibs/pandagles')
  2963. CopyAllHeaders('panda/metalibs/pandagles2')
  2964. CopyAllHeaders('panda/metalibs/pandaphysics')
  2965. CopyAllHeaders('panda/src/testbed')
  2966. if (PkgSkip("PHYSX")==0):
  2967. CopyAllHeaders('panda/src/physx')
  2968. CopyAllHeaders('panda/metalibs/pandaphysx')
  2969. if (PkgSkip("BULLET")==0):
  2970. CopyAllHeaders('panda/src/bullet')
  2971. CopyAllHeaders('panda/metalibs/pandabullet')
  2972. if (PkgSkip("SPEEDTREE")==0):
  2973. CopyAllHeaders('panda/src/speedtree')
  2974. if (PkgSkip("DIRECT")==0):
  2975. CopyAllHeaders('direct/src/directbase')
  2976. CopyAllHeaders('direct/src/dcparser')
  2977. CopyAllHeaders('direct/src/deadrec')
  2978. CopyAllHeaders('direct/src/distributed')
  2979. CopyAllHeaders('direct/src/interval')
  2980. CopyAllHeaders('direct/src/showbase')
  2981. CopyAllHeaders('direct/src/dcparse')
  2982. if (RUNTIME or RTDIST):
  2983. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2984. if (RUNTIME):
  2985. CopyAllHeaders('direct/src/plugin_npapi')
  2986. CopyAllHeaders('direct/src/plugin_standalone')
  2987. if (PkgSkip("PANDATOOL")==0):
  2988. CopyAllHeaders('pandatool/src/pandatoolbase')
  2989. CopyAllHeaders('pandatool/src/converter')
  2990. CopyAllHeaders('pandatool/src/progbase')
  2991. CopyAllHeaders('pandatool/src/eggbase')
  2992. CopyAllHeaders('pandatool/src/bam')
  2993. CopyAllHeaders('pandatool/src/cvscopy')
  2994. CopyAllHeaders('pandatool/src/daeegg')
  2995. CopyAllHeaders('pandatool/src/daeprogs')
  2996. CopyAllHeaders('pandatool/src/dxf')
  2997. CopyAllHeaders('pandatool/src/dxfegg')
  2998. CopyAllHeaders('pandatool/src/dxfprogs')
  2999. CopyAllHeaders('pandatool/src/palettizer')
  3000. CopyAllHeaders('pandatool/src/egg-mkfont')
  3001. CopyAllHeaders('pandatool/src/eggcharbase')
  3002. CopyAllHeaders('pandatool/src/egg-optchar')
  3003. CopyAllHeaders('pandatool/src/egg-palettize')
  3004. CopyAllHeaders('pandatool/src/egg-qtess')
  3005. CopyAllHeaders('pandatool/src/eggprogs')
  3006. CopyAllHeaders('pandatool/src/flt')
  3007. CopyAllHeaders('pandatool/src/fltegg')
  3008. CopyAllHeaders('pandatool/src/fltprogs')
  3009. CopyAllHeaders('pandatool/src/imagebase')
  3010. CopyAllHeaders('pandatool/src/imageprogs')
  3011. CopyAllHeaders('pandatool/src/pfmprogs')
  3012. CopyAllHeaders('pandatool/src/lwo')
  3013. CopyAllHeaders('pandatool/src/lwoegg')
  3014. CopyAllHeaders('pandatool/src/lwoprogs')
  3015. CopyAllHeaders('pandatool/src/maya')
  3016. CopyAllHeaders('pandatool/src/mayaegg')
  3017. CopyAllHeaders('pandatool/src/maxegg')
  3018. CopyAllHeaders('pandatool/src/maxprogs')
  3019. CopyAllHeaders('pandatool/src/objegg')
  3020. CopyAllHeaders('pandatool/src/objprogs')
  3021. CopyAllHeaders('pandatool/src/vrml')
  3022. CopyAllHeaders('pandatool/src/vrmlegg')
  3023. CopyAllHeaders('pandatool/src/xfile')
  3024. CopyAllHeaders('pandatool/src/xfileegg')
  3025. CopyAllHeaders('pandatool/src/ptloader')
  3026. CopyAllHeaders('pandatool/src/miscprogs')
  3027. CopyAllHeaders('pandatool/src/pstatserver')
  3028. CopyAllHeaders('pandatool/src/text-stats')
  3029. CopyAllHeaders('pandatool/src/vrmlprogs')
  3030. CopyAllHeaders('pandatool/src/win-stats')
  3031. CopyAllHeaders('pandatool/src/xfileprogs')
  3032. if (PkgSkip("CONTRIB")==0):
  3033. CopyAllHeaders('contrib/src/contribbase')
  3034. CopyAllHeaders('contrib/src/ai')
  3035. ########################################################################
  3036. #
  3037. # These definitions are syntactic shorthand. They make it easy
  3038. # to link with the usual libraries without listing them all.
  3039. #
  3040. ########################################################################
  3041. COMMON_DTOOL_LIBS=[
  3042. 'libp3dtool.dll',
  3043. 'libp3dtoolconfig.dll',
  3044. ]
  3045. COMMON_PANDA_LIBS=[
  3046. 'libpanda.dll',
  3047. 'libpandaexpress.dll'
  3048. ] + COMMON_DTOOL_LIBS
  3049. COMMON_EGG2X_LIBS=[
  3050. 'libp3eggbase.lib',
  3051. 'libp3progbase.lib',
  3052. 'libp3converter.lib',
  3053. 'libp3pandatoolbase.lib',
  3054. 'libpandaegg.dll',
  3055. ] + COMMON_PANDA_LIBS
  3056. ########################################################################
  3057. #
  3058. # This section contains a list of all the files that need to be compiled.
  3059. #
  3060. ########################################################################
  3061. print("Generating dependencies...")
  3062. sys.stdout.flush()
  3063. #
  3064. # Compile Panda icon resource file.
  3065. # We do it first because we need it at
  3066. # the time we compile an executable.
  3067. #
  3068. if GetTarget() == 'windows':
  3069. OPTS=['DIR:panda/src/configfiles']
  3070. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3071. #
  3072. # DIRECTORY: dtool/src/dtoolbase/
  3073. #
  3074. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  3075. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3076. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3077. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3078. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3079. #
  3080. # DIRECTORY: dtool/src/dtoolutil/
  3081. #
  3082. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3083. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3084. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3085. if GetTarget() == 'darwin':
  3086. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3087. #
  3088. # DIRECTORY: dtool/metalibs/dtool/
  3089. #
  3090. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3091. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3092. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3093. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3094. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3095. if GetTarget() == 'darwin':
  3096. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3097. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3098. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3099. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3100. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3101. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  3102. #
  3103. # DIRECTORY: dtool/src/cppparser/
  3104. #
  3105. if (not RUNTIME):
  3106. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3107. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3108. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3109. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3110. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3111. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3112. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3113. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3114. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3115. #
  3116. # DIRECTORY: dtool/src/prc/
  3117. #
  3118. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3119. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3120. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3121. #
  3122. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3123. #
  3124. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3125. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3126. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3127. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3128. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3129. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3130. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3131. #
  3132. # DIRECTORY: dtool/src/interrogatedb/
  3133. #
  3134. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3135. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3136. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3137. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3138. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3139. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3140. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3141. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3142. # stuff, so it has been renamed appropriately.
  3143. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3144. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3145. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3146. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3147. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3148. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3149. #
  3150. # DIRECTORY: dtool/src/pystub/
  3151. #
  3152. if not RUNTIME and not RTDIST:
  3153. OPTS=['DIR:dtool/src/pystub']
  3154. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3155. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3156. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3157. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3158. #
  3159. # DIRECTORY: dtool/src/interrogate/
  3160. #
  3161. if (not RUNTIME):
  3162. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3163. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3164. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3165. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3166. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3167. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3168. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3169. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3170. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3171. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3172. 'dtool/src/interrogatedb/py_panda.cxx',
  3173. 'dtool/src/interrogatedb/py_compat.cxx',
  3174. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3175. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3176. ])
  3177. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3178. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3179. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3180. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3181. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3182. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3183. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3184. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3185. if (not RTDIST):
  3186. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3187. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3188. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3189. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3190. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3191. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3192. #
  3193. # DIRECTORY: dtool/src/prckeys/
  3194. #
  3195. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3196. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3197. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3198. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3199. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3200. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3201. #
  3202. # DIRECTORY: dtool/src/test_interrogate/
  3203. #
  3204. if (not RTDIST and not RUNTIME):
  3205. OPTS=['DIR:dtool/src/test_interrogate']
  3206. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3207. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3208. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3209. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3210. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3211. #
  3212. # DIRECTORY: dtool/src/dtoolbase/
  3213. #
  3214. OPTS=['DIR:dtool/src/dtoolbase']
  3215. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3216. IGATEFILES += [
  3217. "typeHandle.h",
  3218. "typeHandle_ext.h",
  3219. "typeRegistry.h",
  3220. "typedObject.h",
  3221. "neverFreeMemory.h",
  3222. ]
  3223. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3224. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3225. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3226. #
  3227. # DIRECTORY: dtool/src/dtoolutil/
  3228. #
  3229. OPTS=['DIR:dtool/src/dtoolutil']
  3230. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3231. IGATEFILES += [
  3232. "config_dtoolutil.h",
  3233. "pandaSystem.h",
  3234. "dSearchPath.h",
  3235. "executionEnvironment.h",
  3236. "textEncoder.h",
  3237. "textEncoder_ext.h",
  3238. "filename.h",
  3239. "filename_ext.h",
  3240. "globPattern.h",
  3241. "globPattern_ext.h",
  3242. "pandaFileStream.h",
  3243. "lineStream.h",
  3244. ]
  3245. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3246. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3247. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3248. #
  3249. # DIRECTORY: dtool/src/prc/
  3250. #
  3251. OPTS=['DIR:dtool/src/prc']
  3252. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3253. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3254. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3255. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3256. #
  3257. # DIRECTORY: panda/src/pandabase/
  3258. #
  3259. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3260. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3261. #
  3262. # DIRECTORY: panda/src/express/
  3263. #
  3264. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3265. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3266. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3267. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3268. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3269. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3270. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3271. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3272. #
  3273. # DIRECTORY: panda/src/downloader/
  3274. #
  3275. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3276. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3277. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3278. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3279. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3280. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3281. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3282. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3283. #
  3284. # DIRECTORY: panda/metalibs/pandaexpress/
  3285. #
  3286. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3287. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3288. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3289. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3290. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3291. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3292. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3293. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3294. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3295. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3296. #
  3297. # DIRECTORY: panda/src/pipeline/
  3298. #
  3299. if (not RUNTIME):
  3300. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3301. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3302. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3303. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3304. OPTS=['DIR:panda/src/pipeline']
  3305. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3306. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3307. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3308. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3309. #
  3310. # DIRECTORY: panda/src/linmath/
  3311. #
  3312. if (not RUNTIME):
  3313. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3314. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3315. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3316. OPTS=['DIR:panda/src/linmath']
  3317. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3318. for ifile in IGATEFILES[:]:
  3319. if "_src." in ifile:
  3320. IGATEFILES.remove(ifile)
  3321. IGATEFILES.remove('cast_to_double.h')
  3322. IGATEFILES.remove('lmat_ops.h')
  3323. IGATEFILES.remove('cast_to_float.h')
  3324. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3325. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3326. #
  3327. # DIRECTORY: panda/src/putil/
  3328. #
  3329. if (not RUNTIME):
  3330. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3331. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3332. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3333. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3334. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3335. IGATEFILES.remove("test_bam.h")
  3336. IGATEFILES.remove("config_util.h")
  3337. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3338. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3339. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3340. #
  3341. # DIRECTORY: panda/src/audio/
  3342. #
  3343. if (not RUNTIME):
  3344. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3345. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3346. OPTS=['DIR:panda/src/audio']
  3347. IGATEFILES=["audio.h"]
  3348. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3349. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3350. #
  3351. # DIRECTORY: panda/src/event/
  3352. #
  3353. if (not RUNTIME):
  3354. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3355. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3356. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3357. OPTS=['DIR:panda/src/event']
  3358. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3359. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3360. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3361. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3362. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3363. #
  3364. # DIRECTORY: panda/src/mathutil/
  3365. #
  3366. if (not RUNTIME):
  3367. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3368. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3369. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3370. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3371. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3372. for ifile in IGATEFILES[:]:
  3373. if "_src." in ifile:
  3374. IGATEFILES.remove(ifile)
  3375. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3376. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3377. #
  3378. # DIRECTORY: panda/src/gsgbase/
  3379. #
  3380. if (not RUNTIME):
  3381. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3382. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3383. OPTS=['DIR:panda/src/gsgbase']
  3384. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3385. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3386. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3387. #
  3388. # DIRECTORY: panda/src/pnmimage/
  3389. #
  3390. if (not RUNTIME):
  3391. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3392. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3393. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3394. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3395. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3396. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3397. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3398. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3399. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3400. #
  3401. # DIRECTORY: panda/src/nativenet/
  3402. #
  3403. if (not RUNTIME):
  3404. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3405. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3406. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3407. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3408. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3409. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3410. #
  3411. # DIRECTORY: panda/src/net/
  3412. #
  3413. if (not RUNTIME):
  3414. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3415. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3416. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3417. OPTS=['DIR:panda/src/net']
  3418. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3419. IGATEFILES.remove("datagram_ui.h")
  3420. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3421. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3422. #
  3423. # DIRECTORY: panda/src/pstatclient/
  3424. #
  3425. if (not RUNTIME):
  3426. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3427. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3428. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3429. OPTS=['DIR:panda/src/pstatclient']
  3430. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3431. IGATEFILES.remove("config_pstats.h")
  3432. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3433. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3434. #
  3435. # DIRECTORY: panda/src/gobj/
  3436. #
  3437. if (not RUNTIME):
  3438. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3439. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3440. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3441. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3442. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3443. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3444. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3445. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3446. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3447. #
  3448. # DIRECTORY: panda/src/pgraphnodes/
  3449. #
  3450. if (not RUNTIME):
  3451. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3452. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3453. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3454. OPTS=['DIR:panda/src/pgraphnodes']
  3455. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3456. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3457. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3458. #
  3459. # DIRECTORY: panda/src/pgraph/
  3460. #
  3461. if (not RUNTIME):
  3462. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3463. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3464. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3465. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3466. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3467. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3468. OPTS=['DIR:panda/src/pgraph']
  3469. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3470. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3471. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3472. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3473. #
  3474. # DIRECTORY: panda/src/cull/
  3475. #
  3476. if (not RUNTIME):
  3477. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3478. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3479. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3480. OPTS=['DIR:panda/src/cull']
  3481. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3482. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3483. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3484. #
  3485. # DIRECTORY: panda/src/dgraph/
  3486. #
  3487. if (not RUNTIME):
  3488. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3489. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3490. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3491. OPTS=['DIR:panda/src/dgraph']
  3492. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3493. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3494. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3495. #
  3496. # DIRECTORY: panda/src/device/
  3497. #
  3498. if (not RUNTIME):
  3499. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3500. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3501. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3502. OPTS=['DIR:panda/src/device']
  3503. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3504. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3505. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3506. #
  3507. # DIRECTORY: panda/src/display/
  3508. #
  3509. if (not RUNTIME):
  3510. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3511. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3512. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3513. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3514. OPTS=['DIR:panda/src/display', 'X11']
  3515. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3516. IGATEFILES.remove("renderBuffer.h")
  3517. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3518. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3519. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3520. if RTDIST and GetTarget() == 'darwin':
  3521. OPTS=['DIR:panda/src/display']
  3522. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3523. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3524. #
  3525. # DIRECTORY: panda/src/chan/
  3526. #
  3527. if (not RUNTIME):
  3528. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3529. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3530. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3531. OPTS=['DIR:panda/src/chan']
  3532. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3533. IGATEFILES.remove('movingPart.h')
  3534. IGATEFILES.remove('animChannelFixed.h')
  3535. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3536. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3537. # DIRECTORY: panda/src/char/
  3538. #
  3539. if (not RUNTIME):
  3540. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3541. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3542. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3543. OPTS=['DIR:panda/src/char']
  3544. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3545. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3546. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3547. #
  3548. # DIRECTORY: panda/src/pnmtext/
  3549. #
  3550. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3551. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3552. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3553. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3554. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3555. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3556. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3557. #
  3558. # DIRECTORY: panda/src/text/
  3559. #
  3560. if (not RUNTIME):
  3561. if not PkgSkip("HARFBUZZ"):
  3562. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3563. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3564. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3565. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3566. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3567. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3568. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3569. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3570. #
  3571. # DIRECTORY: panda/src/movies/
  3572. #
  3573. if (not RUNTIME):
  3574. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3575. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3576. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3577. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3578. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3579. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3580. #
  3581. # DIRECTORY: panda/src/grutil/
  3582. #
  3583. if (not RUNTIME):
  3584. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3585. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3586. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3587. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3588. OPTS=['DIR:panda/src/grutil']
  3589. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3590. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3591. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3592. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3593. #
  3594. # DIRECTORY: panda/src/tform/
  3595. #
  3596. if (not RUNTIME):
  3597. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3598. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3599. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3600. OPTS=['DIR:panda/src/tform']
  3601. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3602. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3603. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3604. #
  3605. # DIRECTORY: panda/src/collide/
  3606. #
  3607. if (not RUNTIME):
  3608. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3609. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3610. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3611. OPTS=['DIR:panda/src/collide']
  3612. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3613. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3614. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3615. #
  3616. # DIRECTORY: panda/src/parametrics/
  3617. #
  3618. if (not RUNTIME):
  3619. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3620. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3621. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3622. OPTS=['DIR:panda/src/parametrics']
  3623. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3624. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3625. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3626. #
  3627. # DIRECTORY: panda/src/pgui/
  3628. #
  3629. if (not RUNTIME):
  3630. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3631. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3632. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3633. OPTS=['DIR:panda/src/pgui']
  3634. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3635. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3636. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3637. #
  3638. # DIRECTORY: panda/src/pnmimagetypes/
  3639. #
  3640. if (not RUNTIME):
  3641. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3642. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3643. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3644. #
  3645. # DIRECTORY: panda/src/recorder/
  3646. #
  3647. if (not RUNTIME):
  3648. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3649. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3650. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3651. OPTS=['DIR:panda/src/recorder']
  3652. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3653. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3654. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3655. #
  3656. # DIRECTORY: panda/src/dxml/
  3657. #
  3658. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3659. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3660. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3661. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3662. if (not RUNTIME):
  3663. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3664. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3665. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3666. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3667. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3668. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3669. #
  3670. # DIRECTORY: panda/metalibs/panda/
  3671. #
  3672. if (not RUNTIME):
  3673. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3674. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3675. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3676. 'SETUPAPI']
  3677. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3678. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3679. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3680. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3681. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3682. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3683. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3684. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3685. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3686. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3687. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3688. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3689. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3690. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3691. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3692. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3693. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3694. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3695. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3696. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3697. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3698. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3699. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3700. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3701. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3702. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3703. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3704. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3705. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3706. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3707. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3708. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3709. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3710. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3711. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3712. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3713. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3714. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3715. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3716. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3717. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3718. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3719. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3720. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3721. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3722. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3723. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3724. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3725. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3726. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3727. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3728. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3729. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3730. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3731. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3732. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3733. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3734. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3735. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3736. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3737. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3738. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3739. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3740. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3741. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3742. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3743. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3744. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3745. if PkgSkip("FREETYPE")==0:
  3746. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3747. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3748. TargetAdd('libpanda.dll', opts=OPTS)
  3749. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3750. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3751. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3752. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3753. PyTargetAdd('core_module.obj', input='libp3express.in')
  3754. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3755. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3756. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3757. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3758. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3759. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3760. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3761. PyTargetAdd('core_module.obj', input='libp3char.in')
  3762. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3763. PyTargetAdd('core_module.obj', input='libp3device.in')
  3764. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3765. PyTargetAdd('core_module.obj', input='libp3display.in')
  3766. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3767. PyTargetAdd('core_module.obj', input='libp3event.in')
  3768. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3769. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3770. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3771. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3772. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3773. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3774. PyTargetAdd('core_module.obj', input='libp3text.in')
  3775. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3776. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3777. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3778. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3779. PyTargetAdd('core_module.obj', input='libp3net.in')
  3780. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3781. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3782. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3783. if PkgSkip("FREETYPE")==0:
  3784. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3785. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3786. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3787. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3788. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3789. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3790. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3791. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3792. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3793. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3794. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3795. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3796. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3797. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3798. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3799. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3800. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3801. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3802. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3803. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3804. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3805. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3806. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3807. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3808. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3809. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  3810. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3811. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3812. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3813. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3814. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3815. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3816. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  3817. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  3818. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  3819. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  3820. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3821. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  3822. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3823. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3824. if PkgSkip("FREETYPE")==0:
  3825. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3826. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3827. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3828. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3829. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  3830. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3831. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3832. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3833. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  3834. PyTargetAdd('core.pyd', input='core_module.obj')
  3835. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3836. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3837. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3838. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3839. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  3840. #
  3841. # DIRECTORY: panda/src/vision/
  3842. #
  3843. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3844. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3845. if not PkgSkip("FFMPEG"):
  3846. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3847. if not PkgSkip("OPENCV"):
  3848. DefSymbol("OPENCV", "HAVE_OPENCV")
  3849. if OPENCV_VER_23:
  3850. DefSymbol("OPENCV", "OPENCV_VER_23")
  3851. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3852. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3853. 'dtool_have_ffmpeg.dat',
  3854. 'dtool_have_opencv.dat',
  3855. 'dtool_have_directcam.dat',
  3856. ])
  3857. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3858. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3859. TargetAdd('libp3vision.dll', opts=OPTS)
  3860. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3861. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3862. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3863. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3864. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  3865. PyTargetAdd('vision_module.obj', opts=OPTS)
  3866. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3867. PyTargetAdd('vision.pyd', input='vision_module.obj')
  3868. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3869. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  3870. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3871. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3872. #
  3873. # DIRECTORY: panda/src/rocket/
  3874. #
  3875. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3876. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3877. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3878. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3879. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3880. TargetAdd('libp3rocket.dll', opts=OPTS)
  3881. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS']
  3882. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3883. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3884. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3885. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3886. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3887. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  3888. PyTargetAdd('rocket_module.obj', opts=OPTS)
  3889. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3890. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  3891. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3892. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3893. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  3894. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3895. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3896. PyTargetAdd('rocket.pyd', opts=['ROCKET'])
  3897. #
  3898. # DIRECTORY: panda/src/p3skel
  3899. #
  3900. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3901. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3902. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3903. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  3904. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3905. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3906. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3907. #
  3908. # DIRECTORY: panda/src/p3skel
  3909. #
  3910. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3911. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3912. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3913. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3914. TargetAdd('libpandaskel.dll', opts=OPTS)
  3915. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  3916. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3917. PyTargetAdd('skel.pyd', input='skel_module.obj')
  3918. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3919. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  3920. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3921. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3922. #
  3923. # DIRECTORY: panda/src/distort/
  3924. #
  3925. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3926. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3927. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3928. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  3929. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3930. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3931. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3932. #
  3933. # DIRECTORY: panda/metalibs/pandafx/
  3934. #
  3935. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3936. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3937. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3938. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3939. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3940. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3941. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3942. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  3943. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  3944. PyTargetAdd('fx_module.obj', opts=OPTS)
  3945. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3946. PyTargetAdd('fx.pyd', input='fx_module.obj')
  3947. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3948. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  3949. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3950. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3951. #
  3952. # DIRECTORY: panda/src/vrpn/
  3953. #
  3954. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3955. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3956. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3957. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3958. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3959. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3960. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  3961. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3962. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3963. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3964. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3965. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  3966. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3967. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3968. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3969. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3970. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3971. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3972. #
  3973. # DIRECTORY: panda/src/ffmpeg
  3974. #
  3975. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3976. if not PkgSkip("SWSCALE"):
  3977. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3978. if not PkgSkip("SWRESAMPLE"):
  3979. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3980. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3981. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3982. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3983. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3984. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3985. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3986. #
  3987. # DIRECTORY: panda/src/audiotraits/
  3988. #
  3989. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3990. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3991. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3992. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3993. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3994. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3995. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3996. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3997. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3998. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3999. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4000. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4001. #
  4002. # DIRECTORY: panda/src/downloadertools/
  4003. #
  4004. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4005. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4006. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4007. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4008. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4009. TargetAdd('apply_patch.exe', opts=OPTS)
  4010. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4011. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4012. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4013. TargetAdd('build_patch.exe', opts=OPTS)
  4014. if not PkgSkip("ZLIB"):
  4015. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4016. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4017. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4018. TargetAdd('check_adler.exe', opts=OPTS)
  4019. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4020. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4021. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4022. TargetAdd('check_crc.exe', opts=OPTS)
  4023. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4024. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4025. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4026. TargetAdd('check_md5.exe', opts=OPTS)
  4027. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4028. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4029. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4030. TargetAdd('pdecrypt.exe', opts=OPTS)
  4031. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4032. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4033. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4034. TargetAdd('pencrypt.exe', opts=OPTS)
  4035. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4036. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4037. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4038. TargetAdd('show_ddb.exe', opts=OPTS)
  4039. #
  4040. # DIRECTORY: panda/src/downloadertools/
  4041. #
  4042. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4043. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4044. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4045. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4046. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4047. TargetAdd('multify.exe', opts=OPTS)
  4048. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4049. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4050. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4051. TargetAdd('pzip.exe', opts=OPTS)
  4052. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4053. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4054. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4055. TargetAdd('punzip.exe', opts=OPTS)
  4056. #
  4057. # DIRECTORY: panda/src/windisplay/
  4058. #
  4059. if (GetTarget() == 'windows' and not RUNTIME):
  4060. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4061. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4062. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4063. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4064. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4065. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4066. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4067. #
  4068. # DIRECTORY: panda/metalibs/pandadx9/
  4069. #
  4070. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4071. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4072. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4073. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4074. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4075. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4076. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4077. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4078. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4079. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4080. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4081. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4082. #
  4083. # DIRECTORY: panda/src/egg/
  4084. #
  4085. if not RUNTIME and not PkgSkip("EGG"):
  4086. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  4087. CreateFile(GetOutputDir()+"/include/parser.h")
  4088. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4089. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4090. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4091. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4092. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4093. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4094. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4095. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4096. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4097. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4098. PyTargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  4099. #
  4100. # DIRECTORY: panda/src/egg2pg/
  4101. #
  4102. if not RUNTIME and not PkgSkip("EGG"):
  4103. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4104. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4105. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4106. OPTS=['DIR:panda/src/egg2pg']
  4107. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4108. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4109. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4110. #
  4111. # DIRECTORY: panda/src/framework/
  4112. #
  4113. if (not RUNTIME):
  4114. deps = []
  4115. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4116. if GetLinkAllStatic():
  4117. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4118. if not PkgSkip("GL"):
  4119. DefSymbol("FRAMEWORK", "HAVE_GL")
  4120. if not PkgSkip("TINYDISPLAY"):
  4121. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4122. if not PkgSkip("EGG"):
  4123. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4124. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4125. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4126. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4127. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4128. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4129. #
  4130. # DIRECTORY: panda/src/glgsg/
  4131. #
  4132. if (not RUNTIME and PkgSkip("GL")==0):
  4133. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4134. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4135. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4136. #
  4137. # DIRECTORY: panda/src/glesgsg/
  4138. #
  4139. if (not RUNTIME and PkgSkip("GLES")==0):
  4140. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4141. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4142. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4143. #
  4144. # DIRECTORY: panda/src/gles2gsg/
  4145. #
  4146. if (not RUNTIME and PkgSkip("GLES2")==0):
  4147. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4148. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4149. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4150. #
  4151. # DIRECTORY: panda/metalibs/pandaegg/
  4152. #
  4153. if not RUNTIME and not PkgSkip("EGG"):
  4154. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4155. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4156. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4157. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4158. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4159. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4160. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4161. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4162. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4163. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4164. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4165. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4166. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4167. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4168. PyTargetAdd('egg_module.obj', opts=OPTS)
  4169. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4170. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4171. PyTargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4172. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4173. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4174. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4175. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4176. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4177. #
  4178. # DIRECTORY: panda/src/x11display/
  4179. #
  4180. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4181. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4182. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4183. #
  4184. # DIRECTORY: panda/src/glxdisplay/
  4185. #
  4186. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4187. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4188. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4189. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4190. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4191. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4192. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4193. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4194. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4195. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4196. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4197. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4198. #
  4199. # DIRECTORY: panda/src/cocoadisplay/
  4200. #
  4201. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4202. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4203. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4204. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4205. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4206. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4207. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4208. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4209. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4210. if (PkgSkip('PANDAFX')==0):
  4211. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4212. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4213. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4214. #
  4215. # DIRECTORY: panda/src/osxdisplay/
  4216. #
  4217. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4218. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4219. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4220. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4221. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4222. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4223. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4224. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4225. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4226. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4227. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4228. if (PkgSkip('PANDAFX')==0):
  4229. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4230. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4231. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4232. #
  4233. # DIRECTORY: panda/src/wgldisplay/
  4234. #
  4235. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4236. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4237. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4238. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4239. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4240. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4241. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4242. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4243. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4244. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4245. if (PkgSkip('PANDAFX')==0):
  4246. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4247. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4248. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4249. #
  4250. # DIRECTORY: panda/src/egldisplay/
  4251. #
  4252. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4253. DefSymbol('GLES', 'OPENGLES_1', '')
  4254. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4255. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4256. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4257. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4258. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4259. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4260. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4261. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4262. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4263. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4264. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4265. #
  4266. # DIRECTORY: panda/src/egldisplay/
  4267. #
  4268. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4269. DefSymbol('GLES2', 'OPENGLES_2', '')
  4270. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4271. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4272. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4273. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4274. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4275. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4276. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4277. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4278. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4279. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4280. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4281. #
  4282. # DIRECTORY: panda/src/ode/
  4283. #
  4284. if (PkgSkip("ODE")==0 and not RUNTIME):
  4285. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4286. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4287. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4288. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4289. OPTS=['DIR:panda/src/ode', 'ODE']
  4290. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4291. IGATEFILES.remove("odeConvexGeom.h")
  4292. IGATEFILES.remove("odeHelperStructs.h")
  4293. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4294. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4295. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4296. #
  4297. # DIRECTORY: panda/metalibs/pandaode/
  4298. #
  4299. if (PkgSkip("ODE")==0 and not RUNTIME):
  4300. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4301. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4302. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4303. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4304. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4305. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4306. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4307. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4308. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4309. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4310. PyTargetAdd('ode_module.obj', opts=OPTS)
  4311. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4312. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4313. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4314. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4315. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4316. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4317. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4318. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4319. #
  4320. # DIRECTORY: panda/src/bullet/
  4321. #
  4322. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4323. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4324. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4325. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4326. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4327. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4328. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4329. #
  4330. # DIRECTORY: panda/metalibs/pandabullet/
  4331. #
  4332. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4333. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4334. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4335. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4336. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4337. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4338. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4339. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4340. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4341. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4342. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4343. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4344. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4345. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4346. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4347. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4348. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4349. #
  4350. # DIRECTORY: panda/src/physx/
  4351. #
  4352. if (PkgSkip("PHYSX")==0):
  4353. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4354. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4355. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC']
  4356. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4357. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4358. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4359. #
  4360. # DIRECTORY: panda/metalibs/pandaphysx/
  4361. #
  4362. if (PkgSkip("PHYSX")==0):
  4363. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4364. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4365. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4366. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4367. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4368. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'PYTHON'])
  4369. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC']
  4370. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4371. PyTargetAdd('physx_module.obj', opts=OPTS)
  4372. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4373. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4374. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4375. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4376. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4377. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4378. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4379. #
  4380. # DIRECTORY: panda/src/physics/
  4381. #
  4382. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4383. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4384. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4385. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4386. OPTS=['DIR:panda/src/physics']
  4387. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4388. IGATEFILES.remove("forces.h")
  4389. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4390. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4391. #
  4392. # DIRECTORY: panda/src/particlesystem/
  4393. #
  4394. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4395. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4396. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4397. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4398. OPTS=['DIR:panda/src/particlesystem']
  4399. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4400. IGATEFILES.remove('orientedParticle.h')
  4401. IGATEFILES.remove('orientedParticleFactory.h')
  4402. IGATEFILES.remove('particlefactories.h')
  4403. IGATEFILES.remove('emitters.h')
  4404. IGATEFILES.remove('particles.h')
  4405. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4406. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4407. #
  4408. # DIRECTORY: panda/metalibs/pandaphysics/
  4409. #
  4410. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4411. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4412. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4413. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4414. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4415. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4416. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4417. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4418. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4419. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4420. OPTS=['DIR:panda/metalibs/pandaphysics']
  4421. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4422. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4423. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4424. PyTargetAdd('physics_module.obj', opts=OPTS)
  4425. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4426. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4427. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4428. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4429. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4430. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4431. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4432. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4433. #
  4434. # DIRECTORY: panda/src/speedtree/
  4435. #
  4436. if (PkgSkip("SPEEDTREE")==0):
  4437. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4438. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4439. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4440. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4441. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4442. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4443. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4444. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4445. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4446. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4447. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4448. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4449. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4450. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4451. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4452. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4453. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4454. #
  4455. # DIRECTORY: panda/src/testbed/
  4456. #
  4457. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4458. OPTS=['DIR:panda/src/testbed']
  4459. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4460. TargetAdd('pview.exe', input='pview_pview.obj')
  4461. TargetAdd('pview.exe', input='libp3framework.dll')
  4462. if not PkgSkip("EGG"):
  4463. TargetAdd('pview.exe', input='libpandaegg.dll')
  4464. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4465. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4466. if GetLinkAllStatic() and not PkgSkip("GL"):
  4467. TargetAdd('pview.exe', input='libpandagl.dll')
  4468. #
  4469. # DIRECTORY: panda/src/android/
  4470. #
  4471. if (not RUNTIME and GetTarget() == 'android'):
  4472. OPTS=['DIR:panda/src/android']
  4473. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4474. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4475. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4476. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4477. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4478. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4479. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4480. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4481. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4482. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4483. if (not RTDIST and PkgSkip("PVIEW")==0):
  4484. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4485. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4486. TargetAdd('libpview.dll', input='android_main.obj')
  4487. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4488. TargetAdd('libpview.dll', input='libp3framework.dll')
  4489. if not PkgSkip("EGG"):
  4490. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4491. TargetAdd('libpview.dll', input='libp3android.dll')
  4492. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4493. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4494. if (not RTDIST and PkgSkip("PYTHON")==0):
  4495. OPTS += ['PYTHON']
  4496. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4497. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4498. TargetAdd('libppython.dll', input='android_main.obj')
  4499. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4500. TargetAdd('libppython.dll', input='libp3framework.dll')
  4501. TargetAdd('libppython.dll', input='libp3android.dll')
  4502. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4503. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4504. #
  4505. # DIRECTORY: panda/src/androiddisplay/
  4506. #
  4507. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4508. DefSymbol('GLES', 'OPENGLES_1', '')
  4509. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4510. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4511. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4512. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4513. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4514. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4515. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4516. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4517. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4518. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4519. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4520. #
  4521. # DIRECTORY: panda/src/tinydisplay/
  4522. #
  4523. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4524. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4525. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4526. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4527. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4528. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4529. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4530. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4531. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4532. if GetTarget() == 'darwin':
  4533. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4534. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4535. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4536. elif GetTarget() == 'windows':
  4537. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4538. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4539. else:
  4540. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4541. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4542. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4543. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4544. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4545. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4546. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4547. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4548. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4549. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4550. #
  4551. # DIRECTORY: direct/src/directbase/
  4552. #
  4553. if (PkgSkip("DIRECT")==0):
  4554. OPTS=['DIR:direct/src/directbase']
  4555. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4556. #
  4557. # DIRECTORY: direct/src/dcparser/
  4558. #
  4559. if (PkgSkip("DIRECT")==0):
  4560. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4561. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4562. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4563. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4564. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4565. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4566. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4567. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4568. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4569. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4570. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4571. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4572. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4573. #
  4574. # DIRECTORY: direct/src/deadrec/
  4575. #
  4576. if (PkgSkip("DIRECT")==0):
  4577. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4578. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4579. OPTS=['DIR:direct/src/deadrec']
  4580. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4581. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4582. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4583. #
  4584. # DIRECTORY: direct/src/distributed/
  4585. #
  4586. if (PkgSkip("DIRECT")==0):
  4587. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL']
  4588. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4589. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4590. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4591. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL']
  4592. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4593. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4594. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4595. #
  4596. # DIRECTORY: direct/src/interval/
  4597. #
  4598. if (PkgSkip("DIRECT")==0):
  4599. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4600. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4601. OPTS=['DIR:direct/src/interval']
  4602. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4603. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4604. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4605. #
  4606. # DIRECTORY: direct/src/showbase/
  4607. #
  4608. if (PkgSkip("DIRECT")==0):
  4609. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4610. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4611. if GetTarget() == 'darwin':
  4612. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4613. OPTS=['DIR:direct/src/showbase']
  4614. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4615. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4616. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4617. #
  4618. # DIRECTORY: direct/src/motiontrail/
  4619. #
  4620. if (PkgSkip("DIRECT")==0):
  4621. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4622. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4623. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4624. OPTS=['DIR:direct/src/motiontrail']
  4625. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4626. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4627. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4628. #
  4629. # DIRECTORY: direct/metalibs/direct/
  4630. #
  4631. if (PkgSkip("DIRECT")==0):
  4632. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4633. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4634. if GetTarget() == 'darwin':
  4635. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4636. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4637. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4638. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4639. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4640. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4641. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4642. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4643. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4644. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4645. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4646. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4647. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4648. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4649. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4650. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4651. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4652. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4653. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4654. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4655. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4656. # the Python libraries. If a C++ user needs these modules, we can move them
  4657. # back and filter out the Python-specific code.
  4658. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4659. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4660. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4661. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4662. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4663. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4664. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4665. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4666. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4667. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4668. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4669. PyTargetAdd('direct.pyd', opts=['OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2'])
  4670. #
  4671. # DIRECTORY: direct/src/dcparse/
  4672. #
  4673. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4674. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4675. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4676. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4677. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4678. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4679. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4680. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4681. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4682. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4683. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4684. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4685. #
  4686. # DIRECTORY: direct/src/plugin/
  4687. #
  4688. if (RTDIST or RUNTIME):
  4689. # Explicitly define this as we don't include dtool_config.h here.
  4690. if GetTarget() not in ('windows', 'darwin'):
  4691. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4692. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4693. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4694. OPTS += ['ZLIB', 'MSIMG']
  4695. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4696. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4697. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4698. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4699. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4700. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4701. if GetTarget() == 'darwin':
  4702. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4703. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4704. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4705. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4706. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4707. if (RTDIST):
  4708. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4709. TargetAdd(fname, input='plugin_plugin.obj')
  4710. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4711. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4712. TargetAdd(fname, input='plugin_parse_color.obj')
  4713. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4714. if GetTarget() == 'darwin':
  4715. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4716. TargetAdd(fname, input='plugin_fileSpec.obj')
  4717. TargetAdd(fname, input='plugin_binaryXml.obj')
  4718. TargetAdd(fname, input='plugin_handleStream.obj')
  4719. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4720. TargetAdd(fname, input='libp3tinyxml.ilb')
  4721. if GetTarget() == 'darwin':
  4722. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4723. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4724. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4725. if (PkgSkip("PYTHON")==0 and RTDIST):
  4726. # Freeze VFSImporter and its dependency modules into p3dpython.
  4727. # Mark panda3d.core as a dependency to make sure to build that first.
  4728. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  4729. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4730. OPTS += ['PYTHON']
  4731. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4732. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4733. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4734. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4735. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4736. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4737. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4738. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4739. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4740. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4741. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4742. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4743. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4744. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4745. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4746. if GetTarget() == 'windows':
  4747. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4748. OPTS.append("NON_CONSOLE")
  4749. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4750. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4751. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4752. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4753. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4754. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4755. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4756. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4757. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  4758. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4759. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4760. if GetTarget() == 'darwin':
  4761. OPTS += ['OPT:2']
  4762. if (PkgSkip("FLTK")==0):
  4763. OPTS.append("FLTK")
  4764. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4765. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4766. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4767. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4768. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4769. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4770. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4771. if GetTarget() == 'darwin':
  4772. OPTS += ['OPT:2']
  4773. TargetAdd('p3dcert.exe', opts=OPTS)
  4774. elif (PkgSkip("WX")==0):
  4775. OPTS += ["WX", "RTTI"]
  4776. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4777. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4778. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4779. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4780. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4781. if GetTarget() == "darwin":
  4782. OPTS += ['GL', 'OPT:2']
  4783. TargetAdd('p3dcert.exe', opts=OPTS)
  4784. #
  4785. # DIRECTORY: direct/src/plugin_npapi/
  4786. #
  4787. if RUNTIME:
  4788. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4789. if GetTarget() == 'windows':
  4790. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4791. "version" : VERSION,
  4792. "description" : "Runs 3-D games and interactive applets",
  4793. "filename" : "nppanda3d.dll",
  4794. "mimetype" : "application/x-panda3d",
  4795. "extension" : "p3d",
  4796. "filedesc" : "Panda3D applet"}
  4797. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4798. elif GetTarget() == 'darwin':
  4799. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4800. OPTS += ['GTK2']
  4801. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4802. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4803. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4804. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4805. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4806. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4807. if GetTarget() == 'windows':
  4808. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4809. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4810. elif GetTarget() == 'darwin':
  4811. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4812. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4813. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4814. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4815. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4816. #
  4817. # DIRECTORY: direct/src/plugin_activex/
  4818. #
  4819. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4820. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4821. DefSymbol('ACTIVEX', '_USRDLL', '')
  4822. DefSymbol('ACTIVEX', '_WINDLL', '')
  4823. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4824. DefSymbol('ACTIVEX', '_MBCS', '')
  4825. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4826. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4827. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4828. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4829. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4830. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4831. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4832. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4833. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4834. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4835. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4836. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4837. #
  4838. # DIRECTORY: direct/src/plugin_standalone/
  4839. #
  4840. if (RUNTIME):
  4841. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4842. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4843. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4844. if GetTarget() == 'windows':
  4845. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4846. "version" : VERSION,
  4847. "description" : "Runs 3-D games and interactive applets",
  4848. "filename" : "panda3d.exe",
  4849. "mimetype" : "application/x-panda3d",
  4850. "extension" : "p3d",
  4851. "filedesc" : "Panda3D applet",
  4852. "icon" : "panda3d.ico"}
  4853. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4854. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4855. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4856. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4857. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4858. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4859. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4860. if GetTarget() == 'darwin':
  4861. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4862. elif GetTarget() == 'windows':
  4863. TargetAdd('panda3d.exe', input='panda3d.res')
  4864. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4865. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4866. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4867. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4868. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4869. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4870. if (GetTarget() == 'darwin'):
  4871. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4872. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4873. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4874. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4875. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4876. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4877. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4878. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4879. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4880. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4881. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4882. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4883. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4884. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4885. elif (GetTarget() == 'windows'):
  4886. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4887. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4888. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4889. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4890. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4891. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4892. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4893. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4894. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4895. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4896. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4897. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4898. if (RTDIST):
  4899. 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']
  4900. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4901. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4902. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4903. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4904. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4905. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4906. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4907. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4908. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4909. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4910. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4911. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4912. if (GetTarget() == 'darwin'):
  4913. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4914. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4915. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4916. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4917. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4918. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4919. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4920. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4921. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4922. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4923. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4924. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4925. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4926. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4927. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4928. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4929. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4930. if GetTarget() == 'darwin':
  4931. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4932. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4933. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4934. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4935. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4936. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4937. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4938. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4939. if GetTarget() == 'darwin':
  4940. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4941. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4942. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4943. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4944. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4945. if GetTarget() == 'windows':
  4946. OPTS.append("P3DEMBEDW")
  4947. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4948. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4949. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4950. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4951. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4952. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4953. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4954. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4955. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4956. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4957. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4958. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4959. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4960. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4961. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4962. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4963. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4964. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4965. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4966. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4967. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4968. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4969. #
  4970. # DIRECTORY: pandatool/src/pandatoolbase/
  4971. #
  4972. if (PkgSkip("PANDATOOL")==0):
  4973. OPTS=['DIR:pandatool/src/pandatoolbase']
  4974. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4975. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4976. #
  4977. # DIRECTORY: pandatool/src/converter/
  4978. #
  4979. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4980. OPTS=['DIR:pandatool/src/converter']
  4981. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4982. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4983. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4984. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4985. #
  4986. # DIRECTORY: pandatool/src/progbase/
  4987. #
  4988. if not PkgSkip("PANDATOOL"):
  4989. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4990. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4991. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4992. #
  4993. # DIRECTORY: pandatool/src/eggbase/
  4994. #
  4995. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4996. OPTS=['DIR:pandatool/src/eggbase']
  4997. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4998. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4999. #
  5000. # DIRECTORY: pandatool/src/bam/
  5001. #
  5002. if not PkgSkip("PANDATOOL"):
  5003. OPTS=['DIR:pandatool/src/bam']
  5004. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5005. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5006. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5007. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5008. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5009. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5010. if not PkgSkip("EGG"):
  5011. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5012. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5013. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5014. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5015. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5016. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5017. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5018. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5019. #
  5020. # DIRECTORY: pandatool/src/cvscopy/
  5021. #
  5022. if not PkgSkip("PANDATOOL"):
  5023. OPTS=['DIR:pandatool/src/cvscopy']
  5024. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5025. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5026. #
  5027. # DIRECTORY: pandatool/src/daeegg/
  5028. #
  5029. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5030. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5031. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5032. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5033. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5034. #
  5035. # DIRECTORY: pandatool/src/assimp
  5036. #
  5037. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5038. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5039. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5040. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5041. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5042. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5043. #
  5044. # DIRECTORY: pandatool/src/daeprogs/
  5045. #
  5046. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5047. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5048. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5049. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5050. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5051. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5052. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5053. #
  5054. # DIRECTORY: pandatool/src/dxf/
  5055. #
  5056. if not PkgSkip("PANDATOOL"):
  5057. OPTS=['DIR:pandatool/src/dxf']
  5058. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5059. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5060. #
  5061. # DIRECTORY: pandatool/src/dxfegg/
  5062. #
  5063. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5064. OPTS=['DIR:pandatool/src/dxfegg']
  5065. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5066. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5067. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5068. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5069. #
  5070. # DIRECTORY: pandatool/src/dxfprogs/
  5071. #
  5072. if not PkgSkip("PANDATOOL"):
  5073. OPTS=['DIR:pandatool/src/dxfprogs']
  5074. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5075. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5076. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5077. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5078. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5079. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5080. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5081. if not PkgSkip("EGG"):
  5082. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5083. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5084. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5085. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5086. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5087. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5088. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5089. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5090. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5091. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5092. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5093. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5094. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5095. #
  5096. # DIRECTORY: pandatool/src/objegg/
  5097. #
  5098. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5099. OPTS=['DIR:pandatool/src/objegg']
  5100. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5101. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5102. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5103. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5104. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5105. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5106. #
  5107. # DIRECTORY: pandatool/src/objprogs/
  5108. #
  5109. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5110. OPTS=['DIR:pandatool/src/objprogs']
  5111. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5112. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5113. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5114. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5115. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5116. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5117. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5118. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5119. #
  5120. # DIRECTORY: pandatool/src/palettizer/
  5121. #
  5122. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5123. OPTS=['DIR:pandatool/src/palettizer']
  5124. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5125. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5126. #
  5127. # DIRECTORY: pandatool/src/egg-mkfont/
  5128. #
  5129. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5130. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5131. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5132. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5133. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5134. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5135. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5136. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5137. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5138. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5139. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5140. #
  5141. # DIRECTORY: pandatool/src/eggcharbase/
  5142. #
  5143. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5144. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5145. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5146. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5147. #
  5148. # DIRECTORY: pandatool/src/egg-optchar/
  5149. #
  5150. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5151. OPTS=['DIR:pandatool/src/egg-optchar']
  5152. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5153. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5154. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5155. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5156. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5157. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5158. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5159. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5160. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5161. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5162. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5163. #
  5164. # DIRECTORY: pandatool/src/egg-palettize/
  5165. #
  5166. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5167. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5168. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5169. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5170. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5171. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5172. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5173. #
  5174. # DIRECTORY: pandatool/src/egg-qtess/
  5175. #
  5176. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5177. OPTS=['DIR:pandatool/src/egg-qtess']
  5178. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5179. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5180. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5181. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5182. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5183. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5184. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5185. #
  5186. # DIRECTORY: pandatool/src/eggprogs/
  5187. #
  5188. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5189. OPTS=['DIR:pandatool/src/eggprogs']
  5190. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5191. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5192. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5193. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5194. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5195. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5196. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5197. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5198. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5199. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5200. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5201. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5202. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5203. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5204. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5205. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5206. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5207. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5208. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5209. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5210. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5211. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5212. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5213. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5214. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5215. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5216. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5217. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5218. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5219. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5220. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5221. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5222. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5223. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5224. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5225. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5226. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5227. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5228. #
  5229. # DIRECTORY: pandatool/src/flt/
  5230. #
  5231. if not PkgSkip("PANDATOOL"):
  5232. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5233. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5234. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5235. #
  5236. # DIRECTORY: pandatool/src/fltegg/
  5237. #
  5238. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5239. OPTS=['DIR:pandatool/src/fltegg']
  5240. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5241. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5242. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5243. #
  5244. # DIRECTORY: pandatool/src/fltprogs/
  5245. #
  5246. if not PkgSkip("PANDATOOL"):
  5247. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5248. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5249. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5250. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5251. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5252. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5253. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5254. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5255. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5256. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5257. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5258. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5259. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5260. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5261. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5262. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5263. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5264. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5265. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5266. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5267. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5268. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5269. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5270. if not PkgSkip("EGG"):
  5271. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5272. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5273. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5274. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5275. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5276. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5277. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5278. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5279. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5280. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5281. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5282. #
  5283. # DIRECTORY: pandatool/src/imagebase/
  5284. #
  5285. if not PkgSkip("PANDATOOL"):
  5286. OPTS=['DIR:pandatool/src/imagebase']
  5287. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5288. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5289. #
  5290. # DIRECTORY: pandatool/src/imageprogs/
  5291. #
  5292. if not PkgSkip("PANDATOOL"):
  5293. OPTS=['DIR:pandatool/src/imageprogs']
  5294. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5295. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5296. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5297. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5298. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5299. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5300. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5301. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5302. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5303. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5304. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5305. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5306. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5307. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5308. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5309. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5310. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5311. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5312. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5313. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5314. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5315. #
  5316. # DIRECTORY: pandatool/src/pfmprogs/
  5317. #
  5318. if not PkgSkip("PANDATOOL"):
  5319. OPTS=['DIR:pandatool/src/pfmprogs']
  5320. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5321. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5322. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5323. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5324. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5325. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5326. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5327. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5328. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5329. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5330. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5331. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5332. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5333. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5334. #
  5335. # DIRECTORY: pandatool/src/lwo/
  5336. #
  5337. if not PkgSkip("PANDATOOL"):
  5338. OPTS=['DIR:pandatool/src/lwo']
  5339. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5340. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5341. #
  5342. # DIRECTORY: pandatool/src/lwoegg/
  5343. #
  5344. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5345. OPTS=['DIR:pandatool/src/lwoegg']
  5346. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5347. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5348. #
  5349. # DIRECTORY: pandatool/src/lwoprogs/
  5350. #
  5351. if not PkgSkip("PANDATOOL"):
  5352. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5353. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5354. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5355. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5356. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5357. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5358. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5359. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5360. if not PkgSkip("EGG"):
  5361. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5362. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5363. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5364. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5365. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5366. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5367. #
  5368. # DIRECTORY: pandatool/src/maya/
  5369. #
  5370. for VER in MAYAVERSIONS:
  5371. VNUM=VER[4:]
  5372. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5373. OPTS=['DIR:pandatool/src/maya', VER]
  5374. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5375. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5376. #
  5377. # DIRECTORY: pandatool/src/mayaegg/
  5378. #
  5379. for VER in MAYAVERSIONS:
  5380. VNUM=VER[4:]
  5381. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5382. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5383. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5384. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5385. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5386. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5387. #
  5388. # DIRECTORY: pandatool/src/maxegg/
  5389. #
  5390. for VER in MAXVERSIONS:
  5391. VNUM=VER[3:]
  5392. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5393. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5394. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5395. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5396. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5397. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5398. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5399. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5400. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5401. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5402. #
  5403. # DIRECTORY: pandatool/src/maxprogs/
  5404. #
  5405. for VER in MAXVERSIONS:
  5406. VNUM=VER[3:]
  5407. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5408. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5409. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5410. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5411. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5412. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5413. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5414. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5415. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5416. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5417. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5418. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5419. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5420. #
  5421. # DIRECTORY: pandatool/src/vrml/
  5422. #
  5423. if not PkgSkip("PANDATOOL"):
  5424. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5425. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5426. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5427. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5428. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5429. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5430. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5431. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5432. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5433. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5434. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5435. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5436. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5437. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5438. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5439. #
  5440. # DIRECTORY: pandatool/src/vrmlegg/
  5441. #
  5442. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5443. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5444. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5445. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5446. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5447. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5448. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5449. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5450. #
  5451. # DIRECTORY: pandatool/src/xfile/
  5452. #
  5453. if not PkgSkip("PANDATOOL"):
  5454. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5455. CreateFile(GetOutputDir()+"/include/xParser.h")
  5456. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5457. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5458. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5459. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5460. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5461. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5462. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5463. #
  5464. # DIRECTORY: pandatool/src/xfileegg/
  5465. #
  5466. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5467. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5468. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5469. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5470. #
  5471. # DIRECTORY: pandatool/src/ptloader/
  5472. #
  5473. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5474. if not PkgSkip("FCOLLADA"):
  5475. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5476. 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']
  5477. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5478. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5479. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5480. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5481. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5482. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5483. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5484. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5485. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5486. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5487. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5488. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5489. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5490. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5491. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5492. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5493. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5494. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5495. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5496. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5497. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5498. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5499. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5500. #
  5501. # DIRECTORY: pandatool/src/miscprogs/
  5502. #
  5503. # This is a bit of an esoteric tool, and it causes issues because
  5504. # it conflicts with tools of the same name in different packages.
  5505. #if (PkgSkip("PANDATOOL")==0):
  5506. # OPTS=['DIR:pandatool/src/miscprogs']
  5507. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5508. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5509. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5510. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5511. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5512. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5513. #
  5514. # DIRECTORY: pandatool/src/pstatserver/
  5515. #
  5516. if (PkgSkip("PANDATOOL")==0):
  5517. OPTS=['DIR:pandatool/src/pstatserver']
  5518. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5519. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5520. #
  5521. # DIRECTORY: pandatool/src/text-stats/
  5522. #
  5523. if (PkgSkip("PANDATOOL")==0):
  5524. OPTS=['DIR:pandatool/src/text-stats']
  5525. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5526. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5527. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5528. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5529. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5530. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5531. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5532. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5533. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5534. #
  5535. # DIRECTORY: pandatool/src/vrmlprogs/
  5536. #
  5537. if not PkgSkip("PANDATOOL"):
  5538. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5539. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5540. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5541. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5542. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5543. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5544. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5545. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5546. if not PkgSkip("EGG"):
  5547. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5548. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5549. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5550. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5551. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5552. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5553. #
  5554. # DIRECTORY: pandatool/src/win-stats/
  5555. # DIRECTORY: pandatool/src/gtk-stats/
  5556. #
  5557. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5558. if GetTarget() == 'windows':
  5559. OPTS=['DIR:pandatool/src/win-stats']
  5560. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5561. else:
  5562. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5563. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5564. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5565. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5566. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5567. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5568. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5569. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5570. #
  5571. # DIRECTORY: pandatool/src/xfileprogs/
  5572. #
  5573. if not PkgSkip("PANDATOOL"):
  5574. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5575. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5576. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5577. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5578. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5579. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5580. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5581. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5582. if not PkgSkip("EGG"):
  5583. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5584. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5585. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5586. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5587. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5588. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5589. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5590. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5591. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5592. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5593. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5594. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5595. #
  5596. # DIRECTORY: pandatool/src/mayaprogs/
  5597. #
  5598. for VER in MAYAVERSIONS:
  5599. VNUM = VER[4:]
  5600. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5601. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5602. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5603. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5604. continue
  5605. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5606. ARCH_OPTS = ['NOARCH:PPC']
  5607. elif GetTarget() == 'darwin':
  5608. ARCH_OPTS = ['NOARCH:X86_64']
  5609. else:
  5610. ARCH_OPTS = []
  5611. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5612. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5613. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5614. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5615. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5616. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5617. #if GetTarget() == 'windows':
  5618. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5619. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5620. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5621. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5622. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5623. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5624. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5625. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5626. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5627. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5628. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5629. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5630. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5631. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5632. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5633. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5634. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5635. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5636. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5637. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5638. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5639. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5640. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5641. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5642. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5643. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5644. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5645. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5646. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5647. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5648. if GetTarget() == 'windows':
  5649. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5650. else:
  5651. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5652. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5653. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5654. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5655. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5656. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5657. if GetTarget() == 'windows':
  5658. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5659. else:
  5660. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5661. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5662. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5663. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5664. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5665. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5666. if GetTarget() == 'windows':
  5667. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5668. else:
  5669. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5670. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5671. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5672. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5673. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5674. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5675. if GetTarget() == 'windows':
  5676. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5677. else:
  5678. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5679. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5680. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5681. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5682. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5683. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5684. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5685. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5686. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5687. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5688. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5689. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5690. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5691. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5692. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5693. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5694. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5695. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5696. #
  5697. # DIRECTORY: contrib/src/ai/
  5698. #
  5699. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5700. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5701. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5702. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5703. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5704. OPTS=['DIR:contrib/src/ai']
  5705. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5706. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5707. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5708. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5709. PyTargetAdd('ai_module.obj', opts=OPTS)
  5710. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5711. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5712. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5713. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5714. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5715. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5716. #
  5717. # DIRECTORY: contrib/src/rplight/
  5718. #
  5719. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5720. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5721. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5722. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5723. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5724. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5725. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5726. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5727. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5728. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5729. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5730. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5731. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5732. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5733. #
  5734. # DIRECTORY: pandatool/src/deploy-stub
  5735. #
  5736. if PkgSkip("PYTHON") == 0:
  5737. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5738. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5739. if GetTarget() == 'windows':
  5740. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5741. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5742. # Setup rpath so libs can be found in the same directory as the deployed game
  5743. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5744. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5745. LibName('DEPLOYSTUB', "-rdynamic")
  5746. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5747. if GetTarget() == 'windows':
  5748. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5749. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5750. if GetTarget() == 'windows':
  5751. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5752. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5753. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5754. elif GetTarget() == 'darwin':
  5755. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5756. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5757. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5758. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5759. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5760. #
  5761. # Generate the models directory and samples directory
  5762. #
  5763. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5764. model_extensions = ["*.egg"]
  5765. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5766. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5767. model_extensions.append("*.flt")
  5768. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5769. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5770. newname = model[:-4] + ".egg.pz"
  5771. else:
  5772. newname = model[:-4] + ".egg"
  5773. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5774. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5775. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5776. newname = model[:-4] + ".egg.pz"
  5777. else:
  5778. newname = model[:-4] + ".egg"
  5779. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5780. for model in GetDirectoryContents("models", model_extensions):
  5781. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5782. newname = model[:-4] + ".egg.pz"
  5783. else:
  5784. newname = model[:-4] + ".egg"
  5785. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5786. if not PkgSkip("DIRECT") and not RUNTIME:
  5787. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5788. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5789. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5790. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5791. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5792. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5793. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5794. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5795. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5796. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5797. #
  5798. # Build the rtdist.
  5799. #
  5800. if (RTDIST):
  5801. OPTS=['DIR:direct/src/p3d']
  5802. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5803. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5804. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5805. #
  5806. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5807. #
  5808. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5809. OPTS=['DIR:direct/src/p3d']
  5810. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5811. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5812. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5813. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5814. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5815. ##########################################################################################
  5816. #
  5817. # Dependency-Based Distributed Build System.
  5818. #
  5819. ##########################################################################################
  5820. DEPENDENCYQUEUE=[]
  5821. for target in TARGET_LIST:
  5822. name = target.name
  5823. inputs = target.inputs
  5824. opts = target.opts
  5825. deps = target.deps
  5826. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5827. def BuildWorker(taskqueue, donequeue):
  5828. while True:
  5829. try:
  5830. task = taskqueue.get(timeout=1)
  5831. except:
  5832. ProgressOutput(None, "Waiting for tasks...")
  5833. task = taskqueue.get()
  5834. sys.stdout.flush()
  5835. if (task == 0): return
  5836. try:
  5837. task[0](*task[1])
  5838. donequeue.put(task)
  5839. except:
  5840. donequeue.put(0)
  5841. def AllSourcesReady(task, pending):
  5842. sources = task[3]
  5843. for x in sources:
  5844. if (x in pending):
  5845. return 0
  5846. sources = task[1][1]
  5847. for x in sources:
  5848. if (x in pending):
  5849. return 0
  5850. altsources = task[4]
  5851. for x in altsources:
  5852. if (x in pending):
  5853. return 0
  5854. return 1
  5855. def ParallelMake(tasklist):
  5856. # Create the communication queues.
  5857. donequeue = queue.Queue()
  5858. taskqueue = queue.Queue()
  5859. # Build up a table listing all the pending targets
  5860. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5861. # task[2] = [name]
  5862. # task[3] = deps
  5863. # The python tool package, in particular fltegg seems to throw parallelmake off
  5864. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5865. # and another subpart to be built sequentially. The most time consuming part of the process
  5866. # is the c++ code generation anyways.
  5867. tasklist_seq = []
  5868. i = 0
  5869. while i < len(tasklist):
  5870. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5871. break
  5872. i += 1
  5873. if i < len(tasklist):
  5874. tasklist_seq = tasklist[i:]
  5875. tasklist = tasklist[:i]
  5876. iNumStartingTasks = len(tasklist)
  5877. pending = {}
  5878. for task in tasklist:
  5879. for target in task[2]:
  5880. pending[target] = 1
  5881. # Create the workers
  5882. for slave in range(THREADCOUNT):
  5883. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5884. th.setDaemon(1)
  5885. th.start()
  5886. # Feed tasks to the workers.
  5887. tasksqueued = 0
  5888. while True:
  5889. if (tasksqueued < THREADCOUNT):
  5890. extras = []
  5891. for task in tasklist:
  5892. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5893. if (NeedsBuild(task[2], task[3])):
  5894. tasksqueued += 1
  5895. taskqueue.put(task)
  5896. else:
  5897. for target in task[2]:
  5898. del pending[target]
  5899. else:
  5900. extras.append(task)
  5901. tasklist = extras
  5902. sys.stdout.flush()
  5903. if (tasksqueued == 0): break
  5904. donetask = donequeue.get()
  5905. if (donetask == 0):
  5906. exit("Build process aborting.")
  5907. sys.stdout.flush()
  5908. tasksqueued -= 1
  5909. JustBuilt(donetask[2], donetask[3])
  5910. for target in donetask[2]:
  5911. del pending[target]
  5912. # Kill the workers.
  5913. for slave in range(THREADCOUNT):
  5914. taskqueue.put(0)
  5915. # Make sure there aren't any unsatisfied tasks
  5916. if len(tasklist) > 0:
  5917. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5918. SequentialMake(tasklist_seq)
  5919. def SequentialMake(tasklist):
  5920. i = 0
  5921. for task in tasklist:
  5922. if (NeedsBuild(task[2], task[3])):
  5923. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5924. JustBuilt(task[2], task[3])
  5925. i += 1
  5926. def RunDependencyQueue(tasklist):
  5927. if (THREADCOUNT!=0):
  5928. ParallelMake(tasklist)
  5929. else:
  5930. SequentialMake(tasklist)
  5931. try:
  5932. RunDependencyQueue(DEPENDENCYQUEUE)
  5933. finally:
  5934. SaveDependencyCache()
  5935. # Run the test suite.
  5936. if RUNTESTS:
  5937. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  5938. if sys.version_info >= (2, 6):
  5939. cmdstr += " -B"
  5940. cmdstr += " -m pytest tests"
  5941. if GetVerbose():
  5942. cmdstr += " --verbose"
  5943. oscmd(cmdstr)
  5944. # Write out information about the Python versions in the built dir.
  5945. python_version_info = GetCurrentPythonVersionInfo()
  5946. UpdatePythonVersionInfoFile(python_version_info)
  5947. ##########################################################################################
  5948. #
  5949. # The Installers
  5950. #
  5951. # Under windows, we can build an 'exe' package using NSIS
  5952. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5953. # Under OSX, we can make a 'dmg' package.
  5954. #
  5955. ##########################################################################################
  5956. if INSTALLER:
  5957. ProgressOutput(100.0, "Building installer")
  5958. from makepackage import MakeInstaller
  5959. # When using the --installer flag, only install for the current version.
  5960. python_versions = []
  5961. if python_version_info:
  5962. python_versions.append(python_version_info)
  5963. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  5964. optimize=GetOptimize(), compressor=COMPRESSOR,
  5965. debversion=DEBVERSION, rpmrelease=RPMRELEASE,
  5966. runtime=RUNTIME, python_versions=python_versions)
  5967. if WHEEL:
  5968. ProgressOutput(100.0, "Building wheel")
  5969. from makewheel import makewheel
  5970. makewheel(WHLVERSION, GetOutputDir())
  5971. ##########################################################################################
  5972. #
  5973. # Print final status report.
  5974. #
  5975. ##########################################################################################
  5976. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  5977. printStatus("Makepanda Final Status Report", WARNINGS)
  5978. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())