makepanda.py 330 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as queue
  18. except:
  19. print("You are either using an incomplete or an old version of Python!")
  20. print("Please install the development package of Python 2.x and try again.")
  21. exit(1)
  22. from makepandacore import *
  23. from installpanda import *
  24. import time
  25. import os
  26. import sys
  27. ########################################################################
  28. ##
  29. ## PARSING THE COMMAND LINE OPTIONS
  30. ##
  31. ## You might be tempted to change the defaults by editing them
  32. ## here. Don't do it. Instead, create a script that compiles
  33. ## panda with your preferred options. Or, create
  34. ## a 'makepandaPreferences' file and put it into your python path.
  35. ##
  36. ########################################################################
  37. COMPILER=0
  38. INSTALLER=0
  39. WHEEL=0
  40. GENMAN=0
  41. COMPRESSOR="zlib"
  42. THREADCOUNT=0
  43. CFLAGS=""
  44. CXXFLAGS=""
  45. LDFLAGS=""
  46. RTDIST=0
  47. RTDIST_VERSION=None
  48. RUNTIME=0
  49. DISTRIBUTOR=""
  50. VERSION=None
  51. DEBVERSION=None
  52. WHLVERSION=None
  53. RPMRELEASE="1"
  54. GIT_COMMIT=None
  55. P3DSUFFIX=None
  56. MAJOR_VERSION=None
  57. COREAPI_VERSION=None
  58. PLUGIN_VERSION=None
  59. OSXTARGET=None
  60. OSX_ARCHS=[]
  61. HOST_URL=None
  62. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  63. STRDXSDKVERSION = 'default'
  64. WINDOWS_SDK = None
  65. MSVC_VERSION = None
  66. BOOUSEINTELCOMPILER = False
  67. OPENCV_VER_23 = False
  68. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  69. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  70. PkgListSet(["PYTHON", "DIRECT", # Python support
  71. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  72. "EGL", # OpenGL (ES) integration
  73. "EIGEN", # Linear algebra acceleration
  74. "OPENAL", "FMODEX", # Audio playback
  75. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  76. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  77. "SPEEDTREE", # SpeedTree
  78. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  79. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  80. "FREETYPE", "HARFBUZZ", # Text rendering
  81. "VRPN", "OPENSSL", # Transport
  82. "FFTW", # Algorithm helpers
  83. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  84. "GTK2", # GTK2 is used for PStats on Unix
  85. "MFC", "WX", "FLTK", # Used for web plug-in only
  86. "ROCKET", "AWESOMIUM", # GUI libraries
  87. "CARBON", "COCOA", # Mac OS X toolkits
  88. "X11", # Unix platform support
  89. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  90. "SKEL", # Example SKEL project
  91. "PANDAFX", # Some distortion special lenses
  92. "PANDAPARTICLESYSTEM", # Built in particle system
  93. "CONTRIB", # Experimental
  94. "SSE2", "NEON", # Compiler features
  95. ])
  96. CheckPandaSourceTree()
  97. def keyboardInterruptHandler(x,y):
  98. exit("keyboard interrupt")
  99. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  100. ########################################################################
  101. ##
  102. ## Command-line parser.
  103. ##
  104. ## You can type "makepanda --help" to see all the options.
  105. ##
  106. ########################################################################
  107. def usage(problem):
  108. if (problem):
  109. print("")
  110. print("Error parsing command-line input: %s" % (problem))
  111. print("")
  112. print("Makepanda generates a 'built' subdirectory containing a")
  113. print("compiled copy of Panda3D. Command-line arguments are:")
  114. print("")
  115. print(" --help (print the help message you're reading now)")
  116. print(" --verbose (print out more information)")
  117. print(" --runtime (build a runtime build instead of an SDK build)")
  118. print(" --installer (build an installer)")
  119. print(" --wheel (build a pip-installable .whl)")
  120. print(" --optimize X (optimization level can be 1,2,3,4)")
  121. print(" --version X (set the panda version number)")
  122. print(" --lzma (use lzma compression when building Windows installer)")
  123. print(" --distributor X (short string identifying the distributor of the build)")
  124. print(" --outputdir X (use the specified directory instead of 'built')")
  125. print(" --host URL (set the host url (runtime build only))")
  126. print(" --threads N (use the multithreaded build system. see manual)")
  127. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  128. print(" --universal (build universal binaries (OS X only))")
  129. print(" --override \"O=V\" (override dtool_config/prc option value)")
  130. print(" --static (builds libraries for static linking)")
  131. print(" --target X (experimental cross-compilation (android only))")
  132. print(" --arch X (target architecture for cross-compilation)")
  133. print("")
  134. for pkg in PkgListGet():
  135. p = pkg.lower()
  136. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  137. if sys.platform != 'win32':
  138. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  139. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  140. print("")
  141. print(" --nothing (disable every third-party lib)")
  142. print(" --everything (enable every third-party lib)")
  143. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  144. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  145. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
  146. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  147. print("")
  148. print("The simplest way to compile panda is to just type:")
  149. print("")
  150. print(" makepanda --everything")
  151. print("")
  152. os._exit(1)
  153. def parseopts(args):
  154. global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  155. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  156. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  157. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  158. longopts = [
  159. "help","distributor=","verbose","runtime","osxtarget=",
  160. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  161. "version=","lzma","no-python","threads=","outputdir=","override=",
  162. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  163. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  164. "universal", "target=", "arch=", "git-commit=", "no-directscripts",
  165. "use-touchinput", "no-touchinput"]
  166. anything = 0
  167. optimize = ""
  168. target = None
  169. target_arch = None
  170. universal = False
  171. clean_build = False
  172. for pkg in PkgListGet():
  173. longopts.append("use-" + pkg.lower())
  174. longopts.append("no-" + pkg.lower())
  175. longopts.append(pkg.lower() + "-incdir=")
  176. longopts.append(pkg.lower() + "-libdir=")
  177. try:
  178. opts, extras = getopt.getopt(args, "", longopts)
  179. for option, value in opts:
  180. if (option=="--help"): raise Exception
  181. elif (option=="--optimize"): optimize=value
  182. elif (option=="--installer"): INSTALLER=1
  183. elif (option=="--wheel"): WHEEL=1
  184. elif (option=="--verbose"): SetVerbose(True)
  185. elif (option=="--distributor"): DISTRIBUTOR=value
  186. elif (option=="--rtdist"): RTDIST=1
  187. elif (option=="--runtime"): RUNTIME=1
  188. elif (option=="--genman"): GENMAN=1
  189. elif (option=="--everything"): PkgEnableAll()
  190. elif (option=="--nothing"): PkgDisableAll()
  191. elif (option=="--threads"): THREADCOUNT=int(value)
  192. elif (option=="--outputdir"): SetOutputDir(value.strip())
  193. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  194. elif (option=="--universal"): universal = True
  195. elif (option=="--target"): target = value.strip()
  196. elif (option=="--arch"): target_arch = value.strip()
  197. elif (option=="--nocolor"): DisableColors()
  198. elif (option=="--version"):
  199. match = re.match(r'^\d+\.\d+\.\d+', value)
  200. if not match:
  201. usage("version requires three digits")
  202. WHLVERSION = value
  203. VERSION = match.group()
  204. elif (option=="--lzma"): COMPRESSOR="lzma"
  205. elif (option=="--override"): AddOverride(value.strip())
  206. elif (option=="--static"): SetLinkAllStatic(True)
  207. elif (option=="--host"): HOST_URL=value
  208. elif (option=="--debversion"): DEBVERSION=value
  209. elif (option=="--rpmrelease"): RPMRELEASE=value
  210. elif (option=="--git-commit"): GIT_COMMIT=value
  211. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  212. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  213. # Backward compatibility, OPENGL was renamed to GL
  214. elif (option=="--use-opengl"): PkgEnable("GL")
  215. elif (option=="--no-opengl"): PkgDisable("GL")
  216. elif (option=="--no-directscripts"): pass
  217. elif (option=="--directx-sdk"):
  218. STRDXSDKVERSION = value.strip().lower()
  219. if STRDXSDKVERSION == '':
  220. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  221. STRDXSDKVERSION = 'default'
  222. elif (option=="--windows-sdk"):
  223. WINDOWS_SDK = value.strip().lower()
  224. elif (option=="--msvc-version"):
  225. MSVC_VERSION = value.strip().lower()
  226. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  227. elif (option=="--clean"): clean_build = True
  228. else:
  229. for pkg in PkgListGet():
  230. if option == "--use-" + pkg.lower():
  231. PkgEnable(pkg)
  232. break
  233. elif option == "--no-" + pkg.lower():
  234. PkgDisable(pkg)
  235. break
  236. elif option == "--" + pkg.lower() + "-incdir":
  237. PkgSetCustomLocation(pkg)
  238. IncDirectory(pkg, value)
  239. break
  240. elif option == "--" + pkg.lower() + "-libdir":
  241. PkgSetCustomLocation(pkg)
  242. LibDirectory(pkg, value)
  243. break
  244. if (option == "--everything" or option.startswith("--use-")
  245. or option == "--nothing" or option.startswith("--no-")):
  246. anything = 1
  247. except:
  248. usage(sys.exc_info()[1])
  249. if not anything:
  250. if RUNTIME:
  251. PkgEnableAll()
  252. else:
  253. usage("You should specify a list of packages to use or --everything to enable all packages.")
  254. if (RTDIST and RUNTIME):
  255. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  256. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  257. elif (optimize==""): optimize = "3"
  258. if OSXTARGET:
  259. try:
  260. maj, min = OSXTARGET.strip().split('.')
  261. OSXTARGET = int(maj), int(min)
  262. assert OSXTARGET[0] == 10
  263. except:
  264. usage("Invalid setting for OSXTARGET")
  265. else:
  266. OSXTARGET = None
  267. if target is not None or target_arch is not None:
  268. SetTarget(target, target_arch)
  269. if universal:
  270. if target_arch:
  271. exit("--universal is incompatible with --arch")
  272. OSX_ARCHS.append("i386")
  273. if OSXTARGET:
  274. osxver = OSXTARGET
  275. else:
  276. maj, min = platform.mac_ver()[0].split('.')[:2]
  277. osxver = int(maj), int(min)
  278. if osxver[1] < 6:
  279. OSX_ARCHS.append("ppc")
  280. else:
  281. OSX_ARCHS.append("x86_64")
  282. elif HasTargetArch():
  283. OSX_ARCHS.append(GetTargetArch())
  284. try:
  285. SetOptimize(int(optimize))
  286. assert GetOptimize() in [1, 2, 3, 4]
  287. except:
  288. usage("Invalid setting for OPTIMIZE")
  289. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  290. usage("Invalid SHA-1 hash given for --git-commit option!")
  291. if GetTarget() == 'windows':
  292. if not MSVC_VERSION:
  293. print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
  294. MSVC_VERSION = 10
  295. try:
  296. MSVC_VERSION = int(MSVC_VERSION)
  297. except:
  298. usage("Invalid setting for --msvc-version")
  299. if not WINDOWS_SDK:
  300. print("No Windows SDK version specified. Defaulting to '7.1'.")
  301. WINDOWS_SDK = '7.1'
  302. if clean_build and os.path.isdir(GetOutputDir()):
  303. print("Deleting %s" % (GetOutputDir()))
  304. shutil.rmtree(GetOutputDir())
  305. parseopts(sys.argv[1:])
  306. ########################################################################
  307. ##
  308. ## Handle environment variables.
  309. ##
  310. ########################################################################
  311. if ("CFLAGS" in os.environ):
  312. CFLAGS = os.environ["CFLAGS"].strip()
  313. if ("CXXFLAGS" in os.environ):
  314. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  315. if ("RPM_OPT_FLAGS" in os.environ):
  316. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  317. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  318. if ("LDFLAGS" in os.environ):
  319. LDFLAGS = os.environ["LDFLAGS"].strip()
  320. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  321. if GetHost() == "darwin" and OSXTARGET is not None:
  322. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  323. ########################################################################
  324. ##
  325. ## Configure things based on the command-line parameters.
  326. ##
  327. ########################################################################
  328. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  329. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  330. if VERSION is None:
  331. if RUNTIME:
  332. VERSION = PLUGIN_VERSION
  333. else:
  334. VERSION = ParsePandaVersion("dtool/PandaVersion.pp")
  335. if WHLVERSION is None:
  336. WHLVERSION = VERSION
  337. print("Version: %s" % VERSION)
  338. if RUNTIME or RTDIST:
  339. print("Core API Version: %s" % COREAPI_VERSION)
  340. if DEBVERSION is None:
  341. DEBVERSION = VERSION
  342. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  343. if P3DSUFFIX is None:
  344. P3DSUFFIX = MAJOR_VERSION
  345. outputdir_suffix = ""
  346. if (RUNTIME or RTDIST):
  347. # Compiling Maya/Max is pointless in rtdist build
  348. for ver in MAYAVERSIONS + MAXVERSIONS:
  349. PkgDisable(ver)
  350. if (DISTRIBUTOR.strip() == ""):
  351. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  352. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  353. if (RUNTIME):
  354. outputdir_suffix += "_rt"
  355. if DISTRIBUTOR == "":
  356. DISTRIBUTOR = "makepanda"
  357. elif not RTDIST_VERSION:
  358. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  359. if not RTDIST_VERSION:
  360. RTDIST_VERSION = "dev"
  361. if not IsCustomOutputDir():
  362. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  363. outputdir_suffix += '_x64'
  364. SetOutputDir("built" + outputdir_suffix)
  365. if (RUNTIME):
  366. for pkg in PkgListGet():
  367. if pkg in ["GTK2", "MFC"]:
  368. # Optional package(s) for runtime.
  369. pass
  370. elif pkg in ["OPENSSL", "ZLIB"]:
  371. # Required packages for runtime.
  372. if (PkgSkip(pkg)==1):
  373. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  374. else:
  375. # Unused packages for runtime.
  376. PkgDisable(pkg)
  377. if (INSTALLER and RTDIST):
  378. exit("Cannot build an installer for the rtdist build!")
  379. if (WHEEL and RUNTIME):
  380. exit("Cannot build a wheel for the runtime build!")
  381. if (WHEEL and RTDIST):
  382. exit("Cannot build a wheel for the rtdist build!")
  383. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  384. exit("Cannot build installer on Windows without python")
  385. if WHEEL and PkgSkip("PYTHON"):
  386. exit("Cannot build wheel without Python")
  387. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  388. exit("Cannot build rtdist without wx or fltk")
  389. if (RUNTIME):
  390. SetLinkAllStatic(True)
  391. if not os.path.isdir("contrib"):
  392. PkgDisable("CONTRIB")
  393. ########################################################################
  394. ##
  395. ## Load the dependency cache.
  396. ##
  397. ########################################################################
  398. LoadDependencyCache()
  399. ########################################################################
  400. ##
  401. ## Locate various SDKs.
  402. ##
  403. ########################################################################
  404. MakeBuildTree()
  405. SdkLocateDirectX(STRDXSDKVERSION)
  406. SdkLocateMaya()
  407. SdkLocateMax()
  408. SdkLocateMacOSX(OSXTARGET)
  409. SdkLocatePython(RTDIST)
  410. SdkLocateWindows(WINDOWS_SDK)
  411. SdkLocatePhysX()
  412. SdkLocateSpeedTree()
  413. SdkLocateAndroid()
  414. SdkAutoDisableDirectX()
  415. SdkAutoDisableMaya()
  416. SdkAutoDisableMax()
  417. SdkAutoDisablePhysX()
  418. SdkAutoDisableSpeedTree()
  419. if RTDIST and DISTRIBUTOR == "cmu":
  420. # Some validation checks for the CMU builds.
  421. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  422. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  423. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  424. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  425. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  426. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  427. if RTDIST and not HOST_URL:
  428. exit("You must specify a host URL when building the rtdist!")
  429. if RUNTIME and not HOST_URL:
  430. # Set this to a nice default.
  431. HOST_URL = "https://runtime.panda3d.org/"
  432. ########################################################################
  433. ##
  434. ## Choose a Compiler.
  435. ##
  436. ## This should also set up any environment variables needed to make
  437. ## the compiler work.
  438. ##
  439. ########################################################################
  440. if GetHost() == 'windows' and GetTarget() == 'windows':
  441. COMPILER = "MSVC"
  442. SdkLocateVisualStudio(MSVC_VERSION)
  443. else:
  444. COMPILER = "GCC"
  445. SetupBuildEnvironment(COMPILER)
  446. ########################################################################
  447. ##
  448. ## External includes, external libraries, and external defsyms.
  449. ##
  450. ########################################################################
  451. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  452. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  453. if (COMPILER == "MSVC"):
  454. PkgDisable("X11")
  455. PkgDisable("GLES")
  456. PkgDisable("GLES2")
  457. PkgDisable("EGL")
  458. PkgDisable("CARBON")
  459. PkgDisable("COCOA")
  460. if (PkgSkip("PYTHON")==0):
  461. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  462. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  463. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  464. for pkg in PkgListGet():
  465. if (PkgSkip(pkg)==0):
  466. if (pkg[:4]=="MAYA"):
  467. IncDirectory(pkg, SDK[pkg] + "/include")
  468. DefSymbol(pkg, "MAYAVERSION", pkg)
  469. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  470. elif (pkg[:3]=="MAX"):
  471. IncDirectory(pkg, SDK[pkg] + "/include")
  472. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  473. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  474. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  475. DefSymbol(pkg, "MAX", pkg)
  476. if (int(pkg[3:]) >= 2013):
  477. DefSymbol(pkg, "UNICODE", "")
  478. DefSymbol(pkg, "_UNICODE", "")
  479. elif (pkg[:2]=="DX"):
  480. IncDirectory(pkg, SDK[pkg] + "/include")
  481. elif GetThirdpartyDir() is not None:
  482. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  483. for pkg in DXVERSIONS:
  484. if (PkgSkip(pkg)==0):
  485. vnum=pkg[2:]
  486. if GetTargetArch() == 'x64':
  487. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  488. else:
  489. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  490. LibDirectory(pkg, SDK[pkg] + '/lib')
  491. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  492. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  493. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  494. LibName(pkg, 'dxerr.lib')
  495. else:
  496. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  497. #LibName(pkg, 'ddraw.lib')
  498. LibName(pkg, 'dxguid.lib')
  499. if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
  500. # dxerr needs this for __vsnwprintf definition.
  501. LibName(pkg, 'legacy_stdio_definitions.lib')
  502. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  503. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  504. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  505. LibName("WINSOCK", "wsock32.lib")
  506. LibName("WINSOCK2", "wsock32.lib")
  507. LibName("WINSOCK2", "ws2_32.lib")
  508. LibName("WINCOMCTL", "comctl32.lib")
  509. LibName("WINCOMDLG", "comdlg32.lib")
  510. LibName("WINUSER", "user32.lib")
  511. LibName("WINMM", "winmm.lib")
  512. LibName("WINIMM", "imm32.lib")
  513. LibName("WINKERNEL", "kernel32.lib")
  514. LibName("WINOLE", "ole32.lib")
  515. LibName("WINOLEAUT", "oleaut32.lib")
  516. LibName("WINOLDNAMES", "oldnames.lib")
  517. LibName("WINSHELL", "shell32.lib")
  518. LibName("WINGDI", "gdi32.lib")
  519. LibName("ADVAPI", "advapi32.lib")
  520. LibName("IPHLPAPI", "iphlpapi.lib")
  521. LibName("GL", "opengl32.lib")
  522. LibName("GLES", "libgles_cm.lib")
  523. LibName("GLES2", "libGLESv2.lib")
  524. LibName("EGL", "libEGL.lib")
  525. LibName("MSIMG", "msimg32.lib")
  526. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  527. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  528. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  529. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  530. if (PkgSkip("OPENSSL")==0):
  531. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  532. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  533. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  534. else:
  535. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  536. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  537. if (PkgSkip("PNG")==0):
  538. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  539. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  540. else:
  541. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  542. if (PkgSkip("TIFF")==0):
  543. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  544. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  545. else:
  546. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  547. if (PkgSkip("OPENEXR")==0):
  548. suffix = ""
  549. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  550. suffix = "-2_2"
  551. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  552. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  553. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  554. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  555. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  556. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  557. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  558. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  559. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  560. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  561. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  562. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  563. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  564. if (PkgSkip("HARFBUZZ")==0): LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  565. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  566. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  567. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  568. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  569. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  570. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  571. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  572. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  573. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM",GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  574. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  575. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  576. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  577. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  578. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  579. if (PkgSkip("FCOLLADA")==0):
  580. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  581. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  582. if (PkgSkip("ASSIMP")==0):
  583. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  584. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include/assimp")
  585. if (PkgSkip("SQUISH")==0):
  586. if GetOptimize() <= 2:
  587. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  588. else:
  589. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  590. if (PkgSkip("ROCKET")==0):
  591. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  592. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  593. if (PkgSkip("PYTHON")==0):
  594. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  595. if (GetOptimize() <= 3):
  596. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  597. if (PkgSkip("OPENAL")==0):
  598. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  599. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  600. # Link OpenAL Soft statically.
  601. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  602. if (PkgSkip("ODE")==0):
  603. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  604. DefSymbol("ODE", "dSINGLE", "")
  605. if (PkgSkip("FMODEX")==0):
  606. if (GetTargetArch() == 'x64'):
  607. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  608. else:
  609. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  610. if (PkgSkip("FLTK")==0 and RTDIST):
  611. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  612. if not PkgSkip("FLTK"):
  613. # If we have fltk, we don't need wx
  614. PkgDisable("WX")
  615. if (PkgSkip("WX")==0 and RTDIST):
  616. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  617. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  618. DefSymbol("WX", "__WXMSW__", "")
  619. DefSymbol("WX", "_UNICODE", "")
  620. DefSymbol("WX", "UNICODE", "")
  621. if (PkgSkip("VORBIS")==0):
  622. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libogg_static.lib")
  623. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbis_static.lib")
  624. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbisfile_static.lib")
  625. if (PkgSkip("OPUS")==0):
  626. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libogg_static.lib")
  627. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopus_static.lib")
  628. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopusfile_static.lib")
  629. for pkg in MAYAVERSIONS:
  630. if (PkgSkip(pkg)==0):
  631. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  632. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  633. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  634. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  635. for pkg in MAXVERSIONS:
  636. if (PkgSkip(pkg)==0):
  637. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  638. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  639. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  640. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  641. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  642. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  643. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  644. if (PkgSkip("PHYSX")==0):
  645. if GetTargetArch() == 'x64':
  646. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  647. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  648. else:
  649. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  650. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  651. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  652. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  653. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  654. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  655. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  656. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  657. if (PkgSkip("SPEEDTREE")==0):
  658. if GetTargetArch() == 'x64':
  659. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  660. p64ext = '64'
  661. else:
  662. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  663. p64ext = ''
  664. debugext = ''
  665. if (GetOptimize() <= 2): debugext = "_d"
  666. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  667. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  668. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  669. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  670. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  671. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  672. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  673. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  674. LibName("SPEEDTREE", "glu32.lib")
  675. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  676. if (PkgSkip("BULLET")==0):
  677. suffix = '.lib'
  678. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  679. suffix = '_x64.lib'
  680. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  681. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  682. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  683. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  684. if (COMPILER=="GCC"):
  685. PkgDisable("AWESOMIUM")
  686. if GetTarget() != "darwin":
  687. PkgDisable("CARBON")
  688. PkgDisable("COCOA")
  689. elif RUNTIME:
  690. # We don't support Cocoa in the runtime yet.
  691. PkgDisable("COCOA")
  692. if 'x86_64' in OSX_ARCHS:
  693. # 64-bits OS X doesn't have Carbon.
  694. PkgDisable("CARBON")
  695. #if (PkgSkip("PYTHON")==0):
  696. # IncDirectory("PYTHON", SDK["PYTHON"])
  697. if (GetHost() == "darwin"):
  698. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  699. IncDirectory("FREETYPE", "/usr/X11/include")
  700. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  701. LibDirectory("FREETYPE", "/usr/X11/lib")
  702. if (GetHost() == "freebsd"):
  703. IncDirectory("ALWAYS", "/usr/local/include")
  704. LibDirectory("ALWAYS", "/usr/local/lib")
  705. if (os.path.isdir("/usr/PCBSD")):
  706. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  707. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  708. if GetTarget() != "windows":
  709. PkgDisable("DIRECTCAM")
  710. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  711. # WARNING! The order of the ffmpeg libraries matters!
  712. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  713. # Name pkg-config libs, include(dir)s
  714. if (not RUNTIME):
  715. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  716. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  717. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  718. SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp")
  719. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  720. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  721. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  722. SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
  723. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  724. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  725. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  726. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  727. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  728. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  729. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  730. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  731. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  732. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  733. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  734. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  735. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  736. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  737. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  738. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  739. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h"))
  740. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  741. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  742. if not PkgSkip("FFMPEG"):
  743. if GetTarget() == "darwin":
  744. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  745. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  746. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  747. # Needed when linking ffmpeg statically on Linux.
  748. LibName("FFMPEG", "-Wl,-Bsymbolic")
  749. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  750. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  751. if cv_lib == "opencv_core":
  752. OPENCV_VER_23 = True
  753. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  754. else:
  755. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  756. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  757. else:
  758. PkgDisable("OPENCV")
  759. rocket_libs = ("RocketCore", "RocketControls")
  760. if (GetOptimize() <= 3):
  761. rocket_libs += ("RocketDebugger",)
  762. rocket_libs += ("boost_python",)
  763. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  764. if not PkgSkip("PYTHON"):
  765. python_lib = SDK["PYTHONVERSION"]
  766. if not RTDIST:
  767. # We don't link anything in the SDK with libpython.
  768. python_lib = ""
  769. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  770. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  771. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  772. SmartPkgEnable("GTK2", "gtk+-2.0")
  773. if (RTDIST):
  774. SmartPkgEnable("WX", tool = "wx-config")
  775. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  776. if GetTarget() != 'darwin':
  777. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  778. if not PkgSkip("NVIDIACG") and not RUNTIME:
  779. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  780. if not RUNTIME:
  781. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  782. if GetHost() != "darwin":
  783. # Workaround for an issue where pkg-config does not include this path
  784. if GetTargetArch() in ("x86_64", "amd64"):
  785. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  786. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  787. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  788. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  789. if not PkgSkip("X11"):
  790. if (os.path.isdir("/usr/X11R6/lib64")):
  791. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  792. else:
  793. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  794. elif not PkgSkip("X11"):
  795. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  796. if RUNTIME:
  797. # For the runtime, these packages are required
  798. for pkg in ["OPENSSL", "ZLIB"]:
  799. skips = []
  800. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  801. skips.append(pkg)
  802. if skips:
  803. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  804. for pkg in MAYAVERSIONS:
  805. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  806. if (GetHost() == "darwin"):
  807. # Sheesh, Autodesk really can't make up their mind
  808. # regarding the location of the Maya devkit on OS X.
  809. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  810. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  811. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  812. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  813. if (os.path.isdir(SDK[pkg] + "/lib")):
  814. LibDirectory(pkg, SDK[pkg] + "/lib")
  815. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  816. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  817. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  818. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  819. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  820. IncDirectory(pkg, SDK[pkg] + "/include")
  821. else:
  822. LibDirectory(pkg, SDK[pkg] + "/lib")
  823. IncDirectory(pkg, SDK[pkg] + "/include")
  824. DefSymbol(pkg, "MAYAVERSION", pkg)
  825. if GetTarget() == 'darwin':
  826. LibName("ALWAYS", "-framework AppKit")
  827. if (PkgSkip("OPENCV")==0):
  828. LibName("OPENCV", "-framework QuickTime")
  829. LibName("AGL", "-framework AGL")
  830. LibName("CARBON", "-framework Carbon")
  831. LibName("COCOA", "-framework Cocoa")
  832. # Fix for a bug in OSX Leopard:
  833. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  834. if GetTarget() == 'android':
  835. LibName("ALWAYS", '-llog')
  836. LibName("ALWAYS", '-landroid')
  837. LibName("JNIGRAPHICS", '-ljnigraphics')
  838. for pkg in MAYAVERSIONS:
  839. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  840. if GetTarget() == 'darwin':
  841. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  842. else:
  843. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  844. LibName(pkg, "-lOpenMaya")
  845. LibName(pkg, "-lOpenMayaAnim")
  846. LibName(pkg, "-lAnimSlice")
  847. LibName(pkg, "-lDeformSlice")
  848. LibName(pkg, "-lModifiers")
  849. LibName(pkg, "-lDynSlice")
  850. LibName(pkg, "-lKinSlice")
  851. LibName(pkg, "-lModelSlice")
  852. LibName(pkg, "-lNurbsSlice")
  853. LibName(pkg, "-lPolySlice")
  854. LibName(pkg, "-lProjectSlice")
  855. LibName(pkg, "-lImage")
  856. LibName(pkg, "-lShared")
  857. LibName(pkg, "-lTranslators")
  858. LibName(pkg, "-lDataModel")
  859. LibName(pkg, "-lRenderModel")
  860. LibName(pkg, "-lNurbsEngine")
  861. LibName(pkg, "-lDependEngine")
  862. LibName(pkg, "-lCommandEngine")
  863. LibName(pkg, "-lFoundation")
  864. LibName(pkg, "-lIMFbase")
  865. if GetTarget() != 'darwin':
  866. LibName(pkg, "-lOpenMayalib")
  867. else:
  868. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  869. if (PkgSkip("PHYSX")==0):
  870. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  871. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  872. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  873. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  874. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  875. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  876. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  877. if (GetHost() == "darwin"):
  878. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  879. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  880. else:
  881. LibName("PHYSX", "-lPhysXLoader")
  882. LibName("PHYSX", "-lNxCharacter")
  883. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  884. if GetLinkAllStatic():
  885. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  886. if GetTarget() == 'android':
  887. DefSymbol("ALWAYS", "ANDROID")
  888. if not PkgSkip("EIGEN"):
  889. if GetOptimize() >= 3:
  890. if COMPILER == "MSVC":
  891. # Squeeze out a bit more performance on MSVC builds...
  892. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  893. # will turn them into runtime assertions.
  894. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  895. ########################################################################
  896. ##
  897. ## Give a Status Report on Command-Line Options
  898. ##
  899. ########################################################################
  900. def printStatus(header,warnings):
  901. if GetVerbose():
  902. print("")
  903. print("-------------------------------------------------------------------")
  904. print(header)
  905. tkeep = ""
  906. tomit = ""
  907. for x in PkgListGet():
  908. if PkgSkip(x):
  909. tomit = tomit + x + " "
  910. else:
  911. tkeep = tkeep + x + " "
  912. if RTDIST:
  913. print("Makepanda: Runtime distribution build")
  914. elif RUNTIME:
  915. print("Makepanda: Runtime build")
  916. else:
  917. print("Makepanda: Regular build")
  918. print("Makepanda: Compiler: %s" % (COMPILER))
  919. print("Makepanda: Optimize: %d" % (GetOptimize()))
  920. print("Makepanda: Keep Pkg: %s" % (tkeep))
  921. print("Makepanda: Omit Pkg: %s" % (tomit))
  922. if GENMAN:
  923. print("Makepanda: Generate API reference manual")
  924. else:
  925. print("Makepanda: Don't generate API reference manual")
  926. if GetHost() == "windows" and not RTDIST:
  927. if INSTALLER:
  928. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  929. else:
  930. print("Makepanda: Don't build installer")
  931. print("Makepanda: Version ID: %s" % (VERSION))
  932. for x in warnings:
  933. print("Makepanda: %s" % (x))
  934. print("-------------------------------------------------------------------")
  935. print("")
  936. sys.stdout.flush()
  937. ########################################################################
  938. ##
  939. ## BracketNameWithQuotes
  940. ##
  941. ########################################################################
  942. def BracketNameWithQuotes(name):
  943. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  944. if (name.startswith("-framework")): return name
  945. if (name.startswith("-dylib_file")): return name
  946. # Don't add quotes when it's not necessary.
  947. if " " not in name: return name
  948. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  949. if (name.startswith('"') and name.endswith('"')): return name
  950. else: return '"' + name + '"'
  951. ########################################################################
  952. ##
  953. ## CompileCxx
  954. ##
  955. ########################################################################
  956. def CompileCxx(obj,src,opts):
  957. ipath = GetListOption(opts, "DIR:")
  958. optlevel = GetOptimizeOption(opts)
  959. if (COMPILER=="MSVC"):
  960. if not BOOUSEINTELCOMPILER:
  961. cmd = "cl "
  962. if GetTargetArch() == 'x64':
  963. cmd += "/favor:blend "
  964. cmd += "/wd4996 /wd4275 /wd4273 "
  965. # We still target Windows XP.
  966. cmd += "/DWINVER=0x501 "
  967. # Work around a WinXP/2003 bug when using VS 2015+.
  968. if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
  969. cmd += "/Zc:threadSafeInit- "
  970. cmd += "/Fo" + obj + " /nologo /c"
  971. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  972. cmd += " /arch:SSE2"
  973. for x in ipath: cmd += " /I" + x
  974. for (opt,dir) in INCDIRECTORIES:
  975. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  976. for (opt,var,val) in DEFSYMBOLS:
  977. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  978. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  979. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  980. if (optlevel==2): cmd += " /MDd /Zi"
  981. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  982. if (optlevel==4):
  983. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  984. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  985. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  986. building = GetValueOption(opts, "BUILDING:")
  987. if (building):
  988. cmd += " /DBUILDING_" + building
  989. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  990. cmd += " /bigobj"
  991. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  992. if 'EXCEPTIONS' in opts:
  993. cmd += " /EHsc"
  994. else:
  995. cmd += " /D_HAS_EXCEPTIONS=0"
  996. if 'RTTI' not in opts:
  997. cmd += " /GR-"
  998. if GetTargetArch() == 'x64':
  999. cmd += " /DWIN64_VC /DWIN64"
  1000. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10:
  1001. # To preserve Windows XP compatibility.
  1002. cmd += " /D_USING_V110_SDK71_"
  1003. cmd += " /W3 " + BracketNameWithQuotes(src)
  1004. oscmd(cmd)
  1005. else:
  1006. cmd = "icl "
  1007. if GetTargetArch() == 'x64':
  1008. cmd += "/favor:blend "
  1009. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1010. cmd += "/DWINVER=0x501 "
  1011. cmd += "/Fo" + obj + " /c"
  1012. for x in ipath: cmd += " /I" + x
  1013. for (opt,dir) in INCDIRECTORIES:
  1014. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1015. for (opt,var,val) in DEFSYMBOLS:
  1016. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1017. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1018. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1019. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1020. # core changes from jean-claude (dec 2011)
  1021. # ----------------------------------------
  1022. # performance will be seeked at level 3 & 4
  1023. # -----------------------------------------
  1024. if (optlevel==3):
  1025. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1026. cmd += " /Ob0"
  1027. cmd += " /Qipo-" # beware of IPO !!!
  1028. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1029. ## ----------------------------------------------------------------
  1030. if (optlevel==4):
  1031. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1032. cmd += " /Qipo" # optimization multi file
  1033. # for 3 & 4 optimization levels
  1034. # -----------------------------
  1035. if (optlevel>=3):
  1036. cmd += " /fp:fast=2"
  1037. cmd += " /Qftz"
  1038. cmd += " /Qfp-speculation:fast"
  1039. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1040. cmd += " /Qprec-div-"
  1041. cmd += " /Qsimd"
  1042. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1043. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1044. cmd += " /Qparallel" # enable parallelization
  1045. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1046. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1047. ## PCH files with a .pchi filename suffix and reduce build time.
  1048. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1049. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1050. cmd += " /Qpchi-" # keep it this way!
  1051. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1052. ## ------------------------------------
  1053. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1054. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1055. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1056. ## Ctor displacement /vd0 : Disable constructor displacement.
  1057. ## Choose this option only if no class constructors or destructors call virtual functions.
  1058. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1059. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1060. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1061. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1062. ## Alternate: #pragma pointers_to_members
  1063. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1064. building = GetValueOption(opts, "BUILDING:")
  1065. if (building): cmd += " /DBUILDING_" + building
  1066. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1067. cmd += " /bigobj"
  1068. # level of warnings and optimization reports
  1069. if GetVerbose():
  1070. cmd += " /W3 " # or /W4 or /Wall
  1071. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1072. else:
  1073. cmd += " /W1 "
  1074. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1075. if GetTargetArch() == 'x64':
  1076. cmd += " /DWIN64_VC /DWIN64"
  1077. cmd += " " + BracketNameWithQuotes(src)
  1078. oscmd(cmd)
  1079. if (COMPILER=="GCC"):
  1080. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1081. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1082. for (opt, dir) in INCDIRECTORIES:
  1083. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1084. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1085. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1086. for (opt,var,val) in DEFSYMBOLS:
  1087. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1088. for x in ipath: cmd += ' -I' + x
  1089. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1090. cmd += ' -fvisibility=hidden'
  1091. # Mac-specific flags.
  1092. if GetTarget() == "darwin":
  1093. cmd += " -Wno-deprecated-declarations"
  1094. if OSXTARGET is not None:
  1095. cmd += " -isysroot " + SDK["MACOSX"]
  1096. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1097. for arch in OSX_ARCHS:
  1098. if 'NOARCH:' + arch.upper() not in opts:
  1099. cmd += " -arch %s" % arch
  1100. if "SYSROOT" in SDK:
  1101. cmd += ' --sysroot=%s -no-canonical-prefixes' % (SDK["SYSROOT"])
  1102. # Android-specific flags.
  1103. arch = GetTargetArch()
  1104. if GetTarget() == "android":
  1105. # Most of the specific optimization flags here were
  1106. # just copied from the default Android Makefiles.
  1107. cmd += ' -I%s/include' % (SDK["ANDROID_STL"])
  1108. cmd += ' -I%s/libs/%s/include' % (SDK["ANDROID_STL"], SDK["ANDROID_ABI"])
  1109. cmd += ' -ffunction-sections -funwind-tables'
  1110. if arch == 'armv7a':
  1111. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1112. cmd += ' -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1113. elif arch == 'arm':
  1114. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1115. cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float'
  1116. elif arch == 'mips':
  1117. cmd += ' -finline-functions -fmessage-length=0'
  1118. cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
  1119. cmd += ' -frerun-cse-after-loop -frename-registers'
  1120. cmd += " -Wa,--noexecstack"
  1121. # Now add specific release/debug flags.
  1122. if optlevel >= 3:
  1123. cmd += " -fomit-frame-pointer"
  1124. if arch.startswith('arm'):
  1125. cmd += ' -finline-limit=64 -mthumb'
  1126. elif arch == 'mips':
  1127. cmd += ' -funswitch-loops -finline-limit=300'
  1128. else:
  1129. cmd += ' -fno-omit-frame-pointer'
  1130. if arch.startswith('arm'):
  1131. cmd += ' -marm'
  1132. # Enable SIMD instructions if requested
  1133. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1134. cmd += ' -mfpu=neon'
  1135. else:
  1136. cmd += " -pthread"
  1137. if not src.endswith(".c"):
  1138. # We don't use exceptions for most modules.
  1139. if 'EXCEPTIONS' in opts:
  1140. cmd += " -fexceptions"
  1141. else:
  1142. cmd += " -fno-exceptions"
  1143. if src.endswith(".mm"):
  1144. # Work around Apple compiler bug.
  1145. cmd += " -U__EXCEPTIONS"
  1146. if 'RTTI' not in opts:
  1147. # We always disable RTTI on Android for memory usage reasons.
  1148. if optlevel >= 4 or GetTarget() == "android":
  1149. cmd += " -fno-rtti"
  1150. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"):
  1151. cmd += " -msse2"
  1152. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1153. cmd += " -fno-strict-aliasing"
  1154. if optlevel >= 3:
  1155. cmd += " -ffast-math -fno-stack-protector"
  1156. if optlevel == 3:
  1157. # Fast math is nice, but we'd like to see NaN in dev builds.
  1158. cmd += " -fno-finite-math-only"
  1159. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1160. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1161. if (optlevel==3): cmd += " -O2"
  1162. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1163. if src.endswith(".c"):
  1164. cmd += ' ' + CFLAGS
  1165. else:
  1166. cmd += ' ' + CXXFLAGS
  1167. cmd = cmd.rstrip()
  1168. building = GetValueOption(opts, "BUILDING:")
  1169. if (building): cmd += " -DBUILDING_" + building
  1170. cmd += ' ' + BracketNameWithQuotes(src)
  1171. oscmd(cmd)
  1172. ########################################################################
  1173. ##
  1174. ## CompileBison
  1175. ##
  1176. ########################################################################
  1177. def CompileBison(wobj, wsrc, opts):
  1178. ifile = os.path.basename(wsrc)
  1179. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1180. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1181. pre = GetValueOption(opts, "BISONPREFIX_")
  1182. bison = GetBison()
  1183. if bison is None:
  1184. # We don't have bison. See if there is a prebuilt file.
  1185. base, ext = os.path.splitext(wsrc)
  1186. if os.path.isfile(base + '.h.prebuilt') and \
  1187. os.path.isfile(base + '.cxx.prebuilt'):
  1188. CopyFile(wdstc, base + '.cxx.prebuilt')
  1189. CopyFile(wdsth, base + '.h.prebuilt')
  1190. else:
  1191. exit('Could not find bison!')
  1192. else:
  1193. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1194. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1195. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1196. # Finally, compile the generated source file.
  1197. CompileCxx(wobj,wdstc,opts)
  1198. ########################################################################
  1199. ##
  1200. ## CompileFlex
  1201. ##
  1202. ########################################################################
  1203. def CompileFlex(wobj,wsrc,opts):
  1204. ifile = os.path.basename(wsrc)
  1205. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1206. pre = GetValueOption(opts, "BISONPREFIX_")
  1207. dashi = opts.count("FLEXDASHI")
  1208. flex = GetFlex()
  1209. if flex is None:
  1210. # We don't have flex. See if there is a prebuilt file.
  1211. base, ext = os.path.splitext(wsrc)
  1212. if os.path.isfile(base + '.cxx.prebuilt'):
  1213. CopyFile(wdst, base + '.cxx.prebuilt')
  1214. else:
  1215. exit('Could not find flex!')
  1216. else:
  1217. if (dashi):
  1218. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1219. else:
  1220. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1221. # Finally, compile the generated source file.
  1222. CompileCxx(wobj,wdst,opts)
  1223. ########################################################################
  1224. ##
  1225. ## CompileIgate
  1226. ##
  1227. ########################################################################
  1228. def CompileIgate(woutd,wsrc,opts):
  1229. outbase = os.path.basename(woutd)[:-3]
  1230. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1231. wobj = FindLocation(outbase + "_igate.obj", [])
  1232. srcdir = GetValueOption(opts, "SRCDIR:")
  1233. module = GetValueOption(opts, "IMOD:")
  1234. library = GetValueOption(opts, "ILIB:")
  1235. ipath = GetListOption(opts, "DIR:")
  1236. if (PkgSkip("PYTHON")):
  1237. WriteFile(woutc, "")
  1238. WriteFile(woutd, "")
  1239. ConditionalWriteFile(woutd, "")
  1240. return (wobj, woutc, opts)
  1241. if not CrossCompiling():
  1242. # If we're compiling for this platform, we can use the one we've built.
  1243. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1244. else:
  1245. # Assume that interrogate is on the PATH somewhere.
  1246. cmd = 'interrogate'
  1247. if GetVerbose():
  1248. cmd += ' -v'
  1249. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1250. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1251. if (COMPILER=="MSVC"):
  1252. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1253. if GetTargetArch() == 'x64':
  1254. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1255. else:
  1256. cmd += ' -D_M_IX86'
  1257. # NOTE: this 1600 value is the version number for VC2010.
  1258. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1259. if (COMPILER=="GCC"):
  1260. cmd += ' -D__attribute__\(x\)='
  1261. if GetTargetArch() in ("x86_64", "amd64"):
  1262. cmd += ' -D_LP64'
  1263. else:
  1264. cmd += ' -D__i386__'
  1265. if GetTarget() == 'darwin':
  1266. cmd += ' -D__APPLE__'
  1267. optlevel = GetOptimizeOption(opts)
  1268. if (optlevel==1): cmd += ' -D_DEBUG'
  1269. if (optlevel==2): cmd += ' -D_DEBUG'
  1270. if (optlevel==3): pass
  1271. if (optlevel==4): cmd += ' -DNDEBUG'
  1272. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1273. cmd += ' -fnames -string -refcount -assert -python-native'
  1274. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1275. # Add -I, -S and -D flags
  1276. for x in ipath:
  1277. cmd += ' -I' + BracketNameWithQuotes(x)
  1278. for (opt,dir) in INCDIRECTORIES:
  1279. if (opt=="ALWAYS") or (opt in opts):
  1280. cmd += ' -S' + BracketNameWithQuotes(dir)
  1281. for (opt,var,val) in DEFSYMBOLS:
  1282. if (opt=="ALWAYS") or (opt in opts):
  1283. cmd += ' -D' + var + '=' + val
  1284. #building = GetValueOption(opts, "BUILDING:")
  1285. #if (building): cmd += " -DBUILDING_"+building
  1286. cmd += ' -module ' + module + ' -library ' + library
  1287. for x in wsrc:
  1288. if (x.startswith("/")):
  1289. cmd += ' ' + BracketNameWithQuotes(x)
  1290. else:
  1291. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1292. oscmd(cmd)
  1293. return (wobj, woutc, opts)
  1294. ########################################################################
  1295. ##
  1296. ## CompileImod
  1297. ##
  1298. ########################################################################
  1299. def CompileImod(wobj, wsrc, opts):
  1300. module = GetValueOption(opts, "IMOD:")
  1301. library = GetValueOption(opts, "ILIB:")
  1302. if (COMPILER=="MSVC"):
  1303. woutc = wobj[:-4]+".cxx"
  1304. if (COMPILER=="GCC"):
  1305. woutc = wobj[:-2]+".cxx"
  1306. if (PkgSkip("PYTHON")):
  1307. WriteFile(woutc, "")
  1308. CompileCxx(wobj, woutc, opts)
  1309. return
  1310. if not CrossCompiling():
  1311. # If we're compiling for this platform, we can use the one we've built.
  1312. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1313. else:
  1314. # Assume that interrogate_module is on the PATH somewhere.
  1315. cmd = 'interrogate_module'
  1316. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1317. importmod = GetValueOption(opts, "IMPORT:")
  1318. if importmod:
  1319. cmd += ' -import ' + importmod
  1320. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1321. oscmd(cmd)
  1322. CompileCxx(wobj,woutc,opts)
  1323. return
  1324. ########################################################################
  1325. ##
  1326. ## CompileLib
  1327. ##
  1328. ########################################################################
  1329. def CompileLib(lib, obj, opts):
  1330. if (COMPILER=="MSVC"):
  1331. if not BOOUSEINTELCOMPILER:
  1332. #Use MSVC Linker
  1333. cmd = 'link /lib /nologo'
  1334. if GetOptimizeOption(opts) == 4:
  1335. cmd += " /LTCG"
  1336. if HasTargetArch():
  1337. cmd += " /MACHINE:" + GetTargetArch().upper()
  1338. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1339. for x in obj:
  1340. if not x.endswith('.lib'):
  1341. cmd += ' ' + BracketNameWithQuotes(x)
  1342. oscmd(cmd)
  1343. else:
  1344. # Choose Intel linker; from Jean-Claude
  1345. cmd = 'xilink /verbose:lib /lib '
  1346. if HasTargetArch():
  1347. cmd += " /MACHINE:" + GetTargetArch().upper()
  1348. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1349. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1350. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1351. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1352. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1353. oscmd(cmd)
  1354. if (COMPILER=="GCC"):
  1355. if GetTarget() == 'darwin':
  1356. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1357. else:
  1358. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1359. for x in obj:
  1360. cmd += ' ' + BracketNameWithQuotes(x)
  1361. oscmd(cmd)
  1362. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1363. ########################################################################
  1364. ##
  1365. ## CompileLink
  1366. ##
  1367. ########################################################################
  1368. def CompileLink(dll, obj, opts):
  1369. if (COMPILER=="MSVC"):
  1370. if not BOOUSEINTELCOMPILER:
  1371. cmd = "link /nologo "
  1372. if HasTargetArch():
  1373. cmd += " /MACHINE:" + GetTargetArch().upper()
  1374. if ("MFC" not in opts):
  1375. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1376. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1377. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1378. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1379. optlevel = GetOptimizeOption(opts)
  1380. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1381. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1382. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1383. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1384. if ("MFC" in opts):
  1385. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1386. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1387. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1388. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1389. if not PkgSkip("PYTHON"):
  1390. # If we're building without Python, don't pick it up implicitly.
  1391. if "PYTHON" not in opts:
  1392. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1393. if optlevel <= 2:
  1394. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1395. else:
  1396. cmd += ' /NOD:{}.lib'.format(pythonv)
  1397. # Yes, we know we are importing "locally defined symbols".
  1398. for x in obj:
  1399. if x.endswith('libp3pystub.lib'):
  1400. cmd += ' /ignore:4049,4217'
  1401. break
  1402. # Set the subsystem. Specify that we want to target Windows XP.
  1403. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1404. cmd += " /SUBSYSTEM:" + subsystem
  1405. if GetTargetArch() == 'x64':
  1406. cmd += ",5.02"
  1407. else:
  1408. cmd += ",5.01"
  1409. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1410. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1411. for (opt, dir) in LIBDIRECTORIES:
  1412. if (opt=="ALWAYS") or (opt in opts):
  1413. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1414. for x in obj:
  1415. if x.endswith(".dll") or x.endswith(".pyd"):
  1416. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1417. elif x.endswith(".lib"):
  1418. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1419. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1420. exit("Error: in makepanda, specify "+dname+", not "+x)
  1421. cmd += ' ' + BracketNameWithQuotes(x)
  1422. elif x.endswith(".def"):
  1423. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1424. elif x.endswith(".dat"):
  1425. pass
  1426. else:
  1427. cmd += ' ' + BracketNameWithQuotes(x)
  1428. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1429. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1430. for (opt, name) in LIBNAMES:
  1431. if (opt=="ALWAYS") or (opt in opts):
  1432. cmd += " " + BracketNameWithQuotes(name)
  1433. oscmd(cmd)
  1434. else:
  1435. cmd = "xilink"
  1436. if GetVerbose(): cmd += " /verbose:lib"
  1437. if HasTargetArch():
  1438. cmd += " /MACHINE:" + GetTargetArch().upper()
  1439. if ("MFC" not in opts):
  1440. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1441. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1442. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1443. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1444. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1445. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1446. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1447. optlevel = GetOptimizeOption(opts)
  1448. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1449. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1450. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1451. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1452. if ("MFC" in opts):
  1453. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1454. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1455. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1456. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1457. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1458. if subsystem:
  1459. cmd += " /SUBSYSTEM:" + subsystem
  1460. if dll.endswith(".dll"):
  1461. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1462. for (opt, dir) in LIBDIRECTORIES:
  1463. if (opt=="ALWAYS") or (opt in opts):
  1464. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1465. for x in obj:
  1466. if x.endswith(".dll") or x.endswith(".pyd"):
  1467. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1468. elif x.endswith(".lib"):
  1469. dname = os.path.splitext(dll)[0]+".dll"
  1470. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1471. exit("Error: in makepanda, specify "+dname+", not "+x)
  1472. cmd += ' ' + BracketNameWithQuotes(x)
  1473. elif x.endswith(".def"):
  1474. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1475. elif x.endswith(".dat"):
  1476. pass
  1477. else:
  1478. cmd += ' ' + BracketNameWithQuotes(x)
  1479. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1480. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1481. for (opt, name) in LIBNAMES:
  1482. if (opt=="ALWAYS") or (opt in opts):
  1483. cmd += " " + BracketNameWithQuotes(name)
  1484. oscmd(cmd)
  1485. if COMPILER == "GCC":
  1486. cxx = GetCXX()
  1487. if GetOrigExt(dll) == ".exe" and GetTarget() != 'android':
  1488. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1489. else:
  1490. if (GetTarget() == "darwin"):
  1491. cmd = cxx + ' -undefined dynamic_lookup'
  1492. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1493. cmd += ' -bundle '
  1494. else:
  1495. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1496. cmd += ' -dynamiclib -install_name ' + install_name
  1497. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1498. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1499. else:
  1500. cmd = cxx + ' -shared'
  1501. if "MODULE" not in opts or GetTarget() == 'android':
  1502. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1503. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1504. for x in obj:
  1505. if GetOrigExt(x) != ".dat":
  1506. cmd += ' ' + x
  1507. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1508. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1509. # Mac OS X specific flags.
  1510. if GetTarget() == 'darwin':
  1511. cmd += " -headerpad_max_install_names"
  1512. if OSXTARGET is not None:
  1513. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1514. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1515. for arch in OSX_ARCHS:
  1516. if 'NOARCH:' + arch.upper() not in opts:
  1517. cmd += " -arch %s" % arch
  1518. elif GetTarget() == 'android':
  1519. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1520. if GetTargetArch() == 'armv7a':
  1521. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1522. cmd += ' -lc -lm'
  1523. else:
  1524. cmd += " -pthread"
  1525. if "SYSROOT" in SDK:
  1526. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1527. if LDFLAGS != "":
  1528. cmd += " " + LDFLAGS
  1529. # Don't link libraries with Python.
  1530. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST:
  1531. opts = opts[:]
  1532. opts.remove("PYTHON")
  1533. for (opt, dir) in LIBDIRECTORIES:
  1534. if (opt=="ALWAYS") or (opt in opts):
  1535. cmd += ' -L' + BracketNameWithQuotes(dir)
  1536. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1537. if (opt=="ALWAYS") or (opt in opts):
  1538. cmd += ' -F' + BracketNameWithQuotes(dir)
  1539. for (opt, name) in LIBNAMES:
  1540. if (opt=="ALWAYS") or (opt in opts):
  1541. cmd += ' ' + BracketNameWithQuotes(name)
  1542. if GetTarget() != 'freebsd':
  1543. cmd += " -ldl"
  1544. oscmd(cmd)
  1545. if GetTarget() == 'android':
  1546. # Copy the library to built/libs/$ANDROID_ABI and strip it.
  1547. # This is the format that Android NDK projects should use.
  1548. new_path = '%s/libs/%s/%s' % (GetOutputDir(), SDK["ANDROID_ABI"], os.path.basename(dll))
  1549. CopyFile(new_path, dll)
  1550. oscmd('%s --strip-unneeded %s' % (GetStrip(), BracketNameWithQuotes(new_path)))
  1551. elif (GetOptimizeOption(opts)==4 and GetTarget() == 'linux'):
  1552. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1553. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1554. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1555. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1556. if os.path.isfile(newdll):
  1557. os.remove(newdll)
  1558. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1559. elif dll.endswith("." + MAJOR_VERSION):
  1560. newdll = dll[:-len(MAJOR_VERSION)-1]
  1561. if os.path.isfile(newdll):
  1562. os.remove(newdll)
  1563. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1564. ##########################################################################################
  1565. #
  1566. # CompileEgg
  1567. #
  1568. ##########################################################################################
  1569. def CompileEgg(eggfile, src, opts):
  1570. pz = False
  1571. if eggfile.endswith(".pz"):
  1572. pz = True
  1573. eggfile = eggfile[:-3]
  1574. # Determine the location of the pzip and flt2egg tools.
  1575. if CrossCompiling():
  1576. # We may not be able to use our generated versions of these tools,
  1577. # so we'll expect them to already be present in the PATH.
  1578. pzip = 'pzip'
  1579. flt2egg = 'flt2egg'
  1580. else:
  1581. # If we're compiling for this machine, we can use the binaries we've built.
  1582. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1583. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1584. if not os.path.isfile(pzip):
  1585. pzip = 'pzip'
  1586. if not os.path.isfile(flt2egg):
  1587. flt2egg = 'flt2egg'
  1588. if src.endswith(".egg"):
  1589. CopyFile(eggfile, src)
  1590. elif src.endswith(".flt"):
  1591. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1592. if pz:
  1593. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1594. ##########################################################################################
  1595. #
  1596. # CompileRes, CompileRsrc
  1597. #
  1598. ##########################################################################################
  1599. def CompileRes(target, src, opts):
  1600. """Compiles a Windows .rc file into a .res file."""
  1601. ipath = GetListOption(opts, "DIR:")
  1602. if (COMPILER == "MSVC"):
  1603. cmd = "rc"
  1604. cmd += " /Fo" + BracketNameWithQuotes(target)
  1605. for x in ipath: cmd += " /I" + x
  1606. for (opt,dir) in INCDIRECTORIES:
  1607. if (opt=="ALWAYS") or (opt in opts):
  1608. cmd += " /I" + BracketNameWithQuotes(dir)
  1609. for (opt,var,val) in DEFSYMBOLS:
  1610. if (opt=="ALWAYS") or (opt in opts):
  1611. cmd += " /D" + var + "=" + val
  1612. cmd += " " + BracketNameWithQuotes(src)
  1613. else:
  1614. cmd = "windres"
  1615. for x in ipath: cmd += " -I" + x
  1616. for (opt,dir) in INCDIRECTORIES:
  1617. if (opt=="ALWAYS") or (opt in opts):
  1618. cmd += " -I" + BracketNameWithQuotes(dir)
  1619. for (opt,var,val) in DEFSYMBOLS:
  1620. if (opt=="ALWAYS") or (opt in opts):
  1621. cmd += " -D" + var + "=" + val
  1622. cmd += " -i " + BracketNameWithQuotes(src)
  1623. cmd += " -o " + BracketNameWithQuotes(target)
  1624. oscmd(cmd)
  1625. def CompileRsrc(target, src, opts):
  1626. """Compiles a Mac OS .r file into an .rsrc file."""
  1627. ipath = GetListOption(opts, "DIR:")
  1628. if os.path.isfile("/usr/bin/Rez"):
  1629. cmd = "Rez -useDF"
  1630. else:
  1631. cmd = "/Developer/Tools/Rez -useDF"
  1632. cmd += " -o " + BracketNameWithQuotes(target)
  1633. for x in ipath:
  1634. cmd += " -i " + x
  1635. for (opt,dir) in INCDIRECTORIES:
  1636. if (opt=="ALWAYS") or (opt in opts):
  1637. cmd += " -i " + BracketNameWithQuotes(dir)
  1638. for (opt,var,val) in DEFSYMBOLS:
  1639. if (opt=="ALWAYS") or (opt in opts):
  1640. if (val == ""):
  1641. cmd += " -d " + var
  1642. else:
  1643. cmd += " -d " + var + " = " + val
  1644. cmd += " " + BracketNameWithQuotes(src)
  1645. oscmd(cmd)
  1646. ##########################################################################################
  1647. #
  1648. # FreezePy
  1649. #
  1650. ##########################################################################################
  1651. def FreezePy(target, inputs, opts):
  1652. assert len(inputs) > 0
  1653. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1654. if sys.version_info >= (2, 6):
  1655. cmdstr += "-B "
  1656. cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py")
  1657. if 'FREEZE_STARTUP' in opts:
  1658. cmdstr += " -s"
  1659. if GetOrigExt(target) == '.exe':
  1660. src = inputs.pop(0)
  1661. else:
  1662. src = ""
  1663. for i in inputs:
  1664. i = os.path.splitext(i)[0]
  1665. i = i.replace('/', '.')
  1666. if i.startswith('direct.src'):
  1667. i = i.replace('.src.', '.')
  1668. cmdstr += " -i " + i
  1669. cmdstr += " -o " + target + " " + src
  1670. if ("LINK_PYTHON_STATIC" in opts):
  1671. os.environ["LINK_PYTHON_STATIC"] = "1"
  1672. oscmd(cmdstr)
  1673. if ("LINK_PYTHON_STATIC" in os.environ):
  1674. del os.environ["LINK_PYTHON_STATIC"]
  1675. if (not os.path.exists(target)):
  1676. exit("FREEZER_ERROR")
  1677. ##########################################################################################
  1678. #
  1679. # Package
  1680. #
  1681. ##########################################################################################
  1682. def Package(target, inputs, opts):
  1683. assert len(inputs) == 1
  1684. # Invoke the ppackage script.
  1685. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1686. if GetOptimizeOption(opts) >= 4:
  1687. command += "-OO "
  1688. if sys.version_info >= (2, 6):
  1689. command += "-B "
  1690. command += "direct/src/p3d/ppackage.py"
  1691. if not RTDIST:
  1692. # Don't compile Python sources, because we might not running in the same
  1693. # Python version as the selected host.
  1694. command += " -N"
  1695. if GetTarget() == "darwin":
  1696. if SDK.get("MACOSX"):
  1697. command += " -R \"%s\"" % SDK["MACOSX"]
  1698. for arch in OSX_ARCHS:
  1699. if arch == "x86_64":
  1700. arch = "amd64"
  1701. command += " -P osx_%s" % arch
  1702. command += " -i \"" + GetOutputDir() + "/stage\""
  1703. if (P3DSUFFIX):
  1704. command += ' -a "' + P3DSUFFIX + '"'
  1705. command += " " + inputs[0]
  1706. if GetOrigExt(target) == '.p3d':
  1707. # Build a specific .p3d file.
  1708. basename = os.path.basename(os.path.splitext(target)[0])
  1709. command += " " + basename
  1710. oscmd(command)
  1711. if GetTarget() == 'windows':
  1712. # Make an .exe that calls this .p3d.
  1713. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1714. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1715. exefile = FindLocation(basename + '.exe', [])
  1716. CompileLink(exefile, [objfile], ['ADVAPI'])
  1717. # Move it to the bin directory.
  1718. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1719. if sys.platform != 'win32':
  1720. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1721. else:
  1722. # This is presumably a package or set of packages.
  1723. oscmd(command)
  1724. ##########################################################################################
  1725. #
  1726. # CompileBundle
  1727. #
  1728. ##########################################################################################
  1729. def CompileBundle(target, inputs, opts):
  1730. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1731. plist = None
  1732. resources = []
  1733. objects = []
  1734. for i in inputs:
  1735. if (i.endswith(".plist")):
  1736. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1737. plist = i
  1738. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1739. resources.append(i)
  1740. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1741. objects.append(i)
  1742. else:
  1743. exit("Don't know how to bundle file %s" % i)
  1744. # Now link the object files to form the bundle.
  1745. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1746. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1747. oscmd("rm -rf %s" % target)
  1748. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1749. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1750. if target.endswith(".app"):
  1751. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1752. else:
  1753. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1754. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1755. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1756. for r in resources:
  1757. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1758. ##########################################################################################
  1759. #
  1760. # CompileMIDL
  1761. #
  1762. ##########################################################################################
  1763. def CompileMIDL(target, src, opts):
  1764. ipath = GetListOption(opts, "DIR:")
  1765. if (COMPILER=="MSVC"):
  1766. cmd = "midl"
  1767. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1768. for x in ipath: cmd += " /I" + x
  1769. for (opt,dir) in INCDIRECTORIES:
  1770. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1771. for (opt,var,val) in DEFSYMBOLS:
  1772. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1773. cmd += " " + BracketNameWithQuotes(src)
  1774. oscmd(cmd)
  1775. ##########################################################################################
  1776. #
  1777. # CompileAnything
  1778. #
  1779. ##########################################################################################
  1780. def CompileAnything(target, inputs, opts, progress = None):
  1781. if (opts.count("DEPENDENCYONLY")):
  1782. return
  1783. if (len(inputs)==0):
  1784. exit("No input files for target "+target)
  1785. infile = inputs[0]
  1786. origsuffix = GetOrigExt(target)
  1787. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1788. # It must be a simple copy operation.
  1789. ProgressOutput(progress, "Copying file", target)
  1790. CopyFile(target, infile)
  1791. if (origsuffix==".exe" and GetHost() != "windows"):
  1792. os.system("chmod +x \"%s\"" % target)
  1793. return
  1794. elif (infile.endswith(".py")):
  1795. if origsuffix == ".obj":
  1796. source = os.path.splitext(target)[0] + ".c"
  1797. SetOrigExt(source, ".c")
  1798. ProgressOutput(progress, "Building frozen source", source)
  1799. FreezePy(source, inputs, opts)
  1800. ProgressOutput(progress, "Building C++ object", target)
  1801. return CompileCxx(target, source, opts)
  1802. if origsuffix == ".exe":
  1803. ProgressOutput(progress, "Building frozen executable", target)
  1804. else:
  1805. ProgressOutput(progress, "Building frozen library", target)
  1806. return FreezePy(target, inputs, opts)
  1807. elif (infile.endswith(".idl")):
  1808. ProgressOutput(progress, "Compiling MIDL file", infile)
  1809. return CompileMIDL(target, infile, opts)
  1810. elif (infile.endswith(".pdef")):
  1811. if origsuffix == '.p3d':
  1812. ProgressOutput(progress, "Building package", target)
  1813. else:
  1814. ProgressOutput(progress, "Building package from pdef file", infile)
  1815. return Package(target, inputs, opts)
  1816. elif origsuffix in SUFFIX_LIB:
  1817. ProgressOutput(progress, "Linking static library", target)
  1818. return CompileLib(target, inputs, opts)
  1819. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1820. if (origsuffix==".exe"):
  1821. ProgressOutput(progress, "Linking executable", target)
  1822. else:
  1823. ProgressOutput(progress, "Linking dynamic library", target)
  1824. # Add version number to the dynamic library, on unix
  1825. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  1826. tplatform = GetTarget()
  1827. if tplatform == "darwin":
  1828. # On Mac, libraries are named like libpanda.1.2.dylib
  1829. if target.lower().endswith(".dylib"):
  1830. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1831. SetOrigExt(target, origsuffix)
  1832. elif tplatform != "windows" and tplatform != "android":
  1833. # On Linux, libraries are named like libpanda.so.1.2
  1834. target += "." + MAJOR_VERSION
  1835. SetOrigExt(target, origsuffix)
  1836. return CompileLink(target, inputs, opts)
  1837. elif (origsuffix==".in"):
  1838. ProgressOutput(progress, "Building Interrogate database", target)
  1839. args = CompileIgate(target, inputs, opts)
  1840. ProgressOutput(progress, "Building C++ object", args[0])
  1841. return CompileCxx(*args)
  1842. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  1843. ProgressOutput(progress, "Building plugin bundle", target)
  1844. return CompileBundle(target, inputs, opts)
  1845. elif (origsuffix==".app"):
  1846. ProgressOutput(progress, "Building application bundle", target)
  1847. return CompileBundle(target, inputs, opts)
  1848. elif (origsuffix==".pz"):
  1849. ProgressOutput(progress, "Compressing", target)
  1850. return CompileEgg(target, infile, opts)
  1851. elif (origsuffix==".egg"):
  1852. ProgressOutput(progress, "Converting", target)
  1853. return CompileEgg(target, infile, opts)
  1854. elif (origsuffix==".res"):
  1855. ProgressOutput(progress, "Building resource object", target)
  1856. return CompileRes(target, infile, opts)
  1857. elif (origsuffix==".rsrc"):
  1858. ProgressOutput(progress, "Building resource object", target)
  1859. return CompileRsrc(target, infile, opts)
  1860. elif (origsuffix==".obj"):
  1861. if (infile.endswith(".cxx")):
  1862. ProgressOutput(progress, "Building C++ object", target)
  1863. return CompileCxx(target, infile, opts)
  1864. elif (infile.endswith(".c")):
  1865. ProgressOutput(progress, "Building C object", target)
  1866. return CompileCxx(target, infile, opts)
  1867. elif (infile.endswith(".mm")):
  1868. ProgressOutput(progress, "Building Objective-C++ object", target)
  1869. return CompileCxx(target, infile, opts)
  1870. elif (infile.endswith(".yxx")):
  1871. ProgressOutput(progress, "Building Bison object", target)
  1872. return CompileBison(target, infile, opts)
  1873. elif (infile.endswith(".lxx")):
  1874. ProgressOutput(progress, "Building Flex object", target)
  1875. return CompileFlex(target, infile, opts)
  1876. elif (infile.endswith(".in")):
  1877. ProgressOutput(progress, "Building Interrogate object", target)
  1878. return CompileImod(target, inputs, opts)
  1879. elif (infile.endswith(".rc")):
  1880. ProgressOutput(progress, "Building resource object", target)
  1881. return CompileRes(target, infile, opts)
  1882. elif (infile.endswith(".r")):
  1883. ProgressOutput(progress, "Building resource object", target)
  1884. return CompileRsrc(target, infile, opts)
  1885. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1886. ##########################################################################################
  1887. #
  1888. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1889. #
  1890. ##########################################################################################
  1891. DTOOL_CONFIG=[
  1892. #_Variable_________________________Windows___________________Unix__________
  1893. ("HAVE_PYTHON", '1', '1'),
  1894. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1895. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1896. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1897. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1898. ("HAVE_MAYA", '1', '1'),
  1899. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1900. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1901. ("USE_PANDAFILESTREAM", '1', '1'),
  1902. ("USE_DELETED_CHAIN", '1', '1'),
  1903. ("HAVE_GLX", 'UNDEF', '1'),
  1904. ("HAVE_WGL", '1', 'UNDEF'),
  1905. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1906. ("HAVE_THREADS", '1', '1'),
  1907. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1908. ("OS_SIMPLE_THREADS", '1', '1'),
  1909. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1910. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1911. ("HAVE_AUDIO", '1', '1'),
  1912. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1913. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1914. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  1915. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1916. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  1917. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  1918. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1919. ("DO_PIPELINING", '1', '1'),
  1920. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1921. ("DEFAULT_PATHSEP", '";"', '":"'),
  1922. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1923. ("HAVE_NAMESPACE", '1', '1'),
  1924. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1925. ("HAVE_LOCKF", '1', '1'),
  1926. ("HAVE_WCHAR_T", '1', '1'),
  1927. ("HAVE_WSTRING", '1', '1'),
  1928. ("HAVE_TYPENAME", '1', '1'),
  1929. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1930. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1931. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1932. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1933. ("HAVE_GETOPT", 'UNDEF', '1'),
  1934. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1935. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1936. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1937. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1938. ("HAVE_STREAMSIZE", '1', '1'),
  1939. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1940. ("HAVE_IOS_BINARY", '1', '1'),
  1941. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1942. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1943. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1944. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1945. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1946. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1947. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1948. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1949. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1950. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1951. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1952. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1953. ("PHAVE_IO_H", '1', 'UNDEF'),
  1954. ("PHAVE_IOSTREAM", '1', '1'),
  1955. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1956. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1957. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1958. ("PHAVE_MALLOC_H", '1', '1'),
  1959. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1960. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1961. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1962. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1963. ("PHAVE_SSTREAM", '1', '1'),
  1964. ("PHAVE_NEW", '1', '1'),
  1965. ("PHAVE_SYS_TYPES_H", '1', '1'),
  1966. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  1967. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  1968. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  1969. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  1970. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  1971. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  1972. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  1973. ("PHAVE_STDINT_H", '1', '1'),
  1974. ("HAVE_RTTI", '1', '1'),
  1975. ("HAVE_X11", 'UNDEF', '1'),
  1976. ("IS_LINUX", 'UNDEF', '1'),
  1977. ("IS_OSX", 'UNDEF', 'UNDEF'),
  1978. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  1979. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  1980. ("LINMATH_ALIGN", '1', '1'),
  1981. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  1982. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  1983. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  1984. ("PHAVE_JPEGINT_H", '1', '1'),
  1985. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  1986. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  1987. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  1988. ("HAVE_SGI_RGB", '1', '1'),
  1989. ("HAVE_TGA", '1', '1'),
  1990. ("HAVE_IMG", '1', '1'),
  1991. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  1992. ("HAVE_BMP", '1', '1'),
  1993. ("HAVE_PNM", '1', '1'),
  1994. ("HAVE_STB_IMAGE", '1', '1'),
  1995. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  1996. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  1997. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  1998. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  1999. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2000. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2001. ("WANT_NATIVE_NET", '1', '1'),
  2002. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2003. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2004. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2005. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2006. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2007. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2008. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2009. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2010. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2011. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2012. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2013. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2014. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2015. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2016. # ("_SECURE_SCL", '0', 'UNDEF'),
  2017. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2018. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2019. ]
  2020. PRC_PARAMETERS=[
  2021. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2022. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2023. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2024. ("PRC_PATH2_ENVVARS", '""', '""'),
  2025. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2026. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2027. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2028. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2029. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2030. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2031. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2032. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2033. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2034. ]
  2035. def WriteConfigSettings():
  2036. dtool_config={}
  2037. prc_parameters={}
  2038. speedtree_parameters={}
  2039. plugin_config={}
  2040. if (GetTarget() == 'windows'):
  2041. for key,win,unix in DTOOL_CONFIG:
  2042. dtool_config[key] = win
  2043. for key,win,unix in PRC_PARAMETERS:
  2044. prc_parameters[key] = win
  2045. else:
  2046. for key,win,unix in DTOOL_CONFIG:
  2047. dtool_config[key] = unix
  2048. for key,win,unix in PRC_PARAMETERS:
  2049. prc_parameters[key] = unix
  2050. for x in PkgListGet():
  2051. if ("HAVE_"+x in dtool_config):
  2052. if (PkgSkip(x)==0):
  2053. dtool_config["HAVE_"+x] = '1'
  2054. else:
  2055. dtool_config["HAVE_"+x] = 'UNDEF'
  2056. dtool_config["HAVE_NET"] = '1'
  2057. if (PkgSkip("NVIDIACG")==0):
  2058. dtool_config["HAVE_CG"] = '1'
  2059. dtool_config["HAVE_CGGL"] = '1'
  2060. dtool_config["HAVE_CGDX9"] = '1'
  2061. if (GetTarget() != "linux"):
  2062. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2063. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2064. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2065. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2066. if (GetTarget() == "darwin"):
  2067. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2068. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2069. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2070. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2071. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2072. dtool_config["HAVE_GLX"] = 'UNDEF'
  2073. dtool_config["IS_LINUX"] = 'UNDEF'
  2074. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2075. dtool_config["IS_OSX"] = '1'
  2076. # 10.4 had a broken ucontext implementation
  2077. if int(platform.mac_ver()[0][3]) <= 4:
  2078. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2079. if (GetTarget() == "freebsd"):
  2080. dtool_config["IS_LINUX"] = 'UNDEF'
  2081. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2082. dtool_config["IS_FREEBSD"] = '1'
  2083. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2084. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2085. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2086. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2087. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2088. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2089. if (GetTarget() == "android"):
  2090. # Android does have RTTI, but we disable it anyway.
  2091. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2092. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2093. dtool_config["HAVE_LOCKF"] = 'UNDEF'
  2094. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2095. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2096. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2097. # This should probably be more sophisticated, such as based
  2098. # on whether the libRocket Python modules are available.
  2099. if (PkgSkip("PYTHON") != 0):
  2100. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2101. if (GetOptimize() <= 3):
  2102. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2103. if (GetOptimize() <= 3):
  2104. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2105. dtool_config["DO_PSTATS"] = '1'
  2106. if (GetOptimize() <= 3):
  2107. dtool_config["DO_DCAST"] = '1'
  2108. if (GetOptimize() <= 3):
  2109. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2110. if (GetOptimize() <= 3):
  2111. dtool_config["DO_MEMORY_USAGE"] = '1'
  2112. if (GetOptimize() <= 3):
  2113. dtool_config["NOTIFY_DEBUG"] = '1'
  2114. if (GetOptimize() >= 4):
  2115. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2116. if (GetOptimize() >= 4):
  2117. # Disable RTTI on release builds.
  2118. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2119. # Now that we have OS_SIMPLE_THREADS, we can support
  2120. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2121. # longer need to disable it for this platform.
  2122. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2123. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2124. if (RTDIST or RUNTIME):
  2125. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2126. if HOST_URL:
  2127. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2128. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2129. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2130. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2131. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2132. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2133. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2134. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2135. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2136. if PkgSkip("GTK2") == 0:
  2137. plugin_config["HAVE_GTK"] = '1'
  2138. if (RUNTIME):
  2139. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2140. # Whether it's present on the system doesn't matter here,
  2141. # as the runtime itself doesn't include or link with X11.
  2142. if (RUNTIME and GetTarget() == 'linux'):
  2143. dtool_config["HAVE_X11"] = '1'
  2144. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2145. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2146. else:
  2147. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2148. if (PkgSkip("SPEEDTREE")==0):
  2149. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2150. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2151. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2152. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2153. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2154. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2155. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2156. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2157. for key in sorted(prc_parameters.keys()):
  2158. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2159. val = OverrideValue(key, prc_parameters[key])
  2160. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2161. else: conf = conf + "#define " + key + " " + val + "\n"
  2162. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2163. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2164. for key in sorted(dtool_config.keys()):
  2165. val = OverrideValue(key, dtool_config[key])
  2166. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2167. else: conf = conf + "#define " + key + " " + val + "\n"
  2168. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2169. if (RTDIST or RUNTIME):
  2170. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2171. for key in sorted(plugin_config.keys()):
  2172. val = plugin_config[key]
  2173. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2174. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2175. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2176. if (PkgSkip("SPEEDTREE")==0):
  2177. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2178. for key in sorted(speedtree_parameters.keys()):
  2179. val = OverrideValue(key, speedtree_parameters[key])
  2180. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2181. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2182. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2183. for x in PkgListGet():
  2184. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2185. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2186. WriteConfigSettings()
  2187. WarnConflictingFiles()
  2188. if SystemLibraryExists("dtoolbase"):
  2189. print("%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor()))
  2190. if SystemLibraryExists("p3dtoolconfig"):
  2191. print("%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor()))
  2192. ##########################################################################################
  2193. #
  2194. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2195. #
  2196. ##########################################################################################
  2197. PANDAVERSION_H="""
  2198. #define PANDA_MAJOR_VERSION $VERSION1
  2199. #define PANDA_MINOR_VERSION $VERSION2
  2200. #define PANDA_SEQUENCE_VERSION $VERSION3
  2201. #define PANDA_VERSION $NVERSION
  2202. #define PANDA_NUMERIC_VERSION $NVERSION
  2203. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2204. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2205. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2206. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2207. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2208. """
  2209. PANDAVERSION_H_RUNTIME="""
  2210. #define PANDA_MAJOR_VERSION 0
  2211. #define PANDA_MINOR_VERSION 0
  2212. #define PANDA_SEQUENCE_VERSION 0
  2213. #define PANDA_VERSION_STR "0.0.0"
  2214. #define PANDA_ABI_VERSION_STR "0.0"
  2215. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2216. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2217. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2218. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2219. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2220. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2221. #define PANDA_PACKAGE_VERSION_STR ""
  2222. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2223. """
  2224. CHECKPANDAVERSION_CXX="""
  2225. # include "dtoolbase.h"
  2226. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  2227. """
  2228. CHECKPANDAVERSION_H="""
  2229. # include "dtoolbase.h"
  2230. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  2231. # ifndef WIN32
  2232. /* For Windows, exporting the symbol from the DLL is sufficient; the
  2233. DLL will not load unless all expected public symbols are defined.
  2234. Other systems may not mind if the symbol is absent unless we
  2235. explictly write code that references it. */
  2236. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  2237. # endif
  2238. """
  2239. P3DACTIVEX_RC="""#include "resource.h"
  2240. #define APSTUDIO_READONLY_SYMBOLS
  2241. #include "afxres.h"
  2242. #undef APSTUDIO_READONLY_SYMBOLS
  2243. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2244. #ifdef _WIN32
  2245. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2246. #pragma code_page(1252)
  2247. #endif
  2248. #ifdef APSTUDIO_INVOKED
  2249. 1 TEXTINCLUDE
  2250. BEGIN
  2251. "resource.h\\0"
  2252. END
  2253. 2 TEXTINCLUDE
  2254. BEGIN
  2255. "#include ""afxres.h""\\r\\n"
  2256. "\\0"
  2257. END
  2258. 3 TEXTINCLUDE
  2259. BEGIN
  2260. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2261. "\\0"
  2262. END
  2263. #endif
  2264. %s
  2265. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2266. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2267. STYLE DS_SETFONT | WS_CHILD
  2268. FONT 8, "MS Sans Serif"
  2269. BEGIN
  2270. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2271. IDC_STATIC,7,25,229,16
  2272. END
  2273. #ifdef APSTUDIO_INVOKED
  2274. GUIDELINES DESIGNINFO
  2275. BEGIN
  2276. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2277. BEGIN
  2278. LEFTMARGIN, 7
  2279. RIGHTMARGIN, 243
  2280. TOPMARGIN, 7
  2281. BOTTOMMARGIN, 55
  2282. END
  2283. END
  2284. #endif
  2285. STRINGTABLE
  2286. BEGIN
  2287. IDS_P3DACTIVEX "P3DActiveX Control"
  2288. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2289. END
  2290. STRINGTABLE
  2291. BEGIN
  2292. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2293. END
  2294. #endif
  2295. #ifndef APSTUDIO_INVOKED
  2296. 1 TYPELIB "P3DActiveX.tlb"
  2297. #endif"""
  2298. def CreatePandaVersionFiles():
  2299. version1=int(VERSION.split(".")[0])
  2300. version2=int(VERSION.split(".")[1])
  2301. version3=int(VERSION.split(".")[2])
  2302. nversion=version1*1000000+version2*1000+version3
  2303. if (DISTRIBUTOR != "cmu"):
  2304. # Subtract 1 if we are not an official version.
  2305. nversion -= 1
  2306. if (RUNTIME):
  2307. pandaversion_h = PANDAVERSION_H_RUNTIME
  2308. else:
  2309. pandaversion_h = PANDAVERSION_H
  2310. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2311. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2312. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2313. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2314. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2315. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2316. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2317. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2318. if (DISTRIBUTOR == "cmu"):
  2319. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2320. else:
  2321. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2322. if GIT_COMMIT:
  2323. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2324. if not RUNTIME:
  2325. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2326. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2327. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2328. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2329. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2330. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2331. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2332. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2333. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2334. if RUNTIME:
  2335. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2336. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2337. else:
  2338. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2339. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2340. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2341. if RUNTIME:
  2342. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2343. "version" : VERSION,
  2344. "description" : "Runs 3-D games and interactive applets",
  2345. "filename" : "p3dactivex.ocx",
  2346. "mimetype" : "application/x-panda3d",
  2347. "extension" : "p3d",
  2348. "filedesc" : "Panda3D applet"}
  2349. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2350. CreatePandaVersionFiles()
  2351. ##########################################################################################
  2352. #
  2353. # Copy the "direct" tree
  2354. #
  2355. ##########################################################################################
  2356. if (PkgSkip("DIRECT")==0):
  2357. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2358. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2359. # This file used to be copied, but would nowadays cause conflicts.
  2360. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2361. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2362. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2363. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2364. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2365. # This directory doesn't exist at all any more.
  2366. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2367. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2368. # These files used to exist; remove them to avoid conflicts.
  2369. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2370. '_core.pyd', '_core.so',
  2371. 'direct.py', 'direct.pyc', 'direct.pyo',
  2372. '_direct.pyd', '_direct.so',
  2373. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2374. for basename in del_files:
  2375. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2376. if os.path.isfile(path):
  2377. print("Removing %s" % (path))
  2378. os.remove(path)
  2379. # Write an appropriate panda3d/__init__.py
  2380. p3d_init = """"Python bindings for the Panda3D libraries"
  2381. """
  2382. if GetTarget() == 'windows':
  2383. p3d_init += """
  2384. import os
  2385. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2386. if os.path.isdir(bindir):
  2387. if not os.environ.get('PATH'):
  2388. os.environ['PATH'] = bindir
  2389. else:
  2390. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2391. del os, bindir
  2392. """
  2393. if not PkgSkip("PYTHON"):
  2394. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2395. # Also add this file, for backward compatibility.
  2396. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2397. if __debug__:
  2398. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2399. from .interrogatedb import *
  2400. """)
  2401. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2402. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2403. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2404. os.remove(fn)
  2405. panda_modules = ['core']
  2406. if not PkgSkip("PANDAPHYSICS"):
  2407. panda_modules.append('physics')
  2408. if not PkgSkip('PANDAFX'):
  2409. panda_modules.append('fx')
  2410. if not PkgSkip("DIRECT"):
  2411. panda_modules.append('direct')
  2412. if not PkgSkip("VISION"):
  2413. panda_modules.append('vision')
  2414. if not PkgSkip("SKEL"):
  2415. panda_modules.append('skel')
  2416. if not PkgSkip("EGG"):
  2417. panda_modules.append('egg')
  2418. if not PkgSkip("AWESOMIUM"):
  2419. panda_modules.append('awesomium')
  2420. if not PkgSkip("ODE"):
  2421. panda_modules.append('ode')
  2422. if not PkgSkip("VRPN"):
  2423. panda_modules.append('vrpn')
  2424. panda_modules_code = """
  2425. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2426. if __debug__:
  2427. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2428. """
  2429. for module in panda_modules:
  2430. panda_modules_code += """
  2431. try:
  2432. from panda3d.%s import *
  2433. except ImportError as err:
  2434. if "No module named %s" not in str(err):
  2435. raise""" % (module, module)
  2436. exthelpers_code = """
  2437. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2438. from direct.extensions_native.extension_native_helpers import *
  2439. """
  2440. if not PkgSkip("PYTHON"):
  2441. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2442. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2443. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2444. ##########################################################################################
  2445. #
  2446. # Generate the PRC files into the ETC directory.
  2447. #
  2448. ##########################################################################################
  2449. confautoprc = ReadFile("makepanda/confauto.in")
  2450. if (PkgSkip("SPEEDTREE")==0):
  2451. # If SpeedTree is available, enable it in the config file
  2452. confautoprc = confautoprc.replace('#st#', '')
  2453. else:
  2454. # otherwise, disable it.
  2455. confautoprc = confautoprc.replace('#st#', '#')
  2456. if (os.path.isfile("makepanda/myconfig.in")):
  2457. configprc = ReadFile("makepanda/myconfig.in")
  2458. else:
  2459. configprc = ReadFile("makepanda/config.in")
  2460. if (GetTarget() == 'windows'):
  2461. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2462. else:
  2463. configprc = configprc.replace("aux-display pandadx9", "")
  2464. if (GetTarget() == 'darwin'):
  2465. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2466. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2467. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2468. if GetTarget() == 'windows':
  2469. # Convert to Windows newlines.
  2470. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2471. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2472. else:
  2473. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2474. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2475. ##########################################################################################
  2476. #
  2477. # Copy the precompiled binaries and DLLs into the build.
  2478. #
  2479. ##########################################################################################
  2480. tp_dir = GetThirdpartyDir()
  2481. if tp_dir is not None:
  2482. dylibs = {}
  2483. if GetTarget() == 'darwin':
  2484. # Make a list of all the dylibs we ship, to figure out whether we should use
  2485. # install_name_tool to correct the library reference to point to our copy.
  2486. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2487. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2488. if not PkgSkip("PYTHON"):
  2489. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2490. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2491. for pkg in PkgListGet():
  2492. if PkgSkip(pkg):
  2493. continue
  2494. tp_pkg = tp_dir + pkg.lower()
  2495. if GetTarget() == 'windows':
  2496. if os.path.exists(tp_pkg + "/bin"):
  2497. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2498. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2499. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2500. elif GetTarget() == 'darwin':
  2501. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2502. if not PkgSkip("PYTHON"):
  2503. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2504. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2505. if pkg != 'PYTHON':
  2506. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2507. for tp_lib in tp_libs:
  2508. basename = os.path.basename(tp_lib)
  2509. if basename.endswith('.dylib'):
  2510. # It's a dynamic link library. Put it in the lib directory.
  2511. target = GetOutputDir() + "/lib/" + basename
  2512. dep_prefix = "@loader_path/../lib/"
  2513. lib_id = dep_prefix + basename
  2514. else:
  2515. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2516. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2517. target = GetOutputDir() + "/" + basename
  2518. dep_prefix = "@loader_path/lib/"
  2519. lib_id = basename
  2520. if not NeedsBuild([target], [tp_lib]):
  2521. continue
  2522. CopyFile(target, tp_lib)
  2523. if os.path.islink(target) or target.endswith('.py'):
  2524. continue
  2525. # Correct the inter-library dependencies so that the build is relocatable.
  2526. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2527. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2528. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2529. line = line.strip()
  2530. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2531. continue
  2532. libdep = line.split(" ", 1)[0]
  2533. dep_basename = os.path.basename(libdep)
  2534. if dep_basename in dylibs:
  2535. dep_target = dylibs[dep_basename]
  2536. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2537. JustBuilt([target], [tp_lib])
  2538. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2539. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2540. else: # Linux / FreeBSD case.
  2541. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2542. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2543. if not PkgSkip("PYTHON"):
  2544. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2545. base = os.path.basename(tp_lib)
  2546. if base.startswith('lib'):
  2547. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2548. else:
  2549. # It's a Python module, like _rocketcore.so.
  2550. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2551. if GetTarget() == 'windows':
  2552. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2553. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2554. if not PkgSkip("PYTHON") and not RTDIST:
  2555. # We need to copy the Python DLL to the bin directory for now.
  2556. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2557. if GetOptimize() <= 2:
  2558. pydll += "_d.dll"
  2559. else:
  2560. pydll += ".dll"
  2561. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2562. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2563. CopyFile(GetOutputDir() + "/bin/", fn)
  2564. # Copy the whole Python directory.
  2565. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2566. # NB: Python does not always ship with the correct manifest/dll.
  2567. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2568. manifest = GetOutputDir() + '/tmp/python.manifest'
  2569. if os.path.isfile(manifest):
  2570. os.unlink(manifest)
  2571. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2572. if os.path.isfile(manifest):
  2573. import xml.etree.ElementTree as ET
  2574. tree = ET.parse(manifest)
  2575. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2576. else:
  2577. idents = ()
  2578. for ident in idents:
  2579. sxs_name = '_'.join([
  2580. ident.get('processorArchitecture'),
  2581. ident.get('name').lower(),
  2582. ident.get('publicKeyToken'),
  2583. ident.get('version'),
  2584. ])
  2585. # Find the manifest matching these parameters.
  2586. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2587. manifests = glob.glob(pattern)
  2588. if not manifests:
  2589. print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern))
  2590. continue
  2591. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2592. # Also copy the corresponding msvcr dll.
  2593. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2594. for file in glob.glob(pattern):
  2595. CopyFile(GetOutputDir() + "/python/", file)
  2596. # Copy python.exe to ppython.exe.
  2597. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2598. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2599. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2600. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2601. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2602. # Copy over the MSVC runtime.
  2603. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2604. vcver = SDK["VISUALSTUDIO_VERSION"].replace('.', '')
  2605. crtname = "Microsoft.VC%s.CRT" % (vcver)
  2606. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2607. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2608. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2609. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2610. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2611. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2612. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2613. ########################################################################
  2614. ##
  2615. ## Copy various stuff into the build.
  2616. ##
  2617. ########################################################################
  2618. if GetTarget() == 'windows':
  2619. # Convert to Windows newlines so they can be opened by notepad.
  2620. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2621. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2622. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2623. else:
  2624. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2625. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2626. if (PkgSkip("PANDATOOL")==0):
  2627. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2628. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2629. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2630. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2631. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2632. # Since Eigen is included by all sorts of core headers, as a convenience
  2633. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2634. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2635. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2636. ########################################################################
  2637. #
  2638. # Copy header files to the built/include/parser-inc directory.
  2639. #
  2640. ########################################################################
  2641. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2642. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2643. ########################################################################
  2644. #
  2645. # Transfer all header files to the built/include directory.
  2646. #
  2647. ########################################################################
  2648. CopyAllHeaders('dtool/src/dtoolbase')
  2649. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2650. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2651. CopyAllHeaders('dtool/metalibs/dtool')
  2652. CopyAllHeaders('dtool/src/cppparser')
  2653. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2654. CopyAllHeaders('dtool/src/dconfig')
  2655. CopyAllHeaders('dtool/src/interrogatedb')
  2656. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2657. CopyAllHeaders('dtool/src/pystub')
  2658. CopyAllHeaders('dtool/src/interrogate')
  2659. CopyAllHeaders('dtool/src/test_interrogate')
  2660. CopyAllHeaders('panda/src/putil')
  2661. CopyAllHeaders('panda/src/pandabase')
  2662. CopyAllHeaders('panda/src/express')
  2663. CopyAllHeaders('panda/src/downloader')
  2664. CopyAllHeaders('panda/metalibs/pandaexpress')
  2665. CopyAllHeaders('panda/src/pipeline')
  2666. CopyAllHeaders('panda/src/linmath')
  2667. CopyAllHeaders('panda/src/putil')
  2668. CopyAllHeaders('dtool/src/prckeys')
  2669. CopyAllHeaders('panda/src/audio')
  2670. CopyAllHeaders('panda/src/event')
  2671. CopyAllHeaders('panda/src/mathutil')
  2672. CopyAllHeaders('panda/src/gsgbase')
  2673. CopyAllHeaders('panda/src/pnmimage')
  2674. CopyAllHeaders('panda/src/nativenet')
  2675. CopyAllHeaders('panda/src/net')
  2676. CopyAllHeaders('panda/src/pstatclient')
  2677. CopyAllHeaders('panda/src/gobj')
  2678. CopyAllHeaders('panda/src/movies')
  2679. CopyAllHeaders('panda/src/pgraphnodes')
  2680. CopyAllHeaders('panda/src/pgraph')
  2681. CopyAllHeaders('panda/src/cull')
  2682. CopyAllHeaders('panda/src/chan')
  2683. CopyAllHeaders('panda/src/char')
  2684. CopyAllHeaders('panda/src/dgraph')
  2685. CopyAllHeaders('panda/src/display')
  2686. CopyAllHeaders('panda/src/device')
  2687. CopyAllHeaders('panda/src/pnmtext')
  2688. CopyAllHeaders('panda/src/text')
  2689. CopyAllHeaders('panda/src/grutil')
  2690. if (PkgSkip("VISION")==0):
  2691. CopyAllHeaders('panda/src/vision')
  2692. CopyAllHeaders('panda/src/awesomium')
  2693. if (PkgSkip("FFMPEG")==0):
  2694. CopyAllHeaders('panda/src/ffmpeg')
  2695. CopyAllHeaders('panda/src/tform')
  2696. CopyAllHeaders('panda/src/collide')
  2697. CopyAllHeaders('panda/src/parametrics')
  2698. CopyAllHeaders('panda/src/pgui')
  2699. CopyAllHeaders('panda/src/pnmimagetypes')
  2700. CopyAllHeaders('panda/src/recorder')
  2701. if (PkgSkip("ROCKET")==0):
  2702. CopyAllHeaders('panda/src/rocket')
  2703. if (PkgSkip("VRPN")==0):
  2704. CopyAllHeaders('panda/src/vrpn')
  2705. CopyAllHeaders('panda/src/wgldisplay')
  2706. CopyAllHeaders('panda/src/ode')
  2707. CopyAllHeaders('panda/metalibs/pandaode')
  2708. if (PkgSkip("PANDAPHYSICS")==0):
  2709. CopyAllHeaders('panda/src/physics')
  2710. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2711. CopyAllHeaders('panda/src/particlesystem')
  2712. CopyAllHeaders('panda/src/dxml')
  2713. CopyAllHeaders('panda/metalibs/panda')
  2714. CopyAllHeaders('panda/src/audiotraits')
  2715. CopyAllHeaders('panda/src/audiotraits')
  2716. CopyAllHeaders('panda/src/distort')
  2717. CopyAllHeaders('panda/src/downloadertools')
  2718. CopyAllHeaders('panda/src/windisplay')
  2719. CopyAllHeaders('panda/src/dxgsg9')
  2720. CopyAllHeaders('panda/metalibs/pandadx9')
  2721. if not PkgSkip("EGG"):
  2722. CopyAllHeaders('panda/src/egg')
  2723. CopyAllHeaders('panda/src/egg2pg')
  2724. CopyAllHeaders('panda/src/framework')
  2725. CopyAllHeaders('panda/metalibs/pandafx')
  2726. CopyAllHeaders('panda/src/glstuff')
  2727. CopyAllHeaders('panda/src/glgsg')
  2728. CopyAllHeaders('panda/src/glesgsg')
  2729. CopyAllHeaders('panda/src/gles2gsg')
  2730. if not PkgSkip("EGG"):
  2731. CopyAllHeaders('panda/metalibs/pandaegg')
  2732. if GetTarget() == 'windows':
  2733. CopyAllHeaders('panda/src/wgldisplay')
  2734. elif GetTarget() == 'darwin':
  2735. CopyAllHeaders('panda/src/osxdisplay')
  2736. CopyAllHeaders('panda/src/cocoadisplay')
  2737. elif GetTarget() == 'android':
  2738. CopyAllHeaders('panda/src/android')
  2739. CopyAllHeaders('panda/src/androiddisplay')
  2740. else:
  2741. CopyAllHeaders('panda/src/x11display')
  2742. CopyAllHeaders('panda/src/glxdisplay')
  2743. CopyAllHeaders('panda/src/egldisplay')
  2744. CopyAllHeaders('panda/metalibs/pandagl')
  2745. CopyAllHeaders('panda/metalibs/pandagles')
  2746. CopyAllHeaders('panda/metalibs/pandagles2')
  2747. CopyAllHeaders('panda/metalibs/pandaphysics')
  2748. CopyAllHeaders('panda/src/testbed')
  2749. if (PkgSkip("PHYSX")==0):
  2750. CopyAllHeaders('panda/src/physx')
  2751. CopyAllHeaders('panda/metalibs/pandaphysx')
  2752. if (PkgSkip("BULLET")==0):
  2753. CopyAllHeaders('panda/src/bullet')
  2754. CopyAllHeaders('panda/metalibs/pandabullet')
  2755. if (PkgSkip("SPEEDTREE")==0):
  2756. CopyAllHeaders('panda/src/speedtree')
  2757. if (PkgSkip("DIRECT")==0):
  2758. CopyAllHeaders('direct/src/directbase')
  2759. CopyAllHeaders('direct/src/dcparser')
  2760. CopyAllHeaders('direct/src/deadrec')
  2761. CopyAllHeaders('direct/src/distributed')
  2762. CopyAllHeaders('direct/src/interval')
  2763. CopyAllHeaders('direct/src/showbase')
  2764. CopyAllHeaders('direct/metalibs/direct')
  2765. CopyAllHeaders('direct/src/dcparse')
  2766. if (RUNTIME or RTDIST):
  2767. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2768. if (RUNTIME):
  2769. CopyAllHeaders('direct/src/plugin_npapi')
  2770. CopyAllHeaders('direct/src/plugin_standalone')
  2771. if (PkgSkip("PANDATOOL")==0):
  2772. CopyAllHeaders('pandatool/src/pandatoolbase')
  2773. CopyAllHeaders('pandatool/src/converter')
  2774. CopyAllHeaders('pandatool/src/progbase')
  2775. CopyAllHeaders('pandatool/src/eggbase')
  2776. CopyAllHeaders('pandatool/src/bam')
  2777. CopyAllHeaders('pandatool/src/cvscopy')
  2778. CopyAllHeaders('pandatool/src/daeegg')
  2779. CopyAllHeaders('pandatool/src/daeprogs')
  2780. CopyAllHeaders('pandatool/src/dxf')
  2781. CopyAllHeaders('pandatool/src/dxfegg')
  2782. CopyAllHeaders('pandatool/src/dxfprogs')
  2783. CopyAllHeaders('pandatool/src/palettizer')
  2784. CopyAllHeaders('pandatool/src/egg-mkfont')
  2785. CopyAllHeaders('pandatool/src/eggcharbase')
  2786. CopyAllHeaders('pandatool/src/egg-optchar')
  2787. CopyAllHeaders('pandatool/src/egg-palettize')
  2788. CopyAllHeaders('pandatool/src/egg-qtess')
  2789. CopyAllHeaders('pandatool/src/eggprogs')
  2790. CopyAllHeaders('pandatool/src/flt')
  2791. CopyAllHeaders('pandatool/src/fltegg')
  2792. CopyAllHeaders('pandatool/src/fltprogs')
  2793. CopyAllHeaders('pandatool/src/imagebase')
  2794. CopyAllHeaders('pandatool/src/imageprogs')
  2795. CopyAllHeaders('pandatool/src/pfmprogs')
  2796. CopyAllHeaders('pandatool/src/lwo')
  2797. CopyAllHeaders('pandatool/src/lwoegg')
  2798. CopyAllHeaders('pandatool/src/lwoprogs')
  2799. CopyAllHeaders('pandatool/src/maya')
  2800. CopyAllHeaders('pandatool/src/mayaegg')
  2801. CopyAllHeaders('pandatool/src/maxegg')
  2802. CopyAllHeaders('pandatool/src/maxprogs')
  2803. CopyAllHeaders('pandatool/src/objegg')
  2804. CopyAllHeaders('pandatool/src/objprogs')
  2805. CopyAllHeaders('pandatool/src/vrml')
  2806. CopyAllHeaders('pandatool/src/vrmlegg')
  2807. CopyAllHeaders('pandatool/src/xfile')
  2808. CopyAllHeaders('pandatool/src/xfileegg')
  2809. CopyAllHeaders('pandatool/src/ptloader')
  2810. CopyAllHeaders('pandatool/src/miscprogs')
  2811. CopyAllHeaders('pandatool/src/pstatserver')
  2812. CopyAllHeaders('pandatool/src/softprogs')
  2813. CopyAllHeaders('pandatool/src/text-stats')
  2814. CopyAllHeaders('pandatool/src/vrmlprogs')
  2815. CopyAllHeaders('pandatool/src/win-stats')
  2816. CopyAllHeaders('pandatool/src/xfileprogs')
  2817. if (PkgSkip("CONTRIB")==0):
  2818. CopyAllHeaders('contrib/src/contribbase')
  2819. CopyAllHeaders('contrib/src/ai')
  2820. ########################################################################
  2821. #
  2822. # Copy Java files, if applicable
  2823. #
  2824. ########################################################################
  2825. if GetTarget() == 'android':
  2826. CopyAllJavaSources('panda/src/android')
  2827. ########################################################################
  2828. #
  2829. # These definitions are syntactic shorthand. They make it easy
  2830. # to link with the usual libraries without listing them all.
  2831. #
  2832. ########################################################################
  2833. COMMON_DTOOL_LIBS=[
  2834. 'libp3dtool.dll',
  2835. 'libp3dtoolconfig.dll',
  2836. ]
  2837. COMMON_PANDA_LIBS=[
  2838. 'libpanda.dll',
  2839. 'libpandaexpress.dll'
  2840. ] + COMMON_DTOOL_LIBS
  2841. COMMON_EGG2X_LIBS=[
  2842. 'libp3eggbase.lib',
  2843. 'libp3progbase.lib',
  2844. 'libp3converter.lib',
  2845. 'libp3pandatoolbase.lib',
  2846. 'libpandaegg.dll',
  2847. ] + COMMON_PANDA_LIBS
  2848. ########################################################################
  2849. #
  2850. # This section contains a list of all the files that need to be compiled.
  2851. #
  2852. ########################################################################
  2853. print("Generating dependencies...")
  2854. sys.stdout.flush()
  2855. #
  2856. # Compile Panda icon resource file.
  2857. # We do it first because we need it at
  2858. # the time we compile an executable.
  2859. #
  2860. if GetTarget() == 'windows':
  2861. OPTS=['DIR:panda/src/configfiles']
  2862. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2863. #
  2864. # DIRECTORY: dtool/src/dtoolbase/
  2865. #
  2866. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2867. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2868. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2869. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2870. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2871. #
  2872. # DIRECTORY: dtool/src/dtoolutil/
  2873. #
  2874. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2875. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2876. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2877. if GetTarget() == 'darwin':
  2878. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2879. #
  2880. # DIRECTORY: dtool/metalibs/dtool/
  2881. #
  2882. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2883. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2884. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2885. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2886. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2887. if GetTarget() == 'darwin':
  2888. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2889. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2890. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2891. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2892. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2893. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2894. #
  2895. # DIRECTORY: dtool/src/cppparser/
  2896. #
  2897. if (not RUNTIME):
  2898. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2899. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2900. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2901. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2902. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2903. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2904. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2905. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2906. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2907. #
  2908. # DIRECTORY: dtool/src/prc/
  2909. #
  2910. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2911. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2912. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2913. #
  2914. # DIRECTORY: dtool/src/dconfig/
  2915. #
  2916. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2917. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2918. #
  2919. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2920. #
  2921. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2922. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2923. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2924. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2925. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2926. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2927. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2928. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  2929. #
  2930. # DIRECTORY: dtool/src/interrogatedb/
  2931. #
  2932. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON']
  2933. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2934. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2935. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  2936. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  2937. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  2938. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  2939. TargetAdd('libp3interrogatedb.dll', opts=['PYTHON'])
  2940. if not PkgSkip("PYTHON"):
  2941. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  2942. # stuff, so it has been renamed appropriately.
  2943. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON']
  2944. TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2945. TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  2946. TargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  2947. TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  2948. TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  2949. TargetAdd('interrogatedb.pyd', opts=['PYTHON'])
  2950. #
  2951. # DIRECTORY: dtool/src/pystub/
  2952. #
  2953. if not RUNTIME and not RTDIST:
  2954. OPTS=['DIR:dtool/src/pystub']
  2955. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2956. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  2957. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  2958. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  2959. #
  2960. # DIRECTORY: dtool/src/interrogate/
  2961. #
  2962. if (not RUNTIME):
  2963. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2964. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2965. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2966. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  2967. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  2968. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  2969. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  2970. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  2971. TargetAdd('interrogate.exe', input='libp3pystub.lib')
  2972. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2973. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  2974. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  2975. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  2976. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  2977. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  2978. TargetAdd('interrogate_module.exe', input='libp3pystub.lib')
  2979. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2980. if (not RTDIST):
  2981. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  2982. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  2983. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  2984. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  2985. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  2986. TargetAdd('parse_file.exe', input='libp3pystub.lib')
  2987. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2988. #
  2989. # DIRECTORY: dtool/src/prckeys/
  2990. #
  2991. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  2992. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  2993. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  2994. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  2995. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  2996. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2997. #
  2998. # DIRECTORY: dtool/src/test_interrogate/
  2999. #
  3000. if (not RTDIST and not RUNTIME):
  3001. OPTS=['DIR:dtool/src/test_interrogate']
  3002. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3003. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3004. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3005. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3006. TargetAdd('test_interrogate.exe', input='libp3pystub.lib')
  3007. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3008. #
  3009. # DIRECTORY: dtool/src/dtoolbase/
  3010. #
  3011. OPTS=['DIR:dtool/src/dtoolbase', 'PYTHON']
  3012. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3013. IGATEFILES += [
  3014. "typeHandle.h",
  3015. "typeHandle_ext.h",
  3016. "typeRegistry.h",
  3017. "typedObject.h",
  3018. "neverFreeMemory.h",
  3019. ]
  3020. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3021. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3022. TargetAdd('libp3dtoolbase_igate.obj', input='libp3dtoolbase.in', opts=["DEPENDENCYONLY"])
  3023. TargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3024. #
  3025. # DIRECTORY: dtool/src/dtoolutil/
  3026. #
  3027. OPTS=['DIR:dtool/src/dtoolutil', 'PYTHON']
  3028. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3029. IGATEFILES += [
  3030. "config_dtoolutil.h",
  3031. "pandaSystem.h",
  3032. "dSearchPath.h",
  3033. "executionEnvironment.h",
  3034. "textEncoder.h",
  3035. "filename.h",
  3036. "filename_ext.h",
  3037. "globPattern.h",
  3038. "globPattern_ext.h",
  3039. "pandaFileStream.h",
  3040. "lineStream.h",
  3041. ]
  3042. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3043. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3044. TargetAdd('libp3dtoolutil_igate.obj', input='libp3dtoolutil.in', opts=["DEPENDENCYONLY"])
  3045. TargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3046. #
  3047. # DIRECTORY: dtool/src/prc/
  3048. #
  3049. OPTS=['DIR:dtool/src/prc', 'PYTHON']
  3050. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3051. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3052. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3053. TargetAdd('libp3prc_igate.obj', input='libp3prc.in', opts=["DEPENDENCYONLY"])
  3054. TargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3055. #
  3056. # DIRECTORY: panda/src/pandabase/
  3057. #
  3058. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3059. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3060. #
  3061. # DIRECTORY: panda/src/express/
  3062. #
  3063. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3064. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3065. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3066. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON']
  3067. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3068. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3069. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3070. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  3071. TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3072. #
  3073. # DIRECTORY: panda/src/downloader/
  3074. #
  3075. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3076. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3077. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3078. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON']
  3079. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3080. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3081. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3082. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  3083. TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3084. #
  3085. # DIRECTORY: panda/metalibs/pandaexpress/
  3086. #
  3087. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3088. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3089. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3090. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3091. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3092. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3093. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3094. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3095. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3096. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER'])
  3097. #
  3098. # DIRECTORY: panda/src/pipeline/
  3099. #
  3100. if (not RUNTIME):
  3101. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3102. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3103. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3104. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3105. OPTS=['DIR:panda/src/pipeline', 'PYTHON']
  3106. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3107. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3108. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3109. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  3110. TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3111. #
  3112. # DIRECTORY: panda/src/linmath/
  3113. #
  3114. if (not RUNTIME):
  3115. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3116. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3117. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3118. OPTS=['DIR:panda/src/linmath', 'PYTHON']
  3119. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3120. for ifile in IGATEFILES[:]:
  3121. if "_src." in ifile:
  3122. IGATEFILES.remove(ifile)
  3123. IGATEFILES.remove('cast_to_double.h')
  3124. IGATEFILES.remove('lmat_ops.h')
  3125. IGATEFILES.remove('cast_to_float.h')
  3126. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3127. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3128. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  3129. #
  3130. # DIRECTORY: panda/src/putil/
  3131. #
  3132. if (not RUNTIME):
  3133. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3134. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3135. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3136. OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON']
  3137. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3138. IGATEFILES.remove("test_bam.h")
  3139. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3140. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3141. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  3142. TargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3143. #
  3144. # DIRECTORY: panda/src/audio/
  3145. #
  3146. if (not RUNTIME):
  3147. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3148. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3149. OPTS=['DIR:panda/src/audio', 'PYTHON']
  3150. IGATEFILES=["audio.h"]
  3151. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3152. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3153. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  3154. #
  3155. # DIRECTORY: panda/src/event/
  3156. #
  3157. if (not RUNTIME):
  3158. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3159. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3160. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3161. OPTS=['DIR:panda/src/event', 'PYTHON']
  3162. TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3163. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3164. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3165. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3166. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  3167. #
  3168. # DIRECTORY: panda/src/mathutil/
  3169. #
  3170. if (not RUNTIME):
  3171. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3172. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3173. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3174. OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON']
  3175. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3176. for ifile in IGATEFILES[:]:
  3177. if "_src." in ifile:
  3178. IGATEFILES.remove(ifile)
  3179. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3180. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3181. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  3182. #
  3183. # DIRECTORY: panda/src/gsgbase/
  3184. #
  3185. if (not RUNTIME):
  3186. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3187. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3188. OPTS=['DIR:panda/src/gsgbase', 'PYTHON']
  3189. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3190. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3191. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3192. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  3193. #
  3194. # DIRECTORY: panda/src/pnmimage/
  3195. #
  3196. if (not RUNTIME):
  3197. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3198. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3199. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3200. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3201. OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON']
  3202. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3203. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3204. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3205. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  3206. TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3207. #
  3208. # DIRECTORY: panda/src/nativenet/
  3209. #
  3210. if (not RUNTIME):
  3211. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3212. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3213. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON']
  3214. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3215. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3216. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3217. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  3218. #
  3219. # DIRECTORY: panda/src/net/
  3220. #
  3221. if (not RUNTIME):
  3222. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3223. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3224. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3225. OPTS=['DIR:panda/src/net', 'PYTHON']
  3226. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3227. IGATEFILES.remove("datagram_ui.h")
  3228. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3229. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3230. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  3231. #
  3232. # DIRECTORY: panda/src/pstatclient/
  3233. #
  3234. if (not RUNTIME):
  3235. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3236. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3237. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3238. OPTS=['DIR:panda/src/pstatclient', 'PYTHON']
  3239. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3240. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3241. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3242. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  3243. #
  3244. # DIRECTORY: panda/src/gobj/
  3245. #
  3246. if (not RUNTIME):
  3247. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3248. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3249. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  3250. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON']
  3251. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3252. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3253. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3254. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3255. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  3256. TargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3257. #
  3258. # DIRECTORY: panda/src/pgraphnodes/
  3259. #
  3260. if (not RUNTIME):
  3261. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3262. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3263. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3264. OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON']
  3265. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3266. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3267. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3268. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  3269. #
  3270. # DIRECTORY: panda/src/pgraph/
  3271. #
  3272. if (not RUNTIME):
  3273. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3274. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3275. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3276. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3277. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3278. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3279. OPTS=['DIR:panda/src/pgraph', 'PYTHON']
  3280. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3281. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3282. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3283. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  3284. TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3285. #
  3286. # DIRECTORY: panda/src/cull/
  3287. #
  3288. if (not RUNTIME):
  3289. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3290. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3291. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3292. OPTS=['DIR:panda/src/cull', 'PYTHON']
  3293. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3294. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3295. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3296. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  3297. #
  3298. # DIRECTORY: panda/src/chan/
  3299. #
  3300. if (not RUNTIME):
  3301. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3302. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3303. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3304. OPTS=['DIR:panda/src/chan', 'PYTHON']
  3305. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3306. IGATEFILES.remove('movingPart.h')
  3307. IGATEFILES.remove('animChannelFixed.h')
  3308. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3309. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3310. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  3311. # DIRECTORY: panda/src/char/
  3312. #
  3313. if (not RUNTIME):
  3314. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3315. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3316. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3317. OPTS=['DIR:panda/src/char', 'PYTHON']
  3318. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3319. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3320. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3321. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  3322. #
  3323. # DIRECTORY: panda/src/dgraph/
  3324. #
  3325. if (not RUNTIME):
  3326. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3327. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3328. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3329. OPTS=['DIR:panda/src/dgraph', 'PYTHON']
  3330. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3331. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3332. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3333. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  3334. #
  3335. # DIRECTORY: panda/src/display/
  3336. #
  3337. if (not RUNTIME):
  3338. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA']
  3339. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3340. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3341. OPTS=['DIR:panda/src/display', 'PYTHON']
  3342. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3343. IGATEFILES.remove("renderBuffer.h")
  3344. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3345. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3346. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  3347. TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
  3348. TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx')
  3349. TargetAdd('p3display_pythonGraphicsWindowProc.obj', opts=OPTS, input='pythonGraphicsWindowProc.cxx')
  3350. if RTDIST and GetTarget() == 'darwin':
  3351. OPTS=['DIR:panda/src/display']
  3352. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3353. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3354. #
  3355. # DIRECTORY: panda/src/device/
  3356. #
  3357. if (not RUNTIME):
  3358. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3359. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3360. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3361. OPTS=['DIR:panda/src/device', 'PYTHON']
  3362. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3363. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3364. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3365. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  3366. #
  3367. # DIRECTORY: panda/src/pnmtext/
  3368. #
  3369. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3370. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3371. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3372. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON']
  3373. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3374. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3375. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3376. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  3377. #
  3378. # DIRECTORY: panda/src/text/
  3379. #
  3380. if (not RUNTIME):
  3381. if not PkgSkip("HARFBUZZ"):
  3382. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3383. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3384. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3385. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3386. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON']
  3387. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3388. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3389. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3390. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  3391. #
  3392. # DIRECTORY: panda/src/movies/
  3393. #
  3394. if (not RUNTIME):
  3395. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3396. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3397. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS', 'PYTHON']
  3398. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3399. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3400. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3401. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  3402. #
  3403. # DIRECTORY: panda/src/grutil/
  3404. #
  3405. if (not RUNTIME):
  3406. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3407. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3408. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3409. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3410. OPTS=['DIR:panda/src/grutil', 'PYTHON']
  3411. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3412. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3413. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3414. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3415. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  3416. #
  3417. # DIRECTORY: panda/src/tform/
  3418. #
  3419. if (not RUNTIME):
  3420. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3421. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3422. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3423. OPTS=['DIR:panda/src/tform', 'PYTHON']
  3424. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3425. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3426. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3427. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  3428. #
  3429. # DIRECTORY: panda/src/collide/
  3430. #
  3431. if (not RUNTIME):
  3432. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3433. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3434. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3435. OPTS=['DIR:panda/src/collide', 'PYTHON']
  3436. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3437. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3438. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3439. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  3440. #
  3441. # DIRECTORY: panda/src/parametrics/
  3442. #
  3443. if (not RUNTIME):
  3444. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3445. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3446. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3447. OPTS=['DIR:panda/src/parametrics', 'PYTHON']
  3448. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3449. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3450. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3451. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  3452. #
  3453. # DIRECTORY: panda/src/pgui/
  3454. #
  3455. if (not RUNTIME):
  3456. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3457. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3458. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3459. OPTS=['DIR:panda/src/pgui', 'PYTHON']
  3460. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3461. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3462. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3463. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  3464. #
  3465. # DIRECTORY: panda/src/pnmimagetypes/
  3466. #
  3467. if (not RUNTIME):
  3468. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3469. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3470. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3471. #
  3472. # DIRECTORY: panda/src/recorder/
  3473. #
  3474. if (not RUNTIME):
  3475. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3476. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3477. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3478. OPTS=['DIR:panda/src/recorder', 'PYTHON']
  3479. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3480. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3481. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3482. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  3483. #
  3484. # DIRECTORY: panda/src/dxml/
  3485. #
  3486. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3487. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3488. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3489. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3490. if (not RUNTIME):
  3491. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3492. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3493. OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON']
  3494. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3495. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3496. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3497. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  3498. #
  3499. # DIRECTORY: panda/metalibs/panda/
  3500. #
  3501. if (not RUNTIME):
  3502. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3503. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3504. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI']
  3505. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3506. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3507. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3508. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3509. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3510. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3511. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3512. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3513. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3514. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3515. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3516. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3517. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3518. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3519. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3520. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3521. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3522. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3523. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3524. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3525. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3526. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3527. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3528. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3529. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3530. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3531. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3532. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3533. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3534. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3535. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3536. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3537. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3538. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3539. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3540. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3541. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3542. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3543. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3544. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3545. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3546. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3547. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3548. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3549. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3550. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3551. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3552. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3553. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3554. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3555. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3556. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3557. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3558. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3559. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3560. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3561. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3562. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3563. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3564. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3565. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3566. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3567. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3568. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3569. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3570. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3571. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3572. if PkgSkip("FREETYPE")==0:
  3573. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3574. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3575. TargetAdd('libpanda.dll', opts=OPTS)
  3576. TargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3577. TargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3578. TargetAdd('core_module.obj', input='libp3prc.in')
  3579. TargetAdd('core_module.obj', input='libp3downloader.in')
  3580. TargetAdd('core_module.obj', input='libp3express.in')
  3581. TargetAdd('core_module.obj', input='libp3recorder.in')
  3582. TargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3583. TargetAdd('core_module.obj', input='libp3pgraph.in')
  3584. TargetAdd('core_module.obj', input='libp3cull.in')
  3585. TargetAdd('core_module.obj', input='libp3grutil.in')
  3586. TargetAdd('core_module.obj', input='libp3chan.in')
  3587. TargetAdd('core_module.obj', input='libp3pstatclient.in')
  3588. TargetAdd('core_module.obj', input='libp3char.in')
  3589. TargetAdd('core_module.obj', input='libp3collide.in')
  3590. TargetAdd('core_module.obj', input='libp3device.in')
  3591. TargetAdd('core_module.obj', input='libp3dgraph.in')
  3592. TargetAdd('core_module.obj', input='libp3display.in')
  3593. TargetAdd('core_module.obj', input='libp3pipeline.in')
  3594. TargetAdd('core_module.obj', input='libp3event.in')
  3595. TargetAdd('core_module.obj', input='libp3gobj.in')
  3596. TargetAdd('core_module.obj', input='libp3gsgbase.in')
  3597. TargetAdd('core_module.obj', input='libp3linmath.in')
  3598. TargetAdd('core_module.obj', input='libp3mathutil.in')
  3599. TargetAdd('core_module.obj', input='libp3parametrics.in')
  3600. TargetAdd('core_module.obj', input='libp3pnmimage.in')
  3601. TargetAdd('core_module.obj', input='libp3text.in')
  3602. TargetAdd('core_module.obj', input='libp3tform.in')
  3603. TargetAdd('core_module.obj', input='libp3putil.in')
  3604. TargetAdd('core_module.obj', input='libp3audio.in')
  3605. TargetAdd('core_module.obj', input='libp3nativenet.in')
  3606. TargetAdd('core_module.obj', input='libp3net.in')
  3607. TargetAdd('core_module.obj', input='libp3pgui.in')
  3608. TargetAdd('core_module.obj', input='libp3movies.in')
  3609. TargetAdd('core_module.obj', input='libp3dxml.in')
  3610. if PkgSkip("FREETYPE")==0:
  3611. TargetAdd('core_module.obj', input='libp3pnmtext.in')
  3612. TargetAdd('core_module.obj', opts=['PYTHON'])
  3613. TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3614. TargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3615. TargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3616. TargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3617. TargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3618. TargetAdd('core.pyd', input='libp3prc_igate.obj')
  3619. TargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3620. TargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3621. TargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3622. TargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3623. TargetAdd('core.pyd', input='libp3express_igate.obj')
  3624. TargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3625. TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3626. TargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3627. TargetAdd('core.pyd', input='libp3movies_igate.obj')
  3628. TargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3629. TargetAdd('core.pyd', input='libp3chan_igate.obj')
  3630. TargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3631. TargetAdd('core.pyd', input='libp3char_igate.obj')
  3632. TargetAdd('core.pyd', input='libp3collide_igate.obj')
  3633. TargetAdd('core.pyd', input='libp3device_igate.obj')
  3634. TargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3635. TargetAdd('core.pyd', input='libp3display_igate.obj')
  3636. TargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3637. TargetAdd('core.pyd', input='libp3event_igate.obj')
  3638. TargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3639. TargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3640. TargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3641. TargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3642. TargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3643. TargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3644. TargetAdd('core.pyd', input='libp3text_igate.obj')
  3645. TargetAdd('core.pyd', input='libp3tform_igate.obj')
  3646. TargetAdd('core.pyd', input='libp3putil_igate.obj')
  3647. TargetAdd('core.pyd', input='libp3audio_igate.obj')
  3648. TargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3649. TargetAdd('core.pyd', input='libp3net_igate.obj')
  3650. TargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3651. TargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3652. if PkgSkip("FREETYPE")==0:
  3653. TargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3654. TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3655. TargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3656. TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3657. TargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3658. TargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3659. TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3660. TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj')
  3661. TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj')
  3662. TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj')
  3663. TargetAdd('core.pyd', input='core_module.obj')
  3664. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3665. TargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3666. TargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3667. TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3668. TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2'])
  3669. #
  3670. # DIRECTORY: panda/src/vision/
  3671. #
  3672. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3673. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3674. if not PkgSkip("FFMPEG"):
  3675. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3676. if not PkgSkip("OPENCV"):
  3677. DefSymbol("OPENCV", "HAVE_OPENCV")
  3678. if OPENCV_VER_23:
  3679. DefSymbol("OPENCV", "OPENCV_VER_23")
  3680. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3681. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3682. 'dtool_have_ffmpeg.dat',
  3683. 'dtool_have_opencv.dat',
  3684. 'dtool_have_directcam.dat',
  3685. ])
  3686. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3687. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3688. TargetAdd('libp3vision.dll', opts=OPTS)
  3689. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON']
  3690. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3691. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3692. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3693. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  3694. TargetAdd('vision_module.obj', input='libp3vision.in')
  3695. TargetAdd('vision_module.obj', opts=OPTS)
  3696. TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3697. TargetAdd('vision.pyd', input='vision_module.obj')
  3698. TargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3699. TargetAdd('vision.pyd', input='libp3vision.dll')
  3700. TargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3701. TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3702. TargetAdd('vision.pyd', opts=['PYTHON'])
  3703. #
  3704. # DIRECTORY: panda/src/rocket/
  3705. #
  3706. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3707. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3708. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3709. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3710. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3711. TargetAdd('libp3rocket.dll', opts=OPTS)
  3712. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON']
  3713. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3714. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3715. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3716. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3717. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  3718. TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3719. TargetAdd('rocket_module.obj', input='libp3rocket.in')
  3720. TargetAdd('rocket_module.obj', opts=OPTS)
  3721. TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3722. TargetAdd('rocket.pyd', input='rocket_module.obj')
  3723. TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3724. TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3725. TargetAdd('rocket.pyd', input='libp3rocket.dll')
  3726. TargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3727. TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3728. TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET'])
  3729. #
  3730. # DIRECTORY: panda/src/p3awesomium
  3731. #
  3732. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  3733. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  3734. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  3735. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  3736. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  3737. TargetAdd('libp3awesomium.dll', opts=OPTS)
  3738. OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON']
  3739. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  3740. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  3741. TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  3742. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  3743. TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
  3744. TargetAdd('awesomium_module.obj', opts=OPTS)
  3745. TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core'])
  3746. TargetAdd('awesomium.pyd', input='awesomium_module.obj')
  3747. TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
  3748. TargetAdd('awesomium.pyd', input='libp3awesomium.dll')
  3749. TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll')
  3750. TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS)
  3751. TargetAdd('awesomium.pyd', opts=['PYTHON'])
  3752. #
  3753. # DIRECTORY: panda/src/p3skel
  3754. #
  3755. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3756. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3757. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3758. OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON']
  3759. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3760. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3761. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3762. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  3763. #
  3764. # DIRECTORY: panda/src/p3skel
  3765. #
  3766. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3767. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3768. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3769. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3770. TargetAdd('libpandaskel.dll', opts=OPTS)
  3771. OPTS=['PYTHON']
  3772. TargetAdd('skel_module.obj', input='libp3skel.in')
  3773. TargetAdd('skel_module.obj', opts=OPTS)
  3774. TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3775. TargetAdd('skel.pyd', input='skel_module.obj')
  3776. TargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3777. TargetAdd('skel.pyd', input='libpandaskel.dll')
  3778. TargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3779. TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3780. TargetAdd('skel.pyd', opts=['PYTHON'])
  3781. #
  3782. # DIRECTORY: panda/src/distort/
  3783. #
  3784. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3785. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3786. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3787. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3788. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3789. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3790. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3791. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  3792. #
  3793. # DIRECTORY: panda/metalibs/pandafx/
  3794. #
  3795. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3796. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3797. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3798. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3799. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3800. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3801. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3802. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3803. TargetAdd('fx_module.obj', input='libp3distort.in')
  3804. TargetAdd('fx_module.obj', opts=OPTS)
  3805. TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3806. TargetAdd('fx.pyd', input='fx_module.obj')
  3807. TargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3808. TargetAdd('fx.pyd', input='libpandafx.dll')
  3809. TargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3810. TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3811. TargetAdd('fx.pyd', opts=['PYTHON'])
  3812. #
  3813. # DIRECTORY: panda/src/vrpn/
  3814. #
  3815. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3816. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3817. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3818. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3819. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3820. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3821. OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON']
  3822. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3823. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3824. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3825. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  3826. TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3827. TargetAdd('vrpn_module.obj', opts=OPTS)
  3828. TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3829. TargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3830. TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3831. TargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3832. TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3833. TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3834. TargetAdd('vrpn.pyd', opts=['PYTHON'])
  3835. #
  3836. # DIRECTORY: panda/src/ffmpeg
  3837. #
  3838. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3839. if not PkgSkip("SWSCALE"):
  3840. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3841. if not PkgSkip("SWRESAMPLE"):
  3842. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3843. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3844. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3845. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3846. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3847. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3848. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3849. #
  3850. # DIRECTORY: panda/src/audiotraits/
  3851. #
  3852. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3853. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3854. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3855. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3856. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3857. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3858. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3859. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3860. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3861. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3862. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3863. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  3864. #
  3865. # DIRECTORY: panda/src/downloadertools/
  3866. #
  3867. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3868. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3869. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3870. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3871. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  3872. TargetAdd('apply_patch.exe', opts=OPTS)
  3873. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3874. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3875. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  3876. TargetAdd('build_patch.exe', opts=OPTS)
  3877. if not PkgSkip("ZLIB"):
  3878. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3879. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3880. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  3881. TargetAdd('check_adler.exe', opts=OPTS)
  3882. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3883. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3884. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  3885. TargetAdd('check_crc.exe', opts=OPTS)
  3886. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3887. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3888. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  3889. TargetAdd('check_md5.exe', opts=OPTS)
  3890. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3891. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3892. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3893. TargetAdd('pdecrypt.exe', opts=OPTS)
  3894. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3895. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3896. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3897. TargetAdd('pencrypt.exe', opts=OPTS)
  3898. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3899. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3900. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  3901. TargetAdd('show_ddb.exe', opts=OPTS)
  3902. #
  3903. # DIRECTORY: panda/src/downloadertools/
  3904. #
  3905. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3906. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3907. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3908. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3909. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3910. TargetAdd('multify.exe', opts=OPTS)
  3911. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3912. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3913. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3914. TargetAdd('pzip.exe', opts=OPTS)
  3915. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3916. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3917. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3918. TargetAdd('punzip.exe', opts=OPTS)
  3919. #
  3920. # DIRECTORY: panda/src/windisplay/
  3921. #
  3922. if (GetTarget() == 'windows' and not RUNTIME):
  3923. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3924. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3925. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3926. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3927. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3928. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3929. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3930. #
  3931. # DIRECTORY: panda/metalibs/pandadx9/
  3932. #
  3933. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  3934. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3935. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3936. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3937. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3938. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3939. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3940. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3941. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3942. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3943. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3944. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3945. #
  3946. # DIRECTORY: panda/src/egg/
  3947. #
  3948. if not RUNTIME and not PkgSkip("EGG"):
  3949. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3950. CreateFile(GetOutputDir()+"/include/parser.h")
  3951. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3952. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3953. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3954. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3955. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3956. OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON']
  3957. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3958. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3959. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3960. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3961. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3962. TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  3963. #
  3964. # DIRECTORY: panda/src/egg2pg/
  3965. #
  3966. if not RUNTIME and not PkgSkip("EGG"):
  3967. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3968. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3969. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3970. OPTS=['DIR:panda/src/egg2pg', 'PYTHON']
  3971. IGATEFILES=['load_egg_file.h']
  3972. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3973. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3974. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  3975. #
  3976. # DIRECTORY: panda/src/framework/
  3977. #
  3978. if (not RUNTIME):
  3979. deps = []
  3980. # Framework wants to link in a renderer when building statically, so tell it what is available.
  3981. if GetLinkAllStatic():
  3982. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  3983. if not PkgSkip("GL"):
  3984. DefSymbol("FRAMEWORK", "HAVE_GL")
  3985. if not PkgSkip("TINYDISPLAY"):
  3986. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  3987. if not PkgSkip("EGG"):
  3988. DefSymbol("FRAMEWORK", "HAVE_EGG")
  3989. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  3990. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  3991. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  3992. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  3993. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  3994. #
  3995. # DIRECTORY: panda/src/glgsg/
  3996. #
  3997. if (not RUNTIME and PkgSkip("GL")==0):
  3998. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  3999. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4000. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4001. #
  4002. # DIRECTORY: panda/src/glesgsg/
  4003. #
  4004. if (not RUNTIME and PkgSkip("GLES")==0):
  4005. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4006. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4007. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4008. #
  4009. # DIRECTORY: panda/src/gles2gsg/
  4010. #
  4011. if (not RUNTIME and PkgSkip("GLES2")==0):
  4012. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4013. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4014. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4015. #
  4016. # DIRECTORY: panda/metalibs/pandaegg/
  4017. #
  4018. if not RUNTIME and not PkgSkip("EGG"):
  4019. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4020. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4021. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4022. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4023. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4024. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4025. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4026. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4027. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4028. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4029. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4030. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON']
  4031. TargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4032. TargetAdd('egg_module.obj', input='libp3egg.in')
  4033. TargetAdd('egg_module.obj', opts=OPTS)
  4034. TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4035. TargetAdd('egg.pyd', input='egg_module.obj')
  4036. TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4037. TargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4038. TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4039. TargetAdd('egg.pyd', input='libpandaegg.dll')
  4040. TargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4041. TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4042. TargetAdd('egg.pyd', opts=['PYTHON'])
  4043. #
  4044. # DIRECTORY: panda/src/x11display/
  4045. #
  4046. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4047. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4048. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4049. #
  4050. # DIRECTORY: panda/src/glxdisplay/
  4051. #
  4052. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4053. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4054. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4055. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4056. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4057. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4058. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4059. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4060. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4061. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4062. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4063. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4064. #
  4065. # DIRECTORY: panda/src/cocoadisplay/
  4066. #
  4067. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4068. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4069. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4070. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4071. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4072. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4073. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4074. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4075. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4076. if (PkgSkip('PANDAFX')==0):
  4077. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4078. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4079. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4080. #
  4081. # DIRECTORY: panda/src/osxdisplay/
  4082. #
  4083. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4084. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4085. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4086. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4087. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4088. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4089. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4090. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4091. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4092. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4093. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4094. if (PkgSkip('PANDAFX')==0):
  4095. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4096. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4097. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4098. #
  4099. # DIRECTORY: panda/src/wgldisplay/
  4100. #
  4101. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4102. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4103. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4104. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4105. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4106. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4107. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4108. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4109. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4110. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4111. if (PkgSkip('PANDAFX')==0):
  4112. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4113. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4114. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4115. #
  4116. # DIRECTORY: panda/src/egldisplay/
  4117. #
  4118. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4119. DefSymbol('GLES', 'OPENGLES_1', '')
  4120. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4121. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4122. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4123. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4124. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4125. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4126. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4127. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4128. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4129. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4130. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4131. #
  4132. # DIRECTORY: panda/src/egldisplay/
  4133. #
  4134. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4135. DefSymbol('GLES2', 'OPENGLES_2', '')
  4136. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4137. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4138. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4139. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4140. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4141. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4142. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4143. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4144. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4145. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4146. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4147. #
  4148. # DIRECTORY: panda/src/ode/
  4149. #
  4150. if (PkgSkip("ODE")==0 and not RUNTIME):
  4151. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON']
  4152. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4153. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4154. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4155. OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON']
  4156. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4157. IGATEFILES.remove("odeConvexGeom.h")
  4158. IGATEFILES.remove("odeHeightFieldGeom.h")
  4159. IGATEFILES.remove("odeHelperStructs.h")
  4160. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4161. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4162. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  4163. TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4164. #
  4165. # DIRECTORY: panda/metalibs/pandaode/
  4166. #
  4167. if (PkgSkip("ODE")==0 and not RUNTIME):
  4168. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4169. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4170. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4171. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4172. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4173. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4174. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4175. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4176. OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON']
  4177. TargetAdd('ode_module.obj', input='libpandaode.in')
  4178. TargetAdd('ode_module.obj', opts=OPTS)
  4179. TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4180. TargetAdd('ode.pyd', input='ode_module.obj')
  4181. TargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4182. TargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4183. TargetAdd('ode.pyd', input='libpandaode.dll')
  4184. TargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4185. TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4186. TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE'])
  4187. #
  4188. # DIRECTORY: panda/src/bullet/
  4189. #
  4190. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4191. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4192. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4193. OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON']
  4194. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4195. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4196. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4197. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  4198. #
  4199. # DIRECTORY: panda/metalibs/pandabullet/
  4200. #
  4201. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4202. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4203. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4204. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4205. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4206. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4207. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4208. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON']
  4209. TargetAdd('bullet_module.obj', input='libpandabullet.in')
  4210. TargetAdd('bullet_module.obj', opts=OPTS)
  4211. TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4212. TargetAdd('bullet.pyd', input='bullet_module.obj')
  4213. TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4214. TargetAdd('bullet.pyd', input='libpandabullet.dll')
  4215. TargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4216. TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4217. TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET'])
  4218. #
  4219. # DIRECTORY: panda/src/physx/
  4220. #
  4221. if (PkgSkip("PHYSX")==0):
  4222. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4223. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4224. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4225. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4226. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4227. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4228. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  4229. #
  4230. # DIRECTORY: panda/metalibs/pandaphysx/
  4231. #
  4232. if (PkgSkip("PHYSX")==0):
  4233. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4234. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4235. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4236. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4237. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4238. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'PYTHON'])
  4239. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4240. TargetAdd('physx_module.obj', input='libpandaphysx.in')
  4241. TargetAdd('physx_module.obj', opts=OPTS)
  4242. TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4243. TargetAdd('physx.pyd', input='physx_module.obj')
  4244. TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4245. TargetAdd('physx.pyd', input='libpandaphysx.dll')
  4246. TargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4247. TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4248. TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4249. #
  4250. # DIRECTORY: panda/src/physics/
  4251. #
  4252. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4253. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4254. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4255. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4256. OPTS=['DIR:panda/src/physics', 'PYTHON']
  4257. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4258. IGATEFILES.remove("forces.h")
  4259. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4260. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4261. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  4262. #
  4263. # DIRECTORY: panda/src/particlesystem/
  4264. #
  4265. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4266. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4267. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4268. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4269. OPTS=['DIR:panda/src/particlesystem', 'PYTHON']
  4270. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4271. IGATEFILES.remove('orientedParticle.h')
  4272. IGATEFILES.remove('orientedParticleFactory.h')
  4273. IGATEFILES.remove('particlefactories.h')
  4274. IGATEFILES.remove('emitters.h')
  4275. IGATEFILES.remove('particles.h')
  4276. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4277. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4278. TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
  4279. #
  4280. # DIRECTORY: panda/metalibs/pandaphysics/
  4281. #
  4282. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4283. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4284. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4285. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4286. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4287. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4288. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4289. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4290. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4291. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4292. OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON']
  4293. TargetAdd('physics_module.obj', input='libp3physics.in')
  4294. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4295. TargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4296. TargetAdd('physics_module.obj', opts=OPTS)
  4297. TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4298. TargetAdd('physics.pyd', input='physics_module.obj')
  4299. TargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4300. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4301. TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4302. TargetAdd('physics.pyd', input='libpandaphysics.dll')
  4303. TargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4304. TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4305. TargetAdd('physics.pyd', opts=['PYTHON'])
  4306. #
  4307. # DIRECTORY: panda/src/speedtree/
  4308. #
  4309. if (PkgSkip("SPEEDTREE")==0):
  4310. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON']
  4311. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4312. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4313. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4314. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4315. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  4316. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4317. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4318. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4319. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4320. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4321. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4322. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4323. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4324. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4325. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4326. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4327. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4328. #
  4329. # DIRECTORY: panda/src/testbed/
  4330. #
  4331. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'android'):
  4332. OPTS=['DIR:panda/src/testbed']
  4333. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4334. TargetAdd('pview.exe', input='pview_pview.obj')
  4335. TargetAdd('pview.exe', input='libp3framework.dll')
  4336. if not PkgSkip("EGG"):
  4337. TargetAdd('pview.exe', input='libpandaegg.dll')
  4338. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4339. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4340. #
  4341. # DIRECTORY: panda/src/android/
  4342. #
  4343. if (not RUNTIME and GetTarget() == 'android'):
  4344. native_app_glue = os.path.join(SDK['ANDROID_NDK'], 'sources', 'android', 'native_app_glue')
  4345. OPTS=['DIR:panda/src/android', 'DIR:' + native_app_glue]
  4346. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4347. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4348. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4349. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4350. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4351. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4352. if (not RTDIST and PkgSkip("PVIEW")==0):
  4353. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4354. TargetAdd('pview.exe', input='android_native_app_glue.obj')
  4355. TargetAdd('pview.exe', input='android_main.obj')
  4356. TargetAdd('pview.exe', input='pview_pview.obj')
  4357. TargetAdd('pview.exe', input='libp3framework.dll')
  4358. if not PkgSkip("EGG"):
  4359. TargetAdd('pview.exe', input='libpandaegg.dll')
  4360. TargetAdd('pview.exe', input='libp3android.dll')
  4361. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4362. TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml')
  4363. #
  4364. # DIRECTORY: panda/src/androiddisplay/
  4365. #
  4366. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4367. DefSymbol('GLES', 'OPENGLES_1', '')
  4368. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'DIR:' + native_app_glue, 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4369. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4370. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4371. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4372. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4373. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4374. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4375. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4376. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4377. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4378. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4379. #
  4380. # DIRECTORY: panda/src/tinydisplay/
  4381. #
  4382. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4383. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4384. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4385. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4386. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4387. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4388. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4389. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4390. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4391. if GetTarget() == 'darwin':
  4392. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4393. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4394. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4395. elif GetTarget() == 'windows':
  4396. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4397. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4398. else:
  4399. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4400. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4401. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4402. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4403. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4404. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4405. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4406. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4407. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4408. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4409. #
  4410. # DIRECTORY: direct/src/directbase/
  4411. #
  4412. if (PkgSkip("DIRECT")==0):
  4413. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  4414. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4415. #
  4416. # DIRECTORY: direct/src/dcparser/
  4417. #
  4418. if (PkgSkip("DIRECT")==0):
  4419. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON']
  4420. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4421. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4422. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4423. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4424. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4425. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4426. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON']
  4427. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4428. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4429. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4430. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4431. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4432. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  4433. #
  4434. # DIRECTORY: direct/src/deadrec/
  4435. #
  4436. if (PkgSkip("DIRECT")==0):
  4437. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4438. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4439. OPTS=['DIR:direct/src/deadrec', 'PYTHON']
  4440. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4441. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4442. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4443. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  4444. #
  4445. # DIRECTORY: direct/src/distributed/
  4446. #
  4447. if (PkgSkip("DIRECT")==0):
  4448. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON']
  4449. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4450. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4451. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4452. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON']
  4453. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4454. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4455. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4456. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  4457. #
  4458. # DIRECTORY: direct/src/interval/
  4459. #
  4460. if (PkgSkip("DIRECT")==0):
  4461. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4462. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4463. OPTS=['DIR:direct/src/interval', 'PYTHON']
  4464. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4465. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4466. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4467. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  4468. #
  4469. # DIRECTORY: direct/src/showbase/
  4470. #
  4471. if (PkgSkip("DIRECT")==0):
  4472. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4473. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4474. if GetTarget() == 'darwin':
  4475. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4476. OPTS=['DIR:direct/src/showbase', 'PYTHON']
  4477. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4478. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4479. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4480. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  4481. #
  4482. # DIRECTORY: direct/src/motiontrail/
  4483. #
  4484. if (PkgSkip("DIRECT")==0):
  4485. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4486. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4487. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4488. OPTS=['DIR:direct/src/motiontrail', 'PYTHON']
  4489. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4490. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4491. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4492. TargetAdd('libp3motiontrail_igate.obj', input='libp3motiontrail.in', opts=["DEPENDENCYONLY"])
  4493. #
  4494. # DIRECTORY: direct/metalibs/direct/
  4495. #
  4496. if (PkgSkip("DIRECT")==0):
  4497. OPTS=['DIR:direct/metalibs/direct', 'BUILDING:DIRECT']
  4498. TargetAdd('p3direct_direct.obj', opts=OPTS, input='direct.cxx')
  4499. TargetAdd('libp3direct.dll', input='p3direct_direct.obj')
  4500. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4501. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4502. if GetTarget() == 'darwin':
  4503. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4504. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4505. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4506. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4507. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4508. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4509. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4510. OPTS=['DIR:direct/metalibs/direct', 'PYTHON']
  4511. TargetAdd('direct_module.obj', input='libp3dcparser.in')
  4512. TargetAdd('direct_module.obj', input='libp3showbase.in')
  4513. TargetAdd('direct_module.obj', input='libp3deadrec.in')
  4514. TargetAdd('direct_module.obj', input='libp3interval.in')
  4515. TargetAdd('direct_module.obj', input='libp3distributed.in')
  4516. TargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4517. TargetAdd('direct_module.obj', opts=OPTS)
  4518. TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4519. TargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4520. TargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4521. TargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4522. TargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4523. TargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4524. TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4525. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4526. # the Python libraries. If a C++ user needs these modules, we can move them
  4527. # back and filter out the Python-specific code.
  4528. TargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4529. TargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4530. TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4531. TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4532. TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4533. TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4534. TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4535. TargetAdd('direct.pyd', input='direct_module.obj')
  4536. TargetAdd('direct.pyd', input='libp3direct.dll')
  4537. TargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4538. TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4539. TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2'])
  4540. #
  4541. # DIRECTORY: direct/src/dcparse/
  4542. #
  4543. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4544. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON']
  4545. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4546. TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4547. TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4548. TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4549. TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4550. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4551. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4552. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4553. TargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4554. TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON'])
  4555. #
  4556. # DIRECTORY: direct/src/plugin/
  4557. #
  4558. if (RTDIST or RUNTIME):
  4559. # Explicitly define this as we don't include dtool_config.h here.
  4560. if GetTarget() not in ('windows', 'darwin'):
  4561. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4562. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4563. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4564. OPTS += ['ZLIB', 'MSIMG']
  4565. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4566. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4567. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4568. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4569. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4570. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4571. if GetTarget() == 'darwin':
  4572. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4573. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4574. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4575. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4576. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4577. if (RTDIST):
  4578. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4579. TargetAdd(fname, input='plugin_plugin.obj')
  4580. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4581. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4582. TargetAdd(fname, input='plugin_parse_color.obj')
  4583. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4584. if GetTarget() == 'darwin':
  4585. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4586. TargetAdd(fname, input='plugin_fileSpec.obj')
  4587. TargetAdd(fname, input='plugin_binaryXml.obj')
  4588. TargetAdd(fname, input='plugin_handleStream.obj')
  4589. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4590. TargetAdd(fname, input='libp3tinyxml.ilb')
  4591. if GetTarget() == 'darwin':
  4592. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4593. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4594. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4595. if (PkgSkip("PYTHON")==0 and RTDIST):
  4596. # Freeze VFSImporter and its dependency modules into p3dpython.
  4597. # Mark panda3d.core as a dependency to make sure to build that first.
  4598. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON'])
  4599. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4600. OPTS += ['PYTHON']
  4601. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4602. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4603. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4604. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4605. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4606. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4607. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4608. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4609. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4610. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4611. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4612. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4613. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4614. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4615. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4616. if GetTarget() == 'windows':
  4617. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4618. OPTS.append("NON_CONSOLE")
  4619. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4620. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4621. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4622. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4623. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4624. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4625. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4626. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4627. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  4628. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4629. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4630. if GetTarget() == 'darwin':
  4631. OPTS += ['OPT:2']
  4632. if (PkgSkip("FLTK")==0):
  4633. OPTS.append("FLTK")
  4634. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4635. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4636. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4637. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4638. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4639. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4640. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4641. if GetTarget() == 'darwin':
  4642. OPTS += ['OPT:2']
  4643. TargetAdd('p3dcert.exe', opts=OPTS)
  4644. elif (PkgSkip("WX")==0):
  4645. OPTS += ["WX", "RTTI"]
  4646. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4647. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4648. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4649. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4650. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4651. if GetTarget() == "darwin":
  4652. OPTS += ['GL', 'OPT:2']
  4653. TargetAdd('p3dcert.exe', opts=OPTS)
  4654. #
  4655. # DIRECTORY: direct/src/plugin_npapi/
  4656. #
  4657. if RUNTIME:
  4658. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4659. if GetTarget() == 'windows':
  4660. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4661. "version" : VERSION,
  4662. "description" : "Runs 3-D games and interactive applets",
  4663. "filename" : "nppanda3d.dll",
  4664. "mimetype" : "application/x-panda3d",
  4665. "extension" : "p3d",
  4666. "filedesc" : "Panda3D applet"}
  4667. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4668. elif GetTarget() == 'darwin':
  4669. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4670. OPTS += ['GTK2']
  4671. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4672. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4673. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4674. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4675. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4676. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4677. if GetTarget() == 'windows':
  4678. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4679. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4680. elif GetTarget() == 'darwin':
  4681. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4682. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4683. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4684. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4685. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4686. #
  4687. # DIRECTORY: direct/src/plugin_activex/
  4688. #
  4689. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4690. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4691. DefSymbol('ACTIVEX', '_USRDLL', '')
  4692. DefSymbol('ACTIVEX', '_WINDLL', '')
  4693. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4694. DefSymbol('ACTIVEX', '_MBCS', '')
  4695. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4696. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4697. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4698. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4699. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4700. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4701. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4702. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4703. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4704. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4705. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4706. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4707. #
  4708. # DIRECTORY: direct/src/plugin_standalone/
  4709. #
  4710. if (RUNTIME):
  4711. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4712. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4713. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4714. if GetTarget() == 'windows':
  4715. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4716. "version" : VERSION,
  4717. "description" : "Runs 3-D games and interactive applets",
  4718. "filename" : "panda3d.exe",
  4719. "mimetype" : "application/x-panda3d",
  4720. "extension" : "p3d",
  4721. "filedesc" : "Panda3D applet",
  4722. "icon" : "panda3d.ico"}
  4723. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4724. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4725. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4726. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4727. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4728. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4729. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4730. if GetTarget() == 'darwin':
  4731. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4732. elif GetTarget() == 'windows':
  4733. TargetAdd('panda3d.exe', input='panda3d.res')
  4734. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4735. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4736. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4737. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4738. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4739. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4740. if (GetTarget() == 'darwin'):
  4741. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4742. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4743. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4744. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4745. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4746. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4747. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4748. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4749. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4750. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4751. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4752. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4753. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4754. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4755. elif (GetTarget() == 'windows'):
  4756. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4757. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4758. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4759. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4760. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4761. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4762. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4763. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4764. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4765. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4766. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4767. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4768. if (RTDIST):
  4769. OPTS=['BUILDING:P3D_PLUGIN', 'DIR:direct/src/plugin_standalone', 'DIR:direct/src/plugin', 'DIR:dtool/src/dtoolbase', 'DIR:dtool/src/dtoolutil', 'DIR:dtool/src/pystub', 'DIR:dtool/src/prc', 'DIR:dtool/src/dconfig', 'DIR:panda/src/express', 'DIR:panda/src/downloader', 'RUNTIME', 'P3DEMBED', 'OPENSSL', 'ZLIB']
  4770. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4771. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4772. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4773. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4774. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4775. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4776. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4777. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4778. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4779. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4780. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4781. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4782. if (GetTarget() == 'darwin'):
  4783. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4784. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4785. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4786. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  4787. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4788. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4789. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4790. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4791. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4792. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4793. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4794. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4795. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4796. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4797. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4798. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4799. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4800. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4801. if GetTarget() == 'darwin':
  4802. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4803. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4804. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4805. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  4806. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4807. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4808. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4809. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4810. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4811. if GetTarget() == 'darwin':
  4812. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4813. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4814. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4815. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4816. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4817. if GetTarget() == 'windows':
  4818. OPTS.append("P3DEMBEDW")
  4819. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4820. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4821. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4822. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4823. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4824. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4825. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4826. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4827. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4828. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4829. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4830. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4831. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4832. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4833. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  4834. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4835. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4836. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4837. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4838. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4839. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4840. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4841. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4842. #
  4843. # DIRECTORY: pandatool/src/pandatoolbase/
  4844. #
  4845. if (PkgSkip("PANDATOOL")==0):
  4846. OPTS=['DIR:pandatool/src/pandatoolbase']
  4847. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4848. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4849. #
  4850. # DIRECTORY: pandatool/src/converter/
  4851. #
  4852. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4853. OPTS=['DIR:pandatool/src/converter']
  4854. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4855. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4856. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4857. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4858. #
  4859. # DIRECTORY: pandatool/src/progbase/
  4860. #
  4861. if not PkgSkip("PANDATOOL"):
  4862. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4863. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4864. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4865. #
  4866. # DIRECTORY: pandatool/src/eggbase/
  4867. #
  4868. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4869. OPTS=['DIR:pandatool/src/eggbase']
  4870. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4871. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4872. #
  4873. # DIRECTORY: pandatool/src/bam/
  4874. #
  4875. if not PkgSkip("PANDATOOL"):
  4876. OPTS=['DIR:pandatool/src/bam']
  4877. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4878. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4879. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4880. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4881. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4882. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4883. if not PkgSkip("EGG"):
  4884. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4885. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4886. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4887. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4888. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4889. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4890. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4891. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4892. #
  4893. # DIRECTORY: pandatool/src/cvscopy/
  4894. #
  4895. if not PkgSkip("PANDATOOL"):
  4896. OPTS=['DIR:pandatool/src/cvscopy']
  4897. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  4898. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  4899. #
  4900. # DIRECTORY: pandatool/src/daeegg/
  4901. #
  4902. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4903. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4904. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4905. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4906. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4907. #
  4908. # DIRECTORY: pandatool/src/assimp
  4909. #
  4910. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  4911. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4912. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4913. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4914. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4915. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB'])
  4916. #
  4917. # DIRECTORY: pandatool/src/daeprogs/
  4918. #
  4919. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4920. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4921. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4922. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4923. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4924. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4925. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4926. #
  4927. # DIRECTORY: pandatool/src/dxf/
  4928. #
  4929. if not PkgSkip("PANDATOOL"):
  4930. OPTS=['DIR:pandatool/src/dxf']
  4931. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4932. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4933. #
  4934. # DIRECTORY: pandatool/src/dxfegg/
  4935. #
  4936. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4937. OPTS=['DIR:pandatool/src/dxfegg']
  4938. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4939. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4940. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4941. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4942. #
  4943. # DIRECTORY: pandatool/src/dxfprogs/
  4944. #
  4945. if not PkgSkip("PANDATOOL"):
  4946. OPTS=['DIR:pandatool/src/dxfprogs']
  4947. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4948. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4949. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4950. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4951. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4952. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4953. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4954. if not PkgSkip("EGG"):
  4955. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4956. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4957. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4958. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4959. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4960. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4961. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4962. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4963. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4964. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4965. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4966. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  4967. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  4968. #
  4969. # DIRECTORY: pandatool/src/objegg/
  4970. #
  4971. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4972. OPTS=['DIR:pandatool/src/objegg']
  4973. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  4974. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  4975. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  4976. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  4977. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  4978. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  4979. #
  4980. # DIRECTORY: pandatool/src/objprogs/
  4981. #
  4982. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4983. OPTS=['DIR:pandatool/src/objprogs']
  4984. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  4985. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  4986. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  4987. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  4988. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  4989. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  4990. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  4991. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  4992. #
  4993. # DIRECTORY: pandatool/src/palettizer/
  4994. #
  4995. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4996. OPTS=['DIR:pandatool/src/palettizer']
  4997. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  4998. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  4999. #
  5000. # DIRECTORY: pandatool/src/egg-mkfont/
  5001. #
  5002. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5003. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5004. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5005. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5006. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5007. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5008. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5009. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5010. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5011. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5012. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5013. #
  5014. # DIRECTORY: pandatool/src/eggcharbase/
  5015. #
  5016. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5017. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5018. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5019. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5020. #
  5021. # DIRECTORY: pandatool/src/egg-optchar/
  5022. #
  5023. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5024. OPTS=['DIR:pandatool/src/egg-optchar']
  5025. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5026. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5027. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5028. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5029. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5030. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5031. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5032. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5033. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5034. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5035. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5036. #
  5037. # DIRECTORY: pandatool/src/egg-palettize/
  5038. #
  5039. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5040. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5041. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5042. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5043. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5044. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5045. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5046. #
  5047. # DIRECTORY: pandatool/src/egg-qtess/
  5048. #
  5049. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5050. OPTS=['DIR:pandatool/src/egg-qtess']
  5051. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5052. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5053. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5054. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5055. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5056. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5057. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5058. #
  5059. # DIRECTORY: pandatool/src/eggprogs/
  5060. #
  5061. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5062. OPTS=['DIR:pandatool/src/eggprogs']
  5063. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5064. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5065. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5066. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5067. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5068. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5069. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5070. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5071. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5072. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5073. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5074. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5075. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5076. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5077. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5078. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5079. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5080. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5081. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5082. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5083. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5084. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5085. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5086. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5087. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5088. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5089. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5090. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5091. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5092. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5093. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5094. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5095. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5096. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5097. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5098. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5099. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5100. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5101. #
  5102. # DIRECTORY: pandatool/src/flt/
  5103. #
  5104. if not PkgSkip("PANDATOOL"):
  5105. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5106. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5107. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5108. #
  5109. # DIRECTORY: pandatool/src/fltegg/
  5110. #
  5111. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5112. OPTS=['DIR:pandatool/src/fltegg']
  5113. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5114. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5115. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5116. #
  5117. # DIRECTORY: pandatool/src/fltprogs/
  5118. #
  5119. if not PkgSkip("PANDATOOL"):
  5120. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5121. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5122. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5123. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5124. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5125. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5126. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5127. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5128. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5129. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5130. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5131. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5132. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5133. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5134. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5135. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5136. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5137. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5138. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5139. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5140. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5141. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5142. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5143. if not PkgSkip("EGG"):
  5144. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5145. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5146. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5147. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5148. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5149. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5150. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5151. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5152. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5153. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5154. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5155. #
  5156. # DIRECTORY: pandatool/src/imagebase/
  5157. #
  5158. if not PkgSkip("PANDATOOL"):
  5159. OPTS=['DIR:pandatool/src/imagebase']
  5160. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5161. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5162. #
  5163. # DIRECTORY: pandatool/src/imageprogs/
  5164. #
  5165. if not PkgSkip("PANDATOOL"):
  5166. OPTS=['DIR:pandatool/src/imageprogs']
  5167. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5168. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5169. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5170. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5171. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5172. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5173. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5174. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5175. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5176. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5177. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5178. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5179. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5180. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5181. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5182. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5183. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5184. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5185. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5186. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5187. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5188. #
  5189. # DIRECTORY: pandatool/src/pfmprogs/
  5190. #
  5191. if not PkgSkip("PANDATOOL"):
  5192. OPTS=['DIR:pandatool/src/pfmprogs']
  5193. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5194. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5195. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5196. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5197. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5198. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5199. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5200. TargetAdd('pfm-bba_config_pfm.obj', opts=OPTS, input='config_pfm.cxx')
  5201. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5202. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfm.obj')
  5203. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5204. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5205. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5206. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5207. #
  5208. # DIRECTORY: pandatool/src/lwo/
  5209. #
  5210. if not PkgSkip("PANDATOOL"):
  5211. OPTS=['DIR:pandatool/src/lwo']
  5212. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5213. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5214. #
  5215. # DIRECTORY: pandatool/src/lwoegg/
  5216. #
  5217. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5218. OPTS=['DIR:pandatool/src/lwoegg']
  5219. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5220. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5221. #
  5222. # DIRECTORY: pandatool/src/lwoprogs/
  5223. #
  5224. if not PkgSkip("PANDATOOL"):
  5225. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5226. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5227. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5228. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5229. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5230. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5231. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5232. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5233. if not PkgSkip("EGG"):
  5234. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5235. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5236. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5237. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5238. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5239. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5240. #
  5241. # DIRECTORY: pandatool/src/maya/
  5242. #
  5243. for VER in MAYAVERSIONS:
  5244. VNUM=VER[4:]
  5245. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5246. OPTS=['DIR:pandatool/src/maya', VER]
  5247. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5248. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5249. #
  5250. # DIRECTORY: pandatool/src/mayaegg/
  5251. #
  5252. for VER in MAYAVERSIONS:
  5253. VNUM=VER[4:]
  5254. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5255. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5256. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5257. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5258. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5259. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5260. #
  5261. # DIRECTORY: pandatool/src/maxegg/
  5262. #
  5263. for VER in MAXVERSIONS:
  5264. VNUM=VER[3:]
  5265. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5266. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5267. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5268. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5269. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5270. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5271. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5272. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5273. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5274. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5275. #
  5276. # DIRECTORY: pandatool/src/maxprogs/
  5277. #
  5278. for VER in MAXVERSIONS:
  5279. VNUM=VER[3:]
  5280. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5281. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5282. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5283. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5284. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5285. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5286. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5287. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5288. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5289. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5290. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5291. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5292. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5293. #
  5294. # DIRECTORY: pandatool/src/vrml/
  5295. #
  5296. if not PkgSkip("PANDATOOL"):
  5297. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5298. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5299. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5300. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5301. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5302. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5303. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5304. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5305. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5306. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5307. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5308. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5309. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5310. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5311. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5312. #
  5313. # DIRECTORY: pandatool/src/vrmlegg/
  5314. #
  5315. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5316. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5317. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5318. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5319. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5320. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5321. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5322. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5323. #
  5324. # DIRECTORY: pandatool/src/xfile/
  5325. #
  5326. if not PkgSkip("PANDATOOL"):
  5327. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5328. CreateFile(GetOutputDir()+"/include/xParser.h")
  5329. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5330. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5331. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5332. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5333. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5334. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5335. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5336. #
  5337. # DIRECTORY: pandatool/src/xfileegg/
  5338. #
  5339. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5340. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5341. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5342. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5343. #
  5344. # DIRECTORY: pandatool/src/ptloader/
  5345. #
  5346. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5347. if not PkgSkip("FCOLLADA"):
  5348. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5349. 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']
  5350. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5351. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5352. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5353. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5354. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5355. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5356. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5357. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5358. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5359. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5360. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5361. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5362. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5363. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5364. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5365. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5366. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5367. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5368. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5369. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5370. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5371. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5372. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5373. #
  5374. # DIRECTORY: pandatool/src/miscprogs/
  5375. #
  5376. # This is a bit of an esoteric tool, and it causes issues because
  5377. # it conflicts with tools of the same name in different packages.
  5378. #if (PkgSkip("PANDATOOL")==0):
  5379. # OPTS=['DIR:pandatool/src/miscprogs']
  5380. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5381. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5382. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5383. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5384. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5385. # TargetAdd('bin2c.exe', input='libp3pystub.lib')
  5386. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5387. #
  5388. # DIRECTORY: pandatool/src/pstatserver/
  5389. #
  5390. if (PkgSkip("PANDATOOL")==0):
  5391. OPTS=['DIR:pandatool/src/pstatserver']
  5392. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5393. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5394. #
  5395. # DIRECTORY: pandatool/src/softprogs/
  5396. #
  5397. if (PkgSkip("PANDATOOL")==0):
  5398. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  5399. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  5400. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  5401. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  5402. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  5403. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  5404. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  5405. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  5406. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  5407. #
  5408. # DIRECTORY: pandatool/src/text-stats/
  5409. #
  5410. if (PkgSkip("PANDATOOL")==0):
  5411. OPTS=['DIR:pandatool/src/text-stats']
  5412. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5413. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5414. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5415. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5416. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5417. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5418. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5419. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5420. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5421. #
  5422. # DIRECTORY: pandatool/src/vrmlprogs/
  5423. #
  5424. if not PkgSkip("PANDATOOL"):
  5425. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5426. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5427. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5428. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5429. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5430. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5431. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5432. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5433. if not PkgSkip("EGG"):
  5434. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5435. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5436. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5437. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5438. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5439. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5440. #
  5441. # DIRECTORY: pandatool/src/win-stats/
  5442. # DIRECTORY: pandatool/src/gtk-stats/
  5443. #
  5444. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5445. if GetTarget() == 'windows':
  5446. OPTS=['DIR:pandatool/src/win-stats']
  5447. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5448. else:
  5449. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5450. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5451. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5452. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5453. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5454. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5455. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5456. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5457. #
  5458. # DIRECTORY: pandatool/src/xfileprogs/
  5459. #
  5460. if not PkgSkip("PANDATOOL"):
  5461. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5462. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5463. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5464. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5465. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5466. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5467. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5468. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5469. if not PkgSkip("EGG"):
  5470. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5471. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5472. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5473. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5474. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5475. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5476. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5477. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5478. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5479. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5480. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5481. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5482. #
  5483. # DIRECTORY: pandatool/src/mayaprogs/
  5484. #
  5485. for VER in MAYAVERSIONS:
  5486. VNUM = VER[4:]
  5487. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5488. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5489. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5490. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5491. continue
  5492. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5493. ARCH_OPTS = ['NOARCH:PPC']
  5494. else:
  5495. ARCH_OPTS = []
  5496. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5497. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5498. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5499. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5500. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5501. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5502. #if GetTarget() == 'windows':
  5503. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5504. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5505. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5506. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5507. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5508. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5509. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5510. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5511. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5512. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5513. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5514. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5515. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5516. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5517. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5518. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5519. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5520. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5521. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5522. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5523. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5524. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5525. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5526. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5527. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5528. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5529. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5530. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5531. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5532. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5533. if GetTarget() == 'windows':
  5534. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5535. else:
  5536. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5537. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5538. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5539. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5540. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5541. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5542. if GetTarget() == 'windows':
  5543. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5544. else:
  5545. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5546. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5547. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5548. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5549. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5550. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5551. if GetTarget() == 'windows':
  5552. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5553. else:
  5554. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5555. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5556. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5557. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5558. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5559. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5560. if GetTarget() == 'windows':
  5561. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5562. else:
  5563. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5564. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5565. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5566. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5567. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5568. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5569. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5570. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5571. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5572. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5573. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5574. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5575. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5576. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5577. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5578. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5579. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5580. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5581. #
  5582. # DIRECTORY: contrib/src/ai/
  5583. #
  5584. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5585. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5586. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5587. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5588. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5589. OPTS=['DIR:contrib/src/ai', 'PYTHON']
  5590. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5591. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5592. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5593. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  5594. TargetAdd('ai_module.obj', input='libpandaai.in')
  5595. TargetAdd('ai_module.obj', opts=OPTS)
  5596. TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5597. TargetAdd('ai.pyd', input='ai_module.obj')
  5598. TargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5599. TargetAdd('ai.pyd', input='libpandaai.dll')
  5600. TargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5601. TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5602. TargetAdd('ai.pyd', opts=['PYTHON'])
  5603. #
  5604. # Generate the models directory and samples directory
  5605. #
  5606. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5607. model_extensions = ["*.egg"]
  5608. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5609. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5610. model_extensions.append("*.flt")
  5611. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5612. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5613. newname = model[:-4] + ".egg.pz"
  5614. else:
  5615. newname = model[:-4] + ".egg"
  5616. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5617. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5618. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5619. newname = model[:-4] + ".egg.pz"
  5620. else:
  5621. newname = model[:-4] + ".egg"
  5622. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5623. for model in GetDirectoryContents("models", model_extensions):
  5624. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5625. newname = model[:-4] + ".egg.pz"
  5626. else:
  5627. newname = model[:-4] + ".egg"
  5628. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5629. if not PkgSkip("DIRECT") and not RUNTIME:
  5630. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5631. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5632. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5633. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5634. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5635. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5636. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5637. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5638. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5639. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5640. #
  5641. # Build the rtdist.
  5642. #
  5643. if (RTDIST):
  5644. OPTS=['DIR:direct/src/p3d']
  5645. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5646. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5647. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5648. #
  5649. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5650. #
  5651. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5652. OPTS=['DIR:direct/src/p3d']
  5653. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5654. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5655. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5656. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5657. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5658. ##########################################################################################
  5659. #
  5660. # Dependency-Based Distributed Build System.
  5661. #
  5662. ##########################################################################################
  5663. DEPENDENCYQUEUE=[]
  5664. for target in TARGET_LIST:
  5665. name = target.name
  5666. inputs = target.inputs
  5667. opts = target.opts
  5668. deps = target.deps
  5669. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5670. def BuildWorker(taskqueue, donequeue):
  5671. while True:
  5672. try:
  5673. task = taskqueue.get(timeout=1)
  5674. except:
  5675. ProgressOutput(None, "Waiting for tasks...")
  5676. task = taskqueue.get()
  5677. sys.stdout.flush()
  5678. if (task == 0): return
  5679. try:
  5680. task[0](*task[1])
  5681. donequeue.put(task)
  5682. except:
  5683. donequeue.put(0)
  5684. def AllSourcesReady(task, pending):
  5685. sources = task[3]
  5686. for x in sources:
  5687. if (x in pending):
  5688. return 0
  5689. sources = task[1][1]
  5690. for x in sources:
  5691. if (x in pending):
  5692. return 0
  5693. altsources = task[4]
  5694. for x in altsources:
  5695. if (x in pending):
  5696. return 0
  5697. return 1
  5698. def ParallelMake(tasklist):
  5699. # Create the communication queues.
  5700. donequeue = queue.Queue()
  5701. taskqueue = queue.Queue()
  5702. # Build up a table listing all the pending targets
  5703. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5704. # task[2] = [name]
  5705. # task[3] = deps
  5706. # The python tool package, in particular fltegg seems to throw parallelmake off
  5707. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5708. # and another subpart to be built sequentially. The most time consuming part of the process
  5709. # is the c++ code generation anyways.
  5710. tasklist_seq = []
  5711. i = 0
  5712. while i < len(tasklist):
  5713. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5714. break
  5715. i += 1
  5716. if i < len(tasklist):
  5717. tasklist_seq = tasklist[i:]
  5718. tasklist = tasklist[:i]
  5719. iNumStartingTasks = len(tasklist)
  5720. pending = {}
  5721. for task in tasklist:
  5722. for target in task[2]:
  5723. pending[target] = 1
  5724. # Create the workers
  5725. for slave in range(THREADCOUNT):
  5726. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5727. th.setDaemon(1)
  5728. th.start()
  5729. # Feed tasks to the workers.
  5730. tasksqueued = 0
  5731. while True:
  5732. if (tasksqueued < THREADCOUNT):
  5733. extras = []
  5734. for task in tasklist:
  5735. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5736. if (NeedsBuild(task[2], task[3])):
  5737. tasksqueued += 1
  5738. taskqueue.put(task)
  5739. else:
  5740. for target in task[2]:
  5741. del pending[target]
  5742. else:
  5743. extras.append(task)
  5744. tasklist = extras
  5745. sys.stdout.flush()
  5746. if (tasksqueued == 0): break
  5747. donetask = donequeue.get()
  5748. if (donetask == 0):
  5749. exit("Build process aborting.")
  5750. sys.stdout.flush()
  5751. tasksqueued -= 1
  5752. JustBuilt(donetask[2], donetask[3])
  5753. for target in donetask[2]:
  5754. del pending[target]
  5755. # Kill the workers.
  5756. for slave in range(THREADCOUNT):
  5757. taskqueue.put(0)
  5758. # Make sure there aren't any unsatisfied tasks
  5759. if len(tasklist) > 0:
  5760. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5761. SequentialMake(tasklist_seq)
  5762. def SequentialMake(tasklist):
  5763. i = 0
  5764. for task in tasklist:
  5765. if (NeedsBuild(task[2], task[3])):
  5766. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5767. JustBuilt(task[2], task[3])
  5768. i += 1
  5769. def RunDependencyQueue(tasklist):
  5770. if (THREADCOUNT!=0):
  5771. ParallelMake(tasklist)
  5772. else:
  5773. SequentialMake(tasklist)
  5774. try:
  5775. RunDependencyQueue(DEPENDENCYQUEUE)
  5776. except:
  5777. SaveDependencyCache()
  5778. raise
  5779. ##########################################################################################
  5780. #
  5781. # The Installers
  5782. #
  5783. # Under windows, we can build an 'exe' package using NSIS
  5784. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5785. # Under OSX, we can make a 'dmg' package.
  5786. #
  5787. ##########################################################################################
  5788. def MakeInstallerNSIS(file, title, installdir):
  5789. if (os.path.isfile(file)):
  5790. os.remove(file)
  5791. elif (os.path.isdir(file)):
  5792. shutil.rmtree(file)
  5793. if GetTargetArch() == 'x64':
  5794. regview = '64'
  5795. else:
  5796. regview = '32'
  5797. if (RUNTIME):
  5798. # Invoke the make_installer script.
  5799. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  5800. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  5801. cmd = sys.executable + " -B -u " + os.path.join("direct", "src", "plugin_installer", "make_installer.py")
  5802. cmd += " --version %s --regview %s" % (VERSION, regview)
  5803. if GetTargetArch() == 'x64':
  5804. cmd += " --install \"$PROGRAMFILES64\\Panda3D\" "
  5805. else:
  5806. cmd += " --install \"$PROGRAMFILES32\\Panda3D\" "
  5807. oscmd(cmd)
  5808. shutil.move(os.path.join("direct", "src", "plugin_installer", "p3d-setup.exe"), file)
  5809. return
  5810. print("Building "+title+" installer at %s" % (file))
  5811. if (COMPRESSOR != "lzma"):
  5812. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  5813. if (os.path.exists("nsis-output.exe")):
  5814. os.remove("nsis-output.exe")
  5815. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  5816. nsis_defs = {
  5817. 'COMPRESSOR' : COMPRESSOR,
  5818. 'TITLE' : title,
  5819. 'INSTALLDIR' : installdir,
  5820. 'OUTFILE' : '..\\' + file,
  5821. 'BUILT' : '..\\' + GetOutputDir(),
  5822. 'SOURCE' : '..',
  5823. 'PYVER' : SDK["PYTHONVERSION"][6:9],
  5824. 'REGVIEW' : regview,
  5825. }
  5826. if GetHost() == 'windows':
  5827. cmd = os.path.join(GetThirdpartyBase(), 'win-nsis', 'makensis') + ' /V2'
  5828. for item in nsis_defs.items():
  5829. cmd += ' /D%s="%s"' % item
  5830. else:
  5831. cmd = 'makensis -V2'
  5832. for item in nsis_defs.items():
  5833. cmd += ' -D%s="%s"' % item
  5834. cmd += ' "makepanda\installer.nsi"'
  5835. oscmd(cmd)
  5836. def MakeDebugSymbolArchive(zipname, dirname):
  5837. import zipfile
  5838. zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)
  5839. for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')):
  5840. zip.write(fn, dirname + '/bin/' + os.path.basename(fn))
  5841. for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')):
  5842. zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn))
  5843. for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')):
  5844. zip.write(fn, dirname + '/plugins/' + os.path.basename(fn))
  5845. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')):
  5846. zip.write(fn, dirname + '/python/' + os.path.basename(fn))
  5847. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')):
  5848. zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn))
  5849. zip.close()
  5850. INSTALLER_DEB_FILE="""
  5851. Package: panda3dMAJOR
  5852. Version: VERSION
  5853. Section: libdevel
  5854. Priority: optional
  5855. Architecture: ARCH
  5856. Essential: no
  5857. Depends: DEPENDS
  5858. Recommends: RECOMMENDS
  5859. Suggests: panda3d-runtime
  5860. Provides: panda3d
  5861. Conflicts: panda3d
  5862. Replaces: panda3d
  5863. Maintainer: rdb <[email protected]>
  5864. Installed-Size: INSTSIZE
  5865. Description: Panda3D free 3D engine SDK
  5866. 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.
  5867. 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.
  5868. .
  5869. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5870. """
  5871. RUNTIME_INSTALLER_DEB_FILE="""
  5872. Package: panda3d-runtime
  5873. Version: VERSION
  5874. Section: web
  5875. Priority: optional
  5876. Architecture: ARCH
  5877. Essential: no
  5878. Depends: DEPENDS
  5879. Provides: panda3d-runtime
  5880. Maintainer: rdb <[email protected]>
  5881. Installed-Size: INSTSIZE
  5882. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  5883. 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.
  5884. """
  5885. # We're not putting "python" in the "Requires" field,
  5886. # since the rpm-based distros don't have a common
  5887. # naming for the Python package.
  5888. INSTALLER_SPEC_FILE="""
  5889. Summary: The Panda3D free 3D engine SDK
  5890. Name: panda3d
  5891. Version: VERSION
  5892. Release: RPMRELEASE
  5893. License: BSD License
  5894. Group: Development/Libraries
  5895. BuildRoot: PANDASOURCE/targetroot
  5896. %description
  5897. 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.
  5898. 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.
  5899. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5900. %post
  5901. /sbin/ldconfig
  5902. %postun
  5903. /sbin/ldconfig
  5904. %files
  5905. %defattr(-,root,root)
  5906. /etc/Confauto.prc
  5907. /etc/Config.prc
  5908. /usr/share/panda3d
  5909. /usr/share/mime-info/panda3d.mime
  5910. /usr/share/mime-info/panda3d.keys
  5911. /usr/share/mime/packages/panda3d.xml
  5912. /usr/share/application-registry/panda3d.applications
  5913. /usr/share/applications/*.desktop
  5914. /etc/ld.so.conf.d/panda3d.conf
  5915. /usr/%_lib/panda3d
  5916. """ + PYTHON_SITEPACKAGES + """
  5917. /usr/include/panda3d
  5918. """
  5919. RUNTIME_INSTALLER_SPEC_FILE="""
  5920. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  5921. Name: panda3d-runtime
  5922. Version: VERSION
  5923. Release: RPMRELEASE
  5924. License: BSD License
  5925. Group: Productivity/Graphics/Other
  5926. BuildRoot: PANDASOURCE/targetroot
  5927. %description
  5928. 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.
  5929. %files
  5930. %defattr(-,root,root)
  5931. /usr/bin/panda3d
  5932. /usr/%_lib/nppanda3d.so
  5933. /usr/%_lib/mozilla/plugins/nppanda3d.so
  5934. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  5935. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  5936. /usr/share/mime-info/panda3d-runtime.mime
  5937. /usr/share/mime-info/panda3d-runtime.keys
  5938. /usr/share/mime/packages/panda3d-runtime.xml
  5939. /usr/share/application-registry/panda3d-runtime.applications
  5940. /usr/share/applications/*.desktop
  5941. """
  5942. # plist file for Mac OSX
  5943. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  5944. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  5945. <plist version="1.0">
  5946. <dict>
  5947. <key>CFBundleIdentifier</key>
  5948. <string>%(package_id)s</string>
  5949. <key>CFBundleShortVersionString</key>
  5950. <string>%(version)s</string>
  5951. <key>IFPkgFlagRelocatable</key>
  5952. <false/>
  5953. <key>IFPkgFlagAuthorizationAction</key>
  5954. <string>RootAuthorization</string>
  5955. <key>IFPkgFlagAllowBackRev</key>
  5956. <true/>
  5957. </dict>
  5958. </plist>
  5959. """
  5960. # FreeBSD pkg-descr
  5961. INSTALLER_PKG_DESCR_FILE = """
  5962. 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.
  5963. 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.
  5964. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5965. WWW: https://www.panda3d.org/
  5966. """
  5967. # FreeBSD pkg-descr
  5968. RUNTIME_INSTALLER_PKG_DESCR_FILE = """
  5969. Runtime binary and browser plugin for the Panda3D Game Engine
  5970. 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.
  5971. WWW: https://www.panda3d.org/
  5972. """
  5973. # FreeBSD PKG Manifest template file
  5974. INSTALLER_PKG_MANIFEST_FILE = """
  5975. name: NAME
  5976. version: VERSION
  5977. arch: ARCH
  5978. origin: ORIGIN
  5979. comment: "Panda3D free 3D engine SDK"
  5980. www: https://www.panda3d.org
  5981. maintainer: rdb <[email protected]>
  5982. prefix: /usr/local
  5983. flatsize: INSTSIZEMB
  5984. deps: {DEPENDS}
  5985. """
  5986. def MakeInstallerLinux():
  5987. if not RUNTIME and not PkgSkip("PYTHON"):
  5988. PYTHONV = SDK["PYTHONVERSION"].rstrip('dmu')
  5989. else:
  5990. PYTHONV = "python"
  5991. PV = PYTHONV.replace("python", "")
  5992. # Clean and set up a directory to install Panda3D into
  5993. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  5994. oscmd("mkdir --mode=0755 targetroot")
  5995. dpkg_present = False
  5996. if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"):
  5997. dpkg_present = True
  5998. rpmbuild_present = False
  5999. if os.path.exists("/usr/bin/rpmbuild"):
  6000. rpmbuild_present = True
  6001. if dpkg_present and rpmbuild_present:
  6002. print("Warning: both dpkg and rpmbuild present.")
  6003. if dpkg_present:
  6004. # Invoke installpanda.py to install it into a temporary dir
  6005. lib_dir = GetDebLibDir()
  6006. if RUNTIME:
  6007. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6008. else:
  6009. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6010. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6011. oscmd("mkdir -p targetroot/usr/share/man/man1")
  6012. oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/")
  6013. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  6014. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6015. if (RUNTIME):
  6016. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  6017. else:
  6018. txt = INSTALLER_DEB_FILE[1:]
  6019. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  6020. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  6021. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  6022. oscmd("cd targetroot && (find usr -type f -exec md5sum {} ;) > DEBIAN/md5sums")
  6023. if (not RUNTIME):
  6024. oscmd("cd targetroot && (find etc -type f -exec md5sum {} ;) >> DEBIAN/md5sums")
  6025. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  6026. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  6027. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  6028. # Determine the package name and the locations that
  6029. # dpkg-shlibdeps should look in for executables.
  6030. pkg_version = DEBVERSION
  6031. if RUNTIME:
  6032. pkg_name = "panda3d-runtime"
  6033. lib_pattern = "debian/%s/usr/%s/*.so" % (pkg_name, lib_dir)
  6034. else:
  6035. pkg_name = "panda3d" + MAJOR_VERSION
  6036. lib_pattern = "debian/%s/usr/%s/panda3d/*.so*" % (pkg_name, lib_dir)
  6037. bin_pattern = "debian/%s/usr/bin/*" % (pkg_name)
  6038. # dpkg-shlibdeps looks in the debian/{pkg_name}/DEBIAN/shlibs directory
  6039. # and also expects a debian/control file, so we create this dummy set-up.
  6040. oscmd("mkdir targetroot/debian")
  6041. oscmd("ln -s .. targetroot/debian/" + pkg_name)
  6042. WriteFile("targetroot/debian/control", "")
  6043. dpkg_shlibdeps = "dpkg-shlibdeps"
  6044. if GetVerbose():
  6045. dpkg_shlibdeps += " -v"
  6046. if RUNTIME:
  6047. # The runtime doesn't export any useful symbols, so just query the dependencies.
  6048. oscmd("cd targetroot && %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals())
  6049. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  6050. recommends = ""
  6051. else:
  6052. pkg_name = "panda3d" + MAJOR_VERSION
  6053. pkg_dir = "debian/panda3d" + MAJOR_VERSION
  6054. # Generate a symbols file so that other packages can know which symbols we export.
  6055. oscmd("cd targetroot && dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals())
  6056. # Library dependencies are required, binary dependencies are recommended.
  6057. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX.
  6058. oscmd("cd targetroot && LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_dep --ignore-missing-info -x%(pkg_name)s -xlibphysx-extras %(lib_pattern)s" % locals())
  6059. oscmd("cd targetroot && LD_LIBRARY_PATH=usr/%(lib_dir)s/panda3d %(dpkg_shlibdeps)s -Tdebian/substvars_rec --ignore-missing-info -x%(pkg_name)s %(bin_pattern)s" % locals())
  6060. # Parse the substvars files generated by dpkg-shlibdeps.
  6061. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  6062. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  6063. if PkgSkip("PYTHON")==0:
  6064. depends += ", " + PYTHONV
  6065. recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")"
  6066. if PkgSkip("NVIDIACG")==0:
  6067. depends += ", nvidia-cg-toolkit"
  6068. # Write back the dependencies, and delete the dummy set-up.
  6069. txt = txt.replace("DEPENDS", depends.strip(', '))
  6070. txt = txt.replace("RECOMMENDS", recommends.strip(', '))
  6071. WriteFile("targetroot/DEBIAN/control", txt)
  6072. oscmd("rm -rf targetroot/debian")
  6073. # Package it all up into a .deb file.
  6074. oscmd("chmod -R 755 targetroot/DEBIAN")
  6075. oscmd("chmod 644 targetroot/DEBIAN/control targetroot/DEBIAN/md5sums")
  6076. if not RUNTIME:
  6077. oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols")
  6078. oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch))
  6079. elif rpmbuild_present:
  6080. # Invoke installpanda.py to install it into a temporary dir
  6081. if RUNTIME:
  6082. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6083. else:
  6084. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6085. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6086. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  6087. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6088. pandasource = os.path.abspath(os.getcwd())
  6089. if RUNTIME:
  6090. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  6091. else:
  6092. txt = INSTALLER_SPEC_FILE[1:]
  6093. # Add the binaries in /usr/bin explicitly to the spec file
  6094. for base in os.listdir(GetOutputDir() + "/bin"):
  6095. txt += "/usr/bin/%s\n" % (base)
  6096. # Write out the spec file.
  6097. txt = txt.replace("VERSION", VERSION)
  6098. txt = txt.replace("RPMRELEASE", RPMRELEASE)
  6099. txt = txt.replace("PANDASOURCE", pandasource)
  6100. txt = txt.replace("PV", PV)
  6101. WriteFile("panda3d.spec", txt)
  6102. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  6103. if (RUNTIME):
  6104. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6105. else:
  6106. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6107. oscmd("rm -rf "+ARCH, True)
  6108. else:
  6109. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  6110. def MakeInstallerOSX():
  6111. if (RUNTIME):
  6112. # Invoke the make_installer script.
  6113. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  6114. cmdstr = sys.executable + " "
  6115. if sys.version_info >= (2, 6):
  6116. cmdstr += "-B "
  6117. cmdstr += "direct/src/plugin_installer/make_installer.py --version %s" % VERSION
  6118. oscmd(cmdstr)
  6119. return
  6120. dmg_name = "Panda3D-" + VERSION
  6121. if not SDK["PYTHONVERSION"].startswith("python2."):
  6122. dmg_name += '-py' + SDK["PYTHONVERSION"][6:9]
  6123. dmg_name += ".dmg"
  6124. import compileall
  6125. if (os.path.isfile(dmg_name)): oscmd("rm -f %s" % dmg_name)
  6126. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  6127. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  6128. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  6129. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  6130. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  6131. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  6132. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  6133. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  6134. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  6135. oscmd("cp -R %s/Frameworks dstroot/base/Developer/Panda3D/Frameworks" % GetOutputDir())
  6136. if os.path.isdir(GetOutputDir()+"/plugins"):
  6137. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  6138. # Libraries that shouldn't be in base, but are instead in other modules.
  6139. no_base_libs = ['libp3ffmpeg', 'libp3fmod_audio', 'libfmodex', 'libfmodexL']
  6140. for base in os.listdir(GetOutputDir()+"/lib"):
  6141. if not base.endswith(".a") and base.split('.')[0] not in no_base_libs:
  6142. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  6143. # We really need to specify -R in order not to follow symlinks
  6144. # On OSX, just specifying -P is not enough to do that.
  6145. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  6146. oscmd("mkdir -p dstroot/tools/Developer/Panda3D/bin")
  6147. oscmd("mkdir -p dstroot/tools/Developer/Tools")
  6148. oscmd("ln -s ../Panda3D/bin dstroot/tools/Developer/Tools/Panda3D")
  6149. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  6150. # Trailing newline is important, works around a bug in OSX
  6151. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Panda3D/bin\n")
  6152. oscmd("mkdir -p dstroot/tools/usr/local/share/man/man1")
  6153. oscmd("cp doc/man/*.1 dstroot/tools/usr/local/share/man/man1/")
  6154. for base in os.listdir(GetOutputDir()+"/bin"):
  6155. binname = "dstroot/tools/Developer/Panda3D/bin/" + base
  6156. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  6157. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  6158. if PkgSkip("PYTHON")==0:
  6159. PV = SDK["PYTHONVERSION"][6:9]
  6160. oscmd("mkdir -p dstroot/pythoncode/usr/local/bin")
  6161. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/panda3d")
  6162. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  6163. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D")
  6164. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/pandac" % GetOutputDir())
  6165. oscmd("cp -R %s/direct dstroot/pythoncode/Developer/Panda3D/direct" % GetOutputDir())
  6166. oscmd("ln -s %s dstroot/pythoncode/usr/local/bin/ppython" % SDK["PYTHONEXEC"])
  6167. oscmd("cp -R %s/*.so dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6168. oscmd("cp -R %s/*.py dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6169. if os.path.isdir(GetOutputDir()+"/Pmw"):
  6170. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/Pmw" % GetOutputDir())
  6171. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/Pmw")
  6172. WriteFile("dstroot/pythoncode/Developer/Panda3D/direct/__init__.py", "")
  6173. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/direct"):
  6174. if ((base != "extensions") and (base != "extensions_native")):
  6175. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/direct/"+base)
  6176. for base in os.listdir(GetOutputDir()+"/panda3d"):
  6177. if base.endswith('.py') or base.endswith('.so'):
  6178. libname = "dstroot/pythoncode/Developer/Panda3D/panda3d/" + base
  6179. # We really need to specify -R in order not to follow symlinks
  6180. # On OSX, just specifying -P is not enough to do that.
  6181. oscmd("cp -R -P " + GetOutputDir() + "/panda3d/" + base + " " + libname)
  6182. if not PkgSkip("FFMPEG"):
  6183. oscmd("mkdir -p dstroot/ffmpeg/Developer/Panda3D/lib")
  6184. oscmd("cp -R %s/lib/libp3ffmpeg.* dstroot/ffmpeg/Developer/Panda3D/lib/" % GetOutputDir())
  6185. #if not PkgSkip("OPENAL"):
  6186. # oscmd("mkdir -p dstroot/openal/Developer/Panda3D/lib")
  6187. # oscmd("cp -R %s/lib/libp3openal_audio.* dstroot/openal/Developer/Panda3D/lib/" % GetOutputDir())
  6188. if not PkgSkip("FMODEX"):
  6189. oscmd("mkdir -p dstroot/fmodex/Developer/Panda3D/lib")
  6190. oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6191. oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6192. oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib")
  6193. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  6194. if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"):
  6195. oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir())
  6196. if os.path.isdir("samples"):
  6197. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  6198. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  6199. oscmd("chmod -R 0775 dstroot/*")
  6200. DeleteVCS("dstroot")
  6201. DeleteBuildFiles("dstroot")
  6202. # We need to be root to perform a chown. Bleh.
  6203. # Fortunately PackageMaker does it for us, on 10.5 and above.
  6204. #oscmd("chown -R root:admin dstroot/*", True)
  6205. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  6206. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  6207. pkgs = ["base", "tools", "headers"]
  6208. if not PkgSkip("PYTHON"): pkgs.append("pythoncode")
  6209. if not PkgSkip("FFMPEG"): pkgs.append("ffmpeg")
  6210. #if not PkgSkip("OPENAL"): pkgs.append("openal")
  6211. if not PkgSkip("FMODEX"): pkgs.append("fmodex")
  6212. if os.path.isdir("samples"): pkgs.append("samples")
  6213. for pkg in pkgs:
  6214. identifier = "org.panda3d.panda3d.%s.pkg" % pkg
  6215. plist = open("/tmp/Info_plist", "w")
  6216. plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION })
  6217. plist.close()
  6218. if not os.path.isdir("dstroot/" + pkg):
  6219. os.makedirs("dstroot/" + pkg)
  6220. if OSXTARGET and OSXTARGET <= (10, 5):
  6221. target = '--target %d.%d' % (OSXTARGET)
  6222. else:
  6223. target = ''
  6224. if os.path.exists("/usr/bin/pkgbuild"):
  6225. # This new package builder is used in Lion and above.
  6226. cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg'
  6227. # In older versions, we use PackageMaker. Apple keeps changing its location.
  6228. elif os.path.exists("/Developer/usr/bin/packagemaker"):
  6229. cmd = '/Developer/usr/bin/packagemaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6230. elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6231. cmd = '/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6232. elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6233. cmd = '/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6234. elif os.path.exists("/Developer/Tools/packagemaker"):
  6235. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  6236. elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6237. cmd = '/Applications/PackageMaker.app/Contents/MacOS/PackageMaker --info /tmp/Info_plist --version ' + VERSION + ' --out dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg ' + target + ' --domain system --root dstroot/' + pkg + '/ --no-relocate'
  6238. else:
  6239. exit("Neither pkgbuild nor PackageMaker could be found!")
  6240. oscmd(cmd)
  6241. if os.path.isfile("/tmp/Info_plist"):
  6242. oscmd("rm -f /tmp/Info_plist")
  6243. # Now that we've built all of the individual packages, build the metapackage.
  6244. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  6245. dist.write('<?xml version="1.0" encoding="utf-8"?>\n')
  6246. dist.write('<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">\n')
  6247. dist.write(' <title>Panda3D SDK %s</title>\n' % (VERSION))
  6248. dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>\n')
  6249. dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
  6250. dist.write(' <choices-outline>\n')
  6251. for pkg in pkgs:
  6252. dist.write(' <line choice="%s"/>\n' % (pkg))
  6253. dist.write(' </choices-outline>\n')
  6254. dist.write(' <choice id="base" title="Panda3D Base Installation" description="This package contains the Panda3D libraries, configuration files and models/textures that are needed to use Panda3D. Location: /Developer/Panda3D/" start_enabled="false">\n')
  6255. dist.write(' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>\n')
  6256. dist.write(' </choice>\n')
  6257. dist.write(' <choice id="tools" title="Tools" tooltip="Useful tools and model converters to help with Panda3D development" description="This package contains the various utilities that ship with Panda3D, including packaging tools, model converters, and many more. Location: /Developer/Panda3D/bin/">\n')
  6258. dist.write(' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>\n')
  6259. dist.write(' </choice>\n')
  6260. if not PkgSkip("PYTHON"):
  6261. dist.write(' <choice id="pythoncode" title="Python Support" tooltip="Python bindings for the Panda3D libraries" description="This package contains the \'direct\', \'pandac\' and \'panda3d\' python packages that are needed to do Python development with Panda3D. Location: /Developer/Panda3D/">\n')
  6262. dist.write(' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>\n')
  6263. dist.write(' </choice>\n')
  6264. if not PkgSkip("FFMPEG"):
  6265. dist.write(' <choice id="ffmpeg" title="FFMpeg Plug-In" tooltip="FFMpeg video and audio decoding plug-in" description="This package contains the FFMpeg plug-in, which is used for decoding video and audio files with OpenAL.')
  6266. if PkgSkip("VORBIS") and PkgSkip("OPUS"):
  6267. dist.write(' It is not required for loading .wav files, which Panda3D can read out of the box.">\n')
  6268. elif PkgSkip("VORBIS"):
  6269. dist.write(' It is not required for loading .wav or .opus files, which Panda3D can read out of the box.">\n')
  6270. elif PkgSkip("OPUS"):
  6271. dist.write(' It is not required for loading .wav or .ogg files, which Panda3D can read out of the box.">\n')
  6272. else:
  6273. dist.write(' It is not required for loading .wav, .ogg or .opus files, which Panda3D can read out of the box.">\n')
  6274. dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
  6275. dist.write(' </choice>\n')
  6276. #if not PkgSkip("OPENAL"):
  6277. # dist.write(' <choice id="openal" title="OpenAL Audio Plug-In" tooltip="OpenAL audio output plug-in" description="This package contains the OpenAL audio plug-in, which is an open-source library for playing sounds.">\n')
  6278. # dist.write(' <pkg-ref id="org.panda3d.panda3d.openal.pkg"/>\n')
  6279. # dist.write(' </choice>\n')
  6280. if not PkgSkip("FMODEX"):
  6281. dist.write(' <choice id="fmodex" title="FMOD Ex Plug-In" tooltip="FMOD Ex audio output plug-in" description="This package contains the FMOD Ex audio plug-in, which is a commercial library for playing sounds. It is an optional component as Panda3D can use the open-source alternative OpenAL instead.">\n')
  6282. dist.write(' <pkg-ref id="org.panda3d.panda3d.fmodex.pkg"/>\n')
  6283. dist.write(' </choice>\n')
  6284. if os.path.isdir("samples"):
  6285. dist.write(' <choice id="samples" title="Sample Programs" tooltip="Python sample programs that use Panda3D" description="This package contains the Python sample programs that can help you with learning how to use Panda3D. Location: /Developer/Examples/Panda3D/">\n')
  6286. dist.write(' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>\n')
  6287. dist.write(' </choice>\n')
  6288. dist.write(' <choice id="headers" title="C++ Header Files" tooltip="Header files for C++ development with Panda3D" description="This package contains the C++ header files that are needed in order to do C++ development with Panda3D. You don\'t need this if you want to develop in Python. Location: /Developer/Panda3D/include/" start_selected="false">\n')
  6289. dist.write(' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>\n')
  6290. dist.write(' </choice>\n')
  6291. for pkg in pkgs:
  6292. size = GetDirectorySize("dstroot/" + pkg) // 1024
  6293. dist.write(' <pkg-ref id="org.panda3d.panda3d.%s.pkg" installKBytes="%d" version="1" auth="Root">file:./Contents/Packages/%s.pkg</pkg-ref>\n' % (pkg, size, pkg))
  6294. dist.write('</installer-script>\n')
  6295. dist.close()
  6296. oscmd('hdiutil create Panda3D-rw.dmg -volname "Panda3D SDK %s" -srcfolder dstroot/Panda3D' % (VERSION))
  6297. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o %s' % (dmg_name))
  6298. oscmd('rm -f Panda3D-rw.dmg')
  6299. def MakeInstallerFreeBSD():
  6300. oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
  6301. oscmd("mkdir targetroot")
  6302. # Invoke installpanda.py to install it into a temporary dir
  6303. if RUNTIME:
  6304. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6305. else:
  6306. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6307. if not os.path.exists("/usr/sbin/pkg"):
  6308. exit("Cannot create an installer without pkg")
  6309. plist_txt = ''
  6310. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  6311. for f in files:
  6312. plist_txt += os.path.join(root, f)[21:] + "\n"
  6313. if not RUNTIME:
  6314. plist_txt += "@postexec /sbin/ldconfig -m /usr/local/lib/panda3d\n"
  6315. plist_txt += "@postunexec /sbin/ldconfig -R\n"
  6316. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  6317. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  6318. for d in dirs:
  6319. plist_txt += "@dir %s\n" % os.path.join(root, d)[21:]
  6320. plist_txt += "@dir %s\n" % remdir
  6321. oscmd("echo \"`pkg config abi | tr '[:upper:]' '[:lower:]' | cut -d: -f1,2`:*\" > " + GetOutputDir() + "/tmp/architecture.txt")
  6322. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6323. dependencies = ''
  6324. if PkgSkip("PYTHON") == 0:
  6325. # If this version of Python was installed from a package or ports, let's mark it as dependency.
  6326. oscmd("rm -f %s/tmp/python_dep" % GetOutputDir())
  6327. oscmd("pkg query \"\n\t%%n : {\n\t\torigin : %%o,\n\t\tversion : %%v\n\t},\n\" python%s > %s/tmp/python_dep" % (SDK["PYTHONVERSION"][6:9:2], GetOutputDir()), True)
  6328. if os.path.isfile(GetOutputDir() + "/tmp/python_dep"):
  6329. python_pkg = ReadFile(GetOutputDir() + "/tmp/python_dep")
  6330. if python_pkg:
  6331. dependencies += python_pkg
  6332. manifest_txt = INSTALLER_PKG_MANIFEST_FILE[1:].replace("NAME", 'panda3d' if not RUNTIME else 'panda3d-runtime')
  6333. manifest_txt = manifest_txt.replace("VERSION", VERSION)
  6334. manifest_txt = manifest_txt.replace("ARCH", pkg_arch)
  6335. manifest_txt = manifest_txt.replace("ORIGIN", 'devel/panda3d' if not RUNTIME else 'graphics/panda3d-runtime')
  6336. manifest_txt = manifest_txt.replace("DEPENDS", dependencies)
  6337. manifest_txt = manifest_txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024 / 1024))
  6338. WriteFile("pkg-plist", plist_txt)
  6339. WriteFile("+DESC", INSTALLER_PKG_DESCR_FILE[1:] if not RUNTIME else RUNTIME_INSTALLER_PKG_DESCR_FILE[1:])
  6340. WriteFile("+MANIFEST", manifest_txt)
  6341. oscmd("pkg create -p pkg-plist -r %s -m . -o . %s" % (os.path.abspath("targetroot"), "--verbose" if GetVerbose() else "--quiet"))
  6342. try:
  6343. if INSTALLER:
  6344. ProgressOutput(100.0, "Building installer")
  6345. target = GetTarget()
  6346. if target == 'windows':
  6347. fn = "Panda3D-"
  6348. dir = "Panda3D-" + VERSION
  6349. if RUNTIME:
  6350. fn += "Runtime-"
  6351. title = "Panda3D " + VERSION
  6352. else:
  6353. title = "Panda3D SDK " + VERSION
  6354. fn += VERSION
  6355. if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7":
  6356. fn += '-py' + SDK["PYTHONVERSION"][6:]
  6357. if GetOptimize() <= 2:
  6358. fn += "-dbg"
  6359. if GetTargetArch() == 'x64':
  6360. fn += '-x64'
  6361. dir += '-x64'
  6362. MakeInstallerNSIS(fn + '.exe', title, 'C:\\' + dir)
  6363. if not RUNTIME:
  6364. MakeDebugSymbolArchive(fn + '-pdb.zip', dir)
  6365. elif (target == 'linux'):
  6366. MakeInstallerLinux()
  6367. elif (target == 'darwin'):
  6368. MakeInstallerOSX()
  6369. elif (target == 'freebsd'):
  6370. MakeInstallerFreeBSD()
  6371. else:
  6372. exit("Do not know how to make an installer for this platform")
  6373. if WHEEL:
  6374. ProgressOutput(100.0, "Building wheel")
  6375. from makewheel import makewheel
  6376. makewheel(WHLVERSION, GetOutputDir())
  6377. finally:
  6378. SaveDependencyCache()
  6379. ##########################################################################################
  6380. #
  6381. # Print final status report.
  6382. #
  6383. ##########################################################################################
  6384. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6385. printStatus("Makepanda Final Status Report", WARNINGS)
  6386. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())