makepanda.py 333 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469
  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. RUNTESTS=0
  41. GENMAN=0
  42. COMPRESSOR="zlib"
  43. THREADCOUNT=0
  44. CFLAGS=""
  45. CXXFLAGS=""
  46. LDFLAGS=""
  47. RTDIST=0
  48. RTDIST_VERSION=None
  49. RUNTIME=0
  50. DISTRIBUTOR=""
  51. VERSION=None
  52. DEBVERSION=None
  53. WHLVERSION=None
  54. RPMRELEASE="1"
  55. GIT_COMMIT=None
  56. P3DSUFFIX=None
  57. MAJOR_VERSION=None
  58. COREAPI_VERSION=None
  59. PLUGIN_VERSION=None
  60. OSXTARGET=None
  61. OSX_ARCHS=[]
  62. HOST_URL=None
  63. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  64. STRDXSDKVERSION = 'default'
  65. WINDOWS_SDK = None
  66. MSVC_VERSION = None
  67. BOOUSEINTELCOMPILER = False
  68. OPENCV_VER_23 = False
  69. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  70. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  71. PkgListSet(["PYTHON", "DIRECT", # Python support
  72. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  73. "EGL", # OpenGL (ES) integration
  74. "EIGEN", # Linear algebra acceleration
  75. "OPENAL", "FMODEX", # Audio playback
  76. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  77. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  78. "SPEEDTREE", # SpeedTree
  79. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  80. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  81. "FREETYPE", "HARFBUZZ", # Text rendering
  82. "VRPN", "OPENSSL", # Transport
  83. "FFTW", # Algorithm helpers
  84. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  85. "GTK2", # GTK2 is used for PStats on Unix
  86. "MFC", "WX", "FLTK", # Used for web plug-in only
  87. "ROCKET", "AWESOMIUM", # GUI libraries
  88. "CARBON", "COCOA", # Mac OS X toolkits
  89. "X11", # Unix platform support
  90. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  91. "SKEL", # Example SKEL project
  92. "PANDAFX", # Some distortion special lenses
  93. "PANDAPARTICLESYSTEM", # Built in particle system
  94. "CONTRIB", # Experimental
  95. "SSE2", "NEON", # Compiler features
  96. ])
  97. CheckPandaSourceTree()
  98. def keyboardInterruptHandler(x,y):
  99. exit("keyboard interrupt")
  100. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  101. ########################################################################
  102. ##
  103. ## Command-line parser.
  104. ##
  105. ## You can type "makepanda --help" to see all the options.
  106. ##
  107. ########################################################################
  108. def usage(problem):
  109. if (problem):
  110. print("")
  111. print("Error parsing command-line input: %s" % (problem))
  112. print("")
  113. print("Makepanda generates a 'built' subdirectory containing a")
  114. print("compiled copy of Panda3D. Command-line arguments are:")
  115. print("")
  116. print(" --help (print the help message you're reading now)")
  117. print(" --verbose (print out more information)")
  118. print(" --runtime (build a runtime build instead of an SDK build)")
  119. print(" --tests (run the test suite)")
  120. print(" --installer (build an installer)")
  121. print(" --wheel (build a pip-installable .whl)")
  122. print(" --optimize X (optimization level can be 1,2,3,4)")
  123. print(" --version X (set the panda version number)")
  124. print(" --lzma (use lzma compression when building Windows installer)")
  125. print(" --distributor X (short string identifying the distributor of the build)")
  126. print(" --outputdir X (use the specified directory instead of 'built')")
  127. print(" --host URL (set the host url (runtime build only))")
  128. print(" --threads N (use the multithreaded build system. see manual)")
  129. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  130. print(" --universal (build universal binaries (OS X only))")
  131. print(" --override \"O=V\" (override dtool_config/prc option value)")
  132. print(" --static (builds libraries for static linking)")
  133. print(" --target X (experimental cross-compilation (android only))")
  134. print(" --arch X (target architecture for cross-compilation)")
  135. print("")
  136. for pkg in PkgListGet():
  137. p = pkg.lower()
  138. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  139. if sys.platform != 'win32':
  140. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  141. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  142. print("")
  143. print(" --nothing (disable every third-party lib)")
  144. print(" --everything (enable every third-party lib)")
  145. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  146. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  147. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
  148. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  149. print("")
  150. print("The simplest way to compile panda is to just type:")
  151. print("")
  152. print(" makepanda --everything")
  153. print("")
  154. os._exit(1)
  155. def parseopts(args):
  156. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  157. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  158. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  159. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  160. longopts = [
  161. "help","distributor=","verbose","runtime","osxtarget=","tests",
  162. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  163. "version=","lzma","no-python","threads=","outputdir=","override=",
  164. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  165. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  166. "universal", "target=", "arch=", "git-commit=", "no-directscripts",
  167. "use-touchinput", "no-touchinput"]
  168. anything = 0
  169. optimize = ""
  170. target = None
  171. target_arch = None
  172. universal = False
  173. clean_build = False
  174. for pkg in PkgListGet():
  175. longopts.append("use-" + pkg.lower())
  176. longopts.append("no-" + pkg.lower())
  177. longopts.append(pkg.lower() + "-incdir=")
  178. longopts.append(pkg.lower() + "-libdir=")
  179. try:
  180. opts, extras = getopt.getopt(args, "", longopts)
  181. for option, value in opts:
  182. if (option=="--help"): raise Exception
  183. elif (option=="--optimize"): optimize=value
  184. elif (option=="--installer"): INSTALLER=1
  185. elif (option=="--tests"): RUNTESTS=1
  186. elif (option=="--wheel"): WHEEL=1
  187. elif (option=="--verbose"): SetVerbose(True)
  188. elif (option=="--distributor"): DISTRIBUTOR=value
  189. elif (option=="--rtdist"): RTDIST=1
  190. elif (option=="--runtime"): RUNTIME=1
  191. elif (option=="--genman"): GENMAN=1
  192. elif (option=="--everything"): PkgEnableAll()
  193. elif (option=="--nothing"): PkgDisableAll()
  194. elif (option=="--threads"): THREADCOUNT=int(value)
  195. elif (option=="--outputdir"): SetOutputDir(value.strip())
  196. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  197. elif (option=="--universal"): universal = True
  198. elif (option=="--target"): target = value.strip()
  199. elif (option=="--arch"): target_arch = value.strip()
  200. elif (option=="--nocolor"): DisableColors()
  201. elif (option=="--version"):
  202. match = re.match(r'^\d+\.\d+\.\d+', value)
  203. if not match:
  204. usage("version requires three digits")
  205. WHLVERSION = value
  206. VERSION = match.group()
  207. elif (option=="--lzma"): COMPRESSOR="lzma"
  208. elif (option=="--override"): AddOverride(value.strip())
  209. elif (option=="--static"): SetLinkAllStatic(True)
  210. elif (option=="--host"): HOST_URL=value
  211. elif (option=="--debversion"): DEBVERSION=value
  212. elif (option=="--rpmrelease"): RPMRELEASE=value
  213. elif (option=="--git-commit"): GIT_COMMIT=value
  214. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  215. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  216. # Backward compatibility, OPENGL was renamed to GL
  217. elif (option=="--use-opengl"): PkgEnable("GL")
  218. elif (option=="--no-opengl"): PkgDisable("GL")
  219. elif (option=="--no-directscripts"): pass
  220. elif (option=="--directx-sdk"):
  221. STRDXSDKVERSION = value.strip().lower()
  222. if STRDXSDKVERSION == '':
  223. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  224. STRDXSDKVERSION = 'default'
  225. elif (option=="--windows-sdk"):
  226. WINDOWS_SDK = value.strip().lower()
  227. elif (option=="--msvc-version"):
  228. MSVC_VERSION = value.strip().lower()
  229. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  230. elif (option=="--clean"): clean_build = True
  231. else:
  232. for pkg in PkgListGet():
  233. if option == "--use-" + pkg.lower():
  234. PkgEnable(pkg)
  235. break
  236. elif option == "--no-" + pkg.lower():
  237. PkgDisable(pkg)
  238. break
  239. elif option == "--" + pkg.lower() + "-incdir":
  240. PkgSetCustomLocation(pkg)
  241. IncDirectory(pkg, value)
  242. break
  243. elif option == "--" + pkg.lower() + "-libdir":
  244. PkgSetCustomLocation(pkg)
  245. LibDirectory(pkg, value)
  246. break
  247. if (option == "--everything" or option.startswith("--use-")
  248. or option == "--nothing" or option.startswith("--no-")):
  249. anything = 1
  250. except:
  251. usage(sys.exc_info()[1])
  252. if not anything:
  253. if RUNTIME:
  254. PkgEnableAll()
  255. else:
  256. usage("You should specify a list of packages to use or --everything to enable all packages.")
  257. if (RTDIST and RUNTIME):
  258. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  259. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  260. elif (optimize==""): optimize = "3"
  261. if OSXTARGET:
  262. try:
  263. maj, min = OSXTARGET.strip().split('.')
  264. OSXTARGET = int(maj), int(min)
  265. assert OSXTARGET[0] == 10
  266. except:
  267. usage("Invalid setting for OSXTARGET")
  268. else:
  269. OSXTARGET = None
  270. if target is not None or target_arch is not None:
  271. SetTarget(target, target_arch)
  272. if universal:
  273. if target_arch:
  274. exit("--universal is incompatible with --arch")
  275. OSX_ARCHS.append("i386")
  276. if OSXTARGET:
  277. osxver = OSXTARGET
  278. else:
  279. maj, min = platform.mac_ver()[0].split('.')[:2]
  280. osxver = int(maj), int(min)
  281. if osxver[1] < 6:
  282. OSX_ARCHS.append("ppc")
  283. else:
  284. OSX_ARCHS.append("x86_64")
  285. elif HasTargetArch():
  286. OSX_ARCHS.append(GetTargetArch())
  287. try:
  288. SetOptimize(int(optimize))
  289. assert GetOptimize() in [1, 2, 3, 4]
  290. except:
  291. usage("Invalid setting for OPTIMIZE")
  292. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  293. usage("Invalid SHA-1 hash given for --git-commit option!")
  294. if GetTarget() == 'windows':
  295. if not MSVC_VERSION:
  296. print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
  297. MSVC_VERSION = (10, 0)
  298. else:
  299. try:
  300. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  301. if (len(MSVC_VERSION) == 1):
  302. MSVC_VERSION += (0,)
  303. except:
  304. usage("Invalid setting for --msvc-version")
  305. if not WINDOWS_SDK:
  306. print("No Windows SDK version specified. Defaulting to '7.1'.")
  307. WINDOWS_SDK = '7.1'
  308. if clean_build and os.path.isdir(GetOutputDir()):
  309. print("Deleting %s" % (GetOutputDir()))
  310. shutil.rmtree(GetOutputDir())
  311. parseopts(sys.argv[1:])
  312. ########################################################################
  313. ##
  314. ## Handle environment variables.
  315. ##
  316. ########################################################################
  317. if ("CFLAGS" in os.environ):
  318. CFLAGS = os.environ["CFLAGS"].strip()
  319. if ("CXXFLAGS" in os.environ):
  320. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  321. if ("RPM_OPT_FLAGS" in os.environ):
  322. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  323. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  324. if ("LDFLAGS" in os.environ):
  325. LDFLAGS = os.environ["LDFLAGS"].strip()
  326. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  327. if GetHost() == "darwin" and OSXTARGET is not None:
  328. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  329. ########################################################################
  330. ##
  331. ## Configure things based on the command-line parameters.
  332. ##
  333. ########################################################################
  334. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  335. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  336. if VERSION is None:
  337. if RUNTIME:
  338. VERSION = PLUGIN_VERSION
  339. else:
  340. # Take the value from the setup.cfg file.
  341. VERSION = GetMetadataValue('version')
  342. if WHLVERSION is None:
  343. WHLVERSION = VERSION
  344. print("Version: %s" % VERSION)
  345. if RUNTIME or RTDIST:
  346. print("Core API Version: %s" % COREAPI_VERSION)
  347. if DEBVERSION is None:
  348. DEBVERSION = VERSION
  349. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  350. if P3DSUFFIX is None:
  351. P3DSUFFIX = MAJOR_VERSION
  352. outputdir_suffix = ""
  353. if (RUNTIME or RTDIST):
  354. # Compiling Maya/Max is pointless in rtdist build
  355. for ver in MAYAVERSIONS + MAXVERSIONS:
  356. PkgDisable(ver)
  357. if (DISTRIBUTOR.strip() == ""):
  358. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  359. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  360. if (RUNTIME):
  361. outputdir_suffix += "_rt"
  362. if DISTRIBUTOR == "":
  363. DISTRIBUTOR = "makepanda"
  364. elif not RTDIST_VERSION:
  365. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  366. if not RTDIST_VERSION:
  367. RTDIST_VERSION = "dev"
  368. if not IsCustomOutputDir():
  369. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  370. outputdir_suffix += '_x64'
  371. SetOutputDir("built" + outputdir_suffix)
  372. if (RUNTIME):
  373. for pkg in PkgListGet():
  374. if pkg in ["GTK2", "MFC"]:
  375. # Optional package(s) for runtime.
  376. pass
  377. elif pkg in ["OPENSSL", "ZLIB"]:
  378. # Required packages for runtime.
  379. if (PkgSkip(pkg)==1):
  380. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  381. else:
  382. # Unused packages for runtime.
  383. PkgDisable(pkg)
  384. if (INSTALLER and RTDIST):
  385. exit("Cannot build an installer for the rtdist build!")
  386. if (WHEEL and RUNTIME):
  387. exit("Cannot build a wheel for the runtime build!")
  388. if (WHEEL and RTDIST):
  389. exit("Cannot build a wheel for the rtdist build!")
  390. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  391. exit("Cannot build installer on Windows without python")
  392. if WHEEL and PkgSkip("PYTHON"):
  393. exit("Cannot build wheel without Python")
  394. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  395. exit("Cannot build rtdist without wx or fltk")
  396. if (RUNTIME):
  397. SetLinkAllStatic(True)
  398. if not os.path.isdir("contrib"):
  399. PkgDisable("CONTRIB")
  400. ########################################################################
  401. ##
  402. ## Load the dependency cache.
  403. ##
  404. ########################################################################
  405. LoadDependencyCache()
  406. ########################################################################
  407. ##
  408. ## Locate various SDKs.
  409. ##
  410. ########################################################################
  411. MakeBuildTree()
  412. SdkLocateDirectX(STRDXSDKVERSION)
  413. SdkLocateMaya()
  414. SdkLocateMax()
  415. SdkLocateMacOSX(OSXTARGET)
  416. SdkLocatePython(RTDIST)
  417. SdkLocateWindows(WINDOWS_SDK)
  418. SdkLocatePhysX()
  419. SdkLocateSpeedTree()
  420. SdkLocateAndroid()
  421. SdkAutoDisableDirectX()
  422. SdkAutoDisableMaya()
  423. SdkAutoDisableMax()
  424. SdkAutoDisablePhysX()
  425. SdkAutoDisableSpeedTree()
  426. if RTDIST and DISTRIBUTOR == "cmu":
  427. # Some validation checks for the CMU builds.
  428. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  429. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  430. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  431. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  432. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  433. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  434. if RTDIST and not HOST_URL:
  435. exit("You must specify a host URL when building the rtdist!")
  436. if RUNTIME and not HOST_URL:
  437. # Set this to a nice default.
  438. HOST_URL = "https://runtime.panda3d.org/"
  439. ########################################################################
  440. ##
  441. ## Choose a Compiler.
  442. ##
  443. ## This should also set up any environment variables needed to make
  444. ## the compiler work.
  445. ##
  446. ########################################################################
  447. if GetHost() == 'windows' and GetTarget() == 'windows':
  448. COMPILER = "MSVC"
  449. SdkLocateVisualStudio(MSVC_VERSION)
  450. else:
  451. COMPILER = "GCC"
  452. SetupBuildEnvironment(COMPILER)
  453. ########################################################################
  454. ##
  455. ## External includes, external libraries, and external defsyms.
  456. ##
  457. ########################################################################
  458. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  459. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  460. if (COMPILER == "MSVC"):
  461. PkgDisable("X11")
  462. PkgDisable("GLES")
  463. PkgDisable("GLES2")
  464. PkgDisable("EGL")
  465. PkgDisable("CARBON")
  466. PkgDisable("COCOA")
  467. if (PkgSkip("PYTHON")==0):
  468. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  469. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  470. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  471. for pkg in PkgListGet():
  472. if (PkgSkip(pkg)==0):
  473. if (pkg[:4]=="MAYA"):
  474. IncDirectory(pkg, SDK[pkg] + "/include")
  475. DefSymbol(pkg, "MAYAVERSION", pkg)
  476. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  477. elif (pkg[:3]=="MAX"):
  478. IncDirectory(pkg, SDK[pkg] + "/include")
  479. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  480. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  481. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  482. DefSymbol(pkg, "MAX", pkg)
  483. if (int(pkg[3:]) >= 2013):
  484. DefSymbol(pkg, "UNICODE", "")
  485. DefSymbol(pkg, "_UNICODE", "")
  486. elif (pkg[:2]=="DX"):
  487. IncDirectory(pkg, SDK[pkg] + "/include")
  488. elif GetThirdpartyDir() is not None:
  489. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  490. for pkg in DXVERSIONS:
  491. if (PkgSkip(pkg)==0):
  492. vnum=pkg[2:]
  493. if GetTargetArch() == 'x64':
  494. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  495. else:
  496. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  497. LibDirectory(pkg, SDK[pkg] + '/lib')
  498. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  499. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  500. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  501. LibName(pkg, 'dxerr.lib')
  502. else:
  503. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  504. #LibName(pkg, 'ddraw.lib')
  505. LibName(pkg, 'dxguid.lib')
  506. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  507. # dxerr needs this for __vsnwprintf definition.
  508. LibName(pkg, 'legacy_stdio_definitions.lib')
  509. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  510. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  511. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  512. LibName("WINSOCK", "wsock32.lib")
  513. LibName("WINSOCK2", "wsock32.lib")
  514. LibName("WINSOCK2", "ws2_32.lib")
  515. LibName("WINCOMCTL", "comctl32.lib")
  516. LibName("WINCOMDLG", "comdlg32.lib")
  517. LibName("WINUSER", "user32.lib")
  518. LibName("WINMM", "winmm.lib")
  519. LibName("WINIMM", "imm32.lib")
  520. LibName("WINKERNEL", "kernel32.lib")
  521. LibName("WINOLE", "ole32.lib")
  522. LibName("WINOLEAUT", "oleaut32.lib")
  523. LibName("WINOLDNAMES", "oldnames.lib")
  524. LibName("WINSHELL", "shell32.lib")
  525. LibName("WINGDI", "gdi32.lib")
  526. LibName("ADVAPI", "advapi32.lib")
  527. LibName("IPHLPAPI", "iphlpapi.lib")
  528. LibName("GL", "opengl32.lib")
  529. LibName("GLES", "libgles_cm.lib")
  530. LibName("GLES2", "libGLESv2.lib")
  531. LibName("EGL", "libEGL.lib")
  532. LibName("MSIMG", "msimg32.lib")
  533. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  534. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  535. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  536. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  537. if (PkgSkip("OPENSSL")==0):
  538. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  539. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  540. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  541. else:
  542. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  543. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  544. if (PkgSkip("PNG")==0):
  545. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  546. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  547. else:
  548. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  549. if (PkgSkip("TIFF")==0):
  550. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  551. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  552. else:
  553. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  554. if (PkgSkip("OPENEXR")==0):
  555. suffix = ""
  556. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  557. suffix = "-2_2"
  558. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  559. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  560. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  561. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  562. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  563. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  564. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  565. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  566. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  567. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  568. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  569. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  570. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  571. if (PkgSkip("HARFBUZZ")==0):
  572. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  573. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  574. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  575. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  576. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  577. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  578. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  579. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  580. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  581. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  582. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM",GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  583. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  584. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  585. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  586. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  587. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  588. if (PkgSkip("FCOLLADA")==0):
  589. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  590. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  591. if (PkgSkip("ASSIMP")==0):
  592. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  593. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include/assimp")
  594. if (PkgSkip("SQUISH")==0):
  595. if GetOptimize() <= 2:
  596. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  597. else:
  598. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  599. if (PkgSkip("ROCKET")==0):
  600. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  601. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  602. if (PkgSkip("PYTHON")==0):
  603. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  604. if (GetOptimize() <= 3):
  605. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  606. if (PkgSkip("OPENAL")==0):
  607. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  608. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  609. # Link OpenAL Soft statically.
  610. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  611. if (PkgSkip("ODE")==0):
  612. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  613. DefSymbol("ODE", "dSINGLE", "")
  614. if (PkgSkip("FMODEX")==0):
  615. if (GetTargetArch() == 'x64'):
  616. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  617. else:
  618. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  619. if (PkgSkip("FLTK")==0 and RTDIST):
  620. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  621. if not PkgSkip("FLTK"):
  622. # If we have fltk, we don't need wx
  623. PkgDisable("WX")
  624. if (PkgSkip("WX")==0 and RTDIST):
  625. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  626. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  627. DefSymbol("WX", "__WXMSW__", "")
  628. DefSymbol("WX", "_UNICODE", "")
  629. DefSymbol("WX", "UNICODE", "")
  630. if (PkgSkip("VORBIS")==0):
  631. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  632. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  633. if not os.path.isfile(path):
  634. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  635. LibName("VORBIS", path)
  636. if (PkgSkip("OPUS")==0):
  637. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libogg_static.lib")
  638. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopus_static.lib")
  639. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopusfile_static.lib")
  640. for pkg in MAYAVERSIONS:
  641. if (PkgSkip(pkg)==0):
  642. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  643. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  644. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  645. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  646. for pkg in MAXVERSIONS:
  647. if (PkgSkip(pkg)==0):
  648. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  649. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  650. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  651. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  652. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  653. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  654. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  655. if (PkgSkip("PHYSX")==0):
  656. if GetTargetArch() == 'x64':
  657. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  658. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  659. else:
  660. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  661. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  662. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  663. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  664. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  665. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  666. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  667. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  668. if (PkgSkip("SPEEDTREE")==0):
  669. if GetTargetArch() == 'x64':
  670. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  671. p64ext = '64'
  672. else:
  673. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  674. p64ext = ''
  675. debugext = ''
  676. if (GetOptimize() <= 2): debugext = "_d"
  677. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  678. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  679. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  680. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  681. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  682. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  683. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  684. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  685. LibName("SPEEDTREE", "glu32.lib")
  686. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  687. if (PkgSkip("BULLET")==0):
  688. suffix = '.lib'
  689. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  690. suffix = '_x64.lib'
  691. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  692. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  693. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  694. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  695. if (COMPILER=="GCC"):
  696. PkgDisable("AWESOMIUM")
  697. if GetTarget() != "darwin":
  698. PkgDisable("CARBON")
  699. PkgDisable("COCOA")
  700. elif RUNTIME:
  701. # We don't support Cocoa in the runtime yet.
  702. PkgDisable("COCOA")
  703. if 'x86_64' in OSX_ARCHS:
  704. # 64-bits OS X doesn't have Carbon.
  705. PkgDisable("CARBON")
  706. #if (PkgSkip("PYTHON")==0):
  707. # IncDirectory("PYTHON", SDK["PYTHON"])
  708. if (GetHost() == "darwin"):
  709. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  710. IncDirectory("FREETYPE", "/usr/X11/include")
  711. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  712. LibDirectory("FREETYPE", "/usr/X11/lib")
  713. if (GetHost() == "freebsd"):
  714. IncDirectory("ALWAYS", "/usr/local/include")
  715. LibDirectory("ALWAYS", "/usr/local/lib")
  716. if (os.path.isdir("/usr/PCBSD")):
  717. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  718. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  719. if GetTarget() != "windows":
  720. PkgDisable("DIRECTCAM")
  721. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  722. # WARNING! The order of the ffmpeg libraries matters!
  723. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  724. # Name pkg-config libs, include(dir)s
  725. if (not RUNTIME):
  726. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  727. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  728. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  729. SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp")
  730. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  731. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  732. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  733. SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
  734. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  735. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  736. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  737. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  738. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  739. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  740. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  741. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  742. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  743. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  744. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  745. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  746. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  747. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  748. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  749. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  750. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h"))
  751. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  752. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  753. if not PkgSkip("FFMPEG"):
  754. if GetTarget() == "darwin":
  755. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  756. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  757. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  758. # Needed when linking ffmpeg statically on Linux.
  759. LibName("FFMPEG", "-Wl,-Bsymbolic")
  760. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  761. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  762. if cv_lib == "opencv_core":
  763. OPENCV_VER_23 = True
  764. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  765. else:
  766. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  767. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  768. else:
  769. PkgDisable("OPENCV")
  770. rocket_libs = ("RocketCore", "RocketControls")
  771. if (GetOptimize() <= 3):
  772. rocket_libs += ("RocketDebugger",)
  773. rocket_libs += ("boost_python",)
  774. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  775. if not PkgSkip("PYTHON"):
  776. python_lib = SDK["PYTHONVERSION"]
  777. if not RTDIST and GetTarget() != 'android':
  778. # We don't link anything in the SDK with libpython.
  779. python_lib = ""
  780. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  781. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  782. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  783. SmartPkgEnable("GTK2", "gtk+-2.0")
  784. if (RTDIST):
  785. SmartPkgEnable("WX", tool = "wx-config")
  786. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  787. if GetTarget() != 'darwin':
  788. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  789. if not PkgSkip("NVIDIACG") and not RUNTIME:
  790. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  791. if not RUNTIME:
  792. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  793. if GetHost() != "darwin":
  794. # Workaround for an issue where pkg-config does not include this path
  795. if GetTargetArch() in ("x86_64", "amd64"):
  796. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  797. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  798. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  799. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  800. if not PkgSkip("X11"):
  801. if (os.path.isdir("/usr/X11R6/lib64")):
  802. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  803. else:
  804. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  805. elif not PkgSkip("X11"):
  806. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  807. if RUNTIME:
  808. # For the runtime, these packages are required
  809. for pkg in ["OPENSSL", "ZLIB"]:
  810. skips = []
  811. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  812. skips.append(pkg)
  813. if skips:
  814. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  815. for pkg in MAYAVERSIONS:
  816. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  817. if (GetHost() == "darwin"):
  818. # Sheesh, Autodesk really can't make up their mind
  819. # regarding the location of the Maya devkit on OS X.
  820. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  821. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  822. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  823. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  824. if (os.path.isdir(SDK[pkg] + "/lib")):
  825. LibDirectory(pkg, SDK[pkg] + "/lib")
  826. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  827. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  828. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  829. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  830. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  831. IncDirectory(pkg, SDK[pkg] + "/include")
  832. else:
  833. LibDirectory(pkg, SDK[pkg] + "/lib")
  834. IncDirectory(pkg, SDK[pkg] + "/include")
  835. DefSymbol(pkg, "MAYAVERSION", pkg)
  836. if GetTarget() == 'darwin':
  837. LibName("ALWAYS", "-framework AppKit")
  838. if (PkgSkip("OPENCV")==0):
  839. LibName("OPENCV", "-framework QuickTime")
  840. LibName("AGL", "-framework AGL")
  841. LibName("CARBON", "-framework Carbon")
  842. LibName("COCOA", "-framework Cocoa")
  843. # Fix for a bug in OSX Leopard:
  844. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  845. if GetTarget() == 'android':
  846. LibName("ALWAYS", '-llog')
  847. LibName("ANDROID", '-landroid')
  848. LibName("JNIGRAPHICS", '-ljnigraphics')
  849. for pkg in MAYAVERSIONS:
  850. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  851. if GetTarget() == 'darwin':
  852. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  853. else:
  854. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  855. LibName(pkg, "-lOpenMaya")
  856. LibName(pkg, "-lOpenMayaAnim")
  857. LibName(pkg, "-lAnimSlice")
  858. LibName(pkg, "-lDeformSlice")
  859. LibName(pkg, "-lModifiers")
  860. LibName(pkg, "-lDynSlice")
  861. LibName(pkg, "-lKinSlice")
  862. LibName(pkg, "-lModelSlice")
  863. LibName(pkg, "-lNurbsSlice")
  864. LibName(pkg, "-lPolySlice")
  865. LibName(pkg, "-lProjectSlice")
  866. LibName(pkg, "-lImage")
  867. LibName(pkg, "-lShared")
  868. LibName(pkg, "-lTranslators")
  869. LibName(pkg, "-lDataModel")
  870. LibName(pkg, "-lRenderModel")
  871. LibName(pkg, "-lNurbsEngine")
  872. LibName(pkg, "-lDependEngine")
  873. LibName(pkg, "-lCommandEngine")
  874. LibName(pkg, "-lFoundation")
  875. LibName(pkg, "-lIMFbase")
  876. if GetTarget() != 'darwin':
  877. LibName(pkg, "-lOpenMayalib")
  878. else:
  879. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  880. if (PkgSkip("PHYSX")==0):
  881. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  882. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  883. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  884. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  885. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  886. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  887. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  888. if (GetHost() == "darwin"):
  889. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  890. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  891. else:
  892. LibName("PHYSX", "-lPhysXLoader")
  893. LibName("PHYSX", "-lNxCharacter")
  894. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  895. if GetLinkAllStatic():
  896. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  897. if GetTarget() == 'android':
  898. DefSymbol("ALWAYS", "ANDROID")
  899. if not PkgSkip("EIGEN"):
  900. if GetOptimize() >= 3:
  901. if COMPILER == "MSVC":
  902. # Squeeze out a bit more performance on MSVC builds...
  903. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  904. # will turn them into runtime assertions.
  905. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  906. ########################################################################
  907. ##
  908. ## Give a Status Report on Command-Line Options
  909. ##
  910. ########################################################################
  911. def printStatus(header,warnings):
  912. if GetVerbose():
  913. print("")
  914. print("-------------------------------------------------------------------")
  915. print(header)
  916. tkeep = ""
  917. tomit = ""
  918. for x in PkgListGet():
  919. if PkgSkip(x):
  920. tomit = tomit + x + " "
  921. else:
  922. tkeep = tkeep + x + " "
  923. if RTDIST:
  924. print("Makepanda: Runtime distribution build")
  925. elif RUNTIME:
  926. print("Makepanda: Runtime build")
  927. else:
  928. print("Makepanda: Regular build")
  929. print("Makepanda: Compiler: %s" % (COMPILER))
  930. print("Makepanda: Optimize: %d" % (GetOptimize()))
  931. print("Makepanda: Keep Pkg: %s" % (tkeep))
  932. print("Makepanda: Omit Pkg: %s" % (tomit))
  933. if GENMAN:
  934. print("Makepanda: Generate API reference manual")
  935. else:
  936. print("Makepanda: Don't generate API reference manual")
  937. if GetHost() == "windows" and not RTDIST:
  938. if INSTALLER:
  939. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  940. else:
  941. print("Makepanda: Don't build installer")
  942. print("Makepanda: Version ID: %s" % (VERSION))
  943. for x in warnings:
  944. print("Makepanda: %s" % (x))
  945. print("-------------------------------------------------------------------")
  946. print("")
  947. sys.stdout.flush()
  948. ########################################################################
  949. ##
  950. ## BracketNameWithQuotes
  951. ##
  952. ########################################################################
  953. def BracketNameWithQuotes(name):
  954. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  955. if (name.startswith("-framework")): return name
  956. if (name.startswith("-dylib_file")): return name
  957. # Don't add quotes when it's not necessary.
  958. if " " not in name: return name
  959. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  960. if (name.startswith('"') and name.endswith('"')): return name
  961. else: return '"' + name + '"'
  962. ########################################################################
  963. ##
  964. ## CompileCxx
  965. ##
  966. ########################################################################
  967. def CompileCxx(obj,src,opts):
  968. ipath = GetListOption(opts, "DIR:")
  969. optlevel = GetOptimizeOption(opts)
  970. if (COMPILER=="MSVC"):
  971. if not BOOUSEINTELCOMPILER:
  972. cmd = "cl "
  973. if GetTargetArch() == 'x64':
  974. cmd += "/favor:blend "
  975. cmd += "/wd4996 /wd4275 /wd4273 "
  976. # We still target Windows XP.
  977. cmd += "/DWINVER=0x501 "
  978. # Work around a WinXP/2003 bug when using VS 2015+.
  979. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  980. cmd += "/Zc:threadSafeInit- "
  981. cmd += "/Fo" + obj + " /nologo /c"
  982. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  983. cmd += " /arch:SSE2"
  984. for x in ipath: cmd += " /I" + x
  985. for (opt,dir) in INCDIRECTORIES:
  986. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  987. for (opt,var,val) in DEFSYMBOLS:
  988. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  989. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  990. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  991. if (optlevel==2): cmd += " /MDd /Zi"
  992. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  993. if (optlevel==4):
  994. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  995. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  996. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  997. building = GetValueOption(opts, "BUILDING:")
  998. if (building):
  999. cmd += " /DBUILDING_" + building
  1000. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1001. cmd += " /bigobj"
  1002. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1003. if 'EXCEPTIONS' in opts:
  1004. cmd += " /EHsc"
  1005. else:
  1006. cmd += " /D_HAS_EXCEPTIONS=0"
  1007. if 'RTTI' not in opts:
  1008. cmd += " /GR-"
  1009. if GetTargetArch() == 'x64':
  1010. cmd += " /DWIN64_VC /DWIN64"
  1011. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1012. # To preserve Windows XP compatibility.
  1013. cmd += " /D_USING_V110_SDK71_"
  1014. cmd += " /W3 " + BracketNameWithQuotes(src)
  1015. oscmd(cmd)
  1016. else:
  1017. cmd = "icl "
  1018. if GetTargetArch() == 'x64':
  1019. cmd += "/favor:blend "
  1020. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1021. cmd += "/DWINVER=0x501 "
  1022. cmd += "/Fo" + obj + " /c"
  1023. for x in ipath: cmd += " /I" + x
  1024. for (opt,dir) in INCDIRECTORIES:
  1025. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1026. for (opt,var,val) in DEFSYMBOLS:
  1027. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1028. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1029. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1030. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1031. # core changes from jean-claude (dec 2011)
  1032. # ----------------------------------------
  1033. # performance will be seeked at level 3 & 4
  1034. # -----------------------------------------
  1035. if (optlevel==3):
  1036. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1037. cmd += " /Ob0"
  1038. cmd += " /Qipo-" # beware of IPO !!!
  1039. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1040. ## ----------------------------------------------------------------
  1041. if (optlevel==4):
  1042. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1043. cmd += " /Qipo" # optimization multi file
  1044. # for 3 & 4 optimization levels
  1045. # -----------------------------
  1046. if (optlevel>=3):
  1047. cmd += " /fp:fast=2"
  1048. cmd += " /Qftz"
  1049. cmd += " /Qfp-speculation:fast"
  1050. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1051. cmd += " /Qprec-div-"
  1052. cmd += " /Qsimd"
  1053. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1054. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1055. cmd += " /Qparallel" # enable parallelization
  1056. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1057. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1058. ## PCH files with a .pchi filename suffix and reduce build time.
  1059. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1060. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1061. cmd += " /Qpchi-" # keep it this way!
  1062. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1063. ## ------------------------------------
  1064. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1065. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1066. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1067. ## Ctor displacement /vd0 : Disable constructor displacement.
  1068. ## Choose this option only if no class constructors or destructors call virtual functions.
  1069. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1070. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1071. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1072. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1073. ## Alternate: #pragma pointers_to_members
  1074. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1075. building = GetValueOption(opts, "BUILDING:")
  1076. if (building): cmd += " /DBUILDING_" + building
  1077. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1078. cmd += " /bigobj"
  1079. # level of warnings and optimization reports
  1080. if GetVerbose():
  1081. cmd += " /W3 " # or /W4 or /Wall
  1082. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1083. else:
  1084. cmd += " /W1 "
  1085. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1086. if GetTargetArch() == 'x64':
  1087. cmd += " /DWIN64_VC /DWIN64"
  1088. cmd += " " + BracketNameWithQuotes(src)
  1089. oscmd(cmd)
  1090. if (COMPILER=="GCC"):
  1091. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1092. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1093. for (opt, dir) in INCDIRECTORIES:
  1094. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1095. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1096. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1097. for (opt,var,val) in DEFSYMBOLS:
  1098. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1099. for x in ipath: cmd += ' -I' + x
  1100. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1101. cmd += ' -fvisibility=hidden'
  1102. # Mac-specific flags.
  1103. if GetTarget() == "darwin":
  1104. cmd += " -Wno-deprecated-declarations"
  1105. if OSXTARGET is not None:
  1106. cmd += " -isysroot " + SDK["MACOSX"]
  1107. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1108. for arch in OSX_ARCHS:
  1109. if 'NOARCH:' + arch.upper() not in opts:
  1110. cmd += " -arch %s" % arch
  1111. if "SYSROOT" in SDK:
  1112. cmd += ' --sysroot=%s -no-canonical-prefixes' % (SDK["SYSROOT"])
  1113. # Android-specific flags.
  1114. arch = GetTargetArch()
  1115. if GetTarget() == "android":
  1116. # Most of the specific optimization flags here were
  1117. # just copied from the default Android Makefiles.
  1118. if "ANDROID_API" in SDK:
  1119. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1120. if "ANDROID_STL" in SDK:
  1121. cmd += ' -I%s/include' % (SDK["ANDROID_STL"])
  1122. cmd += ' -I%s/libs/%s/include' % (SDK["ANDROID_STL"], SDK["ANDROID_ABI"])
  1123. cmd += ' -ffunction-sections -funwind-tables'
  1124. if arch == 'armv7a':
  1125. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1126. cmd += ' -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1127. elif arch == 'arm':
  1128. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1129. cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float'
  1130. elif arch == 'mips':
  1131. cmd += ' -finline-functions -fmessage-length=0'
  1132. cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
  1133. cmd += ' -frerun-cse-after-loop -frename-registers'
  1134. cmd += " -Wa,--noexecstack"
  1135. # Now add specific release/debug flags.
  1136. if optlevel >= 3:
  1137. cmd += " -fomit-frame-pointer"
  1138. if arch.startswith('arm'):
  1139. cmd += ' -finline-limit=64 -mthumb'
  1140. elif arch == 'mips':
  1141. cmd += ' -funswitch-loops -finline-limit=300'
  1142. else:
  1143. cmd += ' -fno-omit-frame-pointer'
  1144. if arch.startswith('arm'):
  1145. cmd += ' -marm'
  1146. # Enable SIMD instructions if requested
  1147. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1148. cmd += ' -mfpu=neon'
  1149. else:
  1150. cmd += " -pthread"
  1151. if not src.endswith(".c"):
  1152. # We don't use exceptions for most modules.
  1153. if 'EXCEPTIONS' in opts:
  1154. cmd += " -fexceptions"
  1155. else:
  1156. cmd += " -fno-exceptions"
  1157. if src.endswith(".mm"):
  1158. # Work around Apple compiler bug.
  1159. cmd += " -U__EXCEPTIONS"
  1160. if 'RTTI' not in opts:
  1161. # We always disable RTTI on Android for memory usage reasons.
  1162. if optlevel >= 4 or GetTarget() == "android":
  1163. cmd += " -fno-rtti"
  1164. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1165. cmd += " -msse2"
  1166. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1167. cmd += " -fno-strict-aliasing"
  1168. if optlevel >= 3:
  1169. cmd += " -ffast-math -fno-stack-protector"
  1170. if optlevel == 3:
  1171. # Fast math is nice, but we'd like to see NaN in dev builds.
  1172. cmd += " -fno-finite-math-only"
  1173. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1174. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1175. if (optlevel==3): cmd += " -O2"
  1176. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1177. if src.endswith(".c"):
  1178. cmd += ' ' + CFLAGS
  1179. else:
  1180. cmd += ' ' + CXXFLAGS
  1181. cmd = cmd.rstrip()
  1182. building = GetValueOption(opts, "BUILDING:")
  1183. if (building): cmd += " -DBUILDING_" + building
  1184. cmd += ' ' + BracketNameWithQuotes(src)
  1185. oscmd(cmd)
  1186. ########################################################################
  1187. ##
  1188. ## CompileBison
  1189. ##
  1190. ########################################################################
  1191. def CompileBison(wobj, wsrc, opts):
  1192. ifile = os.path.basename(wsrc)
  1193. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1194. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1195. pre = GetValueOption(opts, "BISONPREFIX_")
  1196. bison = GetBison()
  1197. if bison is None:
  1198. # We don't have bison. See if there is a prebuilt file.
  1199. base, ext = os.path.splitext(wsrc)
  1200. if os.path.isfile(base + '.h.prebuilt') and \
  1201. os.path.isfile(base + '.cxx.prebuilt'):
  1202. CopyFile(wdstc, base + '.cxx.prebuilt')
  1203. CopyFile(wdsth, base + '.h.prebuilt')
  1204. else:
  1205. exit('Could not find bison!')
  1206. else:
  1207. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1208. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1209. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1210. # Finally, compile the generated source file.
  1211. CompileCxx(wobj,wdstc,opts)
  1212. ########################################################################
  1213. ##
  1214. ## CompileFlex
  1215. ##
  1216. ########################################################################
  1217. def CompileFlex(wobj,wsrc,opts):
  1218. ifile = os.path.basename(wsrc)
  1219. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1220. pre = GetValueOption(opts, "BISONPREFIX_")
  1221. dashi = opts.count("FLEXDASHI")
  1222. flex = GetFlex()
  1223. if flex is None:
  1224. # We don't have flex. See if there is a prebuilt file.
  1225. base, ext = os.path.splitext(wsrc)
  1226. if os.path.isfile(base + '.cxx.prebuilt'):
  1227. CopyFile(wdst, base + '.cxx.prebuilt')
  1228. else:
  1229. exit('Could not find flex!')
  1230. else:
  1231. if (dashi):
  1232. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1233. else:
  1234. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1235. # Finally, compile the generated source file.
  1236. CompileCxx(wobj,wdst,opts)
  1237. ########################################################################
  1238. ##
  1239. ## CompileIgate
  1240. ##
  1241. ########################################################################
  1242. def CompileIgate(woutd,wsrc,opts):
  1243. outbase = os.path.basename(woutd)[:-3]
  1244. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1245. wobj = FindLocation(outbase + "_igate.obj", [])
  1246. srcdir = GetValueOption(opts, "SRCDIR:")
  1247. module = GetValueOption(opts, "IMOD:")
  1248. library = GetValueOption(opts, "ILIB:")
  1249. ipath = GetListOption(opts, "DIR:")
  1250. if (PkgSkip("PYTHON")):
  1251. WriteFile(woutc, "")
  1252. WriteFile(woutd, "")
  1253. ConditionalWriteFile(woutd, "")
  1254. return (wobj, woutc, opts)
  1255. if not CrossCompiling():
  1256. # If we're compiling for this platform, we can use the one we've built.
  1257. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1258. else:
  1259. # Assume that interrogate is on the PATH somewhere.
  1260. cmd = 'interrogate'
  1261. if GetVerbose():
  1262. cmd += ' -v'
  1263. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1264. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1265. if (COMPILER=="MSVC"):
  1266. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1267. if GetTargetArch() == 'x64':
  1268. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1269. else:
  1270. cmd += ' -D_M_IX86'
  1271. # NOTE: this 1600 value is the version number for VC2010.
  1272. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1273. if (COMPILER=="GCC"):
  1274. cmd += ' -D__attribute__\(x\)='
  1275. target_arch = GetTargetArch()
  1276. if target_arch in ("x86_64", "amd64"):
  1277. cmd += ' -D_LP64'
  1278. elif target_arch == 'aarch64':
  1279. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1280. else:
  1281. cmd += ' -D__i386__'
  1282. target = GetTarget()
  1283. if target == 'darwin':
  1284. cmd += ' -D__APPLE__'
  1285. elif target == 'android':
  1286. cmd += ' -D__ANDROID__'
  1287. optlevel = GetOptimizeOption(opts)
  1288. if (optlevel==1): cmd += ' -D_DEBUG'
  1289. if (optlevel==2): cmd += ' -D_DEBUG'
  1290. if (optlevel==3): pass
  1291. if (optlevel==4): cmd += ' -DNDEBUG'
  1292. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1293. cmd += ' -fnames -string -refcount -assert -python-native'
  1294. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1295. # Add -I, -S and -D flags
  1296. for x in ipath:
  1297. cmd += ' -I' + BracketNameWithQuotes(x)
  1298. for (opt,dir) in INCDIRECTORIES:
  1299. if (opt=="ALWAYS") or (opt in opts):
  1300. cmd += ' -S' + BracketNameWithQuotes(dir)
  1301. for (opt,var,val) in DEFSYMBOLS:
  1302. if (opt=="ALWAYS") or (opt in opts):
  1303. cmd += ' -D' + var + '=' + val
  1304. #building = GetValueOption(opts, "BUILDING:")
  1305. #if (building): cmd += " -DBUILDING_"+building
  1306. cmd += ' -module ' + module + ' -library ' + library
  1307. for x in wsrc:
  1308. if (x.startswith("/")):
  1309. cmd += ' ' + BracketNameWithQuotes(x)
  1310. else:
  1311. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1312. oscmd(cmd)
  1313. return (wobj, woutc, opts)
  1314. ########################################################################
  1315. ##
  1316. ## CompileImod
  1317. ##
  1318. ########################################################################
  1319. def CompileImod(wobj, wsrc, opts):
  1320. module = GetValueOption(opts, "IMOD:")
  1321. library = GetValueOption(opts, "ILIB:")
  1322. if (COMPILER=="MSVC"):
  1323. woutc = wobj[:-4]+".cxx"
  1324. if (COMPILER=="GCC"):
  1325. woutc = wobj[:-2]+".cxx"
  1326. if (PkgSkip("PYTHON")):
  1327. WriteFile(woutc, "")
  1328. CompileCxx(wobj, woutc, opts)
  1329. return
  1330. if not CrossCompiling():
  1331. # If we're compiling for this platform, we can use the one we've built.
  1332. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1333. else:
  1334. # Assume that interrogate_module is on the PATH somewhere.
  1335. cmd = 'interrogate_module'
  1336. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1337. importmod = GetValueOption(opts, "IMPORT:")
  1338. if importmod:
  1339. cmd += ' -import ' + importmod
  1340. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1341. oscmd(cmd)
  1342. CompileCxx(wobj,woutc,opts)
  1343. return
  1344. ########################################################################
  1345. ##
  1346. ## CompileLib
  1347. ##
  1348. ########################################################################
  1349. def CompileLib(lib, obj, opts):
  1350. if (COMPILER=="MSVC"):
  1351. if not BOOUSEINTELCOMPILER:
  1352. #Use MSVC Linker
  1353. cmd = 'link /lib /nologo'
  1354. if GetOptimizeOption(opts) == 4:
  1355. cmd += " /LTCG"
  1356. if HasTargetArch():
  1357. cmd += " /MACHINE:" + GetTargetArch().upper()
  1358. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1359. for x in obj:
  1360. if not x.endswith('.lib'):
  1361. cmd += ' ' + BracketNameWithQuotes(x)
  1362. oscmd(cmd)
  1363. else:
  1364. # Choose Intel linker; from Jean-Claude
  1365. cmd = 'xilink /verbose:lib /lib '
  1366. if HasTargetArch():
  1367. cmd += " /MACHINE:" + GetTargetArch().upper()
  1368. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1369. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1370. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1371. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1372. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1373. oscmd(cmd)
  1374. if (COMPILER=="GCC"):
  1375. if GetTarget() == 'darwin':
  1376. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1377. else:
  1378. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1379. for x in obj:
  1380. cmd += ' ' + BracketNameWithQuotes(x)
  1381. oscmd(cmd)
  1382. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1383. ########################################################################
  1384. ##
  1385. ## CompileLink
  1386. ##
  1387. ########################################################################
  1388. def CompileLink(dll, obj, opts):
  1389. if (COMPILER=="MSVC"):
  1390. if not BOOUSEINTELCOMPILER:
  1391. cmd = "link /nologo "
  1392. if HasTargetArch():
  1393. cmd += " /MACHINE:" + GetTargetArch().upper()
  1394. if ("MFC" not in opts):
  1395. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1396. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1397. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1398. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1399. optlevel = GetOptimizeOption(opts)
  1400. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1401. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1402. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1403. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1404. if ("MFC" in opts):
  1405. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1406. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1407. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1408. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1409. if not PkgSkip("PYTHON"):
  1410. # If we're building without Python, don't pick it up implicitly.
  1411. if "PYTHON" not in opts:
  1412. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1413. if optlevel <= 2:
  1414. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1415. else:
  1416. cmd += ' /NOD:{}.lib'.format(pythonv)
  1417. # Yes, we know we are importing "locally defined symbols".
  1418. for x in obj:
  1419. if x.endswith('libp3pystub.lib'):
  1420. cmd += ' /ignore:4049,4217'
  1421. break
  1422. # Set the subsystem. Specify that we want to target Windows XP.
  1423. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1424. cmd += " /SUBSYSTEM:" + subsystem
  1425. if GetTargetArch() == 'x64':
  1426. cmd += ",5.02"
  1427. else:
  1428. cmd += ",5.01"
  1429. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1430. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1431. for (opt, dir) in LIBDIRECTORIES:
  1432. if (opt=="ALWAYS") or (opt in opts):
  1433. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1434. for x in obj:
  1435. if x.endswith(".dll") or x.endswith(".pyd"):
  1436. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1437. elif x.endswith(".lib"):
  1438. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1439. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1440. exit("Error: in makepanda, specify "+dname+", not "+x)
  1441. cmd += ' ' + BracketNameWithQuotes(x)
  1442. elif x.endswith(".def"):
  1443. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1444. elif x.endswith(".dat"):
  1445. pass
  1446. else:
  1447. cmd += ' ' + BracketNameWithQuotes(x)
  1448. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1449. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1450. for (opt, name) in LIBNAMES:
  1451. if (opt=="ALWAYS") or (opt in opts):
  1452. cmd += " " + BracketNameWithQuotes(name)
  1453. oscmd(cmd)
  1454. else:
  1455. cmd = "xilink"
  1456. if GetVerbose(): cmd += " /verbose:lib"
  1457. if HasTargetArch():
  1458. cmd += " /MACHINE:" + GetTargetArch().upper()
  1459. if ("MFC" not in opts):
  1460. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1461. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1462. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1463. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1464. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1465. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1466. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1467. optlevel = GetOptimizeOption(opts)
  1468. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1469. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1470. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1471. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1472. if ("MFC" in opts):
  1473. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1474. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1475. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1476. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1477. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1478. if subsystem:
  1479. cmd += " /SUBSYSTEM:" + subsystem
  1480. if dll.endswith(".dll"):
  1481. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1482. for (opt, dir) in LIBDIRECTORIES:
  1483. if (opt=="ALWAYS") or (opt in opts):
  1484. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1485. for x in obj:
  1486. if x.endswith(".dll") or x.endswith(".pyd"):
  1487. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1488. elif x.endswith(".lib"):
  1489. dname = os.path.splitext(dll)[0]+".dll"
  1490. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1491. exit("Error: in makepanda, specify "+dname+", not "+x)
  1492. cmd += ' ' + BracketNameWithQuotes(x)
  1493. elif x.endswith(".def"):
  1494. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1495. elif x.endswith(".dat"):
  1496. pass
  1497. else:
  1498. cmd += ' ' + BracketNameWithQuotes(x)
  1499. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1500. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1501. for (opt, name) in LIBNAMES:
  1502. if (opt=="ALWAYS") or (opt in opts):
  1503. cmd += " " + BracketNameWithQuotes(name)
  1504. oscmd(cmd)
  1505. if COMPILER == "GCC":
  1506. cxx = GetCXX()
  1507. if GetOrigExt(dll) == ".exe":
  1508. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1509. if GetTarget() == "android":
  1510. # Necessary to work around an issue with libandroid depending on vendor libraries
  1511. cmd += ' -Wl,--allow-shlib-undefined'
  1512. else:
  1513. if (GetTarget() == "darwin"):
  1514. cmd = cxx + ' -undefined dynamic_lookup'
  1515. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1516. cmd += ' -bundle '
  1517. else:
  1518. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1519. cmd += ' -dynamiclib -install_name ' + install_name
  1520. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1521. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1522. else:
  1523. cmd = cxx + ' -shared'
  1524. # Always set soname on Android to avoid a linker warning when loading the library.
  1525. if "MODULE" not in opts or GetTarget() == 'android':
  1526. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1527. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1528. for x in obj:
  1529. if GetOrigExt(x) != ".dat":
  1530. cmd += ' ' + x
  1531. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1532. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1533. # Mac OS X specific flags.
  1534. if GetTarget() == 'darwin':
  1535. cmd += " -headerpad_max_install_names"
  1536. if OSXTARGET is not None:
  1537. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1538. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1539. for arch in OSX_ARCHS:
  1540. if 'NOARCH:' + arch.upper() not in opts:
  1541. cmd += " -arch %s" % arch
  1542. elif GetTarget() == 'android':
  1543. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1544. if GetTargetArch() == 'armv7a':
  1545. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1546. cmd += ' -lc -lm'
  1547. else:
  1548. cmd += " -pthread"
  1549. if "SYSROOT" in SDK:
  1550. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1551. if LDFLAGS != "":
  1552. cmd += " " + LDFLAGS
  1553. # Don't link libraries with Python, except on Android.
  1554. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1555. opts = opts[:]
  1556. opts.remove("PYTHON")
  1557. for (opt, dir) in LIBDIRECTORIES:
  1558. if (opt=="ALWAYS") or (opt in opts):
  1559. cmd += ' -L' + BracketNameWithQuotes(dir)
  1560. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1561. if (opt=="ALWAYS") or (opt in opts):
  1562. cmd += ' -F' + BracketNameWithQuotes(dir)
  1563. for (opt, name) in LIBNAMES:
  1564. if (opt=="ALWAYS") or (opt in opts):
  1565. cmd += ' ' + BracketNameWithQuotes(name)
  1566. if GetTarget() != 'freebsd':
  1567. cmd += " -ldl"
  1568. oscmd(cmd)
  1569. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1570. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1571. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1572. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1573. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1574. if os.path.isfile(newdll):
  1575. os.remove(newdll)
  1576. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1577. elif dll.endswith("." + MAJOR_VERSION):
  1578. newdll = dll[:-len(MAJOR_VERSION)-1]
  1579. if os.path.isfile(newdll):
  1580. os.remove(newdll)
  1581. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1582. ##########################################################################################
  1583. #
  1584. # CompileEgg
  1585. #
  1586. ##########################################################################################
  1587. def CompileEgg(eggfile, src, opts):
  1588. pz = False
  1589. if eggfile.endswith(".pz"):
  1590. pz = True
  1591. eggfile = eggfile[:-3]
  1592. # Determine the location of the pzip and flt2egg tools.
  1593. if CrossCompiling():
  1594. # We may not be able to use our generated versions of these tools,
  1595. # so we'll expect them to already be present in the PATH.
  1596. pzip = 'pzip'
  1597. flt2egg = 'flt2egg'
  1598. else:
  1599. # If we're compiling for this machine, we can use the binaries we've built.
  1600. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1601. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1602. if not os.path.isfile(pzip):
  1603. pzip = 'pzip'
  1604. if not os.path.isfile(flt2egg):
  1605. flt2egg = 'flt2egg'
  1606. if src.endswith(".egg"):
  1607. CopyFile(eggfile, src)
  1608. elif src.endswith(".flt"):
  1609. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1610. if pz:
  1611. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1612. ##########################################################################################
  1613. #
  1614. # CompileRes, CompileRsrc
  1615. #
  1616. ##########################################################################################
  1617. def CompileRes(target, src, opts):
  1618. """Compiles a Windows .rc file into a .res file."""
  1619. ipath = GetListOption(opts, "DIR:")
  1620. if (COMPILER == "MSVC"):
  1621. cmd = "rc"
  1622. cmd += " /Fo" + BracketNameWithQuotes(target)
  1623. for x in ipath: cmd += " /I" + x
  1624. for (opt,dir) in INCDIRECTORIES:
  1625. if (opt=="ALWAYS") or (opt in opts):
  1626. cmd += " /I" + BracketNameWithQuotes(dir)
  1627. for (opt,var,val) in DEFSYMBOLS:
  1628. if (opt=="ALWAYS") or (opt in opts):
  1629. cmd += " /D" + var + "=" + val
  1630. cmd += " " + BracketNameWithQuotes(src)
  1631. else:
  1632. cmd = "windres"
  1633. for x in ipath: cmd += " -I" + x
  1634. for (opt,dir) in INCDIRECTORIES:
  1635. if (opt=="ALWAYS") or (opt in opts):
  1636. cmd += " -I" + BracketNameWithQuotes(dir)
  1637. for (opt,var,val) in DEFSYMBOLS:
  1638. if (opt=="ALWAYS") or (opt in opts):
  1639. cmd += " -D" + var + "=" + val
  1640. cmd += " -i " + BracketNameWithQuotes(src)
  1641. cmd += " -o " + BracketNameWithQuotes(target)
  1642. oscmd(cmd)
  1643. def CompileRsrc(target, src, opts):
  1644. """Compiles a Mac OS .r file into an .rsrc file."""
  1645. ipath = GetListOption(opts, "DIR:")
  1646. if os.path.isfile("/usr/bin/Rez"):
  1647. cmd = "Rez -useDF"
  1648. else:
  1649. cmd = "/Developer/Tools/Rez -useDF"
  1650. cmd += " -o " + BracketNameWithQuotes(target)
  1651. for x in ipath:
  1652. cmd += " -i " + x
  1653. for (opt,dir) in INCDIRECTORIES:
  1654. if (opt=="ALWAYS") or (opt in opts):
  1655. cmd += " -i " + BracketNameWithQuotes(dir)
  1656. for (opt,var,val) in DEFSYMBOLS:
  1657. if (opt=="ALWAYS") or (opt in opts):
  1658. if (val == ""):
  1659. cmd += " -d " + var
  1660. else:
  1661. cmd += " -d " + var + " = " + val
  1662. cmd += " " + BracketNameWithQuotes(src)
  1663. oscmd(cmd)
  1664. ##########################################################################################
  1665. #
  1666. # CompileJava (Android only)
  1667. #
  1668. ##########################################################################################
  1669. def CompileJava(target, src, opts):
  1670. """Compiles a .java file into a .class file."""
  1671. cmd = "ecj "
  1672. optlevel = GetOptimizeOption(opts)
  1673. if optlevel >= 4:
  1674. cmd += "-debug:none "
  1675. cmd += "-cp " + GetOutputDir() + "/classes "
  1676. cmd += "-d " + GetOutputDir() + "/classes "
  1677. cmd += BracketNameWithQuotes(src)
  1678. oscmd(cmd)
  1679. ##########################################################################################
  1680. #
  1681. # FreezePy
  1682. #
  1683. ##########################################################################################
  1684. def FreezePy(target, inputs, opts):
  1685. assert len(inputs) > 0
  1686. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1687. if sys.version_info >= (2, 6):
  1688. cmdstr += "-B "
  1689. cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py")
  1690. if 'FREEZE_STARTUP' in opts:
  1691. cmdstr += " -s"
  1692. if GetOrigExt(target) == '.exe':
  1693. src = inputs.pop(0)
  1694. else:
  1695. src = ""
  1696. for i in inputs:
  1697. i = os.path.splitext(i)[0]
  1698. i = i.replace('/', '.')
  1699. if i.startswith('direct.src'):
  1700. i = i.replace('.src.', '.')
  1701. cmdstr += " -i " + i
  1702. cmdstr += " -o " + target + " " + src
  1703. if ("LINK_PYTHON_STATIC" in opts):
  1704. os.environ["LINK_PYTHON_STATIC"] = "1"
  1705. oscmd(cmdstr)
  1706. if ("LINK_PYTHON_STATIC" in os.environ):
  1707. del os.environ["LINK_PYTHON_STATIC"]
  1708. if (not os.path.exists(target)):
  1709. exit("FREEZER_ERROR")
  1710. ##########################################################################################
  1711. #
  1712. # Package
  1713. #
  1714. ##########################################################################################
  1715. def Package(target, inputs, opts):
  1716. assert len(inputs) == 1
  1717. # Invoke the ppackage script.
  1718. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1719. if GetOptimizeOption(opts) >= 4:
  1720. command += "-OO "
  1721. if sys.version_info >= (2, 6):
  1722. command += "-B "
  1723. command += "direct/src/p3d/ppackage.py"
  1724. if not RTDIST:
  1725. # Don't compile Python sources, because we might not running in the same
  1726. # Python version as the selected host.
  1727. command += " -N"
  1728. if GetTarget() == "darwin":
  1729. if SDK.get("MACOSX"):
  1730. command += " -R \"%s\"" % SDK["MACOSX"]
  1731. for arch in OSX_ARCHS:
  1732. if arch == "x86_64":
  1733. arch = "amd64"
  1734. command += " -P osx_%s" % arch
  1735. command += " -i \"" + GetOutputDir() + "/stage\""
  1736. if (P3DSUFFIX):
  1737. command += ' -a "' + P3DSUFFIX + '"'
  1738. command += " " + inputs[0]
  1739. if GetOrigExt(target) == '.p3d':
  1740. # Build a specific .p3d file.
  1741. basename = os.path.basename(os.path.splitext(target)[0])
  1742. command += " " + basename
  1743. oscmd(command)
  1744. if GetTarget() == 'windows':
  1745. # Make an .exe that calls this .p3d.
  1746. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1747. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1748. exefile = FindLocation(basename + '.exe', [])
  1749. CompileLink(exefile, [objfile], ['ADVAPI'])
  1750. # Move it to the bin directory.
  1751. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1752. if sys.platform != 'win32':
  1753. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1754. else:
  1755. # This is presumably a package or set of packages.
  1756. oscmd(command)
  1757. ##########################################################################################
  1758. #
  1759. # CompileBundle
  1760. #
  1761. ##########################################################################################
  1762. def CompileBundle(target, inputs, opts):
  1763. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1764. plist = None
  1765. resources = []
  1766. objects = []
  1767. for i in inputs:
  1768. if (i.endswith(".plist")):
  1769. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1770. plist = i
  1771. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1772. resources.append(i)
  1773. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1774. objects.append(i)
  1775. else:
  1776. exit("Don't know how to bundle file %s" % i)
  1777. # Now link the object files to form the bundle.
  1778. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1779. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1780. oscmd("rm -rf %s" % target)
  1781. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1782. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1783. if target.endswith(".app"):
  1784. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1785. else:
  1786. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1787. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1788. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1789. for r in resources:
  1790. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1791. ##########################################################################################
  1792. #
  1793. # CompileMIDL
  1794. #
  1795. ##########################################################################################
  1796. def CompileMIDL(target, src, opts):
  1797. ipath = GetListOption(opts, "DIR:")
  1798. if (COMPILER=="MSVC"):
  1799. cmd = "midl"
  1800. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1801. for x in ipath: cmd += " /I" + x
  1802. for (opt,dir) in INCDIRECTORIES:
  1803. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1804. for (opt,var,val) in DEFSYMBOLS:
  1805. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1806. cmd += " " + BracketNameWithQuotes(src)
  1807. oscmd(cmd)
  1808. ##########################################################################################
  1809. #
  1810. # CompileAnything
  1811. #
  1812. ##########################################################################################
  1813. def CompileAnything(target, inputs, opts, progress = None):
  1814. if (opts.count("DEPENDENCYONLY")):
  1815. return
  1816. if (len(inputs)==0):
  1817. exit("No input files for target "+target)
  1818. infile = inputs[0]
  1819. origsuffix = GetOrigExt(target)
  1820. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1821. # It must be a simple copy operation.
  1822. ProgressOutput(progress, "Copying file", target)
  1823. CopyFile(target, infile)
  1824. if (origsuffix==".exe" and GetHost() != "windows"):
  1825. os.system("chmod +x \"%s\"" % target)
  1826. return
  1827. elif (infile.endswith(".py")):
  1828. if origsuffix == ".obj":
  1829. source = os.path.splitext(target)[0] + ".c"
  1830. SetOrigExt(source, ".c")
  1831. ProgressOutput(progress, "Building frozen source", source)
  1832. FreezePy(source, inputs, opts)
  1833. ProgressOutput(progress, "Building C++ object", target)
  1834. return CompileCxx(target, source, opts)
  1835. if origsuffix == ".exe":
  1836. ProgressOutput(progress, "Building frozen executable", target)
  1837. else:
  1838. ProgressOutput(progress, "Building frozen library", target)
  1839. return FreezePy(target, inputs, opts)
  1840. elif (infile.endswith(".idl")):
  1841. ProgressOutput(progress, "Compiling MIDL file", infile)
  1842. return CompileMIDL(target, infile, opts)
  1843. elif (infile.endswith(".pdef")):
  1844. if origsuffix == '.p3d':
  1845. ProgressOutput(progress, "Building package", target)
  1846. else:
  1847. ProgressOutput(progress, "Building package from pdef file", infile)
  1848. return Package(target, inputs, opts)
  1849. elif origsuffix in SUFFIX_LIB:
  1850. ProgressOutput(progress, "Linking static library", target)
  1851. return CompileLib(target, inputs, opts)
  1852. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1853. if (origsuffix==".exe"):
  1854. ProgressOutput(progress, "Linking executable", target)
  1855. else:
  1856. ProgressOutput(progress, "Linking dynamic library", target)
  1857. # Add version number to the dynamic library, on unix
  1858. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  1859. tplatform = GetTarget()
  1860. if tplatform == "darwin":
  1861. # On Mac, libraries are named like libpanda.1.2.dylib
  1862. if target.lower().endswith(".dylib"):
  1863. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1864. SetOrigExt(target, origsuffix)
  1865. elif tplatform != "windows" and tplatform != "android":
  1866. # On Linux, libraries are named like libpanda.so.1.2
  1867. target += "." + MAJOR_VERSION
  1868. SetOrigExt(target, origsuffix)
  1869. return CompileLink(target, inputs, opts)
  1870. elif (origsuffix==".in"):
  1871. ProgressOutput(progress, "Building Interrogate database", target)
  1872. args = CompileIgate(target, inputs, opts)
  1873. ProgressOutput(progress, "Building C++ object", args[0])
  1874. return CompileCxx(*args)
  1875. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  1876. ProgressOutput(progress, "Building plugin bundle", target)
  1877. return CompileBundle(target, inputs, opts)
  1878. elif (origsuffix==".app"):
  1879. ProgressOutput(progress, "Building application bundle", target)
  1880. return CompileBundle(target, inputs, opts)
  1881. elif (origsuffix==".pz"):
  1882. ProgressOutput(progress, "Compressing", target)
  1883. return CompileEgg(target, infile, opts)
  1884. elif (origsuffix==".egg"):
  1885. ProgressOutput(progress, "Converting", target)
  1886. return CompileEgg(target, infile, opts)
  1887. elif (origsuffix==".res"):
  1888. ProgressOutput(progress, "Building resource object", target)
  1889. return CompileRes(target, infile, opts)
  1890. elif (origsuffix==".rsrc"):
  1891. ProgressOutput(progress, "Building resource object", target)
  1892. return CompileRsrc(target, infile, opts)
  1893. elif (origsuffix==".class"):
  1894. ProgressOutput(progress, "Building Java class", target)
  1895. return CompileJava(target, infile, opts)
  1896. elif (origsuffix==".obj"):
  1897. if (infile.endswith(".cxx")):
  1898. ProgressOutput(progress, "Building C++ object", target)
  1899. return CompileCxx(target, infile, opts)
  1900. elif (infile.endswith(".c")):
  1901. ProgressOutput(progress, "Building C object", target)
  1902. return CompileCxx(target, infile, opts)
  1903. elif (infile.endswith(".mm")):
  1904. ProgressOutput(progress, "Building Objective-C++ object", target)
  1905. return CompileCxx(target, infile, opts)
  1906. elif (infile.endswith(".yxx")):
  1907. ProgressOutput(progress, "Building Bison object", target)
  1908. return CompileBison(target, infile, opts)
  1909. elif (infile.endswith(".lxx")):
  1910. ProgressOutput(progress, "Building Flex object", target)
  1911. return CompileFlex(target, infile, opts)
  1912. elif (infile.endswith(".in")):
  1913. ProgressOutput(progress, "Building Interrogate object", target)
  1914. return CompileImod(target, inputs, opts)
  1915. elif (infile.endswith(".rc")):
  1916. ProgressOutput(progress, "Building resource object", target)
  1917. return CompileRes(target, infile, opts)
  1918. elif (infile.endswith(".r")):
  1919. ProgressOutput(progress, "Building resource object", target)
  1920. return CompileRsrc(target, infile, opts)
  1921. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1922. ##########################################################################################
  1923. #
  1924. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1925. #
  1926. ##########################################################################################
  1927. DTOOL_CONFIG=[
  1928. #_Variable_________________________Windows___________________Unix__________
  1929. ("HAVE_PYTHON", '1', '1'),
  1930. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1931. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1932. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1933. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1934. ("HAVE_MAYA", '1', '1'),
  1935. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1936. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1937. ("USE_PANDAFILESTREAM", '1', '1'),
  1938. ("USE_DELETED_CHAIN", '1', '1'),
  1939. ("HAVE_GLX", 'UNDEF', '1'),
  1940. ("HAVE_WGL", '1', 'UNDEF'),
  1941. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1942. ("HAVE_THREADS", '1', '1'),
  1943. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1944. ("OS_SIMPLE_THREADS", '1', '1'),
  1945. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1946. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1947. ("HAVE_AUDIO", '1', '1'),
  1948. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1949. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1950. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  1951. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1952. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  1953. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  1954. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1955. ("DO_PIPELINING", '1', '1'),
  1956. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1957. ("DEFAULT_PATHSEP", '";"', '":"'),
  1958. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1959. ("HAVE_NAMESPACE", '1', '1'),
  1960. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1961. ("HAVE_LOCKF", '1', '1'),
  1962. ("HAVE_WCHAR_T", '1', '1'),
  1963. ("HAVE_WSTRING", '1', '1'),
  1964. ("HAVE_TYPENAME", '1', '1'),
  1965. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1966. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1967. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1968. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1969. ("HAVE_GETOPT", 'UNDEF', '1'),
  1970. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1971. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1972. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1973. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1974. ("HAVE_STREAMSIZE", '1', '1'),
  1975. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1976. ("HAVE_IOS_BINARY", '1', '1'),
  1977. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1978. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1979. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1980. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1981. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1982. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1983. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1984. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1985. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1986. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1987. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1988. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1989. ("PHAVE_IO_H", '1', 'UNDEF'),
  1990. ("PHAVE_IOSTREAM", '1', '1'),
  1991. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1992. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1993. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1994. ("PHAVE_MALLOC_H", '1', '1'),
  1995. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1996. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1997. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1998. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1999. ("PHAVE_SSTREAM", '1', '1'),
  2000. ("PHAVE_NEW", '1', '1'),
  2001. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2002. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2003. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2004. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2005. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2006. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2007. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  2008. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2009. ("PHAVE_STDINT_H", '1', '1'),
  2010. ("HAVE_RTTI", '1', '1'),
  2011. ("HAVE_X11", 'UNDEF', '1'),
  2012. ("IS_LINUX", 'UNDEF', '1'),
  2013. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2014. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2015. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2016. ("LINMATH_ALIGN", '1', '1'),
  2017. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2018. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2019. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2020. ("PHAVE_JPEGINT_H", '1', '1'),
  2021. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2022. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2023. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2024. ("HAVE_SGI_RGB", '1', '1'),
  2025. ("HAVE_TGA", '1', '1'),
  2026. ("HAVE_IMG", '1', '1'),
  2027. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2028. ("HAVE_BMP", '1', '1'),
  2029. ("HAVE_PNM", '1', '1'),
  2030. ("HAVE_STB_IMAGE", '1', '1'),
  2031. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2032. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2033. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2034. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2035. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2036. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2037. ("WANT_NATIVE_NET", '1', '1'),
  2038. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2039. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2040. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2041. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2042. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2043. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2044. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2045. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2046. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2047. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2048. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2049. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2050. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2051. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2052. # ("_SECURE_SCL", '0', 'UNDEF'),
  2053. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2054. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2055. ]
  2056. PRC_PARAMETERS=[
  2057. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2058. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2059. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2060. ("PRC_PATH2_ENVVARS", '""', '""'),
  2061. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2062. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2063. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2064. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2065. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2066. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2067. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2068. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2069. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2070. ]
  2071. def WriteConfigSettings():
  2072. dtool_config={}
  2073. prc_parameters={}
  2074. speedtree_parameters={}
  2075. plugin_config={}
  2076. if (GetTarget() == 'windows'):
  2077. for key,win,unix in DTOOL_CONFIG:
  2078. dtool_config[key] = win
  2079. for key,win,unix in PRC_PARAMETERS:
  2080. prc_parameters[key] = win
  2081. else:
  2082. for key,win,unix in DTOOL_CONFIG:
  2083. dtool_config[key] = unix
  2084. for key,win,unix in PRC_PARAMETERS:
  2085. prc_parameters[key] = unix
  2086. for x in PkgListGet():
  2087. if ("HAVE_"+x in dtool_config):
  2088. if (PkgSkip(x)==0):
  2089. dtool_config["HAVE_"+x] = '1'
  2090. else:
  2091. dtool_config["HAVE_"+x] = 'UNDEF'
  2092. dtool_config["HAVE_NET"] = '1'
  2093. if (PkgSkip("NVIDIACG")==0):
  2094. dtool_config["HAVE_CG"] = '1'
  2095. dtool_config["HAVE_CGGL"] = '1'
  2096. dtool_config["HAVE_CGDX9"] = '1'
  2097. if GetTarget() not in ("linux", "android"):
  2098. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2099. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2100. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2101. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2102. if (GetTarget() == "darwin"):
  2103. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2104. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2105. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2106. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2107. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2108. dtool_config["HAVE_GLX"] = 'UNDEF'
  2109. dtool_config["IS_LINUX"] = 'UNDEF'
  2110. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2111. dtool_config["IS_OSX"] = '1'
  2112. # 10.4 had a broken ucontext implementation
  2113. if int(platform.mac_ver()[0][3]) <= 4:
  2114. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2115. if (GetTarget() == "freebsd"):
  2116. dtool_config["IS_LINUX"] = 'UNDEF'
  2117. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2118. dtool_config["IS_FREEBSD"] = '1'
  2119. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2120. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2121. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2122. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2123. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2124. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2125. if (GetTarget() == "android"):
  2126. # Android does have RTTI, but we disable it anyway.
  2127. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2128. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2129. dtool_config["HAVE_LOCKF"] = 'UNDEF'
  2130. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2131. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2132. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2133. # This should probably be more sophisticated, such as based
  2134. # on whether the libRocket Python modules are available.
  2135. if (PkgSkip("PYTHON") != 0):
  2136. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2137. if (GetOptimize() <= 3):
  2138. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2139. if (GetOptimize() <= 3):
  2140. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2141. dtool_config["DO_PSTATS"] = '1'
  2142. if (GetOptimize() <= 3):
  2143. dtool_config["DO_DCAST"] = '1'
  2144. if (GetOptimize() <= 3):
  2145. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2146. if (GetOptimize() <= 3):
  2147. dtool_config["DO_MEMORY_USAGE"] = '1'
  2148. if (GetOptimize() <= 3):
  2149. dtool_config["NOTIFY_DEBUG"] = '1'
  2150. if (GetOptimize() >= 4):
  2151. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2152. if (GetOptimize() >= 4):
  2153. # Disable RTTI on release builds.
  2154. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2155. # Now that we have OS_SIMPLE_THREADS, we can support
  2156. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2157. # longer need to disable it for this platform.
  2158. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2159. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2160. if (RTDIST or RUNTIME):
  2161. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2162. if HOST_URL:
  2163. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2164. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2165. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2166. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2167. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2168. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2169. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2170. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2171. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2172. if PkgSkip("GTK2") == 0:
  2173. plugin_config["HAVE_GTK"] = '1'
  2174. if (RUNTIME):
  2175. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2176. # Whether it's present on the system doesn't matter here,
  2177. # as the runtime itself doesn't include or link with X11.
  2178. if (RUNTIME and GetTarget() == 'linux'):
  2179. dtool_config["HAVE_X11"] = '1'
  2180. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2181. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2182. else:
  2183. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2184. if (PkgSkip("SPEEDTREE")==0):
  2185. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2186. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2187. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2188. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2189. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2190. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2191. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2192. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2193. for key in sorted(prc_parameters.keys()):
  2194. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2195. val = OverrideValue(key, prc_parameters[key])
  2196. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2197. else: conf = conf + "#define " + key + " " + val + "\n"
  2198. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2199. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2200. for key in sorted(dtool_config.keys()):
  2201. val = OverrideValue(key, dtool_config[key])
  2202. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2203. else: conf = conf + "#define " + key + " " + val + "\n"
  2204. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2205. if (RTDIST or RUNTIME):
  2206. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2207. for key in sorted(plugin_config.keys()):
  2208. val = plugin_config[key]
  2209. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2210. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2211. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2212. if (PkgSkip("SPEEDTREE")==0):
  2213. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2214. for key in sorted(speedtree_parameters.keys()):
  2215. val = OverrideValue(key, speedtree_parameters[key])
  2216. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2217. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2218. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2219. for x in PkgListGet():
  2220. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2221. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2222. WriteConfigSettings()
  2223. WarnConflictingFiles()
  2224. if SystemLibraryExists("dtoolbase"):
  2225. print("%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor()))
  2226. if SystemLibraryExists("p3dtoolconfig"):
  2227. print("%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor()))
  2228. ##########################################################################################
  2229. #
  2230. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2231. #
  2232. ##########################################################################################
  2233. PANDAVERSION_H="""
  2234. #define PANDA_MAJOR_VERSION $VERSION1
  2235. #define PANDA_MINOR_VERSION $VERSION2
  2236. #define PANDA_SEQUENCE_VERSION $VERSION3
  2237. #define PANDA_VERSION $NVERSION
  2238. #define PANDA_NUMERIC_VERSION $NVERSION
  2239. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2240. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2241. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2242. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2243. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2244. """
  2245. PANDAVERSION_H_RUNTIME="""
  2246. #define PANDA_MAJOR_VERSION 0
  2247. #define PANDA_MINOR_VERSION 0
  2248. #define PANDA_SEQUENCE_VERSION 0
  2249. #define PANDA_VERSION_STR "0.0.0"
  2250. #define PANDA_ABI_VERSION_STR "0.0"
  2251. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2252. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2253. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2254. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2255. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2256. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2257. #define PANDA_PACKAGE_VERSION_STR ""
  2258. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2259. """
  2260. CHECKPANDAVERSION_CXX="""
  2261. # include "dtoolbase.h"
  2262. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  2263. """
  2264. CHECKPANDAVERSION_H="""
  2265. # include "dtoolbase.h"
  2266. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  2267. # ifndef WIN32
  2268. /* For Windows, exporting the symbol from the DLL is sufficient; the
  2269. DLL will not load unless all expected public symbols are defined.
  2270. Other systems may not mind if the symbol is absent unless we
  2271. explictly write code that references it. */
  2272. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  2273. # endif
  2274. """
  2275. P3DACTIVEX_RC="""#include "resource.h"
  2276. #define APSTUDIO_READONLY_SYMBOLS
  2277. #include "afxres.h"
  2278. #undef APSTUDIO_READONLY_SYMBOLS
  2279. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2280. #ifdef _WIN32
  2281. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2282. #pragma code_page(1252)
  2283. #endif
  2284. #ifdef APSTUDIO_INVOKED
  2285. 1 TEXTINCLUDE
  2286. BEGIN
  2287. "resource.h\\0"
  2288. END
  2289. 2 TEXTINCLUDE
  2290. BEGIN
  2291. "#include ""afxres.h""\\r\\n"
  2292. "\\0"
  2293. END
  2294. 3 TEXTINCLUDE
  2295. BEGIN
  2296. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2297. "\\0"
  2298. END
  2299. #endif
  2300. %s
  2301. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2302. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2303. STYLE DS_SETFONT | WS_CHILD
  2304. FONT 8, "MS Sans Serif"
  2305. BEGIN
  2306. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2307. IDC_STATIC,7,25,229,16
  2308. END
  2309. #ifdef APSTUDIO_INVOKED
  2310. GUIDELINES DESIGNINFO
  2311. BEGIN
  2312. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2313. BEGIN
  2314. LEFTMARGIN, 7
  2315. RIGHTMARGIN, 243
  2316. TOPMARGIN, 7
  2317. BOTTOMMARGIN, 55
  2318. END
  2319. END
  2320. #endif
  2321. STRINGTABLE
  2322. BEGIN
  2323. IDS_P3DACTIVEX "P3DActiveX Control"
  2324. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2325. END
  2326. STRINGTABLE
  2327. BEGIN
  2328. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2329. END
  2330. #endif
  2331. #ifndef APSTUDIO_INVOKED
  2332. 1 TYPELIB "P3DActiveX.tlb"
  2333. #endif"""
  2334. def CreatePandaVersionFiles():
  2335. version1=int(VERSION.split(".")[0])
  2336. version2=int(VERSION.split(".")[1])
  2337. version3=int(VERSION.split(".")[2])
  2338. nversion=version1*1000000+version2*1000+version3
  2339. if (DISTRIBUTOR != "cmu"):
  2340. # Subtract 1 if we are not an official version.
  2341. nversion -= 1
  2342. if (RUNTIME):
  2343. pandaversion_h = PANDAVERSION_H_RUNTIME
  2344. else:
  2345. pandaversion_h = PANDAVERSION_H
  2346. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2347. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2348. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2349. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2350. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2351. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2352. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2353. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2354. if (DISTRIBUTOR == "cmu"):
  2355. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2356. else:
  2357. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2358. if GIT_COMMIT:
  2359. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2360. if not RUNTIME:
  2361. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2362. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2363. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2364. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2365. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2366. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2367. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2368. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2369. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2370. if RUNTIME:
  2371. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2372. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2373. else:
  2374. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2375. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2376. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2377. if RUNTIME:
  2378. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2379. "version" : VERSION,
  2380. "description" : "Runs 3-D games and interactive applets",
  2381. "filename" : "p3dactivex.ocx",
  2382. "mimetype" : "application/x-panda3d",
  2383. "extension" : "p3d",
  2384. "filedesc" : "Panda3D applet"}
  2385. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2386. CreatePandaVersionFiles()
  2387. ##########################################################################################
  2388. #
  2389. # Copy the "direct" tree
  2390. #
  2391. ##########################################################################################
  2392. if (PkgSkip("DIRECT")==0):
  2393. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2394. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2395. # This file used to be copied, but would nowadays cause conflicts.
  2396. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2397. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2398. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2399. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2400. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2401. # This directory doesn't exist at all any more.
  2402. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2403. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2404. # These files used to exist; remove them to avoid conflicts.
  2405. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2406. '_core.pyd', '_core.so',
  2407. 'direct.py', 'direct.pyc', 'direct.pyo',
  2408. '_direct.pyd', '_direct.so',
  2409. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2410. for basename in del_files:
  2411. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2412. if os.path.isfile(path):
  2413. print("Removing %s" % (path))
  2414. os.remove(path)
  2415. # Write an appropriate panda3d/__init__.py
  2416. p3d_init = """"Python bindings for the Panda3D libraries"
  2417. __version__ = '%s'
  2418. """ % (WHLVERSION)
  2419. if GetTarget() == 'windows':
  2420. p3d_init += """
  2421. import os
  2422. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2423. if os.path.isdir(bindir):
  2424. if not os.environ.get('PATH'):
  2425. os.environ['PATH'] = bindir
  2426. else:
  2427. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2428. del os, bindir
  2429. """
  2430. if not PkgSkip("PYTHON"):
  2431. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2432. # Also add this file, for backward compatibility.
  2433. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2434. if __debug__:
  2435. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2436. from .interrogatedb import *
  2437. """)
  2438. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2439. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2440. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2441. os.remove(fn)
  2442. panda_modules = ['core']
  2443. if not PkgSkip("PANDAPHYSICS"):
  2444. panda_modules.append('physics')
  2445. if not PkgSkip('PANDAFX'):
  2446. panda_modules.append('fx')
  2447. if not PkgSkip("DIRECT"):
  2448. panda_modules.append('direct')
  2449. if not PkgSkip("VISION"):
  2450. panda_modules.append('vision')
  2451. if not PkgSkip("SKEL"):
  2452. panda_modules.append('skel')
  2453. if not PkgSkip("EGG"):
  2454. panda_modules.append('egg')
  2455. if not PkgSkip("AWESOMIUM"):
  2456. panda_modules.append('awesomium')
  2457. if not PkgSkip("ODE"):
  2458. panda_modules.append('ode')
  2459. if not PkgSkip("VRPN"):
  2460. panda_modules.append('vrpn')
  2461. panda_modules_code = """
  2462. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2463. if __debug__:
  2464. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2465. """
  2466. for module in panda_modules:
  2467. panda_modules_code += """
  2468. try:
  2469. from panda3d.%s import *
  2470. except ImportError as err:
  2471. if "No module named %s" not in str(err):
  2472. raise""" % (module, module)
  2473. exthelpers_code = """
  2474. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2475. from direct.extensions_native.extension_native_helpers import *
  2476. """
  2477. if not PkgSkip("PYTHON"):
  2478. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2479. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2480. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2481. ##########################################################################################
  2482. #
  2483. # Generate the PRC files into the ETC directory.
  2484. #
  2485. ##########################################################################################
  2486. confautoprc = ReadFile("makepanda/confauto.in")
  2487. if (PkgSkip("SPEEDTREE")==0):
  2488. # If SpeedTree is available, enable it in the config file
  2489. confautoprc = confautoprc.replace('#st#', '')
  2490. else:
  2491. # otherwise, disable it.
  2492. confautoprc = confautoprc.replace('#st#', '#')
  2493. if (os.path.isfile("makepanda/myconfig.in")):
  2494. configprc = ReadFile("makepanda/myconfig.in")
  2495. else:
  2496. configprc = ReadFile("makepanda/config.in")
  2497. if (GetTarget() == 'windows'):
  2498. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2499. else:
  2500. configprc = configprc.replace("aux-display pandadx9", "")
  2501. if (GetTarget() == 'darwin'):
  2502. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2503. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2504. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2505. if GetTarget() == 'windows':
  2506. # Convert to Windows newlines.
  2507. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2508. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2509. else:
  2510. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2511. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2512. ##########################################################################################
  2513. #
  2514. # Copy the precompiled binaries and DLLs into the build.
  2515. #
  2516. ##########################################################################################
  2517. tp_dir = GetThirdpartyDir()
  2518. if tp_dir is not None:
  2519. dylibs = {}
  2520. if GetTarget() == 'darwin':
  2521. # Make a list of all the dylibs we ship, to figure out whether we should use
  2522. # install_name_tool to correct the library reference to point to our copy.
  2523. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2524. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2525. if not PkgSkip("PYTHON"):
  2526. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2527. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2528. for pkg in PkgListGet():
  2529. if PkgSkip(pkg):
  2530. continue
  2531. tp_pkg = tp_dir + pkg.lower()
  2532. if GetTarget() == 'windows':
  2533. if os.path.exists(tp_pkg + "/bin"):
  2534. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2535. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2536. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2537. elif GetTarget() == 'darwin':
  2538. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2539. if not PkgSkip("PYTHON"):
  2540. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2541. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2542. if pkg != 'PYTHON':
  2543. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2544. for tp_lib in tp_libs:
  2545. basename = os.path.basename(tp_lib)
  2546. if basename.endswith('.dylib'):
  2547. # It's a dynamic link library. Put it in the lib directory.
  2548. target = GetOutputDir() + "/lib/" + basename
  2549. dep_prefix = "@loader_path/../lib/"
  2550. lib_id = dep_prefix + basename
  2551. else:
  2552. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2553. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2554. target = GetOutputDir() + "/" + basename
  2555. dep_prefix = "@loader_path/lib/"
  2556. lib_id = basename
  2557. if not NeedsBuild([target], [tp_lib]):
  2558. continue
  2559. CopyFile(target, tp_lib)
  2560. if os.path.islink(target) or target.endswith('.py'):
  2561. continue
  2562. # Correct the inter-library dependencies so that the build is relocatable.
  2563. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2564. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2565. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2566. line = line.strip()
  2567. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2568. continue
  2569. libdep = line.split(" ", 1)[0]
  2570. dep_basename = os.path.basename(libdep)
  2571. if dep_basename in dylibs:
  2572. dep_target = dylibs[dep_basename]
  2573. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2574. JustBuilt([target], [tp_lib])
  2575. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2576. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2577. else: # Linux / FreeBSD case.
  2578. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2579. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2580. if not PkgSkip("PYTHON"):
  2581. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2582. base = os.path.basename(tp_lib)
  2583. if base.startswith('lib'):
  2584. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2585. else:
  2586. # It's a Python module, like _rocketcore.so.
  2587. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2588. if GetTarget() == 'windows':
  2589. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2590. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2591. if not PkgSkip("PYTHON") and not RTDIST:
  2592. # We need to copy the Python DLL to the bin directory for now.
  2593. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2594. if GetOptimize() <= 2:
  2595. pydll += "_d.dll"
  2596. else:
  2597. pydll += ".dll"
  2598. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2599. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2600. CopyFile(GetOutputDir() + "/bin/", fn)
  2601. # Copy the whole Python directory.
  2602. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2603. # NB: Python does not always ship with the correct manifest/dll.
  2604. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2605. manifest = GetOutputDir() + '/tmp/python.manifest'
  2606. if os.path.isfile(manifest):
  2607. os.unlink(manifest)
  2608. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2609. if os.path.isfile(manifest):
  2610. import xml.etree.ElementTree as ET
  2611. tree = ET.parse(manifest)
  2612. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2613. else:
  2614. idents = ()
  2615. for ident in idents:
  2616. sxs_name = '_'.join([
  2617. ident.get('processorArchitecture'),
  2618. ident.get('name').lower(),
  2619. ident.get('publicKeyToken'),
  2620. ident.get('version'),
  2621. ])
  2622. # Find the manifest matching these parameters.
  2623. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2624. manifests = glob.glob(pattern)
  2625. if not manifests:
  2626. print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern))
  2627. continue
  2628. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2629. # Also copy the corresponding msvcr dll.
  2630. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2631. for file in glob.glob(pattern):
  2632. CopyFile(GetOutputDir() + "/python/", file)
  2633. # Copy python.exe to ppython.exe.
  2634. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2635. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2636. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2637. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2638. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2639. # Copy over the MSVC runtime.
  2640. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2641. vsver = "%s%s" % SDK["VISUALSTUDIO_VERSION"]
  2642. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2643. crtname = "Microsoft.VC%s.CRT" % (vsver)
  2644. if ("VCTOOLSVERSION" in SDK):
  2645. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  2646. else:
  2647. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2648. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2649. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2650. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2651. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2652. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2653. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2654. ########################################################################
  2655. ##
  2656. ## Copy various stuff into the build.
  2657. ##
  2658. ########################################################################
  2659. if GetTarget() == 'windows':
  2660. # Convert to Windows newlines so they can be opened by notepad.
  2661. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2662. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2663. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2664. else:
  2665. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2666. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2667. if (PkgSkip("PANDATOOL")==0):
  2668. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2669. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2670. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2671. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2672. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2673. # Since Eigen is included by all sorts of core headers, as a convenience
  2674. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2675. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2676. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2677. ########################################################################
  2678. #
  2679. # Copy header files to the built/include/parser-inc directory.
  2680. #
  2681. ########################################################################
  2682. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2683. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2684. ########################################################################
  2685. #
  2686. # Transfer all header files to the built/include directory.
  2687. #
  2688. ########################################################################
  2689. CopyAllHeaders('dtool/src/dtoolbase')
  2690. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2691. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2692. CopyAllHeaders('dtool/metalibs/dtool')
  2693. CopyAllHeaders('dtool/src/cppparser')
  2694. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2695. CopyAllHeaders('dtool/src/dconfig')
  2696. CopyAllHeaders('dtool/src/interrogatedb')
  2697. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2698. CopyAllHeaders('dtool/src/pystub')
  2699. CopyAllHeaders('dtool/src/interrogate')
  2700. CopyAllHeaders('dtool/src/test_interrogate')
  2701. CopyAllHeaders('panda/src/putil')
  2702. CopyAllHeaders('panda/src/pandabase')
  2703. CopyAllHeaders('panda/src/express')
  2704. CopyAllHeaders('panda/src/downloader')
  2705. CopyAllHeaders('panda/metalibs/pandaexpress')
  2706. CopyAllHeaders('panda/src/pipeline')
  2707. CopyAllHeaders('panda/src/linmath')
  2708. CopyAllHeaders('panda/src/putil')
  2709. CopyAllHeaders('dtool/src/prckeys')
  2710. CopyAllHeaders('panda/src/audio')
  2711. CopyAllHeaders('panda/src/event')
  2712. CopyAllHeaders('panda/src/mathutil')
  2713. CopyAllHeaders('panda/src/gsgbase')
  2714. CopyAllHeaders('panda/src/pnmimage')
  2715. CopyAllHeaders('panda/src/nativenet')
  2716. CopyAllHeaders('panda/src/net')
  2717. CopyAllHeaders('panda/src/pstatclient')
  2718. CopyAllHeaders('panda/src/gobj')
  2719. CopyAllHeaders('panda/src/movies')
  2720. CopyAllHeaders('panda/src/pgraphnodes')
  2721. CopyAllHeaders('panda/src/pgraph')
  2722. CopyAllHeaders('panda/src/cull')
  2723. CopyAllHeaders('panda/src/chan')
  2724. CopyAllHeaders('panda/src/char')
  2725. CopyAllHeaders('panda/src/dgraph')
  2726. CopyAllHeaders('panda/src/display')
  2727. CopyAllHeaders('panda/src/device')
  2728. CopyAllHeaders('panda/src/pnmtext')
  2729. CopyAllHeaders('panda/src/text')
  2730. CopyAllHeaders('panda/src/grutil')
  2731. if (PkgSkip("VISION")==0):
  2732. CopyAllHeaders('panda/src/vision')
  2733. CopyAllHeaders('panda/src/awesomium')
  2734. if (PkgSkip("FFMPEG")==0):
  2735. CopyAllHeaders('panda/src/ffmpeg')
  2736. CopyAllHeaders('panda/src/tform')
  2737. CopyAllHeaders('panda/src/collide')
  2738. CopyAllHeaders('panda/src/parametrics')
  2739. CopyAllHeaders('panda/src/pgui')
  2740. CopyAllHeaders('panda/src/pnmimagetypes')
  2741. CopyAllHeaders('panda/src/recorder')
  2742. if (PkgSkip("ROCKET")==0):
  2743. CopyAllHeaders('panda/src/rocket')
  2744. if (PkgSkip("VRPN")==0):
  2745. CopyAllHeaders('panda/src/vrpn')
  2746. CopyAllHeaders('panda/src/wgldisplay')
  2747. CopyAllHeaders('panda/src/ode')
  2748. CopyAllHeaders('panda/metalibs/pandaode')
  2749. if (PkgSkip("PANDAPHYSICS")==0):
  2750. CopyAllHeaders('panda/src/physics')
  2751. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2752. CopyAllHeaders('panda/src/particlesystem')
  2753. CopyAllHeaders('panda/src/dxml')
  2754. CopyAllHeaders('panda/metalibs/panda')
  2755. CopyAllHeaders('panda/src/audiotraits')
  2756. CopyAllHeaders('panda/src/audiotraits')
  2757. CopyAllHeaders('panda/src/distort')
  2758. CopyAllHeaders('panda/src/downloadertools')
  2759. CopyAllHeaders('panda/src/windisplay')
  2760. CopyAllHeaders('panda/src/dxgsg9')
  2761. CopyAllHeaders('panda/metalibs/pandadx9')
  2762. if not PkgSkip("EGG"):
  2763. CopyAllHeaders('panda/src/egg')
  2764. CopyAllHeaders('panda/src/egg2pg')
  2765. CopyAllHeaders('panda/src/framework')
  2766. CopyAllHeaders('panda/metalibs/pandafx')
  2767. CopyAllHeaders('panda/src/glstuff')
  2768. CopyAllHeaders('panda/src/glgsg')
  2769. CopyAllHeaders('panda/src/glesgsg')
  2770. CopyAllHeaders('panda/src/gles2gsg')
  2771. if not PkgSkip("EGG"):
  2772. CopyAllHeaders('panda/metalibs/pandaegg')
  2773. if GetTarget() == 'windows':
  2774. CopyAllHeaders('panda/src/wgldisplay')
  2775. elif GetTarget() == 'darwin':
  2776. CopyAllHeaders('panda/src/osxdisplay')
  2777. CopyAllHeaders('panda/src/cocoadisplay')
  2778. elif GetTarget() == 'android':
  2779. CopyAllHeaders('panda/src/android')
  2780. CopyAllHeaders('panda/src/androiddisplay')
  2781. else:
  2782. CopyAllHeaders('panda/src/x11display')
  2783. CopyAllHeaders('panda/src/glxdisplay')
  2784. CopyAllHeaders('panda/src/egldisplay')
  2785. CopyAllHeaders('panda/metalibs/pandagl')
  2786. CopyAllHeaders('panda/metalibs/pandagles')
  2787. CopyAllHeaders('panda/metalibs/pandagles2')
  2788. CopyAllHeaders('panda/metalibs/pandaphysics')
  2789. CopyAllHeaders('panda/src/testbed')
  2790. if (PkgSkip("PHYSX")==0):
  2791. CopyAllHeaders('panda/src/physx')
  2792. CopyAllHeaders('panda/metalibs/pandaphysx')
  2793. if (PkgSkip("BULLET")==0):
  2794. CopyAllHeaders('panda/src/bullet')
  2795. CopyAllHeaders('panda/metalibs/pandabullet')
  2796. if (PkgSkip("SPEEDTREE")==0):
  2797. CopyAllHeaders('panda/src/speedtree')
  2798. if (PkgSkip("DIRECT")==0):
  2799. CopyAllHeaders('direct/src/directbase')
  2800. CopyAllHeaders('direct/src/dcparser')
  2801. CopyAllHeaders('direct/src/deadrec')
  2802. CopyAllHeaders('direct/src/distributed')
  2803. CopyAllHeaders('direct/src/interval')
  2804. CopyAllHeaders('direct/src/showbase')
  2805. CopyAllHeaders('direct/src/dcparse')
  2806. if (RUNTIME or RTDIST):
  2807. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2808. if (RUNTIME):
  2809. CopyAllHeaders('direct/src/plugin_npapi')
  2810. CopyAllHeaders('direct/src/plugin_standalone')
  2811. if (PkgSkip("PANDATOOL")==0):
  2812. CopyAllHeaders('pandatool/src/pandatoolbase')
  2813. CopyAllHeaders('pandatool/src/converter')
  2814. CopyAllHeaders('pandatool/src/progbase')
  2815. CopyAllHeaders('pandatool/src/eggbase')
  2816. CopyAllHeaders('pandatool/src/bam')
  2817. CopyAllHeaders('pandatool/src/cvscopy')
  2818. CopyAllHeaders('pandatool/src/daeegg')
  2819. CopyAllHeaders('pandatool/src/daeprogs')
  2820. CopyAllHeaders('pandatool/src/dxf')
  2821. CopyAllHeaders('pandatool/src/dxfegg')
  2822. CopyAllHeaders('pandatool/src/dxfprogs')
  2823. CopyAllHeaders('pandatool/src/palettizer')
  2824. CopyAllHeaders('pandatool/src/egg-mkfont')
  2825. CopyAllHeaders('pandatool/src/eggcharbase')
  2826. CopyAllHeaders('pandatool/src/egg-optchar')
  2827. CopyAllHeaders('pandatool/src/egg-palettize')
  2828. CopyAllHeaders('pandatool/src/egg-qtess')
  2829. CopyAllHeaders('pandatool/src/eggprogs')
  2830. CopyAllHeaders('pandatool/src/flt')
  2831. CopyAllHeaders('pandatool/src/fltegg')
  2832. CopyAllHeaders('pandatool/src/fltprogs')
  2833. CopyAllHeaders('pandatool/src/imagebase')
  2834. CopyAllHeaders('pandatool/src/imageprogs')
  2835. CopyAllHeaders('pandatool/src/pfmprogs')
  2836. CopyAllHeaders('pandatool/src/lwo')
  2837. CopyAllHeaders('pandatool/src/lwoegg')
  2838. CopyAllHeaders('pandatool/src/lwoprogs')
  2839. CopyAllHeaders('pandatool/src/maya')
  2840. CopyAllHeaders('pandatool/src/mayaegg')
  2841. CopyAllHeaders('pandatool/src/maxegg')
  2842. CopyAllHeaders('pandatool/src/maxprogs')
  2843. CopyAllHeaders('pandatool/src/objegg')
  2844. CopyAllHeaders('pandatool/src/objprogs')
  2845. CopyAllHeaders('pandatool/src/vrml')
  2846. CopyAllHeaders('pandatool/src/vrmlegg')
  2847. CopyAllHeaders('pandatool/src/xfile')
  2848. CopyAllHeaders('pandatool/src/xfileegg')
  2849. CopyAllHeaders('pandatool/src/ptloader')
  2850. CopyAllHeaders('pandatool/src/miscprogs')
  2851. CopyAllHeaders('pandatool/src/pstatserver')
  2852. CopyAllHeaders('pandatool/src/softprogs')
  2853. CopyAllHeaders('pandatool/src/text-stats')
  2854. CopyAllHeaders('pandatool/src/vrmlprogs')
  2855. CopyAllHeaders('pandatool/src/win-stats')
  2856. CopyAllHeaders('pandatool/src/xfileprogs')
  2857. if (PkgSkip("CONTRIB")==0):
  2858. CopyAllHeaders('contrib/src/contribbase')
  2859. CopyAllHeaders('contrib/src/ai')
  2860. ########################################################################
  2861. #
  2862. # These definitions are syntactic shorthand. They make it easy
  2863. # to link with the usual libraries without listing them all.
  2864. #
  2865. ########################################################################
  2866. COMMON_DTOOL_LIBS=[
  2867. 'libp3dtool.dll',
  2868. 'libp3dtoolconfig.dll',
  2869. ]
  2870. COMMON_PANDA_LIBS=[
  2871. 'libpanda.dll',
  2872. 'libpandaexpress.dll'
  2873. ] + COMMON_DTOOL_LIBS
  2874. COMMON_EGG2X_LIBS=[
  2875. 'libp3eggbase.lib',
  2876. 'libp3progbase.lib',
  2877. 'libp3converter.lib',
  2878. 'libp3pandatoolbase.lib',
  2879. 'libpandaegg.dll',
  2880. ] + COMMON_PANDA_LIBS
  2881. ########################################################################
  2882. #
  2883. # This section contains a list of all the files that need to be compiled.
  2884. #
  2885. ########################################################################
  2886. print("Generating dependencies...")
  2887. sys.stdout.flush()
  2888. #
  2889. # Compile Panda icon resource file.
  2890. # We do it first because we need it at
  2891. # the time we compile an executable.
  2892. #
  2893. if GetTarget() == 'windows':
  2894. OPTS=['DIR:panda/src/configfiles']
  2895. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2896. #
  2897. # DIRECTORY: dtool/src/dtoolbase/
  2898. #
  2899. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2900. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2901. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2902. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2903. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2904. #
  2905. # DIRECTORY: dtool/src/dtoolutil/
  2906. #
  2907. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2908. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2909. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2910. if GetTarget() == 'darwin':
  2911. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2912. #
  2913. # DIRECTORY: dtool/metalibs/dtool/
  2914. #
  2915. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2916. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2917. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2918. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2919. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2920. if GetTarget() == 'darwin':
  2921. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2922. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2923. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2924. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2925. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2926. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2927. #
  2928. # DIRECTORY: dtool/src/cppparser/
  2929. #
  2930. if (not RUNTIME):
  2931. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2932. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2933. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2934. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2935. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2936. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2937. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2938. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2939. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2940. #
  2941. # DIRECTORY: dtool/src/prc/
  2942. #
  2943. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2944. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2945. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2946. #
  2947. # DIRECTORY: dtool/src/dconfig/
  2948. #
  2949. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2950. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2951. #
  2952. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2953. #
  2954. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2955. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2956. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2957. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2958. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2959. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2960. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2961. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  2962. #
  2963. # DIRECTORY: dtool/src/interrogatedb/
  2964. #
  2965. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON']
  2966. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2967. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2968. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  2969. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  2970. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  2971. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  2972. TargetAdd('libp3interrogatedb.dll', opts=['PYTHON'])
  2973. if not PkgSkip("PYTHON"):
  2974. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  2975. # stuff, so it has been renamed appropriately.
  2976. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON']
  2977. TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2978. TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  2979. TargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  2980. TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  2981. TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  2982. TargetAdd('interrogatedb.pyd', opts=['PYTHON'])
  2983. #
  2984. # DIRECTORY: dtool/src/pystub/
  2985. #
  2986. if not RUNTIME and not RTDIST:
  2987. OPTS=['DIR:dtool/src/pystub']
  2988. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2989. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  2990. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  2991. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  2992. #
  2993. # DIRECTORY: dtool/src/interrogate/
  2994. #
  2995. if (not RUNTIME):
  2996. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2997. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2998. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2999. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3000. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3001. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3002. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3003. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3004. TargetAdd('interrogate.exe', input='libp3pystub.lib')
  3005. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3006. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3007. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3008. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3009. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3010. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3011. TargetAdd('interrogate_module.exe', input='libp3pystub.lib')
  3012. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3013. if (not RTDIST):
  3014. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3015. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3016. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3017. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3018. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3019. TargetAdd('parse_file.exe', input='libp3pystub.lib')
  3020. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3021. #
  3022. # DIRECTORY: dtool/src/prckeys/
  3023. #
  3024. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3025. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3026. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3027. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3028. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3029. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3030. #
  3031. # DIRECTORY: dtool/src/test_interrogate/
  3032. #
  3033. if (not RTDIST and not RUNTIME):
  3034. OPTS=['DIR:dtool/src/test_interrogate']
  3035. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3036. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3037. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3038. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3039. TargetAdd('test_interrogate.exe', input='libp3pystub.lib')
  3040. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3041. #
  3042. # DIRECTORY: dtool/src/dtoolbase/
  3043. #
  3044. OPTS=['DIR:dtool/src/dtoolbase', 'PYTHON']
  3045. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3046. IGATEFILES += [
  3047. "typeHandle.h",
  3048. "typeHandle_ext.h",
  3049. "typeRegistry.h",
  3050. "typedObject.h",
  3051. "neverFreeMemory.h",
  3052. ]
  3053. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3054. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3055. TargetAdd('libp3dtoolbase_igate.obj', input='libp3dtoolbase.in', opts=["DEPENDENCYONLY"])
  3056. TargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3057. #
  3058. # DIRECTORY: dtool/src/dtoolutil/
  3059. #
  3060. OPTS=['DIR:dtool/src/dtoolutil', 'PYTHON']
  3061. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3062. IGATEFILES += [
  3063. "config_dtoolutil.h",
  3064. "pandaSystem.h",
  3065. "dSearchPath.h",
  3066. "executionEnvironment.h",
  3067. "textEncoder.h",
  3068. "filename.h",
  3069. "filename_ext.h",
  3070. "globPattern.h",
  3071. "globPattern_ext.h",
  3072. "pandaFileStream.h",
  3073. "lineStream.h",
  3074. ]
  3075. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3076. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3077. TargetAdd('libp3dtoolutil_igate.obj', input='libp3dtoolutil.in', opts=["DEPENDENCYONLY"])
  3078. TargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3079. #
  3080. # DIRECTORY: dtool/src/prc/
  3081. #
  3082. OPTS=['DIR:dtool/src/prc', 'PYTHON']
  3083. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3084. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3085. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3086. TargetAdd('libp3prc_igate.obj', input='libp3prc.in', opts=["DEPENDENCYONLY"])
  3087. TargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3088. #
  3089. # DIRECTORY: panda/src/pandabase/
  3090. #
  3091. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3092. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3093. #
  3094. # DIRECTORY: panda/src/express/
  3095. #
  3096. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3097. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3098. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3099. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON']
  3100. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3101. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3102. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3103. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  3104. TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3105. #
  3106. # DIRECTORY: panda/src/downloader/
  3107. #
  3108. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3109. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3110. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3111. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON']
  3112. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3113. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3114. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3115. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  3116. TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3117. #
  3118. # DIRECTORY: panda/metalibs/pandaexpress/
  3119. #
  3120. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3121. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3122. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3123. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3124. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3125. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3126. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3127. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3128. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3129. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3130. #
  3131. # DIRECTORY: panda/src/pipeline/
  3132. #
  3133. if (not RUNTIME):
  3134. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3135. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3136. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3137. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3138. OPTS=['DIR:panda/src/pipeline', 'PYTHON']
  3139. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3140. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3141. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3142. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  3143. TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3144. #
  3145. # DIRECTORY: panda/src/linmath/
  3146. #
  3147. if (not RUNTIME):
  3148. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3149. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3150. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3151. OPTS=['DIR:panda/src/linmath', 'PYTHON']
  3152. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3153. for ifile in IGATEFILES[:]:
  3154. if "_src." in ifile:
  3155. IGATEFILES.remove(ifile)
  3156. IGATEFILES.remove('cast_to_double.h')
  3157. IGATEFILES.remove('lmat_ops.h')
  3158. IGATEFILES.remove('cast_to_float.h')
  3159. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3160. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3161. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  3162. #
  3163. # DIRECTORY: panda/src/putil/
  3164. #
  3165. if (not RUNTIME):
  3166. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3167. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3168. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3169. OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON']
  3170. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3171. IGATEFILES.remove("test_bam.h")
  3172. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3173. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3174. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  3175. TargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3176. #
  3177. # DIRECTORY: panda/src/audio/
  3178. #
  3179. if (not RUNTIME):
  3180. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3181. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3182. OPTS=['DIR:panda/src/audio', 'PYTHON']
  3183. IGATEFILES=["audio.h"]
  3184. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3185. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3186. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  3187. #
  3188. # DIRECTORY: panda/src/event/
  3189. #
  3190. if (not RUNTIME):
  3191. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3192. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3193. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3194. OPTS=['DIR:panda/src/event', 'PYTHON']
  3195. TargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3196. TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3197. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3198. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3199. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3200. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  3201. #
  3202. # DIRECTORY: panda/src/mathutil/
  3203. #
  3204. if (not RUNTIME):
  3205. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3206. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3207. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3208. OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON']
  3209. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3210. for ifile in IGATEFILES[:]:
  3211. if "_src." in ifile:
  3212. IGATEFILES.remove(ifile)
  3213. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3214. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3215. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  3216. #
  3217. # DIRECTORY: panda/src/gsgbase/
  3218. #
  3219. if (not RUNTIME):
  3220. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3221. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3222. OPTS=['DIR:panda/src/gsgbase', 'PYTHON']
  3223. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3224. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3225. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3226. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  3227. #
  3228. # DIRECTORY: panda/src/pnmimage/
  3229. #
  3230. if (not RUNTIME):
  3231. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3232. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3233. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3234. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3235. OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON']
  3236. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3237. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3238. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3239. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  3240. TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3241. #
  3242. # DIRECTORY: panda/src/nativenet/
  3243. #
  3244. if (not RUNTIME):
  3245. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3246. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3247. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON']
  3248. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3249. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3250. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3251. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  3252. #
  3253. # DIRECTORY: panda/src/net/
  3254. #
  3255. if (not RUNTIME):
  3256. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3257. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3258. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3259. OPTS=['DIR:panda/src/net', 'PYTHON']
  3260. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3261. IGATEFILES.remove("datagram_ui.h")
  3262. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3263. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3264. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  3265. #
  3266. # DIRECTORY: panda/src/pstatclient/
  3267. #
  3268. if (not RUNTIME):
  3269. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3270. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3271. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3272. OPTS=['DIR:panda/src/pstatclient', 'PYTHON']
  3273. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3274. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3275. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3276. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  3277. #
  3278. # DIRECTORY: panda/src/gobj/
  3279. #
  3280. if (not RUNTIME):
  3281. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3282. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3283. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  3284. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON']
  3285. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3286. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3287. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3288. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3289. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  3290. TargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3291. #
  3292. # DIRECTORY: panda/src/pgraphnodes/
  3293. #
  3294. if (not RUNTIME):
  3295. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3296. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3297. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3298. OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON']
  3299. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3300. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3301. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3302. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  3303. #
  3304. # DIRECTORY: panda/src/pgraph/
  3305. #
  3306. if (not RUNTIME):
  3307. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3308. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3309. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3310. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3311. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3312. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3313. OPTS=['DIR:panda/src/pgraph', 'PYTHON']
  3314. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3315. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3316. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3317. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  3318. TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3319. #
  3320. # DIRECTORY: panda/src/cull/
  3321. #
  3322. if (not RUNTIME):
  3323. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3324. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3325. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3326. OPTS=['DIR:panda/src/cull', 'PYTHON']
  3327. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3328. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3329. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3330. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  3331. #
  3332. # DIRECTORY: panda/src/chan/
  3333. #
  3334. if (not RUNTIME):
  3335. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3336. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3337. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3338. OPTS=['DIR:panda/src/chan', 'PYTHON']
  3339. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3340. IGATEFILES.remove('movingPart.h')
  3341. IGATEFILES.remove('animChannelFixed.h')
  3342. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3343. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3344. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  3345. # DIRECTORY: panda/src/char/
  3346. #
  3347. if (not RUNTIME):
  3348. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3349. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3350. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3351. OPTS=['DIR:panda/src/char', 'PYTHON']
  3352. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3353. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3354. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3355. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  3356. #
  3357. # DIRECTORY: panda/src/dgraph/
  3358. #
  3359. if (not RUNTIME):
  3360. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3361. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3362. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3363. OPTS=['DIR:panda/src/dgraph', 'PYTHON']
  3364. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3365. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3366. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3367. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  3368. #
  3369. # DIRECTORY: panda/src/display/
  3370. #
  3371. if (not RUNTIME):
  3372. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA']
  3373. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3374. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3375. OPTS=['DIR:panda/src/display', 'PYTHON']
  3376. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3377. IGATEFILES.remove("renderBuffer.h")
  3378. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3379. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3380. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  3381. TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
  3382. TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx')
  3383. TargetAdd('p3display_pythonGraphicsWindowProc.obj', opts=OPTS, input='pythonGraphicsWindowProc.cxx')
  3384. if RTDIST and GetTarget() == 'darwin':
  3385. OPTS=['DIR:panda/src/display']
  3386. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3387. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3388. #
  3389. # DIRECTORY: panda/src/device/
  3390. #
  3391. if (not RUNTIME):
  3392. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3393. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3394. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3395. OPTS=['DIR:panda/src/device', 'PYTHON']
  3396. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3397. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3398. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3399. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  3400. #
  3401. # DIRECTORY: panda/src/pnmtext/
  3402. #
  3403. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3404. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3405. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3406. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON']
  3407. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3408. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3409. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3410. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  3411. #
  3412. # DIRECTORY: panda/src/text/
  3413. #
  3414. if (not RUNTIME):
  3415. if not PkgSkip("HARFBUZZ"):
  3416. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3417. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3418. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3419. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3420. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON']
  3421. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3422. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3423. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3424. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  3425. #
  3426. # DIRECTORY: panda/src/movies/
  3427. #
  3428. if (not RUNTIME):
  3429. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3430. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3431. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS', 'PYTHON']
  3432. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3433. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3434. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3435. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  3436. #
  3437. # DIRECTORY: panda/src/grutil/
  3438. #
  3439. if (not RUNTIME):
  3440. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3441. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3442. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3443. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3444. OPTS=['DIR:panda/src/grutil', 'PYTHON']
  3445. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3446. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3447. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3448. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3449. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  3450. #
  3451. # DIRECTORY: panda/src/tform/
  3452. #
  3453. if (not RUNTIME):
  3454. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3455. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3456. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3457. OPTS=['DIR:panda/src/tform', 'PYTHON']
  3458. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3459. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3460. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3461. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  3462. #
  3463. # DIRECTORY: panda/src/collide/
  3464. #
  3465. if (not RUNTIME):
  3466. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3467. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3468. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3469. OPTS=['DIR:panda/src/collide', 'PYTHON']
  3470. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3471. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3472. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3473. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  3474. #
  3475. # DIRECTORY: panda/src/parametrics/
  3476. #
  3477. if (not RUNTIME):
  3478. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3479. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3480. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3481. OPTS=['DIR:panda/src/parametrics', 'PYTHON']
  3482. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3483. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3484. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3485. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  3486. #
  3487. # DIRECTORY: panda/src/pgui/
  3488. #
  3489. if (not RUNTIME):
  3490. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3491. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3492. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3493. OPTS=['DIR:panda/src/pgui', 'PYTHON']
  3494. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3495. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3496. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3497. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  3498. #
  3499. # DIRECTORY: panda/src/pnmimagetypes/
  3500. #
  3501. if (not RUNTIME):
  3502. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3503. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3504. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3505. #
  3506. # DIRECTORY: panda/src/recorder/
  3507. #
  3508. if (not RUNTIME):
  3509. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3510. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3511. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3512. OPTS=['DIR:panda/src/recorder', 'PYTHON']
  3513. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3514. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3515. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3516. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  3517. #
  3518. # DIRECTORY: panda/src/dxml/
  3519. #
  3520. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3521. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3522. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3523. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3524. if (not RUNTIME):
  3525. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3526. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3527. OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON']
  3528. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3529. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3530. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3531. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  3532. #
  3533. # DIRECTORY: panda/metalibs/panda/
  3534. #
  3535. if (not RUNTIME):
  3536. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3537. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3538. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI']
  3539. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3540. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3541. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3542. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3543. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3544. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3545. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3546. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3547. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3548. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3549. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3550. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3551. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3552. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3553. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3554. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3555. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3556. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3557. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3558. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3559. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3560. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3561. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3562. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3563. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3564. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3565. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3566. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3567. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3568. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3569. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3570. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3571. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3572. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3573. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3574. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3575. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3576. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3577. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3578. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3579. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3580. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3581. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3582. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3583. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3584. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3585. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3586. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3587. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3588. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3589. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3590. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3591. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3592. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3593. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3594. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3595. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3596. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3597. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3598. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3599. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3600. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3601. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3602. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3603. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3604. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3605. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3606. if PkgSkip("FREETYPE")==0:
  3607. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3608. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3609. TargetAdd('libpanda.dll', opts=OPTS)
  3610. TargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3611. TargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3612. TargetAdd('core_module.obj', input='libp3prc.in')
  3613. TargetAdd('core_module.obj', input='libp3downloader.in')
  3614. TargetAdd('core_module.obj', input='libp3express.in')
  3615. TargetAdd('core_module.obj', input='libp3recorder.in')
  3616. TargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3617. TargetAdd('core_module.obj', input='libp3pgraph.in')
  3618. TargetAdd('core_module.obj', input='libp3cull.in')
  3619. TargetAdd('core_module.obj', input='libp3grutil.in')
  3620. TargetAdd('core_module.obj', input='libp3chan.in')
  3621. TargetAdd('core_module.obj', input='libp3pstatclient.in')
  3622. TargetAdd('core_module.obj', input='libp3char.in')
  3623. TargetAdd('core_module.obj', input='libp3collide.in')
  3624. TargetAdd('core_module.obj', input='libp3device.in')
  3625. TargetAdd('core_module.obj', input='libp3dgraph.in')
  3626. TargetAdd('core_module.obj', input='libp3display.in')
  3627. TargetAdd('core_module.obj', input='libp3pipeline.in')
  3628. TargetAdd('core_module.obj', input='libp3event.in')
  3629. TargetAdd('core_module.obj', input='libp3gobj.in')
  3630. TargetAdd('core_module.obj', input='libp3gsgbase.in')
  3631. TargetAdd('core_module.obj', input='libp3linmath.in')
  3632. TargetAdd('core_module.obj', input='libp3mathutil.in')
  3633. TargetAdd('core_module.obj', input='libp3parametrics.in')
  3634. TargetAdd('core_module.obj', input='libp3pnmimage.in')
  3635. TargetAdd('core_module.obj', input='libp3text.in')
  3636. TargetAdd('core_module.obj', input='libp3tform.in')
  3637. TargetAdd('core_module.obj', input='libp3putil.in')
  3638. TargetAdd('core_module.obj', input='libp3audio.in')
  3639. TargetAdd('core_module.obj', input='libp3nativenet.in')
  3640. TargetAdd('core_module.obj', input='libp3net.in')
  3641. TargetAdd('core_module.obj', input='libp3pgui.in')
  3642. TargetAdd('core_module.obj', input='libp3movies.in')
  3643. TargetAdd('core_module.obj', input='libp3dxml.in')
  3644. if PkgSkip("FREETYPE")==0:
  3645. TargetAdd('core_module.obj', input='libp3pnmtext.in')
  3646. TargetAdd('core_module.obj', opts=['PYTHON'])
  3647. TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3648. TargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3649. TargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3650. TargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3651. TargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3652. TargetAdd('core.pyd', input='libp3prc_igate.obj')
  3653. TargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3654. TargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3655. TargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3656. TargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3657. TargetAdd('core.pyd', input='libp3express_igate.obj')
  3658. TargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3659. TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3660. TargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3661. TargetAdd('core.pyd', input='libp3movies_igate.obj')
  3662. TargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3663. TargetAdd('core.pyd', input='libp3chan_igate.obj')
  3664. TargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3665. TargetAdd('core.pyd', input='libp3char_igate.obj')
  3666. TargetAdd('core.pyd', input='libp3collide_igate.obj')
  3667. TargetAdd('core.pyd', input='libp3device_igate.obj')
  3668. TargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3669. TargetAdd('core.pyd', input='libp3display_igate.obj')
  3670. TargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3671. TargetAdd('core.pyd', input='libp3event_igate.obj')
  3672. TargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3673. TargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3674. TargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3675. TargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3676. TargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3677. TargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3678. TargetAdd('core.pyd', input='libp3text_igate.obj')
  3679. TargetAdd('core.pyd', input='libp3tform_igate.obj')
  3680. TargetAdd('core.pyd', input='libp3putil_igate.obj')
  3681. TargetAdd('core.pyd', input='libp3audio_igate.obj')
  3682. TargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3683. TargetAdd('core.pyd', input='libp3net_igate.obj')
  3684. TargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3685. TargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3686. if PkgSkip("FREETYPE")==0:
  3687. TargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3688. TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3689. TargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3690. TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3691. TargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  3692. TargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3693. TargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3694. TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3695. TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj')
  3696. TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj')
  3697. TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj')
  3698. TargetAdd('core.pyd', input='core_module.obj')
  3699. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3700. TargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3701. TargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3702. TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3703. TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2'])
  3704. #
  3705. # DIRECTORY: panda/src/vision/
  3706. #
  3707. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3708. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3709. if not PkgSkip("FFMPEG"):
  3710. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3711. if not PkgSkip("OPENCV"):
  3712. DefSymbol("OPENCV", "HAVE_OPENCV")
  3713. if OPENCV_VER_23:
  3714. DefSymbol("OPENCV", "OPENCV_VER_23")
  3715. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3716. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3717. 'dtool_have_ffmpeg.dat',
  3718. 'dtool_have_opencv.dat',
  3719. 'dtool_have_directcam.dat',
  3720. ])
  3721. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3722. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3723. TargetAdd('libp3vision.dll', opts=OPTS)
  3724. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON']
  3725. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3726. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3727. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3728. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  3729. TargetAdd('vision_module.obj', input='libp3vision.in')
  3730. TargetAdd('vision_module.obj', opts=OPTS)
  3731. TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3732. TargetAdd('vision.pyd', input='vision_module.obj')
  3733. TargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3734. TargetAdd('vision.pyd', input='libp3vision.dll')
  3735. TargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3736. TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3737. TargetAdd('vision.pyd', opts=['PYTHON'])
  3738. #
  3739. # DIRECTORY: panda/src/rocket/
  3740. #
  3741. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3742. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3743. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3744. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3745. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3746. TargetAdd('libp3rocket.dll', opts=OPTS)
  3747. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON']
  3748. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3749. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3750. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3751. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3752. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  3753. TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3754. TargetAdd('rocket_module.obj', input='libp3rocket.in')
  3755. TargetAdd('rocket_module.obj', opts=OPTS)
  3756. TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3757. TargetAdd('rocket.pyd', input='rocket_module.obj')
  3758. TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3759. TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3760. TargetAdd('rocket.pyd', input='libp3rocket.dll')
  3761. TargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3762. TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3763. TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET'])
  3764. #
  3765. # DIRECTORY: panda/src/p3awesomium
  3766. #
  3767. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  3768. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  3769. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  3770. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  3771. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  3772. TargetAdd('libp3awesomium.dll', opts=OPTS)
  3773. OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON']
  3774. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  3775. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  3776. TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  3777. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  3778. TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
  3779. TargetAdd('awesomium_module.obj', opts=OPTS)
  3780. TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core'])
  3781. TargetAdd('awesomium.pyd', input='awesomium_module.obj')
  3782. TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
  3783. TargetAdd('awesomium.pyd', input='libp3awesomium.dll')
  3784. TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll')
  3785. TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS)
  3786. TargetAdd('awesomium.pyd', opts=['PYTHON'])
  3787. #
  3788. # DIRECTORY: panda/src/p3skel
  3789. #
  3790. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3791. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3792. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3793. OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON']
  3794. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3795. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3796. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3797. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  3798. #
  3799. # DIRECTORY: panda/src/p3skel
  3800. #
  3801. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3802. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3803. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3804. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3805. TargetAdd('libpandaskel.dll', opts=OPTS)
  3806. OPTS=['PYTHON']
  3807. TargetAdd('skel_module.obj', input='libp3skel.in')
  3808. TargetAdd('skel_module.obj', opts=OPTS)
  3809. TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3810. TargetAdd('skel.pyd', input='skel_module.obj')
  3811. TargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3812. TargetAdd('skel.pyd', input='libpandaskel.dll')
  3813. TargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3814. TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3815. TargetAdd('skel.pyd', opts=['PYTHON'])
  3816. #
  3817. # DIRECTORY: panda/src/distort/
  3818. #
  3819. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3820. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3821. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3822. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3823. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3824. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3825. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3826. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  3827. #
  3828. # DIRECTORY: panda/metalibs/pandafx/
  3829. #
  3830. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3831. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3832. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3833. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3834. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3835. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3836. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3837. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3838. TargetAdd('fx_module.obj', input='libp3distort.in')
  3839. TargetAdd('fx_module.obj', opts=OPTS)
  3840. TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3841. TargetAdd('fx.pyd', input='fx_module.obj')
  3842. TargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3843. TargetAdd('fx.pyd', input='libpandafx.dll')
  3844. TargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3845. TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3846. TargetAdd('fx.pyd', opts=['PYTHON'])
  3847. #
  3848. # DIRECTORY: panda/src/vrpn/
  3849. #
  3850. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3851. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3852. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3853. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3854. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3855. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3856. OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON']
  3857. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3858. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3859. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3860. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  3861. TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3862. TargetAdd('vrpn_module.obj', opts=OPTS)
  3863. TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3864. TargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3865. TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3866. TargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3867. TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3868. TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3869. TargetAdd('vrpn.pyd', opts=['PYTHON'])
  3870. #
  3871. # DIRECTORY: panda/src/ffmpeg
  3872. #
  3873. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3874. if not PkgSkip("SWSCALE"):
  3875. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3876. if not PkgSkip("SWRESAMPLE"):
  3877. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3878. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3879. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3880. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3881. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3882. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3883. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3884. #
  3885. # DIRECTORY: panda/src/audiotraits/
  3886. #
  3887. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3888. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3889. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3890. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3891. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3892. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3893. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3894. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3895. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3896. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3897. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3898. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  3899. #
  3900. # DIRECTORY: panda/src/downloadertools/
  3901. #
  3902. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3903. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3904. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3905. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3906. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  3907. TargetAdd('apply_patch.exe', opts=OPTS)
  3908. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3909. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3910. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  3911. TargetAdd('build_patch.exe', opts=OPTS)
  3912. if not PkgSkip("ZLIB"):
  3913. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3914. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3915. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  3916. TargetAdd('check_adler.exe', opts=OPTS)
  3917. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3918. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3919. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  3920. TargetAdd('check_crc.exe', opts=OPTS)
  3921. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3922. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3923. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  3924. TargetAdd('check_md5.exe', opts=OPTS)
  3925. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3926. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3927. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3928. TargetAdd('pdecrypt.exe', opts=OPTS)
  3929. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3930. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3931. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3932. TargetAdd('pencrypt.exe', opts=OPTS)
  3933. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3934. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3935. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  3936. TargetAdd('show_ddb.exe', opts=OPTS)
  3937. #
  3938. # DIRECTORY: panda/src/downloadertools/
  3939. #
  3940. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3941. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3942. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3943. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3944. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3945. TargetAdd('multify.exe', opts=OPTS)
  3946. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3947. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3948. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3949. TargetAdd('pzip.exe', opts=OPTS)
  3950. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3951. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3952. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3953. TargetAdd('punzip.exe', opts=OPTS)
  3954. #
  3955. # DIRECTORY: panda/src/windisplay/
  3956. #
  3957. if (GetTarget() == 'windows' and not RUNTIME):
  3958. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3959. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3960. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3961. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3962. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3963. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3964. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3965. #
  3966. # DIRECTORY: panda/metalibs/pandadx9/
  3967. #
  3968. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  3969. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3970. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3971. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3972. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3973. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3974. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3975. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3976. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3977. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3978. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3979. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3980. #
  3981. # DIRECTORY: panda/src/egg/
  3982. #
  3983. if not RUNTIME and not PkgSkip("EGG"):
  3984. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3985. CreateFile(GetOutputDir()+"/include/parser.h")
  3986. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3987. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3988. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3989. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3990. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3991. OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON']
  3992. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3993. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3994. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3995. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3996. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3997. TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  3998. #
  3999. # DIRECTORY: panda/src/egg2pg/
  4000. #
  4001. if not RUNTIME and not PkgSkip("EGG"):
  4002. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4003. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4004. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4005. OPTS=['DIR:panda/src/egg2pg', 'PYTHON']
  4006. IGATEFILES=['load_egg_file.h']
  4007. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4008. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4009. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  4010. #
  4011. # DIRECTORY: panda/src/framework/
  4012. #
  4013. if (not RUNTIME):
  4014. deps = []
  4015. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4016. if GetLinkAllStatic():
  4017. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4018. if not PkgSkip("GL"):
  4019. DefSymbol("FRAMEWORK", "HAVE_GL")
  4020. if not PkgSkip("TINYDISPLAY"):
  4021. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4022. if not PkgSkip("EGG"):
  4023. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4024. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4025. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4026. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4027. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4028. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4029. #
  4030. # DIRECTORY: panda/src/glgsg/
  4031. #
  4032. if (not RUNTIME and PkgSkip("GL")==0):
  4033. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4034. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4035. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4036. #
  4037. # DIRECTORY: panda/src/glesgsg/
  4038. #
  4039. if (not RUNTIME and PkgSkip("GLES")==0):
  4040. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4041. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4042. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4043. #
  4044. # DIRECTORY: panda/src/gles2gsg/
  4045. #
  4046. if (not RUNTIME and PkgSkip("GLES2")==0):
  4047. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4048. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4049. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4050. #
  4051. # DIRECTORY: panda/metalibs/pandaegg/
  4052. #
  4053. if not RUNTIME and not PkgSkip("EGG"):
  4054. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4055. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4056. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4057. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4058. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4059. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4060. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4061. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4062. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4063. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4064. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4065. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON']
  4066. TargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4067. TargetAdd('egg_module.obj', input='libp3egg.in')
  4068. TargetAdd('egg_module.obj', opts=OPTS)
  4069. TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4070. TargetAdd('egg.pyd', input='egg_module.obj')
  4071. TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4072. TargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4073. TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4074. TargetAdd('egg.pyd', input='libpandaegg.dll')
  4075. TargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4076. TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4077. TargetAdd('egg.pyd', opts=['PYTHON'])
  4078. #
  4079. # DIRECTORY: panda/src/x11display/
  4080. #
  4081. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4082. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4083. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4084. #
  4085. # DIRECTORY: panda/src/glxdisplay/
  4086. #
  4087. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4088. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4089. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4090. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4091. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4092. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4093. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4094. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4095. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4096. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4097. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4098. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4099. #
  4100. # DIRECTORY: panda/src/cocoadisplay/
  4101. #
  4102. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4103. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4104. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4105. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4106. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4107. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4108. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4109. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4110. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  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', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4115. #
  4116. # DIRECTORY: panda/src/osxdisplay/
  4117. #
  4118. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4119. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4120. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4121. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4122. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4123. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4124. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4125. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4126. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4127. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4128. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4129. if (PkgSkip('PANDAFX')==0):
  4130. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4131. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4132. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4133. #
  4134. # DIRECTORY: panda/src/wgldisplay/
  4135. #
  4136. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4137. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4138. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4139. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4140. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4141. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4142. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4143. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4144. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4145. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4146. if (PkgSkip('PANDAFX')==0):
  4147. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4148. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4149. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4150. #
  4151. # DIRECTORY: panda/src/egldisplay/
  4152. #
  4153. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4154. DefSymbol('GLES', 'OPENGLES_1', '')
  4155. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4156. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4157. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4158. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4159. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4160. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4161. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4162. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4163. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4164. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4165. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4166. #
  4167. # DIRECTORY: panda/src/egldisplay/
  4168. #
  4169. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4170. DefSymbol('GLES2', 'OPENGLES_2', '')
  4171. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4172. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4173. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4174. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4175. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4176. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4177. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4178. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4179. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4180. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4181. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4182. #
  4183. # DIRECTORY: panda/src/ode/
  4184. #
  4185. if (PkgSkip("ODE")==0 and not RUNTIME):
  4186. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON']
  4187. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4188. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4189. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4190. OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON']
  4191. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4192. IGATEFILES.remove("odeConvexGeom.h")
  4193. IGATEFILES.remove("odeHeightFieldGeom.h")
  4194. IGATEFILES.remove("odeHelperStructs.h")
  4195. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4196. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4197. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  4198. TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4199. #
  4200. # DIRECTORY: panda/metalibs/pandaode/
  4201. #
  4202. if (PkgSkip("ODE")==0 and not RUNTIME):
  4203. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4204. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4205. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4206. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4207. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4208. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4209. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4210. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4211. OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON']
  4212. TargetAdd('ode_module.obj', input='libpandaode.in')
  4213. TargetAdd('ode_module.obj', opts=OPTS)
  4214. TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4215. TargetAdd('ode.pyd', input='ode_module.obj')
  4216. TargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4217. TargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4218. TargetAdd('ode.pyd', input='libpandaode.dll')
  4219. TargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4220. TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4221. TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE'])
  4222. #
  4223. # DIRECTORY: panda/src/bullet/
  4224. #
  4225. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4226. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4227. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4228. OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON']
  4229. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4230. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4231. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4232. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  4233. #
  4234. # DIRECTORY: panda/metalibs/pandabullet/
  4235. #
  4236. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4237. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4238. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4239. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4240. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4241. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4242. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4243. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON']
  4244. TargetAdd('bullet_module.obj', input='libpandabullet.in')
  4245. TargetAdd('bullet_module.obj', opts=OPTS)
  4246. TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4247. TargetAdd('bullet.pyd', input='bullet_module.obj')
  4248. TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4249. TargetAdd('bullet.pyd', input='libpandabullet.dll')
  4250. TargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4251. TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4252. TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET'])
  4253. #
  4254. # DIRECTORY: panda/src/physx/
  4255. #
  4256. if (PkgSkip("PHYSX")==0):
  4257. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4258. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4259. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4260. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4261. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4262. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4263. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  4264. #
  4265. # DIRECTORY: panda/metalibs/pandaphysx/
  4266. #
  4267. if (PkgSkip("PHYSX")==0):
  4268. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4269. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4270. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4271. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4272. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4273. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'PYTHON'])
  4274. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4275. TargetAdd('physx_module.obj', input='libpandaphysx.in')
  4276. TargetAdd('physx_module.obj', opts=OPTS)
  4277. TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4278. TargetAdd('physx.pyd', input='physx_module.obj')
  4279. TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4280. TargetAdd('physx.pyd', input='libpandaphysx.dll')
  4281. TargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4282. TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4283. TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4284. #
  4285. # DIRECTORY: panda/src/physics/
  4286. #
  4287. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4288. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4289. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4290. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4291. OPTS=['DIR:panda/src/physics', 'PYTHON']
  4292. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4293. IGATEFILES.remove("forces.h")
  4294. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4295. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4296. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  4297. #
  4298. # DIRECTORY: panda/src/particlesystem/
  4299. #
  4300. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4301. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4302. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4303. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4304. OPTS=['DIR:panda/src/particlesystem', 'PYTHON']
  4305. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4306. IGATEFILES.remove('orientedParticle.h')
  4307. IGATEFILES.remove('orientedParticleFactory.h')
  4308. IGATEFILES.remove('particlefactories.h')
  4309. IGATEFILES.remove('emitters.h')
  4310. IGATEFILES.remove('particles.h')
  4311. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4312. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4313. TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
  4314. #
  4315. # DIRECTORY: panda/metalibs/pandaphysics/
  4316. #
  4317. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4318. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4319. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4320. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4321. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4322. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4323. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4324. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4325. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4326. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4327. OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON']
  4328. TargetAdd('physics_module.obj', input='libp3physics.in')
  4329. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4330. TargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4331. TargetAdd('physics_module.obj', opts=OPTS)
  4332. TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4333. TargetAdd('physics.pyd', input='physics_module.obj')
  4334. TargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4335. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4336. TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4337. TargetAdd('physics.pyd', input='libpandaphysics.dll')
  4338. TargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4339. TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4340. TargetAdd('physics.pyd', opts=['PYTHON'])
  4341. #
  4342. # DIRECTORY: panda/src/speedtree/
  4343. #
  4344. if (PkgSkip("SPEEDTREE")==0):
  4345. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON']
  4346. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4347. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4348. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4349. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4350. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  4351. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4352. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4353. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4354. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4355. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4356. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4357. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4358. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4359. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4360. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4361. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4362. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4363. #
  4364. # DIRECTORY: panda/src/testbed/
  4365. #
  4366. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'android'):
  4367. OPTS=['DIR:panda/src/testbed']
  4368. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4369. TargetAdd('pview.exe', input='pview_pview.obj')
  4370. TargetAdd('pview.exe', input='libp3framework.dll')
  4371. if not PkgSkip("EGG"):
  4372. TargetAdd('pview.exe', input='libpandaegg.dll')
  4373. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4374. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4375. #
  4376. # DIRECTORY: panda/src/android/
  4377. #
  4378. if (not RUNTIME and GetTarget() == 'android'):
  4379. OPTS=['DIR:panda/src/android']
  4380. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4381. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java', dep='org/panda3d/android/NativeIStream.class')
  4382. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4383. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4384. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4385. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4386. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4387. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4388. if (not RTDIST and PkgSkip("PVIEW")==0):
  4389. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4390. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4391. TargetAdd('libpview.dll', input='android_main.obj')
  4392. TargetAdd('libpview.dll', input='pview_pview.obj')
  4393. TargetAdd('libpview.dll', input='libp3framework.dll')
  4394. if not PkgSkip("EGG"):
  4395. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4396. TargetAdd('libpview.dll', input='libp3android.dll')
  4397. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4398. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4399. #
  4400. # DIRECTORY: panda/src/androiddisplay/
  4401. #
  4402. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4403. DefSymbol('GLES', 'OPENGLES_1', '')
  4404. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4405. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4406. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4407. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4408. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4409. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4410. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4411. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4412. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4413. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4414. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4415. #
  4416. # DIRECTORY: panda/src/tinydisplay/
  4417. #
  4418. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4419. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4420. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4421. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4422. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4423. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4424. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4425. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4426. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4427. if GetTarget() == 'darwin':
  4428. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4429. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4430. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4431. elif GetTarget() == 'windows':
  4432. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4433. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4434. else:
  4435. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4436. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4437. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4438. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4439. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4440. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4441. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4442. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4443. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4444. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4445. #
  4446. # DIRECTORY: direct/src/directbase/
  4447. #
  4448. if (PkgSkip("DIRECT")==0):
  4449. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  4450. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4451. #
  4452. # DIRECTORY: direct/src/dcparser/
  4453. #
  4454. if (PkgSkip("DIRECT")==0):
  4455. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON']
  4456. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4457. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4458. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4459. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4460. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4461. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4462. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON']
  4463. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4464. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4465. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4466. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4467. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4468. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  4469. #
  4470. # DIRECTORY: direct/src/deadrec/
  4471. #
  4472. if (PkgSkip("DIRECT")==0):
  4473. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4474. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4475. OPTS=['DIR:direct/src/deadrec', 'PYTHON']
  4476. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4477. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4478. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4479. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  4480. #
  4481. # DIRECTORY: direct/src/distributed/
  4482. #
  4483. if (PkgSkip("DIRECT")==0):
  4484. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON']
  4485. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4486. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4487. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4488. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON']
  4489. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4490. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4491. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4492. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  4493. #
  4494. # DIRECTORY: direct/src/interval/
  4495. #
  4496. if (PkgSkip("DIRECT")==0):
  4497. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4498. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4499. OPTS=['DIR:direct/src/interval', 'PYTHON']
  4500. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4501. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4502. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4503. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  4504. #
  4505. # DIRECTORY: direct/src/showbase/
  4506. #
  4507. if (PkgSkip("DIRECT")==0):
  4508. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4509. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4510. if GetTarget() == 'darwin':
  4511. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4512. OPTS=['DIR:direct/src/showbase', 'PYTHON']
  4513. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4514. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4515. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4516. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  4517. #
  4518. # DIRECTORY: direct/src/motiontrail/
  4519. #
  4520. if (PkgSkip("DIRECT")==0):
  4521. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4522. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4523. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4524. OPTS=['DIR:direct/src/motiontrail', 'PYTHON']
  4525. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4526. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4527. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4528. TargetAdd('libp3motiontrail_igate.obj', input='libp3motiontrail.in', opts=["DEPENDENCYONLY"])
  4529. #
  4530. # DIRECTORY: direct/metalibs/direct/
  4531. #
  4532. if (PkgSkip("DIRECT")==0):
  4533. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4534. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4535. if GetTarget() == 'darwin':
  4536. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4537. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4538. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4539. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4540. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4541. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4542. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4543. OPTS=['PYTHON']
  4544. TargetAdd('direct_module.obj', input='libp3dcparser.in')
  4545. TargetAdd('direct_module.obj', input='libp3showbase.in')
  4546. TargetAdd('direct_module.obj', input='libp3deadrec.in')
  4547. TargetAdd('direct_module.obj', input='libp3interval.in')
  4548. TargetAdd('direct_module.obj', input='libp3distributed.in')
  4549. TargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4550. TargetAdd('direct_module.obj', opts=OPTS)
  4551. TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4552. TargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4553. TargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4554. TargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4555. TargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4556. TargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4557. TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4558. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4559. # the Python libraries. If a C++ user needs these modules, we can move them
  4560. # back and filter out the Python-specific code.
  4561. TargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4562. TargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4563. TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4564. TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4565. TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4566. TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4567. TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4568. TargetAdd('direct.pyd', input='direct_module.obj')
  4569. TargetAdd('direct.pyd', input='libp3direct.dll')
  4570. TargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4571. TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4572. TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2'])
  4573. #
  4574. # DIRECTORY: direct/src/dcparse/
  4575. #
  4576. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4577. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON']
  4578. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4579. TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4580. TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4581. TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4582. TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4583. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4584. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4585. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4586. TargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4587. TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON'])
  4588. #
  4589. # DIRECTORY: direct/src/plugin/
  4590. #
  4591. if (RTDIST or RUNTIME):
  4592. # Explicitly define this as we don't include dtool_config.h here.
  4593. if GetTarget() not in ('windows', 'darwin'):
  4594. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4595. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4596. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4597. OPTS += ['ZLIB', 'MSIMG']
  4598. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4599. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4600. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4601. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4602. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4603. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4604. if GetTarget() == 'darwin':
  4605. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4606. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4607. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4608. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4609. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4610. if (RTDIST):
  4611. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4612. TargetAdd(fname, input='plugin_plugin.obj')
  4613. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4614. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4615. TargetAdd(fname, input='plugin_parse_color.obj')
  4616. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4617. if GetTarget() == 'darwin':
  4618. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4619. TargetAdd(fname, input='plugin_fileSpec.obj')
  4620. TargetAdd(fname, input='plugin_binaryXml.obj')
  4621. TargetAdd(fname, input='plugin_handleStream.obj')
  4622. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4623. TargetAdd(fname, input='libp3tinyxml.ilb')
  4624. if GetTarget() == 'darwin':
  4625. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4626. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4627. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4628. if (PkgSkip("PYTHON")==0 and RTDIST):
  4629. # Freeze VFSImporter and its dependency modules into p3dpython.
  4630. # Mark panda3d.core as a dependency to make sure to build that first.
  4631. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON'])
  4632. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4633. OPTS += ['PYTHON']
  4634. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4635. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4636. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4637. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4638. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4639. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4640. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4641. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4642. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4643. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4644. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4645. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4646. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4647. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4648. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4649. if GetTarget() == 'windows':
  4650. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4651. OPTS.append("NON_CONSOLE")
  4652. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4653. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4654. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4655. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4656. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4657. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4658. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4659. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4660. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  4661. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4662. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4663. if GetTarget() == 'darwin':
  4664. OPTS += ['OPT:2']
  4665. if (PkgSkip("FLTK")==0):
  4666. OPTS.append("FLTK")
  4667. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4668. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4669. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4670. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4671. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4672. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4673. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4674. if GetTarget() == 'darwin':
  4675. OPTS += ['OPT:2']
  4676. TargetAdd('p3dcert.exe', opts=OPTS)
  4677. elif (PkgSkip("WX")==0):
  4678. OPTS += ["WX", "RTTI"]
  4679. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4680. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4681. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4682. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4683. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4684. if GetTarget() == "darwin":
  4685. OPTS += ['GL', 'OPT:2']
  4686. TargetAdd('p3dcert.exe', opts=OPTS)
  4687. #
  4688. # DIRECTORY: direct/src/plugin_npapi/
  4689. #
  4690. if RUNTIME:
  4691. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4692. if GetTarget() == 'windows':
  4693. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4694. "version" : VERSION,
  4695. "description" : "Runs 3-D games and interactive applets",
  4696. "filename" : "nppanda3d.dll",
  4697. "mimetype" : "application/x-panda3d",
  4698. "extension" : "p3d",
  4699. "filedesc" : "Panda3D applet"}
  4700. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4701. elif GetTarget() == 'darwin':
  4702. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4703. OPTS += ['GTK2']
  4704. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4705. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4706. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4707. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4708. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4709. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4710. if GetTarget() == 'windows':
  4711. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4712. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4713. elif GetTarget() == 'darwin':
  4714. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4715. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4716. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4717. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4718. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4719. #
  4720. # DIRECTORY: direct/src/plugin_activex/
  4721. #
  4722. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4723. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4724. DefSymbol('ACTIVEX', '_USRDLL', '')
  4725. DefSymbol('ACTIVEX', '_WINDLL', '')
  4726. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4727. DefSymbol('ACTIVEX', '_MBCS', '')
  4728. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4729. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4730. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4731. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4732. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4733. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4734. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4735. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4736. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4737. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4738. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4739. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4740. #
  4741. # DIRECTORY: direct/src/plugin_standalone/
  4742. #
  4743. if (RUNTIME):
  4744. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4745. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4746. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4747. if GetTarget() == 'windows':
  4748. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4749. "version" : VERSION,
  4750. "description" : "Runs 3-D games and interactive applets",
  4751. "filename" : "panda3d.exe",
  4752. "mimetype" : "application/x-panda3d",
  4753. "extension" : "p3d",
  4754. "filedesc" : "Panda3D applet",
  4755. "icon" : "panda3d.ico"}
  4756. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4757. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4758. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4759. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4760. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4761. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4762. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4763. if GetTarget() == 'darwin':
  4764. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4765. elif GetTarget() == 'windows':
  4766. TargetAdd('panda3d.exe', input='panda3d.res')
  4767. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4768. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4769. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4770. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4771. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4772. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4773. if (GetTarget() == 'darwin'):
  4774. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4775. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4776. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4777. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4778. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4779. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4780. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4781. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4782. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4783. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4784. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4785. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4786. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4787. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4788. elif (GetTarget() == 'windows'):
  4789. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4790. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4791. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4792. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4793. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4794. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4795. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4796. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4797. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4798. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4799. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4800. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4801. if (RTDIST):
  4802. 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']
  4803. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4804. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4805. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4806. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4807. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4808. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4809. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4810. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4811. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4812. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4813. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4814. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4815. if (GetTarget() == 'darwin'):
  4816. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4817. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4818. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4819. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  4820. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4821. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4822. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4823. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4824. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4825. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4826. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4827. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4828. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4829. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4830. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4831. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4832. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4833. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4834. if GetTarget() == 'darwin':
  4835. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4836. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4837. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4838. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  4839. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4840. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4841. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4842. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4843. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4844. if GetTarget() == 'darwin':
  4845. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4846. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4847. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4848. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4849. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4850. if GetTarget() == 'windows':
  4851. OPTS.append("P3DEMBEDW")
  4852. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4853. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4854. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4855. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4856. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4857. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4858. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4859. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4860. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4861. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4862. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4863. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4864. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4865. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4866. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  4867. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4868. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4869. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4870. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4871. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4872. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4873. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4874. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4875. #
  4876. # DIRECTORY: pandatool/src/pandatoolbase/
  4877. #
  4878. if (PkgSkip("PANDATOOL")==0):
  4879. OPTS=['DIR:pandatool/src/pandatoolbase']
  4880. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4881. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4882. #
  4883. # DIRECTORY: pandatool/src/converter/
  4884. #
  4885. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4886. OPTS=['DIR:pandatool/src/converter']
  4887. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4888. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4889. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4890. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4891. #
  4892. # DIRECTORY: pandatool/src/progbase/
  4893. #
  4894. if not PkgSkip("PANDATOOL"):
  4895. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4896. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4897. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4898. #
  4899. # DIRECTORY: pandatool/src/eggbase/
  4900. #
  4901. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4902. OPTS=['DIR:pandatool/src/eggbase']
  4903. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4904. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4905. #
  4906. # DIRECTORY: pandatool/src/bam/
  4907. #
  4908. if not PkgSkip("PANDATOOL"):
  4909. OPTS=['DIR:pandatool/src/bam']
  4910. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4911. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4912. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4913. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4914. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4915. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4916. if not PkgSkip("EGG"):
  4917. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4918. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4919. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4920. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4921. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4922. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4923. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4924. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4925. #
  4926. # DIRECTORY: pandatool/src/cvscopy/
  4927. #
  4928. if not PkgSkip("PANDATOOL"):
  4929. OPTS=['DIR:pandatool/src/cvscopy']
  4930. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  4931. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  4932. #
  4933. # DIRECTORY: pandatool/src/daeegg/
  4934. #
  4935. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4936. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4937. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4938. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4939. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4940. #
  4941. # DIRECTORY: pandatool/src/assimp
  4942. #
  4943. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  4944. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4945. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4946. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4947. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4948. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB'])
  4949. #
  4950. # DIRECTORY: pandatool/src/daeprogs/
  4951. #
  4952. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4953. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4954. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4955. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4956. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4957. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4958. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4959. #
  4960. # DIRECTORY: pandatool/src/dxf/
  4961. #
  4962. if not PkgSkip("PANDATOOL"):
  4963. OPTS=['DIR:pandatool/src/dxf']
  4964. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4965. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4966. #
  4967. # DIRECTORY: pandatool/src/dxfegg/
  4968. #
  4969. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4970. OPTS=['DIR:pandatool/src/dxfegg']
  4971. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4972. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4973. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4974. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4975. #
  4976. # DIRECTORY: pandatool/src/dxfprogs/
  4977. #
  4978. if not PkgSkip("PANDATOOL"):
  4979. OPTS=['DIR:pandatool/src/dxfprogs']
  4980. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4981. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4982. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4983. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4984. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4985. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4986. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4987. if not PkgSkip("EGG"):
  4988. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4989. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4990. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4991. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4992. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4993. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4994. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4995. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4996. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4997. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4998. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4999. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5000. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5001. #
  5002. # DIRECTORY: pandatool/src/objegg/
  5003. #
  5004. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5005. OPTS=['DIR:pandatool/src/objegg']
  5006. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5007. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5008. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5009. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5010. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5011. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5012. #
  5013. # DIRECTORY: pandatool/src/objprogs/
  5014. #
  5015. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5016. OPTS=['DIR:pandatool/src/objprogs']
  5017. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5018. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5019. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5020. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5021. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5022. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5023. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5024. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5025. #
  5026. # DIRECTORY: pandatool/src/palettizer/
  5027. #
  5028. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5029. OPTS=['DIR:pandatool/src/palettizer']
  5030. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5031. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5032. #
  5033. # DIRECTORY: pandatool/src/egg-mkfont/
  5034. #
  5035. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5036. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5037. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5038. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5039. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5040. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5041. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5042. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5043. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5044. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5045. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5046. #
  5047. # DIRECTORY: pandatool/src/eggcharbase/
  5048. #
  5049. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5050. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5051. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5052. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5053. #
  5054. # DIRECTORY: pandatool/src/egg-optchar/
  5055. #
  5056. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5057. OPTS=['DIR:pandatool/src/egg-optchar']
  5058. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5059. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5060. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5061. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5062. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5063. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5064. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5065. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5066. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5067. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5068. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5069. #
  5070. # DIRECTORY: pandatool/src/egg-palettize/
  5071. #
  5072. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5073. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5074. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5075. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5076. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5077. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5078. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5079. #
  5080. # DIRECTORY: pandatool/src/egg-qtess/
  5081. #
  5082. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5083. OPTS=['DIR:pandatool/src/egg-qtess']
  5084. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5085. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5086. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5087. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5088. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5089. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5090. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5091. #
  5092. # DIRECTORY: pandatool/src/eggprogs/
  5093. #
  5094. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5095. OPTS=['DIR:pandatool/src/eggprogs']
  5096. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5097. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5098. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5099. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5100. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5101. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5102. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5103. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5104. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5105. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5106. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5107. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5108. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5109. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5110. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5111. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5112. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5113. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5114. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5115. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5116. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5117. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5118. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5119. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5120. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5121. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5122. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5123. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5124. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5125. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5126. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5127. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5128. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5129. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5130. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5131. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5132. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5133. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5134. #
  5135. # DIRECTORY: pandatool/src/flt/
  5136. #
  5137. if not PkgSkip("PANDATOOL"):
  5138. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5139. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5140. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5141. #
  5142. # DIRECTORY: pandatool/src/fltegg/
  5143. #
  5144. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5145. OPTS=['DIR:pandatool/src/fltegg']
  5146. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5147. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5148. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5149. #
  5150. # DIRECTORY: pandatool/src/fltprogs/
  5151. #
  5152. if not PkgSkip("PANDATOOL"):
  5153. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5154. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5155. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5156. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5157. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5158. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5159. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5160. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5161. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5162. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5163. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5164. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5165. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5166. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5167. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5168. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5169. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5170. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5171. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5172. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5173. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5174. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5175. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5176. if not PkgSkip("EGG"):
  5177. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5178. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5179. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5180. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5181. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5182. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5183. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5184. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5185. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5186. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5187. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5188. #
  5189. # DIRECTORY: pandatool/src/imagebase/
  5190. #
  5191. if not PkgSkip("PANDATOOL"):
  5192. OPTS=['DIR:pandatool/src/imagebase']
  5193. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5194. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5195. #
  5196. # DIRECTORY: pandatool/src/imageprogs/
  5197. #
  5198. if not PkgSkip("PANDATOOL"):
  5199. OPTS=['DIR:pandatool/src/imageprogs']
  5200. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5201. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5202. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5203. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5204. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5205. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5206. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5207. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5208. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5209. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5210. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5211. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5212. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5213. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5214. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5215. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5216. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5217. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5218. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5219. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5220. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5221. #
  5222. # DIRECTORY: pandatool/src/pfmprogs/
  5223. #
  5224. if not PkgSkip("PANDATOOL"):
  5225. OPTS=['DIR:pandatool/src/pfmprogs']
  5226. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5227. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5228. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5229. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5230. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5231. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5232. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5233. TargetAdd('pfm-bba_config_pfm.obj', opts=OPTS, input='config_pfm.cxx')
  5234. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5235. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfm.obj')
  5236. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5237. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5238. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5239. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5240. #
  5241. # DIRECTORY: pandatool/src/lwo/
  5242. #
  5243. if not PkgSkip("PANDATOOL"):
  5244. OPTS=['DIR:pandatool/src/lwo']
  5245. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5246. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5247. #
  5248. # DIRECTORY: pandatool/src/lwoegg/
  5249. #
  5250. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5251. OPTS=['DIR:pandatool/src/lwoegg']
  5252. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5253. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5254. #
  5255. # DIRECTORY: pandatool/src/lwoprogs/
  5256. #
  5257. if not PkgSkip("PANDATOOL"):
  5258. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5259. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5260. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5261. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5262. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5263. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5264. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5265. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5266. if not PkgSkip("EGG"):
  5267. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5268. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5269. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5270. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5271. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5272. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5273. #
  5274. # DIRECTORY: pandatool/src/maya/
  5275. #
  5276. for VER in MAYAVERSIONS:
  5277. VNUM=VER[4:]
  5278. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5279. OPTS=['DIR:pandatool/src/maya', VER]
  5280. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5281. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5282. #
  5283. # DIRECTORY: pandatool/src/mayaegg/
  5284. #
  5285. for VER in MAYAVERSIONS:
  5286. VNUM=VER[4:]
  5287. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5288. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5289. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5290. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5291. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5292. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5293. #
  5294. # DIRECTORY: pandatool/src/maxegg/
  5295. #
  5296. for VER in MAXVERSIONS:
  5297. VNUM=VER[3:]
  5298. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5299. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5300. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5301. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5302. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5303. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5304. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5305. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5306. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5307. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5308. #
  5309. # DIRECTORY: pandatool/src/maxprogs/
  5310. #
  5311. for VER in MAXVERSIONS:
  5312. VNUM=VER[3:]
  5313. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5314. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5315. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5316. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5317. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5318. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5319. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5320. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5321. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5322. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5323. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5324. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5325. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5326. #
  5327. # DIRECTORY: pandatool/src/vrml/
  5328. #
  5329. if not PkgSkip("PANDATOOL"):
  5330. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5331. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5332. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5333. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5334. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5335. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5336. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5337. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5338. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5339. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5340. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5341. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5342. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5343. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5344. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5345. #
  5346. # DIRECTORY: pandatool/src/vrmlegg/
  5347. #
  5348. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5349. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5350. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5351. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5352. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5353. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5354. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5355. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5356. #
  5357. # DIRECTORY: pandatool/src/xfile/
  5358. #
  5359. if not PkgSkip("PANDATOOL"):
  5360. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5361. CreateFile(GetOutputDir()+"/include/xParser.h")
  5362. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5363. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5364. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5365. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5366. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5367. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5368. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5369. #
  5370. # DIRECTORY: pandatool/src/xfileegg/
  5371. #
  5372. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5373. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5374. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5375. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5376. #
  5377. # DIRECTORY: pandatool/src/ptloader/
  5378. #
  5379. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5380. if not PkgSkip("FCOLLADA"):
  5381. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5382. 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']
  5383. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5384. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5385. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5386. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5387. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5388. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5389. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5390. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5391. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5392. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5393. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5394. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5395. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5396. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5397. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5398. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5399. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5400. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5401. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5402. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5403. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5404. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5405. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5406. #
  5407. # DIRECTORY: pandatool/src/miscprogs/
  5408. #
  5409. # This is a bit of an esoteric tool, and it causes issues because
  5410. # it conflicts with tools of the same name in different packages.
  5411. #if (PkgSkip("PANDATOOL")==0):
  5412. # OPTS=['DIR:pandatool/src/miscprogs']
  5413. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5414. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5415. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5416. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5417. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5418. # TargetAdd('bin2c.exe', input='libp3pystub.lib')
  5419. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5420. #
  5421. # DIRECTORY: pandatool/src/pstatserver/
  5422. #
  5423. if (PkgSkip("PANDATOOL")==0):
  5424. OPTS=['DIR:pandatool/src/pstatserver']
  5425. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5426. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5427. #
  5428. # DIRECTORY: pandatool/src/softprogs/
  5429. #
  5430. if (PkgSkip("PANDATOOL")==0):
  5431. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  5432. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  5433. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  5434. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  5435. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  5436. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  5437. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  5438. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  5439. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  5440. #
  5441. # DIRECTORY: pandatool/src/text-stats/
  5442. #
  5443. if (PkgSkip("PANDATOOL")==0):
  5444. OPTS=['DIR:pandatool/src/text-stats']
  5445. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5446. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5447. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5448. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5449. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5450. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5451. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5452. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5453. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5454. #
  5455. # DIRECTORY: pandatool/src/vrmlprogs/
  5456. #
  5457. if not PkgSkip("PANDATOOL"):
  5458. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5459. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5460. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5461. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5462. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5463. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5464. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5465. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5466. if not PkgSkip("EGG"):
  5467. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5468. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5469. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5470. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5471. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5472. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5473. #
  5474. # DIRECTORY: pandatool/src/win-stats/
  5475. # DIRECTORY: pandatool/src/gtk-stats/
  5476. #
  5477. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5478. if GetTarget() == 'windows':
  5479. OPTS=['DIR:pandatool/src/win-stats']
  5480. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5481. else:
  5482. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5483. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5484. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5485. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5486. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5487. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5488. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5489. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5490. #
  5491. # DIRECTORY: pandatool/src/xfileprogs/
  5492. #
  5493. if not PkgSkip("PANDATOOL"):
  5494. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5495. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5496. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5497. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5498. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5499. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5500. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5501. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5502. if not PkgSkip("EGG"):
  5503. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5504. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5505. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5506. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5507. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5508. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5509. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5510. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5511. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5512. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5513. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5514. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5515. #
  5516. # DIRECTORY: pandatool/src/mayaprogs/
  5517. #
  5518. for VER in MAYAVERSIONS:
  5519. VNUM = VER[4:]
  5520. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5521. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5522. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5523. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5524. continue
  5525. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5526. ARCH_OPTS = ['NOARCH:PPC']
  5527. elif GetTarget() == 'darwin':
  5528. ARCH_OPTS = ['NOARCH:X86_64']
  5529. else:
  5530. ARCH_OPTS = []
  5531. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5532. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5533. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5534. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5535. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5536. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5537. #if GetTarget() == 'windows':
  5538. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5539. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5540. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5541. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5542. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5543. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5544. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5545. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5546. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5547. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5548. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5549. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5550. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5551. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5552. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5553. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5554. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5555. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5556. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5557. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5558. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5559. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5560. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5561. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5562. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5563. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5564. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5565. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5566. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5567. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5568. if GetTarget() == 'windows':
  5569. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5570. else:
  5571. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5572. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5573. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5574. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5575. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5576. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5577. if GetTarget() == 'windows':
  5578. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5579. else:
  5580. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5581. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5582. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5583. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5584. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5585. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5586. if GetTarget() == 'windows':
  5587. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5588. else:
  5589. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5590. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5591. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5592. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5593. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5594. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5595. if GetTarget() == 'windows':
  5596. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5597. else:
  5598. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5599. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5600. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5601. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5602. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5603. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5604. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5605. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5606. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5607. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5608. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5609. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5610. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5611. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5612. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5613. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5614. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5615. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5616. #
  5617. # DIRECTORY: contrib/src/ai/
  5618. #
  5619. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5620. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5621. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5622. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5623. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5624. OPTS=['DIR:contrib/src/ai', 'PYTHON']
  5625. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5626. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5627. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5628. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  5629. TargetAdd('ai_module.obj', input='libpandaai.in')
  5630. TargetAdd('ai_module.obj', opts=OPTS)
  5631. TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5632. TargetAdd('ai.pyd', input='ai_module.obj')
  5633. TargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5634. TargetAdd('ai.pyd', input='libpandaai.dll')
  5635. TargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5636. TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5637. TargetAdd('ai.pyd', opts=['PYTHON'])
  5638. #
  5639. # DIRECTORY: contrib/src/rplight/
  5640. #
  5641. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5642. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT', 'PYTHON']
  5643. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5644. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5645. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5646. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5647. TargetAdd('libp3rplight_igate.obj', input='libp3rplight.in', opts=["DEPENDENCYONLY"])
  5648. TargetAdd('rplight_module.obj', input='libp3rplight.in')
  5649. TargetAdd('rplight_module.obj', opts=OPTS)
  5650. TargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5651. TargetAdd('_rplight.pyd', input='rplight_module.obj')
  5652. TargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5653. TargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5654. TargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5655. TargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5656. TargetAdd('_rplight.pyd', opts=['PYTHON'])
  5657. #
  5658. # Generate the models directory and samples directory
  5659. #
  5660. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5661. model_extensions = ["*.egg"]
  5662. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5663. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5664. model_extensions.append("*.flt")
  5665. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5666. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5667. newname = model[:-4] + ".egg.pz"
  5668. else:
  5669. newname = model[:-4] + ".egg"
  5670. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5671. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5672. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5673. newname = model[:-4] + ".egg.pz"
  5674. else:
  5675. newname = model[:-4] + ".egg"
  5676. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5677. for model in GetDirectoryContents("models", model_extensions):
  5678. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5679. newname = model[:-4] + ".egg.pz"
  5680. else:
  5681. newname = model[:-4] + ".egg"
  5682. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5683. if not PkgSkip("DIRECT") and not RUNTIME:
  5684. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5685. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5686. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5687. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5688. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5689. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5690. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5691. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5692. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5693. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5694. #
  5695. # Build the rtdist.
  5696. #
  5697. if (RTDIST):
  5698. OPTS=['DIR:direct/src/p3d']
  5699. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5700. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5701. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5702. #
  5703. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5704. #
  5705. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5706. OPTS=['DIR:direct/src/p3d']
  5707. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5708. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5709. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5710. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5711. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5712. ##########################################################################################
  5713. #
  5714. # Dependency-Based Distributed Build System.
  5715. #
  5716. ##########################################################################################
  5717. DEPENDENCYQUEUE=[]
  5718. for target in TARGET_LIST:
  5719. name = target.name
  5720. inputs = target.inputs
  5721. opts = target.opts
  5722. deps = target.deps
  5723. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5724. def BuildWorker(taskqueue, donequeue):
  5725. while True:
  5726. try:
  5727. task = taskqueue.get(timeout=1)
  5728. except:
  5729. ProgressOutput(None, "Waiting for tasks...")
  5730. task = taskqueue.get()
  5731. sys.stdout.flush()
  5732. if (task == 0): return
  5733. try:
  5734. task[0](*task[1])
  5735. donequeue.put(task)
  5736. except:
  5737. donequeue.put(0)
  5738. def AllSourcesReady(task, pending):
  5739. sources = task[3]
  5740. for x in sources:
  5741. if (x in pending):
  5742. return 0
  5743. sources = task[1][1]
  5744. for x in sources:
  5745. if (x in pending):
  5746. return 0
  5747. altsources = task[4]
  5748. for x in altsources:
  5749. if (x in pending):
  5750. return 0
  5751. return 1
  5752. def ParallelMake(tasklist):
  5753. # Create the communication queues.
  5754. donequeue = queue.Queue()
  5755. taskqueue = queue.Queue()
  5756. # Build up a table listing all the pending targets
  5757. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5758. # task[2] = [name]
  5759. # task[3] = deps
  5760. # The python tool package, in particular fltegg seems to throw parallelmake off
  5761. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5762. # and another subpart to be built sequentially. The most time consuming part of the process
  5763. # is the c++ code generation anyways.
  5764. tasklist_seq = []
  5765. i = 0
  5766. while i < len(tasklist):
  5767. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5768. break
  5769. i += 1
  5770. if i < len(tasklist):
  5771. tasklist_seq = tasklist[i:]
  5772. tasklist = tasklist[:i]
  5773. iNumStartingTasks = len(tasklist)
  5774. pending = {}
  5775. for task in tasklist:
  5776. for target in task[2]:
  5777. pending[target] = 1
  5778. # Create the workers
  5779. for slave in range(THREADCOUNT):
  5780. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5781. th.setDaemon(1)
  5782. th.start()
  5783. # Feed tasks to the workers.
  5784. tasksqueued = 0
  5785. while True:
  5786. if (tasksqueued < THREADCOUNT):
  5787. extras = []
  5788. for task in tasklist:
  5789. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5790. if (NeedsBuild(task[2], task[3])):
  5791. tasksqueued += 1
  5792. taskqueue.put(task)
  5793. else:
  5794. for target in task[2]:
  5795. del pending[target]
  5796. else:
  5797. extras.append(task)
  5798. tasklist = extras
  5799. sys.stdout.flush()
  5800. if (tasksqueued == 0): break
  5801. donetask = donequeue.get()
  5802. if (donetask == 0):
  5803. exit("Build process aborting.")
  5804. sys.stdout.flush()
  5805. tasksqueued -= 1
  5806. JustBuilt(donetask[2], donetask[3])
  5807. for target in donetask[2]:
  5808. del pending[target]
  5809. # Kill the workers.
  5810. for slave in range(THREADCOUNT):
  5811. taskqueue.put(0)
  5812. # Make sure there aren't any unsatisfied tasks
  5813. if len(tasklist) > 0:
  5814. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5815. SequentialMake(tasklist_seq)
  5816. def SequentialMake(tasklist):
  5817. i = 0
  5818. for task in tasklist:
  5819. if (NeedsBuild(task[2], task[3])):
  5820. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5821. JustBuilt(task[2], task[3])
  5822. i += 1
  5823. def RunDependencyQueue(tasklist):
  5824. if (THREADCOUNT!=0):
  5825. ParallelMake(tasklist)
  5826. else:
  5827. SequentialMake(tasklist)
  5828. try:
  5829. RunDependencyQueue(DEPENDENCYQUEUE)
  5830. except:
  5831. SaveDependencyCache()
  5832. raise
  5833. # Run the test suite.
  5834. if RUNTESTS:
  5835. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  5836. if sys.version_info >= (2, 6):
  5837. cmdstr += " -B"
  5838. cmdstr += " -m pytest tests"
  5839. if GetVerbose():
  5840. cmdstr += " --verbose"
  5841. oscmd(cmdstr)
  5842. ##########################################################################################
  5843. #
  5844. # The Installers
  5845. #
  5846. # Under windows, we can build an 'exe' package using NSIS
  5847. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5848. # Under OSX, we can make a 'dmg' package.
  5849. #
  5850. ##########################################################################################
  5851. def MakeInstallerNSIS(file, title, installdir):
  5852. if (os.path.isfile(file)):
  5853. os.remove(file)
  5854. elif (os.path.isdir(file)):
  5855. shutil.rmtree(file)
  5856. if GetTargetArch() == 'x64':
  5857. regview = '64'
  5858. else:
  5859. regview = '32'
  5860. if (RUNTIME):
  5861. # Invoke the make_installer script.
  5862. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  5863. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  5864. cmd = sys.executable + " -B -u " + os.path.join("direct", "src", "plugin_installer", "make_installer.py")
  5865. cmd += " --version %s --regview %s" % (VERSION, regview)
  5866. if GetTargetArch() == 'x64':
  5867. cmd += " --install \"$PROGRAMFILES64\\Panda3D\" "
  5868. else:
  5869. cmd += " --install \"$PROGRAMFILES32\\Panda3D\" "
  5870. oscmd(cmd)
  5871. shutil.move(os.path.join("direct", "src", "plugin_installer", "p3d-setup.exe"), file)
  5872. return
  5873. print("Building "+title+" installer at %s" % (file))
  5874. if (COMPRESSOR != "lzma"):
  5875. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  5876. if (os.path.exists("nsis-output.exe")):
  5877. os.remove("nsis-output.exe")
  5878. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  5879. nsis_defs = {
  5880. 'COMPRESSOR' : COMPRESSOR,
  5881. 'TITLE' : title,
  5882. 'INSTALLDIR' : installdir,
  5883. 'OUTFILE' : '..\\' + file,
  5884. 'BUILT' : '..\\' + GetOutputDir(),
  5885. 'SOURCE' : '..',
  5886. 'PYVER' : SDK["PYTHONVERSION"][6:9],
  5887. 'REGVIEW' : regview,
  5888. }
  5889. if GetHost() == 'windows':
  5890. cmd = os.path.join(GetThirdpartyBase(), 'win-nsis', 'makensis') + ' /V2'
  5891. for item in nsis_defs.items():
  5892. cmd += ' /D%s="%s"' % item
  5893. else:
  5894. cmd = 'makensis -V2'
  5895. for item in nsis_defs.items():
  5896. cmd += ' -D%s="%s"' % item
  5897. cmd += ' "makepanda\installer.nsi"'
  5898. oscmd(cmd)
  5899. def MakeDebugSymbolArchive(zipname, dirname):
  5900. import zipfile
  5901. zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)
  5902. for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')):
  5903. zip.write(fn, dirname + '/bin/' + os.path.basename(fn))
  5904. for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')):
  5905. zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn))
  5906. for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')):
  5907. zip.write(fn, dirname + '/plugins/' + os.path.basename(fn))
  5908. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')):
  5909. zip.write(fn, dirname + '/python/' + os.path.basename(fn))
  5910. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')):
  5911. zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn))
  5912. zip.close()
  5913. INSTALLER_DEB_FILE="""
  5914. Package: panda3dMAJOR
  5915. Version: VERSION
  5916. Section: libdevel
  5917. Priority: optional
  5918. Architecture: ARCH
  5919. Essential: no
  5920. Depends: DEPENDS
  5921. Recommends: RECOMMENDS
  5922. Suggests: panda3d-runtime
  5923. Provides: panda3d
  5924. Conflicts: panda3d
  5925. Replaces: panda3d
  5926. Maintainer: rdb <[email protected]>
  5927. Installed-Size: INSTSIZE
  5928. Description: Panda3D free 3D engine SDK
  5929. 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.
  5930. 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.
  5931. .
  5932. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5933. """
  5934. RUNTIME_INSTALLER_DEB_FILE="""
  5935. Package: panda3d-runtime
  5936. Version: VERSION
  5937. Section: web
  5938. Priority: optional
  5939. Architecture: ARCH
  5940. Essential: no
  5941. Depends: DEPENDS
  5942. Provides: panda3d-runtime
  5943. Maintainer: rdb <[email protected]>
  5944. Installed-Size: INSTSIZE
  5945. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  5946. 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.
  5947. """
  5948. # We're not putting "python" in the "Requires" field,
  5949. # since the rpm-based distros don't have a common
  5950. # naming for the Python package.
  5951. INSTALLER_SPEC_FILE="""
  5952. Summary: The Panda3D free 3D engine SDK
  5953. Name: panda3d
  5954. Version: VERSION
  5955. Release: RPMRELEASE
  5956. License: BSD License
  5957. Group: Development/Libraries
  5958. BuildRoot: PANDASOURCE/targetroot
  5959. %description
  5960. 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.
  5961. 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.
  5962. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5963. %post
  5964. /sbin/ldconfig
  5965. %postun
  5966. /sbin/ldconfig
  5967. %files
  5968. %defattr(-,root,root)
  5969. /etc/Confauto.prc
  5970. /etc/Config.prc
  5971. /usr/share/panda3d
  5972. /usr/share/mime-info/panda3d.mime
  5973. /usr/share/mime-info/panda3d.keys
  5974. /usr/share/mime/packages/panda3d.xml
  5975. /usr/share/application-registry/panda3d.applications
  5976. /usr/share/applications/*.desktop
  5977. /etc/ld.so.conf.d/panda3d.conf
  5978. /usr/%_lib/panda3d
  5979. """ + PYTHON_SITEPACKAGES + """
  5980. /usr/include/panda3d
  5981. """
  5982. RUNTIME_INSTALLER_SPEC_FILE="""
  5983. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  5984. Name: panda3d-runtime
  5985. Version: VERSION
  5986. Release: RPMRELEASE
  5987. License: BSD License
  5988. Group: Productivity/Graphics/Other
  5989. BuildRoot: PANDASOURCE/targetroot
  5990. %description
  5991. 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.
  5992. %files
  5993. %defattr(-,root,root)
  5994. /usr/bin/panda3d
  5995. /usr/%_lib/nppanda3d.so
  5996. /usr/%_lib/mozilla/plugins/nppanda3d.so
  5997. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  5998. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  5999. /usr/share/mime-info/panda3d-runtime.mime
  6000. /usr/share/mime-info/panda3d-runtime.keys
  6001. /usr/share/mime/packages/panda3d-runtime.xml
  6002. /usr/share/application-registry/panda3d-runtime.applications
  6003. /usr/share/applications/*.desktop
  6004. """
  6005. # plist file for Mac OSX
  6006. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  6007. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  6008. <plist version="1.0">
  6009. <dict>
  6010. <key>CFBundleIdentifier</key>
  6011. <string>%(package_id)s</string>
  6012. <key>CFBundleShortVersionString</key>
  6013. <string>%(version)s</string>
  6014. <key>IFPkgFlagRelocatable</key>
  6015. <false/>
  6016. <key>IFPkgFlagAuthorizationAction</key>
  6017. <string>RootAuthorization</string>
  6018. <key>IFPkgFlagAllowBackRev</key>
  6019. <true/>
  6020. </dict>
  6021. </plist>
  6022. """
  6023. # FreeBSD pkg-descr
  6024. INSTALLER_PKG_DESCR_FILE = """
  6025. 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.
  6026. 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.
  6027. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  6028. WWW: https://www.panda3d.org/
  6029. """
  6030. # FreeBSD pkg-descr
  6031. RUNTIME_INSTALLER_PKG_DESCR_FILE = """
  6032. Runtime binary and browser plugin for the Panda3D Game Engine
  6033. 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.
  6034. WWW: https://www.panda3d.org/
  6035. """
  6036. # FreeBSD PKG Manifest template file
  6037. INSTALLER_PKG_MANIFEST_FILE = """
  6038. name: NAME
  6039. version: VERSION
  6040. arch: ARCH
  6041. origin: ORIGIN
  6042. comment: "Panda3D free 3D engine SDK"
  6043. www: https://www.panda3d.org
  6044. maintainer: rdb <[email protected]>
  6045. prefix: /usr/local
  6046. flatsize: INSTSIZEMB
  6047. deps: {DEPENDS}
  6048. """
  6049. def MakeInstallerLinux():
  6050. if not RUNTIME and not PkgSkip("PYTHON"):
  6051. PYTHONV = SDK["PYTHONVERSION"].rstrip('dmu')
  6052. else:
  6053. PYTHONV = "python"
  6054. PV = PYTHONV.replace("python", "")
  6055. # Clean and set up a directory to install Panda3D into
  6056. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  6057. oscmd("mkdir --mode=0755 targetroot")
  6058. dpkg_present = False
  6059. if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"):
  6060. dpkg_present = True
  6061. rpmbuild_present = False
  6062. if os.path.exists("/usr/bin/rpmbuild"):
  6063. rpmbuild_present = True
  6064. if dpkg_present and rpmbuild_present:
  6065. print("Warning: both dpkg and rpmbuild present.")
  6066. if dpkg_present:
  6067. # Invoke installpanda.py to install it into a temporary dir
  6068. lib_dir = GetDebLibDir()
  6069. if RUNTIME:
  6070. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6071. else:
  6072. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6073. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6074. oscmd("mkdir -m 0755 -p targetroot/usr/share/man/man1")
  6075. oscmd("install -m 0644 doc/man/*.1 targetroot/usr/share/man/man1/")
  6076. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  6077. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6078. if (RUNTIME):
  6079. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  6080. else:
  6081. txt = INSTALLER_DEB_FILE[1:]
  6082. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  6083. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  6084. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  6085. oscmd("cd targetroot && (find usr -type f -exec md5sum {} ;) > DEBIAN/md5sums")
  6086. if (not RUNTIME):
  6087. oscmd("cd targetroot && (find etc -type f -exec md5sum {} ;) >> DEBIAN/md5sums")
  6088. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  6089. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  6090. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  6091. # Determine the package name and the locations that
  6092. # dpkg-shlibdeps should look in for executables.
  6093. pkg_version = DEBVERSION
  6094. if RUNTIME:
  6095. pkg_name = "panda3d-runtime"
  6096. lib_pattern = "debian/%s/usr/%s/*.so" % (pkg_name, lib_dir)
  6097. else:
  6098. pkg_name = "panda3d" + MAJOR_VERSION
  6099. lib_pattern = "debian/%s/usr/%s/panda3d/*.so*" % (pkg_name, lib_dir)
  6100. bin_pattern = "debian/%s/usr/bin/*" % (pkg_name)
  6101. # dpkg-shlibdeps looks in the debian/{pkg_name}/DEBIAN/shlibs directory
  6102. # and also expects a debian/control file, so we create this dummy set-up.
  6103. oscmd("mkdir targetroot/debian")
  6104. oscmd("ln -s .. targetroot/debian/" + pkg_name)
  6105. WriteFile("targetroot/debian/control", "")
  6106. dpkg_shlibdeps = "dpkg-shlibdeps"
  6107. if GetVerbose():
  6108. dpkg_shlibdeps += " -v"
  6109. if RUNTIME:
  6110. # The runtime doesn't export any useful symbols, so just query the dependencies.
  6111. oscmd("cd targetroot && %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals())
  6112. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  6113. recommends = ""
  6114. else:
  6115. pkg_name = "panda3d" + MAJOR_VERSION
  6116. pkg_dir = "debian/panda3d" + MAJOR_VERSION
  6117. # Generate a symbols file so that other packages can know which symbols we export.
  6118. oscmd("cd targetroot && dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals())
  6119. # Library dependencies are required, binary dependencies are recommended.
  6120. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX.
  6121. 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())
  6122. 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())
  6123. # Parse the substvars files generated by dpkg-shlibdeps.
  6124. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  6125. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  6126. if PkgSkip("PYTHON")==0:
  6127. depends += ", " + PYTHONV
  6128. recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")"
  6129. if PkgSkip("NVIDIACG")==0:
  6130. depends += ", nvidia-cg-toolkit"
  6131. # Write back the dependencies, and delete the dummy set-up.
  6132. txt = txt.replace("DEPENDS", depends.strip(', '))
  6133. txt = txt.replace("RECOMMENDS", recommends.strip(', '))
  6134. WriteFile("targetroot/DEBIAN/control", txt)
  6135. oscmd("rm -rf targetroot/debian")
  6136. # Package it all up into a .deb file.
  6137. oscmd("chmod -R 755 targetroot/DEBIAN")
  6138. oscmd("chmod 644 targetroot/DEBIAN/control targetroot/DEBIAN/md5sums")
  6139. if not RUNTIME:
  6140. oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols")
  6141. oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch))
  6142. elif rpmbuild_present:
  6143. # Invoke installpanda.py to install it into a temporary dir
  6144. if RUNTIME:
  6145. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6146. else:
  6147. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6148. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6149. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  6150. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6151. pandasource = os.path.abspath(os.getcwd())
  6152. if RUNTIME:
  6153. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  6154. else:
  6155. txt = INSTALLER_SPEC_FILE[1:]
  6156. # Add the binaries in /usr/bin explicitly to the spec file
  6157. for base in os.listdir(GetOutputDir() + "/bin"):
  6158. txt += "/usr/bin/%s\n" % (base)
  6159. # Write out the spec file.
  6160. txt = txt.replace("VERSION", VERSION)
  6161. txt = txt.replace("RPMRELEASE", RPMRELEASE)
  6162. txt = txt.replace("PANDASOURCE", pandasource)
  6163. txt = txt.replace("PV", PV)
  6164. WriteFile("panda3d.spec", txt)
  6165. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  6166. if (RUNTIME):
  6167. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6168. else:
  6169. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6170. oscmd("rm -rf "+ARCH, True)
  6171. else:
  6172. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  6173. def MakeInstallerOSX():
  6174. if (RUNTIME):
  6175. # Invoke the make_installer script.
  6176. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  6177. cmdstr = sys.executable + " "
  6178. if sys.version_info >= (2, 6):
  6179. cmdstr += "-B "
  6180. cmdstr += "direct/src/plugin_installer/make_installer.py --version %s" % VERSION
  6181. oscmd(cmdstr)
  6182. return
  6183. dmg_name = "Panda3D-" + VERSION
  6184. if not SDK["PYTHONVERSION"].startswith("python2."):
  6185. dmg_name += '-py' + SDK["PYTHONVERSION"][6:9]
  6186. dmg_name += ".dmg"
  6187. import compileall
  6188. if (os.path.isfile(dmg_name)): oscmd("rm -f %s" % dmg_name)
  6189. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  6190. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  6191. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  6192. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  6193. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  6194. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  6195. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  6196. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  6197. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  6198. oscmd("cp -R %s/Frameworks dstroot/base/Developer/Panda3D/Frameworks" % GetOutputDir())
  6199. if os.path.isdir(GetOutputDir()+"/plugins"):
  6200. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  6201. # Libraries that shouldn't be in base, but are instead in other modules.
  6202. no_base_libs = ['libp3ffmpeg', 'libp3fmod_audio', 'libfmodex', 'libfmodexL']
  6203. for base in os.listdir(GetOutputDir()+"/lib"):
  6204. if not base.endswith(".a") and base.split('.')[0] not in no_base_libs:
  6205. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  6206. # We really need to specify -R in order not to follow symlinks
  6207. # On OSX, just specifying -P is not enough to do that.
  6208. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  6209. oscmd("mkdir -p dstroot/tools/Developer/Panda3D/bin")
  6210. oscmd("mkdir -p dstroot/tools/Developer/Tools")
  6211. oscmd("ln -s ../Panda3D/bin dstroot/tools/Developer/Tools/Panda3D")
  6212. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  6213. # Trailing newline is important, works around a bug in OSX
  6214. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Panda3D/bin\n")
  6215. oscmd("mkdir -m 0755 -p dstroot/tools/usr/local/share/man/man1")
  6216. oscmd("install -m 0644 doc/man/*.1 dstroot/tools/usr/local/share/man/man1/")
  6217. for base in os.listdir(GetOutputDir()+"/bin"):
  6218. binname = "dstroot/tools/Developer/Panda3D/bin/" + base
  6219. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  6220. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  6221. if PkgSkip("PYTHON")==0:
  6222. PV = SDK["PYTHONVERSION"][6:9]
  6223. oscmd("mkdir -p dstroot/pythoncode/usr/local/bin")
  6224. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/panda3d")
  6225. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  6226. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D")
  6227. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/pandac" % GetOutputDir())
  6228. oscmd("cp -R %s/direct dstroot/pythoncode/Developer/Panda3D/direct" % GetOutputDir())
  6229. oscmd("ln -s %s dstroot/pythoncode/usr/local/bin/ppython" % SDK["PYTHONEXEC"])
  6230. oscmd("cp -R %s/*.so dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6231. oscmd("cp -R %s/*.py dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6232. if os.path.isdir(GetOutputDir()+"/Pmw"):
  6233. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/Pmw" % GetOutputDir())
  6234. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/Pmw")
  6235. WriteFile("dstroot/pythoncode/Developer/Panda3D/direct/__init__.py", "")
  6236. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/direct"):
  6237. if ((base != "extensions") and (base != "extensions_native")):
  6238. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/direct/"+base)
  6239. for base in os.listdir(GetOutputDir()+"/panda3d"):
  6240. if base.endswith('.py') or base.endswith('.so'):
  6241. libname = "dstroot/pythoncode/Developer/Panda3D/panda3d/" + base
  6242. # We really need to specify -R in order not to follow symlinks
  6243. # On OSX, just specifying -P is not enough to do that.
  6244. oscmd("cp -R -P " + GetOutputDir() + "/panda3d/" + base + " " + libname)
  6245. if not PkgSkip("FFMPEG"):
  6246. oscmd("mkdir -p dstroot/ffmpeg/Developer/Panda3D/lib")
  6247. oscmd("cp -R %s/lib/libp3ffmpeg.* dstroot/ffmpeg/Developer/Panda3D/lib/" % GetOutputDir())
  6248. #if not PkgSkip("OPENAL"):
  6249. # oscmd("mkdir -p dstroot/openal/Developer/Panda3D/lib")
  6250. # oscmd("cp -R %s/lib/libp3openal_audio.* dstroot/openal/Developer/Panda3D/lib/" % GetOutputDir())
  6251. if not PkgSkip("FMODEX"):
  6252. oscmd("mkdir -p dstroot/fmodex/Developer/Panda3D/lib")
  6253. oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6254. oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6255. oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib")
  6256. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  6257. if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"):
  6258. oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir())
  6259. if os.path.isdir("samples"):
  6260. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  6261. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  6262. oscmd("chmod -R 0775 dstroot/*")
  6263. DeleteVCS("dstroot")
  6264. DeleteBuildFiles("dstroot")
  6265. # We need to be root to perform a chown. Bleh.
  6266. # Fortunately PackageMaker does it for us, on 10.5 and above.
  6267. #oscmd("chown -R root:admin dstroot/*", True)
  6268. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  6269. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  6270. pkgs = ["base", "tools", "headers"]
  6271. if not PkgSkip("PYTHON"): pkgs.append("pythoncode")
  6272. if not PkgSkip("FFMPEG"): pkgs.append("ffmpeg")
  6273. #if not PkgSkip("OPENAL"): pkgs.append("openal")
  6274. if not PkgSkip("FMODEX"): pkgs.append("fmodex")
  6275. if os.path.isdir("samples"): pkgs.append("samples")
  6276. for pkg in pkgs:
  6277. identifier = "org.panda3d.panda3d.%s.pkg" % pkg
  6278. plist = open("/tmp/Info_plist", "w")
  6279. plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION })
  6280. plist.close()
  6281. if not os.path.isdir("dstroot/" + pkg):
  6282. os.makedirs("dstroot/" + pkg)
  6283. if OSXTARGET and OSXTARGET <= (10, 5):
  6284. target = '--target %d.%d' % (OSXTARGET)
  6285. else:
  6286. target = ''
  6287. if os.path.exists("/usr/bin/pkgbuild"):
  6288. # This new package builder is used in Lion and above.
  6289. cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg'
  6290. # In older versions, we use PackageMaker. Apple keeps changing its location.
  6291. elif os.path.exists("/Developer/usr/bin/packagemaker"):
  6292. 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'
  6293. elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6294. 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'
  6295. elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6296. 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'
  6297. elif os.path.exists("/Developer/Tools/packagemaker"):
  6298. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  6299. elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6300. 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'
  6301. else:
  6302. exit("Neither pkgbuild nor PackageMaker could be found!")
  6303. oscmd(cmd)
  6304. if os.path.isfile("/tmp/Info_plist"):
  6305. oscmd("rm -f /tmp/Info_plist")
  6306. # Now that we've built all of the individual packages, build the metapackage.
  6307. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  6308. dist.write('<?xml version="1.0" encoding="utf-8"?>\n')
  6309. dist.write('<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">\n')
  6310. dist.write(' <title>Panda3D SDK %s</title>\n' % (VERSION))
  6311. dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>\n')
  6312. dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
  6313. dist.write(' <choices-outline>\n')
  6314. for pkg in pkgs:
  6315. dist.write(' <line choice="%s"/>\n' % (pkg))
  6316. dist.write(' </choices-outline>\n')
  6317. 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')
  6318. dist.write(' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>\n')
  6319. dist.write(' </choice>\n')
  6320. 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')
  6321. dist.write(' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>\n')
  6322. dist.write(' </choice>\n')
  6323. if not PkgSkip("PYTHON"):
  6324. 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')
  6325. dist.write(' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>\n')
  6326. dist.write(' </choice>\n')
  6327. if not PkgSkip("FFMPEG"):
  6328. 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.')
  6329. if PkgSkip("VORBIS") and PkgSkip("OPUS"):
  6330. dist.write(' It is not required for loading .wav files, which Panda3D can read out of the box.">\n')
  6331. elif PkgSkip("VORBIS"):
  6332. dist.write(' It is not required for loading .wav or .opus files, which Panda3D can read out of the box.">\n')
  6333. elif PkgSkip("OPUS"):
  6334. dist.write(' It is not required for loading .wav or .ogg files, which Panda3D can read out of the box.">\n')
  6335. else:
  6336. dist.write(' It is not required for loading .wav, .ogg or .opus files, which Panda3D can read out of the box.">\n')
  6337. dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
  6338. dist.write(' </choice>\n')
  6339. #if not PkgSkip("OPENAL"):
  6340. # 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')
  6341. # dist.write(' <pkg-ref id="org.panda3d.panda3d.openal.pkg"/>\n')
  6342. # dist.write(' </choice>\n')
  6343. if not PkgSkip("FMODEX"):
  6344. 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')
  6345. dist.write(' <pkg-ref id="org.panda3d.panda3d.fmodex.pkg"/>\n')
  6346. dist.write(' </choice>\n')
  6347. if os.path.isdir("samples"):
  6348. 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')
  6349. dist.write(' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>\n')
  6350. dist.write(' </choice>\n')
  6351. 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')
  6352. dist.write(' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>\n')
  6353. dist.write(' </choice>\n')
  6354. for pkg in pkgs:
  6355. size = GetDirectorySize("dstroot/" + pkg) // 1024
  6356. 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))
  6357. dist.write('</installer-script>\n')
  6358. dist.close()
  6359. oscmd('hdiutil create Panda3D-rw.dmg -volname "Panda3D SDK %s" -srcfolder dstroot/Panda3D' % (VERSION))
  6360. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o %s' % (dmg_name))
  6361. oscmd('rm -f Panda3D-rw.dmg')
  6362. def MakeInstallerFreeBSD():
  6363. oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
  6364. oscmd("mkdir targetroot")
  6365. # Invoke installpanda.py to install it into a temporary dir
  6366. if RUNTIME:
  6367. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6368. else:
  6369. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6370. if not os.path.exists("/usr/sbin/pkg"):
  6371. exit("Cannot create an installer without pkg")
  6372. plist_txt = ''
  6373. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  6374. for f in files:
  6375. plist_txt += os.path.join(root, f)[21:] + "\n"
  6376. if not RUNTIME:
  6377. plist_txt += "@postexec /sbin/ldconfig -m /usr/local/lib/panda3d\n"
  6378. plist_txt += "@postunexec /sbin/ldconfig -R\n"
  6379. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  6380. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  6381. for d in dirs:
  6382. plist_txt += "@dir %s\n" % os.path.join(root, d)[21:]
  6383. plist_txt += "@dir %s\n" % remdir
  6384. oscmd("echo \"`pkg config abi | tr '[:upper:]' '[:lower:]' | cut -d: -f1,2`:*\" > " + GetOutputDir() + "/tmp/architecture.txt")
  6385. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6386. dependencies = ''
  6387. if PkgSkip("PYTHON") == 0:
  6388. # If this version of Python was installed from a package or ports, let's mark it as dependency.
  6389. oscmd("rm -f %s/tmp/python_dep" % GetOutputDir())
  6390. 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)
  6391. if os.path.isfile(GetOutputDir() + "/tmp/python_dep"):
  6392. python_pkg = ReadFile(GetOutputDir() + "/tmp/python_dep")
  6393. if python_pkg:
  6394. dependencies += python_pkg
  6395. manifest_txt = INSTALLER_PKG_MANIFEST_FILE[1:].replace("NAME", 'panda3d' if not RUNTIME else 'panda3d-runtime')
  6396. manifest_txt = manifest_txt.replace("VERSION", VERSION)
  6397. manifest_txt = manifest_txt.replace("ARCH", pkg_arch)
  6398. manifest_txt = manifest_txt.replace("ORIGIN", 'devel/panda3d' if not RUNTIME else 'graphics/panda3d-runtime')
  6399. manifest_txt = manifest_txt.replace("DEPENDS", dependencies)
  6400. manifest_txt = manifest_txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024 / 1024))
  6401. WriteFile("pkg-plist", plist_txt)
  6402. WriteFile("+DESC", INSTALLER_PKG_DESCR_FILE[1:] if not RUNTIME else RUNTIME_INSTALLER_PKG_DESCR_FILE[1:])
  6403. WriteFile("+MANIFEST", manifest_txt)
  6404. oscmd("pkg create -p pkg-plist -r %s -m . -o . %s" % (os.path.abspath("targetroot"), "--verbose" if GetVerbose() else "--quiet"))
  6405. try:
  6406. if INSTALLER:
  6407. ProgressOutput(100.0, "Building installer")
  6408. target = GetTarget()
  6409. if target == 'windows':
  6410. fn = "Panda3D-"
  6411. dir = "Panda3D-" + VERSION
  6412. if RUNTIME:
  6413. fn += "Runtime-"
  6414. title = "Panda3D " + VERSION
  6415. else:
  6416. title = "Panda3D SDK " + VERSION
  6417. fn += VERSION
  6418. if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7":
  6419. fn += '-py' + SDK["PYTHONVERSION"][6:]
  6420. if GetOptimize() <= 2:
  6421. fn += "-dbg"
  6422. if GetTargetArch() == 'x64':
  6423. fn += '-x64'
  6424. dir += '-x64'
  6425. MakeInstallerNSIS(fn + '.exe', title, 'C:\\' + dir)
  6426. if not RUNTIME:
  6427. MakeDebugSymbolArchive(fn + '-pdb.zip', dir)
  6428. elif (target == 'linux'):
  6429. MakeInstallerLinux()
  6430. elif (target == 'darwin'):
  6431. MakeInstallerOSX()
  6432. elif (target == 'freebsd'):
  6433. MakeInstallerFreeBSD()
  6434. else:
  6435. exit("Do not know how to make an installer for this platform")
  6436. if WHEEL:
  6437. ProgressOutput(100.0, "Building wheel")
  6438. from makewheel import makewheel
  6439. makewheel(WHLVERSION, GetOutputDir())
  6440. finally:
  6441. SaveDependencyCache()
  6442. ##########################################################################################
  6443. #
  6444. # Print final status report.
  6445. #
  6446. ##########################################################################################
  6447. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6448. printStatus("Makepanda Final Status Report", WARNINGS)
  6449. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())