makepanda.py 284 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060
  1. #!/usr/bin/python
  2. ########################################################################
  3. #
  4. # Caution: there are two separate, independent build systems:
  5. # 'makepanda', and 'ppremake'. Use one or the other, do not attempt
  6. # to use both. This file is part of the 'makepanda' system.
  7. #
  8. # To build panda using this script, type 'makepanda.py' on unix
  9. # or 'makepanda.bat' on windows, and examine the help-text.
  10. # Then run the script again with the appropriate options to compile
  11. # panda3d.
  12. #
  13. ########################################################################
  14. try:
  15. import sys,os,platform,time,stat,string,re,getopt,fnmatch,threading,Queue,signal,shutil
  16. if (sys.platform == "darwin"): import plistlib
  17. except:
  18. print "You are either using an incomplete or an old version of Python!"
  19. print "Please install the development package of Python 2.x and try again."
  20. exit(1)
  21. from makepandacore import *
  22. from installpanda import *
  23. import time
  24. import os
  25. import sys
  26. ## jGenPyCode tries to get the directory for Direct from the sys.path. This only works if you
  27. ## have installed the sdk using a installer. This would not work if the installer was
  28. ## never used and everything was grabbed into a virgin environment using cvs.
  29. sys.path.append( os.getcwd() )
  30. import __builtin__
  31. ########################################################################
  32. ##
  33. ## PARSING THE COMMAND LINE OPTIONS
  34. ##
  35. ## You might be tempted to change the defaults by editing them
  36. ## here. Don't do it. Instead, create a script that compiles
  37. ## panda with your preferred options. Or, create
  38. ## a 'makepandaPreferences' file and put it into your python path.
  39. ##
  40. ########################################################################
  41. COMPILER=0
  42. INSTALLER=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. LDFLAGS=""
  48. RTDIST=0
  49. RTDIST_VERSION="dev"
  50. RUNTIME=0
  51. DISTRIBUTOR=""
  52. VERSION=None
  53. DEBVERSION=None
  54. RPMRELEASE="1"
  55. P3DSUFFIX=None
  56. MAJOR_VERSION=None
  57. COREAPI_VERSION=None
  58. PLUGIN_VERSION=None
  59. OSXTARGET=None
  60. HOST_URL="https://runtime.panda3d.org/"
  61. global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
  62. STRDXSDKVERSION = 'default'
  63. STRMSPLATFORMVERSION = 'default'
  64. BOOUSEINTELCOMPILER = False
  65. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  66. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  67. PkgListSet(["PYTHON", "DIRECT", # Python support
  68. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  69. "EGL", # OpenGL (ES) integration
  70. "EIGEN", # Linear algebra acceleration
  71. "OPENAL", "FMODEX", "FFMPEG", # Multimedia
  72. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  73. "SPEEDTREE", # SpeedTree
  74. "ZLIB", "PNG", "JPEG", "TIFF", "SQUISH", "FREETYPE", # 2D Formats support
  75. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", # 3D Formats support
  76. "VRPN", "OPENSSL", # Transport
  77. "FFTW", "SWSCALE", # Algorithm helpers
  78. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  79. "NPAPI", "AWESOMIUM", # Browser embedding
  80. "GTK2", "WX", "FLTK", # Toolkit support
  81. "ROCKET", # GUI libraries
  82. "OSMESA", "X11", "XF86DGA", "XRANDR", "XCURSOR", # Unix platform support
  83. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  84. "SKEL", # Example SKEL project
  85. "PANDAFX", # Some distortion special lenses
  86. "PANDAPARTICLESYSTEM", # Built in particle system
  87. "CONTRIB" # Experimental
  88. ])
  89. CheckPandaSourceTree()
  90. def keyboardInterruptHandler(x,y):
  91. exit("keyboard interrupt")
  92. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  93. ########################################################################
  94. ##
  95. ## Command-line parser.
  96. ##
  97. ## You can type "makepanda --help" to see all the options.
  98. ##
  99. ########################################################################
  100. def usage(problem):
  101. if (problem):
  102. print ""
  103. print "Error parsing commandline input", problem
  104. print ""
  105. print "Makepanda generates a 'built' subdirectory containing a"
  106. print "compiled copy of Panda3D. Command-line arguments are:"
  107. print ""
  108. print " --help (print the help message you're reading now)"
  109. print " --verbose (print out more information)"
  110. print " --runtime (build a runtime build instead of an SDK build)"
  111. print " --installer (build an installer)"
  112. print " --optimize X (optimization level can be 1,2,3,4)"
  113. print " --version X (set the panda version number)"
  114. print " --lzma (use lzma compression when building Windows installer)"
  115. print " --distributor X (short string identifying the distributor of the build)"
  116. print " --outputdir X (use the specified directory instead of 'built')"
  117. print " --host URL (set the host url (runtime build only))"
  118. print " --threads N (use the multithreaded build system. see manual)"
  119. print " --osxtarget N (the OSX version number to build for (OSX only))"
  120. print " --override \"O=V\" (override dtool_config/prc option value)"
  121. print " --static (builds libraries for static linking)"
  122. print ""
  123. for pkg in PkgListGet():
  124. p = pkg.lower()
  125. print " --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg)
  126. print ""
  127. print " --nothing (disable every third-party lib)"
  128. print " --everything (enable every third-party lib)"
  129. print " --directx-sdk=X (specify version of Dx9 SDK to use: jun2010, aug2009, mar2009, aug2006)"
  130. print " --platform-sdk=X (specify MSPlatSdk to use: win71, win61, win60A, winserver2003r2"
  131. print " --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)"
  132. print ""
  133. print "The simplest way to compile panda is to just type:"
  134. print ""
  135. print " makepanda --everything"
  136. print ""
  137. os._exit(1)
  138. def parseopts(args):
  139. global INSTALLER,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  140. global COMPRESSOR,THREADCOUNT,OSXTARGET,HOST_URL
  141. global DEBVERSION,RPMRELEASE,P3DSUFFIX
  142. global STRDXSDKVERSION, STRMSPLATFORMVERSION, BOOUSEINTELCOMPILER
  143. longopts = [
  144. "help","distributor=","verbose","runtime","osxtarget=",
  145. "optimize=","everything","nothing","installer","rtdist","nocolor",
  146. "version=","lzma","no-python","threads=","outputdir=","override=",
  147. "static","host=","debversion=","rpmrelease=","p3dsuffix=",
  148. "directx-sdk=", "platform-sdk=", "use-icl"]
  149. anything = 0
  150. optimize = ""
  151. for pkg in PkgListGet(): longopts.append("no-"+pkg.lower())
  152. for pkg in PkgListGet(): longopts.append("use-"+pkg.lower())
  153. try:
  154. opts, extras = getopt.getopt(args, "", longopts)
  155. for option,value in opts:
  156. if (option=="--help"): raise "usage"
  157. elif (option=="--optimize"): optimize=value
  158. elif (option=="--installer"): INSTALLER=1
  159. elif (option=="--verbose"): SetVerbose(True)
  160. elif (option=="--distributor"): DISTRIBUTOR=value
  161. elif (option=="--rtdist"): RTDIST=1
  162. elif (option=="--runtime"): RUNTIME=1
  163. elif (option=="--genman"): GENMAN=1
  164. elif (option=="--everything"): PkgEnableAll()
  165. elif (option=="--nothing"): PkgDisableAll()
  166. elif (option=="--threads"): THREADCOUNT=int(value)
  167. elif (option=="--outputdir"): SetOutputDir(value.strip())
  168. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  169. elif (option=="--nocolor"): DisableColors()
  170. elif (option=="--version"):
  171. VERSION=value
  172. if (len(VERSION.split(".")) != 3): raise "usage"
  173. elif (option=="--lzma"): COMPRESSOR="lzma"
  174. elif (option=="--override"): AddOverride(value.strip())
  175. elif (option=="--static"): SetLinkAllStatic(True)
  176. elif (option=="--host"): HOST_URL=value
  177. elif (option=="--debversion"): DEBVERSION=value
  178. elif (option=="--rpmrelease"): RPMRELEASE=value
  179. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  180. # Backward compatibility, OPENGL was renamed to GL
  181. elif (option=="--use-opengl"): PkgEnable("GL")
  182. elif (option=="--no-opengl"): PkgDisable("GL")
  183. elif (option=="--directx-sdk"):
  184. STRDXSDKVERSION = value.strip().lower()
  185. if STRDXSDKVERSION == '':
  186. print "No DirectX SDK version specified. Using 'default' DirectX SDK search"
  187. STRDXSDKVERSION = 'default'
  188. elif (option=="--platform-sdk"):
  189. STRMSPLATFORMVERSION = value.strip().lower()
  190. if STRMSPLATFORMVERSION == '':
  191. print "No MS Platform SDK version specified. Using 'default' MS Platform SDK search"
  192. STRMSPLATFORMVERSION = 'default'
  193. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  194. else:
  195. for pkg in PkgListGet():
  196. if (option=="--use-"+pkg.lower()):
  197. PkgEnable(pkg)
  198. break
  199. for pkg in PkgListGet():
  200. if (option=="--no-"+pkg.lower()):
  201. PkgDisable(pkg)
  202. break
  203. if (option=="--everything" or option.startswith("--use-")
  204. or option=="--nothing" or option.startswith("--no-")):
  205. anything = 1
  206. except:
  207. usage(0)
  208. print "Exception while parsing commandline:", sys.exc_info()[0]
  209. if (anything==0): usage(0)
  210. if (RTDIST and RUNTIME):
  211. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  212. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  213. elif (optimize==""): optimize = "3"
  214. if (OSXTARGET != None and OSXTARGET.strip() == ""):
  215. OSXTARGET = None
  216. elif (OSXTARGET != None):
  217. OSXTARGET = OSXTARGET.strip()
  218. if (len(OSXTARGET) != 4 or not OSXTARGET.startswith("10.")):
  219. usage("Invalid setting for OSXTARGET")
  220. try:
  221. OSXTARGET = "10.%d" % int(OSXTARGET[-1])
  222. except:
  223. usage("Invalid setting for OSXTARGET")
  224. try:
  225. SetOptimize(int(optimize))
  226. assert GetOptimize() in [1, 2, 3, 4]
  227. except:
  228. usage("Invalid setting for OPTIMIZE")
  229. parseopts(sys.argv[1:])
  230. ########################################################################
  231. ##
  232. ## Handle environment variables.
  233. ##
  234. ########################################################################
  235. if ("CFLAGS" in os.environ):
  236. CFLAGS = os.environ["CFLAGS"]
  237. if ("RPM_OPT_FLAGS" in os.environ):
  238. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"]
  239. CFLAGS = CFLAGS.strip()
  240. if ("LDFLAGS" in os.environ):
  241. LDFLAGS = os.environ["LDFLAGS"]
  242. LDFLAGS = LDFLAGS.strip()
  243. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  244. if (sys.platform == "darwin" and OSXTARGET != None):
  245. os.environ["MACOSX_DEPLOYMENT_TARGET"] = OSXTARGET
  246. ########################################################################
  247. ##
  248. ## Configure things based on the command-line parameters.
  249. ##
  250. ########################################################################
  251. if (VERSION is None):
  252. if (RUNTIME):
  253. VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  254. COREAPI_VERSION = VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  255. PLUGIN_VERSION = VERSION
  256. else:
  257. VERSION = ParsePandaVersion("dtool/PandaVersion.pp")
  258. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  259. if (COREAPI_VERSION is None):
  260. COREAPI_VERSION = VERSION
  261. if (DEBVERSION is None):
  262. DEBVERSION = VERSION
  263. MAJOR_VERSION = VERSION[:3]
  264. if (P3DSUFFIX is None):
  265. P3DSUFFIX = MAJOR_VERSION
  266. if (RUNTIME or RTDIST):
  267. # Compiling Maya/Max is pointless in rtdist build
  268. for ver in MAYAVERSIONS + MAXVERSIONS:
  269. PkgDisable(ver)
  270. if (DISTRIBUTOR.strip() == ""):
  271. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  272. if (not IsCustomOutputDir()):
  273. if (RTDIST):
  274. SetOutputDir("built_" + DISTRIBUTOR.strip())
  275. elif (RUNTIME):
  276. SetOutputDir("built_" + DISTRIBUTOR.strip() + "_rt")
  277. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  278. elif (DISTRIBUTOR == ""):
  279. DISTRIBUTOR = "makepanda"
  280. if (RUNTIME):
  281. for pkg in PkgListGet():
  282. if pkg in ["GTK2"]:
  283. # Optional package(s) for runtime.
  284. pass
  285. elif pkg in ["OPENSSL", "ZLIB", "NPAPI", "JPEG", "PNG"]:
  286. # Required packages for runtime.
  287. if (PkgSkip(pkg)==1):
  288. exit("Runtime must be compiled with OpenSSL, ZLib, NPAPI, JPEG and PNG support!")
  289. else:
  290. # Unused packages for runtime.
  291. PkgDisable(pkg)
  292. if (sys.platform.startswith("win")):
  293. os.environ["BISON_SIMPLE"] = GetThirdpartyBase()+"/win-util/bison.simple"
  294. if (INSTALLER and RTDIST):
  295. exit("Cannot build an installer for the rtdist build!")
  296. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME):
  297. exit("Cannot build installer without python")
  298. if (RTDIST) and (PkgSkip("JPEG")):
  299. exit("Cannot build rtdist without jpeg")
  300. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  301. exit("Cannot build rtdist without wx or fltk")
  302. if (RUNTIME):
  303. SetLinkAllStatic(True)
  304. if not os.path.isdir("contrib"):
  305. PkgDisable("CONTRIB")
  306. ########################################################################
  307. ##
  308. ## Load the dependency cache.
  309. ##
  310. ########################################################################
  311. LoadDependencyCache()
  312. ########################################################################
  313. ##
  314. ## Locate various SDKs.
  315. ##
  316. ########################################################################
  317. MakeBuildTree()
  318. SdkLocateDirectX( STRDXSDKVERSION )
  319. SdkLocateMaya()
  320. SdkLocateMax()
  321. SdkLocateMacOSX(OSXTARGET)
  322. SdkLocatePython(RTDIST)
  323. SdkLocateVisualStudio()
  324. SdkLocateMSPlatform( STRMSPLATFORMVERSION )
  325. SdkLocatePhysX()
  326. SdkLocateSpeedTree()
  327. SdkAutoDisableDirectX()
  328. SdkAutoDisableMaya()
  329. SdkAutoDisableMax()
  330. SdkAutoDisablePhysX()
  331. SdkAutoDisableSpeedTree()
  332. if (RTDIST and DISTRIBUTOR == "cmu"):
  333. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  334. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  335. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  336. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  337. ########################################################################
  338. ##
  339. ## Choose a Compiler.
  340. ##
  341. ## This should also set up any environment variables needed to make
  342. ## the compiler work.
  343. ##
  344. ########################################################################
  345. if (sys.platform == "win32"):
  346. SetupVisualStudioEnviron()
  347. COMPILER="MSVC"
  348. else:
  349. CheckLinkerLibraryPath()
  350. COMPILER="LINUX"
  351. builtdir = os.path.join(os.path.abspath(GetOutputDir()))
  352. AddToPathEnv("PYTHONPATH", builtdir)
  353. AddToPathEnv("PANDA_PRC_DIR", os.path.join(builtdir, "etc"))
  354. if (sys.platform.startswith("win")):
  355. AddToPathEnv("PATH", os.path.join(builtdir, "plugins"))
  356. AddToPathEnv("PYTHONPATH", os.path.join(builtdir, "bin"))
  357. else:
  358. AddToPathEnv("PATH", os.path.join(builtdir, "bin"))
  359. AddToPathEnv("PYTHONPATH", os.path.join(builtdir, "lib"))
  360. ########################################################################
  361. ##
  362. ## External includes, external libraries, and external defsyms.
  363. ##
  364. ########################################################################
  365. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  366. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  367. if (COMPILER=="MSVC"):
  368. PkgDisable("X11")
  369. PkgDisable("XRANDR")
  370. PkgDisable("XF86DGA")
  371. PkgDisable("XCURSOR")
  372. PkgDisable("GLES")
  373. PkgDisable("GLES2")
  374. PkgDisable("EGL")
  375. if (PkgSkip("PYTHON")==0):
  376. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  377. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  378. SmartPkgEnable("EIGEN", "", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  379. for pkg in PkgListGet():
  380. if (PkgSkip(pkg)==0):
  381. if (pkg[:4]=="MAYA"):
  382. IncDirectory(pkg, SDK[pkg] + "/include")
  383. DefSymbol(pkg, "MAYAVERSION", pkg)
  384. elif (pkg[:3]=="MAX"):
  385. IncDirectory(pkg, SDK[pkg] + "/include")
  386. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  387. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  388. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  389. DefSymbol(pkg, "MAX", pkg)
  390. elif (pkg[:2]=="DX"):
  391. IncDirectory(pkg, SDK[pkg] + "/include")
  392. else:
  393. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  394. for pkg in DXVERSIONS:
  395. if (PkgSkip(pkg)==0):
  396. vnum=pkg[2:]
  397. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  398. LibDirectory(pkg, SDK[pkg] + '/lib')
  399. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  400. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  401. if (vnum=="9" and "GENERIC_DXERR_LIBRARY" in SDK):
  402. LibName(pkg, 'dxerr.lib')
  403. else:
  404. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  405. LibName(pkg, 'ddraw.lib')
  406. LibName(pkg, 'dxguid.lib')
  407. LibName("WINSOCK", "wsock32.lib")
  408. LibName("WINSOCK2", "wsock32.lib")
  409. LibName("WINSOCK2", "ws2_32.lib")
  410. LibName("WINCOMCTL", "comctl32.lib")
  411. LibName("WINCOMDLG", "comdlg32.lib")
  412. LibName("WINUSER", "user32.lib")
  413. LibName("WINMM", "winmm.lib")
  414. LibName("WINIMM", "imm32.lib")
  415. LibName("WINKERNEL", "kernel32.lib")
  416. LibName("WINOLE", "ole32.lib")
  417. LibName("WINOLEAUT", "oleaut32.lib")
  418. LibName("WINOLDNAMES", "oldnames.lib")
  419. LibName("WINSHELL", "shell32.lib")
  420. LibName("WINGDI", "gdi32.lib")
  421. LibName("ADVAPI", "advapi32.lib")
  422. LibName("GL", "opengl32.lib")
  423. LibName("GLES", "libgles_cm.lib")
  424. LibName("GLES2", "libGLESv2.lib")
  425. LibName("EGL", "libEGL.lib")
  426. LibName("MSIMG", "msimg32.lib")
  427. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  428. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  429. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  430. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  431. if (PkgSkip("PNG")==0): LibName("PNG", GetThirdpartyDir() + "png/lib/libpandapng.lib")
  432. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/libpandajpeg.lib")
  433. if (PkgSkip("TIFF")==0): LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libpandatiff.lib")
  434. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/libpandazlib1.lib")
  435. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  436. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  437. if (PkgSkip("FMODEX")==0): LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  438. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  439. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  440. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  441. if (PkgSkip("OPENSSL")==0): LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  442. if (PkgSkip("OPENSSL")==0): LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  443. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  444. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  445. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  446. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  447. if (PkgSkip("ODE")==0): LibName("ODE", GetThirdpartyDir() + "ode/lib/ode.lib")
  448. if (PkgSkip("FCOLLADA")==0): LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  449. if (PkgSkip("SQUISH")==0): LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  450. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  451. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  452. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  453. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  454. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  455. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM", GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  456. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  457. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  458. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  459. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  460. if (PkgSkip("ROCKET")==0): LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  461. if (PkgSkip("ROCKET")==0): LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  462. if (PkgSkip("OPENAL")==0):
  463. if (os.path.exists(GetThirdpartyDir() + "openal/lib/pandaopenal32.lib")):
  464. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/pandaopenal32.lib")
  465. else:
  466. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  467. if (PkgSkip("WX")==0):
  468. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  469. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  470. DefSymbol("WX", "__WXMSW__", "")
  471. DefSymbol("WX", "_UNICODE", "")
  472. DefSymbol("WX", "UNICODE", "")
  473. if (PkgSkip("FLTK")==0):
  474. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  475. for pkg in MAYAVERSIONS:
  476. if (PkgSkip(pkg)==0):
  477. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  478. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  479. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  480. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  481. for pkg in MAXVERSIONS:
  482. if (PkgSkip(pkg)==0):
  483. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  484. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  485. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  486. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  487. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  488. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  489. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  490. if (PkgSkip("PHYSX")==0):
  491. LibName("PHYSX", SDK["PHYSX"] + "/lib/Win32/PhysXLoader.lib")
  492. LibName("PHYSX", SDK["PHYSX"] + "/lib/Win32/NxCharacter.lib")
  493. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  494. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  495. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  496. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  497. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  498. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  499. # We need to be able to find NxCharacter.dll when importing code library libpandaphysx
  500. AddToPathEnv("PATH", SDK["PHYSX"]+"/../Bin/win32/")
  501. if (PkgSkip("SPEEDTREE")==0):
  502. win64 = (sys.platform.startswith("win") and is_64)
  503. if win64:
  504. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC9.x64/"
  505. p64ext = '64'
  506. else:
  507. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC9/"
  508. p64ext = ''
  509. debugext = ''
  510. if (GetOptimize() <= 2 and sys.platform.startswith("win")): debugext = "_d"
  511. libsuffix = "_v%s_VC90MT%s_Static%s.lib" % (
  512. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  513. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  514. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  515. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  516. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  517. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  518. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  519. LibName("SPEEDTREE", "glu32.lib")
  520. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  521. if (PkgSkip("BULLET")==0):
  522. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath.lib")
  523. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision.lib")
  524. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics.lib")
  525. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody.lib")
  526. if (COMPILER=="LINUX"):
  527. PkgDisable("AWESOMIUM")
  528. if (PkgSkip("PYTHON")==0):
  529. IncDirectory("ALWAYS", SDK["PYTHON"])
  530. if (sys.platform == "darwin"):
  531. if (PkgSkip("FREETYPE")==0):
  532. IncDirectory("FREETYPE", "/usr/X11R6/include")
  533. IncDirectory("FREETYPE", "/usr/X11/include")
  534. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  535. IncDirectory("GL", "/usr/X11R6/include")
  536. if (os.path.isdir("/usr/PCBSD")):
  537. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  538. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  539. if (sys.platform.startswith("freebsd")):
  540. IncDirectory("ALWAYS", "/usr/local/include")
  541. LibDirectory("ALWAYS", "/usr/local/lib")
  542. # Workaround for an issue where pkg-config does not include this path
  543. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  544. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  545. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  546. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  547. fcollada_libs = ("FColladaD", "FColladaSD")
  548. # WARNING! The order of the ffmpeg libraries matters!
  549. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  550. # Name pkg-config libs, include(dir)s
  551. if (not RUNTIME):
  552. SmartPkgEnable("EIGEN", "", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  553. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  554. SmartPkgEnable("FCOLLADA", "", ChooseLib(*fcollada_libs), ("FCollada", "FCollada.h"))
  555. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ffmpeg_libs)
  556. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale", "libswscale/swscale.h"), target_pkg = "FFMPEG")
  557. SmartPkgEnable("FFTW", "", ("fftw", "rfftw"), ("fftw.h", "rfftw.h"))
  558. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  559. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  560. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  561. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  562. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  563. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  564. SmartPkgEnable("OSMESA", "osmesa", ("OSMesa"), ("GL/osmesa.h"))
  565. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  566. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h")
  567. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  568. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"), ("opencv", "opencv/cv.h"))
  569. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  570. SmartPkgEnable("TIFF", "", ("tiff"), "tiff.h")
  571. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  572. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  573. SmartPkgEnable("ROCKET", "", ("RocketCore", "RocketControls"), "Rocket/Core.h")
  574. SmartPkgEnable("GTK2", "gtk+-2.0")
  575. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  576. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  577. SmartPkgEnable("PNG", "libpng", ("png"), "png.h")
  578. SmartPkgEnable("ZLIB", "", ("z"), "zlib.h")
  579. if (RTDIST and sys.platform == "darwin" and "PYTHONVERSION" in SDK):
  580. # Don't use the framework for the OSX rtdist build. I'm afraid it gives problems somewhere.
  581. SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config")
  582. elif("PYTHONVERSION" in SDK and not RUNTIME):
  583. SmartPkgEnable("PYTHON", "", SDK["PYTHONVERSION"], (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"), tool = SDK["PYTHONVERSION"] + "-config", framework = "Python")
  584. if (RTDIST):
  585. SmartPkgEnable("WX", tool = "wx-config")
  586. SmartPkgEnable("FLTK", "", ("fltk"), ("Fl/Fl.H"), tool = "fltk-config")
  587. if (RUNTIME):
  588. if (sys.platform.startswith("freebsd")):
  589. SmartPkgEnable("NPAPI", "mozilla-plugin", (), ("libxul/stable", "libxul/stable/npapi.h", "nspr/prtypes.h", "nspr"))
  590. else:
  591. SmartPkgEnable("NPAPI", "mozilla-plugin", (), ("xulrunner-*/stable", "xulrunner-*/stable/npapi.h", "nspr*/prtypes.h", "nspr*"))
  592. if (sys.platform != "darwin"):
  593. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  594. if (PkgSkip("NVIDIACG")==0 and not RUNTIME):
  595. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h")
  596. if (not RUNTIME):
  597. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h"))
  598. SmartPkgEnable("XRANDR", "xrandr", "Xrandr", "X11/extensions/Xrandr.h")
  599. SmartPkgEnable("XF86DGA", "xxf86dga", "Xxf86dga", "X11/extensions/xf86dga.h")
  600. SmartPkgEnable("XCURSOR", "xcursor", "Xcursor", "X11/Xcursor/Xcursor.h")
  601. if (RUNTIME):
  602. # For the runtime, all packages are required
  603. for pkg in ["OPENSSL", "ZLIB", "NPAPI", "JPEG", "PNG"]:
  604. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  605. exit("Runtime must be compiled with OpenSSL, ZLib, NPAPI, JPEG and PNG support!")
  606. if (not RUNTIME and not LocateBinary("bison")):
  607. exit("Could not locate bison!")
  608. if (not RUNTIME and not LocateBinary("flex")):
  609. exit("Could not locate flex!")
  610. for pkg in MAYAVERSIONS:
  611. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  612. if (sys.platform == "darwin"):
  613. # Sheesh, Autodesk really can't make up their mind
  614. # regarding the location of the Maya devkit on OS X.
  615. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  616. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  617. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  618. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  619. if (os.path.isdir(SDK[pkg] + "/lib")):
  620. LibDirectory(pkg, SDK[pkg] + "/lib")
  621. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  622. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  623. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  624. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  625. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  626. IncDirectory(pkg, SDK[pkg] + "/include")
  627. else:
  628. LibDirectory(pkg, SDK[pkg] + "/lib")
  629. IncDirectory(pkg, SDK[pkg] + "/include")
  630. DefSymbol(pkg, "MAYAVERSION", pkg)
  631. if (sys.platform == "darwin"):
  632. LibName("ALWAYS", "-framework AppKit")
  633. if (PkgSkip("OPENCV")==0): LibName("OPENCV", "-framework QuickTime")
  634. LibName("AGL", "-framework AGL")
  635. LibName("CARBON", "-framework Carbon")
  636. LibName("COCOA", "-framework Cocoa")
  637. # Fix for a bug in OSX Leopard:
  638. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  639. for pkg in MAYAVERSIONS:
  640. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  641. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  642. if (sys.platform != "darwin"):
  643. LibName(pkg, "-lOpenMayalib")
  644. LibName(pkg, "-lOpenMaya")
  645. LibName(pkg, "-lOpenMayaAnim")
  646. LibName(pkg, "-lAnimSlice")
  647. LibName(pkg, "-lDeformSlice")
  648. LibName(pkg, "-lModifiers")
  649. LibName(pkg, "-lDynSlice")
  650. LibName(pkg, "-lKinSlice")
  651. LibName(pkg, "-lModelSlice")
  652. LibName(pkg, "-lNurbsSlice")
  653. LibName(pkg, "-lPolySlice")
  654. LibName(pkg, "-lProjectSlice")
  655. LibName(pkg, "-lImage")
  656. LibName(pkg, "-lShared")
  657. LibName(pkg, "-lTranslators")
  658. LibName(pkg, "-lDataModel")
  659. LibName(pkg, "-lRenderModel")
  660. LibName(pkg, "-lNurbsEngine")
  661. LibName(pkg, "-lDependEngine")
  662. LibName(pkg, "-lCommandEngine")
  663. LibName(pkg, "-lFoundation")
  664. LibName(pkg, "-lIMFbase")
  665. if (sys.platform == "darwin"):
  666. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  667. if (PkgSkip("PHYSX")==0):
  668. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  669. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  670. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  671. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  672. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  673. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  674. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  675. if (sys.platform == "darwin"):
  676. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  677. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  678. else:
  679. LibName("PHYSX", "-lPhysXLoader")
  680. LibName("PHYSX", "-lNxCharacter")
  681. DefSymbol("ALWAYS", "MAKEPANDA", "")
  682. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  683. if GetLinkAllStatic():
  684. DefSymbol("ALWAYS", "LINK_ALL_STATIC", "")
  685. ########################################################################
  686. ##
  687. ## Give a Status Report on Command-Line Options
  688. ##
  689. ########################################################################
  690. def printStatus(header,warnings):
  691. if GetVerbose():
  692. print ""
  693. print "-------------------------------------------------------------------"
  694. print header
  695. tkeep = ""
  696. tomit = ""
  697. for x in PkgListGet():
  698. if (PkgSkip(x)==0): tkeep = tkeep + x + " "
  699. else: tomit = tomit + x + " "
  700. if RTDIST: print "Makepanda: Runtime distribution build"
  701. elif RUNTIME: print "Makepanda: Runtime build"
  702. else: print "Makepanda: Regular build"
  703. print "Makepanda: Compiler:",COMPILER
  704. print "Makepanda: Optimize:",GetOptimize()
  705. print "Makepanda: Keep Pkg:",tkeep
  706. print "Makepanda: Omit Pkg:",tomit
  707. if (GENMAN): print "Makepanda: Generate API reference manual"
  708. else : print "Makepanda: Don't generate API reference manual"
  709. if (sys.platform == "win32" and not RTDIST):
  710. if INSTALLER: print "Makepanda: Build installer, using",COMPRESSOR
  711. else : print "Makepanda: Don't build installer"
  712. print "Makepanda: Version ID: "+VERSION
  713. for x in warnings: print "Makepanda: "+x
  714. print "-------------------------------------------------------------------"
  715. print ""
  716. sys.stdout.flush()
  717. ########################################################################
  718. ##
  719. ## BracketNameWithQuotes
  720. ##
  721. ########################################################################
  722. def BracketNameWithQuotes(name):
  723. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  724. if (name.startswith("-framework")): return name
  725. if (name.startswith("-dylib_file")): return name
  726. # Don't add quotes when it's not necessary.
  727. if " " not in name: return name
  728. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  729. if (name.startswith('"') and name.endswith('"')): return name
  730. else: return '"' + name + '"'
  731. ########################################################################
  732. ##
  733. ## CompileCxx
  734. ##
  735. ########################################################################
  736. def CompileCxx(obj,src,opts):
  737. ipath = GetListOption(opts, "DIR:")
  738. if (COMPILER=="MSVC"):
  739. if not BOOUSEINTELCOMPILER:
  740. cmd = "cl "
  741. if (is_64):
  742. cmd += "/favor:blend "
  743. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  744. # Enables Windows 7 mode if SDK is detected.
  745. # But only if it is Windows 7 (0x601) and not e. g. Vista (0x600)
  746. if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
  747. platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
  748. winver = sys.getwindowsversion()
  749. if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
  750. cmd += "/DPANDA_WIN7 /DWINVER=0x601 "
  751. cmd += "/Fo" + obj + " /nologo /c"
  752. if (not is_64):
  753. cmd += " /arch:SSE2"
  754. for x in ipath: cmd += " /I" + x
  755. for (opt,dir) in INCDIRECTORIES:
  756. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  757. for (opt,var,val) in DEFSYMBOLS:
  758. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  759. if (opts.count('NOFLOATWARN')): cmd += ' /wd4244 /wd4305'
  760. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  761. optlevel = GetOptimizeOption(opts)
  762. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  763. if (optlevel==2): cmd += " /MDd /Zi"
  764. if (optlevel==3): cmd += " /MD /Zi /O2 /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING"
  765. if (optlevel==4):
  766. cmd += " /MD /Zi /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  767. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  768. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  769. building = GetValueOption(opts, "BUILDING:")
  770. if (building): cmd += " /DBUILDING_" + building
  771. if ("BIGOBJ" in opts) or (is_64):
  772. cmd += " /bigobj"
  773. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32 /W3 " + BracketNameWithQuotes(src)
  774. oscmd(cmd)
  775. else:
  776. cmd = "icl "
  777. if (is_64):
  778. cmd += "/favor:blend "
  779. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  780. # Enables Windows 7 mode if SDK is detected.
  781. # But only if it is Windows 7 (0x601) and not e. g. Vista (0x600)
  782. if (STRMSPLATFORMVERSION not in ['winserver2003r2', 'win60A']):
  783. platsdk = GetRegistryKey("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v7.1", "InstallationFolder")
  784. winver = sys.getwindowsversion()
  785. if platsdk and os.path.isdir(platsdk) and winver[0] >= 6 and winver[1] >= 1:
  786. cmd += "/DPANDA_WIN7 /DWINVER=0x601 "
  787. cmd += "/Fo" + obj + " /c"
  788. for x in ipath: cmd += " /I" + x
  789. for (opt,dir) in INCDIRECTORIES:
  790. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  791. for (opt,var,val) in DEFSYMBOLS:
  792. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  793. if (opts.count('NOFLOATWARN')): cmd += ' /wd4244 /wd4305'
  794. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  795. optlevel = GetOptimizeOption(opts)
  796. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  797. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  798. # core changes from jean-claude (dec 2011)
  799. # ----------------------------------------
  800. # performance will be seeked at level 3 & 4
  801. # -----------------------------------------
  802. if (optlevel==3):
  803. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  804. cmd += " /Ob0"
  805. cmd += " /Qipo-" # beware of IPO !!!
  806. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  807. ## ----------------------------------------------------------------
  808. if (optlevel==4):
  809. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  810. cmd += " /Qipo" # optimization multi file
  811. # for 3 & 4 optimization levels
  812. # -----------------------------
  813. if (optlevel>=3):
  814. cmd += " /fp:fast=2"
  815. cmd += " /Qftz"
  816. cmd += " /Qfp-speculation:fast"
  817. cmd += " /Qopt-matmul" # needs /O2 or /O3
  818. cmd += " /Qprec-div-"
  819. cmd += " /Qsimd"
  820. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  821. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  822. cmd += " /Qparallel" # enable parallelization
  823. cmd += " /Qvc9" # for Microsoft Visual C++ 2008
  824. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  825. ## PCH files with a .pchi filename suffix and reduce build time.
  826. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  827. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  828. cmd += " /Qpchi-" # keep it this way!
  829. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  830. ## ------------------------------------
  831. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  832. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  833. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  834. ## Ctor displacement /vd0 : Disable constructor displacement.
  835. ## Choose this option only if no class constructors or destructors call virtual functions.
  836. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  837. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  838. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  839. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  840. ## Alternate: #pragma pointers_to_members
  841. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  842. building = GetValueOption(opts, "BUILDING:")
  843. if (building): cmd += " /DBUILDING_" + building
  844. if ("BIGOBJ" in opts) or (is_64):
  845. cmd += " /bigobj"
  846. # level of warnings and optimization reports
  847. if GetVerbose():
  848. cmd += " /W3 " # or /W4 or /Wall
  849. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  850. else:
  851. cmd += " /W1 "
  852. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32 " + BracketNameWithQuotes(src)
  853. oscmd(cmd)
  854. if (COMPILER=="LINUX"):
  855. cc = os.environ.get('CC', 'gcc')
  856. cxx = os.environ.get('CXX', 'g++')
  857. if (src.endswith(".c")): cmd = cc +' -fPIC -c -o ' + obj
  858. else: cmd = cxx+' -ftemplate-depth-30 -fPIC -c -o ' + obj
  859. for (opt, dir) in INCDIRECTORIES:
  860. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  861. for (opt,var,val) in DEFSYMBOLS:
  862. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  863. for x in ipath: cmd += ' -I' + x
  864. if (sys.platform == "darwin"):
  865. cmd += " -Wno-deprecated-declarations"
  866. if (OSXTARGET != None):
  867. cmd += " -isysroot " + SDK["MACOSX"]
  868. cmd += " -mmacosx-version-min=" + OSXTARGET
  869. if is_64:
  870. cmd += " -arch x86_64"
  871. else:
  872. cmd += " -arch i386"
  873. if ("NOPPC" not in opts): cmd += " -arch ppc"
  874. cmd += " -pthread -msse2"
  875. optlevel = GetOptimizeOption(opts)
  876. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  877. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  878. if (optlevel==3): cmd += " -O2"
  879. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  880. if (CFLAGS !=""): cmd += " " + CFLAGS
  881. building = GetValueOption(opts, "BUILDING:")
  882. if (building): cmd += " -DBUILDING_" + building
  883. cmd += ' ' + BracketNameWithQuotes(src)
  884. oscmd(cmd)
  885. ########################################################################
  886. ##
  887. ## CompileBison
  888. ##
  889. ########################################################################
  890. def CompileBison(wobj, wsrc, opts):
  891. ifile = os.path.basename(wsrc)
  892. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  893. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  894. pre = GetValueOption(opts, "BISONPREFIX_")
  895. if (COMPILER == "MSVC"):
  896. oscmd(GetThirdpartyBase()+'/win-util/bison -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  897. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  898. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  899. if (COMPILER == "LINUX"):
  900. oscmd("bison -y -d -o"+GetOutputDir()+"/tmp/"+ifile+".c -p "+pre+" "+wsrc)
  901. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  902. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  903. CompileCxx(wobj,wdstc,opts)
  904. ########################################################################
  905. ##
  906. ## CompileFlex
  907. ##
  908. ########################################################################
  909. def CompileFlex(wobj,wsrc,opts):
  910. ifile = os.path.basename(wsrc)
  911. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  912. pre = GetValueOption(opts, "BISONPREFIX_")
  913. dashi = opts.count("FLEXDASHI")
  914. if (COMPILER == "MSVC"):
  915. if (dashi): oscmd(GetThirdpartyBase()+"/win-util/flex -i -P" + pre + " -o"+wdst+" "+wsrc)
  916. else: oscmd(GetThirdpartyBase()+"/win-util/flex -P" + pre + " -o"+wdst+" "+wsrc)
  917. if (COMPILER == "LINUX"):
  918. if (dashi): oscmd("flex -i -P" + pre + " -o"+wdst+" "+wsrc)
  919. else: oscmd("flex -P" + pre + " -o"+wdst+" "+wsrc)
  920. CompileCxx(wobj,wdst,opts)
  921. ########################################################################
  922. ##
  923. ## CompileIgate
  924. ##
  925. ########################################################################
  926. def CompileIgate(woutd,wsrc,opts):
  927. outbase = os.path.basename(woutd)[:-3]
  928. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  929. wobj = FindLocation(outbase + "_igate.obj", [])
  930. srcdir = GetValueOption(opts, "SRCDIR:")
  931. module = GetValueOption(opts, "IMOD:")
  932. library = GetValueOption(opts, "ILIB:")
  933. ipath = GetListOption(opts, "DIR:")
  934. if (PkgSkip("PYTHON")):
  935. WriteFile(woutc,"")
  936. WriteFile(woutd,"")
  937. CompileCxx(wobj,woutc,opts)
  938. ConditionalWriteFile(woutd,"")
  939. return
  940. cmd = GetOutputDir()+"/bin/interrogate -srcdir "+srcdir+" -I"+srcdir
  941. cmd += ' -Dvolatile -Dmutable'
  942. if (COMPILER=="MSVC"):
  943. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -longlong __int64 -D_X86_ -DWIN32_VC -D_WIN32'
  944. #NOTE: this 1500 value is the version number for VC2008.
  945. cmd += ' -D_MSC_VER=1500 -D"_declspec(param)=" -D_near -D_far -D__near -D__far -D__stdcall'
  946. if (COMPILER=="LINUX") and (is_64):
  947. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D_LP64'
  948. if (COMPILER=="LINUX") and (not is_64):
  949. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus -D__inline -D__const=const -D__i386__'
  950. optlevel=GetOptimizeOption(opts)
  951. if (optlevel==1): cmd += ' -D_DEBUG'
  952. if (optlevel==2): cmd += ' -D_DEBUG'
  953. if (optlevel==3): pass
  954. if (optlevel==4): cmd += ' -DNDEBUG'
  955. cmd += ' -oc ' + woutc + ' -od ' + woutd
  956. cmd += ' -fnames -string -refcount -assert -python-native'
  957. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  958. for x in ipath: cmd += ' -I' + BracketNameWithQuotes(x)
  959. for (opt,dir) in INCDIRECTORIES:
  960. if (opt=="ALWAYS") or (opt in opts): cmd += ' -S' + BracketNameWithQuotes(dir)
  961. for (opt,var,val) in DEFSYMBOLS:
  962. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  963. building = GetValueOption(opts, "BUILDING:")
  964. if (building): cmd += " -DBUILDING_"+building
  965. cmd += ' -module ' + module + ' -library ' + library
  966. for x in wsrc:
  967. if (x.startswith("/")):
  968. cmd += ' ' + BracketNameWithQuotes(x)
  969. else:
  970. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  971. oscmd(cmd)
  972. CompileCxx(wobj,woutc,opts)
  973. return
  974. ########################################################################
  975. ##
  976. ## CompileImod
  977. ##
  978. ########################################################################
  979. def CompileImod(wobj, wsrc, opts):
  980. module = GetValueOption(opts, "IMOD:")
  981. library = GetValueOption(opts, "ILIB:")
  982. if (COMPILER=="MSVC"):
  983. woutc = wobj[:-4]+".cxx"
  984. if (COMPILER=="LINUX"):
  985. woutc = wobj[:-2]+".cxx"
  986. if (PkgSkip("PYTHON")):
  987. WriteFile(woutc,"")
  988. CompileCxx(wobj,woutc,opts)
  989. return
  990. cmd = GetOutputDir() + '/bin/interrogate_module '
  991. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native '
  992. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  993. oscmd(cmd)
  994. CompileCxx(wobj,woutc,opts)
  995. return
  996. ########################################################################
  997. ##
  998. ## CompileLib
  999. ##
  1000. ########################################################################
  1001. def CompileLib(lib, obj, opts):
  1002. if (COMPILER=="MSVC"):
  1003. if not BOOUSEINTELCOMPILER:
  1004. #Use MSVC Linker
  1005. cmd = 'link /lib /nologo '
  1006. if (is_64):
  1007. cmd += "/MACHINE:X64 "
  1008. cmd += '/OUT:' + BracketNameWithQuotes(lib)
  1009. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1010. oscmd(cmd)
  1011. else:
  1012. # Choose Intel linker; from Jean-Claude
  1013. cmd = 'xilink /verbose:lib /lib '
  1014. if (is_64):
  1015. cmd += "/MACHINE:X64 "
  1016. cmd += '/OUT:' + BracketNameWithQuotes(lib)
  1017. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1018. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1019. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc9"'
  1020. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1021. oscmd(cmd)
  1022. if (COMPILER=="LINUX"):
  1023. if sys.platform == 'darwin':
  1024. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1025. else:
  1026. cmd = 'ar cru ' + BracketNameWithQuotes(lib)
  1027. for x in obj: cmd=cmd + ' ' + BracketNameWithQuotes(x)
  1028. oscmd(cmd)
  1029. oscmd("ranlib " + BracketNameWithQuotes(lib))
  1030. ########################################################################
  1031. ##
  1032. ## CompileLink
  1033. ##
  1034. ########################################################################
  1035. def CompileLink(dll, obj, opts):
  1036. if (COMPILER=="MSVC"):
  1037. if not BOOUSEINTELCOMPILER:
  1038. cmd = "link /nologo"
  1039. if (is_64):
  1040. cmd += " /MACHINE:X64"
  1041. if ("MFC" not in opts):
  1042. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1043. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1044. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1045. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1046. optlevel = GetOptimizeOption(opts)
  1047. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1048. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1049. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1050. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1051. if ("MFC" in opts):
  1052. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs90d.lib MSVCRTD.lib"
  1053. else: cmd += " /NOD:MSVCRT.LIB mfcs90.lib MSVCRT.lib"
  1054. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1055. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1056. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1057. if (subsystem): cmd += " /SUBSYSTEM:" + subsystem
  1058. if (dll.endswith(".dll")):
  1059. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/'+os.path.splitext(os.path.basename(dll))[0]+".lib"
  1060. for (opt, dir) in LIBDIRECTORIES:
  1061. if (opt=="ALWAYS") or (opt in opts): cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1062. for x in obj:
  1063. if (x.endswith(".dll")):
  1064. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1065. elif (x.endswith(".lib")):
  1066. dname = os.path.splitext(dll)[0]+".dll"
  1067. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1068. exit("Error: in makepanda, specify "+dname+", not "+x)
  1069. cmd += ' ' + BracketNameWithQuotes(x)
  1070. elif (x.endswith(".def")):
  1071. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1072. elif (x.endswith(".dat")):
  1073. pass
  1074. else: cmd += ' ' + BracketNameWithQuotes(x)
  1075. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1076. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1077. for (opt, name) in LIBNAMES:
  1078. if (opt=="ALWAYS") or (opt in opts): cmd += " " + BracketNameWithQuotes(name)
  1079. oscmd(cmd)
  1080. SetVC90CRTVersion(dll+".manifest")
  1081. mtcmd = "mt -manifest " + dll + ".manifest -outputresource:" + dll
  1082. if (dll.endswith(".exe")==0): mtcmd = mtcmd + ";2"
  1083. else: mtcmd = mtcmd + ";1"
  1084. oscmd(mtcmd, ignoreError=True) # HACK: For some reason, mt sometimes gives a non-zero return value, even when it works
  1085. else:
  1086. cmd = "xilink"
  1087. if GetVerbose(): cmd += " /verbose:lib"
  1088. if (is_64):
  1089. cmd += " /MACHINE:X64"
  1090. if ("MFC" not in opts):
  1091. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1092. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1093. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1094. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1095. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc9"'
  1096. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1097. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1098. optlevel = GetOptimizeOption(opts)
  1099. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1100. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1101. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1102. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1103. if ("MFC" in opts):
  1104. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs90d.lib MSVCRTD.lib"
  1105. else: cmd += " /NOD:MSVCRT.LIB mfcs90.lib MSVCRT.lib"
  1106. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1107. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1108. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1109. if (subsystem): cmd += " /SUBSYSTEM:" + subsystem
  1110. if (dll.endswith(".dll")):
  1111. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/'+os.path.splitext(os.path.basename(dll))[0]+".lib"
  1112. for (opt, dir) in LIBDIRECTORIES:
  1113. if (opt=="ALWAYS") or (opt in opts): cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1114. for x in obj:
  1115. if (x.endswith(".dll")):
  1116. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1117. elif (x.endswith(".lib")):
  1118. dname = os.path.splitext(dll)[0]+".dll"
  1119. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1120. exit("Error: in makepanda, specify "+dname+", not "+x)
  1121. cmd += ' ' + BracketNameWithQuotes(x)
  1122. elif (x.endswith(".def")):
  1123. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1124. elif (x.endswith(".dat")):
  1125. pass
  1126. else: cmd += ' ' + BracketNameWithQuotes(x)
  1127. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1128. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1129. for (opt, name) in LIBNAMES:
  1130. if (opt=="ALWAYS") or (opt in opts): cmd += " " + BracketNameWithQuotes(name)
  1131. oscmd(cmd)
  1132. SetVC90CRTVersion(dll+".manifest")
  1133. mtcmd = "mt -manifest " + dll + ".manifest -outputresource:" + dll
  1134. if (dll.endswith(".exe")==0): mtcmd = mtcmd + ";2"
  1135. else: mtcmd = mtcmd + ";1"
  1136. oscmd(mtcmd, ignoreError=True) # HACK: For some reason, mt sometimes gives a non-zero return value, even when it works
  1137. if (COMPILER=="LINUX"):
  1138. cxx = os.environ.get('CXX', 'g++')
  1139. if (GetOrigExt(dll)==".exe"): cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp -L/usr/X11R6/lib'
  1140. else:
  1141. if (sys.platform == "darwin"):
  1142. cmd = cxx + ' -undefined dynamic_lookup'
  1143. if ("BUNDLE" in opts): cmd += ' -bundle '
  1144. else:
  1145. cmd += ' -dynamiclib -install_name ' + os.path.basename(dll)
  1146. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1147. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp -L/usr/X11R6/lib'
  1148. else:
  1149. cmd = cxx + ' -shared'
  1150. if ("MODULE" not in opts): cmd += " -Wl,-soname=" + os.path.basename(dll)
  1151. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp -L/usr/X11R6/lib'
  1152. for x in obj:
  1153. if (GetOrigExt(x) != ".dat"):
  1154. base = os.path.basename(x)
  1155. if (base[-3:]==".so") and (base[:3]=="lib"):
  1156. cmd += ' -l' + base[3:-3]
  1157. elif (base[-2:]==".a") and (base[:3]=="lib"):
  1158. cmd += ' -l' + base[3:-2]
  1159. else:
  1160. cmd += ' ' + x
  1161. if (sys.platform == "darwin"):
  1162. cmd += " -headerpad_max_install_names"
  1163. if (OSXTARGET != None):
  1164. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1165. cmd += " -mmacosx-version-min=" + OSXTARGET
  1166. if is_64:
  1167. cmd += " -arch x86_64"
  1168. else:
  1169. cmd += " -arch i386"
  1170. if ("NOPPC" not in opts): cmd += " -arch ppc"
  1171. if (LDFLAGS !=""): cmd += " " + LDFLAGS
  1172. for (opt, dir) in LIBDIRECTORIES:
  1173. if (opt=="ALWAYS") or (opt in opts): cmd += ' -L' + BracketNameWithQuotes(dir)
  1174. for (opt, name) in LIBNAMES:
  1175. if (opt=="ALWAYS") or (opt in opts): cmd += ' ' + BracketNameWithQuotes(name)
  1176. cmd += " -pthread"
  1177. if (not sys.platform.startswith("freebsd")):
  1178. cmd += " -ldl"
  1179. oscmd(cmd)
  1180. if (GetOrigExt(dll)==".exe" and GetOptimizeOption(opts)==4 and "NOSTRIP" not in opts):
  1181. oscmd("strip " + BracketNameWithQuotes(dll))
  1182. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1183. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1184. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1185. if (os.path.isfile(newdll)):
  1186. os.remove(newdll)
  1187. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1188. elif dll.endswith("." + MAJOR_VERSION):
  1189. newdll = dll[:-len(MAJOR_VERSION)-1]
  1190. if (os.path.isfile(newdll)):
  1191. os.remove(newdll)
  1192. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1193. ##########################################################################################
  1194. #
  1195. # CompileEgg
  1196. #
  1197. ##########################################################################################
  1198. def CompileEgg(eggfile, src, opts):
  1199. pz = False
  1200. if (eggfile.endswith(".pz")):
  1201. pz = True
  1202. eggfile = eggfile[:-3]
  1203. if (src.endswith(".egg")):
  1204. CopyFile(eggfile, src)
  1205. elif (src.endswith(".flt")):
  1206. oscmd(GetOutputDir()+"/bin/flt2egg -ps keep -o " + BracketNameWithQuotes(eggfile) + " " + BracketNameWithQuotes(src))
  1207. if pz:
  1208. oscmd(GetOutputDir()+"/bin/pzip " + BracketNameWithQuotes(eggfile))
  1209. ##########################################################################################
  1210. #
  1211. # CompileResource
  1212. #
  1213. ##########################################################################################
  1214. def CompileResource(target, src, opts):
  1215. ipath = GetListOption(opts, "DIR:")
  1216. if (COMPILER=="MSVC"):
  1217. cmd = "rc"
  1218. cmd += " /Fo" + BracketNameWithQuotes(target)
  1219. for x in ipath: cmd += " /I" + x
  1220. for (opt,dir) in INCDIRECTORIES:
  1221. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1222. for (opt,var,val) in DEFSYMBOLS:
  1223. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1224. cmd += " " + BracketNameWithQuotes(src)
  1225. oscmd(cmd)
  1226. elif (sys.platform == "darwin"):
  1227. cmd = "/Developer/Tools/Rez -useDF"
  1228. cmd += " -o " + BracketNameWithQuotes(target)
  1229. for x in ipath: cmd += " -i " + x
  1230. for (opt,dir) in INCDIRECTORIES:
  1231. if (opt=="ALWAYS") or (opt in opts): cmd += " -i " + BracketNameWithQuotes(dir)
  1232. for (opt,var,val) in DEFSYMBOLS:
  1233. if (opt=="ALWAYS") or (opt in opts):
  1234. if (val == ""):
  1235. cmd += " -d " + var
  1236. else:
  1237. cmd += " -d " + var + " = " + val
  1238. cmd += " " + BracketNameWithQuotes(src)
  1239. oscmd(cmd)
  1240. ##########################################################################################
  1241. #
  1242. # RunGenPyCode
  1243. #
  1244. ##########################################################################################
  1245. def RunGenPyCode(target, inputs, opts):
  1246. if (PkgSkip("PYTHON") != 0): return
  1247. cmdstr = SDK["PYTHONEXEC"] + " " + os.path.join("direct", "src", "ffi", "jGenPyCode.py")
  1248. if (GENMAN): cmdstr += " -d"
  1249. cmdstr += " -r"
  1250. for i in inputs:
  1251. if (GetOrigExt(i)==".dll"):
  1252. cmdstr += " " + os.path.basename(os.path.splitext(i)[0].replace("_d","").replace(GetOutputDir()+"/lib/",""))
  1253. ## On a win7 64 bit system, dir/dir/python.exe doesn't work. Needs dir\\dir\\python.exe
  1254. if sys.platform.startswith("win"):
  1255. cmdstr = cmdstr.replace('/','\\')
  1256. oscmd(cmdstr)
  1257. ##########################################################################################
  1258. #
  1259. # FreezePy
  1260. #
  1261. ##########################################################################################
  1262. def FreezePy(target, inputs, opts):
  1263. assert len(inputs) > 0
  1264. # Make sure this function isn't called before genpycode is run.
  1265. cmdstr = SDK["PYTHONEXEC"] + " " + os.path.join("direct", "src", "showutil", "pfreeze.py")
  1266. src = inputs.pop(0)
  1267. for i in inputs:
  1268. cmdstr += " -i " + os.path.splitext(i)[0]
  1269. cmdstr += " -o " + target + " " + src
  1270. if ("LINK_PYTHON_STATIC" in opts):
  1271. os.environ["LINK_PYTHON_STATIC"] = "1"
  1272. oscmd(cmdstr)
  1273. if ("LINK_PYTHON_STATIC" in os.environ):
  1274. del os.environ["LINK_PYTHON_STATIC"]
  1275. if (not os.path.exists(target)):
  1276. exit("FREEZER_ERROR")
  1277. ##########################################################################################
  1278. #
  1279. # Package
  1280. #
  1281. ##########################################################################################
  1282. def Package(target, inputs, opts):
  1283. assert len(inputs) == 1
  1284. # Invoke the ppackage script.
  1285. command = SDK["PYTHONEXEC"]
  1286. if (GetOptimizeOption(opts) >= 4):
  1287. command += " -OO"
  1288. command += " direct/src/p3d/ppackage.py -u"
  1289. if (sys.platform == "darwin" and "MACOSX" in SDK and SDK["MACOSX"] != None and len(SDK["MACOSX"]) > 1):
  1290. command += " -R \"%s\"" % SDK["MACOSX"]
  1291. command += " -i \"" + GetOutputDir() + "/stage\""
  1292. if (P3DSUFFIX):
  1293. command += ' -a "' + P3DSUFFIX + '"'
  1294. command += " " + inputs[0]
  1295. oscmd(command)
  1296. ##########################################################################################
  1297. #
  1298. # CompileBundle
  1299. #
  1300. ##########################################################################################
  1301. def CompileBundle(target, inputs, opts):
  1302. if (sys.platform != "darwin"): return
  1303. plist = None
  1304. resources = []
  1305. objects = []
  1306. for i in inputs:
  1307. if (i.endswith(".plist")):
  1308. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1309. plist = i
  1310. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1311. resources.append(i)
  1312. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1313. objects.append(i)
  1314. else:
  1315. exit("Don't know how to bundle file %s" % i)
  1316. # Now link the object files to form the bundle.
  1317. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1318. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1319. oscmd("rm -rf %s" % target)
  1320. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1321. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1322. if target.endswith(".app"):
  1323. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1324. else:
  1325. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1326. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1327. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1328. for r in resources:
  1329. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1330. ##########################################################################################
  1331. #
  1332. # CompileMIDL
  1333. #
  1334. ##########################################################################################
  1335. def CompileMIDL(target, src, opts):
  1336. ipath = GetListOption(opts, "DIR:")
  1337. if (COMPILER=="MSVC"):
  1338. cmd = "midl"
  1339. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1340. for x in ipath: cmd += " /I" + x
  1341. for (opt,dir) in INCDIRECTORIES:
  1342. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1343. for (opt,var,val) in DEFSYMBOLS:
  1344. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1345. cmd += " " + BracketNameWithQuotes(src)
  1346. oscmd(cmd)
  1347. ##########################################################################################
  1348. #
  1349. # CompileAnything
  1350. #
  1351. ##########################################################################################
  1352. def CompileAnything(target, inputs, opts, progress = None):
  1353. if (opts.count("DEPENDENCYONLY")):
  1354. return
  1355. if (len(inputs)==0):
  1356. exit("No input files for target "+target)
  1357. infile = inputs[0]
  1358. origsuffix = GetOrigExt(target)
  1359. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1360. # It must be a simple copy operation.
  1361. ProgressOutput(progress, "Copying file", target)
  1362. CopyFile(target, infile)
  1363. if (origsuffix==".exe" and not sys.platform.startswith("win")):
  1364. os.system("chmod +x \"%s\"" % target)
  1365. return
  1366. elif (target == "pandac/PandaModules.py"):
  1367. ProgressOutput(progress, "Generating 'pandac' tree")
  1368. return RunGenPyCode(target, inputs, opts)
  1369. elif (infile.endswith(".py")):
  1370. if (origsuffix==".exe"):
  1371. ProgressOutput(progress, "Building frozen executable", target)
  1372. else:
  1373. ProgressOutput(progress, "Building frozen library", target)
  1374. return FreezePy(target, inputs, opts)
  1375. elif (infile.endswith(".idl")):
  1376. ProgressOutput(progress, "Compiling MIDL file", infile)
  1377. return CompileMIDL(target, infile, opts)
  1378. elif (infile.endswith(".pdef")):
  1379. ProgressOutput(progress, "Building package from pdef file", infile)
  1380. return Package(target, inputs, opts)
  1381. elif origsuffix in SUFFIX_LIB:
  1382. ProgressOutput(progress, "Linking static library", target)
  1383. return CompileLib(target, inputs, opts)
  1384. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and sys.platform != "darwin"):
  1385. if (origsuffix==".exe"):
  1386. ProgressOutput(progress, "Linking executable", target)
  1387. else:
  1388. ProgressOutput(progress, "Linking dynamic library", target)
  1389. # Add version number to the dynamic library, on unix
  1390. if (origsuffix==".dll" and "MODULE" not in opts and not sys.platform.startswith("win") and not RTDIST):
  1391. if (sys.platform == "darwin"):
  1392. if (target.lower().endswith(".dylib")):
  1393. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1394. SetOrigExt(target, origsuffix)
  1395. else:
  1396. target = target + "." + MAJOR_VERSION
  1397. SetOrigExt(target, origsuffix)
  1398. return CompileLink(target, inputs, opts)
  1399. elif (origsuffix==".in"):
  1400. ProgressOutput(progress, "Building Interrogate database", target)
  1401. return CompileIgate(target, inputs, opts)
  1402. elif (origsuffix==".plugin" and sys.platform == "darwin"):
  1403. ProgressOutput(progress, "Building plugin bundle", target)
  1404. return CompileBundle(target, inputs, opts)
  1405. elif (origsuffix==".app"):
  1406. ProgressOutput(progress, "Building application bundle", target)
  1407. return CompileBundle(target, inputs, opts)
  1408. elif (origsuffix==".pz"):
  1409. ProgressOutput(progress, "Compressing", target)
  1410. return CompileEgg(target, infile, opts)
  1411. elif (origsuffix==".egg"):
  1412. ProgressOutput(progress, "Converting", target)
  1413. return CompileEgg(target, infile, opts)
  1414. elif (origsuffix in [".res", ".rsrc"]):
  1415. ProgressOutput(progress, "Building resource object", target)
  1416. return CompileResource(target, infile, opts)
  1417. elif (origsuffix==".obj"):
  1418. if (infile.endswith(".cxx")):
  1419. ProgressOutput(progress, "Building C++ object", target)
  1420. return CompileCxx(target, infile, opts)
  1421. elif (infile.endswith(".c")):
  1422. ProgressOutput(progress, "Building C object", target)
  1423. return CompileCxx(target, infile, opts)
  1424. elif (infile.endswith(".mm")):
  1425. ProgressOutput(progress, "Building Objective-C++ object", target)
  1426. return CompileCxx(target, infile, opts)
  1427. elif (infile.endswith(".yxx")):
  1428. ProgressOutput(progress, "Building Bison object", target)
  1429. return CompileBison(target, infile, opts)
  1430. elif (infile.endswith(".lxx")):
  1431. ProgressOutput(progress, "Building Flex object", target)
  1432. return CompileFlex(target, infile, opts)
  1433. elif (infile.endswith(".in")):
  1434. ProgressOutput(progress, "Building Interrogate object", target)
  1435. return CompileImod(target, inputs, opts)
  1436. elif (infile.endswith(".rc") or infile.endswith(".r")):
  1437. ProgressOutput(progress, "Building resource object", target)
  1438. return CompileResource(target, infile, opts)
  1439. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1440. ##########################################################################################
  1441. #
  1442. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1443. #
  1444. ##########################################################################################
  1445. DTOOL_CONFIG=[
  1446. #_Variable_________________________Windows___________________Unix__________
  1447. ("HAVE_PYTHON", '1', '1'),
  1448. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1449. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1450. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1451. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1452. ("HAVE_MAYA", '1', '1'),
  1453. ("MAYA_PRE_5_0", 'UNDEF', 'UNDEF'),
  1454. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1455. ("SSL_097", 'UNDEF', 'UNDEF'),
  1456. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1457. ("USE_PANDAFILESTREAM", '1', '1'),
  1458. ("USE_DELETED_CHAIN", '1', '1'),
  1459. ("HAVE_GL", '1', 'UNDEF'),
  1460. ("HAVE_GLES", 'UNDEF', 'UNDEF'),
  1461. ("HAVE_GLES2", 'UNDEF', 'UNDEF'),
  1462. ("HAVE_MESA", 'UNDEF', 'UNDEF'),
  1463. ("MESA_MGL", 'UNDEF', 'UNDEF'),
  1464. ("HAVE_SGIGL", 'UNDEF', 'UNDEF'),
  1465. ("HAVE_GLX", 'UNDEF', '1'),
  1466. ("HAVE_EGL", 'UNDEF', 'UNDEF'),
  1467. ("HAVE_WGL", '1', 'UNDEF'),
  1468. ("HAVE_DX8", 'UNDEF', 'UNDEF'),
  1469. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1470. ("HAVE_CHROMIUM", 'UNDEF', 'UNDEF'),
  1471. ("HAVE_THREADS", '1', '1'),
  1472. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1473. ("OS_SIMPLE_THREADS", '1', '1'),
  1474. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1475. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1476. ("HAVE_AUDIO", '1', '1'),
  1477. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1478. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1479. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1480. ("SUPPORT_IMMEDIATE_MODE", '1', '1'),
  1481. ("TRACK_IN_INTERPRETER", 'UNDEF', 'UNDEF'),
  1482. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1483. ("DO_PIPELINING", '1', '1'),
  1484. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1485. ("LINK_IN_GL", 'UNDEF', 'UNDEF'),
  1486. ("LINK_IN_PHYSICS", 'UNDEF', 'UNDEF'),
  1487. ("DEFAULT_PATHSEP", '";"', '":"'),
  1488. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1489. ("HAVE_NAMESPACE", '1', '1'),
  1490. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1491. ("HAVE_WCHAR_T", '1', '1'),
  1492. ("HAVE_WSTRING", '1', '1'),
  1493. ("HAVE_TYPENAME", '1', '1'),
  1494. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1495. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1496. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1497. ("HAVE_GETTIMEOFDAY", 'UNDEF', '1'),
  1498. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1499. ("HAVE_GETOPT", 'UNDEF', '1'),
  1500. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1501. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1502. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1503. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1504. ("HAVE_STREAMSIZE", '1', '1'),
  1505. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1506. ("HAVE_IOS_BINARY", '1', '1'),
  1507. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1508. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1509. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1510. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1511. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1512. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1513. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1514. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1515. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1516. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1517. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1518. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1519. ("PHAVE_IO_H", '1', 'UNDEF'),
  1520. ("PHAVE_IOSTREAM", '1', '1'),
  1521. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1522. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1523. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1524. ("PHAVE_MALLOC_H", '1', '1'),
  1525. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1526. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1527. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1528. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1529. ("PHAVE_SSTREAM", '1', '1'),
  1530. ("PHAVE_NEW", '1', '1'),
  1531. ("PHAVE_SYS_TYPES_H", '1', '1'),
  1532. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  1533. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  1534. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  1535. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  1536. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  1537. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  1538. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  1539. ("PHAVE_STDINT_H", 'UNDEF', '1'),
  1540. ("HAVE_RTTI", '1', '1'),
  1541. ("HAVE_X11", 'UNDEF', '1'),
  1542. ("HAVE_XRANDR", 'UNDEF', '1'),
  1543. ("HAVE_XF86DGA", 'UNDEF', '1'),
  1544. ("HAVE_XCURSOR", 'UNDEF', '1'),
  1545. ("IS_LINUX", 'UNDEF', '1'),
  1546. ("IS_OSX", 'UNDEF', 'UNDEF'),
  1547. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  1548. ("GLOBAL_OPERATOR_NEW_EXCEPTIONS", 'UNDEF', '1'),
  1549. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  1550. ("LINMATH_ALIGN", '1', '1'),
  1551. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  1552. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  1553. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  1554. ("PHAVE_JPEGINT_H", '1', '1'),
  1555. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  1556. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  1557. ("HAVE_SGI_RGB", '1', '1'),
  1558. ("HAVE_TGA", '1', '1'),
  1559. ("HAVE_IMG", '1', '1'),
  1560. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  1561. ("HAVE_BMP", '1', '1'),
  1562. ("HAVE_PNM", '1', '1'),
  1563. ("HAVE_VRPN", 'UNDEF', 'UNDEF'),
  1564. ("HAVE_FMODEX", 'UNDEF', 'UNDEF'),
  1565. ("HAVE_OPENAL", 'UNDEF', 'UNDEF'),
  1566. ("HAVE_NVIDIACG", 'UNDEF', 'UNDEF'),
  1567. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  1568. ("HAVE_SPEEDTREE", 'UNDEF', 'UNDEF'),
  1569. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  1570. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  1571. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  1572. ("HAVE_EGG", '1', '1'),
  1573. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  1574. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  1575. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  1576. ("HAVE_FFMPEG", 'UNDEF', 'UNDEF'),
  1577. ("HAVE_SWSCALE", 'UNDEF', 'UNDEF'),
  1578. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  1579. ("HAVE_ODE", 'UNDEF', 'UNDEF'),
  1580. ("HAVE_OPENCV", 'UNDEF', 'UNDEF'),
  1581. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  1582. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  1583. ("HAVE_FCOLLADA", 'UNDEF', 'UNDEF'),
  1584. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1585. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  1586. # ("_SECURE_SCL", '0', 'UNDEF'),
  1587. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  1588. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  1589. ]
  1590. PRC_PARAMETERS=[
  1591. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  1592. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  1593. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  1594. ("PRC_PATH2_ENVVARS", '""', '""'),
  1595. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  1596. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  1597. ("PRC_ENCRYPTION_KEY", '""', '""'),
  1598. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  1599. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  1600. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  1601. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  1602. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  1603. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  1604. ]
  1605. def WriteConfigSettings():
  1606. dtool_config={}
  1607. prc_parameters={}
  1608. speedtree_parameters={}
  1609. plugin_config={}
  1610. if (sys.platform.startswith("win")):
  1611. for key,win,unix in DTOOL_CONFIG:
  1612. dtool_config[key] = win
  1613. for key,win,unix in PRC_PARAMETERS:
  1614. prc_parameters[key] = win
  1615. else:
  1616. for key,win,unix in DTOOL_CONFIG:
  1617. dtool_config[key] = unix
  1618. for key,win,unix in PRC_PARAMETERS:
  1619. prc_parameters[key] = unix
  1620. for x in PkgListGet():
  1621. if ("HAVE_"+x in dtool_config):
  1622. if (PkgSkip(x)==0):
  1623. dtool_config["HAVE_"+x] = '1'
  1624. else:
  1625. dtool_config["HAVE_"+x] = 'UNDEF'
  1626. dtool_config["HAVE_NET"] = '1'
  1627. if (PkgSkip("NVIDIACG")==0):
  1628. dtool_config["HAVE_CG"] = '1'
  1629. dtool_config["HAVE_CGGL"] = '1'
  1630. dtool_config["HAVE_CGDX9"] = '1'
  1631. if (not sys.platform.startswith("linux")):
  1632. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  1633. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  1634. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  1635. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  1636. if (sys.platform == "darwin"):
  1637. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  1638. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  1639. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  1640. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  1641. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  1642. dtool_config["HAVE_XRANDR"] = 'UNDEF'
  1643. dtool_config["HAVE_XF86DGA"] = 'UNDEF'
  1644. dtool_config["HAVE_XCURSOR"] = 'UNDEF'
  1645. dtool_config["HAVE_GLX"] = 'UNDEF'
  1646. dtool_config["IS_LINUX"] = 'UNDEF'
  1647. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  1648. dtool_config["IS_OSX"] = '1'
  1649. # 10.4 had a broken ucontext implementation
  1650. if int(platform.mac_ver()[0][3]) <= 4:
  1651. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  1652. if (sys.platform.startswith("freebsd")):
  1653. dtool_config["IS_LINUX"] = 'UNDEF'
  1654. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  1655. dtool_config["IS_FREEBSD"] = '1'
  1656. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  1657. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  1658. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  1659. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  1660. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  1661. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  1662. if (GetOptimize() <= 2 and sys.platform.startswith("win")):
  1663. dtool_config["USE_DEBUG_PYTHON"] = '1'
  1664. if (GetOptimize() <= 3):
  1665. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  1666. dtool_config["DO_PSTATS"] = '1'
  1667. if (GetOptimize() <= 3):
  1668. dtool_config["DO_COLLISION_RECORDING"] = '1'
  1669. #if (GetOptimize() <= 2):
  1670. # dtool_config["TRACK_IN_INTERPRETER"] = '1'
  1671. if (GetOptimize() <= 3):
  1672. dtool_config["DO_MEMORY_USAGE"] = '1'
  1673. #if (GetOptimize() <= 1):
  1674. # dtool_config["DO_PIPELINING"] = '1'
  1675. if (GetOptimize() <= 3):
  1676. dtool_config["NOTIFY_DEBUG"] = '1'
  1677. # Now that we have OS_SIMPLE_THREADS, we can support
  1678. # SIMPLE_THREADS on exotic architectures like win64, so we no
  1679. # longer need to disable it for this platform.
  1680. ## if (sys.platform.startswith("win") and is_64):
  1681. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  1682. if (RTDIST or RUNTIME):
  1683. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  1684. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  1685. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  1686. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  1687. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  1688. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  1689. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  1690. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  1691. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  1692. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  1693. if PkgSkip("GTK2") == 0:
  1694. plugin_config["HAVE_GTK"] = '1'
  1695. if (RUNTIME):
  1696. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  1697. # Whether it's present on the system doesn't matter here,
  1698. # as the runtime itself doesn't include or link with X11.
  1699. if (RUNTIME and sys.platform != "darwin" and not sys.platform.startswith("win")):
  1700. dtool_config["HAVE_X11"] = '1'
  1701. if ("GENERIC_DXERR_LIBRARY" in SDK):
  1702. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  1703. else:
  1704. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  1705. if (PkgSkip("SPEEDTREE")==0):
  1706. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  1707. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  1708. if SDK["SPEEDTREEAPI"] == "OpenGL":
  1709. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  1710. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  1711. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  1712. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  1713. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  1714. for key in prc_parameters.keys():
  1715. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  1716. val = OverrideValue(key, prc_parameters[key])
  1717. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  1718. else: conf = conf + "#define " + key + " " + val + "\n"
  1719. del prc_parameters[key]
  1720. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  1721. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  1722. for key in dtool_config.keys():
  1723. val = OverrideValue(key, dtool_config[key])
  1724. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  1725. else: conf = conf + "#define " + key + " " + val + "\n"
  1726. del dtool_config[key]
  1727. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  1728. if (RTDIST or RUNTIME):
  1729. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  1730. for key in plugin_config.keys():
  1731. val = plugin_config[key]
  1732. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  1733. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  1734. del plugin_config[key]
  1735. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  1736. if (PkgSkip("SPEEDTREE")==0):
  1737. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  1738. for key in speedtree_parameters.keys():
  1739. val = OverrideValue(key, speedtree_parameters[key])
  1740. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  1741. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  1742. del speedtree_parameters[key]
  1743. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  1744. for x in PkgListGet():
  1745. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat',"0\n")
  1746. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat',"1\n")
  1747. WriteConfigSettings()
  1748. MoveAwayConflictingFiles()
  1749. if "libdtoolbase" in GetLibCache():
  1750. print "%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor())
  1751. if "libp3dtoolconfig" in GetLibCache():
  1752. print "%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor())
  1753. ##########################################################################################
  1754. #
  1755. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  1756. #
  1757. ##########################################################################################
  1758. PANDAVERSION_H="""
  1759. #define PANDA_MAJOR_VERSION $VERSION1
  1760. #define PANDA_MINOR_VERSION $VERSION2
  1761. #define PANDA_SEQUENCE_VERSION $VERSION3
  1762. #define PANDA_VERSION $NVERSION
  1763. #define PANDA_NUMERIC_VERSION $NVERSION
  1764. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  1765. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  1766. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  1767. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  1768. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  1769. """
  1770. PANDAVERSION_H_RUNTIME="""
  1771. #define PANDA_MAJOR_VERSION 0
  1772. #define PANDA_MINOR_VERSION 0
  1773. #define PANDA_SEQUENCE_VERSION 0
  1774. #define PANDA_VERSION_STR "0.0.0"
  1775. #define PANDA_ABI_VERSION_STR "0.0"
  1776. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  1777. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  1778. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  1779. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  1780. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  1781. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  1782. #define PANDA_PACKAGE_VERSION_STR ""
  1783. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  1784. """
  1785. CHECKPANDAVERSION_CXX="""
  1786. # include "dtoolbase.h"
  1787. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  1788. """
  1789. CHECKPANDAVERSION_H="""
  1790. # include "dtoolbase.h"
  1791. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  1792. # ifndef WIN32
  1793. /* For Windows, exporting the symbol from the DLL is sufficient; the
  1794. DLL will not load unless all expected public symbols are defined.
  1795. Other systems may not mind if the symbol is absent unless we
  1796. explictly write code that references it. */
  1797. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  1798. # endif
  1799. """
  1800. P3DACTIVEX_RC="""#include "resource.h"
  1801. #define APSTUDIO_READONLY_SYMBOLS
  1802. #include "afxres.h"
  1803. #undef APSTUDIO_READONLY_SYMBOLS
  1804. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  1805. #ifdef _WIN32
  1806. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  1807. #pragma code_page(1252)
  1808. #endif
  1809. #ifdef APSTUDIO_INVOKED
  1810. 1 TEXTINCLUDE
  1811. BEGIN
  1812. "resource.h\\0"
  1813. END
  1814. 2 TEXTINCLUDE
  1815. BEGIN
  1816. "#include ""afxres.h""\\r\\n"
  1817. "\\0"
  1818. END
  1819. 3 TEXTINCLUDE
  1820. BEGIN
  1821. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  1822. "\\0"
  1823. END
  1824. #endif
  1825. %s
  1826. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  1827. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  1828. STYLE DS_SETFONT | WS_CHILD
  1829. FONT 8, "MS Sans Serif"
  1830. BEGIN
  1831. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  1832. IDC_STATIC,7,25,229,16
  1833. END
  1834. #ifdef APSTUDIO_INVOKED
  1835. GUIDELINES DESIGNINFO
  1836. BEGIN
  1837. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  1838. BEGIN
  1839. LEFTMARGIN, 7
  1840. RIGHTMARGIN, 243
  1841. TOPMARGIN, 7
  1842. BOTTOMMARGIN, 55
  1843. END
  1844. END
  1845. #endif
  1846. STRINGTABLE
  1847. BEGIN
  1848. IDS_P3DACTIVEX "P3DActiveX Control"
  1849. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  1850. END
  1851. STRINGTABLE
  1852. BEGIN
  1853. IDS_P3DACTIVEX_PPG_CAPTION "General"
  1854. END
  1855. #endif
  1856. #ifndef APSTUDIO_INVOKED
  1857. 1 TYPELIB "P3DActiveX.tlb"
  1858. #endif"""
  1859. def CreatePandaVersionFiles():
  1860. version1=int(VERSION.split(".")[0])
  1861. version2=int(VERSION.split(".")[1])
  1862. version3=int(VERSION.split(".")[2])
  1863. nversion=version1*1000000+version2*1000+version3
  1864. if (DISTRIBUTOR != "cmu"):
  1865. # Subtract 1 if we are not an official version.
  1866. nversion -= 1
  1867. if (RUNTIME):
  1868. pandaversion_h = PANDAVERSION_H_RUNTIME
  1869. else:
  1870. pandaversion_h = PANDAVERSION_H
  1871. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  1872. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  1873. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  1874. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  1875. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  1876. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  1877. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  1878. pandaversion_h = pandaversion_h.replace("$HOST_URL",HOST_URL)
  1879. if (DISTRIBUTOR == "cmu"):
  1880. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  1881. else:
  1882. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  1883. if not RUNTIME:
  1884. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  1885. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  1886. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  1887. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  1888. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  1889. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  1890. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  1891. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  1892. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  1893. if RUNTIME:
  1894. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  1895. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  1896. else:
  1897. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  1898. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  1899. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  1900. if RUNTIME:
  1901. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  1902. "version" : VERSION,
  1903. "description" : "Runs 3-D games and interactive applets",
  1904. "filename" : "p3dactivex.ocx",
  1905. "mimetype" : "application/x-panda3d",
  1906. "extension" : "p3d",
  1907. "filedesc" : "Panda3D applet"}
  1908. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  1909. CreatePandaVersionFiles()
  1910. ##########################################################################################
  1911. #
  1912. # Copy the "direct" tree and panda3d.py
  1913. #
  1914. ##########################################################################################
  1915. if (PkgSkip("DIRECT")==0):
  1916. CopyTree(GetOutputDir()+'/direct', 'direct/src')
  1917. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  1918. if (sys.platform.startswith("win")):
  1919. CopyFile(GetOutputDir()+'/bin/panda3d.py', 'direct/src/ffi/panda3d.py')
  1920. else:
  1921. CopyFile(GetOutputDir()+'/lib/panda3d.py', 'direct/src/ffi/panda3d.py')
  1922. ##########################################################################################
  1923. #
  1924. # Generate the PRC files into the ETC directory.
  1925. #
  1926. ##########################################################################################
  1927. confautoprc = ReadFile("makepanda/confauto.in")
  1928. if (PkgSkip("SPEEDTREE")==0):
  1929. # If SpeedTree is available, enable it in the config file
  1930. confautoprc = confautoprc.replace('#st#', '')
  1931. else:
  1932. # otherwise, disable it.
  1933. confautoprc = confautoprc.replace('#st#', '#')
  1934. if (os.path.isfile("makepanda/myconfig.in")):
  1935. configprc = ReadFile("makepanda/myconfig.in")
  1936. else:
  1937. configprc = ReadFile("makepanda/config.in")
  1938. if (sys.platform.startswith("win")):
  1939. configprc = configprc.replace("$HOME/.panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  1940. else:
  1941. configprc = configprc.replace("aux-display pandadx9", "")
  1942. configprc = configprc.replace("aux-display pandadx8", "")
  1943. if (sys.platform == "darwin"):
  1944. configprc = configprc.replace(".panda3d/cache", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  1945. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  1946. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  1947. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  1948. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  1949. ##########################################################################################
  1950. #
  1951. # Copy the precompiled binaries and DLLs into the build.
  1952. #
  1953. ##########################################################################################
  1954. for pkg in PkgListGet():
  1955. if (PkgSkip(pkg)==0):
  1956. if (COMPILER == "MSVC"):
  1957. if (os.path.exists(GetThirdpartyDir()+pkg.lower()+"/bin")):
  1958. CopyAllFiles(GetOutputDir()+"/bin/",GetThirdpartyDir()+pkg.lower()+"/bin/")
  1959. if (COMPILER == "LINUX"):
  1960. if (os.path.exists(GetThirdpartyDir()+pkg.lower()+"/lib")):
  1961. CopyAllFiles(GetOutputDir()+"/lib/",GetThirdpartyDir()+pkg.lower()+"/lib/")
  1962. if (COMPILER=="MSVC"):
  1963. CopyAllFiles(GetOutputDir()+"/bin/", GetThirdpartyDir()+"extras"+"/bin/")
  1964. if (sys.platform.startswith("win")):
  1965. if (PkgSkip("PYTHON")==0):
  1966. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  1967. if (GetOptimize() <= 2): pydll += "_d.dll"
  1968. else: pydll += ".dll"
  1969. CopyFile(GetOutputDir()+"/bin"+pydll, SDK["PYTHON"]+pydll)
  1970. if not RTDIST:
  1971. CopyTree(GetOutputDir()+"/python", SDK["PYTHON"])
  1972. ConditionalWriteFile(GetOutputDir()+"/python/panda.pth", "..\n../bin\n")
  1973. ########################################################################
  1974. ##
  1975. ## Copy various stuff into the build.
  1976. ##
  1977. ########################################################################
  1978. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  1979. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  1980. if (PkgSkip("PANDATOOL")==0):
  1981. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  1982. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  1983. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  1984. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  1985. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  1986. ########################################################################
  1987. #
  1988. # Copy header files to the built/include/parser-inc directory.
  1989. #
  1990. ########################################################################
  1991. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  1992. MakeDirectory(GetOutputDir()+'/include/parser-inc/openssl')
  1993. MakeDirectory(GetOutputDir()+'/include/parser-inc/netinet')
  1994. MakeDirectory(GetOutputDir()+'/include/parser-inc/Cg')
  1995. MakeDirectory(GetOutputDir()+'/include/parser-inc/Core')
  1996. MakeDirectory(GetOutputDir()+'/include/parser-inc/Forest')
  1997. MakeDirectory(GetOutputDir()+'/include/parser-inc/Renderers')
  1998. MakeDirectory(GetOutputDir()+'/include/parser-inc/Renderers/OpenGL')
  1999. MakeDirectory(GetOutputDir()+'/include/parser-inc/Renderers/DirectX9')
  2000. MakeDirectory(GetOutputDir()+'/include/parser-inc/glew')
  2001. MakeDirectory(GetOutputDir()+'/include/parser-inc/Eigen')
  2002. MakeDirectory(GetOutputDir()+'/include/parser-inc/Rocket')
  2003. MakeDirectory(GetOutputDir()+'/include/parser-inc/Rocket/Core')
  2004. CopyAllFiles(GetOutputDir()+'/include/parser-inc/openssl/','dtool/src/parser-inc/')
  2005. CopyAllFiles(GetOutputDir()+'/include/parser-inc/netinet/','dtool/src/parser-inc/')
  2006. CopyFile(GetOutputDir()+'/include/parser-inc/Cg/','dtool/src/parser-inc/cg.h')
  2007. CopyFile(GetOutputDir()+'/include/parser-inc/Cg/','dtool/src/parser-inc/cgGL.h')
  2008. CopyFile(GetOutputDir()+'/include/parser-inc/Core/','dtool/src/parser-inc/Core.h')
  2009. CopyFile(GetOutputDir()+'/include/parser-inc/Forest/','dtool/src/parser-inc/Forest.h')
  2010. CopyFile(GetOutputDir()+'/include/parser-inc/Renderers/OpenGL/','dtool/src/parser-inc/OpenGLRenderer.h')
  2011. CopyFile(GetOutputDir()+'/include/parser-inc/Renderers/DirectX9/','dtool/src/parser-inc/DirectX9Renderer.h')
  2012. CopyFile(GetOutputDir()+'/include/parser-inc/glew/','dtool/src/parser-inc/glew.h')
  2013. CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/Dense')
  2014. CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/StdVector')
  2015. CopyFile(GetOutputDir()+'/include/parser-inc/Rocket/Core/','dtool/src/parser-inc/RenderInterface.h')
  2016. DeleteCVS(GetOutputDir()+'/include/parser-inc')
  2017. ########################################################################
  2018. #
  2019. # Transfer all header files to the built/include directory.
  2020. #
  2021. ########################################################################
  2022. CopyAllHeaders('dtool/src/dtoolbase')
  2023. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2024. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2025. CopyAllHeaders('dtool/metalibs/dtool')
  2026. CopyAllHeaders('dtool/src/cppparser')
  2027. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2028. CopyAllHeaders('dtool/src/dconfig')
  2029. CopyAllHeaders('dtool/src/interrogatedb')
  2030. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2031. CopyAllHeaders('dtool/src/pystub')
  2032. CopyAllHeaders('dtool/src/interrogate')
  2033. CopyAllHeaders('dtool/src/test_interrogate')
  2034. CopyAllHeaders('panda/src/putil')
  2035. CopyAllHeaders('panda/src/pandabase')
  2036. CopyAllHeaders('panda/src/express')
  2037. CopyAllHeaders('panda/src/downloader')
  2038. CopyAllHeaders('panda/metalibs/pandaexpress')
  2039. CopyAllHeaders('panda/src/pipeline')
  2040. CopyAllHeaders('panda/src/putil')
  2041. CopyAllHeaders('dtool/src/prckeys')
  2042. CopyAllHeaders('panda/src/audio')
  2043. CopyAllHeaders('panda/src/event')
  2044. CopyAllHeaders('panda/src/linmath')
  2045. CopyAllHeaders('panda/src/mathutil')
  2046. CopyAllHeaders('panda/src/gsgbase')
  2047. CopyAllHeaders('panda/src/pnmimage')
  2048. CopyAllHeaders('panda/src/nativenet')
  2049. CopyAllHeaders('panda/src/net')
  2050. CopyAllHeaders('panda/src/pstatclient')
  2051. CopyAllHeaders('panda/src/gobj')
  2052. CopyAllHeaders('panda/src/movies')
  2053. CopyAllHeaders('panda/src/pgraphnodes')
  2054. CopyAllHeaders('panda/src/pgraph')
  2055. CopyAllHeaders('panda/src/cull')
  2056. CopyAllHeaders('panda/src/chan')
  2057. CopyAllHeaders('panda/src/char')
  2058. CopyAllHeaders('panda/src/dgraph')
  2059. CopyAllHeaders('panda/src/display')
  2060. CopyAllHeaders('panda/src/device')
  2061. CopyAllHeaders('panda/src/pnmtext')
  2062. CopyAllHeaders('panda/src/text')
  2063. CopyAllHeaders('panda/src/grutil')
  2064. if (PkgSkip("VISION")==0):
  2065. CopyAllHeaders('panda/src/vision')
  2066. CopyAllHeaders('panda/src/awesomium')
  2067. CopyAllHeaders('panda/src/tform')
  2068. CopyAllHeaders('panda/src/collide')
  2069. CopyAllHeaders('panda/src/parametrics')
  2070. CopyAllHeaders('panda/src/pgui')
  2071. CopyAllHeaders('panda/src/pnmimagetypes')
  2072. CopyAllHeaders('panda/src/recorder')
  2073. if (PkgSkip("ROCKET")==0):
  2074. CopyAllHeaders('panda/src/rocket')
  2075. if (PkgSkip("VRPN")==0):
  2076. CopyAllHeaders('panda/src/vrpn')
  2077. CopyAllHeaders('panda/src/wgldisplay')
  2078. CopyAllHeaders('panda/src/ode')
  2079. CopyAllHeaders('panda/metalibs/pandaode')
  2080. if (PkgSkip("PANDAPHYSICS")==0):
  2081. CopyAllHeaders('panda/src/physics')
  2082. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2083. CopyAllHeaders('panda/src/particlesystem')
  2084. CopyAllHeaders('panda/src/dxml')
  2085. CopyAllHeaders('panda/metalibs/panda')
  2086. CopyAllHeaders('panda/src/audiotraits')
  2087. CopyAllHeaders('panda/src/audiotraits')
  2088. CopyAllHeaders('panda/src/distort')
  2089. CopyAllHeaders('panda/src/downloadertools')
  2090. CopyAllHeaders('panda/src/windisplay')
  2091. CopyAllHeaders('panda/src/dxgsg8')
  2092. CopyAllHeaders('panda/metalibs/pandadx8')
  2093. CopyAllHeaders('panda/src/dxgsg9')
  2094. CopyAllHeaders('panda/metalibs/pandadx9')
  2095. CopyAllHeaders('panda/src/egg')
  2096. CopyAllHeaders('panda/src/egg2pg')
  2097. CopyAllHeaders('panda/src/framework')
  2098. CopyAllHeaders('panda/metalibs/pandafx')
  2099. CopyAllHeaders('panda/src/glstuff')
  2100. CopyAllHeaders('panda/src/glgsg')
  2101. CopyAllHeaders('panda/src/glesgsg')
  2102. CopyAllHeaders('panda/src/gles2gsg')
  2103. CopyAllHeaders('panda/metalibs/pandaegg')
  2104. if (sys.platform.startswith("win")):
  2105. CopyAllHeaders('panda/src/wgldisplay')
  2106. elif (sys.platform == "darwin"):
  2107. CopyAllHeaders('panda/src/osxdisplay')
  2108. else:
  2109. CopyAllHeaders('panda/src/x11display')
  2110. CopyAllHeaders('panda/src/glxdisplay')
  2111. CopyAllHeaders('panda/src/egldisplay')
  2112. CopyAllHeaders('panda/metalibs/pandagl')
  2113. CopyAllHeaders('panda/metalibs/pandagles')
  2114. CopyAllHeaders('panda/metalibs/pandagles2')
  2115. CopyAllHeaders('panda/metalibs/pandaphysics')
  2116. CopyAllHeaders('panda/src/testbed')
  2117. if (PkgSkip("PHYSX")==0):
  2118. CopyAllHeaders('panda/src/physx')
  2119. CopyAllHeaders('panda/metalibs/pandaphysx')
  2120. if (PkgSkip("BULLET")==0):
  2121. CopyAllHeaders('panda/src/bullet')
  2122. CopyAllHeaders('panda/metalibs/pandabullet')
  2123. if (PkgSkip("SPEEDTREE")==0):
  2124. CopyAllHeaders('panda/src/speedtree')
  2125. if (PkgSkip("DIRECT")==0):
  2126. CopyAllHeaders('direct/src/directbase')
  2127. CopyAllHeaders('direct/src/dcparser')
  2128. CopyAllHeaders('direct/src/deadrec')
  2129. CopyAllHeaders('direct/src/distributed')
  2130. CopyAllHeaders('direct/src/interval')
  2131. CopyAllHeaders('direct/src/showbase')
  2132. CopyAllHeaders('direct/metalibs/direct')
  2133. CopyAllHeaders('direct/src/dcparse')
  2134. if (RUNTIME or RTDIST):
  2135. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2136. if (RUNTIME):
  2137. CopyAllHeaders('direct/src/plugin_npapi')
  2138. CopyAllHeaders('direct/src/plugin_standalone')
  2139. if (PkgSkip("PANDATOOL")==0):
  2140. CopyAllHeaders('pandatool/src/pandatoolbase')
  2141. CopyAllHeaders('pandatool/src/converter')
  2142. CopyAllHeaders('pandatool/src/progbase')
  2143. CopyAllHeaders('pandatool/src/eggbase')
  2144. CopyAllHeaders('pandatool/src/bam')
  2145. CopyAllHeaders('pandatool/src/cvscopy')
  2146. CopyAllHeaders('pandatool/src/daeegg')
  2147. CopyAllHeaders('pandatool/src/daeprogs')
  2148. CopyAllHeaders('pandatool/src/dxf')
  2149. CopyAllHeaders('pandatool/src/dxfegg')
  2150. CopyAllHeaders('pandatool/src/dxfprogs')
  2151. CopyAllHeaders('pandatool/src/palettizer')
  2152. CopyAllHeaders('pandatool/src/egg-mkfont')
  2153. CopyAllHeaders('pandatool/src/eggcharbase')
  2154. CopyAllHeaders('pandatool/src/egg-optchar')
  2155. CopyAllHeaders('pandatool/src/egg-palettize')
  2156. CopyAllHeaders('pandatool/src/egg-qtess')
  2157. CopyAllHeaders('pandatool/src/eggprogs')
  2158. CopyAllHeaders('pandatool/src/flt')
  2159. CopyAllHeaders('pandatool/src/fltegg')
  2160. CopyAllHeaders('pandatool/src/fltprogs')
  2161. CopyAllHeaders('pandatool/src/imagebase')
  2162. CopyAllHeaders('pandatool/src/imageprogs')
  2163. CopyAllHeaders('pandatool/src/pfmprogs')
  2164. CopyAllHeaders('pandatool/src/lwo')
  2165. CopyAllHeaders('pandatool/src/lwoegg')
  2166. CopyAllHeaders('pandatool/src/lwoprogs')
  2167. CopyAllHeaders('pandatool/src/maya')
  2168. CopyAllHeaders('pandatool/src/mayaegg')
  2169. CopyAllHeaders('pandatool/src/maxegg')
  2170. CopyAllHeaders('pandatool/src/maxprogs')
  2171. CopyAllHeaders('pandatool/src/objegg')
  2172. CopyAllHeaders('pandatool/src/objprogs')
  2173. CopyAllHeaders('pandatool/src/vrml')
  2174. CopyAllHeaders('pandatool/src/vrmlegg')
  2175. CopyAllHeaders('pandatool/src/xfile')
  2176. CopyAllHeaders('pandatool/src/xfileegg')
  2177. CopyAllHeaders('pandatool/src/ptloader')
  2178. CopyAllHeaders('pandatool/src/miscprogs')
  2179. CopyAllHeaders('pandatool/src/pstatserver')
  2180. CopyAllHeaders('pandatool/src/softprogs')
  2181. CopyAllHeaders('pandatool/src/text-stats')
  2182. CopyAllHeaders('pandatool/src/vrmlprogs')
  2183. CopyAllHeaders('pandatool/src/win-stats')
  2184. CopyAllHeaders('pandatool/src/xfileprogs')
  2185. if (PkgSkip("CONTRIB")==0):
  2186. CopyAllHeaders('contrib/src/contribbase')
  2187. CopyAllHeaders('contrib/src/ai')
  2188. ########################################################################
  2189. #
  2190. # These definitions are syntactic shorthand. They make it easy
  2191. # to link with the usual libraries without listing them all.
  2192. #
  2193. ########################################################################
  2194. COMMON_DTOOL_LIBS=[
  2195. 'libp3dtool.dll',
  2196. 'libp3dtoolconfig.dll',
  2197. ]
  2198. COMMON_PANDA_LIBS=[
  2199. 'libpanda.dll',
  2200. 'libpandaexpress.dll'
  2201. ] + COMMON_DTOOL_LIBS
  2202. COMMON_EGG2X_LIBS=[
  2203. 'libp3eggbase.lib',
  2204. 'libp3progbase.lib',
  2205. 'libp3converter.lib',
  2206. 'libp3pandatoolbase.lib',
  2207. 'libpandaegg.dll',
  2208. ] + COMMON_PANDA_LIBS
  2209. COMMON_DTOOL_LIBS_PYSTUB = COMMON_DTOOL_LIBS + ['libp3pystub.dll']
  2210. COMMON_PANDA_LIBS_PYSTUB = COMMON_PANDA_LIBS + ['libp3pystub.dll']
  2211. COMMON_EGG2X_LIBS_PYSTUB = COMMON_EGG2X_LIBS + ['libp3pystub.dll']
  2212. ########################################################################
  2213. #
  2214. # This section contains a list of all the files that need to be compiled.
  2215. #
  2216. ########################################################################
  2217. print "Generating dependencies..."
  2218. sys.stdout.flush()
  2219. #
  2220. # Compile Panda icon resource file.
  2221. # We do it first because we need it at
  2222. # the time we compile an executable.
  2223. #
  2224. if (sys.platform.startswith("win")):
  2225. OPTS=['DIR:panda/src/configfiles']
  2226. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2227. #
  2228. # DIRECTORY: dtool/src/dtoolbase/
  2229. #
  2230. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2231. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2232. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2233. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2234. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2235. #
  2236. # DIRECTORY: dtool/src/dtoolutil/
  2237. #
  2238. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2239. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2240. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2241. if (sys.platform == 'darwin'):
  2242. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2243. #
  2244. # DIRECTORY: dtool/metalibs/dtool/
  2245. #
  2246. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2247. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2248. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2249. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2250. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2251. if (sys.platform == 'darwin'):
  2252. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2253. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2254. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2255. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2256. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2257. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2258. #
  2259. # DIRECTORY: dtool/src/cppparser/
  2260. #
  2261. if (not RUNTIME):
  2262. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2263. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2264. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2265. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2266. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2267. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2268. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2269. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2270. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2271. #
  2272. # DIRECTORY: dtool/src/prc/
  2273. #
  2274. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2275. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2276. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2277. #
  2278. # DIRECTORY: dtool/src/dconfig/
  2279. #
  2280. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2281. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2282. #
  2283. # DIRECTORY: dtool/src/interrogatedb/
  2284. #
  2285. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:DTOOLCONFIG']
  2286. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2287. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2288. #
  2289. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2290. #
  2291. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2292. if (PkgSkip("PYTHON")):
  2293. TargetAdd('p3dtoolconfig_pydtool.obj', opts=OPTS, input="null.cxx")
  2294. else:
  2295. TargetAdd('p3dtoolconfig_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2296. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2297. TargetAdd('p3dtoolconfig_pydtool.obj', dep='dtool_have_python.dat')
  2298. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2299. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_pydtool.obj')
  2300. TargetAdd('libp3dtoolconfig.dll', input='p3interrogatedb_composite1.obj')
  2301. TargetAdd('libp3dtoolconfig.dll', input='p3interrogatedb_composite2.obj')
  2302. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2303. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2304. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2305. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2306. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL'])
  2307. #
  2308. # DIRECTORY: dtool/src/pystub/
  2309. #
  2310. OPTS=['DIR:dtool/src/pystub', 'BUILDING:DTOOLCONFIG']
  2311. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2312. TargetAdd('libp3pystub.dll', input='p3pystub_pystub.obj')
  2313. TargetAdd('libp3pystub.dll', input='libp3dtool.dll')
  2314. TargetAdd('libp3pystub.dll', opts=['ADVAPI'])
  2315. #
  2316. # DIRECTORY: dtool/src/interrogate/
  2317. #
  2318. if (not RUNTIME):
  2319. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2320. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2321. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2322. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  2323. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  2324. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  2325. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB)
  2326. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL'])
  2327. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  2328. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  2329. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  2330. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS_PYSTUB)
  2331. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL'])
  2332. if (not RTDIST):
  2333. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  2334. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  2335. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  2336. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS_PYSTUB)
  2337. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL'])
  2338. #
  2339. # DIRECTORY: dtool/src/prckeys/
  2340. #
  2341. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  2342. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  2343. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  2344. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  2345. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS_PYSTUB)
  2346. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL'])
  2347. #
  2348. # DIRECTORY: dtool/src/test_interrogate/
  2349. #
  2350. if (not RTDIST and not RUNTIME):
  2351. OPTS=['DIR:dtool/src/test_interrogate']
  2352. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  2353. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  2354. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS_PYSTUB)
  2355. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL'])
  2356. #
  2357. # DIRECTORY: panda/src/pandabase/
  2358. #
  2359. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  2360. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  2361. #
  2362. # DIRECTORY: panda/src/express/
  2363. #
  2364. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  2365. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  2366. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  2367. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  2368. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  2369. TargetAdd('libp3express.in', opts=['IMOD:pandaexpress', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  2370. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  2371. #
  2372. # DIRECTORY: panda/src/downloader/
  2373. #
  2374. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  2375. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  2376. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  2377. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  2378. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  2379. TargetAdd('libp3downloader.in', opts=['IMOD:pandaexpress', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  2380. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  2381. #
  2382. # DIRECTORY: panda/metalibs/pandaexpress/
  2383. #
  2384. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  2385. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  2386. TargetAdd('libpandaexpress_module.obj', input='libp3downloader.in')
  2387. TargetAdd('libpandaexpress_module.obj', input='libp3express.in')
  2388. TargetAdd('libpandaexpress_module.obj', opts=['ADVAPI', 'OPENSSL'])
  2389. TargetAdd('libpandaexpress_module.obj', opts=['IMOD:pandaexpress', 'ILIB:libpandaexpress'])
  2390. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  2391. TargetAdd('libpandaexpress.dll', input='libpandaexpress_module.obj')
  2392. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  2393. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  2394. TargetAdd('libpandaexpress.dll', input='libp3downloader_igate.obj')
  2395. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  2396. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  2397. TargetAdd('libpandaexpress.dll', input='libp3express_igate.obj')
  2398. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  2399. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  2400. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB'])
  2401. #
  2402. # DIRECTORY: panda/src/pipeline/
  2403. #
  2404. if (not RUNTIME):
  2405. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  2406. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  2407. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  2408. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  2409. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  2410. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  2411. TargetAdd('libp3pipeline.in', opts=['IMOD:panda', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  2412. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  2413. #
  2414. # DIRECTORY: panda/src/putil/
  2415. #
  2416. if (not RUNTIME):
  2417. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  2418. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  2419. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  2420. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  2421. IGATEFILES.remove("test_bam.h")
  2422. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  2423. TargetAdd('libp3putil.in', opts=['IMOD:panda', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  2424. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  2425. #
  2426. # DIRECTORY: panda/src/audio/
  2427. #
  2428. if (not RUNTIME):
  2429. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  2430. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  2431. IGATEFILES=["audio.h"]
  2432. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  2433. TargetAdd('libp3audio.in', opts=['IMOD:panda', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  2434. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  2435. #
  2436. # DIRECTORY: panda/src/event/
  2437. #
  2438. if (not RUNTIME):
  2439. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  2440. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  2441. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  2442. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  2443. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  2444. TargetAdd('libp3event.in', opts=['IMOD:panda', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  2445. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  2446. #
  2447. # DIRECTORY: panda/src/linmath/
  2448. #
  2449. if (not RUNTIME):
  2450. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  2451. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  2452. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  2453. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_ext.I", "*_composite*.cxx"])
  2454. IGATEFILES.remove('lmat_ops_src.h')
  2455. IGATEFILES.remove('cast_to_double.h')
  2456. IGATEFILES.remove('lmat_ops.h')
  2457. IGATEFILES.remove('cast_to_float.h')
  2458. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  2459. TargetAdd('libp3linmath.in', opts=['IMOD:panda', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  2460. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  2461. #
  2462. # DIRECTORY: panda/src/mathutil/
  2463. #
  2464. if (not RUNTIME):
  2465. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  2466. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  2467. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  2468. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  2469. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  2470. TargetAdd('libp3mathutil.in', opts=['IMOD:panda', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  2471. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  2472. #
  2473. # DIRECTORY: panda/src/gsgbase/
  2474. #
  2475. if (not RUNTIME):
  2476. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  2477. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  2478. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  2479. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  2480. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  2481. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  2482. #
  2483. # DIRECTORY: panda/src/pnmimage/
  2484. #
  2485. if (not RUNTIME):
  2486. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  2487. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  2488. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  2489. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  2490. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  2491. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  2492. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  2493. #
  2494. # DIRECTORY: panda/src/nativenet/
  2495. #
  2496. if (not RUNTIME):
  2497. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  2498. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  2499. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  2500. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  2501. TargetAdd('libp3nativenet.in', opts=['IMOD:panda', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  2502. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  2503. #
  2504. # DIRECTORY: panda/src/net/
  2505. #
  2506. if (not RUNTIME):
  2507. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  2508. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  2509. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  2510. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  2511. IGATEFILES.remove("datagram_ui.h")
  2512. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  2513. TargetAdd('libp3net.in', opts=['IMOD:panda', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  2514. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  2515. #
  2516. # DIRECTORY: panda/src/pstatclient/
  2517. #
  2518. if (not RUNTIME):
  2519. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  2520. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  2521. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  2522. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  2523. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  2524. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  2525. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  2526. #
  2527. # DIRECTORY: panda/src/gobj/
  2528. #
  2529. if (not RUNTIME):
  2530. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH', "BIGOBJ"]
  2531. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  2532. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  2533. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  2534. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  2535. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  2536. TargetAdd('libp3gobj.in', opts=['IMOD:panda', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  2537. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  2538. #
  2539. # DIRECTORY: panda/src/pgraphnodes/
  2540. #
  2541. if (not RUNTIME):
  2542. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA', "BIGOBJ"]
  2543. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  2544. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  2545. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  2546. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  2547. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  2548. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  2549. #
  2550. # DIRECTORY: panda/src/pgraph/
  2551. #
  2552. if (not RUNTIME):
  2553. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA','BIGOBJ']
  2554. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  2555. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  2556. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  2557. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  2558. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  2559. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  2560. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  2561. TargetAdd('libp3pgraph.in', opts=['IMOD:panda', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  2562. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  2563. #
  2564. # DIRECTORY: panda/src/cull/
  2565. #
  2566. if (not RUNTIME):
  2567. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA', 'BIGOBJ']
  2568. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  2569. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  2570. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  2571. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  2572. TargetAdd('libp3cull.in', opts=['IMOD:panda', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  2573. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  2574. #
  2575. # DIRECTORY: panda/src/chan/
  2576. #
  2577. if (not RUNTIME):
  2578. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA', 'BIGOBJ']
  2579. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  2580. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  2581. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  2582. IGATEFILES.remove('movingPart.h')
  2583. IGATEFILES.remove('animChannelFixed.h')
  2584. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  2585. TargetAdd('libp3chan.in', opts=['IMOD:panda', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  2586. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  2587. # DIRECTORY: panda/src/char/
  2588. #
  2589. if (not RUNTIME):
  2590. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA', 'BIGOBJ']
  2591. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  2592. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  2593. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  2594. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  2595. TargetAdd('libp3char.in', opts=['IMOD:panda', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  2596. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  2597. #
  2598. # DIRECTORY: panda/src/dgraph/
  2599. #
  2600. if (not RUNTIME):
  2601. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  2602. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  2603. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  2604. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  2605. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  2606. TargetAdd('libp3dgraph.in', opts=['IMOD:panda', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  2607. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  2608. #
  2609. # DIRECTORY: panda/src/display/
  2610. #
  2611. if (not RUNTIME):
  2612. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'BIGOBJ']
  2613. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  2614. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  2615. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  2616. IGATEFILES.remove("renderBuffer.h")
  2617. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  2618. TargetAdd('libp3display.in', opts=['IMOD:panda', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  2619. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  2620. if (RTDIST and sys.platform == "darwin"):
  2621. OPTS=['DIR:panda/src/display']
  2622. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  2623. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  2624. #
  2625. # DIRECTORY: panda/src/device/
  2626. #
  2627. if (not RUNTIME):
  2628. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA', 'BIGOBJ']
  2629. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  2630. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  2631. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  2632. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  2633. TargetAdd('libp3device.in', opts=['IMOD:panda', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  2634. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  2635. #
  2636. # DIRECTORY: panda/src/pnmtext/
  2637. #
  2638. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  2639. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  2640. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  2641. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  2642. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  2643. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  2644. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  2645. #
  2646. # DIRECTORY: panda/src/text/
  2647. #
  2648. if (not RUNTIME):
  2649. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'BIGOBJ']
  2650. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  2651. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  2652. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  2653. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  2654. TargetAdd('libp3text.in', opts=['IMOD:panda', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  2655. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  2656. #
  2657. # DIRECTORY: panda/src/movies/
  2658. #
  2659. if (not RUNTIME):
  2660. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'FFMPEG']
  2661. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  2662. TargetAdd('p3movies_composite2.obj', opts=OPTS, input='p3movies_composite2.cxx')
  2663. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  2664. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  2665. TargetAdd('libp3movies.in', opts=['IMOD:panda', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  2666. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  2667. #
  2668. # DIRECTORY: panda/src/grutil/
  2669. #
  2670. if (not RUNTIME):
  2671. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA', 'FFMPEG', 'BIGOBJ']
  2672. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  2673. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  2674. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  2675. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  2676. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  2677. TargetAdd('libp3grutil.in', opts=['IMOD:panda', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  2678. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  2679. #
  2680. # DIRECTORY: panda/src/tform/
  2681. #
  2682. if (not RUNTIME):
  2683. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA', 'BIGOBJ']
  2684. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  2685. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  2686. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  2687. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  2688. TargetAdd('libp3tform.in', opts=['IMOD:panda', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  2689. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  2690. #
  2691. # DIRECTORY: panda/src/collide/
  2692. #
  2693. if (not RUNTIME):
  2694. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA', 'BIGOBJ']
  2695. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  2696. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  2697. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  2698. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  2699. TargetAdd('libp3collide.in', opts=['IMOD:panda', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  2700. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  2701. #
  2702. # DIRECTORY: panda/src/parametrics/
  2703. #
  2704. if (not RUNTIME):
  2705. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA', 'BIGOBJ']
  2706. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  2707. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  2708. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  2709. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  2710. TargetAdd('libp3parametrics.in', opts=['IMOD:panda', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  2711. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  2712. #
  2713. # DIRECTORY: panda/src/pgui/
  2714. #
  2715. if (not RUNTIME):
  2716. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA', 'BIGOBJ']
  2717. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  2718. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  2719. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  2720. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  2721. TargetAdd('libp3pgui.in', opts=['IMOD:panda', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  2722. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  2723. #
  2724. # DIRECTORY: panda/src/pnmimagetypes/
  2725. #
  2726. if (not RUNTIME):
  2727. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'ZLIB', 'JPEG', 'TIFF']
  2728. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  2729. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  2730. #
  2731. # DIRECTORY: panda/src/recorder/
  2732. #
  2733. if (not RUNTIME):
  2734. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  2735. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  2736. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  2737. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  2738. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  2739. TargetAdd('libp3recorder.in', opts=['IMOD:panda', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  2740. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  2741. #
  2742. # DIRECTORY: panda/src/vrpn/
  2743. #
  2744. if (PkgSkip("VRPN")==0 and not RUNTIME):
  2745. OPTS=['DIR:panda/src/vrpn', 'BUILDING:PANDA', 'VRPN']
  2746. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  2747. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  2748. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  2749. TargetAdd('libp3vrpn.in', opts=['IMOD:panda', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  2750. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  2751. #
  2752. # DIRECTORY: panda/src/dxml/
  2753. #
  2754. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  2755. if (RUNTIME or RTDIST):
  2756. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  2757. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  2758. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  2759. if (not RUNTIME):
  2760. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  2761. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  2762. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  2763. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  2764. TargetAdd('libp3dxml.in', opts=['IMOD:panda', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  2765. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  2766. #
  2767. # DIRECTORY: panda/metalibs/panda/
  2768. #
  2769. if (not RUNTIME):
  2770. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'VRPN', 'JPEG', 'PNG',
  2771. 'TIFF', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2','SQUISH',
  2772. 'NVIDIACG', 'WINUSER', 'WINMM', 'FFMPEG', 'SWSCALE']
  2773. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  2774. TargetAdd('libpanda_module.obj', input='libp3recorder.in')
  2775. TargetAdd('libpanda_module.obj', input='libp3pgraphnodes.in')
  2776. TargetAdd('libpanda_module.obj', input='libp3pgraph.in')
  2777. TargetAdd('libpanda_module.obj', input='libp3cull.in')
  2778. TargetAdd('libpanda_module.obj', input='libp3grutil.in')
  2779. TargetAdd('libpanda_module.obj', input='libp3chan.in')
  2780. TargetAdd('libpanda_module.obj', input='libp3pstatclient.in')
  2781. TargetAdd('libpanda_module.obj', input='libp3char.in')
  2782. TargetAdd('libpanda_module.obj', input='libp3collide.in')
  2783. TargetAdd('libpanda_module.obj', input='libp3device.in')
  2784. TargetAdd('libpanda_module.obj', input='libp3dgraph.in')
  2785. TargetAdd('libpanda_module.obj', input='libp3display.in')
  2786. TargetAdd('libpanda_module.obj', input='libp3pipeline.in')
  2787. TargetAdd('libpanda_module.obj', input='libp3event.in')
  2788. TargetAdd('libpanda_module.obj', input='libp3gobj.in')
  2789. TargetAdd('libpanda_module.obj', input='libp3gsgbase.in')
  2790. TargetAdd('libpanda_module.obj', input='libp3linmath.in')
  2791. TargetAdd('libpanda_module.obj', input='libp3mathutil.in')
  2792. TargetAdd('libpanda_module.obj', input='libp3parametrics.in')
  2793. TargetAdd('libpanda_module.obj', input='libp3pnmimage.in')
  2794. TargetAdd('libpanda_module.obj', input='libp3text.in')
  2795. TargetAdd('libpanda_module.obj', input='libp3tform.in')
  2796. TargetAdd('libpanda_module.obj', input='libp3putil.in')
  2797. TargetAdd('libpanda_module.obj', input='libp3audio.in')
  2798. TargetAdd('libpanda_module.obj', input='libp3nativenet.in')
  2799. TargetAdd('libpanda_module.obj', input='libp3net.in')
  2800. TargetAdd('libpanda_module.obj', input='libp3pgui.in')
  2801. TargetAdd('libpanda_module.obj', input='libp3movies.in')
  2802. TargetAdd('libpanda_module.obj', input='libp3dxml.in')
  2803. TargetAdd('libpanda.dll', input='panda_panda.obj')
  2804. TargetAdd('libpanda.dll', input='libpanda_module.obj')
  2805. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  2806. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  2807. TargetAdd('libpanda.dll', input='libp3recorder_igate.obj')
  2808. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  2809. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  2810. TargetAdd('libpanda.dll', input='libp3pgraphnodes_igate.obj')
  2811. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  2812. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  2813. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  2814. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  2815. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  2816. TargetAdd('libpanda.dll', input='libp3pgraph_igate.obj')
  2817. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  2818. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  2819. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  2820. TargetAdd('libpanda.dll', input='p3movies_composite2.obj')
  2821. TargetAdd('libpanda.dll', input='libp3movies_igate.obj')
  2822. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  2823. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  2824. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  2825. TargetAdd('libpanda.dll', input='libp3grutil_igate.obj')
  2826. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  2827. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  2828. TargetAdd('libpanda.dll', input='libp3chan_igate.obj')
  2829. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  2830. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  2831. TargetAdd('libpanda.dll', input='libp3pstatclient_igate.obj')
  2832. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  2833. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  2834. TargetAdd('libpanda.dll', input='libp3char_igate.obj')
  2835. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  2836. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  2837. TargetAdd('libpanda.dll', input='libp3collide_igate.obj')
  2838. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  2839. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  2840. TargetAdd('libpanda.dll', input='libp3device_igate.obj')
  2841. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  2842. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  2843. TargetAdd('libpanda.dll', input='libp3dgraph_igate.obj')
  2844. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  2845. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  2846. TargetAdd('libpanda.dll', input='libp3display_igate.obj')
  2847. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  2848. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  2849. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  2850. TargetAdd('libpanda.dll', input='libp3pipeline_igate.obj')
  2851. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  2852. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  2853. TargetAdd('libpanda.dll', input='libp3event_igate.obj')
  2854. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  2855. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  2856. TargetAdd('libpanda.dll', input='libp3gobj_igate.obj')
  2857. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  2858. TargetAdd('libpanda.dll', input='libp3gsgbase_igate.obj')
  2859. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  2860. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  2861. TargetAdd('libpanda.dll', input='libp3linmath_igate.obj')
  2862. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  2863. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  2864. TargetAdd('libpanda.dll', input='libp3mathutil_igate.obj')
  2865. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  2866. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  2867. TargetAdd('libpanda.dll', input='libp3parametrics_igate.obj')
  2868. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  2869. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  2870. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  2871. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  2872. TargetAdd('libpanda.dll', input='libp3pnmimage_igate.obj')
  2873. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  2874. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  2875. TargetAdd('libpanda.dll', input='libp3text_igate.obj')
  2876. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  2877. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  2878. TargetAdd('libpanda.dll', input='libp3tform_igate.obj')
  2879. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  2880. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  2881. TargetAdd('libpanda.dll', input='libp3putil_igate.obj')
  2882. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  2883. TargetAdd('libpanda.dll', input='libp3audio_igate.obj')
  2884. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  2885. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  2886. TargetAdd('libpanda.dll', input='libp3pgui_igate.obj')
  2887. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  2888. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  2889. TargetAdd('libpanda.dll', input='libp3net_igate.obj')
  2890. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  2891. TargetAdd('libpanda.dll', input='libp3nativenet_igate.obj')
  2892. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  2893. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  2894. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  2895. TargetAdd('libpanda.dll', input='libp3dxml_igate.obj')
  2896. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  2897. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  2898. if PkgSkip("VRPN")==0:
  2899. TargetAdd('libpanda.dll', input="p3vrpn_composite1.obj")
  2900. TargetAdd('libpanda.dll', input="libp3vrpn_igate.obj")
  2901. TargetAdd('libpanda_module.obj', input='libp3vrpn.in')
  2902. if PkgSkip("FREETYPE")==0:
  2903. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  2904. TargetAdd('libpanda.dll', input="libp3pnmtext_igate.obj")
  2905. TargetAdd('libpanda_module.obj', input='libp3pnmtext.in')
  2906. TargetAdd('libpanda_module.obj', opts=OPTS)
  2907. TargetAdd('libpanda_module.obj', opts=['IMOD:panda', 'ILIB:libpanda'])
  2908. TargetAdd('libpanda.dll', dep='dtool_have_vrpn.dat')
  2909. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  2910. TargetAdd('libpanda.dll', opts=OPTS)
  2911. #
  2912. # DIRECTORY: panda/src/vision/
  2913. #
  2914. if (PkgSkip("VISION") ==0) and (not RUNTIME):
  2915. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG']
  2916. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx')
  2917. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  2918. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  2919. TargetAdd('libp3vision.in', opts=['IMOD:p3vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  2920. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  2921. TargetAdd('libp3vision_module.obj', input='libp3vision.in')
  2922. TargetAdd('libp3vision_module.obj', opts=OPTS)
  2923. TargetAdd('libp3vision_module.obj', opts=['IMOD:p3vision', 'ILIB:libp3vision'])
  2924. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  2925. TargetAdd('libp3vision.dll', input='libp3vision_igate.obj')
  2926. TargetAdd('libp3vision.dll', input='libp3vision_module.obj')
  2927. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  2928. TargetAdd('libp3vision.dll', opts=OPTS)
  2929. #
  2930. # DIRECTORY: panda/src/rocket/
  2931. #
  2932. if (PkgSkip("ROCKET") ==0) and (not RUNTIME):
  2933. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET']
  2934. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  2935. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  2936. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.I"])
  2937. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  2938. TargetAdd('libp3rocket.in', opts=['IMOD:p3rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  2939. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  2940. TargetAdd('libp3rocket_module.obj', input='libp3rocket.in')
  2941. TargetAdd('libp3rocket_module.obj', opts=OPTS)
  2942. TargetAdd('libp3rocket_module.obj', opts=['IMOD:p3rocket', 'ILIB:libp3rocket'])
  2943. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  2944. TargetAdd('libp3rocket.dll', input='libp3rocket_igate.obj')
  2945. TargetAdd('libp3rocket.dll', input='libp3rocket_module.obj')
  2946. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  2947. TargetAdd('libp3rocket.dll', opts=OPTS)
  2948. #
  2949. # DIRECTORY: panda/src/p3awesomium
  2950. #
  2951. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  2952. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  2953. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  2954. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  2955. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  2956. TargetAdd('libp3awesomium.in', opts=['IMOD:p3awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  2957. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  2958. TargetAdd('libp3awesomium_module.obj', input='libp3awesomium.in')
  2959. TargetAdd('libp3awesomium_module.obj', opts=OPTS)
  2960. TargetAdd('libp3awesomium_module.obj', opts=['IMOD:p3awesomium', 'ILIB:libp3awesomium'])
  2961. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  2962. TargetAdd('libp3awesomium.dll', input='libp3awesomium_igate.obj')
  2963. TargetAdd('libp3awesomium.dll', input='libp3awesomium_module.obj')
  2964. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  2965. TargetAdd('libp3awesomium.dll', opts=OPTS)
  2966. #
  2967. # DIRECTORY: panda/src/p3skel
  2968. #
  2969. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  2970. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  2971. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  2972. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  2973. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  2974. TargetAdd('libp3skel.in', opts=['IMOD:pandaskel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  2975. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  2976. #
  2977. # DIRECTORY: panda/src/p3skel
  2978. #
  2979. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  2980. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  2981. TargetAdd('libpandaskel_module.obj', input='libp3skel.in')
  2982. TargetAdd('libpandaskel_module.obj', opts=OPTS)
  2983. TargetAdd('libpandaskel_module.obj', opts=['IMOD:pandaskel', 'ILIB:libpandaskel'])
  2984. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  2985. TargetAdd('libpandaskel.dll', input='libp3skel_igate.obj')
  2986. TargetAdd('libpandaskel.dll', input='libpandaskel_module.obj')
  2987. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  2988. TargetAdd('libpandaskel.dll', opts=OPTS)
  2989. #
  2990. # DIRECTORY: panda/src/distort/
  2991. #
  2992. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  2993. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  2994. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  2995. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  2996. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  2997. TargetAdd('libp3distort.in', opts=['IMOD:pandafx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  2998. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  2999. #
  3000. # DIRECTORY: panda/metalibs/pandafx/
  3001. #
  3002. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3003. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3004. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3005. TargetAdd('libpandafx_module.obj', input='libp3distort.in')
  3006. TargetAdd('libpandafx_module.obj', opts=OPTS)
  3007. TargetAdd('libpandafx_module.obj', opts=['IMOD:pandafx', 'ILIB:libpandafx'])
  3008. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3009. TargetAdd('libpandafx.dll', input='libpandafx_module.obj')
  3010. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3011. TargetAdd('libpandafx.dll', input='libp3distort_igate.obj')
  3012. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3013. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3014. #
  3015. # DIRECTORY: panda/src/audiotraits/
  3016. #
  3017. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3018. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3019. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3020. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3021. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3022. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3023. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3024. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3025. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3026. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3027. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3028. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'OPENAL'])
  3029. #
  3030. # DIRECTORY: panda/src/downloadertools/
  3031. #
  3032. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3033. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL']
  3034. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3035. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3036. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3037. TargetAdd('apply_patch.exe', opts=OPTS)
  3038. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3039. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3040. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3041. TargetAdd('build_patch.exe', opts=OPTS)
  3042. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3043. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3044. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3045. TargetAdd('check_adler.exe', opts=OPTS)
  3046. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3047. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3048. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3049. TargetAdd('check_crc.exe', opts=OPTS)
  3050. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3051. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3052. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3053. TargetAdd('check_md5.exe', opts=OPTS)
  3054. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3055. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3056. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3057. TargetAdd('pdecrypt.exe', opts=OPTS)
  3058. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3059. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3060. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3061. TargetAdd('pencrypt.exe', opts=OPTS)
  3062. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3063. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3064. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3065. TargetAdd('show_ddb.exe', opts=OPTS)
  3066. #
  3067. # DIRECTORY: panda/src/downloadertools/
  3068. #
  3069. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3070. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL']
  3071. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3072. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3073. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3074. TargetAdd('multify.exe', opts=OPTS)
  3075. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3076. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3077. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3078. TargetAdd('pzip.exe', opts=OPTS)
  3079. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3080. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3081. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3082. TargetAdd('punzip.exe', opts=OPTS)
  3083. #
  3084. # DIRECTORY: panda/src/windisplay/
  3085. #
  3086. if (sys.platform.startswith("win") and not RUNTIME):
  3087. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3088. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3089. TargetAdd('p3windisplay_windetectdx8.obj', opts=OPTS + ["DX8"], input='winDetectDx8.cxx')
  3090. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3091. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3092. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx8.obj')
  3093. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3094. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3095. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3096. #
  3097. # DIRECTORY: panda/metalibs/pandadx8/
  3098. #
  3099. if PkgSkip("DX8")==0 and not RUNTIME:
  3100. OPTS=['DIR:panda/src/dxgsg8', 'DIR:panda/metalibs/pandadx8', 'BUILDING:PANDADX', 'DX8']
  3101. TargetAdd('p3dxgsg8_dxGraphicsStateGuardian8.obj', opts=OPTS, input='dxGraphicsStateGuardian8.cxx')
  3102. TargetAdd('p3dxgsg8_composite1.obj', opts=OPTS, input='p3dxgsg8_composite1.cxx')
  3103. TargetAdd('pandadx8_pandadx8.obj', opts=OPTS, input='pandadx8.cxx')
  3104. TargetAdd('libpandadx8.dll', input='pandadx8_pandadx8.obj')
  3105. TargetAdd('libpandadx8.dll', input='p3dxgsg8_dxGraphicsStateGuardian8.obj')
  3106. TargetAdd('libpandadx8.dll', input='p3dxgsg8_composite1.obj')
  3107. TargetAdd('libpandadx8.dll', input='libp3windisplay.dll')
  3108. TargetAdd('libpandadx8.dll', input=COMMON_PANDA_LIBS)
  3109. TargetAdd('libpandadx8.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX8'])
  3110. #
  3111. # DIRECTORY: panda/metalibs/pandadx9/
  3112. #
  3113. if PkgSkip("DX9")==0 and not RUNTIME:
  3114. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3115. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3116. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3117. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3118. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3119. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3120. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3121. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3122. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3123. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3124. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3125. #
  3126. # DIRECTORY: panda/src/egg/
  3127. #
  3128. if (not RUNTIME):
  3129. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3130. CreateFile(GetOutputDir()+"/include/parser.h")
  3131. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3132. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3133. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3134. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3135. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3136. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3137. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3138. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3139. TargetAdd('libp3egg.in', opts=['IMOD:pandaegg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3140. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3141. #
  3142. # DIRECTORY: panda/src/egg2pg/
  3143. #
  3144. if (not RUNTIME):
  3145. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3146. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3147. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3148. IGATEFILES=['load_egg_file.h']
  3149. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3150. TargetAdd('libp3egg2pg.in', opts=['IMOD:pandaegg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3151. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  3152. #
  3153. # DIRECTORY: panda/src/framework/
  3154. #
  3155. if (not RUNTIME):
  3156. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK']
  3157. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx')
  3158. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  3159. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  3160. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  3161. #
  3162. # DIRECTORY: panda/src/glstuff/
  3163. #
  3164. if (not RUNTIME):
  3165. OPTS=['DIR:panda/src/glstuff', 'NVIDIACG', 'CGGL']
  3166. TargetAdd('p3glstuff_glpure.obj', opts=OPTS, input='glpure.cxx')
  3167. TargetAdd('libp3glstuff.dll', input='p3glstuff_glpure.obj')
  3168. TargetAdd('libp3glstuff.dll', input=COMMON_PANDA_LIBS)
  3169. TargetAdd('libp3glstuff.dll', opts=['ADVAPI', 'GL', 'NVIDIACG', 'CGGL'])
  3170. #
  3171. # DIRECTORY: panda/src/glgsg/
  3172. #
  3173. if (not RUNTIME and PkgSkip("GL")==0):
  3174. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG']
  3175. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  3176. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  3177. #
  3178. # DIRECTORY: panda/src/glesgsg/
  3179. #
  3180. if (not RUNTIME and PkgSkip("GLES")==0):
  3181. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES']
  3182. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  3183. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  3184. #
  3185. # DIRECTORY: panda/src/gles2gsg/
  3186. #
  3187. if (not RUNTIME and PkgSkip("GLES2")==0):
  3188. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2']
  3189. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  3190. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  3191. #
  3192. # DIRECTORY: panda/metalibs/pandaegg/
  3193. #
  3194. if (not RUNTIME):
  3195. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  3196. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  3197. TargetAdd('libpandaegg_module.obj', input='libp3egg2pg.in')
  3198. TargetAdd('libpandaegg_module.obj', input='libp3egg.in')
  3199. TargetAdd('libpandaegg_module.obj', opts=OPTS)
  3200. TargetAdd('libpandaegg_module.obj', opts=['IMOD:pandaegg', 'ILIB:libpandaegg'])
  3201. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  3202. TargetAdd('libpandaegg.dll', input='libpandaegg_module.obj')
  3203. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  3204. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  3205. TargetAdd('libpandaegg.dll', input='libp3egg2pg_igate.obj')
  3206. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  3207. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  3208. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  3209. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  3210. TargetAdd('libpandaegg.dll', input='libp3egg_igate.obj')
  3211. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  3212. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  3213. #
  3214. # DIRECTORY: panda/src/mesadisplay/
  3215. #
  3216. if (not sys.platform.startswith("win") and PkgSkip("GL")==0 and PkgSkip("OSMESA")==0 and not RUNTIME):
  3217. OPTS=['DIR:panda/src/mesadisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAMESA', 'NVIDIACG', 'GL', 'OSMESA']
  3218. TargetAdd('p3mesadisplay_composite1.obj', opts=OPTS, input='p3mesadisplay_composite1.cxx')
  3219. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAMESA', 'NVIDIACG', 'GL']
  3220. TargetAdd('libpandamesa.dll', input='p3mesadisplay_composite1.obj')
  3221. TargetAdd('libpandamesa.dll', input='libp3glstuff.dll')
  3222. if (PkgSkip('PANDAFX')==0):
  3223. TargetAdd('libpandamesa.dll', input='libpandafx.dll')
  3224. TargetAdd('libpandamesa.dll', input=COMMON_PANDA_LIBS)
  3225. TargetAdd('libpandamesa.dll', opts=['MODULE', 'GL', 'OSMESA'])
  3226. #
  3227. # DIRECTORY: panda/src/x11display/
  3228. #
  3229. if (sys.platform != "win32" and sys.platform != "darwin" and PkgSkip("X11")==0 and not RUNTIME):
  3230. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  3231. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  3232. #
  3233. # DIRECTORY: panda/src/glxdisplay/
  3234. #
  3235. if (sys.platform != "win32" and sys.platform != "darwin" and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3236. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3237. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  3238. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3239. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3240. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  3241. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3242. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3243. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3244. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  3245. TargetAdd('libpandagl.dll', input='libp3glstuff.dll')
  3246. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3247. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3248. #
  3249. # DIRECTORY: panda/src/osxdisplay/
  3250. #
  3251. if (sys.platform == 'darwin' and PkgSkip("GL")==0 and not RUNTIME):
  3252. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3253. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  3254. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  3255. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  3256. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3257. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3258. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3259. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3260. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  3261. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  3262. TargetAdd('libpandagl.dll', input='libp3glstuff.dll')
  3263. if (PkgSkip('PANDAFX')==0):
  3264. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  3265. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3266. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  3267. #
  3268. # DIRECTORY: panda/src/wgldisplay/
  3269. #
  3270. if (sys.platform == "win32" and PkgSkip("GL")==0 and not RUNTIME):
  3271. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  3272. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  3273. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  3274. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  3275. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  3276. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  3277. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  3278. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  3279. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  3280. TargetAdd('libpandagl.dll', input='libp3glstuff.dll')
  3281. if (PkgSkip('PANDAFX')==0):
  3282. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  3283. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  3284. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  3285. #
  3286. # DIRECTORY: panda/src/egldisplay/
  3287. #
  3288. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3289. DefSymbol('GLES', 'OPENGLES_1', '')
  3290. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  3291. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  3292. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  3293. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  3294. # Uncomment this as soon as x11-specific stuff is removed from p3egldisplay
  3295. #TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  3296. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  3297. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  3298. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  3299. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  3300. TargetAdd('libpandagles.dll', input='libp3glstuff.dll')
  3301. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  3302. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3303. #
  3304. # DIRECTORY: panda/src/egldisplay/
  3305. #
  3306. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  3307. DefSymbol('GLES2', 'OPENGLES_2', '')
  3308. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  3309. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  3310. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  3311. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  3312. # Uncomment this as soon as x11-specific stuff is removed from p3egldisplay
  3313. #TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  3314. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  3315. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  3316. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  3317. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  3318. TargetAdd('libpandagles2.dll', input='libp3glstuff.dll')
  3319. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  3320. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3321. #
  3322. # DIRECTORY: panda/src/ode/
  3323. #
  3324. if (PkgSkip("ODE")==0 and not RUNTIME):
  3325. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  3326. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  3327. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  3328. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  3329. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  3330. IGATEFILES.remove("odeConvexGeom.h")
  3331. IGATEFILES.remove("odeHeightFieldGeom.h")
  3332. IGATEFILES.remove("odeHelperStructs.h")
  3333. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  3334. TargetAdd('libpandaode.in', opts=['IMOD:pandaode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  3335. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  3336. #
  3337. # DIRECTORY: panda/metalibs/pandaode/
  3338. #
  3339. if (PkgSkip("ODE")==0 and not RUNTIME):
  3340. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  3341. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  3342. TargetAdd('libpandaode_module.obj', input='libpandaode.in')
  3343. TargetAdd('libpandaode_module.obj', opts=OPTS)
  3344. TargetAdd('libpandaode_module.obj', opts=['IMOD:pandaode', 'ILIB:libpandaode'])
  3345. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  3346. TargetAdd('libpandaode.dll', input='libpandaode_module.obj')
  3347. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  3348. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  3349. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  3350. TargetAdd('libpandaode.dll', input='libpandaode_igate.obj')
  3351. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  3352. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  3353. #
  3354. # DIRECTORY: panda/src/bullet/
  3355. #
  3356. if (PkgSkip("BULLET")==0 and not RUNTIME):
  3357. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  3358. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  3359. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  3360. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  3361. TargetAdd('libpandabullet.in', opts=['IMOD:pandabullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  3362. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  3363. #
  3364. # DIRECTORY: panda/metalibs/pandabullet/
  3365. #
  3366. if (PkgSkip("BULLET")==0 and not RUNTIME):
  3367. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  3368. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  3369. TargetAdd('libpandabullet_module.obj', input='libpandabullet.in')
  3370. TargetAdd('libpandabullet_module.obj', opts=OPTS)
  3371. TargetAdd('libpandabullet_module.obj', opts=['IMOD:pandabullet', 'ILIB:libpandabullet'])
  3372. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  3373. TargetAdd('libpandabullet.dll', input='libpandabullet_module.obj')
  3374. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  3375. TargetAdd('libpandabullet.dll', input='libpandabullet_igate.obj')
  3376. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  3377. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  3378. #
  3379. # DIRECTORY: panda/src/physx/
  3380. #
  3381. if (PkgSkip("PHYSX")==0):
  3382. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOPPC']
  3383. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  3384. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  3385. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  3386. TargetAdd('libpandaphysx.in', opts=['IMOD:pandaphysx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  3387. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  3388. #
  3389. # DIRECTORY: panda/metalibs/pandaphysx/
  3390. #
  3391. if (PkgSkip("PHYSX")==0):
  3392. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOPPC']
  3393. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  3394. TargetAdd('libpandaphysx_module.obj', input='libpandaphysx.in')
  3395. TargetAdd('libpandaphysx_module.obj', opts=OPTS)
  3396. TargetAdd('libpandaphysx_module.obj', opts=['IMOD:pandaphysx', 'ILIB:libpandaphysx'])
  3397. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  3398. TargetAdd('libpandaphysx.dll', input='libpandaphysx_module.obj')
  3399. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  3400. TargetAdd('libpandaphysx.dll', input='libpandaphysx_igate.obj')
  3401. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  3402. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOPPC'])
  3403. #
  3404. # DIRECTORY: panda/src/physics/
  3405. #
  3406. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  3407. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  3408. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  3409. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  3410. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  3411. IGATEFILES.remove("forces.h")
  3412. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  3413. TargetAdd('libp3physics.in', opts=['IMOD:pandaphysics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  3414. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  3415. #
  3416. # DIRECTORY: panda/src/particlesystem/
  3417. #
  3418. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  3419. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  3420. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  3421. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  3422. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  3423. IGATEFILES.remove('orientedParticle.h')
  3424. IGATEFILES.remove('orientedParticleFactory.h')
  3425. IGATEFILES.remove('particlefactories.h')
  3426. IGATEFILES.remove('emitters.h')
  3427. IGATEFILES.remove('particles.h')
  3428. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  3429. TargetAdd('libp3particlesystem.in', opts=['IMOD:pandaphysics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  3430. #
  3431. # DIRECTORY: panda/metalibs/pandaphysics/
  3432. #
  3433. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  3434. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  3435. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  3436. TargetAdd('libpandaphysics_module.obj', input='libp3physics.in')
  3437. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3438. TargetAdd('libpandaphysics_module.obj', input='libp3particlesystem.in')
  3439. TargetAdd('libpandaphysics_module.obj', opts=OPTS)
  3440. TargetAdd('libpandaphysics_module.obj', opts=['IMOD:pandaphysics', 'ILIB:libpandaphysics'])
  3441. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  3442. TargetAdd('libpandaphysics.dll', input='libpandaphysics_module.obj')
  3443. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  3444. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  3445. TargetAdd('libpandaphysics.dll', input='libp3physics_igate.obj')
  3446. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  3447. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  3448. TargetAdd('libpandaphysics.dll', input='libp3particlesystem_igate.obj')
  3449. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  3450. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  3451. #
  3452. # DIRECTORY: panda/src/speedtree/
  3453. #
  3454. if (PkgSkip("SPEEDTREE")==0):
  3455. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  3456. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  3457. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  3458. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  3459. TargetAdd('libpandaspeedtree.in', opts=['IMOD:pandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  3460. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  3461. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  3462. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  3463. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:pandaspeedtree', 'ILIB:libpandaspeedtree'])
  3464. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  3465. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  3466. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  3467. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  3468. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  3469. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  3470. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  3471. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  3472. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  3473. #
  3474. # DIRECTORY: panda/src/testbed/
  3475. #
  3476. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  3477. OPTS=['DIR:panda/src/testbed']
  3478. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  3479. TargetAdd('pview.exe', input='pview_pview.obj')
  3480. TargetAdd('pview.exe', input='libp3framework.dll')
  3481. TargetAdd('pview.exe', input='libpandaegg.dll')
  3482. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3483. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  3484. #
  3485. # DIRECTORY: panda/src/tinydisplay/
  3486. #
  3487. if (not RUNTIME and (sys.platform == "win32" or sys.platform == "darwin" or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  3488. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  3489. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  3490. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  3491. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  3492. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  3493. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  3494. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  3495. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  3496. if (sys.platform == "darwin"):
  3497. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  3498. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  3499. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  3500. elif (sys.platform == "win32"):
  3501. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  3502. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  3503. else:
  3504. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  3505. TargetAdd('libp3tinydisplay.dll', opts=['X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  3506. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  3507. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  3508. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  3509. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  3510. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  3511. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  3512. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  3513. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  3514. #
  3515. # DIRECTORY: direct/src/directbase/
  3516. #
  3517. if (PkgSkip("DIRECT")==0):
  3518. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  3519. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  3520. if (PkgSkip("PYTHON")==0 and not RTDIST and not RUNTIME):
  3521. DefSymbol("BUILDING:PACKPANDA", "IMPORT_MODULE", "direct.directscripts.packpanda")
  3522. TargetAdd('packpanda.obj', opts=OPTS+['BUILDING:PACKPANDA'], input='ppython.cxx')
  3523. TargetAdd('packpanda.exe', input='packpanda.obj')
  3524. TargetAdd('packpanda.exe', opts=['PYTHON'])
  3525. DefSymbol("BUILDING:EGGCACHER", "IMPORT_MODULE", "direct.directscripts.eggcacher")
  3526. TargetAdd('eggcacher.obj', opts=OPTS+['BUILDING:EGGCACHER'], input='ppython.cxx')
  3527. TargetAdd('eggcacher.exe', input='eggcacher.obj')
  3528. TargetAdd('eggcacher.exe', opts=['PYTHON'])
  3529. #
  3530. # DIRECTORY: direct/src/dcparser/
  3531. #
  3532. if (PkgSkip("DIRECT")==0):
  3533. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'BISONPREFIX_dcyy']
  3534. CreateFile(GetOutputDir()+"/include/dcParser.h")
  3535. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  3536. TargetAdd('dcParser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3537. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  3538. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  3539. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  3540. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  3541. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  3542. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  3543. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  3544. TargetAdd('libp3dcparser.in', opts=['IMOD:p3direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  3545. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  3546. #
  3547. # DIRECTORY: direct/src/deadrec/
  3548. #
  3549. if (PkgSkip("DIRECT")==0):
  3550. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  3551. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  3552. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  3553. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  3554. TargetAdd('libp3deadrec.in', opts=['IMOD:p3direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  3555. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  3556. #
  3557. # DIRECTORY: direct/src/distributed/
  3558. #
  3559. if (PkgSkip("DIRECT")==0):
  3560. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL']
  3561. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  3562. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  3563. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  3564. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  3565. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  3566. TargetAdd('libp3distributed.in', opts=['IMOD:p3direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  3567. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  3568. #
  3569. # DIRECTORY: direct/src/interval/
  3570. #
  3571. if (PkgSkip("DIRECT")==0):
  3572. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  3573. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  3574. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  3575. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  3576. TargetAdd('libp3interval.in', opts=['IMOD:p3direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  3577. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  3578. #
  3579. # DIRECTORY: direct/src/showbase/
  3580. #
  3581. if (PkgSkip("DIRECT")==0):
  3582. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  3583. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  3584. if (sys.platform == "darwin"):
  3585. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  3586. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  3587. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  3588. TargetAdd('libp3showbase.in', opts=['IMOD:p3direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  3589. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  3590. #
  3591. # DIRECTORY: direct/metalibs/direct/
  3592. #
  3593. if (PkgSkip("DIRECT")==0):
  3594. OPTS=['DIR:direct/metalibs/direct', 'BUILDING:DIRECT']
  3595. TargetAdd('p3direct_direct.obj', opts=OPTS, input='direct.cxx')
  3596. TargetAdd('libp3direct_module.obj', input='libp3dcparser.in')
  3597. TargetAdd('libp3direct_module.obj', input='libp3showbase.in')
  3598. TargetAdd('libp3direct_module.obj', input='libp3deadrec.in')
  3599. TargetAdd('libp3direct_module.obj', input='libp3interval.in')
  3600. TargetAdd('libp3direct_module.obj', input='libp3distributed.in')
  3601. TargetAdd('libp3direct_module.obj', opts=OPTS)
  3602. TargetAdd('libp3direct_module.obj', opts=['IMOD:p3direct', 'ILIB:libp3direct'])
  3603. TargetAdd('libp3direct.dll', input='p3direct_direct.obj')
  3604. TargetAdd('libp3direct.dll', input='libp3direct_module.obj')
  3605. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  3606. TargetAdd('libp3direct.dll', input='p3dcparser_composite1.obj')
  3607. TargetAdd('libp3direct.dll', input='p3dcparser_composite2.obj')
  3608. TargetAdd('libp3direct.dll', input='p3dcparser_dcParser.obj')
  3609. TargetAdd('libp3direct.dll', input='p3dcparser_dcLexer.obj')
  3610. TargetAdd('libp3direct.dll', input='libp3dcparser_igate.obj')
  3611. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  3612. if (sys.platform == "darwin"):
  3613. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  3614. TargetAdd('libp3direct.dll', input='libp3showbase_igate.obj')
  3615. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  3616. TargetAdd('libp3direct.dll', input='libp3deadrec_igate.obj')
  3617. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  3618. TargetAdd('libp3direct.dll', input='libp3interval_igate.obj')
  3619. TargetAdd('libp3direct.dll', input='p3distributed_config_distributed.obj')
  3620. TargetAdd('libp3direct.dll', input='p3distributed_cConnectionRepository.obj')
  3621. TargetAdd('libp3direct.dll', input='p3distributed_cDistributedSmoothNodeBase.obj')
  3622. TargetAdd('libp3direct.dll', input='libp3distributed_igate.obj')
  3623. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  3624. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER'])
  3625. #
  3626. # DIRECTORY: direct/src/dcparse/
  3627. #
  3628. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  3629. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  3630. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  3631. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  3632. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  3633. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3634. TargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  3635. #
  3636. # DIRECTORY: direct/src/plugin/
  3637. #
  3638. if (RTDIST or RUNTIME):
  3639. # Explicitly define this as we don't include dtool_config.h here.
  3640. if (sys.platform != "darwin" and not sys.platform.startswith("win")):
  3641. DefSymbol("RUNTIME", "HAVE_X11", "1")
  3642. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  3643. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  3644. OPTS += ['ZLIB', 'JPEG', 'PNG', 'MSIMG']
  3645. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  3646. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  3647. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  3648. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  3649. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  3650. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  3651. if (sys.platform == "darwin"):
  3652. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  3653. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  3654. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  3655. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  3656. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  3657. if (RTDIST):
  3658. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  3659. TargetAdd(fname, input='plugin_plugin.obj')
  3660. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  3661. TargetAdd(fname, input='plugin_wstring_encode.obj')
  3662. TargetAdd(fname, input='plugin_parse_color.obj')
  3663. TargetAdd(fname, input='plugin_find_root_dir.obj')
  3664. if (sys.platform == "darwin"):
  3665. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  3666. TargetAdd(fname, input='plugin_fileSpec.obj')
  3667. TargetAdd(fname, input='plugin_binaryXml.obj')
  3668. TargetAdd(fname, input='plugin_handleStream.obj')
  3669. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  3670. TargetAdd(fname, input='libp3tinyxml.ilb')
  3671. if (sys.platform == "darwin"):
  3672. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  3673. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'JPEG', 'PNG', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  3674. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  3675. if (PkgSkip("PYTHON")==0 and RTDIST):
  3676. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  3677. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  3678. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  3679. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  3680. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  3681. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  3682. TargetAdd('p3dpython.exe', opts=['NOSTRIP', 'PYTHON', 'WINUSER'])
  3683. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  3684. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  3685. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  3686. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  3687. if (sys.platform.startswith("win")):
  3688. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  3689. OPTS.append("NON_CONSOLE")
  3690. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  3691. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  3692. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  3693. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  3694. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  3695. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  3696. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  3697. if (PkgSkip("OPENSSL")==0 and RTDIST):
  3698. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  3699. if (sys.platform=="darwin"): OPTS += ['OPT:2']
  3700. if (PkgSkip("FLTK")==0):
  3701. OPTS.append("FLTK")
  3702. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  3703. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  3704. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  3705. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  3706. OPTS=['OPENSSL', 'FLTK', 'WINCOMCTL', 'WINSOCK']
  3707. else:
  3708. OPTS.append("WX")
  3709. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  3710. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  3711. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  3712. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  3713. OPTS=['NOSTRIP', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  3714. if (sys.platform=="darwin"): OPTS.append("GL")
  3715. if (sys.platform=="darwin"): OPTS += ['OPT:2']
  3716. TargetAdd('p3dcert.exe', opts=OPTS)
  3717. #
  3718. # DIRECTORY: direct/src/plugin_npapi/
  3719. #
  3720. if (RUNTIME and PkgSkip("NPAPI")==0):
  3721. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME']
  3722. if (sys.platform.startswith("win")):
  3723. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  3724. "version" : VERSION,
  3725. "description" : "Runs 3-D games and interactive applets",
  3726. "filename" : "nppanda3d.dll",
  3727. "mimetype" : "application/x-panda3d",
  3728. "extension" : "p3d",
  3729. "filedesc" : "Panda3D applet"}
  3730. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  3731. elif (sys.platform=="darwin"):
  3732. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  3733. OPTS += ['NPAPI', 'GTK2']
  3734. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  3735. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  3736. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  3737. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  3738. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  3739. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  3740. if (sys.platform.startswith("win")):
  3741. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  3742. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  3743. elif (sys.platform == "darwin"):
  3744. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  3745. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  3746. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  3747. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  3748. TargetAdd('nppanda3d.plugin', opts=['NPAPI', 'OPENSSL', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  3749. #
  3750. # DIRECTORY: direct/src/plugin_activex/
  3751. #
  3752. if (RUNTIME and sys.platform.startswith("win")):
  3753. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX']
  3754. DefSymbol('ACTIVEX', '_USRDLL', '')
  3755. DefSymbol('ACTIVEX', '_WINDLL', '')
  3756. DefSymbol('ACTIVEX', '_AFXDLL', '')
  3757. DefSymbol('ACTIVEX', '_MBCS', '')
  3758. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  3759. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  3760. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  3761. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  3762. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  3763. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  3764. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  3765. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  3766. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  3767. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  3768. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  3769. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL'])
  3770. #
  3771. # DIRECTORY: direct/src/plugin_standalone/
  3772. #
  3773. if (RUNTIME):
  3774. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  3775. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  3776. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  3777. if (sys.platform.startswith("win")):
  3778. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  3779. "version" : VERSION,
  3780. "description" : "Runs 3-D games and interactive applets",
  3781. "filename" : "panda3d.exe",
  3782. "mimetype" : "application/x-panda3d",
  3783. "extension" : "p3d",
  3784. "filedesc" : "Panda3D applet",
  3785. "icon" : "panda3d.ico"}
  3786. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  3787. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  3788. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  3789. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  3790. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  3791. TargetAdd('panda3d.exe', input='plugin_common.obj')
  3792. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  3793. if (sys.platform == "darwin"):
  3794. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  3795. elif (sys.platform.startswith("win")):
  3796. TargetAdd('panda3d.exe', input='panda3d.res')
  3797. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  3798. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  3799. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  3800. TargetAdd('panda3d.exe', input='libp3pystub.dll')
  3801. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  3802. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  3803. if (sys.platform == "darwin"):
  3804. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  3805. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  3806. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  3807. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  3808. TargetAdd('Panda3D.app', input='plugin_common.obj')
  3809. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  3810. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  3811. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  3812. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  3813. TargetAdd('Panda3D.app', input='libp3pystub.dll')
  3814. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  3815. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  3816. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  3817. TargetAdd('Panda3D.app', opts=['NOSTRIP', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  3818. elif (sys.platform.startswith("win")):
  3819. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  3820. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  3821. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  3822. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  3823. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  3824. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  3825. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  3826. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  3827. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  3828. TargetAdd('panda3dw.exe', input='libp3pystub.dll')
  3829. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  3830. TargetAdd('panda3dw.exe', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  3831. if (RTDIST):
  3832. 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', 'JPEG', 'PNG', 'ZLIB']
  3833. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  3834. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  3835. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  3836. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  3837. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  3838. TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  3839. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3840. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3841. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  3842. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  3843. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3844. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3845. if (sys.platform == 'darwin'):
  3846. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3847. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3848. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3849. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  3850. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3851. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3852. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3853. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3854. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  3855. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  3856. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  3857. TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  3858. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  3859. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  3860. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  3861. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  3862. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  3863. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  3864. if (sys.platform == 'darwin'):
  3865. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  3866. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  3867. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  3868. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  3869. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  3870. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  3871. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  3872. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  3873. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  3874. if (sys.platform == "darwin"):
  3875. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  3876. if (sys.platform == "darwin"):
  3877. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  3878. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  3879. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  3880. TargetAdd('p3dembed.exe', opts=['NOICON', 'NOSTRIP', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'JPEG', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11', 'PNG'])
  3881. if (sys.platform.startswith("win")):
  3882. OPTS.append("P3DEMBEDW")
  3883. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  3884. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  3885. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  3886. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  3887. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  3888. TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  3889. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  3890. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  3891. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  3892. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  3893. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  3894. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  3895. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  3896. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  3897. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  3898. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  3899. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  3900. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  3901. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  3902. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  3903. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  3904. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  3905. TargetAdd('p3dembedw.exe', opts=['NOICON', 'NOSTRIP', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'JPEG', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'PNG'])
  3906. #
  3907. # DIRECTORY: pandatool/src/pandatoolbase/
  3908. #
  3909. if (PkgSkip("PANDATOOL")==0):
  3910. OPTS=['DIR:pandatool/src/pandatoolbase']
  3911. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  3912. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  3913. #
  3914. # DIRECTORY: pandatool/src/converter/
  3915. #
  3916. if (PkgSkip("PANDATOOL")==0):
  3917. OPTS=['DIR:pandatool/src/converter']
  3918. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  3919. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  3920. #
  3921. # DIRECTORY: pandatool/src/progbase/
  3922. #
  3923. if (PkgSkip("PANDATOOL")==0):
  3924. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  3925. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  3926. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  3927. #
  3928. # DIRECTORY: pandatool/src/eggbase/
  3929. #
  3930. if (PkgSkip("PANDATOOL")==0):
  3931. OPTS=['DIR:pandatool/src/eggbase']
  3932. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  3933. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  3934. #
  3935. # DIRECTORY: pandatool/src/bam/
  3936. #
  3937. if (PkgSkip("PANDATOOL")==0):
  3938. OPTS=['DIR:pandatool/src/bam']
  3939. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  3940. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  3941. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  3942. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  3943. TargetAdd('bam-info.exe', input='libpandaegg.dll')
  3944. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  3945. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  3946. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  3947. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  3948. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  3949. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  3950. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  3951. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  3952. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  3953. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  3954. #
  3955. # DIRECTORY: pandatool/src/cvscopy/
  3956. #
  3957. if (PkgSkip("PANDATOOL")==0):
  3958. OPTS=['DIR:pandatool/src/cvscopy']
  3959. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  3960. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  3961. #
  3962. # DIRECTORY: pandatool/src/daeegg/
  3963. #
  3964. if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0):
  3965. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  3966. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  3967. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  3968. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  3969. #
  3970. # DIRECTORY: pandatool/src/daeprogs/
  3971. #
  3972. if (PkgSkip("PANDATOOL")==0 and PkgSkip("FCOLLADA")==0):
  3973. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  3974. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  3975. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  3976. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  3977. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  3978. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  3979. #
  3980. # DIRECTORY: pandatool/src/dxf/
  3981. #
  3982. if (PkgSkip("PANDATOOL")==0):
  3983. OPTS=['DIR:pandatool/src/dxf']
  3984. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  3985. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  3986. #
  3987. # DIRECTORY: pandatool/src/dxfegg/
  3988. #
  3989. if (PkgSkip("PANDATOOL")==0):
  3990. OPTS=['DIR:pandatool/src/dxfegg']
  3991. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  3992. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  3993. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  3994. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  3995. #
  3996. # DIRECTORY: pandatool/src/dxfprogs/
  3997. #
  3998. if (PkgSkip("PANDATOOL")==0):
  3999. OPTS=['DIR:pandatool/src/dxfprogs']
  4000. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4001. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4002. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4003. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4004. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4005. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS_PYSTUB)
  4006. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4007. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4008. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4009. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4010. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4011. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4012. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4013. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4014. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4015. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4016. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4017. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4018. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4019. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  4020. #
  4021. # DIRECTORY: pandatool/src/objegg/
  4022. #
  4023. if (PkgSkip("PANDATOOL")==0):
  4024. OPTS=['DIR:pandatool/src/objegg']
  4025. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  4026. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  4027. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  4028. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  4029. #
  4030. # DIRECTORY: pandatool/src/objprogs/
  4031. #
  4032. if (PkgSkip("PANDATOOL")==0):
  4033. OPTS=['DIR:pandatool/src/objprogs']
  4034. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  4035. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  4036. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  4037. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4038. #
  4039. # DIRECTORY: pandatool/src/palettizer/
  4040. #
  4041. if (PkgSkip("PANDATOOL")==0):
  4042. OPTS=['DIR:pandatool/src/palettizer']
  4043. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  4044. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  4045. #
  4046. # DIRECTORY: pandatool/src/egg-mkfont/
  4047. #
  4048. if (PkgSkip("FREETYPE")==0) and (PkgSkip("PANDATOOL")==0):
  4049. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  4050. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  4051. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  4052. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  4053. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  4054. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  4055. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  4056. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  4057. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4058. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  4059. #
  4060. # DIRECTORY: pandatool/src/eggcharbase/
  4061. #
  4062. if (PkgSkip("PANDATOOL")==0):
  4063. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  4064. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  4065. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  4066. #
  4067. # DIRECTORY: pandatool/src/egg-optchar/
  4068. #
  4069. if (PkgSkip("PANDATOOL")==0):
  4070. OPTS=['DIR:pandatool/src/egg-optchar']
  4071. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  4072. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  4073. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  4074. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  4075. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  4076. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  4077. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  4078. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  4079. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  4080. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4081. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  4082. #
  4083. # DIRECTORY: pandatool/src/egg-palettize/
  4084. #
  4085. if (PkgSkip("PANDATOOL")==0):
  4086. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  4087. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  4088. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  4089. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  4090. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4091. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  4092. #
  4093. # DIRECTORY: pandatool/src/egg-qtess/
  4094. #
  4095. if (PkgSkip("PANDATOOL")==0):
  4096. OPTS=['DIR:pandatool/src/egg-qtess']
  4097. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  4098. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  4099. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  4100. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  4101. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  4102. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4103. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  4104. #
  4105. # DIRECTORY: pandatool/src/eggprogs/
  4106. #
  4107. if (PkgSkip("PANDATOOL")==0):
  4108. OPTS=['DIR:pandatool/src/eggprogs']
  4109. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  4110. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  4111. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4112. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  4113. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  4114. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  4115. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4116. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  4117. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  4118. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  4119. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4120. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  4121. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  4122. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  4123. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  4124. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4125. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  4126. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  4127. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  4128. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4129. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  4130. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  4131. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  4132. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4133. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  4134. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  4135. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  4136. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4137. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  4138. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  4139. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  4140. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  4141. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4142. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  4143. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  4144. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  4145. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4146. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  4147. #
  4148. # DIRECTORY: pandatool/src/flt/
  4149. #
  4150. if (PkgSkip("PANDATOOL")==0):
  4151. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  4152. TargetAdd('p3flt_fltVectorRecord.obj', opts=OPTS, input='fltVectorRecord.cxx')
  4153. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  4154. TargetAdd('libp3flt.lib', input=['p3flt_fltVectorRecord.obj', 'p3flt_composite1.obj'])
  4155. #
  4156. # DIRECTORY: pandatool/src/fltegg/
  4157. #
  4158. if (PkgSkip("PANDATOOL")==0):
  4159. OPTS=['DIR:pandatool/src/fltegg']
  4160. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  4161. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  4162. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  4163. #
  4164. # DIRECTORY: pandatool/src/fltprogs/
  4165. #
  4166. if (PkgSkip("PANDATOOL")==0):
  4167. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  4168. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  4169. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  4170. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  4171. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4172. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  4173. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  4174. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  4175. TargetAdd('flt-info.exe', input='libp3flt.lib')
  4176. TargetAdd('flt-info.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4177. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  4178. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  4179. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  4180. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  4181. TargetAdd('flt-trans.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4182. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  4183. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  4184. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  4185. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  4186. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  4187. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4188. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  4189. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  4190. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  4191. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  4192. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  4193. TargetAdd('fltcopy.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4194. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  4195. #
  4196. # DIRECTORY: pandatool/src/imagebase/
  4197. #
  4198. if (PkgSkip("PANDATOOL")==0):
  4199. OPTS=['DIR:pandatool/src/imagebase']
  4200. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  4201. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  4202. #
  4203. # DIRECTORY: pandatool/src/imageprogs/
  4204. #
  4205. if (PkgSkip("PANDATOOL")==0):
  4206. OPTS=['DIR:pandatool/src/imageprogs']
  4207. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  4208. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  4209. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  4210. TargetAdd('image-info.exe', input='libp3progbase.lib')
  4211. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  4212. TargetAdd('image-info.exe', input='libpandaegg.dll')
  4213. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  4214. TargetAdd('image-info.exe', input='libp3pystub.dll')
  4215. TargetAdd('image-info.exe', opts=['ADVAPI'])
  4216. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  4217. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  4218. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  4219. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  4220. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  4221. TargetAdd('image-resize.exe', input='libpandaegg.dll')
  4222. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  4223. TargetAdd('image-resize.exe', input='libp3pystub.dll')
  4224. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  4225. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  4226. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  4227. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  4228. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  4229. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  4230. TargetAdd('image-trans.exe', input='libpandaegg.dll')
  4231. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  4232. TargetAdd('image-trans.exe', input='libp3pystub.dll')
  4233. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  4234. #
  4235. # DIRECTORY: pandatool/src/pfmprogs/
  4236. #
  4237. if (PkgSkip("PANDATOOL")==0):
  4238. OPTS=['DIR:pandatool/src/pfmprogs']
  4239. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  4240. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  4241. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  4242. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  4243. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  4244. TargetAdd('pfm-trans.exe', input='libp3pystub.dll')
  4245. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  4246. #
  4247. # DIRECTORY: pandatool/src/lwo/
  4248. #
  4249. if (PkgSkip("PANDATOOL")==0):
  4250. OPTS=['DIR:pandatool/src/lwo']
  4251. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  4252. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  4253. #
  4254. # DIRECTORY: pandatool/src/lwoegg/
  4255. #
  4256. if (PkgSkip("PANDATOOL")==0):
  4257. OPTS=['DIR:pandatool/src/lwoegg']
  4258. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  4259. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  4260. #
  4261. # DIRECTORY: pandatool/src/lwoprogs/
  4262. #
  4263. if (PkgSkip("PANDATOOL")==0):
  4264. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  4265. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  4266. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  4267. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  4268. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  4269. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  4270. TargetAdd('lwo-scan.exe', input='libpandaegg.dll')
  4271. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  4272. TargetAdd('lwo-scan.exe', input='libp3pystub.dll')
  4273. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  4274. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  4275. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  4276. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  4277. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  4278. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4279. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  4280. #
  4281. # DIRECTORY: pandatool/src/maya/
  4282. #
  4283. for VER in MAYAVERSIONS:
  4284. VNUM=VER[4:]
  4285. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  4286. OPTS=['DIR:pandatool/src/maya', VER]
  4287. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  4288. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  4289. #
  4290. # DIRECTORY: pandatool/src/mayaegg/
  4291. #
  4292. for VER in MAYAVERSIONS:
  4293. VNUM=VER[4:]
  4294. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  4295. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  4296. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  4297. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  4298. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  4299. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  4300. #
  4301. # DIRECTORY: pandatool/src/maxegg/
  4302. #
  4303. for VER in MAXVERSIONS:
  4304. VNUM=VER[3:]
  4305. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  4306. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE"]
  4307. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  4308. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  4309. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  4310. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  4311. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  4312. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  4313. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS_PYSTUB)
  4314. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  4315. #
  4316. # DIRECTORY: pandatool/src/maxprogs/
  4317. #
  4318. for VER in MAXVERSIONS:
  4319. VNUM=VER[3:]
  4320. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  4321. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE"]
  4322. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  4323. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  4324. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  4325. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  4326. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  4327. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  4328. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  4329. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  4330. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  4331. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  4332. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  4333. #
  4334. # DIRECTORY: pandatool/src/vrml/
  4335. #
  4336. if (PkgSkip("PANDATOOL")==0):
  4337. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  4338. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  4339. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  4340. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  4341. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  4342. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  4343. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  4344. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  4345. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  4346. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  4347. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  4348. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  4349. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  4350. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  4351. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  4352. #
  4353. # DIRECTORY: pandatool/src/vrmlegg/
  4354. #
  4355. if (PkgSkip("PANDATOOL")==0):
  4356. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  4357. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  4358. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  4359. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  4360. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  4361. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  4362. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  4363. #
  4364. # DIRECTORY: pandatool/src/xfile/
  4365. #
  4366. if (PkgSkip("PANDATOOL")==0):
  4367. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  4368. CreateFile(GetOutputDir()+"/include/xParser.h")
  4369. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  4370. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  4371. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  4372. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  4373. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  4374. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  4375. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  4376. #
  4377. # DIRECTORY: pandatool/src/xfileegg/
  4378. #
  4379. if (PkgSkip("PANDATOOL")==0):
  4380. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  4381. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  4382. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  4383. #
  4384. # DIRECTORY: pandatool/src/ptloader/
  4385. #
  4386. if (PkgSkip("PANDATOOL")==0):
  4387. 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']
  4388. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx')
  4389. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  4390. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  4391. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  4392. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  4393. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  4394. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  4395. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  4396. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  4397. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  4398. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  4399. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  4400. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  4401. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  4402. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  4403. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  4404. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  4405. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  4406. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  4407. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  4408. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  4409. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  4410. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  4411. #
  4412. # DIRECTORY: pandatool/src/miscprogs/
  4413. #
  4414. if (PkgSkip("PANDATOOL")==0):
  4415. OPTS=['DIR:pandatool/src/miscprogs']
  4416. TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  4417. TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  4418. TargetAdd('bin2c.exe', input='libp3progbase.lib')
  4419. TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  4420. TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  4421. TargetAdd('bin2c.exe', input='libp3pystub.dll')
  4422. TargetAdd('bin2c.exe', opts=['ADVAPI'])
  4423. #
  4424. # DIRECTORY: pandatool/src/pstatserver/
  4425. #
  4426. if (PkgSkip("PANDATOOL")==0):
  4427. OPTS=['DIR:pandatool/src/pstatserver']
  4428. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  4429. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  4430. #
  4431. # DIRECTORY: pandatool/src/softprogs/
  4432. #
  4433. if (PkgSkip("PANDATOOL")==0):
  4434. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  4435. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  4436. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  4437. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  4438. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  4439. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  4440. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  4441. TargetAdd('softcvs.exe', input='libpandaegg.dll')
  4442. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  4443. TargetAdd('softcvs.exe', input='libp3pystub.dll')
  4444. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  4445. #
  4446. # DIRECTORY: pandatool/src/text-stats/
  4447. #
  4448. if (PkgSkip("PANDATOOL")==0):
  4449. OPTS=['DIR:pandatool/src/text-stats']
  4450. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  4451. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  4452. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  4453. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  4454. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  4455. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  4456. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  4457. TargetAdd('text-stats.exe', input='libpandaegg.dll')
  4458. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  4459. TargetAdd('text-stats.exe', input='libp3pystub.dll')
  4460. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  4461. #
  4462. # DIRECTORY: pandatool/src/vrmlprogs/
  4463. #
  4464. if (PkgSkip("PANDATOOL")==0):
  4465. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  4466. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  4467. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  4468. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  4469. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  4470. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  4471. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  4472. TargetAdd('vrml-trans.exe', input='libp3pystub.dll')
  4473. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  4474. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  4475. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  4476. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  4477. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  4478. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4479. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  4480. #
  4481. # DIRECTORY: pandatool/src/win-stats/
  4482. # DIRECTORY: pandatool/src/gtk-stats/
  4483. #
  4484. if (PkgSkip("PANDATOOL")==0 and (sys.platform.startswith("win") or PkgSkip("GTK2")==0)):
  4485. if (sys.platform.startswith("win")):
  4486. OPTS=['DIR:pandatool/src/win-stats']
  4487. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  4488. else:
  4489. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  4490. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  4491. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  4492. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  4493. TargetAdd('pstats.exe', input='libp3progbase.lib')
  4494. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  4495. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  4496. TargetAdd('pstats.exe', input='libp3pystub.dll')
  4497. TargetAdd('pstats.exe', opts=['WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  4498. #
  4499. # DIRECTORY: pandatool/src/xfileprogs/
  4500. #
  4501. if (PkgSkip("PANDATOOL")==0):
  4502. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  4503. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  4504. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  4505. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  4506. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  4507. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4508. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  4509. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  4510. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  4511. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  4512. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  4513. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  4514. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  4515. TargetAdd('x-trans.exe', input='libp3pystub.dll')
  4516. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  4517. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  4518. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  4519. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  4520. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  4521. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4522. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  4523. #
  4524. # DIRECTORY: pandatool/src/mayaprogs/
  4525. #
  4526. for VER in MAYAVERSIONS:
  4527. VNUM=VER[4:]
  4528. if (PkgSkip(VER)==0) and (PkgSkip("PANDATOOL")==0):
  4529. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER]
  4530. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  4531. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  4532. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  4533. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  4534. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  4535. if sys.platform.startswith("win32"):
  4536. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.dll')
  4537. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER])
  4538. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  4539. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  4540. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  4541. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  4542. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  4543. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  4544. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  4545. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  4546. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  4547. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  4548. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  4549. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  4550. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  4551. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  4552. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  4553. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  4554. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  4555. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  4556. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  4557. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  4558. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  4559. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  4560. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER])
  4561. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  4562. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  4563. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  4564. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  4565. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  4566. if (sys.platform.startswith("win")):
  4567. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS_PYSTUB)
  4568. else:
  4569. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  4570. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER])
  4571. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  4572. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  4573. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input='libmayaegg'+VNUM+'.lib')
  4574. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input='libmaya'+VNUM+'.lib')
  4575. if (sys.platform.startswith("win")):
  4576. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4577. else:
  4578. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS)
  4579. if (sys.platform == "darwin" and int(VNUM) >= 2009):
  4580. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', opts=['ADVAPI', 'NOPPC', VER])
  4581. else:
  4582. TargetAdd('maya2egg'+VNUM+'-wrapped.exe', opts=['ADVAPI', VER])
  4583. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  4584. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  4585. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', input='libmayaegg'+VNUM+'.lib')
  4586. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', input='libmaya'+VNUM+'.lib')
  4587. if (sys.platform.startswith("win")):
  4588. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4589. else:
  4590. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS)
  4591. if (sys.platform == "darwin" and int(VNUM) >= 2009):
  4592. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', opts=['ADVAPI', 'NOPPC', VER])
  4593. else:
  4594. TargetAdd('egg2maya'+VNUM+'-wrapped.exe', opts=['ADVAPI', VER])
  4595. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  4596. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  4597. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input='libp3cvscopy.lib')
  4598. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input='libmaya'+VNUM+'.lib')
  4599. if sys.platform == "win32":
  4600. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS_PYSTUB)
  4601. else:
  4602. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', input=COMMON_EGG2X_LIBS)
  4603. if (sys.platform == "darwin" and int(VNUM) >= 2009):
  4604. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', opts=['ADVAPI', 'NOPPC', VER])
  4605. else:
  4606. TargetAdd('mayacopy'+VNUM+'-wrapped.exe', opts=['ADVAPI', VER])
  4607. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  4608. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  4609. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER])
  4610. TargetAdd('mayaWrapper'+VNUM+'.obj', opts=OPTS, input='mayaWrapper.cxx')
  4611. TargetAdd('maya2egg'+VNUM+'.exe', input='mayaWrapper'+VNUM+'.obj')
  4612. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI'])
  4613. TargetAdd('mayacopy'+VNUM+'.exe', input='mayaWrapper'+VNUM+'.obj')
  4614. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI'])
  4615. #
  4616. # DIRECTORY: contrib/src/ai/
  4617. #
  4618. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  4619. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  4620. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  4621. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  4622. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  4623. TargetAdd('libpandaai.in', opts=['IMOD:pandaai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  4624. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  4625. TargetAdd('libpandaai_module.obj', input='libpandaai.in')
  4626. TargetAdd('libpandaai_module.obj', opts=OPTS)
  4627. TargetAdd('libpandaai_module.obj', opts=['IMOD:pandaai', 'ILIB:libpandaai'])
  4628. TargetAdd('libpandaai.dll', input='libpandaai_module.obj')
  4629. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  4630. TargetAdd('libpandaai.dll', input='libpandaai_igate.obj')
  4631. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  4632. #
  4633. # Run genpycode
  4634. #
  4635. if (PkgSkip("PYTHON")==0 and not RUNTIME):
  4636. # We're phasing out the concept of PandaModules, so do not
  4637. # add new libraries here. See direct/src/ffi/panda3d.py
  4638. TargetAdd('PandaModules.py', input='libpandaexpress.dll')
  4639. TargetAdd('PandaModules.py', input='libpanda.dll')
  4640. if (PkgSkip("PANDAPHYSICS")==0):
  4641. TargetAdd('PandaModules.py', input='libpandaphysics.dll')
  4642. if (PkgSkip('PANDAFX')==0):
  4643. TargetAdd('PandaModules.py', input='libpandafx.dll')
  4644. if (PkgSkip("DIRECT")==0):
  4645. TargetAdd('PandaModules.py', input='libp3direct.dll')
  4646. if (PkgSkip("VISION")==0):
  4647. TargetAdd('PandaModules.py', input='libp3vision.dll')
  4648. if (PkgSkip("SKEL")==0):
  4649. TargetAdd('PandaModules.py', input='libpandaskel.dll')
  4650. TargetAdd('PandaModules.py', input='libpandaegg.dll')
  4651. if (PkgSkip("AWESOMIUM")==0):
  4652. TargetAdd('PandaModules.py', input='libp3awesomium.dll')
  4653. if (PkgSkip("ODE")==0):
  4654. TargetAdd('PandaModules.py', input='libpandaode.dll')
  4655. #
  4656. # Generate the models directory and samples directory
  4657. #
  4658. if (PkgSkip("DIRECT")==0 and not RUNTIME):
  4659. model_extensions = ["*.egg"]
  4660. if (PkgSkip("PANDATOOL")==0):
  4661. model_extensions.append("*.flt")
  4662. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  4663. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  4664. newname = model[:-4] + ".egg.pz"
  4665. else:
  4666. newname = model[:-4] + ".egg"
  4667. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  4668. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  4669. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  4670. newname = model[:-4] + ".egg.pz"
  4671. else:
  4672. newname = model[:-4] + ".egg"
  4673. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  4674. for model in GetDirectoryContents("models", model_extensions):
  4675. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  4676. newname = model[:-4] + ".egg.pz"
  4677. else:
  4678. newname = model[:-4] + ".egg"
  4679. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  4680. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  4681. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  4682. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  4683. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  4684. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  4685. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  4686. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  4687. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  4688. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  4689. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  4690. #
  4691. # Build the rtdist.
  4692. #
  4693. if (RTDIST):
  4694. OPTS=['DIR:direct/src/p3d']
  4695. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  4696. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  4697. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  4698. #
  4699. # Distribute prebuilt .p3d files as executable.
  4700. #
  4701. if (PkgSkip("DIRECT")==0 and not RUNTIME and not RTDIST):
  4702. if (sys.platform.startswith("win")):
  4703. OPTS=['DIR:direct/src/p3d']
  4704. TargetAdd('p3dWrapper.obj', opts=OPTS, input='p3dWrapper.c')
  4705. TargetAdd('p3dWrapper.exe', input='p3dWrapper.obj')
  4706. TargetAdd('p3dWrapper.exe', opts=["ADVAPI"])
  4707. for g in glob.glob("direct/src/p3d/*.p3d"):
  4708. base = os.path.basename(g)
  4709. base = base.split(".", 1)[0]
  4710. if (sys.platform.startswith("win")):
  4711. TargetAdd(base+".exe", input='p3dWrapper.exe')
  4712. CopyFile(GetOutputDir()+"/bin/"+base+".p3d", g)
  4713. else:
  4714. CopyFile(GetOutputDir()+"/bin/"+base, g)
  4715. oscmd("chmod +x "+GetOutputDir()+"/bin/"+base)
  4716. ##########################################################################################
  4717. #
  4718. # Dependency-Based Distributed Build System.
  4719. #
  4720. ##########################################################################################
  4721. DEPENDENCYQUEUE=[]
  4722. for target in TARGET_LIST:
  4723. name = target.name
  4724. inputs = target.inputs
  4725. opts = target.opts
  4726. deps = target.deps
  4727. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  4728. def BuildWorker(taskqueue, donequeue):
  4729. while (1):
  4730. task = taskqueue.get()
  4731. sys.stdout.flush()
  4732. if (task == 0): return
  4733. try:
  4734. apply(task[0],task[1])
  4735. donequeue.put(task)
  4736. except:
  4737. donequeue.put(0)
  4738. def AllSourcesReady(task, pending):
  4739. sources = task[3]
  4740. for x in sources:
  4741. if (x in pending):
  4742. return 0
  4743. sources = task[1][1]
  4744. for x in sources:
  4745. if (x in pending):
  4746. return 0
  4747. altsources = task[4]
  4748. for x in altsources:
  4749. if (x in pending):
  4750. return 0
  4751. return 1
  4752. def ParallelMake(tasklist):
  4753. # Create the communication queues.
  4754. donequeue=Queue.Queue()
  4755. taskqueue=Queue.Queue()
  4756. # Build up a table listing all the pending targets
  4757. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  4758. # task[2] = [name]
  4759. # task[3] = deps
  4760. # The python tool package, in particular fltegg seems to throw parallelmake off
  4761. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  4762. # and another subpart to be built sequentially. The most time consuming part of the process
  4763. # is the c++ code generation anyways.
  4764. tasklist_seq = []
  4765. i = 0
  4766. while i < len(tasklist):
  4767. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  4768. break
  4769. i += 1
  4770. if i < len(tasklist):
  4771. tasklist_seq = tasklist[i:]
  4772. tasklist = tasklist[:i]
  4773. iNumStartingTasks = len(tasklist)
  4774. pending = {}
  4775. for task in tasklist:
  4776. for target in task[2]:
  4777. pending[target] = 1
  4778. # Create the workers
  4779. for slave in range(THREADCOUNT):
  4780. th = threading.Thread(target=BuildWorker, args=[taskqueue,donequeue])
  4781. th.setDaemon(1)
  4782. th.start()
  4783. # Feed tasks to the workers.
  4784. tasksqueued = 0
  4785. while (1):
  4786. if (tasksqueued < THREADCOUNT):
  4787. extras = []
  4788. for task in tasklist:
  4789. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  4790. if (NeedsBuild(task[2], task[3])):
  4791. tasksqueued += 1
  4792. taskqueue.put(task)
  4793. else:
  4794. for target in task[2]:
  4795. del pending[target]
  4796. else:
  4797. extras.append(task)
  4798. tasklist = extras
  4799. sys.stdout.flush()
  4800. if (tasksqueued == 0): break
  4801. donetask = donequeue.get()
  4802. if (donetask == 0):
  4803. exit("Build process aborting.")
  4804. sys.stdout.flush()
  4805. tasksqueued -= 1
  4806. JustBuilt(donetask[2], donetask[3])
  4807. for target in donetask[2]:
  4808. del pending[target]
  4809. # Kill the workers.
  4810. for slave in range(THREADCOUNT):
  4811. taskqueue.put(0)
  4812. # Make sure there aren't any unsatisfied tasks
  4813. if (len(tasklist)>0):
  4814. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  4815. SequentialMake(tasklist_seq)
  4816. def SequentialMake(tasklist):
  4817. i = 0
  4818. for task in tasklist:
  4819. if (NeedsBuild(task[2], task[3])):
  4820. apply(task[0], task[1] + [(i * 100.0) / len(tasklist)])
  4821. JustBuilt(task[2], task[3])
  4822. i += 1
  4823. def RunDependencyQueue(tasklist):
  4824. if (THREADCOUNT!=0):
  4825. ParallelMake(tasklist)
  4826. else:
  4827. SequentialMake(tasklist)
  4828. try:
  4829. RunDependencyQueue(DEPENDENCYQUEUE)
  4830. except:
  4831. SaveDependencyCache()
  4832. raise
  4833. ##########################################################################################
  4834. #
  4835. # The Installers
  4836. #
  4837. # Under windows, we can build an 'exe' package using NSIS
  4838. # Under linux, we can build a 'deb' package or an 'rpm' package.
  4839. # Under OSX, we can make a 'dmg' package.
  4840. #
  4841. ##########################################################################################
  4842. def MakeInstallerNSIS(file, fullname, smdirectory, installdir):
  4843. if (os.path.isfile(file)):
  4844. os.remove(file)
  4845. elif (os.path.isdir(file)):
  4846. shutil.rmtree(file)
  4847. if (RUNTIME):
  4848. # Invoke the make_installer script.
  4849. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  4850. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  4851. oscmd(SDK["PYTHONEXEC"] + " direct\\src\\plugin_installer\\make_installer.py --version %s" % VERSION)
  4852. shutil.move("direct\\src\\plugin_installer\\p3d-setup.exe", file)
  4853. return
  4854. print "Building "+fullname+" installer. This can take up to an hour."
  4855. if (COMPRESSOR != "lzma"):
  4856. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  4857. if (os.path.exists("nsis-output.exe")):
  4858. os.remove("nsis-output.exe")
  4859. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  4860. psource=os.path.abspath(".")
  4861. panda=os.path.abspath(GetOutputDir())
  4862. cmd=GetThirdpartyBase()+"/win-nsis/makensis /V2 "
  4863. cmd=cmd+'/DCOMPRESSOR="'+COMPRESSOR+'" '
  4864. cmd=cmd+'/DNAME="'+fullname+'" '
  4865. cmd=cmd+'/DSMDIRECTORY="'+smdirectory+'" '
  4866. cmd=cmd+'/DINSTALLDIR="'+installdir+'" '
  4867. cmd=cmd+'/DOUTFILE="'+psource+'\\nsis-output.exe" '
  4868. cmd=cmd+'/DLICENSE="'+panda+'\\LICENSE" '
  4869. cmd=cmd+'/DLANGUAGE="English" '
  4870. cmd=cmd+'/DRUNTEXT="Visit the Panda Manual" '
  4871. cmd=cmd+'/DIBITMAP="panda-install.bmp" '
  4872. cmd=cmd+'/DUBITMAP="panda-install.bmp" '
  4873. cmd=cmd+'/DPANDA="'+panda+'" '
  4874. cmd=cmd+'/DPANDACONF="'+panda+'\\etc" '
  4875. cmd=cmd+'/DPSOURCE="'+psource+'" '
  4876. cmd=cmd+'/DPYEXTRAS="'+os.path.abspath(GetThirdpartyBase())+'\\win-extras" '
  4877. cmd=cmd+'"'+psource+'\\direct\\src\\directscripts\\packpanda.nsi"'
  4878. oscmd(cmd)
  4879. os.rename("nsis-output.exe", file)
  4880. INSTALLER_DEB_FILE="""
  4881. Package: panda3dMAJOR
  4882. Version: VERSION
  4883. Section: libdevel
  4884. Priority: optional
  4885. Architecture: ARCH
  4886. Essential: no
  4887. Depends: DEPENDS
  4888. Recommends: panda3d-runtime, python-wxversion, python-profiler (>= PV), python-tk (>= PV), RECOMMENDS
  4889. Provides: panda3d
  4890. Conflicts: panda3d
  4891. Replaces: panda3d
  4892. Maintainer: rdb <[email protected]>
  4893. Installed-Size: INSTSIZE
  4894. Description: The Panda3D free 3D engine SDK
  4895. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
  4896. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
  4897. .
  4898. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  4899. """
  4900. RUNTIME_INSTALLER_DEB_FILE="""
  4901. Package: panda3d-runtime
  4902. Version: VERSION
  4903. Section: web
  4904. Priority: optional
  4905. Architecture: ARCH
  4906. Essential: no
  4907. Depends: DEPENDS
  4908. Provides: panda3d-runtime
  4909. Maintainer: rdb <[email protected]>
  4910. Installed-Size: INSTSIZE
  4911. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  4912. This package contains the runtime distribution and browser plugin of the Panda3D engine. It allows you view webpages that contain Panda3D content and to run games created with Panda3D that are packaged as .p3d file.
  4913. """
  4914. # We're not putting "python" in the "Requires" field,
  4915. # since the rpm-based distros don't have a common
  4916. # naming for the Python package.
  4917. INSTALLER_SPEC_FILE="""
  4918. %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
  4919. Summary: The Panda3D free 3D engine SDK
  4920. Name: panda3d
  4921. Version: VERSION
  4922. Release: RPMRELEASE
  4923. License: BSD License
  4924. Group: Development/Libraries
  4925. BuildRoot: PANDASOURCE/targetroot
  4926. %description
  4927. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
  4928. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
  4929. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  4930. %post
  4931. /sbin/ldconfig
  4932. %postun
  4933. /sbin/ldconfig
  4934. %files
  4935. %defattr(-,root,root)
  4936. /etc/Confauto.prc
  4937. /etc/Config.prc
  4938. /usr/share/panda3d
  4939. /usr/share/mime-info/panda3d.mime
  4940. /usr/share/mime-info/panda3d.keys
  4941. /usr/share/mime/packages/panda3d.xml
  4942. /usr/share/application-registry/panda3d.applications
  4943. /usr/share/applications/*.desktop
  4944. /etc/ld.so.conf.d/panda3d.conf
  4945. /usr/bin
  4946. /usr/%_lib/panda3d
  4947. %{python_sitearch}
  4948. /usr/include/panda3d
  4949. """
  4950. RUNTIME_INSTALLER_SPEC_FILE="""
  4951. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  4952. Name: panda3d-runtime
  4953. Version: VERSION
  4954. Release: RPMRELEASE
  4955. License: BSD License
  4956. Group: Productivity/Graphics/Other
  4957. BuildRoot: PANDASOURCE/targetroot
  4958. %description
  4959. This package contains the runtime distribution and browser plugin of the Panda3D engine. It allows you view webpages that contain Panda3D content and to run games created with Panda3D that are packaged as .p3d file.
  4960. %files
  4961. %defattr(-,root,root)
  4962. /usr/bin/panda3d
  4963. /usr/%_lib/nppanda3d.so
  4964. /usr/%_lib/mozilla/plugins/nppanda3d.so
  4965. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  4966. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  4967. /usr/share/mime-info/panda3d-runtime.mime
  4968. /usr/share/mime-info/panda3d-runtime.keys
  4969. /usr/share/mime/packages/panda3d-runtime.xml
  4970. /usr/share/application-registry/panda3d-runtime.applications
  4971. /usr/share/applications/*.desktop
  4972. """
  4973. # plist file for Mac OSX
  4974. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  4975. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  4976. <plist version="1.0">
  4977. <dict>
  4978. <key>CFBundleIdentifier</key>
  4979. <string>%(package_id)s</string>
  4980. <key>CFBundleShortVersionString</key>
  4981. <string>%(version)s</string>
  4982. <key>IFPkgFlagRelocatable</key>
  4983. <false/>
  4984. <key>IFPkgFlagAuthorizationAction</key>
  4985. <string>RootAuthorization</string>
  4986. <key>IFPkgFlagAllowBackRev</key>
  4987. <true/>
  4988. </dict>
  4989. </plist>
  4990. """
  4991. # FreeBSD pkg-descr
  4992. INSTALLER_PKG_DESCR_FILE = """
  4993. Panda3D is a game engine which includes graphics, audio, I/O, collision detection, and other abilities relevant to the creation of 3D games. Panda3D is open source and free software under the revised BSD license, and can be used for both free and commercial game development at no financial cost.
  4994. Panda3D's intended game-development language is Python. The engine itself is written in C++, and utilizes an automatic wrapper-generator to expose the complete functionality of the engine in a Python interface.
  4995. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  4996. WWW: http://www.panda3d.org/
  4997. """
  4998. def MakeInstallerLinux():
  4999. if RUNTIME: # No worries, it won't be used
  5000. PYTHONV = "python"
  5001. else:
  5002. PYTHONV = SDK["PYTHONVERSION"]
  5003. PV = PYTHONV.replace("python", "")
  5004. if (os.path.isdir("targetroot")): oscmd("chmod -R 755 targetroot")
  5005. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  5006. oscmd("mkdir --mode=0755 targetroot")
  5007. # Invoke installpanda.py to install it into a temporary dir
  5008. if RUNTIME:
  5009. InstallRuntime(destdir = "targetroot", prefix = "/usr", outputdir = GetOutputDir())
  5010. else:
  5011. InstallPanda(destdir = "targetroot", prefix = "/usr", outputdir = GetOutputDir())
  5012. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  5013. if (os.path.exists("/usr/bin/rpmbuild") and not os.path.exists("/usr/bin/dpkg-deb")):
  5014. oscmd("rm -rf targetroot/DEBIAN")
  5015. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  5016. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  5017. pandasource = os.path.abspath(os.getcwd())
  5018. if (RUNTIME):
  5019. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  5020. else:
  5021. txt = INSTALLER_SPEC_FILE[1:]
  5022. txt = txt.replace("VERSION", VERSION).replace("RPMRELEASE", RPMRELEASE).replace("PANDASOURCE", pandasource).replace("PV", PV)
  5023. WriteFile("panda3d.spec", txt)
  5024. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  5025. if (RUNTIME):
  5026. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  5027. else:
  5028. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  5029. oscmd("rm -rf "+ARCH, True)
  5030. if (os.path.exists("/usr/bin/dpkg-deb")):
  5031. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  5032. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  5033. if (RUNTIME):
  5034. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  5035. else:
  5036. txt = INSTALLER_DEB_FILE[1:]
  5037. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", ARCH).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  5038. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  5039. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  5040. oscmd("cd targetroot ; (find usr -type f -exec md5sum {} \;) > DEBIAN/md5sums")
  5041. if (not RUNTIME):
  5042. oscmd("cd targetroot ; (find etc -type f -exec md5sum {} \;) >> DEBIAN/md5sums")
  5043. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  5044. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  5045. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  5046. oscmd("mkdir targetroot/debian")
  5047. WriteFile("targetroot/debian/control", "")
  5048. if (RUNTIME):
  5049. oscmd("ln -s .. targetroot/debian/panda3d-runtime")
  5050. oscmd("cd targetroot ; dpkg-shlibdeps -xpanda3d-runtime debian/panda3d-runtime/usr/lib*/*.so* debian/panda3d-runtime/usr/bin/*")
  5051. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  5052. WriteFile("targetroot/DEBIAN/control", txt.replace("DEPENDS", depends))
  5053. else:
  5054. oscmd("ln -s .. targetroot/debian/panda3d" + MAJOR_VERSION)
  5055. oscmd("cd targetroot ; dpkg-gensymbols -v%s -ppanda3d%s -eusr%s/panda3d/lib*.so* -ODEBIAN/symbols >/dev/null" % (DEBVERSION, MAJOR_VERSION, libdir))
  5056. # Library dependencies are required, binary dependencies are recommended. Dunno why -xlibphysx-extras is needed, prolly a bug in their package
  5057. oscmd("cd targetroot ; LD_LIBRARY_PATH=usr%s/panda3d dpkg-shlibdeps --ignore-missing-info --warnings=2 -xpanda3d%s -xlibphysx-extras -Tdebian/substvars_dep debian/panda3d%s/usr/lib*/panda3d/lib*.so*" % (libdir, MAJOR_VERSION, MAJOR_VERSION))
  5058. oscmd("cd targetroot ; LD_LIBRARY_PATH=usr%s/panda3d dpkg-shlibdeps --ignore-missing-info --warnings=2 -xpanda3d%s -Tdebian/substvars_rec debian/panda3d%s/usr/bin/*" % (libdir, MAJOR_VERSION, MAJOR_VERSION))
  5059. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  5060. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  5061. if PkgSkip("PYTHON")==0:
  5062. depends += ", " + PYTHONV + ", python-pmw"
  5063. if PkgSkip("NVIDIACG")==0:
  5064. depends += ", nvidia-cg-toolkit"
  5065. WriteFile("targetroot/DEBIAN/control", txt.replace("DEPENDS", depends).replace("RECOMMENDS", recommends))
  5066. oscmd("rm -rf targetroot/debian")
  5067. oscmd("chmod -R 755 targetroot/DEBIAN")
  5068. if (RUNTIME):
  5069. oscmd("cd targetroot/DEBIAN ; chmod 644 control md5sums")
  5070. oscmd("fakeroot dpkg-deb -b targetroot panda3d-runtime_"+DEBVERSION+"_"+ARCH+".deb")
  5071. else:
  5072. oscmd("cd targetroot/DEBIAN ; chmod 644 control md5sums conffiles symbols")
  5073. oscmd("fakeroot dpkg-deb -b targetroot panda3d"+MAJOR_VERSION+"_"+DEBVERSION+"_"+ARCH+".deb")
  5074. oscmd("chmod -R 755 targetroot")
  5075. if not (os.path.exists("/usr/bin/rpmbuild") or os.path.exists("/usr/bin/dpkg-deb")):
  5076. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  5077. # oscmd("chmod -R 755 targetroot")
  5078. # oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec "+ARCH)
  5079. def MakeInstallerOSX():
  5080. if (RUNTIME):
  5081. # Invoke the make_installer script.
  5082. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  5083. oscmd(SDK["PYTHONEXEC"] + " direct/src/plugin_installer/make_installer.py --version %s" % VERSION)
  5084. return
  5085. import compileall
  5086. if (os.path.isfile("Panda3D-%s.dmg" % VERSION)): oscmd("rm -f Panda3D-%s.dmg" % VERSION)
  5087. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  5088. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  5089. #TODO: add postflight script
  5090. #oscmd("sed -e 's@\\$1@%s@' < direct/src/directscripts/profilepaths-osx.command >> Panda3D-tpl-rw/panda3dpaths.command" % VERSION)
  5091. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  5092. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  5093. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  5094. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  5095. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  5096. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  5097. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  5098. if os.path.isdir(GetOutputDir()+"/plugins"):
  5099. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  5100. for base in os.listdir(GetOutputDir()+"/lib"):
  5101. if (not base.endswith(".a")):
  5102. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  5103. # We really need to specify -R in order not to follow symlinks
  5104. # On OSX, just specifying -P is not enough to do that.
  5105. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  5106. # Execute install_name_tool to make them reference an absolute path
  5107. if (libname.endswith(".dylib") and not os.path.islink(libname)):
  5108. oscmd("install_name_tool -id /Developer/Panda3D/lib/%s %s" % (base, libname), True)
  5109. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (libname, GetOutputDir()), True)
  5110. for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"):
  5111. if len(line.strip()) > 0 and not line.strip().endswith(":"):
  5112. libdep = line.strip().split(" ", 1)[0]
  5113. if not libdep.startswith("/"):
  5114. oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, os.path.basename(libdep), libname), True)
  5115. # Temporary script that should clean up the poison that the early 1.7.0 builds injected into environment.plist
  5116. oscmd("mkdir -p dstroot/scripts/base/")
  5117. postinstall = open("dstroot/scripts/base/postinstall", "w")
  5118. print >>postinstall, "#!/usr/bin/python"
  5119. print >>postinstall, "import os, sys, plistlib"
  5120. print >>postinstall, "home = os.environ['HOME']"
  5121. print >>postinstall, "if not os.path.isdir(os.path.join(home, '.MacOSX')):"
  5122. print >>postinstall, " sys.exit()"
  5123. print >>postinstall, "plist = dict()"
  5124. print >>postinstall, "envfile = os.path.join(home, '.MacOSX', 'environment.plist')"
  5125. print >>postinstall, "if os.path.exists(envfile):"
  5126. print >>postinstall, " try:"
  5127. print >>postinstall, " plist = plistlib.readPlist(envfile)"
  5128. print >>postinstall, " except: sys.exit(0)"
  5129. print >>postinstall, "else:"
  5130. print >>postinstall, " sys.exit(0)"
  5131. print >>postinstall, "paths = {'PATH' : '/Developer/Tools/Panda3D', 'DYLD_LIBRARY_PATH' : '/Developer/Panda3D/lib', 'PYTHONPATH' : '/Developer/Panda3D/lib',"
  5132. print >>postinstall, " 'MAYA_SCRIPT_PATH' : '/Developer/Panda3D/plugins', 'MAYA_PLUG_IN_PATH' : '/Developer/Panda3D/plugins'}"
  5133. print >>postinstall, "for env, path in paths.items():"
  5134. print >>postinstall, " if env in plist:"
  5135. print >>postinstall, " paths = plist[env].split(':')"
  5136. print >>postinstall, " if '' in paths: paths.remove('')"
  5137. print >>postinstall, " if path in paths: paths.remove(path)"
  5138. print >>postinstall, " if len(paths) == 0:"
  5139. print >>postinstall, " del plist[env]"
  5140. print >>postinstall, " else:"
  5141. print >>postinstall, " plist[env] = ':'.join(paths)"
  5142. print >>postinstall, "if len(plist) == 0:"
  5143. print >>postinstall, " os.remove(envfile)"
  5144. print >>postinstall, "else:"
  5145. print >>postinstall, " plistlib.writePlist(plist, envfile)"
  5146. postinstall.close()
  5147. postflight = open("dstroot/scripts/base/postflight", "w")
  5148. print >>postflight, "#!/usr/bin/env bash\n"
  5149. print >>postflight, "RESULT=`/usr/bin/open 'http://www.panda3d.org/wiki/index.php/Getting_Started_on_OSX'`"
  5150. print >>postflight, "\nexit 0"
  5151. postflight.close()
  5152. oscmd("chmod +x dstroot/scripts/base/postinstall")
  5153. oscmd("chmod +x dstroot/scripts/base/postflight")
  5154. oscmd("mkdir -p dstroot/tools/Developer/Tools/Panda3D")
  5155. oscmd("mkdir -p dstroot/tools/Developer/Panda3D")
  5156. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  5157. # Trailing newline is important, works around a bug in OSX
  5158. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Tools/Panda3D\n")
  5159. for base in os.listdir(GetOutputDir()+"/bin"):
  5160. binname = "dstroot/tools/Developer/Tools/Panda3D/" + base
  5161. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  5162. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  5163. # Execute install_name_tool to make the binaries reference an absolute path
  5164. if (not os.path.islink(binname)):
  5165. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (binname, GetOutputDir()), True)
  5166. for line in open(GetOutputDir()+"/tmp/otool-libs.txt", "r"):
  5167. if len(line.strip()) > 0 and not line.strip().endswith(":"):
  5168. libdep = line.strip().split(" ", 1)[0]
  5169. if not libdep.startswith("/"):
  5170. oscmd("install_name_tool -change %s /Developer/Panda3D/lib/%s %s" % (libdep, os.path.basename(libdep), binname), True)
  5171. if PkgSkip("PYTHON")==0:
  5172. PV = SDK["PYTHONVERSION"].replace("python", "")
  5173. oscmd("mkdir -p dstroot/pythoncode/usr/bin")
  5174. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/lib/direct")
  5175. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  5176. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D/lib")
  5177. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/lib/pandac" % GetOutputDir())
  5178. oscmd("cp -R direct/src/* dstroot/pythoncode/Developer/Panda3D/lib/direct")
  5179. oscmd("cp direct/src/ffi/panda3d.py dstroot/pythoncode/Developer/Panda3D/lib/panda3d.py")
  5180. oscmd("ln -s %s dstroot/pythoncode/usr/bin/ppython" % SDK["PYTHONEXEC"])
  5181. if os.path.isdir(GetOutputDir()+"/Pmw"):
  5182. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/lib/Pmw" % GetOutputDir())
  5183. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/lib/Pmw")
  5184. WriteFile("dstroot/pythoncode/Developer/Panda3D/lib/direct/__init__.py", "")
  5185. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/lib/direct"):
  5186. if ((base != "extensions") and (base != "extensions_native")):
  5187. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/lib/direct/"+base)
  5188. oscmd("mkdir -p dstroot/headers/Developer/Panda3D")
  5189. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  5190. if os.path.isdir("samples"):
  5191. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  5192. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  5193. # Dummy package uninstall16 which just contains a preflight script to remove /Applications/Panda3D/ .
  5194. oscmd("mkdir -p dstroot/scripts/uninstall16/")
  5195. preflight = open("dstroot/scripts/uninstall16/preflight", "w")
  5196. print >>preflight, "#!/usr/bin/python"
  5197. print >>preflight, "import os, re, sys, shutil"
  5198. print >>preflight, "if os.path.isdir('/Applications/Panda3D'): shutil.rmtree('/Applications/Panda3D')"
  5199. print >>preflight, "bash_profile = os.path.join(os.environ['HOME'], '.bash_profile')"
  5200. print >>preflight, "if not os.path.isfile(bash_profile): sys.exit(0)"
  5201. print >>preflight, "pattern = re.compile('''PANDA_VERSION=[0-9][.][0-9][.][0-9]"
  5202. print >>preflight, "PANDA_PATH=/Applications/Panda3D/[$A-Z.0-9_]+"
  5203. print >>preflight, "if \[ -d \$PANDA_PATH \]"
  5204. print >>preflight, "then(.+?)fi"
  5205. print >>preflight, "''', flags = re.DOTALL | re.MULTILINE)"
  5206. print >>preflight, "bpfile = open(bash_profile, 'r')"
  5207. print >>preflight, "bpdata = bpfile.read()"
  5208. print >>preflight, "bpfile.close()"
  5209. print >>preflight, "newbpdata = pattern.sub('', bpdata)"
  5210. print >>preflight, "if newbpdata == bpdata: sys.exit(0)"
  5211. print >>preflight, "bpfile = open(bash_profile, 'w')"
  5212. print >>preflight, "bpfile.write(newbpdata)"
  5213. print >>preflight, "bpfile.close()"
  5214. preflight.close()
  5215. oscmd("chmod +x dstroot/scripts/uninstall16/preflight")
  5216. oscmd("chmod -R 0775 dstroot/*")
  5217. # We need to be root to perform a chown. Bleh.
  5218. # Fortunately PackageMaker does it for us, on 10.5 and above.
  5219. #oscmd("chown -R root:admin dstroot/*", True)
  5220. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  5221. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  5222. pkgs = ["base", "tools", "headers", "uninstall16"]
  5223. if PkgSkip("PYTHON")==0: pkgs.append("pythoncode")
  5224. if os.path.isdir("samples"): pkgs.append("samples")
  5225. for pkg in pkgs:
  5226. plist = open("/tmp/Info_plist", "w")
  5227. plist.write(Info_plist % { "package_id" : "org.panda3d.panda3d.%s.pkg" % pkg, "version" : VERSION })
  5228. plist.close()
  5229. if not os.path.isdir("dstroot/" + pkg):
  5230. os.makedirs("dstroot/" + pkg)
  5231. if os.path.exists("/Developer/usr/bin/packagemaker"):
  5232. cmd = '/Developer/usr/bin/packagemaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg --target 10.4 --domain system --root dstroot/' + pkg + '/ --no-relocate'
  5233. if os.path.isdir("dstroot/scripts/" + pkg):
  5234. cmd += ' --scripts dstroot/scripts/' + pkg
  5235. elif os.path.exists("/Developer/Tools/packagemaker"):
  5236. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  5237. else:
  5238. exit("PackageMaker could not be found!")
  5239. oscmd(cmd)
  5240. if os.path.isfile("/tmp/Info_plist"):
  5241. oscmd("rm -f /tmp/Info_plist")
  5242. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  5243. print >>dist, '<?xml version="1.0" encoding="utf-8"?>'
  5244. print >>dist, '<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">'
  5245. print >>dist, ' <title>Panda3D</title>'
  5246. print >>dist, ' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>'
  5247. # The following script is to enable the "Uninstall 1.6.x" option only when Panda3D 1.6.x is actually installed.
  5248. print >>dist, ''' <script>
  5249. function have16installed() {
  5250. return system.files.fileExistsAtPath(my.target.mountpoint + '/Applications/Panda3D');
  5251. }</script>'''
  5252. print >>dist, ' <license language="en" mime-type="text/plain">%s</license>' % ReadFile("doc/LICENSE")
  5253. print >>dist, ' <choices-outline>'
  5254. print >>dist, ' <line choice="uninstall16"/>'
  5255. print >>dist, ' <line choice="base"/>'
  5256. print >>dist, ' <line choice="tools"/>'
  5257. if PkgSkip("PYTHON")==0:
  5258. print >>dist, ' <line choice="pythoncode"/>'
  5259. if os.path.isdir("samples"):
  5260. print >>dist, ' <line choice="samples"/>'
  5261. print >>dist, ' <line choice="headers"/>'
  5262. print >>dist, ' </choices-outline>'
  5263. print >>dist, ' <choice id="uninstall16" title="Uninstall Panda3D 1.6.x" tooltip="Uninstalls Panda3D 1.6.x before installing Panda3D %s" description="If this option is checked, Panda3D 1.6.x is removed from /Applications/Panda3D/ before the new version is installed. This is recommended to avoid library conflicts. WARNING: EVERYTHING UNDER /Applications/Panda3D WILL BE DELETED. MAKE SURE YOU HAVE BACKED UP IMPORTANT DATA!" selected="have16installed()" enabled="have16installed()" visible="have16installed()">' % VERSION
  5264. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.uninstall16.pkg"/>'
  5265. print >>dist, ' </choice>'
  5266. print >>dist, ' <choice id="base" title="Panda3D Base Installation" description="This package contains the Panda3D libraries, configuration files and models/textures that are needed to use Panda3D. Location: /Developer/Panda3D/" start_enabled="false">'
  5267. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>'
  5268. print >>dist, ' </choice>'
  5269. print >>dist, ' <choice id="tools" title="Tools" tooltip="Useful tools and model converters to help with Panda3D development" description="This package contains the various utilities that ship with Panda3D, including packaging tools, model converters, and many more. Location: /Developer/Tools/Panda3D/">'
  5270. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>'
  5271. print >>dist, ' </choice>'
  5272. if PkgSkip("PYTHON")==0:
  5273. print >>dist, ' <choice id="pythoncode" title="Python Code" tooltip="Code you\'ll need for Python development" description="This package contains the \'direct\', \'pandac\' and \'panda3d\' python packages that are needed to do Python development with Panda3D. Location: /Developer/Panda3D/">'
  5274. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>'
  5275. print >>dist, ' </choice>'
  5276. if os.path.isdir("samples"):
  5277. print >>dist, ' <choice id="samples" title="Sample Programs" tooltip="Python sample programs that use Panda3D" description="This package contains the Python sample programs that can help you with learning how to use Panda3D. Location: /Developer/Examples/Panda3D/">'
  5278. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>'
  5279. print >>dist, ' </choice>'
  5280. print >>dist, ' <choice id="headers" title="C++ Header Files" tooltip="Header files for C++ development with Panda3D" description="This package contains the C++ header files that are needed in order to do C++ development with Panda3D. You don\'t need this if you want to develop in Python. Location: /Developer/Panda3D/include/" start_selected="false">'
  5281. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>'
  5282. print >>dist, ' </choice>'
  5283. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.uninstall16.pkg" installKBytes="0" version="1" auth="Root">file:./Contents/Packages/uninstall16.pkg</pkg-ref>'
  5284. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.base.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/base.pkg</pkg-ref>' % (GetDirectorySize("dstroot/base") / 1024)
  5285. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.tools.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/tools.pkg</pkg-ref>' % (GetDirectorySize("dstroot/tools") / 1024)
  5286. if PkgSkip("PYTHON")==0:
  5287. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/pythoncode.pkg</pkg-ref>' % (GetDirectorySize("dstroot/pythoncode") / 1024)
  5288. if os.path.isdir("samples"):
  5289. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.samples.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/samples.pkg</pkg-ref>' % (GetDirectorySize("dstroot/samples") / 1024)
  5290. print >>dist, ' <pkg-ref id="org.panda3d.panda3d.headers.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/headers.pkg</pkg-ref>' % (GetDirectorySize("dstroot/headers") / 1024)
  5291. print >>dist, '</installer-script>'
  5292. dist.close()
  5293. oscmd('hdiutil create Panda3D-rw.dmg -srcfolder dstroot/Panda3D')
  5294. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o Panda3D-%s.dmg' % VERSION)
  5295. oscmd('rm -f Panda3D-rw.dmg')
  5296. def MakeInstallerFreeBSD():
  5297. import compileall
  5298. oscmd("rm -rf targetroot pkg-descr pkg-plist")
  5299. oscmd("mkdir targetroot")
  5300. # Invoke installpanda.py to install it into a temporary dir
  5301. if RUNTIME:
  5302. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  5303. else:
  5304. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  5305. if (not os.path.exists("/usr/sbin/pkg_create")):
  5306. exit("Cannot create an installer without pkg_create")
  5307. if (RUNTIME):
  5308. descr_txt = RUNTIME_INSTALLER_PKG_DESCR_FILE[1:]
  5309. else:
  5310. descr_txt = INSTALLER_PKG_DESCR_FILE[1:]
  5311. descr_txt = descr_txt.replace("VERSION", VERSION)
  5312. if (RUNTIME):
  5313. plist_txt = "@name panda3d-runtime-%s\n" % VERSION
  5314. else:
  5315. plist_txt = "@name panda3d-%s\n" % VERSION
  5316. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  5317. for f in files:
  5318. plist_txt += os.path.join(root, f)[21:] + "\n"
  5319. if (not RUNTIME):
  5320. plist_txt += "@exec /sbin/ldconfig -m /usr/local/lib\n"
  5321. plist_txt += "@unexec /sbin/ldconfig -R\n"
  5322. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  5323. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  5324. for d in dirs:
  5325. plist_txt += "@dirrm %s\n" % os.path.join(root, d)[21:]
  5326. plist_txt += "@dirrm %s\n" % remdir
  5327. WriteFile("pkg-plist", plist_txt)
  5328. WriteFile("pkg-descr", descr_txt)
  5329. cmd = "pkg_create"
  5330. if GetVerbose():
  5331. cmd += " --verbose"
  5332. if PkgSkip("PYTHON")==0:
  5333. # If this version of Python was installed from a package, let's mark it as dependency.
  5334. oscmd("rm -f %s/tmp/python-pkg.txt" % GetOutputDir())
  5335. oscmd("pkg_info -E 'python%s>=%s' > %s/tmp/python-pkg.txt" % (SDK["PYTHONVERSION"][6:9:2], SDK["PYTHONVERSION"][6:9], GetOutputDir()), True)
  5336. if (os.path.isfile(GetOutputDir() + "/tmp/python-pkg.txt")):
  5337. python_pkg = ReadFile(GetOutputDir() + "/tmp/python-pkg.txt").strip()
  5338. if (python_pkg):
  5339. cmd += " -P " + python_pkg
  5340. cmd += " -p /usr/local -S \"%s\"" % os.path.abspath("targetroot")
  5341. if (RUNTIME):
  5342. cmd += " -c -\"The Panda3D free 3D engine runtime\" -o graphics/panda3d-runtime"
  5343. else:
  5344. cmd += " -c -\"The Panda3D free 3D engine SDK\" -o devel/panda3d"
  5345. cmd += " -d pkg-descr -f pkg-plist panda3d-%s" % VERSION
  5346. oscmd(cmd)
  5347. if (INSTALLER != 0):
  5348. ProgressOutput(100.0, "Building installer")
  5349. if (sys.platform.startswith("win")):
  5350. dbg = ""
  5351. if (GetOptimize() <= 2): dbg = "-dbg"
  5352. if (is_64):
  5353. if (RUNTIME):
  5354. MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+"-x64.exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
  5355. else:
  5356. MakeInstallerNSIS("Panda3D-"+VERSION+dbg+"-x64.exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
  5357. else:
  5358. if (RUNTIME):
  5359. MakeInstallerNSIS("Panda3D-Runtime-"+VERSION+dbg+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
  5360. else:
  5361. MakeInstallerNSIS("Panda3D-"+VERSION+dbg+".exe", "Panda3D", "Panda3D "+VERSION, "C:\\Panda3D-"+VERSION)
  5362. elif (sys.platform == "linux2"):
  5363. MakeInstallerLinux()
  5364. elif (sys.platform == "darwin"):
  5365. MakeInstallerOSX()
  5366. elif (sys.platform.startswith("freebsd")):
  5367. MakeInstallerFreeBSD()
  5368. else:
  5369. exit("Do not know how to make an installer for this platform")
  5370. ##########################################################################################
  5371. #
  5372. # Print final status report.
  5373. #
  5374. ##########################################################################################
  5375. SaveDependencyCache()
  5376. MoveBackConflictingFiles()
  5377. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  5378. printStatus("Makepanda Final Status Report", WARNINGS)
  5379. print GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor()