makepanda.py 291 KB

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