makepanda.py 287 KB

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