makepanda.py 330 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403
  1. #!/usr/bin/env python
  2. ########################################################################
  3. #
  4. # To build panda using this script, type 'makepanda.py' on unix
  5. # or 'makepanda.bat' on windows, and examine the help-text.
  6. # Then run the script again with the appropriate options to compile
  7. # panda3d.
  8. #
  9. ########################################################################
  10. try:
  11. import sys, os, platform, time, stat, re, getopt, threading, signal, shutil
  12. if sys.platform == "darwin" or sys.version_info >= (2, 6):
  13. import plistlib
  14. if sys.version_info >= (3, 0):
  15. import queue
  16. else:
  17. import Queue as queue
  18. except:
  19. print("You are either using an incomplete or an old version of Python!")
  20. print("Please install the development package of Python 2.x and try again.")
  21. exit(1)
  22. from makepandacore import *
  23. from installpanda import *
  24. import time
  25. import os
  26. import sys
  27. ########################################################################
  28. ##
  29. ## PARSING THE COMMAND LINE OPTIONS
  30. ##
  31. ## You might be tempted to change the defaults by editing them
  32. ## here. Don't do it. Instead, create a script that compiles
  33. ## panda with your preferred options. Or, create
  34. ## a 'makepandaPreferences' file and put it into your python path.
  35. ##
  36. ########################################################################
  37. COMPILER=0
  38. INSTALLER=0
  39. WHEEL=0
  40. GENMAN=0
  41. COMPRESSOR="zlib"
  42. THREADCOUNT=0
  43. CFLAGS=""
  44. CXXFLAGS=""
  45. LDFLAGS=""
  46. RTDIST=0
  47. RTDIST_VERSION=None
  48. RUNTIME=0
  49. DISTRIBUTOR=""
  50. VERSION=None
  51. DEBVERSION=None
  52. WHLVERSION=None
  53. RPMRELEASE="1"
  54. GIT_COMMIT=None
  55. P3DSUFFIX=None
  56. MAJOR_VERSION=None
  57. COREAPI_VERSION=None
  58. PLUGIN_VERSION=None
  59. OSXTARGET=None
  60. OSX_ARCHS=[]
  61. HOST_URL=None
  62. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  63. STRDXSDKVERSION = 'default'
  64. WINDOWS_SDK = None
  65. MSVC_VERSION = None
  66. BOOUSEINTELCOMPILER = False
  67. OPENCV_VER_23 = False
  68. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  69. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  70. PkgListSet(["PYTHON", "DIRECT", # Python support
  71. "GL", "VULKAN"] + DXVERSIONS + ["TINYDISPLAY", # 3D graphics
  72. "EGL", "GLES", "GLES2", # OpenGL (ES) integration
  73. "NVIDIACG", # Shaders
  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(" --installer (build an installer)")
  120. print(" --wheel (build a pip-installable .whl)")
  121. print(" --optimize X (optimization level can be 1,2,3,4)")
  122. print(" --version X (set the panda version number)")
  123. print(" --lzma (use lzma compression when building Windows installer)")
  124. print(" --distributor X (short string identifying the distributor of the build)")
  125. print(" --outputdir X (use the specified directory instead of 'built')")
  126. print(" --host URL (set the host url (runtime build only))")
  127. print(" --threads N (use the multithreaded build system. see manual)")
  128. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  129. print(" --universal (build universal binaries (OS X only))")
  130. print(" --override \"O=V\" (override dtool_config/prc option value)")
  131. print(" --static (builds libraries for static linking)")
  132. print(" --target X (experimental cross-compilation (android only))")
  133. print(" --arch X (target architecture for cross-compilation)")
  134. print("")
  135. for pkg in PkgListGet():
  136. p = pkg.lower()
  137. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  138. if sys.platform != 'win32':
  139. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  140. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  141. print("")
  142. print(" --nothing (disable every third-party lib)")
  143. print(" --everything (enable every third-party lib)")
  144. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  145. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  146. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14. Default is 10)")
  147. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  148. print("")
  149. print("The simplest way to compile panda is to just type:")
  150. print("")
  151. print(" makepanda --everything")
  152. print("")
  153. os._exit(1)
  154. def parseopts(args):
  155. global INSTALLER,WHEEL,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  156. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  157. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  158. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  159. longopts = [
  160. "help","distributor=","verbose","runtime","osxtarget=",
  161. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  162. "version=","lzma","no-python","threads=","outputdir=","override=",
  163. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  164. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  165. "universal", "target=", "arch=", "git-commit=", "no-directscripts",
  166. "use-touchinput", "no-touchinput"]
  167. anything = 0
  168. optimize = ""
  169. target = None
  170. target_arch = None
  171. universal = False
  172. clean_build = False
  173. for pkg in PkgListGet():
  174. longopts.append("use-" + pkg.lower())
  175. longopts.append("no-" + pkg.lower())
  176. longopts.append(pkg.lower() + "-incdir=")
  177. longopts.append(pkg.lower() + "-libdir=")
  178. try:
  179. opts, extras = getopt.getopt(args, "", longopts)
  180. for option, value in opts:
  181. if (option=="--help"): raise Exception
  182. elif (option=="--optimize"): optimize=value
  183. elif (option=="--installer"): INSTALLER=1
  184. elif (option=="--wheel"): WHEEL=1
  185. elif (option=="--verbose"): SetVerbose(True)
  186. elif (option=="--distributor"): DISTRIBUTOR=value
  187. elif (option=="--rtdist"): RTDIST=1
  188. elif (option=="--runtime"): RUNTIME=1
  189. elif (option=="--genman"): GENMAN=1
  190. elif (option=="--everything"): PkgEnableAll()
  191. elif (option=="--nothing"): PkgDisableAll()
  192. elif (option=="--threads"): THREADCOUNT=int(value)
  193. elif (option=="--outputdir"): SetOutputDir(value.strip())
  194. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  195. elif (option=="--universal"): universal = True
  196. elif (option=="--target"): target = value.strip()
  197. elif (option=="--arch"): target_arch = value.strip()
  198. elif (option=="--nocolor"): DisableColors()
  199. elif (option=="--version"):
  200. match = re.match(r'^\d+\.\d+\.\d+', value)
  201. if not match:
  202. usage("version requires three digits")
  203. WHLVERSION = value
  204. VERSION = match.group()
  205. elif (option=="--lzma"): COMPRESSOR="lzma"
  206. elif (option=="--override"): AddOverride(value.strip())
  207. elif (option=="--static"): SetLinkAllStatic(True)
  208. elif (option=="--host"): HOST_URL=value
  209. elif (option=="--debversion"): DEBVERSION=value
  210. elif (option=="--rpmrelease"): RPMRELEASE=value
  211. elif (option=="--git-commit"): GIT_COMMIT=value
  212. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  213. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  214. # Backward compatibility, OPENGL was renamed to GL
  215. elif (option=="--use-opengl"): PkgEnable("GL")
  216. elif (option=="--no-opengl"): PkgDisable("GL")
  217. elif (option=="--no-directscripts"): pass
  218. elif (option=="--directx-sdk"):
  219. STRDXSDKVERSION = value.strip().lower()
  220. if STRDXSDKVERSION == '':
  221. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  222. STRDXSDKVERSION = 'default'
  223. elif (option=="--windows-sdk"):
  224. WINDOWS_SDK = value.strip().lower()
  225. elif (option=="--msvc-version"):
  226. MSVC_VERSION = value.strip().lower()
  227. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  228. elif (option=="--clean"): clean_build = True
  229. else:
  230. for pkg in PkgListGet():
  231. if option == "--use-" + pkg.lower():
  232. PkgEnable(pkg)
  233. break
  234. elif option == "--no-" + pkg.lower():
  235. PkgDisable(pkg)
  236. break
  237. elif option == "--" + pkg.lower() + "-incdir":
  238. PkgSetCustomLocation(pkg)
  239. IncDirectory(pkg, value)
  240. break
  241. elif option == "--" + pkg.lower() + "-libdir":
  242. PkgSetCustomLocation(pkg)
  243. LibDirectory(pkg, value)
  244. break
  245. if (option == "--everything" or option.startswith("--use-")
  246. or option == "--nothing" or option.startswith("--no-")):
  247. anything = 1
  248. except:
  249. usage(sys.exc_info()[1])
  250. if not anything:
  251. if RUNTIME:
  252. PkgEnableAll()
  253. else:
  254. usage("You should specify a list of packages to use or --everything to enable all packages.")
  255. if (RTDIST and RUNTIME):
  256. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  257. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  258. elif (optimize==""): optimize = "3"
  259. if OSXTARGET:
  260. try:
  261. maj, min = OSXTARGET.strip().split('.')
  262. OSXTARGET = int(maj), int(min)
  263. assert OSXTARGET[0] == 10
  264. except:
  265. usage("Invalid setting for OSXTARGET")
  266. else:
  267. OSXTARGET = None
  268. if target is not None or target_arch is not None:
  269. SetTarget(target, target_arch)
  270. if universal:
  271. if target_arch:
  272. exit("--universal is incompatible with --arch")
  273. OSX_ARCHS.append("i386")
  274. if OSXTARGET:
  275. osxver = OSXTARGET
  276. else:
  277. maj, min = platform.mac_ver()[0].split('.')[:2]
  278. osxver = int(maj), int(min)
  279. if osxver[1] < 6:
  280. OSX_ARCHS.append("ppc")
  281. else:
  282. OSX_ARCHS.append("x86_64")
  283. elif HasTargetArch():
  284. OSX_ARCHS.append(GetTargetArch())
  285. try:
  286. SetOptimize(int(optimize))
  287. assert GetOptimize() in [1, 2, 3, 4]
  288. except:
  289. usage("Invalid setting for OPTIMIZE")
  290. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  291. usage("Invalid SHA-1 hash given for --git-commit option!")
  292. if GetTarget() == 'windows':
  293. if not MSVC_VERSION:
  294. print("No MSVC version specified. Defaulting to 10 (Visual Studio 2010).")
  295. MSVC_VERSION = 10
  296. try:
  297. MSVC_VERSION = int(MSVC_VERSION)
  298. except:
  299. usage("Invalid setting for --msvc-version")
  300. if not WINDOWS_SDK:
  301. print("No Windows SDK version specified. Defaulting to '7.1'.")
  302. WINDOWS_SDK = '7.1'
  303. if clean_build and os.path.isdir(GetOutputDir()):
  304. print("Deleting %s" % (GetOutputDir()))
  305. shutil.rmtree(GetOutputDir())
  306. parseopts(sys.argv[1:])
  307. ########################################################################
  308. ##
  309. ## Handle environment variables.
  310. ##
  311. ########################################################################
  312. if ("CFLAGS" in os.environ):
  313. CFLAGS = os.environ["CFLAGS"].strip()
  314. if ("CXXFLAGS" in os.environ):
  315. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  316. if ("RPM_OPT_FLAGS" in os.environ):
  317. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  318. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  319. if ("LDFLAGS" in os.environ):
  320. LDFLAGS = os.environ["LDFLAGS"].strip()
  321. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  322. if GetHost() == "darwin" and OSXTARGET is not None:
  323. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  324. ########################################################################
  325. ##
  326. ## Configure things based on the command-line parameters.
  327. ##
  328. ########################################################################
  329. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  330. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  331. if VERSION is None:
  332. if RUNTIME:
  333. VERSION = PLUGIN_VERSION
  334. else:
  335. VERSION = ParsePandaVersion("dtool/PandaVersion.pp")
  336. if WHLVERSION is None:
  337. WHLVERSION = VERSION
  338. print("Version: %s" % VERSION)
  339. if RUNTIME or RTDIST:
  340. print("Core API Version: %s" % COREAPI_VERSION)
  341. if DEBVERSION is None:
  342. DEBVERSION = VERSION
  343. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  344. if P3DSUFFIX is None:
  345. P3DSUFFIX = MAJOR_VERSION
  346. outputdir_suffix = ""
  347. if (RUNTIME or RTDIST):
  348. # Compiling Maya/Max is pointless in rtdist build
  349. for ver in MAYAVERSIONS + MAXVERSIONS:
  350. PkgDisable(ver)
  351. if (DISTRIBUTOR.strip() == ""):
  352. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  353. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  354. if (RUNTIME):
  355. outputdir_suffix += "_rt"
  356. if DISTRIBUTOR == "":
  357. DISTRIBUTOR = "makepanda"
  358. elif not RTDIST_VERSION:
  359. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  360. if not RTDIST_VERSION:
  361. RTDIST_VERSION = "dev"
  362. if not IsCustomOutputDir():
  363. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  364. outputdir_suffix += '_x64'
  365. SetOutputDir("built" + outputdir_suffix)
  366. if (RUNTIME):
  367. for pkg in PkgListGet():
  368. if pkg in ["GTK2", "MFC"]:
  369. # Optional package(s) for runtime.
  370. pass
  371. elif pkg in ["OPENSSL", "ZLIB"]:
  372. # Required packages for runtime.
  373. if (PkgSkip(pkg)==1):
  374. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  375. else:
  376. # Unused packages for runtime.
  377. PkgDisable(pkg)
  378. if (INSTALLER and RTDIST):
  379. exit("Cannot build an installer for the rtdist build!")
  380. if (WHEEL and RUNTIME):
  381. exit("Cannot build a wheel for the runtime build!")
  382. if (WHEEL and RTDIST):
  383. exit("Cannot build a wheel for the rtdist build!")
  384. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  385. exit("Cannot build installer on Windows without python")
  386. if WHEEL and PkgSkip("PYTHON"):
  387. exit("Cannot build wheel without Python")
  388. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  389. exit("Cannot build rtdist without wx or fltk")
  390. if (RUNTIME):
  391. SetLinkAllStatic(True)
  392. if not os.path.isdir("contrib"):
  393. PkgDisable("CONTRIB")
  394. ########################################################################
  395. ##
  396. ## Load the dependency cache.
  397. ##
  398. ########################################################################
  399. LoadDependencyCache()
  400. ########################################################################
  401. ##
  402. ## Locate various SDKs.
  403. ##
  404. ########################################################################
  405. MakeBuildTree()
  406. SdkLocateDirectX(STRDXSDKVERSION)
  407. SdkLocateMaya()
  408. SdkLocateMax()
  409. SdkLocateMacOSX(OSXTARGET)
  410. SdkLocatePython(RTDIST)
  411. SdkLocateWindows(WINDOWS_SDK)
  412. SdkLocatePhysX()
  413. SdkLocateSpeedTree()
  414. SdkLocateAndroid()
  415. SdkLocateVulkan()
  416. SdkAutoDisableDirectX()
  417. SdkAutoDisableMaya()
  418. SdkAutoDisableMax()
  419. SdkAutoDisablePhysX()
  420. SdkAutoDisableSpeedTree()
  421. if RTDIST and DISTRIBUTOR == "cmu":
  422. # Some validation checks for the CMU builds.
  423. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  424. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  425. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  426. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  427. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  428. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  429. if RTDIST and not HOST_URL:
  430. exit("You must specify a host URL when building the rtdist!")
  431. if RUNTIME and not HOST_URL:
  432. # Set this to a nice default.
  433. HOST_URL = "https://runtime.panda3d.org/"
  434. ########################################################################
  435. ##
  436. ## Choose a Compiler.
  437. ##
  438. ## This should also set up any environment variables needed to make
  439. ## the compiler work.
  440. ##
  441. ########################################################################
  442. if GetHost() == 'windows' and GetTarget() == 'windows':
  443. COMPILER = "MSVC"
  444. SdkLocateVisualStudio(MSVC_VERSION)
  445. else:
  446. COMPILER = "GCC"
  447. SetupBuildEnvironment(COMPILER)
  448. ########################################################################
  449. ##
  450. ## External includes, external libraries, and external defsyms.
  451. ##
  452. ########################################################################
  453. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  454. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  455. if (COMPILER == "MSVC"):
  456. PkgDisable("X11")
  457. PkgDisable("GLES")
  458. PkgDisable("GLES2")
  459. PkgDisable("EGL")
  460. PkgDisable("CARBON")
  461. PkgDisable("COCOA")
  462. if (PkgSkip("PYTHON")==0):
  463. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  464. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  465. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  466. for pkg in PkgListGet():
  467. if (PkgSkip(pkg)==0):
  468. if (pkg[:4]=="MAYA"):
  469. IncDirectory(pkg, SDK[pkg] + "/include")
  470. DefSymbol(pkg, "MAYAVERSION", pkg)
  471. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  472. elif (pkg[:3]=="MAX"):
  473. IncDirectory(pkg, SDK[pkg] + "/include")
  474. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  475. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  476. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  477. DefSymbol(pkg, "MAX", pkg)
  478. if (int(pkg[3:]) >= 2013):
  479. DefSymbol(pkg, "UNICODE", "")
  480. DefSymbol(pkg, "_UNICODE", "")
  481. elif (pkg[:2]=="DX"):
  482. IncDirectory(pkg, SDK[pkg] + "/include")
  483. elif pkg == "VULKAN":
  484. IncDirectory(pkg, SDK[pkg] + "/Include")
  485. LibName(pkg, SDK[pkg] + "/Source/lib/vulkan-1.lib")
  486. elif GetThirdpartyDir() is not None:
  487. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  488. for pkg in DXVERSIONS:
  489. if (PkgSkip(pkg)==0):
  490. vnum=pkg[2:]
  491. if GetTargetArch() == 'x64':
  492. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  493. else:
  494. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  495. LibDirectory(pkg, SDK[pkg] + '/lib')
  496. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  497. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  498. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  499. LibName(pkg, 'dxerr.lib')
  500. else:
  501. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  502. #LibName(pkg, 'ddraw.lib')
  503. LibName(pkg, 'dxguid.lib')
  504. if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
  505. # dxerr needs this for __vsnwprintf definition.
  506. LibName(pkg, 'legacy_stdio_definitions.lib')
  507. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  508. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  509. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  510. LibName("WINSOCK", "wsock32.lib")
  511. LibName("WINSOCK2", "wsock32.lib")
  512. LibName("WINSOCK2", "ws2_32.lib")
  513. LibName("WINCOMCTL", "comctl32.lib")
  514. LibName("WINCOMDLG", "comdlg32.lib")
  515. LibName("WINUSER", "user32.lib")
  516. LibName("WINMM", "winmm.lib")
  517. LibName("WINIMM", "imm32.lib")
  518. LibName("WINKERNEL", "kernel32.lib")
  519. LibName("WINOLE", "ole32.lib")
  520. LibName("WINOLEAUT", "oleaut32.lib")
  521. LibName("WINOLDNAMES", "oldnames.lib")
  522. LibName("WINSHELL", "shell32.lib")
  523. LibName("WINGDI", "gdi32.lib")
  524. LibName("ADVAPI", "advapi32.lib")
  525. LibName("IPHLPAPI", "iphlpapi.lib")
  526. LibName("GL", "opengl32.lib")
  527. LibName("GLES", "libgles_cm.lib")
  528. LibName("GLES2", "libGLESv2.lib")
  529. LibName("EGL", "libEGL.lib")
  530. LibName("MSIMG", "msimg32.lib")
  531. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  532. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  533. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  534. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  535. if (PkgSkip("OPENSSL")==0):
  536. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  537. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  538. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  539. else:
  540. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  541. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  542. if (PkgSkip("PNG")==0):
  543. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  544. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  545. else:
  546. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  547. if (PkgSkip("TIFF")==0):
  548. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  549. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  550. else:
  551. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  552. if (PkgSkip("OPENEXR")==0):
  553. suffix = ""
  554. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  555. suffix = "-2_2"
  556. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  557. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  558. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  559. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  560. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  561. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  562. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  563. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  564. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  565. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  566. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  567. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  568. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  569. if (PkgSkip("HARFBUZZ")==0): LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  570. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/rfftw.lib")
  571. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw.lib")
  572. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  573. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  574. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  575. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  576. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  577. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  578. if (PkgSkip("AWESOMIUM")==0):LibName("AWESOMIUM",GetThirdpartyDir() + "awesomium/lib/Awesomium.lib")
  579. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  580. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  581. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  582. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  583. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  584. if (PkgSkip("FCOLLADA")==0):
  585. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  586. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  587. if (PkgSkip("ASSIMP")==0):
  588. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  589. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include/assimp")
  590. if (PkgSkip("SQUISH")==0):
  591. if GetOptimize() <= 2:
  592. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  593. else:
  594. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  595. if (PkgSkip("ROCKET")==0):
  596. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  597. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  598. if (PkgSkip("PYTHON")==0):
  599. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  600. if (GetOptimize() <= 3):
  601. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  602. if (PkgSkip("OPENAL")==0):
  603. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  604. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  605. # Link OpenAL Soft statically.
  606. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  607. if (PkgSkip("ODE")==0):
  608. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  609. DefSymbol("ODE", "dSINGLE", "")
  610. if (PkgSkip("FMODEX")==0):
  611. if (GetTargetArch() == 'x64'):
  612. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  613. else:
  614. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  615. if (PkgSkip("FLTK")==0 and RTDIST):
  616. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  617. if not PkgSkip("FLTK"):
  618. # If we have fltk, we don't need wx
  619. PkgDisable("WX")
  620. if (PkgSkip("WX")==0 and RTDIST):
  621. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  622. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  623. DefSymbol("WX", "__WXMSW__", "")
  624. DefSymbol("WX", "_UNICODE", "")
  625. DefSymbol("WX", "UNICODE", "")
  626. if (PkgSkip("VORBIS")==0):
  627. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libogg_static.lib")
  628. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbis_static.lib")
  629. LibName("VORBIS", GetThirdpartyDir() + "vorbis/lib/libvorbisfile_static.lib")
  630. if (PkgSkip("OPUS")==0):
  631. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libogg_static.lib")
  632. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopus_static.lib")
  633. LibName("OPUS", GetThirdpartyDir() + "opus/lib/libopusfile_static.lib")
  634. for pkg in MAYAVERSIONS:
  635. if (PkgSkip(pkg)==0):
  636. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  637. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  638. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  639. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  640. for pkg in MAXVERSIONS:
  641. if (PkgSkip(pkg)==0):
  642. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  643. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  644. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  645. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  646. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  647. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  648. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  649. if (PkgSkip("PHYSX")==0):
  650. if GetTargetArch() == 'x64':
  651. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  652. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  653. else:
  654. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  655. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  656. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  657. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  658. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  659. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  660. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  661. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  662. if (PkgSkip("SPEEDTREE")==0):
  663. if GetTargetArch() == 'x64':
  664. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  665. p64ext = '64'
  666. else:
  667. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  668. p64ext = ''
  669. debugext = ''
  670. if (GetOptimize() <= 2): debugext = "_d"
  671. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  672. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  673. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  674. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  675. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  676. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  677. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  678. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  679. LibName("SPEEDTREE", "glu32.lib")
  680. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  681. if (PkgSkip("BULLET")==0):
  682. suffix = '.lib'
  683. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  684. suffix = '_x64.lib'
  685. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  686. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  687. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  688. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  689. if (COMPILER=="GCC"):
  690. PkgDisable("AWESOMIUM")
  691. if GetTarget() != "darwin":
  692. PkgDisable("CARBON")
  693. PkgDisable("COCOA")
  694. elif RUNTIME:
  695. # We don't support Cocoa in the runtime yet.
  696. PkgDisable("COCOA")
  697. if 'x86_64' in OSX_ARCHS:
  698. # 64-bits OS X doesn't have Carbon.
  699. PkgDisable("CARBON")
  700. #if (PkgSkip("PYTHON")==0):
  701. # IncDirectory("PYTHON", SDK["PYTHON"])
  702. if (GetHost() == "darwin"):
  703. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  704. IncDirectory("FREETYPE", "/usr/X11/include")
  705. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  706. LibDirectory("FREETYPE", "/usr/X11/lib")
  707. if (GetHost() == "freebsd"):
  708. IncDirectory("ALWAYS", "/usr/local/include")
  709. LibDirectory("ALWAYS", "/usr/local/lib")
  710. if (os.path.isdir("/usr/PCBSD")):
  711. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  712. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  713. if GetTarget() != "windows":
  714. PkgDisable("DIRECTCAM")
  715. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  716. # WARNING! The order of the ffmpeg libraries matters!
  717. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  718. # Name pkg-config libs, include(dir)s
  719. if (not RUNTIME):
  720. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  721. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  722. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  723. SmartPkgEnable("ASSIMP", "assimp", ("assimp"), "assimp")
  724. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  725. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  726. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  727. SmartPkgEnable("FFTW", "", ("rfftw", "fftw"), ("fftw.h", "rfftw.h"))
  728. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  729. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  730. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  731. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  732. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  733. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  734. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  735. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  736. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  737. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  738. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  739. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  740. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  741. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  742. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  743. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  744. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h"))
  745. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  746. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  747. SmartPkgEnable("VULKAN", "", ("vulkan"), "vulkan/vulkan.h")
  748. if not PkgSkip("FFMPEG"):
  749. if GetTarget() == "darwin":
  750. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  751. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  752. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  753. # Needed when linking ffmpeg statically on Linux.
  754. LibName("FFMPEG", "-Wl,-Bsymbolic")
  755. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  756. if cv_lib == "opencv_core":
  757. OPENCV_VER_23 = True
  758. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  759. else:
  760. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  761. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  762. rocket_libs = ("RocketCore", "RocketControls")
  763. if (GetOptimize() <= 3):
  764. rocket_libs += ("RocketDebugger",)
  765. rocket_libs += ("boost_python",)
  766. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  767. if not PkgSkip("PYTHON"):
  768. python_lib = SDK["PYTHONVERSION"]
  769. if not RTDIST:
  770. # We don't link anything in the SDK with libpython.
  771. python_lib = ""
  772. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  773. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  774. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  775. SmartPkgEnable("GTK2", "gtk+-2.0")
  776. if (RTDIST):
  777. SmartPkgEnable("WX", tool = "wx-config")
  778. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  779. if GetTarget() != 'darwin':
  780. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  781. if not PkgSkip("NVIDIACG") and not RUNTIME:
  782. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  783. if not RUNTIME:
  784. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  785. if GetHost() != "darwin":
  786. # Workaround for an issue where pkg-config does not include this path
  787. if GetTargetArch() in ("x86_64", "amd64"):
  788. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  789. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  790. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  791. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  792. if not PkgSkip("X11"):
  793. if (os.path.isdir("/usr/X11R6/lib64")):
  794. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  795. else:
  796. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  797. elif not PkgSkip("X11"):
  798. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  799. if RUNTIME:
  800. # For the runtime, these packages are required
  801. for pkg in ["OPENSSL", "ZLIB"]:
  802. skips = []
  803. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  804. skips.append(pkg)
  805. if skips:
  806. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  807. for pkg in MAYAVERSIONS:
  808. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  809. if (GetHost() == "darwin"):
  810. # Sheesh, Autodesk really can't make up their mind
  811. # regarding the location of the Maya devkit on OS X.
  812. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  813. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  814. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  815. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  816. if (os.path.isdir(SDK[pkg] + "/lib")):
  817. LibDirectory(pkg, SDK[pkg] + "/lib")
  818. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  819. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  820. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  821. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  822. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  823. IncDirectory(pkg, SDK[pkg] + "/include")
  824. else:
  825. LibDirectory(pkg, SDK[pkg] + "/lib")
  826. IncDirectory(pkg, SDK[pkg] + "/include")
  827. DefSymbol(pkg, "MAYAVERSION", pkg)
  828. if GetTarget() == 'darwin':
  829. LibName("ALWAYS", "-framework AppKit")
  830. if (PkgSkip("OPENCV")==0):
  831. LibName("OPENCV", "-framework QuickTime")
  832. LibName("AGL", "-framework AGL")
  833. LibName("CARBON", "-framework Carbon")
  834. LibName("COCOA", "-framework Cocoa")
  835. # Fix for a bug in OSX Leopard:
  836. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  837. if GetTarget() == 'android':
  838. LibName("ALWAYS", '-llog')
  839. LibName("ALWAYS", '-landroid')
  840. LibName("JNIGRAPHICS", '-ljnigraphics')
  841. for pkg in MAYAVERSIONS:
  842. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  843. if GetTarget() == 'darwin':
  844. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/Maya.app/Contents/MacOS")
  845. else:
  846. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  847. LibName(pkg, "-lOpenMaya")
  848. LibName(pkg, "-lOpenMayaAnim")
  849. LibName(pkg, "-lAnimSlice")
  850. LibName(pkg, "-lDeformSlice")
  851. LibName(pkg, "-lModifiers")
  852. LibName(pkg, "-lDynSlice")
  853. LibName(pkg, "-lKinSlice")
  854. LibName(pkg, "-lModelSlice")
  855. LibName(pkg, "-lNurbsSlice")
  856. LibName(pkg, "-lPolySlice")
  857. LibName(pkg, "-lProjectSlice")
  858. LibName(pkg, "-lImage")
  859. LibName(pkg, "-lShared")
  860. LibName(pkg, "-lTranslators")
  861. LibName(pkg, "-lDataModel")
  862. LibName(pkg, "-lRenderModel")
  863. LibName(pkg, "-lNurbsEngine")
  864. LibName(pkg, "-lDependEngine")
  865. LibName(pkg, "-lCommandEngine")
  866. LibName(pkg, "-lFoundation")
  867. LibName(pkg, "-lIMFbase")
  868. if GetTarget() != 'darwin':
  869. LibName(pkg, "-lOpenMayalib")
  870. else:
  871. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  872. if (PkgSkip("PHYSX")==0):
  873. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  874. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  875. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  876. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  877. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  878. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  879. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  880. if (GetHost() == "darwin"):
  881. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  882. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  883. else:
  884. LibName("PHYSX", "-lPhysXLoader")
  885. LibName("PHYSX", "-lNxCharacter")
  886. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  887. if GetLinkAllStatic():
  888. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  889. if GetTarget() == 'android':
  890. DefSymbol("ALWAYS", "ANDROID")
  891. if not PkgSkip("EIGEN"):
  892. if GetOptimize() >= 3:
  893. if COMPILER == "MSVC":
  894. # Squeeze out a bit more performance on MSVC builds...
  895. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  896. # will turn them into runtime assertions.
  897. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  898. ########################################################################
  899. ##
  900. ## Give a Status Report on Command-Line Options
  901. ##
  902. ########################################################################
  903. def printStatus(header,warnings):
  904. if GetVerbose():
  905. print("")
  906. print("-------------------------------------------------------------------")
  907. print(header)
  908. tkeep = ""
  909. tomit = ""
  910. for x in PkgListGet():
  911. if PkgSkip(x):
  912. tomit = tomit + x + " "
  913. else:
  914. tkeep = tkeep + x + " "
  915. if RTDIST:
  916. print("Makepanda: Runtime distribution build")
  917. elif RUNTIME:
  918. print("Makepanda: Runtime build")
  919. else:
  920. print("Makepanda: Regular build")
  921. print("Makepanda: Compiler: %s" % (COMPILER))
  922. print("Makepanda: Optimize: %d" % (GetOptimize()))
  923. print("Makepanda: Keep Pkg: %s" % (tkeep))
  924. print("Makepanda: Omit Pkg: %s" % (tomit))
  925. if GENMAN:
  926. print("Makepanda: Generate API reference manual")
  927. else:
  928. print("Makepanda: Don't generate API reference manual")
  929. if GetHost() == "windows" and not RTDIST:
  930. if INSTALLER:
  931. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  932. else:
  933. print("Makepanda: Don't build installer")
  934. print("Makepanda: Version ID: %s" % (VERSION))
  935. for x in warnings:
  936. print("Makepanda: %s" % (x))
  937. print("-------------------------------------------------------------------")
  938. print("")
  939. sys.stdout.flush()
  940. ########################################################################
  941. ##
  942. ## BracketNameWithQuotes
  943. ##
  944. ########################################################################
  945. def BracketNameWithQuotes(name):
  946. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  947. if (name.startswith("-framework")): return name
  948. if (name.startswith("-dylib_file")): return name
  949. # Don't add quotes when it's not necessary.
  950. if " " not in name: return name
  951. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  952. if (name.startswith('"') and name.endswith('"')): return name
  953. else: return '"' + name + '"'
  954. ########################################################################
  955. ##
  956. ## CompileCxx
  957. ##
  958. ########################################################################
  959. def CompileCxx(obj,src,opts):
  960. ipath = GetListOption(opts, "DIR:")
  961. optlevel = GetOptimizeOption(opts)
  962. if (COMPILER=="MSVC"):
  963. if not BOOUSEINTELCOMPILER:
  964. cmd = "cl "
  965. if GetTargetArch() == 'x64':
  966. cmd += "/favor:blend "
  967. cmd += "/wd4996 /wd4275 /wd4273 "
  968. # We still target Windows XP.
  969. cmd += "/DWINVER=0x501 "
  970. # Work around a WinXP/2003 bug when using VS 2015+.
  971. if SDK.get("VISUALSTUDIO_VERSION") == '14.0':
  972. cmd += "/Zc:threadSafeInit- "
  973. cmd += "/Fo" + obj + " /nologo /c"
  974. if GetTargetArch() != 'x64' and (not PkgSkip("SSE2") or 'SSE2' in opts):
  975. cmd += " /arch:SSE2"
  976. for x in ipath: cmd += " /I" + x
  977. for (opt,dir) in INCDIRECTORIES:
  978. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  979. for (opt,var,val) in DEFSYMBOLS:
  980. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  981. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  982. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  983. if (optlevel==2): cmd += " /MDd /Zi"
  984. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  985. if (optlevel==4):
  986. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  987. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  988. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  989. building = GetValueOption(opts, "BUILDING:")
  990. if (building):
  991. cmd += " /DBUILDING_" + building
  992. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  993. cmd += " /bigobj"
  994. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  995. if 'EXCEPTIONS' in opts:
  996. cmd += " /EHsc"
  997. else:
  998. cmd += " /D_HAS_EXCEPTIONS=0"
  999. if 'RTTI' not in opts:
  1000. cmd += " /GR-"
  1001. if GetTargetArch() == 'x64':
  1002. cmd += " /DWIN64_VC /DWIN64"
  1003. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > 10:
  1004. # To preserve Windows XP compatibility.
  1005. cmd += " /D_USING_V110_SDK71_"
  1006. cmd += " /W3 " + BracketNameWithQuotes(src)
  1007. oscmd(cmd)
  1008. else:
  1009. cmd = "icl "
  1010. if GetTargetArch() == 'x64':
  1011. cmd += "/favor:blend "
  1012. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1013. cmd += "/DWINVER=0x501 "
  1014. cmd += "/Fo" + obj + " /c"
  1015. for x in ipath: cmd += " /I" + x
  1016. for (opt,dir) in INCDIRECTORIES:
  1017. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1018. for (opt,var,val) in DEFSYMBOLS:
  1019. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1020. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1021. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1022. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1023. # core changes from jean-claude (dec 2011)
  1024. # ----------------------------------------
  1025. # performance will be seeked at level 3 & 4
  1026. # -----------------------------------------
  1027. if (optlevel==3):
  1028. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1029. cmd += " /Ob0"
  1030. cmd += " /Qipo-" # beware of IPO !!!
  1031. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1032. ## ----------------------------------------------------------------
  1033. if (optlevel==4):
  1034. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1035. cmd += " /Qipo" # optimization multi file
  1036. # for 3 & 4 optimization levels
  1037. # -----------------------------
  1038. if (optlevel>=3):
  1039. cmd += " /fp:fast=2"
  1040. cmd += " /Qftz"
  1041. cmd += " /Qfp-speculation:fast"
  1042. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1043. cmd += " /Qprec-div-"
  1044. cmd += " /Qsimd"
  1045. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1046. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1047. cmd += " /Qparallel" # enable parallelization
  1048. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1049. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1050. ## PCH files with a .pchi filename suffix and reduce build time.
  1051. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1052. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1053. cmd += " /Qpchi-" # keep it this way!
  1054. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1055. ## ------------------------------------
  1056. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1057. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1058. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1059. ## Ctor displacement /vd0 : Disable constructor displacement.
  1060. ## Choose this option only if no class constructors or destructors call virtual functions.
  1061. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1062. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1063. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1064. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1065. ## Alternate: #pragma pointers_to_members
  1066. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1067. building = GetValueOption(opts, "BUILDING:")
  1068. if (building): cmd += " /DBUILDING_" + building
  1069. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1070. cmd += " /bigobj"
  1071. # level of warnings and optimization reports
  1072. if GetVerbose():
  1073. cmd += " /W3 " # or /W4 or /Wall
  1074. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1075. else:
  1076. cmd += " /W1 "
  1077. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1078. if GetTargetArch() == 'x64':
  1079. cmd += " /DWIN64_VC /DWIN64"
  1080. cmd += " " + BracketNameWithQuotes(src)
  1081. oscmd(cmd)
  1082. if (COMPILER=="GCC"):
  1083. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1084. else: cmd = GetCXX()+' -std=gnu++0x -ftemplate-depth-70 -fPIC -c -o ' + obj
  1085. for (opt, dir) in INCDIRECTORIES:
  1086. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1087. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1088. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1089. for (opt,var,val) in DEFSYMBOLS:
  1090. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1091. for x in ipath: cmd += ' -I' + x
  1092. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1093. cmd += ' -fvisibility=hidden'
  1094. # Mac-specific flags.
  1095. if GetTarget() == "darwin":
  1096. cmd += " -Wno-deprecated-declarations"
  1097. if OSXTARGET is not None:
  1098. cmd += " -isysroot " + SDK["MACOSX"]
  1099. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1100. for arch in OSX_ARCHS:
  1101. if 'NOARCH:' + arch.upper() not in opts:
  1102. cmd += " -arch %s" % arch
  1103. if "SYSROOT" in SDK:
  1104. cmd += ' --sysroot=%s -no-canonical-prefixes' % (SDK["SYSROOT"])
  1105. # Android-specific flags.
  1106. arch = GetTargetArch()
  1107. if GetTarget() == "android":
  1108. # Most of the specific optimization flags here were
  1109. # just copied from the default Android Makefiles.
  1110. cmd += ' -I%s/include' % (SDK["ANDROID_STL"])
  1111. cmd += ' -I%s/libs/%s/include' % (SDK["ANDROID_STL"], SDK["ANDROID_ABI"])
  1112. cmd += ' -ffunction-sections -funwind-tables'
  1113. if arch == 'armv7a':
  1114. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1115. cmd += ' -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1116. elif arch == 'arm':
  1117. cmd += ' -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__'
  1118. cmd += ' -fstack-protector -march=armv5te -mtune=xscale -msoft-float'
  1119. elif arch == 'mips':
  1120. cmd += ' -finline-functions -fmessage-length=0'
  1121. cmd += ' -fno-inline-functions-called-once -fgcse-after-reload'
  1122. cmd += ' -frerun-cse-after-loop -frename-registers'
  1123. cmd += " -Wa,--noexecstack"
  1124. # Now add specific release/debug flags.
  1125. if optlevel >= 3:
  1126. cmd += " -fomit-frame-pointer"
  1127. if arch.startswith('arm'):
  1128. cmd += ' -finline-limit=64 -mthumb'
  1129. elif arch == 'mips':
  1130. cmd += ' -funswitch-loops -finline-limit=300'
  1131. else:
  1132. cmd += ' -fno-omit-frame-pointer'
  1133. if arch.startswith('arm'):
  1134. cmd += ' -marm'
  1135. # Enable SIMD instructions if requested
  1136. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1137. cmd += ' -mfpu=neon'
  1138. else:
  1139. cmd += " -pthread"
  1140. if not src.endswith(".c"):
  1141. # We don't use exceptions for most modules.
  1142. if 'EXCEPTIONS' in opts:
  1143. cmd += " -fexceptions"
  1144. else:
  1145. cmd += " -fno-exceptions"
  1146. if src.endswith(".mm"):
  1147. # Work around Apple compiler bug.
  1148. cmd += " -U__EXCEPTIONS"
  1149. if 'RTTI' not in opts:
  1150. # We always disable RTTI on Android for memory usage reasons.
  1151. if optlevel >= 4 or GetTarget() == "android":
  1152. cmd += " -fno-rtti"
  1153. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm"):
  1154. cmd += " -msse2"
  1155. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1156. cmd += " -fno-strict-aliasing"
  1157. if optlevel >= 3:
  1158. cmd += " -ffast-math -fno-stack-protector"
  1159. if optlevel == 3:
  1160. # Fast math is nice, but we'd like to see NaN in dev builds.
  1161. cmd += " -fno-finite-math-only"
  1162. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1163. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1164. if (optlevel==3): cmd += " -O2"
  1165. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1166. if src.endswith(".c"):
  1167. cmd += ' ' + CFLAGS
  1168. else:
  1169. cmd += ' ' + CXXFLAGS
  1170. cmd = cmd.rstrip()
  1171. building = GetValueOption(opts, "BUILDING:")
  1172. if (building): cmd += " -DBUILDING_" + building
  1173. cmd += ' ' + BracketNameWithQuotes(src)
  1174. oscmd(cmd)
  1175. ########################################################################
  1176. ##
  1177. ## CompileBison
  1178. ##
  1179. ########################################################################
  1180. def CompileBison(wobj, wsrc, opts):
  1181. ifile = os.path.basename(wsrc)
  1182. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1183. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1184. pre = GetValueOption(opts, "BISONPREFIX_")
  1185. bison = GetBison()
  1186. if bison is None:
  1187. # We don't have bison. See if there is a prebuilt file.
  1188. base, ext = os.path.splitext(wsrc)
  1189. if os.path.isfile(base + '.h.prebuilt') and \
  1190. os.path.isfile(base + '.cxx.prebuilt'):
  1191. CopyFile(wdstc, base + '.cxx.prebuilt')
  1192. CopyFile(wdsth, base + '.h.prebuilt')
  1193. else:
  1194. exit('Could not find bison!')
  1195. else:
  1196. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1197. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1198. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1199. # Finally, compile the generated source file.
  1200. CompileCxx(wobj,wdstc,opts)
  1201. ########################################################################
  1202. ##
  1203. ## CompileFlex
  1204. ##
  1205. ########################################################################
  1206. def CompileFlex(wobj,wsrc,opts):
  1207. ifile = os.path.basename(wsrc)
  1208. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1209. pre = GetValueOption(opts, "BISONPREFIX_")
  1210. dashi = opts.count("FLEXDASHI")
  1211. flex = GetFlex()
  1212. if flex is None:
  1213. # We don't have flex. See if there is a prebuilt file.
  1214. base, ext = os.path.splitext(wsrc)
  1215. if os.path.isfile(base + '.cxx.prebuilt'):
  1216. CopyFile(wdst, base + '.cxx.prebuilt')
  1217. else:
  1218. exit('Could not find flex!')
  1219. else:
  1220. if (dashi):
  1221. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1222. else:
  1223. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1224. # Finally, compile the generated source file.
  1225. CompileCxx(wobj,wdst,opts)
  1226. ########################################################################
  1227. ##
  1228. ## CompileIgate
  1229. ##
  1230. ########################################################################
  1231. def CompileIgate(woutd,wsrc,opts):
  1232. outbase = os.path.basename(woutd)[:-3]
  1233. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1234. wobj = FindLocation(outbase + "_igate.obj", [])
  1235. srcdir = GetValueOption(opts, "SRCDIR:")
  1236. module = GetValueOption(opts, "IMOD:")
  1237. library = GetValueOption(opts, "ILIB:")
  1238. ipath = GetListOption(opts, "DIR:")
  1239. if (PkgSkip("PYTHON")):
  1240. WriteFile(woutc, "")
  1241. WriteFile(woutd, "")
  1242. ConditionalWriteFile(woutd, "")
  1243. return (wobj, woutc, opts)
  1244. if not CrossCompiling():
  1245. # If we're compiling for this platform, we can use the one we've built.
  1246. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1247. else:
  1248. # Assume that interrogate is on the PATH somewhere.
  1249. cmd = 'interrogate'
  1250. if GetVerbose():
  1251. cmd += ' -v'
  1252. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1253. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1254. if (COMPILER=="MSVC"):
  1255. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1256. if GetTargetArch() == 'x64':
  1257. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1258. else:
  1259. cmd += ' -D_M_IX86'
  1260. # NOTE: this 1600 value is the version number for VC2010.
  1261. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1262. if (COMPILER=="GCC"):
  1263. cmd += ' -D__attribute__\(x\)='
  1264. if GetTargetArch() in ("x86_64", "amd64"):
  1265. cmd += ' -D_LP64'
  1266. else:
  1267. cmd += ' -D__i386__'
  1268. if GetTarget() == 'darwin':
  1269. cmd += ' -D__APPLE__'
  1270. optlevel = GetOptimizeOption(opts)
  1271. if (optlevel==1): cmd += ' -D_DEBUG'
  1272. if (optlevel==2): cmd += ' -D_DEBUG'
  1273. if (optlevel==3): pass
  1274. if (optlevel==4): cmd += ' -DNDEBUG'
  1275. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1276. cmd += ' -fnames -string -refcount -assert -python-native'
  1277. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1278. # Add -I, -S and -D flags
  1279. for x in ipath:
  1280. cmd += ' -I' + BracketNameWithQuotes(x)
  1281. for (opt,dir) in INCDIRECTORIES:
  1282. if (opt=="ALWAYS") or (opt in opts):
  1283. cmd += ' -S' + BracketNameWithQuotes(dir)
  1284. for (opt,var,val) in DEFSYMBOLS:
  1285. if (opt=="ALWAYS") or (opt in opts):
  1286. cmd += ' -D' + var + '=' + val
  1287. #building = GetValueOption(opts, "BUILDING:")
  1288. #if (building): cmd += " -DBUILDING_"+building
  1289. cmd += ' -module ' + module + ' -library ' + library
  1290. for x in wsrc:
  1291. if (x.startswith("/")):
  1292. cmd += ' ' + BracketNameWithQuotes(x)
  1293. else:
  1294. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1295. oscmd(cmd)
  1296. return (wobj, woutc, opts)
  1297. ########################################################################
  1298. ##
  1299. ## CompileImod
  1300. ##
  1301. ########################################################################
  1302. def CompileImod(wobj, wsrc, opts):
  1303. module = GetValueOption(opts, "IMOD:")
  1304. library = GetValueOption(opts, "ILIB:")
  1305. if (COMPILER=="MSVC"):
  1306. woutc = wobj[:-4]+".cxx"
  1307. if (COMPILER=="GCC"):
  1308. woutc = wobj[:-2]+".cxx"
  1309. if (PkgSkip("PYTHON")):
  1310. WriteFile(woutc, "")
  1311. CompileCxx(wobj, woutc, opts)
  1312. return
  1313. if not CrossCompiling():
  1314. # If we're compiling for this platform, we can use the one we've built.
  1315. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1316. else:
  1317. # Assume that interrogate_module is on the PATH somewhere.
  1318. cmd = 'interrogate_module'
  1319. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1320. importmod = GetValueOption(opts, "IMPORT:")
  1321. if importmod:
  1322. cmd += ' -import ' + importmod
  1323. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1324. oscmd(cmd)
  1325. CompileCxx(wobj,woutc,opts)
  1326. return
  1327. ########################################################################
  1328. ##
  1329. ## CompileLib
  1330. ##
  1331. ########################################################################
  1332. def CompileLib(lib, obj, opts):
  1333. if (COMPILER=="MSVC"):
  1334. if not BOOUSEINTELCOMPILER:
  1335. #Use MSVC Linker
  1336. cmd = 'link /lib /nologo'
  1337. if GetOptimizeOption(opts) == 4:
  1338. cmd += " /LTCG"
  1339. if HasTargetArch():
  1340. cmd += " /MACHINE:" + GetTargetArch().upper()
  1341. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1342. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1343. oscmd(cmd)
  1344. else:
  1345. # Choose Intel linker; from Jean-Claude
  1346. cmd = 'xilink /verbose:lib /lib '
  1347. if HasTargetArch():
  1348. cmd += " /MACHINE:" + GetTargetArch().upper()
  1349. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1350. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1351. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1352. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1353. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1354. oscmd(cmd)
  1355. if (COMPILER=="GCC"):
  1356. if GetTarget() == 'darwin':
  1357. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1358. else:
  1359. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1360. for x in obj:
  1361. cmd += ' ' + BracketNameWithQuotes(x)
  1362. oscmd(cmd)
  1363. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1364. ########################################################################
  1365. ##
  1366. ## CompileLink
  1367. ##
  1368. ########################################################################
  1369. def CompileLink(dll, obj, opts):
  1370. if (COMPILER=="MSVC"):
  1371. if not BOOUSEINTELCOMPILER:
  1372. cmd = "link /nologo "
  1373. if HasTargetArch():
  1374. cmd += " /MACHINE:" + GetTargetArch().upper()
  1375. if ("MFC" not in opts):
  1376. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1377. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1378. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1379. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1380. optlevel = GetOptimizeOption(opts)
  1381. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1382. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1383. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1384. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1385. if ("MFC" in opts):
  1386. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1387. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1388. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1389. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1390. # Set the subsystem. Specify that we want to target Windows XP.
  1391. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1392. cmd += " /SUBSYSTEM:" + subsystem
  1393. if GetTargetArch() == 'x64':
  1394. cmd += ",5.02"
  1395. else:
  1396. cmd += ",5.01"
  1397. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1398. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1399. for (opt, dir) in LIBDIRECTORIES:
  1400. if (opt=="ALWAYS") or (opt in opts):
  1401. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1402. for x in obj:
  1403. if x.endswith(".dll") or x.endswith(".pyd"):
  1404. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1405. elif x.endswith(".lib"):
  1406. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1407. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1408. exit("Error: in makepanda, specify "+dname+", not "+x)
  1409. cmd += ' ' + BracketNameWithQuotes(x)
  1410. elif x.endswith(".def"):
  1411. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1412. elif x.endswith(".dat"):
  1413. pass
  1414. else:
  1415. cmd += ' ' + BracketNameWithQuotes(x)
  1416. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1417. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1418. for (opt, name) in LIBNAMES:
  1419. if (opt=="ALWAYS") or (opt in opts):
  1420. cmd += " " + BracketNameWithQuotes(name)
  1421. oscmd(cmd)
  1422. else:
  1423. cmd = "xilink"
  1424. if GetVerbose(): cmd += " /verbose:lib"
  1425. if HasTargetArch():
  1426. cmd += " /MACHINE:" + GetTargetArch().upper()
  1427. if ("MFC" not in opts):
  1428. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1429. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1430. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1431. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\ipp\lib\ia32"'
  1432. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\TBB\Lib\ia32\vc10"'
  1433. cmd += ' /LIBPATH:"C:\Program Files (x86)\Intel\Composer XE 2011 SP1\compiler\lib\ia32"'
  1434. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1435. optlevel = GetOptimizeOption(opts)
  1436. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1437. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1438. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1439. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1440. if ("MFC" in opts):
  1441. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1442. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1443. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1444. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1445. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1446. if subsystem:
  1447. cmd += " /SUBSYSTEM:" + subsystem
  1448. if dll.endswith(".dll"):
  1449. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1450. for (opt, dir) in LIBDIRECTORIES:
  1451. if (opt=="ALWAYS") or (opt in opts):
  1452. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1453. for x in obj:
  1454. if x.endswith(".dll") or x.endswith(".pyd"):
  1455. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1456. elif x.endswith(".lib"):
  1457. dname = os.path.splitext(dll)[0]+".dll"
  1458. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1459. exit("Error: in makepanda, specify "+dname+", not "+x)
  1460. cmd += ' ' + BracketNameWithQuotes(x)
  1461. elif x.endswith(".def"):
  1462. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1463. elif x.endswith(".dat"):
  1464. pass
  1465. else:
  1466. cmd += ' ' + BracketNameWithQuotes(x)
  1467. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1468. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1469. for (opt, name) in LIBNAMES:
  1470. if (opt=="ALWAYS") or (opt in opts):
  1471. cmd += " " + BracketNameWithQuotes(name)
  1472. oscmd(cmd)
  1473. if COMPILER == "GCC":
  1474. cxx = GetCXX()
  1475. if GetOrigExt(dll) == ".exe" and GetTarget() != 'android':
  1476. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1477. else:
  1478. if (GetTarget() == "darwin"):
  1479. cmd = cxx + ' -undefined dynamic_lookup'
  1480. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1481. cmd += ' -bundle '
  1482. else:
  1483. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1484. cmd += ' -dynamiclib -install_name ' + install_name
  1485. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1486. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1487. else:
  1488. cmd = cxx + ' -shared'
  1489. if "MODULE" not in opts or GetTarget() == 'android':
  1490. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1491. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1492. for x in obj:
  1493. if GetOrigExt(x) != ".dat":
  1494. cmd += ' ' + x
  1495. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1496. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1497. # Mac OS X specific flags.
  1498. if GetTarget() == 'darwin':
  1499. cmd += " -headerpad_max_install_names"
  1500. if OSXTARGET is not None:
  1501. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1502. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1503. for arch in OSX_ARCHS:
  1504. if 'NOARCH:' + arch.upper() not in opts:
  1505. cmd += " -arch %s" % arch
  1506. elif GetTarget() == 'android':
  1507. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1508. if GetTargetArch() == 'armv7a':
  1509. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1510. cmd += ' -lc -lm'
  1511. else:
  1512. cmd += " -pthread"
  1513. if "SYSROOT" in SDK:
  1514. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1515. if LDFLAGS != "":
  1516. cmd += " " + LDFLAGS
  1517. # Don't link libraries with Python.
  1518. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST:
  1519. opts = opts[:]
  1520. opts.remove("PYTHON")
  1521. for (opt, dir) in LIBDIRECTORIES:
  1522. if (opt=="ALWAYS") or (opt in opts):
  1523. cmd += ' -L' + BracketNameWithQuotes(dir)
  1524. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1525. if (opt=="ALWAYS") or (opt in opts):
  1526. cmd += ' -F' + BracketNameWithQuotes(dir)
  1527. for (opt, name) in LIBNAMES:
  1528. if (opt=="ALWAYS") or (opt in opts):
  1529. cmd += ' ' + BracketNameWithQuotes(name)
  1530. if GetTarget() != 'freebsd':
  1531. cmd += " -ldl"
  1532. oscmd(cmd)
  1533. if GetTarget() == 'android':
  1534. # Copy the library to built/libs/$ANDROID_ABI and strip it.
  1535. # This is the format that Android NDK projects should use.
  1536. new_path = '%s/libs/%s/%s' % (GetOutputDir(), SDK["ANDROID_ABI"], os.path.basename(dll))
  1537. CopyFile(new_path, dll)
  1538. oscmd('%s --strip-unneeded %s' % (GetStrip(), BracketNameWithQuotes(new_path)))
  1539. elif (GetOptimizeOption(opts)==4 and GetTarget() == 'linux'):
  1540. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1541. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1542. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1543. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1544. if os.path.isfile(newdll):
  1545. os.remove(newdll)
  1546. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1547. elif dll.endswith("." + MAJOR_VERSION):
  1548. newdll = dll[:-len(MAJOR_VERSION)-1]
  1549. if os.path.isfile(newdll):
  1550. os.remove(newdll)
  1551. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1552. ##########################################################################################
  1553. #
  1554. # CompileEgg
  1555. #
  1556. ##########################################################################################
  1557. def CompileEgg(eggfile, src, opts):
  1558. pz = False
  1559. if eggfile.endswith(".pz"):
  1560. pz = True
  1561. eggfile = eggfile[:-3]
  1562. # Determine the location of the pzip and flt2egg tools.
  1563. if CrossCompiling():
  1564. # We may not be able to use our generated versions of these tools,
  1565. # so we'll expect them to already be present in the PATH.
  1566. pzip = 'pzip'
  1567. flt2egg = 'flt2egg'
  1568. else:
  1569. # If we're compiling for this machine, we can use the binaries we've built.
  1570. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1571. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1572. if not os.path.isfile(pzip):
  1573. pzip = 'pzip'
  1574. if not os.path.isfile(flt2egg):
  1575. flt2egg = 'flt2egg'
  1576. if src.endswith(".egg"):
  1577. CopyFile(eggfile, src)
  1578. elif src.endswith(".flt"):
  1579. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1580. if pz:
  1581. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1582. ##########################################################################################
  1583. #
  1584. # CompileRes, CompileRsrc
  1585. #
  1586. ##########################################################################################
  1587. def CompileRes(target, src, opts):
  1588. """Compiles a Windows .rc file into a .res file."""
  1589. ipath = GetListOption(opts, "DIR:")
  1590. if (COMPILER == "MSVC"):
  1591. cmd = "rc"
  1592. cmd += " /Fo" + BracketNameWithQuotes(target)
  1593. for x in ipath: cmd += " /I" + x
  1594. for (opt,dir) in INCDIRECTORIES:
  1595. if (opt=="ALWAYS") or (opt in opts):
  1596. cmd += " /I" + BracketNameWithQuotes(dir)
  1597. for (opt,var,val) in DEFSYMBOLS:
  1598. if (opt=="ALWAYS") or (opt in opts):
  1599. cmd += " /D" + var + "=" + val
  1600. cmd += " " + BracketNameWithQuotes(src)
  1601. else:
  1602. cmd = "windres"
  1603. for x in ipath: cmd += " -I" + x
  1604. for (opt,dir) in INCDIRECTORIES:
  1605. if (opt=="ALWAYS") or (opt in opts):
  1606. cmd += " -I" + BracketNameWithQuotes(dir)
  1607. for (opt,var,val) in DEFSYMBOLS:
  1608. if (opt=="ALWAYS") or (opt in opts):
  1609. cmd += " -D" + var + "=" + val
  1610. cmd += " -i " + BracketNameWithQuotes(src)
  1611. cmd += " -o " + BracketNameWithQuotes(target)
  1612. oscmd(cmd)
  1613. def CompileRsrc(target, src, opts):
  1614. """Compiles a Mac OS .r file into an .rsrc file."""
  1615. ipath = GetListOption(opts, "DIR:")
  1616. if os.path.isfile("/usr/bin/Rez"):
  1617. cmd = "Rez -useDF"
  1618. else:
  1619. cmd = "/Developer/Tools/Rez -useDF"
  1620. cmd += " -o " + BracketNameWithQuotes(target)
  1621. for x in ipath:
  1622. cmd += " -i " + x
  1623. for (opt,dir) in INCDIRECTORIES:
  1624. if (opt=="ALWAYS") or (opt in opts):
  1625. cmd += " -i " + BracketNameWithQuotes(dir)
  1626. for (opt,var,val) in DEFSYMBOLS:
  1627. if (opt=="ALWAYS") or (opt in opts):
  1628. if (val == ""):
  1629. cmd += " -d " + var
  1630. else:
  1631. cmd += " -d " + var + " = " + val
  1632. cmd += " " + BracketNameWithQuotes(src)
  1633. oscmd(cmd)
  1634. ##########################################################################################
  1635. #
  1636. # FreezePy
  1637. #
  1638. ##########################################################################################
  1639. def FreezePy(target, inputs, opts):
  1640. assert len(inputs) > 0
  1641. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1642. if sys.version_info >= (2, 6):
  1643. cmdstr += "-B "
  1644. cmdstr += os.path.join(GetOutputDir(), "direct", "showutil", "pfreeze.py")
  1645. if 'FREEZE_STARTUP' in opts:
  1646. cmdstr += " -s"
  1647. if GetOrigExt(target) == '.exe':
  1648. src = inputs.pop(0)
  1649. else:
  1650. src = ""
  1651. for i in inputs:
  1652. i = os.path.splitext(i)[0]
  1653. i = i.replace('/', '.')
  1654. if i.startswith('direct.src'):
  1655. i = i.replace('.src.', '.')
  1656. cmdstr += " -i " + i
  1657. cmdstr += " -o " + target + " " + src
  1658. if ("LINK_PYTHON_STATIC" in opts):
  1659. os.environ["LINK_PYTHON_STATIC"] = "1"
  1660. oscmd(cmdstr)
  1661. if ("LINK_PYTHON_STATIC" in os.environ):
  1662. del os.environ["LINK_PYTHON_STATIC"]
  1663. if (not os.path.exists(target)):
  1664. exit("FREEZER_ERROR")
  1665. ##########################################################################################
  1666. #
  1667. # Package
  1668. #
  1669. ##########################################################################################
  1670. def Package(target, inputs, opts):
  1671. assert len(inputs) == 1
  1672. # Invoke the ppackage script.
  1673. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1674. if GetOptimizeOption(opts) >= 4:
  1675. command += "-OO "
  1676. if sys.version_info >= (2, 6):
  1677. command += "-B "
  1678. command += "direct/src/p3d/ppackage.py"
  1679. if not RTDIST:
  1680. # Don't compile Python sources, because we might not running in the same
  1681. # Python version as the selected host.
  1682. command += " -N"
  1683. if GetTarget() == "darwin":
  1684. if SDK.get("MACOSX"):
  1685. command += " -R \"%s\"" % SDK["MACOSX"]
  1686. for arch in OSX_ARCHS:
  1687. if arch == "x86_64":
  1688. arch = "amd64"
  1689. command += " -P osx_%s" % arch
  1690. command += " -i \"" + GetOutputDir() + "/stage\""
  1691. if (P3DSUFFIX):
  1692. command += ' -a "' + P3DSUFFIX + '"'
  1693. command += " " + inputs[0]
  1694. if GetOrigExt(target) == '.p3d':
  1695. # Build a specific .p3d file.
  1696. basename = os.path.basename(os.path.splitext(target)[0])
  1697. command += " " + basename
  1698. oscmd(command)
  1699. if GetTarget() == 'windows':
  1700. # Make an .exe that calls this .p3d.
  1701. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1702. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1703. exefile = FindLocation(basename + '.exe', [])
  1704. CompileLink(exefile, [objfile], ['ADVAPI'])
  1705. # Move it to the bin directory.
  1706. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1707. if sys.platform != 'win32':
  1708. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1709. else:
  1710. # This is presumably a package or set of packages.
  1711. oscmd(command)
  1712. ##########################################################################################
  1713. #
  1714. # CompileBundle
  1715. #
  1716. ##########################################################################################
  1717. def CompileBundle(target, inputs, opts):
  1718. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1719. plist = None
  1720. resources = []
  1721. objects = []
  1722. for i in inputs:
  1723. if (i.endswith(".plist")):
  1724. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1725. plist = i
  1726. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  1727. resources.append(i)
  1728. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  1729. objects.append(i)
  1730. else:
  1731. exit("Don't know how to bundle file %s" % i)
  1732. # Now link the object files to form the bundle.
  1733. if (plist == None): exit("One plist file must be used when creating a bundle!")
  1734. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  1735. oscmd("rm -rf %s" % target)
  1736. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  1737. oscmd("mkdir -p %s/Contents/Resources/" % target)
  1738. if target.endswith(".app"):
  1739. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  1740. else:
  1741. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  1742. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  1743. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  1744. for r in resources:
  1745. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  1746. ##########################################################################################
  1747. #
  1748. # CompileMIDL
  1749. #
  1750. ##########################################################################################
  1751. def CompileMIDL(target, src, opts):
  1752. ipath = GetListOption(opts, "DIR:")
  1753. if (COMPILER=="MSVC"):
  1754. cmd = "midl"
  1755. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  1756. for x in ipath: cmd += " /I" + x
  1757. for (opt,dir) in INCDIRECTORIES:
  1758. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1759. for (opt,var,val) in DEFSYMBOLS:
  1760. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1761. cmd += " " + BracketNameWithQuotes(src)
  1762. oscmd(cmd)
  1763. ##########################################################################################
  1764. #
  1765. # CompileAnything
  1766. #
  1767. ##########################################################################################
  1768. def CompileAnything(target, inputs, opts, progress = None):
  1769. if (opts.count("DEPENDENCYONLY")):
  1770. return
  1771. if (len(inputs)==0):
  1772. exit("No input files for target "+target)
  1773. infile = inputs[0]
  1774. origsuffix = GetOrigExt(target)
  1775. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  1776. # It must be a simple copy operation.
  1777. ProgressOutput(progress, "Copying file", target)
  1778. CopyFile(target, infile)
  1779. if (origsuffix==".exe" and GetHost() != "windows"):
  1780. os.system("chmod +x \"%s\"" % target)
  1781. return
  1782. elif (infile.endswith(".py")):
  1783. if origsuffix == ".obj":
  1784. source = os.path.splitext(target)[0] + ".c"
  1785. SetOrigExt(source, ".c")
  1786. ProgressOutput(progress, "Building frozen source", source)
  1787. FreezePy(source, inputs, opts)
  1788. ProgressOutput(progress, "Building C++ object", target)
  1789. return CompileCxx(target, source, opts)
  1790. if origsuffix == ".exe":
  1791. ProgressOutput(progress, "Building frozen executable", target)
  1792. else:
  1793. ProgressOutput(progress, "Building frozen library", target)
  1794. return FreezePy(target, inputs, opts)
  1795. elif (infile.endswith(".idl")):
  1796. ProgressOutput(progress, "Compiling MIDL file", infile)
  1797. return CompileMIDL(target, infile, opts)
  1798. elif (infile.endswith(".pdef")):
  1799. if origsuffix == '.p3d':
  1800. ProgressOutput(progress, "Building package", target)
  1801. else:
  1802. ProgressOutput(progress, "Building package from pdef file", infile)
  1803. return Package(target, inputs, opts)
  1804. elif origsuffix in SUFFIX_LIB:
  1805. ProgressOutput(progress, "Linking static library", target)
  1806. return CompileLib(target, inputs, opts)
  1807. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  1808. if (origsuffix==".exe"):
  1809. ProgressOutput(progress, "Linking executable", target)
  1810. else:
  1811. ProgressOutput(progress, "Linking dynamic library", target)
  1812. # Add version number to the dynamic library, on unix
  1813. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  1814. tplatform = GetTarget()
  1815. if tplatform == "darwin":
  1816. # On Mac, libraries are named like libpanda.1.2.dylib
  1817. if target.lower().endswith(".dylib"):
  1818. target = target[:-5] + MAJOR_VERSION + ".dylib"
  1819. SetOrigExt(target, origsuffix)
  1820. elif tplatform != "windows" and tplatform != "android":
  1821. # On Linux, libraries are named like libpanda.so.1.2
  1822. target += "." + MAJOR_VERSION
  1823. SetOrigExt(target, origsuffix)
  1824. return CompileLink(target, inputs, opts)
  1825. elif (origsuffix==".in"):
  1826. ProgressOutput(progress, "Building Interrogate database", target)
  1827. args = CompileIgate(target, inputs, opts)
  1828. ProgressOutput(progress, "Building C++ object", args[0])
  1829. return CompileCxx(*args)
  1830. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  1831. ProgressOutput(progress, "Building plugin bundle", target)
  1832. return CompileBundle(target, inputs, opts)
  1833. elif (origsuffix==".app"):
  1834. ProgressOutput(progress, "Building application bundle", target)
  1835. return CompileBundle(target, inputs, opts)
  1836. elif (origsuffix==".pz"):
  1837. ProgressOutput(progress, "Compressing", target)
  1838. return CompileEgg(target, infile, opts)
  1839. elif (origsuffix==".egg"):
  1840. ProgressOutput(progress, "Converting", target)
  1841. return CompileEgg(target, infile, opts)
  1842. elif (origsuffix==".res"):
  1843. ProgressOutput(progress, "Building resource object", target)
  1844. return CompileRes(target, infile, opts)
  1845. elif (origsuffix==".rsrc"):
  1846. ProgressOutput(progress, "Building resource object", target)
  1847. return CompileRsrc(target, infile, opts)
  1848. elif (origsuffix==".obj"):
  1849. if (infile.endswith(".cxx")):
  1850. ProgressOutput(progress, "Building C++ object", target)
  1851. return CompileCxx(target, infile, opts)
  1852. elif (infile.endswith(".c")):
  1853. ProgressOutput(progress, "Building C object", target)
  1854. return CompileCxx(target, infile, opts)
  1855. elif (infile.endswith(".mm")):
  1856. ProgressOutput(progress, "Building Objective-C++ object", target)
  1857. return CompileCxx(target, infile, opts)
  1858. elif (infile.endswith(".yxx")):
  1859. ProgressOutput(progress, "Building Bison object", target)
  1860. return CompileBison(target, infile, opts)
  1861. elif (infile.endswith(".lxx")):
  1862. ProgressOutput(progress, "Building Flex object", target)
  1863. return CompileFlex(target, infile, opts)
  1864. elif (infile.endswith(".in")):
  1865. ProgressOutput(progress, "Building Interrogate object", target)
  1866. return CompileImod(target, inputs, opts)
  1867. elif (infile.endswith(".rc")):
  1868. ProgressOutput(progress, "Building resource object", target)
  1869. return CompileRes(target, infile, opts)
  1870. elif (infile.endswith(".r")):
  1871. ProgressOutput(progress, "Building resource object", target)
  1872. return CompileRsrc(target, infile, opts)
  1873. exit("Don't know how to compile: %s from %s" % (target, inputs))
  1874. ##########################################################################################
  1875. #
  1876. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  1877. #
  1878. ##########################################################################################
  1879. DTOOL_CONFIG=[
  1880. #_Variable_________________________Windows___________________Unix__________
  1881. ("HAVE_PYTHON", '1', '1'),
  1882. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  1883. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  1884. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  1885. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  1886. ("HAVE_MAYA", '1', '1'),
  1887. ("HAVE_SOFTIMAGE", 'UNDEF', 'UNDEF'),
  1888. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  1889. ("USE_PANDAFILESTREAM", '1', '1'),
  1890. ("USE_DELETED_CHAIN", '1', '1'),
  1891. ("HAVE_GLX", 'UNDEF', '1'),
  1892. ("HAVE_WGL", '1', 'UNDEF'),
  1893. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  1894. ("HAVE_THREADS", '1', '1'),
  1895. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  1896. ("OS_SIMPLE_THREADS", '1', '1'),
  1897. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  1898. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  1899. ("HAVE_AUDIO", '1', '1'),
  1900. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  1901. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  1902. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  1903. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  1904. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  1905. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  1906. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  1907. ("DO_PIPELINING", '1', '1'),
  1908. ("EXPORT_TEMPLATES", 'yes', 'yes'),
  1909. ("DEFAULT_PATHSEP", '";"', '":"'),
  1910. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  1911. ("HAVE_NAMESPACE", '1', '1'),
  1912. ("HAVE_OPEN_MASK", 'UNDEF', 'UNDEF'),
  1913. ("HAVE_LOCKF", '1', '1'),
  1914. ("HAVE_WCHAR_T", '1', '1'),
  1915. ("HAVE_WSTRING", '1', '1'),
  1916. ("HAVE_TYPENAME", '1', '1'),
  1917. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  1918. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  1919. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  1920. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  1921. ("HAVE_GETOPT", 'UNDEF', '1'),
  1922. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  1923. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  1924. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  1925. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  1926. ("HAVE_STREAMSIZE", '1', '1'),
  1927. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  1928. ("HAVE_IOS_BINARY", '1', '1'),
  1929. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  1930. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  1931. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  1932. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  1933. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  1934. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  1935. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  1936. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  1937. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  1938. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  1939. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  1940. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  1941. ("PHAVE_IO_H", '1', 'UNDEF'),
  1942. ("PHAVE_IOSTREAM", '1', '1'),
  1943. ("PHAVE_STRING_H", 'UNDEF', '1'),
  1944. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  1945. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  1946. ("PHAVE_MALLOC_H", '1', '1'),
  1947. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  1948. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  1949. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  1950. ("PHAVE_MINMAX_H", '1', 'UNDEF'),
  1951. ("PHAVE_SSTREAM", '1', '1'),
  1952. ("PHAVE_NEW", '1', '1'),
  1953. ("PHAVE_SYS_TYPES_H", '1', '1'),
  1954. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  1955. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  1956. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  1957. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  1958. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  1959. ("PHAVE_SYS_SOUNDCARD_H", 'UNDEF', '1'),
  1960. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  1961. ("PHAVE_STDINT_H", '1', '1'),
  1962. ("HAVE_RTTI", '1', '1'),
  1963. ("HAVE_X11", 'UNDEF', '1'),
  1964. ("IS_LINUX", 'UNDEF', '1'),
  1965. ("IS_OSX", 'UNDEF', 'UNDEF'),
  1966. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  1967. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  1968. ("LINMATH_ALIGN", '1', '1'),
  1969. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  1970. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  1971. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  1972. ("PHAVE_JPEGINT_H", '1', '1'),
  1973. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  1974. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  1975. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  1976. ("HAVE_SGI_RGB", '1', '1'),
  1977. ("HAVE_TGA", '1', '1'),
  1978. ("HAVE_IMG", '1', '1'),
  1979. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  1980. ("HAVE_BMP", '1', '1'),
  1981. ("HAVE_PNM", '1', '1'),
  1982. ("HAVE_STB_IMAGE", '1', '1'),
  1983. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  1984. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  1985. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  1986. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  1987. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  1988. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  1989. ("WANT_NATIVE_NET", '1', '1'),
  1990. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  1991. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  1992. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  1993. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  1994. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  1995. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  1996. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  1997. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  1998. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  1999. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2000. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2001. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2002. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2003. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2004. # ("_SECURE_SCL", '0', 'UNDEF'),
  2005. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2006. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2007. ]
  2008. PRC_PARAMETERS=[
  2009. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2010. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2011. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2012. ("PRC_PATH2_ENVVARS", '""', '""'),
  2013. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2014. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2015. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2016. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2017. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2018. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2019. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2020. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2021. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2022. ]
  2023. def WriteConfigSettings():
  2024. dtool_config={}
  2025. prc_parameters={}
  2026. speedtree_parameters={}
  2027. plugin_config={}
  2028. if (GetTarget() == 'windows'):
  2029. for key,win,unix in DTOOL_CONFIG:
  2030. dtool_config[key] = win
  2031. for key,win,unix in PRC_PARAMETERS:
  2032. prc_parameters[key] = win
  2033. else:
  2034. for key,win,unix in DTOOL_CONFIG:
  2035. dtool_config[key] = unix
  2036. for key,win,unix in PRC_PARAMETERS:
  2037. prc_parameters[key] = unix
  2038. for x in PkgListGet():
  2039. if ("HAVE_"+x in dtool_config):
  2040. if (PkgSkip(x)==0):
  2041. dtool_config["HAVE_"+x] = '1'
  2042. else:
  2043. dtool_config["HAVE_"+x] = 'UNDEF'
  2044. dtool_config["HAVE_NET"] = '1'
  2045. if (PkgSkip("NVIDIACG")==0):
  2046. dtool_config["HAVE_CG"] = '1'
  2047. dtool_config["HAVE_CGGL"] = '1'
  2048. dtool_config["HAVE_CGDX9"] = '1'
  2049. if (GetTarget() != "linux"):
  2050. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2051. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2052. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2053. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2054. if (GetTarget() == "darwin"):
  2055. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2056. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2057. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2058. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2059. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2060. dtool_config["HAVE_GLX"] = 'UNDEF'
  2061. dtool_config["IS_LINUX"] = 'UNDEF'
  2062. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2063. dtool_config["IS_OSX"] = '1'
  2064. # 10.4 had a broken ucontext implementation
  2065. if int(platform.mac_ver()[0][3]) <= 4:
  2066. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2067. if (GetTarget() == "freebsd"):
  2068. dtool_config["IS_LINUX"] = 'UNDEF'
  2069. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2070. dtool_config["IS_FREEBSD"] = '1'
  2071. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2072. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2073. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2074. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2075. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2076. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2077. if (GetTarget() == "android"):
  2078. # Android does have RTTI, but we disable it anyway.
  2079. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2080. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2081. dtool_config["HAVE_LOCKF"] = 'UNDEF'
  2082. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2083. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2084. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2085. # This should probably be more sophisticated, such as based
  2086. # on whether the libRocket Python modules are available.
  2087. if (PkgSkip("PYTHON") != 0):
  2088. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2089. if (GetOptimize() <= 3):
  2090. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2091. if (GetOptimize() <= 3):
  2092. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2093. dtool_config["DO_PSTATS"] = '1'
  2094. if (GetOptimize() <= 3):
  2095. dtool_config["DO_DCAST"] = '1'
  2096. if (GetOptimize() <= 3):
  2097. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2098. if (GetOptimize() <= 3):
  2099. dtool_config["DO_MEMORY_USAGE"] = '1'
  2100. if (GetOptimize() <= 3):
  2101. dtool_config["NOTIFY_DEBUG"] = '1'
  2102. if (GetOptimize() >= 4):
  2103. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2104. if (GetOptimize() >= 4):
  2105. # Disable RTTI on release builds.
  2106. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2107. # Now that we have OS_SIMPLE_THREADS, we can support
  2108. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2109. # longer need to disable it for this platform.
  2110. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2111. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2112. if (RTDIST or RUNTIME):
  2113. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2114. if HOST_URL:
  2115. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2116. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2117. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2118. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2119. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2120. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2121. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2122. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2123. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2124. if PkgSkip("GTK2") == 0:
  2125. plugin_config["HAVE_GTK"] = '1'
  2126. if (RUNTIME):
  2127. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2128. # Whether it's present on the system doesn't matter here,
  2129. # as the runtime itself doesn't include or link with X11.
  2130. if (RUNTIME and GetTarget() == 'linux'):
  2131. dtool_config["HAVE_X11"] = '1'
  2132. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2133. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2134. else:
  2135. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2136. if (PkgSkip("SPEEDTREE")==0):
  2137. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2138. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2139. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2140. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2141. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2142. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2143. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2144. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2145. for key in sorted(prc_parameters.keys()):
  2146. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2147. val = OverrideValue(key, prc_parameters[key])
  2148. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2149. else: conf = conf + "#define " + key + " " + val + "\n"
  2150. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2151. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2152. for key in sorted(dtool_config.keys()):
  2153. val = OverrideValue(key, dtool_config[key])
  2154. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2155. else: conf = conf + "#define " + key + " " + val + "\n"
  2156. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2157. if (RTDIST or RUNTIME):
  2158. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2159. for key in sorted(plugin_config.keys()):
  2160. val = plugin_config[key]
  2161. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2162. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2163. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2164. if (PkgSkip("SPEEDTREE")==0):
  2165. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2166. for key in sorted(speedtree_parameters.keys()):
  2167. val = OverrideValue(key, speedtree_parameters[key])
  2168. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2169. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2170. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2171. for x in PkgListGet():
  2172. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2173. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2174. WriteConfigSettings()
  2175. WarnConflictingFiles()
  2176. if SystemLibraryExists("dtoolbase"):
  2177. print("%sWARNING:%s Found conflicting Panda3D libraries from other ppremake build!" % (GetColor("red"), GetColor()))
  2178. if SystemLibraryExists("p3dtoolconfig"):
  2179. print("%sWARNING:%s Found conflicting Panda3D libraries from other makepanda build!" % (GetColor("red"), GetColor()))
  2180. ##########################################################################################
  2181. #
  2182. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2183. #
  2184. ##########################################################################################
  2185. PANDAVERSION_H="""
  2186. #define PANDA_MAJOR_VERSION $VERSION1
  2187. #define PANDA_MINOR_VERSION $VERSION2
  2188. #define PANDA_SEQUENCE_VERSION $VERSION3
  2189. #define PANDA_VERSION $NVERSION
  2190. #define PANDA_NUMERIC_VERSION $NVERSION
  2191. #define PANDA_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2192. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2193. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2194. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2195. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2196. """
  2197. PANDAVERSION_H_RUNTIME="""
  2198. #define PANDA_MAJOR_VERSION 0
  2199. #define PANDA_MINOR_VERSION 0
  2200. #define PANDA_SEQUENCE_VERSION 0
  2201. #define PANDA_VERSION_STR "0.0.0"
  2202. #define PANDA_ABI_VERSION_STR "0.0"
  2203. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2204. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2205. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2206. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2207. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2208. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2209. #define PANDA_PACKAGE_VERSION_STR ""
  2210. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2211. """
  2212. CHECKPANDAVERSION_CXX="""
  2213. # include "dtoolbase.h"
  2214. EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2 = 0;
  2215. """
  2216. CHECKPANDAVERSION_H="""
  2217. # include "dtoolbase.h"
  2218. extern EXPCL_DTOOL int panda_version_$VERSION1_$VERSION2;
  2219. # ifndef WIN32
  2220. /* For Windows, exporting the symbol from the DLL is sufficient; the
  2221. DLL will not load unless all expected public symbols are defined.
  2222. Other systems may not mind if the symbol is absent unless we
  2223. explictly write code that references it. */
  2224. static int check_panda_version = panda_version_$VERSION1_$VERSION2;
  2225. # endif
  2226. """
  2227. P3DACTIVEX_RC="""#include "resource.h"
  2228. #define APSTUDIO_READONLY_SYMBOLS
  2229. #include "afxres.h"
  2230. #undef APSTUDIO_READONLY_SYMBOLS
  2231. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2232. #ifdef _WIN32
  2233. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2234. #pragma code_page(1252)
  2235. #endif
  2236. #ifdef APSTUDIO_INVOKED
  2237. 1 TEXTINCLUDE
  2238. BEGIN
  2239. "resource.h\\0"
  2240. END
  2241. 2 TEXTINCLUDE
  2242. BEGIN
  2243. "#include ""afxres.h""\\r\\n"
  2244. "\\0"
  2245. END
  2246. 3 TEXTINCLUDE
  2247. BEGIN
  2248. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2249. "\\0"
  2250. END
  2251. #endif
  2252. %s
  2253. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2254. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2255. STYLE DS_SETFONT | WS_CHILD
  2256. FONT 8, "MS Sans Serif"
  2257. BEGIN
  2258. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2259. IDC_STATIC,7,25,229,16
  2260. END
  2261. #ifdef APSTUDIO_INVOKED
  2262. GUIDELINES DESIGNINFO
  2263. BEGIN
  2264. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2265. BEGIN
  2266. LEFTMARGIN, 7
  2267. RIGHTMARGIN, 243
  2268. TOPMARGIN, 7
  2269. BOTTOMMARGIN, 55
  2270. END
  2271. END
  2272. #endif
  2273. STRINGTABLE
  2274. BEGIN
  2275. IDS_P3DACTIVEX "P3DActiveX Control"
  2276. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2277. END
  2278. STRINGTABLE
  2279. BEGIN
  2280. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2281. END
  2282. #endif
  2283. #ifndef APSTUDIO_INVOKED
  2284. 1 TYPELIB "P3DActiveX.tlb"
  2285. #endif"""
  2286. def CreatePandaVersionFiles():
  2287. version1=int(VERSION.split(".")[0])
  2288. version2=int(VERSION.split(".")[1])
  2289. version3=int(VERSION.split(".")[2])
  2290. nversion=version1*1000000+version2*1000+version3
  2291. if (DISTRIBUTOR != "cmu"):
  2292. # Subtract 1 if we are not an official version.
  2293. nversion -= 1
  2294. if (RUNTIME):
  2295. pandaversion_h = PANDAVERSION_H_RUNTIME
  2296. else:
  2297. pandaversion_h = PANDAVERSION_H
  2298. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2299. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2300. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2301. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2302. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2303. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2304. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2305. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2306. if (DISTRIBUTOR == "cmu"):
  2307. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2308. else:
  2309. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2310. if GIT_COMMIT:
  2311. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2312. if not RUNTIME:
  2313. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2314. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2315. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2316. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2317. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2318. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2319. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2320. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2321. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2322. if RUNTIME:
  2323. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2324. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2325. else:
  2326. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2327. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2328. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2329. if RUNTIME:
  2330. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2331. "version" : VERSION,
  2332. "description" : "Runs 3-D games and interactive applets",
  2333. "filename" : "p3dactivex.ocx",
  2334. "mimetype" : "application/x-panda3d",
  2335. "extension" : "p3d",
  2336. "filedesc" : "Panda3D applet"}
  2337. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2338. CreatePandaVersionFiles()
  2339. ##########################################################################################
  2340. #
  2341. # Copy the "direct" tree
  2342. #
  2343. ##########################################################################################
  2344. if (PkgSkip("DIRECT")==0):
  2345. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2346. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2347. # This file used to be copied, but would nowadays cause conflicts.
  2348. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2349. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2350. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2351. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2352. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2353. # This directory doesn't exist at all any more.
  2354. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2355. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2356. # These files used to exist; remove them to avoid conflicts.
  2357. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2358. '_core.pyd', '_core.so',
  2359. 'direct.py', 'direct.pyc', 'direct.pyo',
  2360. '_direct.pyd', '_direct.so',
  2361. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2362. for basename in del_files:
  2363. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2364. if os.path.isfile(path):
  2365. print("Removing %s" % (path))
  2366. os.remove(path)
  2367. # Write an appropriate panda3d/__init__.py
  2368. p3d_init = """"Python bindings for the Panda3D libraries"
  2369. """
  2370. if GetTarget() == 'windows':
  2371. p3d_init += """
  2372. import os
  2373. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2374. if os.path.isfile(os.path.join(bindir, 'libpanda.dll')):
  2375. if not os.environ.get('PATH'):
  2376. os.environ['PATH'] = bindir
  2377. else:
  2378. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2379. del os, bindir
  2380. """
  2381. if not PkgSkip("PYTHON"):
  2382. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2383. # Also add this file, for backward compatibility.
  2384. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """
  2385. if __debug__:
  2386. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2387. from .interrogatedb import *
  2388. """)
  2389. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2390. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2391. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2392. os.remove(fn)
  2393. panda_modules = ['core']
  2394. if not PkgSkip("PANDAPHYSICS"):
  2395. panda_modules.append('physics')
  2396. if not PkgSkip('PANDAFX'):
  2397. panda_modules.append('fx')
  2398. if not PkgSkip("DIRECT"):
  2399. panda_modules.append('direct')
  2400. if not PkgSkip("VISION"):
  2401. panda_modules.append('vision')
  2402. if not PkgSkip("SKEL"):
  2403. panda_modules.append('skel')
  2404. if not PkgSkip("EGG"):
  2405. panda_modules.append('egg')
  2406. if not PkgSkip("AWESOMIUM"):
  2407. panda_modules.append('awesomium')
  2408. if not PkgSkip("ODE"):
  2409. panda_modules.append('ode')
  2410. if not PkgSkip("VRPN"):
  2411. panda_modules.append('vrpn')
  2412. panda_modules_code = """
  2413. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2414. if __debug__:
  2415. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2416. """
  2417. for module in panda_modules:
  2418. panda_modules_code += """
  2419. try:
  2420. from panda3d.%s import *
  2421. except ImportError as err:
  2422. if "No module named %s" not in str(err):
  2423. raise""" % (module, module)
  2424. exthelpers_code = """
  2425. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2426. from direct.extensions_native.extension_native_helpers import *
  2427. """
  2428. if not PkgSkip("PYTHON"):
  2429. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2430. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2431. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2432. ##########################################################################################
  2433. #
  2434. # Generate the PRC files into the ETC directory.
  2435. #
  2436. ##########################################################################################
  2437. confautoprc = ReadFile("makepanda/confauto.in")
  2438. if (PkgSkip("SPEEDTREE")==0):
  2439. # If SpeedTree is available, enable it in the config file
  2440. confautoprc = confautoprc.replace('#st#', '')
  2441. else:
  2442. # otherwise, disable it.
  2443. confautoprc = confautoprc.replace('#st#', '#')
  2444. if (os.path.isfile("makepanda/myconfig.in")):
  2445. configprc = ReadFile("makepanda/myconfig.in")
  2446. else:
  2447. configprc = ReadFile("makepanda/config.in")
  2448. if (GetTarget() == 'windows'):
  2449. configprc = configprc.replace("$HOME/.panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2450. else:
  2451. configprc = configprc.replace("aux-display pandadx9", "")
  2452. if (GetTarget() == 'darwin'):
  2453. configprc = configprc.replace(".panda3d/cache", "Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2454. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2455. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2456. if GetTarget() == 'windows':
  2457. # Convert to Windows newlines.
  2458. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2459. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2460. else:
  2461. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2462. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2463. ##########################################################################################
  2464. #
  2465. # Copy the precompiled binaries and DLLs into the build.
  2466. #
  2467. ##########################################################################################
  2468. tp_dir = GetThirdpartyDir()
  2469. if tp_dir is not None:
  2470. dylibs = {}
  2471. if GetTarget() == 'darwin':
  2472. # Make a list of all the dylibs we ship, to figure out whether we should use
  2473. # install_name_tool to correct the library reference to point to our copy.
  2474. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2475. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2476. if not PkgSkip("PYTHON"):
  2477. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2478. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2479. for pkg in PkgListGet():
  2480. if PkgSkip(pkg):
  2481. continue
  2482. tp_pkg = tp_dir + pkg.lower()
  2483. if GetTarget() == 'windows':
  2484. if os.path.exists(tp_pkg + "/bin"):
  2485. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2486. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2487. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2488. elif GetTarget() == 'darwin':
  2489. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2490. if not PkgSkip("PYTHON"):
  2491. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2492. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2493. if pkg != 'PYTHON':
  2494. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2495. for tp_lib in tp_libs:
  2496. basename = os.path.basename(tp_lib)
  2497. if basename.endswith('.dylib'):
  2498. # It's a dynamic link library. Put it in the lib directory.
  2499. target = GetOutputDir() + "/lib/" + basename
  2500. dep_prefix = "@loader_path/../lib/"
  2501. lib_id = dep_prefix + basename
  2502. else:
  2503. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2504. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2505. target = GetOutputDir() + "/" + basename
  2506. dep_prefix = "@loader_path/lib/"
  2507. lib_id = basename
  2508. if not NeedsBuild([target], [tp_lib]):
  2509. continue
  2510. CopyFile(target, tp_lib)
  2511. if os.path.islink(target) or target.endswith('.py'):
  2512. continue
  2513. # Correct the inter-library dependencies so that the build is relocatable.
  2514. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2515. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2516. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2517. line = line.strip()
  2518. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2519. continue
  2520. libdep = line.split(" ", 1)[0]
  2521. dep_basename = os.path.basename(libdep)
  2522. if dep_basename in dylibs:
  2523. dep_target = dylibs[dep_basename]
  2524. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2525. JustBuilt([target], [tp_lib])
  2526. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2527. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2528. else: # Linux / FreeBSD case.
  2529. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2530. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2531. if not PkgSkip("PYTHON"):
  2532. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2533. base = os.path.basename(tp_lib)
  2534. if base.startswith('lib'):
  2535. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2536. else:
  2537. # It's a Python module, like _rocketcore.so.
  2538. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2539. if GetTarget() == 'windows':
  2540. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2541. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2542. if not PkgSkip("PYTHON") and not RTDIST:
  2543. # We need to copy the Python DLL to the bin directory for now.
  2544. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2545. if GetOptimize() <= 2:
  2546. pydll += "_d.dll"
  2547. else:
  2548. pydll += ".dll"
  2549. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2550. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2551. CopyFile(GetOutputDir() + "/bin/", fn)
  2552. # Copy the whole Python directory.
  2553. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2554. # NB: Python does not always ship with the correct manifest/dll.
  2555. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2556. manifest = GetOutputDir() + '/tmp/python.manifest'
  2557. if os.path.isfile(manifest):
  2558. os.unlink(manifest)
  2559. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2560. if os.path.isfile(manifest):
  2561. import xml.etree.ElementTree as ET
  2562. tree = ET.parse(manifest)
  2563. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2564. else:
  2565. idents = ()
  2566. for ident in idents:
  2567. sxs_name = '_'.join([
  2568. ident.get('processorArchitecture'),
  2569. ident.get('name').lower(),
  2570. ident.get('publicKeyToken'),
  2571. ident.get('version'),
  2572. ])
  2573. # Find the manifest matching these parameters.
  2574. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2575. manifests = glob.glob(pattern)
  2576. if not manifests:
  2577. print("%sWARNING:%s Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (GetColor("red"), GetColor(), pattern))
  2578. continue
  2579. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2580. # Also copy the corresponding msvcr dll.
  2581. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2582. for file in glob.glob(pattern):
  2583. CopyFile(GetOutputDir() + "/python/", file)
  2584. # Copy python.exe to ppython.exe.
  2585. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2586. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2587. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2588. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2589. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2590. # Copy over the MSVC runtime.
  2591. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2592. vcver = SDK["VISUALSTUDIO_VERSION"].replace('.', '')
  2593. crtname = "Microsoft.VC%s.CRT" % (vcver)
  2594. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2595. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2596. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2597. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2598. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2599. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2600. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2601. ########################################################################
  2602. ##
  2603. ## Copy various stuff into the build.
  2604. ##
  2605. ########################################################################
  2606. if GetTarget() == 'windows':
  2607. # Convert to Windows newlines so they can be opened by notepad.
  2608. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2609. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2610. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2611. else:
  2612. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2613. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2614. if (PkgSkip("PANDATOOL")==0):
  2615. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2616. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2617. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2618. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2619. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2620. # Since Eigen is included by all sorts of core headers, as a convenience
  2621. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2622. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2623. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2624. ########################################################################
  2625. #
  2626. # Copy header files to the built/include/parser-inc directory.
  2627. #
  2628. ########################################################################
  2629. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2630. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2631. ########################################################################
  2632. #
  2633. # Transfer all header files to the built/include directory.
  2634. #
  2635. ########################################################################
  2636. CopyAllHeaders('dtool/src/dtoolbase')
  2637. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2638. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2639. CopyAllHeaders('dtool/metalibs/dtool')
  2640. CopyAllHeaders('dtool/src/cppparser')
  2641. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2642. CopyAllHeaders('dtool/src/dconfig')
  2643. CopyAllHeaders('dtool/src/interrogatedb')
  2644. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2645. CopyAllHeaders('dtool/src/pystub')
  2646. CopyAllHeaders('dtool/src/interrogate')
  2647. CopyAllHeaders('dtool/src/test_interrogate')
  2648. CopyAllHeaders('panda/src/putil')
  2649. CopyAllHeaders('panda/src/pandabase')
  2650. CopyAllHeaders('panda/src/express')
  2651. CopyAllHeaders('panda/src/downloader')
  2652. CopyAllHeaders('panda/metalibs/pandaexpress')
  2653. CopyAllHeaders('panda/src/pipeline')
  2654. CopyAllHeaders('panda/src/linmath')
  2655. CopyAllHeaders('panda/src/putil')
  2656. CopyAllHeaders('dtool/src/prckeys')
  2657. CopyAllHeaders('panda/src/audio')
  2658. CopyAllHeaders('panda/src/event')
  2659. CopyAllHeaders('panda/src/mathutil')
  2660. CopyAllHeaders('panda/src/gsgbase')
  2661. CopyAllHeaders('panda/src/pnmimage')
  2662. CopyAllHeaders('panda/src/nativenet')
  2663. CopyAllHeaders('panda/src/net')
  2664. CopyAllHeaders('panda/src/pstatclient')
  2665. CopyAllHeaders('panda/src/gobj')
  2666. CopyAllHeaders('panda/src/movies')
  2667. CopyAllHeaders('panda/src/pgraphnodes')
  2668. CopyAllHeaders('panda/src/pgraph')
  2669. CopyAllHeaders('panda/src/cull')
  2670. CopyAllHeaders('panda/src/chan')
  2671. CopyAllHeaders('panda/src/char')
  2672. CopyAllHeaders('panda/src/dgraph')
  2673. CopyAllHeaders('panda/src/display')
  2674. CopyAllHeaders('panda/src/device')
  2675. CopyAllHeaders('panda/src/pnmtext')
  2676. CopyAllHeaders('panda/src/text')
  2677. CopyAllHeaders('panda/src/grutil')
  2678. if (PkgSkip("VISION")==0):
  2679. CopyAllHeaders('panda/src/vision')
  2680. CopyAllHeaders('panda/src/awesomium')
  2681. if (PkgSkip("FFMPEG")==0):
  2682. CopyAllHeaders('panda/src/ffmpeg')
  2683. CopyAllHeaders('panda/src/tform')
  2684. CopyAllHeaders('panda/src/collide')
  2685. CopyAllHeaders('panda/src/parametrics')
  2686. CopyAllHeaders('panda/src/pgui')
  2687. CopyAllHeaders('panda/src/pnmimagetypes')
  2688. CopyAllHeaders('panda/src/recorder')
  2689. if (PkgSkip("ROCKET")==0):
  2690. CopyAllHeaders('panda/src/rocket')
  2691. if (PkgSkip("VRPN")==0):
  2692. CopyAllHeaders('panda/src/vrpn')
  2693. CopyAllHeaders('panda/src/wgldisplay')
  2694. CopyAllHeaders('panda/src/ode')
  2695. CopyAllHeaders('panda/metalibs/pandaode')
  2696. if (PkgSkip("PANDAPHYSICS")==0):
  2697. CopyAllHeaders('panda/src/physics')
  2698. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  2699. CopyAllHeaders('panda/src/particlesystem')
  2700. CopyAllHeaders('panda/src/dxml')
  2701. CopyAllHeaders('panda/metalibs/panda')
  2702. CopyAllHeaders('panda/src/audiotraits')
  2703. CopyAllHeaders('panda/src/audiotraits')
  2704. CopyAllHeaders('panda/src/distort')
  2705. CopyAllHeaders('panda/src/downloadertools')
  2706. CopyAllHeaders('panda/src/windisplay')
  2707. CopyAllHeaders('panda/src/dxgsg9')
  2708. CopyAllHeaders('panda/metalibs/pandadx9')
  2709. if not PkgSkip("EGG"):
  2710. CopyAllHeaders('panda/src/egg')
  2711. CopyAllHeaders('panda/src/egg2pg')
  2712. CopyAllHeaders('panda/src/framework')
  2713. CopyAllHeaders('panda/metalibs/pandafx')
  2714. CopyAllHeaders('panda/src/glstuff')
  2715. CopyAllHeaders('panda/src/glgsg')
  2716. CopyAllHeaders('panda/src/glesgsg')
  2717. CopyAllHeaders('panda/src/gles2gsg')
  2718. if not PkgSkip("EGG"):
  2719. CopyAllHeaders('panda/metalibs/pandaegg')
  2720. if GetTarget() == 'windows':
  2721. CopyAllHeaders('panda/src/wgldisplay')
  2722. elif GetTarget() == 'darwin':
  2723. CopyAllHeaders('panda/src/osxdisplay')
  2724. CopyAllHeaders('panda/src/cocoadisplay')
  2725. elif GetTarget() == 'android':
  2726. CopyAllHeaders('panda/src/android')
  2727. CopyAllHeaders('panda/src/androiddisplay')
  2728. else:
  2729. CopyAllHeaders('panda/src/x11display')
  2730. CopyAllHeaders('panda/src/glxdisplay')
  2731. CopyAllHeaders('panda/src/egldisplay')
  2732. CopyAllHeaders('panda/src/vulkandisplay')
  2733. CopyAllHeaders('panda/metalibs/pandagl')
  2734. CopyAllHeaders('panda/metalibs/pandagles')
  2735. CopyAllHeaders('panda/metalibs/pandagles2')
  2736. CopyAllHeaders('panda/metalibs/pandaphysics')
  2737. CopyAllHeaders('panda/src/testbed')
  2738. if (PkgSkip("PHYSX")==0):
  2739. CopyAllHeaders('panda/src/physx')
  2740. CopyAllHeaders('panda/metalibs/pandaphysx')
  2741. if (PkgSkip("BULLET")==0):
  2742. CopyAllHeaders('panda/src/bullet')
  2743. CopyAllHeaders('panda/metalibs/pandabullet')
  2744. if (PkgSkip("SPEEDTREE")==0):
  2745. CopyAllHeaders('panda/src/speedtree')
  2746. if (PkgSkip("DIRECT")==0):
  2747. CopyAllHeaders('direct/src/directbase')
  2748. CopyAllHeaders('direct/src/dcparser')
  2749. CopyAllHeaders('direct/src/deadrec')
  2750. CopyAllHeaders('direct/src/distributed')
  2751. CopyAllHeaders('direct/src/interval')
  2752. CopyAllHeaders('direct/src/showbase')
  2753. CopyAllHeaders('direct/metalibs/direct')
  2754. CopyAllHeaders('direct/src/dcparse')
  2755. if (RUNTIME or RTDIST):
  2756. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  2757. if (RUNTIME):
  2758. CopyAllHeaders('direct/src/plugin_npapi')
  2759. CopyAllHeaders('direct/src/plugin_standalone')
  2760. if (PkgSkip("PANDATOOL")==0):
  2761. CopyAllHeaders('pandatool/src/pandatoolbase')
  2762. CopyAllHeaders('pandatool/src/converter')
  2763. CopyAllHeaders('pandatool/src/progbase')
  2764. CopyAllHeaders('pandatool/src/eggbase')
  2765. CopyAllHeaders('pandatool/src/bam')
  2766. CopyAllHeaders('pandatool/src/cvscopy')
  2767. CopyAllHeaders('pandatool/src/daeegg')
  2768. CopyAllHeaders('pandatool/src/daeprogs')
  2769. CopyAllHeaders('pandatool/src/dxf')
  2770. CopyAllHeaders('pandatool/src/dxfegg')
  2771. CopyAllHeaders('pandatool/src/dxfprogs')
  2772. CopyAllHeaders('pandatool/src/palettizer')
  2773. CopyAllHeaders('pandatool/src/egg-mkfont')
  2774. CopyAllHeaders('pandatool/src/eggcharbase')
  2775. CopyAllHeaders('pandatool/src/egg-optchar')
  2776. CopyAllHeaders('pandatool/src/egg-palettize')
  2777. CopyAllHeaders('pandatool/src/egg-qtess')
  2778. CopyAllHeaders('pandatool/src/eggprogs')
  2779. CopyAllHeaders('pandatool/src/flt')
  2780. CopyAllHeaders('pandatool/src/fltegg')
  2781. CopyAllHeaders('pandatool/src/fltprogs')
  2782. CopyAllHeaders('pandatool/src/imagebase')
  2783. CopyAllHeaders('pandatool/src/imageprogs')
  2784. CopyAllHeaders('pandatool/src/pfmprogs')
  2785. CopyAllHeaders('pandatool/src/lwo')
  2786. CopyAllHeaders('pandatool/src/lwoegg')
  2787. CopyAllHeaders('pandatool/src/lwoprogs')
  2788. CopyAllHeaders('pandatool/src/maya')
  2789. CopyAllHeaders('pandatool/src/mayaegg')
  2790. CopyAllHeaders('pandatool/src/maxegg')
  2791. CopyAllHeaders('pandatool/src/maxprogs')
  2792. CopyAllHeaders('pandatool/src/objegg')
  2793. CopyAllHeaders('pandatool/src/objprogs')
  2794. CopyAllHeaders('pandatool/src/vrml')
  2795. CopyAllHeaders('pandatool/src/vrmlegg')
  2796. CopyAllHeaders('pandatool/src/xfile')
  2797. CopyAllHeaders('pandatool/src/xfileegg')
  2798. CopyAllHeaders('pandatool/src/ptloader')
  2799. CopyAllHeaders('pandatool/src/miscprogs')
  2800. CopyAllHeaders('pandatool/src/pstatserver')
  2801. CopyAllHeaders('pandatool/src/softprogs')
  2802. CopyAllHeaders('pandatool/src/text-stats')
  2803. CopyAllHeaders('pandatool/src/vrmlprogs')
  2804. CopyAllHeaders('pandatool/src/win-stats')
  2805. CopyAllHeaders('pandatool/src/xfileprogs')
  2806. if (PkgSkip("CONTRIB")==0):
  2807. CopyAllHeaders('contrib/src/contribbase')
  2808. CopyAllHeaders('contrib/src/ai')
  2809. ########################################################################
  2810. #
  2811. # Copy Java files, if applicable
  2812. #
  2813. ########################################################################
  2814. if GetTarget() == 'android':
  2815. CopyAllJavaSources('panda/src/android')
  2816. ########################################################################
  2817. #
  2818. # These definitions are syntactic shorthand. They make it easy
  2819. # to link with the usual libraries without listing them all.
  2820. #
  2821. ########################################################################
  2822. COMMON_DTOOL_LIBS=[
  2823. 'libp3dtool.dll',
  2824. 'libp3dtoolconfig.dll',
  2825. ]
  2826. COMMON_PANDA_LIBS=[
  2827. 'libpanda.dll',
  2828. 'libpandaexpress.dll'
  2829. ] + COMMON_DTOOL_LIBS
  2830. COMMON_EGG2X_LIBS=[
  2831. 'libp3eggbase.lib',
  2832. 'libp3progbase.lib',
  2833. 'libp3converter.lib',
  2834. 'libp3pandatoolbase.lib',
  2835. 'libpandaegg.dll',
  2836. ] + COMMON_PANDA_LIBS
  2837. ########################################################################
  2838. #
  2839. # This section contains a list of all the files that need to be compiled.
  2840. #
  2841. ########################################################################
  2842. print("Generating dependencies...")
  2843. sys.stdout.flush()
  2844. #
  2845. # Compile Panda icon resource file.
  2846. # We do it first because we need it at
  2847. # the time we compile an executable.
  2848. #
  2849. if GetTarget() == 'windows':
  2850. OPTS=['DIR:panda/src/configfiles']
  2851. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  2852. #
  2853. # DIRECTORY: dtool/src/dtoolbase/
  2854. #
  2855. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  2856. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  2857. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  2858. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  2859. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  2860. #
  2861. # DIRECTORY: dtool/src/dtoolutil/
  2862. #
  2863. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  2864. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  2865. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  2866. if GetTarget() == 'darwin':
  2867. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  2868. #
  2869. # DIRECTORY: dtool/metalibs/dtool/
  2870. #
  2871. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  2872. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  2873. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  2874. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  2875. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  2876. if GetTarget() == 'darwin':
  2877. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  2878. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  2879. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  2880. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  2881. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  2882. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  2883. #
  2884. # DIRECTORY: dtool/src/cppparser/
  2885. #
  2886. if (not RUNTIME):
  2887. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  2888. CreateFile(GetOutputDir()+"/include/cppBison.h")
  2889. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  2890. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  2891. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  2892. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  2893. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  2894. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  2895. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  2896. #
  2897. # DIRECTORY: dtool/src/prc/
  2898. #
  2899. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  2900. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  2901. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  2902. #
  2903. # DIRECTORY: dtool/src/dconfig/
  2904. #
  2905. OPTS=['DIR:dtool/src/dconfig', 'BUILDING:DTOOLCONFIG']
  2906. TargetAdd('p3dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  2907. #
  2908. # DIRECTORY: dtool/metalibs/dtoolconfig/
  2909. #
  2910. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  2911. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  2912. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  2913. TargetAdd('libp3dtoolconfig.dll', input='p3dconfig_composite1.obj')
  2914. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  2915. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  2916. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  2917. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  2918. #
  2919. # DIRECTORY: dtool/src/interrogatedb/
  2920. #
  2921. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB', 'PYTHON']
  2922. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  2923. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  2924. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  2925. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  2926. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  2927. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  2928. TargetAdd('libp3interrogatedb.dll', opts=['PYTHON'])
  2929. if not PkgSkip("PYTHON"):
  2930. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  2931. # stuff, so it has been renamed appropriately.
  2932. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'PYTHON']
  2933. TargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  2934. TargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  2935. TargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  2936. TargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  2937. TargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  2938. TargetAdd('interrogatedb.pyd', opts=['PYTHON'])
  2939. #
  2940. # DIRECTORY: dtool/src/pystub/
  2941. #
  2942. if not RUNTIME and not RTDIST:
  2943. OPTS=['DIR:dtool/src/pystub']
  2944. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  2945. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  2946. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  2947. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  2948. #
  2949. # DIRECTORY: dtool/src/interrogate/
  2950. #
  2951. if (not RUNTIME):
  2952. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  2953. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  2954. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  2955. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  2956. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  2957. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  2958. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  2959. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  2960. TargetAdd('interrogate.exe', input='libp3pystub.lib')
  2961. TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2962. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  2963. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  2964. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  2965. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  2966. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  2967. TargetAdd('interrogate_module.exe', input='libp3pystub.lib')
  2968. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2969. if (not RTDIST):
  2970. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  2971. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  2972. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  2973. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  2974. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  2975. TargetAdd('parse_file.exe', input='libp3pystub.lib')
  2976. TargetAdd('parse_file.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2977. #
  2978. # DIRECTORY: dtool/src/prckeys/
  2979. #
  2980. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  2981. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  2982. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  2983. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  2984. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  2985. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2986. #
  2987. # DIRECTORY: dtool/src/test_interrogate/
  2988. #
  2989. if (not RTDIST and not RUNTIME):
  2990. OPTS=['DIR:dtool/src/test_interrogate']
  2991. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  2992. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  2993. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  2994. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  2995. TargetAdd('test_interrogate.exe', input='libp3pystub.lib')
  2996. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  2997. #
  2998. # DIRECTORY: dtool/src/dtoolbase/
  2999. #
  3000. OPTS=['DIR:dtool/src/dtoolbase', 'PYTHON']
  3001. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3002. IGATEFILES += [
  3003. "typeHandle.h",
  3004. "typeHandle_ext.h",
  3005. "typeRegistry.h",
  3006. "typedObject.h",
  3007. "neverFreeMemory.h",
  3008. ]
  3009. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3010. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3011. TargetAdd('libp3dtoolbase_igate.obj', input='libp3dtoolbase.in', opts=["DEPENDENCYONLY"])
  3012. TargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3013. #
  3014. # DIRECTORY: dtool/src/dtoolutil/
  3015. #
  3016. OPTS=['DIR:dtool/src/dtoolutil', 'PYTHON']
  3017. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3018. IGATEFILES += [
  3019. "config_dtoolutil.h",
  3020. "pandaSystem.h",
  3021. "dSearchPath.h",
  3022. "executionEnvironment.h",
  3023. "textEncoder.h",
  3024. "filename.h",
  3025. "filename_ext.h",
  3026. "globPattern.h",
  3027. "globPattern_ext.h",
  3028. "pandaFileStream.h",
  3029. "lineStream.h",
  3030. ]
  3031. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3032. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3033. TargetAdd('libp3dtoolutil_igate.obj', input='libp3dtoolutil.in', opts=["DEPENDENCYONLY"])
  3034. TargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3035. #
  3036. # DIRECTORY: dtool/src/prc/
  3037. #
  3038. OPTS=['DIR:dtool/src/prc', 'PYTHON']
  3039. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3040. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3041. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3042. TargetAdd('libp3prc_igate.obj', input='libp3prc.in', opts=["DEPENDENCYONLY"])
  3043. TargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3044. #
  3045. # DIRECTORY: panda/src/pandabase/
  3046. #
  3047. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3048. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3049. #
  3050. # DIRECTORY: panda/src/express/
  3051. #
  3052. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3053. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3054. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3055. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB', 'PYTHON']
  3056. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3057. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3058. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3059. TargetAdd('libp3express_igate.obj', input='libp3express.in', opts=["DEPENDENCYONLY"])
  3060. TargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3061. #
  3062. # DIRECTORY: panda/src/downloader/
  3063. #
  3064. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3065. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3066. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3067. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB', 'PYTHON']
  3068. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3069. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3070. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3071. TargetAdd('libp3downloader_igate.obj', input='libp3downloader.in', opts=["DEPENDENCYONLY"])
  3072. TargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3073. #
  3074. # DIRECTORY: panda/metalibs/pandaexpress/
  3075. #
  3076. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3077. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3078. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3079. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3080. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3081. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3082. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3083. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3084. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3085. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER'])
  3086. #
  3087. # DIRECTORY: panda/src/pipeline/
  3088. #
  3089. if (not RUNTIME):
  3090. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3091. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3092. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3093. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3094. OPTS=['DIR:panda/src/pipeline', 'PYTHON']
  3095. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3096. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3097. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3098. TargetAdd('libp3pipeline_igate.obj', input='libp3pipeline.in', opts=["DEPENDENCYONLY"])
  3099. TargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3100. #
  3101. # DIRECTORY: panda/src/linmath/
  3102. #
  3103. if (not RUNTIME):
  3104. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3105. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3106. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3107. OPTS=['DIR:panda/src/linmath', 'PYTHON']
  3108. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3109. for ifile in IGATEFILES[:]:
  3110. if "_src." in ifile:
  3111. IGATEFILES.remove(ifile)
  3112. IGATEFILES.remove('cast_to_double.h')
  3113. IGATEFILES.remove('lmat_ops.h')
  3114. IGATEFILES.remove('cast_to_float.h')
  3115. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3116. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3117. TargetAdd('libp3linmath_igate.obj', input='libp3linmath.in', opts=["DEPENDENCYONLY"])
  3118. #
  3119. # DIRECTORY: panda/src/putil/
  3120. #
  3121. if (not RUNTIME):
  3122. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3123. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3124. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3125. OPTS=['DIR:panda/src/putil', 'ZLIB', 'PYTHON']
  3126. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3127. IGATEFILES.remove("test_bam.h")
  3128. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3129. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3130. TargetAdd('libp3putil_igate.obj', input='libp3putil.in', opts=["DEPENDENCYONLY"])
  3131. TargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3132. #
  3133. # DIRECTORY: panda/src/audio/
  3134. #
  3135. if (not RUNTIME):
  3136. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3137. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3138. OPTS=['DIR:panda/src/audio', 'PYTHON']
  3139. IGATEFILES=["audio.h"]
  3140. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3141. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3142. TargetAdd('libp3audio_igate.obj', input='libp3audio.in', opts=["DEPENDENCYONLY"])
  3143. #
  3144. # DIRECTORY: panda/src/event/
  3145. #
  3146. if (not RUNTIME):
  3147. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3148. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3149. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3150. OPTS=['DIR:panda/src/event', 'PYTHON']
  3151. TargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3152. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3153. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3154. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3155. TargetAdd('libp3event_igate.obj', input='libp3event.in', opts=["DEPENDENCYONLY"])
  3156. #
  3157. # DIRECTORY: panda/src/mathutil/
  3158. #
  3159. if (not RUNTIME):
  3160. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3161. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3162. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3163. OPTS=['DIR:panda/src/mathutil', 'FFTW', 'PYTHON']
  3164. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3165. for ifile in IGATEFILES[:]:
  3166. if "_src." in ifile:
  3167. IGATEFILES.remove(ifile)
  3168. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3169. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3170. TargetAdd('libp3mathutil_igate.obj', input='libp3mathutil.in', opts=["DEPENDENCYONLY"])
  3171. #
  3172. # DIRECTORY: panda/src/gsgbase/
  3173. #
  3174. if (not RUNTIME):
  3175. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3176. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3177. OPTS=['DIR:panda/src/gsgbase', 'PYTHON']
  3178. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3179. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3180. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3181. TargetAdd('libp3gsgbase_igate.obj', input='libp3gsgbase.in', opts=["DEPENDENCYONLY"])
  3182. #
  3183. # DIRECTORY: panda/src/pnmimage/
  3184. #
  3185. if (not RUNTIME):
  3186. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3187. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3188. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3189. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3190. OPTS=['DIR:panda/src/pnmimage', 'ZLIB', 'PYTHON']
  3191. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3192. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3193. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3194. TargetAdd('libp3pnmimage_igate.obj', input='libp3pnmimage.in', opts=["DEPENDENCYONLY"])
  3195. TargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3196. #
  3197. # DIRECTORY: panda/src/nativenet/
  3198. #
  3199. if (not RUNTIME):
  3200. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3201. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3202. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'PYTHON']
  3203. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3204. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3205. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3206. TargetAdd('libp3nativenet_igate.obj', input='libp3nativenet.in', opts=["DEPENDENCYONLY"])
  3207. #
  3208. # DIRECTORY: panda/src/net/
  3209. #
  3210. if (not RUNTIME):
  3211. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3212. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3213. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3214. OPTS=['DIR:panda/src/net', 'PYTHON']
  3215. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3216. IGATEFILES.remove("datagram_ui.h")
  3217. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3218. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3219. TargetAdd('libp3net_igate.obj', input='libp3net.in', opts=["DEPENDENCYONLY"])
  3220. #
  3221. # DIRECTORY: panda/src/pstatclient/
  3222. #
  3223. if (not RUNTIME):
  3224. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3225. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3226. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3227. OPTS=['DIR:panda/src/pstatclient', 'PYTHON']
  3228. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3229. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3230. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3231. TargetAdd('libp3pstatclient_igate.obj', input='libp3pstatclient.in', opts=["DEPENDENCYONLY"])
  3232. #
  3233. # DIRECTORY: panda/src/gobj/
  3234. #
  3235. if (not RUNTIME):
  3236. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH', 'VULKAN']
  3237. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3238. TargetAdd('p3gobj_composite2.obj', opts=OPTS, input='p3gobj_composite2.cxx')
  3239. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH', 'PYTHON']
  3240. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3241. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3242. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3243. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3244. TargetAdd('libp3gobj_igate.obj', input='libp3gobj.in', opts=["DEPENDENCYONLY"])
  3245. TargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3246. #
  3247. # DIRECTORY: panda/src/pgraphnodes/
  3248. #
  3249. if (not RUNTIME):
  3250. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3251. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3252. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3253. OPTS=['DIR:panda/src/pgraphnodes', 'PYTHON']
  3254. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3255. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3256. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3257. TargetAdd('libp3pgraphnodes_igate.obj', input='libp3pgraphnodes.in', opts=["DEPENDENCYONLY"])
  3258. #
  3259. # DIRECTORY: panda/src/pgraph/
  3260. #
  3261. if (not RUNTIME):
  3262. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3263. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3264. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3265. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3266. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3267. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3268. OPTS=['DIR:panda/src/pgraph', 'PYTHON']
  3269. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3270. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3271. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3272. TargetAdd('libp3pgraph_igate.obj', input='libp3pgraph.in', opts=["DEPENDENCYONLY","BIGOBJ"])
  3273. TargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3274. #
  3275. # DIRECTORY: panda/src/cull/
  3276. #
  3277. if (not RUNTIME):
  3278. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3279. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3280. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3281. OPTS=['DIR:panda/src/cull', 'PYTHON']
  3282. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3283. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3284. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3285. TargetAdd('libp3cull_igate.obj', input='libp3cull.in', opts=["DEPENDENCYONLY"])
  3286. #
  3287. # DIRECTORY: panda/src/chan/
  3288. #
  3289. if (not RUNTIME):
  3290. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3291. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3292. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3293. OPTS=['DIR:panda/src/chan', 'PYTHON']
  3294. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3295. IGATEFILES.remove('movingPart.h')
  3296. IGATEFILES.remove('animChannelFixed.h')
  3297. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3298. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3299. TargetAdd('libp3chan_igate.obj', input='libp3chan.in', opts=["DEPENDENCYONLY"])
  3300. # DIRECTORY: panda/src/char/
  3301. #
  3302. if (not RUNTIME):
  3303. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3304. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3305. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3306. OPTS=['DIR:panda/src/char', 'PYTHON']
  3307. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3308. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3309. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3310. TargetAdd('libp3char_igate.obj', input='libp3char.in', opts=["DEPENDENCYONLY"])
  3311. #
  3312. # DIRECTORY: panda/src/dgraph/
  3313. #
  3314. if (not RUNTIME):
  3315. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3316. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3317. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3318. OPTS=['DIR:panda/src/dgraph', 'PYTHON']
  3319. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3320. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3321. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3322. TargetAdd('libp3dgraph_igate.obj', input='libp3dgraph.in', opts=["DEPENDENCYONLY"])
  3323. #
  3324. # DIRECTORY: panda/src/display/
  3325. #
  3326. if (not RUNTIME):
  3327. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA']
  3328. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3329. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3330. OPTS=['DIR:panda/src/display', 'PYTHON']
  3331. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3332. IGATEFILES.remove("renderBuffer.h")
  3333. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3334. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3335. TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"])
  3336. TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx')
  3337. TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx')
  3338. TargetAdd('p3display_pythonGraphicsWindowProc.obj', opts=OPTS, input='pythonGraphicsWindowProc.cxx')
  3339. if RTDIST and GetTarget() == 'darwin':
  3340. OPTS=['DIR:panda/src/display']
  3341. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3342. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3343. #
  3344. # DIRECTORY: panda/src/device/
  3345. #
  3346. if (not RUNTIME):
  3347. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3348. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3349. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3350. OPTS=['DIR:panda/src/device', 'PYTHON']
  3351. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3352. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3353. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3354. TargetAdd('libp3device_igate.obj', input='libp3device.in', opts=["DEPENDENCYONLY"])
  3355. #
  3356. # DIRECTORY: panda/src/pnmtext/
  3357. #
  3358. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3359. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3360. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3361. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE', 'PYTHON']
  3362. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3363. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3364. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3365. TargetAdd('libp3pnmtext_igate.obj', input='libp3pnmtext.in', opts=["DEPENDENCYONLY"])
  3366. #
  3367. # DIRECTORY: panda/src/text/
  3368. #
  3369. if (not RUNTIME):
  3370. if not PkgSkip("HARFBUZZ"):
  3371. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3372. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3373. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3374. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3375. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE', 'PYTHON']
  3376. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3377. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3378. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3379. TargetAdd('libp3text_igate.obj', input='libp3text.in', opts=["DEPENDENCYONLY"])
  3380. #
  3381. # DIRECTORY: panda/src/movies/
  3382. #
  3383. if (not RUNTIME):
  3384. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3385. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3386. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS', 'PYTHON']
  3387. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3388. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3389. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3390. TargetAdd('libp3movies_igate.obj', input='libp3movies.in', opts=["DEPENDENCYONLY"])
  3391. #
  3392. # DIRECTORY: panda/src/grutil/
  3393. #
  3394. if (not RUNTIME):
  3395. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3396. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3397. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3398. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3399. OPTS=['DIR:panda/src/grutil', 'PYTHON']
  3400. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3401. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3402. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3403. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3404. TargetAdd('libp3grutil_igate.obj', input='libp3grutil.in', opts=["DEPENDENCYONLY"])
  3405. #
  3406. # DIRECTORY: panda/src/tform/
  3407. #
  3408. if (not RUNTIME):
  3409. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3410. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3411. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3412. OPTS=['DIR:panda/src/tform', 'PYTHON']
  3413. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3414. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3415. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3416. TargetAdd('libp3tform_igate.obj', input='libp3tform.in', opts=["DEPENDENCYONLY"])
  3417. #
  3418. # DIRECTORY: panda/src/collide/
  3419. #
  3420. if (not RUNTIME):
  3421. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3422. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3423. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3424. OPTS=['DIR:panda/src/collide', 'PYTHON']
  3425. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3426. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3427. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3428. TargetAdd('libp3collide_igate.obj', input='libp3collide.in', opts=["DEPENDENCYONLY"])
  3429. #
  3430. # DIRECTORY: panda/src/parametrics/
  3431. #
  3432. if (not RUNTIME):
  3433. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3434. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3435. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3436. OPTS=['DIR:panda/src/parametrics', 'PYTHON']
  3437. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3438. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3439. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3440. TargetAdd('libp3parametrics_igate.obj', input='libp3parametrics.in', opts=["DEPENDENCYONLY"])
  3441. #
  3442. # DIRECTORY: panda/src/pgui/
  3443. #
  3444. if (not RUNTIME):
  3445. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3446. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3447. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3448. OPTS=['DIR:panda/src/pgui', 'PYTHON']
  3449. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3450. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3451. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3452. TargetAdd('libp3pgui_igate.obj', input='libp3pgui.in', opts=["DEPENDENCYONLY"])
  3453. #
  3454. # DIRECTORY: panda/src/pnmimagetypes/
  3455. #
  3456. if (not RUNTIME):
  3457. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3458. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3459. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3460. #
  3461. # DIRECTORY: panda/src/recorder/
  3462. #
  3463. if (not RUNTIME):
  3464. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3465. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3466. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3467. OPTS=['DIR:panda/src/recorder', 'PYTHON']
  3468. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3469. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3470. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3471. TargetAdd('libp3recorder_igate.obj', input='libp3recorder.in', opts=["DEPENDENCYONLY"])
  3472. #
  3473. # DIRECTORY: panda/src/dxml/
  3474. #
  3475. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3476. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3477. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3478. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3479. if (not RUNTIME):
  3480. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3481. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3482. OPTS=['DIR:panda/src/dxml', 'TINYXML', 'PYTHON']
  3483. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3484. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3485. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3486. TargetAdd('libp3dxml_igate.obj', input='libp3dxml.in', opts=["DEPENDENCYONLY"])
  3487. #
  3488. # DIRECTORY: panda/metalibs/panda/
  3489. #
  3490. if (not RUNTIME):
  3491. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3492. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3493. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI']
  3494. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3495. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3496. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3497. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3498. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3499. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3500. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3501. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3502. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3503. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3504. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3505. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3506. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3507. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3508. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3509. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3510. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3511. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3512. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3513. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3514. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3515. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3516. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3517. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3518. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3519. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3520. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3521. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3522. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3523. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3524. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3525. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3526. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3527. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3528. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3529. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3530. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3531. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3532. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3533. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3534. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3535. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3536. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3537. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3538. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3539. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3540. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3541. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3542. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3543. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3544. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3545. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3546. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3547. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3548. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3549. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3550. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3551. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3552. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3553. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3554. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3555. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3556. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3557. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3558. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3559. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3560. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3561. if PkgSkip("FREETYPE")==0:
  3562. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3563. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3564. TargetAdd('libpanda.dll', opts=OPTS)
  3565. TargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3566. TargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3567. TargetAdd('core_module.obj', input='libp3prc.in')
  3568. TargetAdd('core_module.obj', input='libp3downloader.in')
  3569. TargetAdd('core_module.obj', input='libp3express.in')
  3570. TargetAdd('core_module.obj', input='libp3recorder.in')
  3571. TargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3572. TargetAdd('core_module.obj', input='libp3pgraph.in')
  3573. TargetAdd('core_module.obj', input='libp3cull.in')
  3574. TargetAdd('core_module.obj', input='libp3grutil.in')
  3575. TargetAdd('core_module.obj', input='libp3chan.in')
  3576. TargetAdd('core_module.obj', input='libp3pstatclient.in')
  3577. TargetAdd('core_module.obj', input='libp3char.in')
  3578. TargetAdd('core_module.obj', input='libp3collide.in')
  3579. TargetAdd('core_module.obj', input='libp3device.in')
  3580. TargetAdd('core_module.obj', input='libp3dgraph.in')
  3581. TargetAdd('core_module.obj', input='libp3display.in')
  3582. TargetAdd('core_module.obj', input='libp3pipeline.in')
  3583. TargetAdd('core_module.obj', input='libp3event.in')
  3584. TargetAdd('core_module.obj', input='libp3gobj.in')
  3585. TargetAdd('core_module.obj', input='libp3gsgbase.in')
  3586. TargetAdd('core_module.obj', input='libp3linmath.in')
  3587. TargetAdd('core_module.obj', input='libp3mathutil.in')
  3588. TargetAdd('core_module.obj', input='libp3parametrics.in')
  3589. TargetAdd('core_module.obj', input='libp3pnmimage.in')
  3590. TargetAdd('core_module.obj', input='libp3text.in')
  3591. TargetAdd('core_module.obj', input='libp3tform.in')
  3592. TargetAdd('core_module.obj', input='libp3putil.in')
  3593. TargetAdd('core_module.obj', input='libp3audio.in')
  3594. TargetAdd('core_module.obj', input='libp3nativenet.in')
  3595. TargetAdd('core_module.obj', input='libp3net.in')
  3596. TargetAdd('core_module.obj', input='libp3pgui.in')
  3597. TargetAdd('core_module.obj', input='libp3movies.in')
  3598. TargetAdd('core_module.obj', input='libp3dxml.in')
  3599. if PkgSkip("FREETYPE")==0:
  3600. TargetAdd('core_module.obj', input='libp3pnmtext.in')
  3601. TargetAdd('core_module.obj', opts=['PYTHON'])
  3602. TargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3603. TargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3604. TargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3605. TargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3606. TargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3607. TargetAdd('core.pyd', input='libp3prc_igate.obj')
  3608. TargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3609. TargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3610. TargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3611. TargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3612. TargetAdd('core.pyd', input='libp3express_igate.obj')
  3613. TargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3614. TargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3615. TargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3616. TargetAdd('core.pyd', input='libp3movies_igate.obj')
  3617. TargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3618. TargetAdd('core.pyd', input='libp3chan_igate.obj')
  3619. TargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3620. TargetAdd('core.pyd', input='libp3char_igate.obj')
  3621. TargetAdd('core.pyd', input='libp3collide_igate.obj')
  3622. TargetAdd('core.pyd', input='libp3device_igate.obj')
  3623. TargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3624. TargetAdd('core.pyd', input='libp3display_igate.obj')
  3625. TargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3626. TargetAdd('core.pyd', input='libp3event_igate.obj')
  3627. TargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3628. TargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3629. TargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3630. TargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3631. TargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3632. TargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3633. TargetAdd('core.pyd', input='libp3text_igate.obj')
  3634. TargetAdd('core.pyd', input='libp3tform_igate.obj')
  3635. TargetAdd('core.pyd', input='libp3putil_igate.obj')
  3636. TargetAdd('core.pyd', input='libp3audio_igate.obj')
  3637. TargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3638. TargetAdd('core.pyd', input='libp3net_igate.obj')
  3639. TargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3640. TargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3641. if PkgSkip("FREETYPE")==0:
  3642. TargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3643. TargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3644. TargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3645. TargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3646. TargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3647. TargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3648. TargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3649. TargetAdd('core.pyd', input='p3display_graphicsStateGuardian_ext.obj')
  3650. TargetAdd('core.pyd', input='p3display_graphicsWindow_ext.obj')
  3651. TargetAdd('core.pyd', input='p3display_pythonGraphicsWindowProc.obj')
  3652. TargetAdd('core.pyd', input='core_module.obj')
  3653. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3654. TargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3655. TargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3656. TargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3657. TargetAdd('core.pyd', opts=['PYTHON', 'WINSOCK2'])
  3658. #
  3659. # DIRECTORY: panda/src/vision/
  3660. #
  3661. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3662. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3663. if not PkgSkip("FFMPEG"):
  3664. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3665. if not PkgSkip("OPENCV"):
  3666. DefSymbol("OPENCV", "HAVE_OPENCV")
  3667. if OPENCV_VER_23:
  3668. DefSymbol("OPENCV", "OPENCV_VER_23")
  3669. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3670. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3671. 'dtool_have_ffmpeg.dat',
  3672. 'dtool_have_opencv.dat',
  3673. 'dtool_have_directcam.dat',
  3674. ])
  3675. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3676. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3677. TargetAdd('libp3vision.dll', opts=OPTS)
  3678. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS', 'PYTHON']
  3679. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3680. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3681. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3682. TargetAdd('libp3vision_igate.obj', input='libp3vision.in', opts=["DEPENDENCYONLY"])
  3683. TargetAdd('vision_module.obj', input='libp3vision.in')
  3684. TargetAdd('vision_module.obj', opts=OPTS)
  3685. TargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3686. TargetAdd('vision.pyd', input='vision_module.obj')
  3687. TargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3688. TargetAdd('vision.pyd', input='libp3vision.dll')
  3689. TargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3690. TargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3691. TargetAdd('vision.pyd', opts=['PYTHON'])
  3692. #
  3693. # DIRECTORY: panda/src/rocket/
  3694. #
  3695. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3696. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3697. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3698. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3699. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3700. TargetAdd('libp3rocket.dll', opts=OPTS)
  3701. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'PYTHON']
  3702. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3703. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3704. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3705. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3706. TargetAdd('libp3rocket_igate.obj', input='libp3rocket.in', opts=["DEPENDENCYONLY"])
  3707. TargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3708. TargetAdd('rocket_module.obj', input='libp3rocket.in')
  3709. TargetAdd('rocket_module.obj', opts=OPTS)
  3710. TargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  3711. TargetAdd('rocket.pyd', input='rocket_module.obj')
  3712. TargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  3713. TargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  3714. TargetAdd('rocket.pyd', input='libp3rocket.dll')
  3715. TargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  3716. TargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  3717. TargetAdd('rocket.pyd', opts=['PYTHON', 'ROCKET'])
  3718. #
  3719. # DIRECTORY: panda/src/p3awesomium
  3720. #
  3721. if PkgSkip("AWESOMIUM") == 0 and not RUNTIME:
  3722. OPTS=['DIR:panda/src/awesomium', 'BUILDING:PANDAAWESOMIUM', 'AWESOMIUM']
  3723. TargetAdd('pandaawesomium_composite1.obj', opts=OPTS, input='pandaawesomium_composite1.cxx')
  3724. TargetAdd('libp3awesomium.dll', input='pandaawesomium_composite1.obj')
  3725. TargetAdd('libp3awesomium.dll', input=COMMON_PANDA_LIBS)
  3726. TargetAdd('libp3awesomium.dll', opts=OPTS)
  3727. OPTS=['DIR:panda/src/awesomium', 'AWESOMIUM', 'PYTHON']
  3728. IGATEFILES=GetDirectoryContents('panda/src/awesomium', ["*.h", "*_composite1.cxx"])
  3729. TargetAdd('libp3awesomium.in', opts=OPTS, input=IGATEFILES)
  3730. TargetAdd('libp3awesomium.in', opts=['IMOD:panda3d.awesomium', 'ILIB:libp3awesomium', 'SRCDIR:panda/src/awesomium'])
  3731. TargetAdd('libp3awesomium_igate.obj', input='libp3awesomium.in', opts=["DEPENDENCYONLY"])
  3732. TargetAdd('awesomium_module.obj', input='libp3awesomium.in')
  3733. TargetAdd('awesomium_module.obj', opts=OPTS)
  3734. TargetAdd('awesomium_module.obj', opts=['IMOD:panda3d.awesomium', 'ILIB:awesomium', 'IMPORT:panda3d.core'])
  3735. TargetAdd('awesomium.pyd', input='awesomium_module.obj')
  3736. TargetAdd('awesomium.pyd', input='libp3awesomium_igate.obj')
  3737. TargetAdd('awesomium.pyd', input='libp3awesomium.dll')
  3738. TargetAdd('awesomium.pyd', input='libp3interrogatedb.dll')
  3739. TargetAdd('awesomium.pyd', input=COMMON_PANDA_LIBS)
  3740. TargetAdd('awesomium.pyd', opts=['PYTHON'])
  3741. #
  3742. # DIRECTORY: panda/src/p3skel
  3743. #
  3744. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3745. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  3746. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  3747. OPTS=['DIR:panda/src/skel', 'ADVAPI', 'PYTHON']
  3748. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  3749. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  3750. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  3751. TargetAdd('libp3skel_igate.obj', input='libp3skel.in', opts=["DEPENDENCYONLY"])
  3752. #
  3753. # DIRECTORY: panda/src/p3skel
  3754. #
  3755. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  3756. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  3757. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  3758. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  3759. TargetAdd('libpandaskel.dll', opts=OPTS)
  3760. OPTS=['PYTHON']
  3761. TargetAdd('skel_module.obj', input='libp3skel.in')
  3762. TargetAdd('skel_module.obj', opts=OPTS)
  3763. TargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  3764. TargetAdd('skel.pyd', input='skel_module.obj')
  3765. TargetAdd('skel.pyd', input='libp3skel_igate.obj')
  3766. TargetAdd('skel.pyd', input='libpandaskel.dll')
  3767. TargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  3768. TargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  3769. TargetAdd('skel.pyd', opts=['PYTHON'])
  3770. #
  3771. # DIRECTORY: panda/src/distort/
  3772. #
  3773. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3774. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  3775. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  3776. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3777. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  3778. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  3779. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  3780. TargetAdd('libp3distort_igate.obj', input='libp3distort.in', opts=["DEPENDENCYONLY"])
  3781. #
  3782. # DIRECTORY: panda/metalibs/pandafx/
  3783. #
  3784. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  3785. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  3786. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  3787. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  3788. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  3789. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  3790. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  3791. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG', 'PYTHON']
  3792. TargetAdd('fx_module.obj', input='libp3distort.in')
  3793. TargetAdd('fx_module.obj', opts=OPTS)
  3794. TargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  3795. TargetAdd('fx.pyd', input='fx_module.obj')
  3796. TargetAdd('fx.pyd', input='libp3distort_igate.obj')
  3797. TargetAdd('fx.pyd', input='libpandafx.dll')
  3798. TargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  3799. TargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  3800. TargetAdd('fx.pyd', opts=['PYTHON'])
  3801. #
  3802. # DIRECTORY: panda/src/vrpn/
  3803. #
  3804. if (PkgSkip("VRPN")==0 and not RUNTIME):
  3805. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  3806. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  3807. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  3808. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  3809. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  3810. OPTS=['DIR:panda/src/vrpn', 'VRPN', 'PYTHON']
  3811. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  3812. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  3813. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  3814. TargetAdd('libp3vrpn_igate.obj', input='libp3vrpn.in', opts=["DEPENDENCYONLY"])
  3815. TargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  3816. TargetAdd('vrpn_module.obj', opts=OPTS)
  3817. TargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  3818. TargetAdd('vrpn.pyd', input='vrpn_module.obj')
  3819. TargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  3820. TargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  3821. TargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  3822. TargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  3823. TargetAdd('vrpn.pyd', opts=['PYTHON'])
  3824. #
  3825. # DIRECTORY: panda/src/ffmpeg
  3826. #
  3827. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  3828. if not PkgSkip("SWSCALE"):
  3829. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  3830. if not PkgSkip("SWRESAMPLE"):
  3831. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  3832. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  3833. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  3834. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  3835. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  3836. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  3837. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  3838. #
  3839. # DIRECTORY: panda/src/audiotraits/
  3840. #
  3841. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  3842. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  3843. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  3844. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  3845. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  3846. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  3847. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  3848. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  3849. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  3850. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  3851. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  3852. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  3853. #
  3854. # DIRECTORY: panda/src/downloadertools/
  3855. #
  3856. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3857. OPTS=['DIR:panda/src/downloadertools', 'OPENSSL', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3858. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  3859. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  3860. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  3861. TargetAdd('apply_patch.exe', opts=OPTS)
  3862. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  3863. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  3864. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  3865. TargetAdd('build_patch.exe', opts=OPTS)
  3866. if not PkgSkip("ZLIB"):
  3867. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  3868. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  3869. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  3870. TargetAdd('check_adler.exe', opts=OPTS)
  3871. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  3872. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  3873. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  3874. TargetAdd('check_crc.exe', opts=OPTS)
  3875. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  3876. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  3877. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  3878. TargetAdd('check_md5.exe', opts=OPTS)
  3879. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  3880. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  3881. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  3882. TargetAdd('pdecrypt.exe', opts=OPTS)
  3883. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  3884. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  3885. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  3886. TargetAdd('pencrypt.exe', opts=OPTS)
  3887. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  3888. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  3889. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  3890. TargetAdd('show_ddb.exe', opts=OPTS)
  3891. #
  3892. # DIRECTORY: panda/src/downloadertools/
  3893. #
  3894. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  3895. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'OPENSSL', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  3896. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  3897. TargetAdd('multify.exe', input=['multify_multify.obj'])
  3898. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  3899. TargetAdd('multify.exe', opts=OPTS)
  3900. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  3901. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  3902. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  3903. TargetAdd('pzip.exe', opts=OPTS)
  3904. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  3905. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  3906. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  3907. TargetAdd('punzip.exe', opts=OPTS)
  3908. #
  3909. # DIRECTORY: panda/src/windisplay/
  3910. #
  3911. if (GetTarget() == 'windows' and not RUNTIME):
  3912. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  3913. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  3914. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  3915. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  3916. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  3917. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  3918. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  3919. #
  3920. # DIRECTORY: panda/metalibs/pandadx9/
  3921. #
  3922. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  3923. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3924. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  3925. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  3926. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  3927. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  3928. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  3929. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  3930. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  3931. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  3932. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  3933. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  3934. #
  3935. # DIRECTORY: panda/src/egg/
  3936. #
  3937. if not RUNTIME and not PkgSkip("EGG"):
  3938. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  3939. CreateFile(GetOutputDir()+"/include/parser.h")
  3940. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  3941. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  3942. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  3943. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  3944. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  3945. OPTS=['DIR:panda/src/egg', 'ZLIB', 'PYTHON']
  3946. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  3947. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  3948. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  3949. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  3950. TargetAdd('libp3egg_igate.obj', input='libp3egg.in', opts=["DEPENDENCYONLY"])
  3951. TargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  3952. #
  3953. # DIRECTORY: panda/src/egg2pg/
  3954. #
  3955. if not RUNTIME and not PkgSkip("EGG"):
  3956. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  3957. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  3958. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  3959. OPTS=['DIR:panda/src/egg2pg', 'PYTHON']
  3960. IGATEFILES=['load_egg_file.h']
  3961. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  3962. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  3963. TargetAdd('libp3egg2pg_igate.obj', input='libp3egg2pg.in', opts=["DEPENDENCYONLY"])
  3964. #
  3965. # DIRECTORY: panda/src/framework/
  3966. #
  3967. if (not RUNTIME):
  3968. deps = []
  3969. # Framework wants to link in a renderer when building statically, so tell it what is available.
  3970. if GetLinkAllStatic():
  3971. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  3972. if not PkgSkip("GL"):
  3973. DefSymbol("FRAMEWORK", "HAVE_GL")
  3974. if not PkgSkip("TINYDISPLAY"):
  3975. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  3976. if not PkgSkip("EGG"):
  3977. DefSymbol("FRAMEWORK", "HAVE_EGG")
  3978. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  3979. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  3980. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  3981. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  3982. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  3983. #
  3984. # DIRECTORY: panda/src/glgsg/
  3985. #
  3986. if (not RUNTIME and PkgSkip("GL")==0):
  3987. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  3988. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  3989. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  3990. #
  3991. # DIRECTORY: panda/src/glesgsg/
  3992. #
  3993. if (not RUNTIME and PkgSkip("GLES")==0):
  3994. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  3995. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  3996. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  3997. #
  3998. # DIRECTORY: panda/src/gles2gsg/
  3999. #
  4000. if (not RUNTIME and PkgSkip("GLES2")==0):
  4001. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4002. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4003. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4004. #
  4005. # DIRECTORY: panda/metalibs/pandaegg/
  4006. #
  4007. if not RUNTIME and not PkgSkip("EGG"):
  4008. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4009. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4010. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4011. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4012. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4013. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4014. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4015. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4016. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4017. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4018. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4019. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'PYTHON']
  4020. TargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4021. TargetAdd('egg_module.obj', input='libp3egg.in')
  4022. TargetAdd('egg_module.obj', opts=OPTS)
  4023. TargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4024. TargetAdd('egg.pyd', input='egg_module.obj')
  4025. TargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4026. TargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4027. TargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4028. TargetAdd('egg.pyd', input='libpandaegg.dll')
  4029. TargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4030. TargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4031. TargetAdd('egg.pyd', opts=['PYTHON'])
  4032. #
  4033. # DIRECTORY: panda/src/x11display/
  4034. #
  4035. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4036. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4037. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4038. #
  4039. # DIRECTORY: panda/src/glxdisplay/
  4040. #
  4041. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4042. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4043. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4044. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4045. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4046. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4047. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4048. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4049. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4050. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4051. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4052. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4053. #
  4054. # DIRECTORY: panda/src/cocoadisplay/
  4055. #
  4056. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4057. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4058. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4059. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4060. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4061. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4062. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4063. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4064. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4065. if (PkgSkip('PANDAFX')==0):
  4066. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4067. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4068. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4069. #
  4070. # DIRECTORY: panda/src/osxdisplay/
  4071. #
  4072. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4073. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4074. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4075. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4076. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4077. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4078. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4079. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4080. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4081. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4082. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4083. if (PkgSkip('PANDAFX')==0):
  4084. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4085. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4086. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4087. #
  4088. # DIRECTORY: panda/src/wgldisplay/
  4089. #
  4090. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4091. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4092. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4093. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4094. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4095. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4096. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4097. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4098. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4099. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4100. if (PkgSkip('PANDAFX')==0):
  4101. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4102. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4103. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4104. #
  4105. # DIRECTORY: panda/src/egldisplay/
  4106. #
  4107. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4108. DefSymbol('GLES', 'OPENGLES_1', '')
  4109. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4110. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4111. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4112. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4113. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4114. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4115. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4116. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4117. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4118. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4119. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4120. #
  4121. # DIRECTORY: panda/src/egldisplay/
  4122. #
  4123. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4124. DefSymbol('GLES2', 'OPENGLES_2', '')
  4125. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4126. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4127. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4128. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4129. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4130. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4131. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4132. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4133. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4134. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4135. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4136. #
  4137. # DIRECTORY: panda/src/vulkandisplay/
  4138. #
  4139. if not PkgSkip("VULKAN") and not RUNTIME:
  4140. OPTS=['DIR:panda/src/vulkandisplay', 'DIR:panda/src/vulkandisplay', 'BUILDING:VULKANDISPLAY', 'VULKAN']
  4141. TargetAdd('p3vulkandisplay_composite1.obj', opts=OPTS, input='p3vulkandisplay_composite1.cxx')
  4142. TargetAdd('libp3vulkandisplay.dll', input='p3vulkandisplay_composite1.obj')
  4143. if GetTarget() == 'windows':
  4144. TargetAdd('libp3vulkandisplay.dll', input='libp3windisplay.dll')
  4145. TargetAdd('libp3vulkandisplay.dll', opts=['MODULE', 'VULKAN'])
  4146. else:
  4147. TargetAdd('libp3vulkandisplay.dll', input='p3x11display_composite1.obj')
  4148. TargetAdd('libp3vulkandisplay.dll', opts=['MODULE', 'VULKAN', 'X11', 'XRANDR', 'XF86DGA', 'XCURSOR'])
  4149. TargetAdd('libp3vulkandisplay.dll', input=COMMON_PANDA_LIBS)
  4150. #
  4151. # DIRECTORY: panda/src/ode/
  4152. #
  4153. if (PkgSkip("ODE")==0 and not RUNTIME):
  4154. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE', 'PYTHON']
  4155. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4156. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4157. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4158. OPTS=['DIR:panda/src/ode', 'ODE', 'PYTHON']
  4159. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4160. IGATEFILES.remove("odeConvexGeom.h")
  4161. IGATEFILES.remove("odeHeightFieldGeom.h")
  4162. IGATEFILES.remove("odeHelperStructs.h")
  4163. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4164. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4165. TargetAdd('libpandaode_igate.obj', input='libpandaode.in', opts=["DEPENDENCYONLY"])
  4166. TargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4167. #
  4168. # DIRECTORY: panda/metalibs/pandaode/
  4169. #
  4170. if (PkgSkip("ODE")==0 and not RUNTIME):
  4171. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4172. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4173. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4174. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4175. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4176. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4177. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4178. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4179. OPTS=['DIR:panda/metalibs/pandaode', 'ODE', 'PYTHON']
  4180. TargetAdd('ode_module.obj', input='libpandaode.in')
  4181. TargetAdd('ode_module.obj', opts=OPTS)
  4182. TargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4183. TargetAdd('ode.pyd', input='ode_module.obj')
  4184. TargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4185. TargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4186. TargetAdd('ode.pyd', input='libpandaode.dll')
  4187. TargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4188. TargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4189. TargetAdd('ode.pyd', opts=['PYTHON', 'WINUSER', 'ODE'])
  4190. #
  4191. # DIRECTORY: panda/src/bullet/
  4192. #
  4193. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4194. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4195. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4196. OPTS=['DIR:panda/src/bullet', 'BULLET', 'PYTHON']
  4197. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4198. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4199. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4200. TargetAdd('libpandabullet_igate.obj', input='libpandabullet.in', opts=["DEPENDENCYONLY"])
  4201. #
  4202. # DIRECTORY: panda/metalibs/pandabullet/
  4203. #
  4204. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4205. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4206. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4207. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4208. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4209. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4210. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4211. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET', 'PYTHON']
  4212. TargetAdd('bullet_module.obj', input='libpandabullet.in')
  4213. TargetAdd('bullet_module.obj', opts=OPTS)
  4214. TargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4215. TargetAdd('bullet.pyd', input='bullet_module.obj')
  4216. TargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4217. TargetAdd('bullet.pyd', input='libpandabullet.dll')
  4218. TargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4219. TargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4220. TargetAdd('bullet.pyd', opts=['PYTHON', 'WINUSER', 'BULLET'])
  4221. #
  4222. # DIRECTORY: panda/src/physx/
  4223. #
  4224. if (PkgSkip("PHYSX")==0):
  4225. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4226. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4227. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4228. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4229. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4230. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4231. TargetAdd('libpandaphysx_igate.obj', input='libpandaphysx.in', opts=["DEPENDENCYONLY"])
  4232. #
  4233. # DIRECTORY: panda/metalibs/pandaphysx/
  4234. #
  4235. if (PkgSkip("PHYSX")==0):
  4236. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4237. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4238. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4239. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4240. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4241. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4242. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4243. TargetAdd('physx_module.obj', input='libpandaphysx.in')
  4244. TargetAdd('physx_module.obj', opts=OPTS)
  4245. TargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4246. TargetAdd('physx.pyd', input='physx_module.obj')
  4247. TargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4248. TargetAdd('physx.pyd', input='libpandaphysx.dll')
  4249. TargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4250. TargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4251. TargetAdd('physx.pyd', opts=['PYTHON', 'WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4252. #
  4253. # DIRECTORY: panda/src/physics/
  4254. #
  4255. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4256. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4257. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4258. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4259. OPTS=['DIR:panda/src/physics', 'PYTHON']
  4260. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4261. IGATEFILES.remove("forces.h")
  4262. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4263. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4264. TargetAdd('libp3physics_igate.obj', input='libp3physics.in', opts=["DEPENDENCYONLY"])
  4265. #
  4266. # DIRECTORY: panda/src/particlesystem/
  4267. #
  4268. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4269. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4270. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4271. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4272. OPTS=['DIR:panda/src/particlesystem', 'PYTHON']
  4273. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4274. IGATEFILES.remove('orientedParticle.h')
  4275. IGATEFILES.remove('orientedParticleFactory.h')
  4276. IGATEFILES.remove('particlefactories.h')
  4277. IGATEFILES.remove('emitters.h')
  4278. IGATEFILES.remove('particles.h')
  4279. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4280. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4281. TargetAdd('libp3particlesystem_igate.obj', input='libp3particlesystem.in', opts=["DEPENDENCYONLY"])
  4282. #
  4283. # DIRECTORY: panda/metalibs/pandaphysics/
  4284. #
  4285. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4286. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4287. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4288. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4289. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4290. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4291. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4292. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4293. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4294. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4295. OPTS=['DIR:panda/metalibs/pandaphysics', 'PYTHON']
  4296. TargetAdd('physics_module.obj', input='libp3physics.in')
  4297. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4298. TargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4299. TargetAdd('physics_module.obj', opts=OPTS)
  4300. TargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4301. TargetAdd('physics.pyd', input='physics_module.obj')
  4302. TargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4303. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4304. TargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4305. TargetAdd('physics.pyd', input='libpandaphysics.dll')
  4306. TargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4307. TargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4308. TargetAdd('physics.pyd', opts=['PYTHON'])
  4309. #
  4310. # DIRECTORY: panda/src/speedtree/
  4311. #
  4312. if (PkgSkip("SPEEDTREE")==0):
  4313. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE', 'PYTHON']
  4314. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4315. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4316. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4317. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4318. TargetAdd('libpandaspeedtree_igate.obj', input='libpandaspeedtree.in', opts=["DEPENDENCYONLY"])
  4319. TargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4320. TargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4321. TargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4322. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4323. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4324. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4325. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4326. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4327. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4328. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4329. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4330. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4331. #
  4332. # DIRECTORY: panda/src/testbed/
  4333. #
  4334. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0 and GetTarget() != 'android'):
  4335. OPTS=['DIR:panda/src/testbed']
  4336. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4337. TargetAdd('pview.exe', input='pview_pview.obj')
  4338. TargetAdd('pview.exe', input='libp3framework.dll')
  4339. if not PkgSkip("EGG"):
  4340. TargetAdd('pview.exe', input='libpandaegg.dll')
  4341. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4342. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4343. #
  4344. # DIRECTORY: panda/src/android/
  4345. #
  4346. if (not RUNTIME and GetTarget() == 'android'):
  4347. native_app_glue = os.path.join(SDK['ANDROID_NDK'], 'sources', 'android', 'native_app_glue')
  4348. OPTS=['DIR:panda/src/android', 'DIR:' + native_app_glue]
  4349. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4350. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4351. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4352. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4353. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4354. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4355. if (not RTDIST and PkgSkip("PVIEW")==0):
  4356. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4357. TargetAdd('pview.exe', input='android_native_app_glue.obj')
  4358. TargetAdd('pview.exe', input='android_main.obj')
  4359. TargetAdd('pview.exe', input='pview_pview.obj')
  4360. TargetAdd('pview.exe', input='libp3framework.dll')
  4361. if not PkgSkip("EGG"):
  4362. TargetAdd('pview.exe', input='libpandaegg.dll')
  4363. TargetAdd('pview.exe', input='libp3android.dll')
  4364. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4365. TargetAdd('AndroidManifest.xml', opts=OPTS, input='pview_manifest.xml')
  4366. #
  4367. # DIRECTORY: panda/src/androiddisplay/
  4368. #
  4369. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4370. DefSymbol('GLES', 'OPENGLES_1', '')
  4371. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'DIR:' + native_app_glue, 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4372. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4373. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4374. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4375. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4376. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4377. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4378. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4379. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4380. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4381. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4382. #
  4383. # DIRECTORY: panda/src/tinydisplay/
  4384. #
  4385. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4386. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4387. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4388. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4389. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4390. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4391. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4392. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4393. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4394. if GetTarget() == 'darwin':
  4395. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4396. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4397. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4398. elif GetTarget() == 'windows':
  4399. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4400. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4401. else:
  4402. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4403. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4404. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4405. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4406. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4407. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4408. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4409. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4410. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4411. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4412. #
  4413. # DIRECTORY: direct/src/directbase/
  4414. #
  4415. if (PkgSkip("DIRECT")==0):
  4416. OPTS=['DIR:direct/src/directbase', 'PYTHON']
  4417. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4418. #
  4419. # DIRECTORY: direct/src/dcparser/
  4420. #
  4421. if (PkgSkip("DIRECT")==0):
  4422. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'BISONPREFIX_dcyy', 'PYTHON']
  4423. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4424. TargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4425. TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4426. TargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx')
  4427. TargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4428. TargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4429. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA', 'PYTHON']
  4430. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4431. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4432. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4433. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4434. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4435. TargetAdd('libp3dcparser_igate.obj', input='libp3dcparser.in', opts=["DEPENDENCYONLY"])
  4436. #
  4437. # DIRECTORY: direct/src/deadrec/
  4438. #
  4439. if (PkgSkip("DIRECT")==0):
  4440. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4441. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4442. OPTS=['DIR:direct/src/deadrec', 'PYTHON']
  4443. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4444. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4445. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4446. TargetAdd('libp3deadrec_igate.obj', input='libp3deadrec.in', opts=["DEPENDENCYONLY"])
  4447. #
  4448. # DIRECTORY: direct/src/distributed/
  4449. #
  4450. if (PkgSkip("DIRECT")==0):
  4451. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT', 'OPENSSL', 'PYTHON']
  4452. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4453. TargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4454. TargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4455. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA', 'OPENSSL', 'PYTHON']
  4456. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4457. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4458. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4459. TargetAdd('libp3distributed_igate.obj', input='libp3distributed.in', opts=["DEPENDENCYONLY"])
  4460. #
  4461. # DIRECTORY: direct/src/interval/
  4462. #
  4463. if (PkgSkip("DIRECT")==0):
  4464. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4465. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4466. OPTS=['DIR:direct/src/interval', 'PYTHON']
  4467. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4468. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4469. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4470. TargetAdd('libp3interval_igate.obj', input='libp3interval.in', opts=["DEPENDENCYONLY"])
  4471. #
  4472. # DIRECTORY: direct/src/showbase/
  4473. #
  4474. if (PkgSkip("DIRECT")==0):
  4475. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4476. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4477. if GetTarget() == 'darwin':
  4478. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4479. OPTS=['DIR:direct/src/showbase', 'PYTHON']
  4480. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4481. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4482. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4483. TargetAdd('libp3showbase_igate.obj', input='libp3showbase.in', opts=["DEPENDENCYONLY"])
  4484. #
  4485. # DIRECTORY: direct/src/motiontrail/
  4486. #
  4487. if (PkgSkip("DIRECT")==0):
  4488. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4489. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4490. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4491. OPTS=['DIR:direct/src/motiontrail', 'PYTHON']
  4492. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4493. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4494. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4495. TargetAdd('libp3motiontrail_igate.obj', input='libp3motiontrail.in', opts=["DEPENDENCYONLY"])
  4496. #
  4497. # DIRECTORY: direct/metalibs/direct/
  4498. #
  4499. if (PkgSkip("DIRECT")==0):
  4500. OPTS=['DIR:direct/metalibs/direct', 'BUILDING:DIRECT']
  4501. TargetAdd('p3direct_direct.obj', opts=OPTS, input='direct.cxx')
  4502. TargetAdd('libp3direct.dll', input='p3direct_direct.obj')
  4503. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4504. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4505. if GetTarget() == 'darwin':
  4506. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4507. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4508. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4509. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4510. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4511. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4512. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'OPENSSL', 'WINUSER', 'WINGDI'])
  4513. OPTS=['DIR:direct/metalibs/direct', 'PYTHON']
  4514. TargetAdd('direct_module.obj', input='libp3dcparser.in')
  4515. TargetAdd('direct_module.obj', input='libp3showbase.in')
  4516. TargetAdd('direct_module.obj', input='libp3deadrec.in')
  4517. TargetAdd('direct_module.obj', input='libp3interval.in')
  4518. TargetAdd('direct_module.obj', input='libp3distributed.in')
  4519. TargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4520. TargetAdd('direct_module.obj', opts=OPTS)
  4521. TargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4522. TargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4523. TargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4524. TargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4525. TargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4526. TargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4527. TargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4528. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4529. # the Python libraries. If a C++ user needs these modules, we can move them
  4530. # back and filter out the Python-specific code.
  4531. TargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4532. TargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4533. TargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4534. TargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4535. TargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4536. TargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4537. TargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4538. TargetAdd('direct.pyd', input='direct_module.obj')
  4539. TargetAdd('direct.pyd', input='libp3direct.dll')
  4540. TargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4541. TargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4542. TargetAdd('direct.pyd', opts=['PYTHON', 'OPENSSL', 'WINUSER', 'WINGDI', 'WINSOCK2'])
  4543. #
  4544. # DIRECTORY: direct/src/dcparse/
  4545. #
  4546. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4547. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI', 'PYTHON']
  4548. TargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4549. TargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4550. TargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4551. TargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4552. TargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4553. TargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4554. TargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4555. TargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4556. TargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4557. TargetAdd('p3dcparse.exe', opts=['ADVAPI', 'PYTHON'])
  4558. #
  4559. # DIRECTORY: direct/src/plugin/
  4560. #
  4561. if (RTDIST or RUNTIME):
  4562. # Explicitly define this as we don't include dtool_config.h here.
  4563. if GetTarget() not in ('windows', 'darwin'):
  4564. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4565. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4566. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4567. OPTS += ['ZLIB', 'MSIMG']
  4568. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4569. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4570. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4571. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4572. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4573. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4574. if GetTarget() == 'darwin':
  4575. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4576. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4577. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4578. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4579. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4580. if (RTDIST):
  4581. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4582. TargetAdd(fname, input='plugin_plugin.obj')
  4583. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4584. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4585. TargetAdd(fname, input='plugin_parse_color.obj')
  4586. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4587. if GetTarget() == 'darwin':
  4588. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4589. TargetAdd(fname, input='plugin_fileSpec.obj')
  4590. TargetAdd(fname, input='plugin_binaryXml.obj')
  4591. TargetAdd(fname, input='plugin_handleStream.obj')
  4592. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4593. TargetAdd(fname, input='libp3tinyxml.ilb')
  4594. if GetTarget() == 'darwin':
  4595. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4596. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4597. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4598. if (PkgSkip("PYTHON")==0 and RTDIST):
  4599. # Freeze VFSImporter and its dependency modules into p3dpython.
  4600. # Mark panda3d.core as a dependency to make sure to build that first.
  4601. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP', 'PYTHON'])
  4602. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4603. OPTS += ['PYTHON']
  4604. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4605. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4606. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4607. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4608. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4609. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4610. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4611. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4612. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4613. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4614. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4615. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4616. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4617. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4618. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4619. if GetTarget() == 'windows':
  4620. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4621. OPTS.append("NON_CONSOLE")
  4622. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4623. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4624. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4625. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4626. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4627. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4628. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4629. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4630. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'PYTHON', 'WINUSER'])
  4631. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4632. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4633. if GetTarget() == 'darwin':
  4634. OPTS += ['OPT:2']
  4635. if (PkgSkip("FLTK")==0):
  4636. OPTS.append("FLTK")
  4637. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4638. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4639. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4640. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4641. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4642. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4643. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4644. if GetTarget() == 'darwin':
  4645. OPTS += ['OPT:2']
  4646. TargetAdd('p3dcert.exe', opts=OPTS)
  4647. elif (PkgSkip("WX")==0):
  4648. OPTS += ["WX", "RTTI"]
  4649. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4650. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4651. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4652. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4653. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4654. if GetTarget() == "darwin":
  4655. OPTS += ['GL', 'OPT:2']
  4656. TargetAdd('p3dcert.exe', opts=OPTS)
  4657. #
  4658. # DIRECTORY: direct/src/plugin_npapi/
  4659. #
  4660. if RUNTIME:
  4661. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4662. if GetTarget() == 'windows':
  4663. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4664. "version" : VERSION,
  4665. "description" : "Runs 3-D games and interactive applets",
  4666. "filename" : "nppanda3d.dll",
  4667. "mimetype" : "application/x-panda3d",
  4668. "extension" : "p3d",
  4669. "filedesc" : "Panda3D applet"}
  4670. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4671. elif GetTarget() == 'darwin':
  4672. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4673. OPTS += ['GTK2']
  4674. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4675. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4676. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4677. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4678. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4679. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4680. if GetTarget() == 'windows':
  4681. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4682. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4683. elif GetTarget() == 'darwin':
  4684. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4685. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4686. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4687. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4688. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4689. #
  4690. # DIRECTORY: direct/src/plugin_activex/
  4691. #
  4692. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4693. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4694. DefSymbol('ACTIVEX', '_USRDLL', '')
  4695. DefSymbol('ACTIVEX', '_WINDLL', '')
  4696. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4697. DefSymbol('ACTIVEX', '_MBCS', '')
  4698. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4699. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4700. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4701. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4702. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4703. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4704. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4705. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4706. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4707. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4708. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4709. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4710. #
  4711. # DIRECTORY: direct/src/plugin_standalone/
  4712. #
  4713. if (RUNTIME):
  4714. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4715. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4716. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4717. if GetTarget() == 'windows':
  4718. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4719. "version" : VERSION,
  4720. "description" : "Runs 3-D games and interactive applets",
  4721. "filename" : "panda3d.exe",
  4722. "mimetype" : "application/x-panda3d",
  4723. "extension" : "p3d",
  4724. "filedesc" : "Panda3D applet",
  4725. "icon" : "panda3d.ico"}
  4726. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4727. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4728. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4729. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4730. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4731. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4732. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4733. if GetTarget() == 'darwin':
  4734. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4735. elif GetTarget() == 'windows':
  4736. TargetAdd('panda3d.exe', input='panda3d.res')
  4737. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4738. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4739. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4740. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4741. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4742. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4743. if (GetTarget() == 'darwin'):
  4744. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4745. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4746. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4747. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4748. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4749. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4750. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4751. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4752. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4753. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4754. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4755. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4756. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4757. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4758. elif (GetTarget() == 'windows'):
  4759. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4760. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  4761. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  4762. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  4763. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  4764. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  4765. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  4766. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  4767. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  4768. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  4769. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  4770. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4771. if (RTDIST):
  4772. 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']
  4773. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  4774. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  4775. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4776. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4777. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  4778. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  4779. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  4780. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  4781. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  4782. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  4783. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  4784. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  4785. if (GetTarget() == 'darwin'):
  4786. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  4787. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  4788. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  4789. TargetAdd('plugin_standalone_dconfig_composite1.obj', opts=OPTS, input='p3dconfig_composite1.cxx')
  4790. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  4791. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  4792. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  4793. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  4794. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  4795. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  4796. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  4797. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  4798. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4799. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4800. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  4801. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  4802. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4803. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4804. if GetTarget() == 'darwin':
  4805. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  4806. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  4807. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  4808. TargetAdd('p3dembed.exe', input='plugin_standalone_dconfig_composite1.obj')
  4809. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  4810. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  4811. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  4812. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  4813. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  4814. if GetTarget() == 'darwin':
  4815. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  4816. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  4817. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  4818. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  4819. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  4820. if GetTarget() == 'windows':
  4821. OPTS.append("P3DEMBEDW")
  4822. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  4823. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  4824. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  4825. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  4826. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  4827. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  4828. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  4829. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  4830. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  4831. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  4832. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  4833. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  4834. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  4835. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  4836. TargetAdd('p3dembedw.exe', input='plugin_standalone_dconfig_composite1.obj')
  4837. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  4838. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  4839. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  4840. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  4841. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  4842. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  4843. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  4844. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  4845. #
  4846. # DIRECTORY: pandatool/src/pandatoolbase/
  4847. #
  4848. if (PkgSkip("PANDATOOL")==0):
  4849. OPTS=['DIR:pandatool/src/pandatoolbase']
  4850. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  4851. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  4852. #
  4853. # DIRECTORY: pandatool/src/converter/
  4854. #
  4855. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4856. OPTS=['DIR:pandatool/src/converter']
  4857. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  4858. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  4859. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  4860. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  4861. #
  4862. # DIRECTORY: pandatool/src/progbase/
  4863. #
  4864. if not PkgSkip("PANDATOOL"):
  4865. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  4866. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  4867. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  4868. #
  4869. # DIRECTORY: pandatool/src/eggbase/
  4870. #
  4871. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4872. OPTS=['DIR:pandatool/src/eggbase']
  4873. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  4874. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  4875. #
  4876. # DIRECTORY: pandatool/src/bam/
  4877. #
  4878. if not PkgSkip("PANDATOOL"):
  4879. OPTS=['DIR:pandatool/src/bam']
  4880. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  4881. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  4882. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  4883. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  4884. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  4885. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  4886. if not PkgSkip("EGG"):
  4887. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  4888. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  4889. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  4890. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  4891. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  4892. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  4893. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  4894. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  4895. #
  4896. # DIRECTORY: pandatool/src/cvscopy/
  4897. #
  4898. if not PkgSkip("PANDATOOL"):
  4899. OPTS=['DIR:pandatool/src/cvscopy']
  4900. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  4901. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  4902. #
  4903. # DIRECTORY: pandatool/src/daeegg/
  4904. #
  4905. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4906. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  4907. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  4908. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  4909. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  4910. #
  4911. # DIRECTORY: pandatool/src/assimp
  4912. #
  4913. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  4914. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  4915. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  4916. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  4917. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  4918. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB'])
  4919. #
  4920. # DIRECTORY: pandatool/src/daeprogs/
  4921. #
  4922. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  4923. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  4924. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  4925. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  4926. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  4927. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  4928. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  4929. #
  4930. # DIRECTORY: pandatool/src/dxf/
  4931. #
  4932. if not PkgSkip("PANDATOOL"):
  4933. OPTS=['DIR:pandatool/src/dxf']
  4934. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  4935. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  4936. #
  4937. # DIRECTORY: pandatool/src/dxfegg/
  4938. #
  4939. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4940. OPTS=['DIR:pandatool/src/dxfegg']
  4941. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  4942. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  4943. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  4944. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  4945. #
  4946. # DIRECTORY: pandatool/src/dxfprogs/
  4947. #
  4948. if not PkgSkip("PANDATOOL"):
  4949. OPTS=['DIR:pandatool/src/dxfprogs']
  4950. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  4951. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  4952. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  4953. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  4954. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  4955. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  4956. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  4957. if not PkgSkip("EGG"):
  4958. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  4959. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  4960. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  4961. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  4962. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  4963. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  4964. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  4965. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  4966. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  4967. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  4968. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  4969. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  4970. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  4971. #
  4972. # DIRECTORY: pandatool/src/objegg/
  4973. #
  4974. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4975. OPTS=['DIR:pandatool/src/objegg']
  4976. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  4977. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  4978. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  4979. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  4980. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  4981. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  4982. #
  4983. # DIRECTORY: pandatool/src/objprogs/
  4984. #
  4985. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4986. OPTS=['DIR:pandatool/src/objprogs']
  4987. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  4988. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  4989. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  4990. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  4991. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  4992. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  4993. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  4994. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  4995. #
  4996. # DIRECTORY: pandatool/src/palettizer/
  4997. #
  4998. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  4999. OPTS=['DIR:pandatool/src/palettizer']
  5000. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5001. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5002. #
  5003. # DIRECTORY: pandatool/src/egg-mkfont/
  5004. #
  5005. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5006. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5007. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5008. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5009. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5010. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5011. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5012. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5013. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5014. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5015. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5016. #
  5017. # DIRECTORY: pandatool/src/eggcharbase/
  5018. #
  5019. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5020. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5021. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5022. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5023. #
  5024. # DIRECTORY: pandatool/src/egg-optchar/
  5025. #
  5026. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5027. OPTS=['DIR:pandatool/src/egg-optchar']
  5028. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5029. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5030. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5031. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5032. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5033. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5034. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5035. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5036. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5037. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5038. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5039. #
  5040. # DIRECTORY: pandatool/src/egg-palettize/
  5041. #
  5042. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5043. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5044. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5045. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5046. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5047. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5048. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5049. #
  5050. # DIRECTORY: pandatool/src/egg-qtess/
  5051. #
  5052. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5053. OPTS=['DIR:pandatool/src/egg-qtess']
  5054. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5055. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5056. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5057. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5058. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5059. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5060. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5061. #
  5062. # DIRECTORY: pandatool/src/eggprogs/
  5063. #
  5064. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5065. OPTS=['DIR:pandatool/src/eggprogs']
  5066. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5067. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5068. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5069. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5070. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5071. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5072. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5073. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5074. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5075. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5076. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5077. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5078. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5079. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5080. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5081. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5082. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5083. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5084. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5085. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5086. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5087. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5088. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5089. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5090. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5091. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5092. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5093. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5094. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5095. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5096. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5097. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5098. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5099. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5100. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5101. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5102. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5103. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5104. #
  5105. # DIRECTORY: pandatool/src/flt/
  5106. #
  5107. if not PkgSkip("PANDATOOL"):
  5108. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5109. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5110. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5111. #
  5112. # DIRECTORY: pandatool/src/fltegg/
  5113. #
  5114. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5115. OPTS=['DIR:pandatool/src/fltegg']
  5116. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5117. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5118. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5119. #
  5120. # DIRECTORY: pandatool/src/fltprogs/
  5121. #
  5122. if not PkgSkip("PANDATOOL"):
  5123. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5124. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5125. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5126. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5127. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5128. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5129. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5130. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5131. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5132. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5133. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5134. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5135. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5136. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5137. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5138. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5139. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5140. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5141. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5142. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5143. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5144. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5145. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5146. if not PkgSkip("EGG"):
  5147. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5148. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5149. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5150. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5151. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5152. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5153. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5154. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5155. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5156. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5157. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5158. #
  5159. # DIRECTORY: pandatool/src/imagebase/
  5160. #
  5161. if not PkgSkip("PANDATOOL"):
  5162. OPTS=['DIR:pandatool/src/imagebase']
  5163. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5164. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5165. #
  5166. # DIRECTORY: pandatool/src/imageprogs/
  5167. #
  5168. if not PkgSkip("PANDATOOL"):
  5169. OPTS=['DIR:pandatool/src/imageprogs']
  5170. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5171. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5172. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5173. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5174. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5175. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5176. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5177. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5178. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5179. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5180. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5181. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5182. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5183. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5184. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5185. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5186. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5187. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5188. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5189. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5190. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5191. #
  5192. # DIRECTORY: pandatool/src/pfmprogs/
  5193. #
  5194. if not PkgSkip("PANDATOOL"):
  5195. OPTS=['DIR:pandatool/src/pfmprogs']
  5196. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5197. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5198. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5199. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5200. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5201. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5202. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5203. TargetAdd('pfm-bba_config_pfm.obj', opts=OPTS, input='config_pfm.cxx')
  5204. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5205. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfm.obj')
  5206. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5207. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5208. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5209. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5210. #
  5211. # DIRECTORY: pandatool/src/lwo/
  5212. #
  5213. if not PkgSkip("PANDATOOL"):
  5214. OPTS=['DIR:pandatool/src/lwo']
  5215. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5216. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5217. #
  5218. # DIRECTORY: pandatool/src/lwoegg/
  5219. #
  5220. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5221. OPTS=['DIR:pandatool/src/lwoegg']
  5222. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5223. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5224. #
  5225. # DIRECTORY: pandatool/src/lwoprogs/
  5226. #
  5227. if not PkgSkip("PANDATOOL"):
  5228. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5229. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5230. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5231. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5232. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5233. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5234. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5235. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5236. if not PkgSkip("EGG"):
  5237. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5238. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5239. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5240. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5241. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5242. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5243. #
  5244. # DIRECTORY: pandatool/src/maya/
  5245. #
  5246. for VER in MAYAVERSIONS:
  5247. VNUM=VER[4:]
  5248. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5249. OPTS=['DIR:pandatool/src/maya', VER]
  5250. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5251. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5252. #
  5253. # DIRECTORY: pandatool/src/mayaegg/
  5254. #
  5255. for VER in MAYAVERSIONS:
  5256. VNUM=VER[4:]
  5257. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5258. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5259. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5260. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5261. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5262. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5263. #
  5264. # DIRECTORY: pandatool/src/maxegg/
  5265. #
  5266. for VER in MAXVERSIONS:
  5267. VNUM=VER[3:]
  5268. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5269. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5270. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5271. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5272. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5273. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5274. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5275. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5276. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5277. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5278. #
  5279. # DIRECTORY: pandatool/src/maxprogs/
  5280. #
  5281. for VER in MAXVERSIONS:
  5282. VNUM=VER[3:]
  5283. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5284. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5285. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5286. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5287. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5288. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5289. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5290. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5291. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5292. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5293. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5294. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5295. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5296. #
  5297. # DIRECTORY: pandatool/src/vrml/
  5298. #
  5299. if not PkgSkip("PANDATOOL"):
  5300. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5301. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5302. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5303. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5304. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5305. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5306. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5307. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5308. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5309. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5310. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5311. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5312. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5313. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5314. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5315. #
  5316. # DIRECTORY: pandatool/src/vrmlegg/
  5317. #
  5318. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5319. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5320. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5321. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5322. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5323. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5324. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5325. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5326. #
  5327. # DIRECTORY: pandatool/src/xfile/
  5328. #
  5329. if not PkgSkip("PANDATOOL"):
  5330. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5331. CreateFile(GetOutputDir()+"/include/xParser.h")
  5332. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5333. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5334. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5335. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5336. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5337. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5338. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5339. #
  5340. # DIRECTORY: pandatool/src/xfileegg/
  5341. #
  5342. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5343. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5344. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5345. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5346. #
  5347. # DIRECTORY: pandatool/src/ptloader/
  5348. #
  5349. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5350. if not PkgSkip("FCOLLADA"):
  5351. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5352. 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']
  5353. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5354. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5355. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5356. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5357. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5358. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5359. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5360. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5361. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5362. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5363. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5364. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5365. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5366. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5367. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5368. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5369. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5370. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5371. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5372. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5373. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5374. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5375. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5376. #
  5377. # DIRECTORY: pandatool/src/miscprogs/
  5378. #
  5379. # This is a bit of an esoteric tool, and it causes issues because
  5380. # it conflicts with tools of the same name in different packages.
  5381. #if (PkgSkip("PANDATOOL")==0):
  5382. # OPTS=['DIR:pandatool/src/miscprogs']
  5383. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5384. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5385. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5386. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5387. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5388. # TargetAdd('bin2c.exe', input='libp3pystub.lib')
  5389. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5390. #
  5391. # DIRECTORY: pandatool/src/pstatserver/
  5392. #
  5393. if (PkgSkip("PANDATOOL")==0):
  5394. OPTS=['DIR:pandatool/src/pstatserver']
  5395. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5396. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5397. #
  5398. # DIRECTORY: pandatool/src/softprogs/
  5399. #
  5400. if (PkgSkip("PANDATOOL")==0):
  5401. OPTS=['DIR:pandatool/src/softprogs', 'OPENSSL']
  5402. TargetAdd('softcvs_softCVS.obj', opts=OPTS, input='softCVS.cxx')
  5403. TargetAdd('softcvs_softFilename.obj', opts=OPTS, input='softFilename.cxx')
  5404. TargetAdd('softcvs.exe', input='softcvs_softCVS.obj')
  5405. TargetAdd('softcvs.exe', input='softcvs_softFilename.obj')
  5406. TargetAdd('softcvs.exe', input='libp3progbase.lib')
  5407. TargetAdd('softcvs.exe', input='libp3pandatoolbase.lib')
  5408. TargetAdd('softcvs.exe', input=COMMON_PANDA_LIBS)
  5409. TargetAdd('softcvs.exe', opts=['ADVAPI'])
  5410. #
  5411. # DIRECTORY: pandatool/src/text-stats/
  5412. #
  5413. if (PkgSkip("PANDATOOL")==0):
  5414. OPTS=['DIR:pandatool/src/text-stats']
  5415. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5416. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5417. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5418. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5419. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5420. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5421. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5422. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5423. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5424. #
  5425. # DIRECTORY: pandatool/src/vrmlprogs/
  5426. #
  5427. if not PkgSkip("PANDATOOL"):
  5428. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5429. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5430. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5431. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5432. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5433. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5434. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5435. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5436. if not PkgSkip("EGG"):
  5437. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5438. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5439. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5440. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5441. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5442. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5443. #
  5444. # DIRECTORY: pandatool/src/win-stats/
  5445. # DIRECTORY: pandatool/src/gtk-stats/
  5446. #
  5447. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5448. if GetTarget() == 'windows':
  5449. OPTS=['DIR:pandatool/src/win-stats']
  5450. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5451. else:
  5452. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5453. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5454. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5455. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5456. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5457. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5458. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5459. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5460. #
  5461. # DIRECTORY: pandatool/src/xfileprogs/
  5462. #
  5463. if not PkgSkip("PANDATOOL"):
  5464. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5465. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5466. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5467. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5468. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5469. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5470. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5471. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5472. if not PkgSkip("EGG"):
  5473. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5474. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5475. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5476. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5477. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5478. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5479. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5480. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5481. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5482. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5483. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5484. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5485. #
  5486. # DIRECTORY: pandatool/src/mayaprogs/
  5487. #
  5488. for VER in MAYAVERSIONS:
  5489. VNUM = VER[4:]
  5490. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5491. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5492. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5493. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5494. continue
  5495. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5496. ARCH_OPTS = ['NOARCH:PPC']
  5497. else:
  5498. ARCH_OPTS = []
  5499. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5500. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5501. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5502. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5503. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5504. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5505. #if GetTarget() == 'windows':
  5506. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5507. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5508. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5509. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5510. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5511. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5512. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5513. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5514. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5515. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5516. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5517. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5518. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5519. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5520. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5521. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5522. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5523. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5524. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5525. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5526. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5527. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5528. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5529. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5530. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5531. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5532. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5533. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5534. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5535. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5536. if GetTarget() == 'windows':
  5537. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5538. else:
  5539. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5540. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5541. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5542. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5543. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5544. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5545. if GetTarget() == 'windows':
  5546. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5547. else:
  5548. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5549. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5550. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5551. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5552. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5553. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5554. if GetTarget() == 'windows':
  5555. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5556. else:
  5557. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5558. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5559. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5560. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5561. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5562. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5563. if GetTarget() == 'windows':
  5564. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5565. else:
  5566. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5567. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5568. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5569. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5570. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5571. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5572. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5573. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5574. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5575. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5576. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5577. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5578. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5579. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5580. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5581. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5582. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5583. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5584. #
  5585. # DIRECTORY: contrib/src/ai/
  5586. #
  5587. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5588. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5589. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5590. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5591. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5592. OPTS=['DIR:contrib/src/ai', 'PYTHON']
  5593. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5594. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5595. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5596. TargetAdd('libpandaai_igate.obj', input='libpandaai.in', opts=["DEPENDENCYONLY"])
  5597. TargetAdd('ai_module.obj', input='libpandaai.in')
  5598. TargetAdd('ai_module.obj', opts=OPTS)
  5599. TargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5600. TargetAdd('ai.pyd', input='ai_module.obj')
  5601. TargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5602. TargetAdd('ai.pyd', input='libpandaai.dll')
  5603. TargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5604. TargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5605. TargetAdd('ai.pyd', opts=['PYTHON'])
  5606. #
  5607. # Generate the models directory and samples directory
  5608. #
  5609. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5610. model_extensions = ["*.egg"]
  5611. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5612. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5613. model_extensions.append("*.flt")
  5614. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5615. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5616. newname = model[:-4] + ".egg.pz"
  5617. else:
  5618. newname = model[:-4] + ".egg"
  5619. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5620. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5621. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5622. newname = model[:-4] + ".egg.pz"
  5623. else:
  5624. newname = model[:-4] + ".egg"
  5625. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5626. for model in GetDirectoryContents("models", model_extensions):
  5627. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5628. newname = model[:-4] + ".egg.pz"
  5629. else:
  5630. newname = model[:-4] + ".egg"
  5631. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5632. if not PkgSkip("DIRECT") and not RUNTIME:
  5633. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5634. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5635. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5636. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5637. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5638. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5639. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5640. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5641. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5642. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5643. #
  5644. # Build the rtdist.
  5645. #
  5646. if (RTDIST):
  5647. OPTS=['DIR:direct/src/p3d']
  5648. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5649. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5650. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5651. #
  5652. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5653. #
  5654. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5655. OPTS=['DIR:direct/src/p3d']
  5656. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5657. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5658. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5659. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5660. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5661. ##########################################################################################
  5662. #
  5663. # Dependency-Based Distributed Build System.
  5664. #
  5665. ##########################################################################################
  5666. DEPENDENCYQUEUE=[]
  5667. for target in TARGET_LIST:
  5668. name = target.name
  5669. inputs = target.inputs
  5670. opts = target.opts
  5671. deps = target.deps
  5672. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5673. def BuildWorker(taskqueue, donequeue):
  5674. while True:
  5675. try:
  5676. task = taskqueue.get(timeout=1)
  5677. except:
  5678. ProgressOutput(None, "Waiting for tasks...")
  5679. task = taskqueue.get()
  5680. sys.stdout.flush()
  5681. if (task == 0): return
  5682. try:
  5683. task[0](*task[1])
  5684. donequeue.put(task)
  5685. except:
  5686. donequeue.put(0)
  5687. def AllSourcesReady(task, pending):
  5688. sources = task[3]
  5689. for x in sources:
  5690. if (x in pending):
  5691. return 0
  5692. sources = task[1][1]
  5693. for x in sources:
  5694. if (x in pending):
  5695. return 0
  5696. altsources = task[4]
  5697. for x in altsources:
  5698. if (x in pending):
  5699. return 0
  5700. return 1
  5701. def ParallelMake(tasklist):
  5702. # Create the communication queues.
  5703. donequeue = queue.Queue()
  5704. taskqueue = queue.Queue()
  5705. # Build up a table listing all the pending targets
  5706. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5707. # task[2] = [name]
  5708. # task[3] = deps
  5709. # The python tool package, in particular fltegg seems to throw parallelmake off
  5710. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5711. # and another subpart to be built sequentially. The most time consuming part of the process
  5712. # is the c++ code generation anyways.
  5713. tasklist_seq = []
  5714. i = 0
  5715. while i < len(tasklist):
  5716. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5717. break
  5718. i += 1
  5719. if i < len(tasklist):
  5720. tasklist_seq = tasklist[i:]
  5721. tasklist = tasklist[:i]
  5722. iNumStartingTasks = len(tasklist)
  5723. pending = {}
  5724. for task in tasklist:
  5725. for target in task[2]:
  5726. pending[target] = 1
  5727. # Create the workers
  5728. for slave in range(THREADCOUNT):
  5729. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5730. th.setDaemon(1)
  5731. th.start()
  5732. # Feed tasks to the workers.
  5733. tasksqueued = 0
  5734. while True:
  5735. if (tasksqueued < THREADCOUNT):
  5736. extras = []
  5737. for task in tasklist:
  5738. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  5739. if (NeedsBuild(task[2], task[3])):
  5740. tasksqueued += 1
  5741. taskqueue.put(task)
  5742. else:
  5743. for target in task[2]:
  5744. del pending[target]
  5745. else:
  5746. extras.append(task)
  5747. tasklist = extras
  5748. sys.stdout.flush()
  5749. if (tasksqueued == 0): break
  5750. donetask = donequeue.get()
  5751. if (donetask == 0):
  5752. exit("Build process aborting.")
  5753. sys.stdout.flush()
  5754. tasksqueued -= 1
  5755. JustBuilt(donetask[2], donetask[3])
  5756. for target in donetask[2]:
  5757. del pending[target]
  5758. # Kill the workers.
  5759. for slave in range(THREADCOUNT):
  5760. taskqueue.put(0)
  5761. # Make sure there aren't any unsatisfied tasks
  5762. if len(tasklist) > 0:
  5763. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  5764. SequentialMake(tasklist_seq)
  5765. def SequentialMake(tasklist):
  5766. i = 0
  5767. for task in tasklist:
  5768. if (NeedsBuild(task[2], task[3])):
  5769. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  5770. JustBuilt(task[2], task[3])
  5771. i += 1
  5772. def RunDependencyQueue(tasklist):
  5773. if (THREADCOUNT!=0):
  5774. ParallelMake(tasklist)
  5775. else:
  5776. SequentialMake(tasklist)
  5777. try:
  5778. RunDependencyQueue(DEPENDENCYQUEUE)
  5779. except:
  5780. SaveDependencyCache()
  5781. raise
  5782. ##########################################################################################
  5783. #
  5784. # The Installers
  5785. #
  5786. # Under windows, we can build an 'exe' package using NSIS
  5787. # Under linux, we can build a 'deb' package or an 'rpm' package.
  5788. # Under OSX, we can make a 'dmg' package.
  5789. #
  5790. ##########################################################################################
  5791. def MakeInstallerNSIS(file, title, installdir):
  5792. if (os.path.isfile(file)):
  5793. os.remove(file)
  5794. elif (os.path.isdir(file)):
  5795. shutil.rmtree(file)
  5796. if GetTargetArch() == 'x64':
  5797. regview = '64'
  5798. else:
  5799. regview = '32'
  5800. if (RUNTIME):
  5801. # Invoke the make_installer script.
  5802. AddToPathEnv("PATH", GetOutputDir() + "\\bin")
  5803. AddToPathEnv("PATH", GetOutputDir() + "\\plugins")
  5804. cmd = sys.executable + " -B -u " + os.path.join("direct", "src", "plugin_installer", "make_installer.py")
  5805. cmd += " --version %s --regview %s" % (VERSION, regview)
  5806. if GetTargetArch() == 'x64':
  5807. cmd += " --install \"$PROGRAMFILES64\\Panda3D\" "
  5808. else:
  5809. cmd += " --install \"$PROGRAMFILES32\\Panda3D\" "
  5810. oscmd(cmd)
  5811. shutil.move(os.path.join("direct", "src", "plugin_installer", "p3d-setup.exe"), file)
  5812. return
  5813. print("Building "+title+" installer at %s" % (file))
  5814. if (COMPRESSOR != "lzma"):
  5815. print("Note: you are using zlib, which is faster, but lzma gives better compression.")
  5816. if (os.path.exists("nsis-output.exe")):
  5817. os.remove("nsis-output.exe")
  5818. WriteFile(GetOutputDir()+"/tmp/__init__.py", "")
  5819. nsis_defs = {
  5820. 'COMPRESSOR' : COMPRESSOR,
  5821. 'TITLE' : title,
  5822. 'INSTALLDIR' : installdir,
  5823. 'OUTFILE' : '..\\' + file,
  5824. 'BUILT' : '..\\' + GetOutputDir(),
  5825. 'SOURCE' : '..',
  5826. 'PYVER' : SDK["PYTHONVERSION"][6:9],
  5827. 'REGVIEW' : regview,
  5828. }
  5829. if GetHost() == 'windows':
  5830. cmd = os.path.join(GetThirdpartyBase(), 'win-nsis', 'makensis') + ' /V2'
  5831. for item in nsis_defs.items():
  5832. cmd += ' /D%s="%s"' % item
  5833. else:
  5834. cmd = 'makensis -V2'
  5835. for item in nsis_defs.items():
  5836. cmd += ' -D%s="%s"' % item
  5837. cmd += ' "makepanda\installer.nsi"'
  5838. oscmd(cmd)
  5839. def MakeDebugSymbolArchive(zipname, dirname):
  5840. import zipfile
  5841. zip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)
  5842. for fn in glob.glob(os.path.join(GetOutputDir(), 'bin', '*.pdb')):
  5843. zip.write(fn, dirname + '/bin/' + os.path.basename(fn))
  5844. for fn in glob.glob(os.path.join(GetOutputDir(), 'panda3d', '*.pdb')):
  5845. zip.write(fn, dirname + '/panda3d/' + os.path.basename(fn))
  5846. for fn in glob.glob(os.path.join(GetOutputDir(), 'plugins', '*.pdb')):
  5847. zip.write(fn, dirname + '/plugins/' + os.path.basename(fn))
  5848. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', '*.pdb')):
  5849. zip.write(fn, dirname + '/python/' + os.path.basename(fn))
  5850. for fn in glob.glob(os.path.join(GetOutputDir(), 'python', 'DLLs', '*.pdb')):
  5851. zip.write(fn, dirname + '/python/DLLs/' + os.path.basename(fn))
  5852. zip.close()
  5853. INSTALLER_DEB_FILE="""
  5854. Package: panda3dMAJOR
  5855. Version: VERSION
  5856. Section: libdevel
  5857. Priority: optional
  5858. Architecture: ARCH
  5859. Essential: no
  5860. Depends: DEPENDS
  5861. Recommends: RECOMMENDS
  5862. Suggests: panda3d-runtime
  5863. Provides: panda3d
  5864. Conflicts: panda3d
  5865. Replaces: panda3d
  5866. Maintainer: rdb <[email protected]>
  5867. Installed-Size: INSTSIZE
  5868. Description: Panda3D free 3D engine SDK
  5869. 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.
  5870. 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.
  5871. .
  5872. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5873. """
  5874. RUNTIME_INSTALLER_DEB_FILE="""
  5875. Package: panda3d-runtime
  5876. Version: VERSION
  5877. Section: web
  5878. Priority: optional
  5879. Architecture: ARCH
  5880. Essential: no
  5881. Depends: DEPENDS
  5882. Provides: panda3d-runtime
  5883. Maintainer: rdb <[email protected]>
  5884. Installed-Size: INSTSIZE
  5885. Description: Runtime binary and browser plugin for the Panda3D Game Engine
  5886. 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.
  5887. """
  5888. # We're not putting "python" in the "Requires" field,
  5889. # since the rpm-based distros don't have a common
  5890. # naming for the Python package.
  5891. INSTALLER_SPEC_FILE="""
  5892. Summary: The Panda3D free 3D engine SDK
  5893. Name: panda3d
  5894. Version: VERSION
  5895. Release: RPMRELEASE
  5896. License: BSD License
  5897. Group: Development/Libraries
  5898. BuildRoot: PANDASOURCE/targetroot
  5899. %description
  5900. 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.
  5901. 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.
  5902. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5903. %post
  5904. /sbin/ldconfig
  5905. %postun
  5906. /sbin/ldconfig
  5907. %files
  5908. %defattr(-,root,root)
  5909. /etc/Confauto.prc
  5910. /etc/Config.prc
  5911. /usr/share/panda3d
  5912. /usr/share/mime-info/panda3d.mime
  5913. /usr/share/mime-info/panda3d.keys
  5914. /usr/share/mime/packages/panda3d.xml
  5915. /usr/share/application-registry/panda3d.applications
  5916. /usr/share/applications/*.desktop
  5917. /etc/ld.so.conf.d/panda3d.conf
  5918. /usr/%_lib/panda3d
  5919. """ + PYTHON_SITEPACKAGES + """
  5920. /usr/include/panda3d
  5921. """
  5922. RUNTIME_INSTALLER_SPEC_FILE="""
  5923. Summary: Runtime binary and browser plugin for the Panda3D Game Engine
  5924. Name: panda3d-runtime
  5925. Version: VERSION
  5926. Release: RPMRELEASE
  5927. License: BSD License
  5928. Group: Productivity/Graphics/Other
  5929. BuildRoot: PANDASOURCE/targetroot
  5930. %description
  5931. 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.
  5932. %files
  5933. %defattr(-,root,root)
  5934. /usr/bin/panda3d
  5935. /usr/%_lib/nppanda3d.so
  5936. /usr/%_lib/mozilla/plugins/nppanda3d.so
  5937. /usr/%_lib/mozilla-firefox/plugins/nppanda3d.so
  5938. /usr/%_lib/xulrunner-addons/plugins/nppanda3d.so
  5939. /usr/share/mime-info/panda3d-runtime.mime
  5940. /usr/share/mime-info/panda3d-runtime.keys
  5941. /usr/share/mime/packages/panda3d-runtime.xml
  5942. /usr/share/application-registry/panda3d-runtime.applications
  5943. /usr/share/applications/*.desktop
  5944. """
  5945. # plist file for Mac OSX
  5946. Info_plist = """<?xml version="1.0" encoding="UTF-8"?>
  5947. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
  5948. <plist version="1.0">
  5949. <dict>
  5950. <key>CFBundleIdentifier</key>
  5951. <string>%(package_id)s</string>
  5952. <key>CFBundleShortVersionString</key>
  5953. <string>%(version)s</string>
  5954. <key>IFPkgFlagRelocatable</key>
  5955. <false/>
  5956. <key>IFPkgFlagAuthorizationAction</key>
  5957. <string>RootAuthorization</string>
  5958. <key>IFPkgFlagAllowBackRev</key>
  5959. <true/>
  5960. </dict>
  5961. </plist>
  5962. """
  5963. # FreeBSD pkg-descr
  5964. INSTALLER_PKG_DESCR_FILE = """
  5965. 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.
  5966. 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.
  5967. This package contains the SDK for development with Panda3D, install panda3d-runtime for the runtime files.
  5968. WWW: http://www.panda3d.org/
  5969. """
  5970. # FreeBSD pkg-descr
  5971. RUNTIME_INSTALLER_PKG_DESCR_FILE = """
  5972. Runtime binary and browser plugin for the Panda3D Game Engine
  5973. 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.
  5974. WWW: http://www.panda3d.org/
  5975. """
  5976. # FreeBSD PKG Manifest template file
  5977. INSTALLER_PKG_MANIFEST_FILE = """
  5978. name: NAME
  5979. version: VERSION
  5980. arch: ARCH
  5981. origin: ORIGIN
  5982. comment: "Panda 3D Engine"
  5983. www: http://www.panda3d.org
  5984. maintainer: rdb <[email protected]>
  5985. prefix: /usr/local
  5986. flatsize: INSTSIZEMB
  5987. deps: {DEPENDS}
  5988. """
  5989. def MakeInstallerLinux():
  5990. if not RUNTIME and not PkgSkip("PYTHON"):
  5991. PYTHONV = SDK["PYTHONVERSION"].rstrip('dmu')
  5992. else:
  5993. PYTHONV = "python"
  5994. PV = PYTHONV.replace("python", "")
  5995. # Clean and set up a directory to install Panda3D into
  5996. oscmd("rm -rf targetroot data.tar.gz control.tar.gz panda3d.spec")
  5997. oscmd("mkdir --mode=0755 targetroot")
  5998. dpkg_present = False
  5999. if os.path.exists("/usr/bin/dpkg-architecture") and os.path.exists("/usr/bin/dpkg-deb"):
  6000. dpkg_present = True
  6001. rpmbuild_present = False
  6002. if os.path.exists("/usr/bin/rpmbuild"):
  6003. rpmbuild_present = True
  6004. if dpkg_present and rpmbuild_present:
  6005. print("Warning: both dpkg and rpmbuild present.")
  6006. if dpkg_present:
  6007. # Invoke installpanda.py to install it into a temporary dir
  6008. lib_dir = GetDebLibDir()
  6009. if RUNTIME:
  6010. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6011. else:
  6012. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=lib_dir)
  6013. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6014. oscmd("mkdir -p targetroot/usr/share/man/man1")
  6015. oscmd("cp doc/man/*.1 targetroot/usr/share/man/man1/")
  6016. oscmd("dpkg --print-architecture > "+GetOutputDir()+"/tmp/architecture.txt")
  6017. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6018. if (RUNTIME):
  6019. txt = RUNTIME_INSTALLER_DEB_FILE[1:]
  6020. else:
  6021. txt = INSTALLER_DEB_FILE[1:]
  6022. txt = txt.replace("VERSION", DEBVERSION).replace("ARCH", pkg_arch).replace("PV", PV).replace("MAJOR", MAJOR_VERSION)
  6023. txt = txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024))
  6024. oscmd("mkdir --mode=0755 -p targetroot/DEBIAN")
  6025. oscmd("cd targetroot && (find usr -type f -exec md5sum {} ;) > DEBIAN/md5sums")
  6026. if (not RUNTIME):
  6027. oscmd("cd targetroot && (find etc -type f -exec md5sum {} ;) >> DEBIAN/md5sums")
  6028. WriteFile("targetroot/DEBIAN/conffiles","/etc/Config.prc\n")
  6029. WriteFile("targetroot/DEBIAN/postinst","#!/bin/sh\necho running ldconfig\nldconfig\n")
  6030. oscmd("cp targetroot/DEBIAN/postinst targetroot/DEBIAN/postrm")
  6031. # Determine the package name and the locations that
  6032. # dpkg-shlibdeps should look in for executables.
  6033. pkg_version = DEBVERSION
  6034. if RUNTIME:
  6035. pkg_name = "panda3d-runtime"
  6036. lib_pattern = "debian/%s/usr/%s/*.so" % (pkg_name, lib_dir)
  6037. else:
  6038. pkg_name = "panda3d" + MAJOR_VERSION
  6039. lib_pattern = "debian/%s/usr/%s/panda3d/*.so*" % (pkg_name, lib_dir)
  6040. bin_pattern = "debian/%s/usr/bin/*" % (pkg_name)
  6041. # dpkg-shlibdeps looks in the debian/{pkg_name}/DEBIAN/shlibs directory
  6042. # and also expects a debian/control file, so we create this dummy set-up.
  6043. oscmd("mkdir targetroot/debian")
  6044. oscmd("ln -s .. targetroot/debian/" + pkg_name)
  6045. WriteFile("targetroot/debian/control", "")
  6046. dpkg_shlibdeps = "dpkg-shlibdeps"
  6047. if GetVerbose():
  6048. dpkg_shlibdeps += " -v"
  6049. if RUNTIME:
  6050. # The runtime doesn't export any useful symbols, so just query the dependencies.
  6051. oscmd("cd targetroot && %(dpkg_shlibdeps)s -x%(pkg_name)s %(lib_pattern)s %(bin_pattern)s*" % locals())
  6052. depends = ReadFile("targetroot/debian/substvars").replace("shlibs:Depends=", "").strip()
  6053. recommends = ""
  6054. else:
  6055. pkg_name = "panda3d" + MAJOR_VERSION
  6056. pkg_dir = "debian/panda3d" + MAJOR_VERSION
  6057. # Generate a symbols file so that other packages can know which symbols we export.
  6058. oscmd("cd targetroot && dpkg-gensymbols -q -ODEBIAN/symbols -v%(pkg_version)s -p%(pkg_name)s -e%(lib_pattern)s" % locals())
  6059. # Library dependencies are required, binary dependencies are recommended.
  6060. # We explicitly exclude libphysx-extras since we don't want to depend on PhysX.
  6061. 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())
  6062. 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())
  6063. # Parse the substvars files generated by dpkg-shlibdeps.
  6064. depends = ReadFile("targetroot/debian/substvars_dep").replace("shlibs:Depends=", "").strip()
  6065. recommends = ReadFile("targetroot/debian/substvars_rec").replace("shlibs:Depends=", "").strip()
  6066. if PkgSkip("PYTHON")==0:
  6067. depends += ", " + PYTHONV
  6068. recommends += ", python-wxversion, python-profiler (>= " + PV + "), python-pmw, python-tk (>= " + PV + ")"
  6069. if PkgSkip("NVIDIACG")==0:
  6070. depends += ", nvidia-cg-toolkit"
  6071. # Write back the dependencies, and delete the dummy set-up.
  6072. txt = txt.replace("DEPENDS", depends.strip(', '))
  6073. txt = txt.replace("RECOMMENDS", recommends.strip(', '))
  6074. WriteFile("targetroot/DEBIAN/control", txt)
  6075. oscmd("rm -rf targetroot/debian")
  6076. # Package it all up into a .deb file.
  6077. oscmd("chmod -R 755 targetroot/DEBIAN")
  6078. oscmd("chmod 644 targetroot/DEBIAN/control targetroot/DEBIAN/md5sums")
  6079. if not RUNTIME:
  6080. oscmd("chmod 644 targetroot/DEBIAN/conffiles targetroot/DEBIAN/symbols")
  6081. oscmd("fakeroot dpkg-deb -b targetroot %s_%s_%s.deb" % (pkg_name, pkg_version, pkg_arch))
  6082. elif rpmbuild_present:
  6083. # Invoke installpanda.py to install it into a temporary dir
  6084. if RUNTIME:
  6085. InstallRuntime(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6086. else:
  6087. InstallPanda(destdir="targetroot", prefix="/usr", outputdir=GetOutputDir(), libdir=GetRPMLibDir())
  6088. oscmd("chmod -R 755 targetroot/usr/share/panda3d")
  6089. oscmd("rpm -E '%_target_cpu' > "+GetOutputDir()+"/tmp/architecture.txt")
  6090. ARCH = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6091. pandasource = os.path.abspath(os.getcwd())
  6092. if RUNTIME:
  6093. txt = RUNTIME_INSTALLER_SPEC_FILE[1:]
  6094. else:
  6095. txt = INSTALLER_SPEC_FILE[1:]
  6096. # Add the binaries in /usr/bin explicitly to the spec file
  6097. for base in os.listdir(GetOutputDir() + "/bin"):
  6098. txt += "/usr/bin/%s\n" % (base)
  6099. # Write out the spec file.
  6100. txt = txt.replace("VERSION", VERSION)
  6101. txt = txt.replace("RPMRELEASE", RPMRELEASE)
  6102. txt = txt.replace("PANDASOURCE", pandasource)
  6103. txt = txt.replace("PV", PV)
  6104. WriteFile("panda3d.spec", txt)
  6105. oscmd("fakeroot rpmbuild --define '_rpmdir "+pandasource+"' --buildroot '"+os.path.abspath("targetroot")+"' -bb panda3d.spec")
  6106. if (RUNTIME):
  6107. oscmd("mv "+ARCH+"/panda3d-runtime-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6108. else:
  6109. oscmd("mv "+ARCH+"/panda3d-"+VERSION+"-"+RPMRELEASE+"."+ARCH+".rpm .")
  6110. oscmd("rm -rf "+ARCH, True)
  6111. else:
  6112. exit("To build an installer, either rpmbuild or dpkg-deb must be present on your system!")
  6113. def MakeInstallerOSX():
  6114. if (RUNTIME):
  6115. # Invoke the make_installer script.
  6116. AddToPathEnv("DYLD_LIBRARY_PATH", GetOutputDir() + "/plugins")
  6117. cmdstr = sys.executable + " "
  6118. if sys.version_info >= (2, 6):
  6119. cmdstr += "-B "
  6120. cmdstr += "direct/src/plugin_installer/make_installer.py --version %s" % VERSION
  6121. oscmd(cmdstr)
  6122. return
  6123. dmg_name = "Panda3D-" + VERSION
  6124. if not SDK["PYTHONVERSION"].startswith("python2."):
  6125. dmg_name += '-py' + SDK["PYTHONVERSION"][6:9]
  6126. dmg_name += ".dmg"
  6127. import compileall
  6128. if (os.path.isfile(dmg_name)): oscmd("rm -f %s" % dmg_name)
  6129. if (os.path.exists("dstroot")): oscmd("rm -rf dstroot")
  6130. if (os.path.exists("Panda3D-rw.dmg")): oscmd('rm -f Panda3D-rw.dmg')
  6131. oscmd("mkdir -p dstroot/base/Developer/Panda3D/lib")
  6132. oscmd("mkdir -p dstroot/base/Developer/Panda3D/etc")
  6133. oscmd("cp %s/etc/Config.prc dstroot/base/Developer/Panda3D/etc/Config.prc" % GetOutputDir())
  6134. oscmd("cp %s/etc/Confauto.prc dstroot/base/Developer/Panda3D/etc/Confauto.prc" % GetOutputDir())
  6135. oscmd("cp -R %s/models dstroot/base/Developer/Panda3D/models" % GetOutputDir())
  6136. oscmd("cp -R doc/LICENSE dstroot/base/Developer/Panda3D/LICENSE")
  6137. oscmd("cp -R doc/ReleaseNotes dstroot/base/Developer/Panda3D/ReleaseNotes")
  6138. oscmd("cp -R %s/Frameworks dstroot/base/Developer/Panda3D/Frameworks" % GetOutputDir())
  6139. if os.path.isdir(GetOutputDir()+"/plugins"):
  6140. oscmd("cp -R %s/plugins dstroot/base/Developer/Panda3D/plugins" % GetOutputDir())
  6141. # Libraries that shouldn't be in base, but are instead in other modules.
  6142. no_base_libs = ['libp3ffmpeg', 'libp3fmod_audio', 'libfmodex', 'libfmodexL']
  6143. for base in os.listdir(GetOutputDir()+"/lib"):
  6144. if not base.endswith(".a") and base.split('.')[0] not in no_base_libs:
  6145. libname = "dstroot/base/Developer/Panda3D/lib/" + base
  6146. # We really need to specify -R in order not to follow symlinks
  6147. # On OSX, just specifying -P is not enough to do that.
  6148. oscmd("cp -R -P " + GetOutputDir() + "/lib/" + base + " " + libname)
  6149. oscmd("mkdir -p dstroot/tools/Developer/Panda3D/bin")
  6150. oscmd("mkdir -p dstroot/tools/Developer/Tools")
  6151. oscmd("ln -s ../Panda3D/bin dstroot/tools/Developer/Tools/Panda3D")
  6152. oscmd("mkdir -p dstroot/tools/etc/paths.d")
  6153. # Trailing newline is important, works around a bug in OSX
  6154. WriteFile("dstroot/tools/etc/paths.d/Panda3D", "/Developer/Panda3D/bin\n")
  6155. oscmd("mkdir -p dstroot/tools/usr/local/share/man/man1")
  6156. oscmd("cp doc/man/*.1 dstroot/tools/usr/local/share/man/man1/")
  6157. for base in os.listdir(GetOutputDir()+"/bin"):
  6158. binname = "dstroot/tools/Developer/Panda3D/bin/" + base
  6159. # OSX needs the -R argument to copy symbolic links correctly, it doesn't have -d. How weird.
  6160. oscmd("cp -R " + GetOutputDir() + "/bin/" + base + " " + binname)
  6161. if PkgSkip("PYTHON")==0:
  6162. PV = SDK["PYTHONVERSION"][6:9]
  6163. oscmd("mkdir -p dstroot/pythoncode/usr/local/bin")
  6164. oscmd("mkdir -p dstroot/pythoncode/Developer/Panda3D/panda3d")
  6165. oscmd("mkdir -p dstroot/pythoncode/Library/Python/%s/site-packages" % PV)
  6166. WriteFile("dstroot/pythoncode/Library/Python/%s/site-packages/Panda3D.pth" % PV, "/Developer/Panda3D")
  6167. oscmd("cp -R %s/pandac dstroot/pythoncode/Developer/Panda3D/pandac" % GetOutputDir())
  6168. oscmd("cp -R %s/direct dstroot/pythoncode/Developer/Panda3D/direct" % GetOutputDir())
  6169. oscmd("ln -s %s dstroot/pythoncode/usr/local/bin/ppython" % SDK["PYTHONEXEC"])
  6170. oscmd("cp -R %s/*.so dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6171. oscmd("cp -R %s/*.py dstroot/pythoncode/Developer/Panda3D/" % GetOutputDir(), True)
  6172. if os.path.isdir(GetOutputDir()+"/Pmw"):
  6173. oscmd("cp -R %s/Pmw dstroot/pythoncode/Developer/Panda3D/Pmw" % GetOutputDir())
  6174. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/Pmw")
  6175. WriteFile("dstroot/pythoncode/Developer/Panda3D/direct/__init__.py", "")
  6176. for base in os.listdir("dstroot/pythoncode/Developer/Panda3D/direct"):
  6177. if ((base != "extensions") and (base != "extensions_native")):
  6178. compileall.compile_dir("dstroot/pythoncode/Developer/Panda3D/direct/"+base)
  6179. for base in os.listdir(GetOutputDir()+"/panda3d"):
  6180. if base.endswith('.py') or base.endswith('.so'):
  6181. libname = "dstroot/pythoncode/Developer/Panda3D/panda3d/" + base
  6182. # We really need to specify -R in order not to follow symlinks
  6183. # On OSX, just specifying -P is not enough to do that.
  6184. oscmd("cp -R -P " + GetOutputDir() + "/panda3d/" + base + " " + libname)
  6185. if not PkgSkip("FFMPEG"):
  6186. oscmd("mkdir -p dstroot/ffmpeg/Developer/Panda3D/lib")
  6187. oscmd("cp -R %s/lib/libp3ffmpeg.* dstroot/ffmpeg/Developer/Panda3D/lib/" % GetOutputDir())
  6188. #if not PkgSkip("OPENAL"):
  6189. # oscmd("mkdir -p dstroot/openal/Developer/Panda3D/lib")
  6190. # oscmd("cp -R %s/lib/libp3openal_audio.* dstroot/openal/Developer/Panda3D/lib/" % GetOutputDir())
  6191. if not PkgSkip("FMODEX"):
  6192. oscmd("mkdir -p dstroot/fmodex/Developer/Panda3D/lib")
  6193. oscmd("cp -R %s/lib/libp3fmod_audio.* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6194. oscmd("cp -R %s/lib/libfmodex* dstroot/fmodex/Developer/Panda3D/lib/" % GetOutputDir())
  6195. oscmd("mkdir -p dstroot/headers/Developer/Panda3D/lib")
  6196. oscmd("cp -R %s/include dstroot/headers/Developer/Panda3D/include" % GetOutputDir())
  6197. if os.path.isfile(GetOutputDir() + "/lib/libp3pystub.a"):
  6198. oscmd("cp -R -P %s/lib/libp3pystub.a dstroot/headers/Developer/Panda3D/lib/" % GetOutputDir())
  6199. if os.path.isdir("samples"):
  6200. oscmd("mkdir -p dstroot/samples/Developer/Examples/Panda3D")
  6201. oscmd("cp -R samples/* dstroot/samples/Developer/Examples/Panda3D/")
  6202. oscmd("chmod -R 0775 dstroot/*")
  6203. DeleteVCS("dstroot")
  6204. DeleteBuildFiles("dstroot")
  6205. # We need to be root to perform a chown. Bleh.
  6206. # Fortunately PackageMaker does it for us, on 10.5 and above.
  6207. #oscmd("chown -R root:admin dstroot/*", True)
  6208. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/")
  6209. oscmd("mkdir -p dstroot/Panda3D/Panda3D.mpkg/Contents/Resources/en.lproj/")
  6210. pkgs = ["base", "tools", "headers"]
  6211. if not PkgSkip("PYTHON"): pkgs.append("pythoncode")
  6212. if not PkgSkip("FFMPEG"): pkgs.append("ffmpeg")
  6213. #if not PkgSkip("OPENAL"): pkgs.append("openal")
  6214. if not PkgSkip("FMODEX"): pkgs.append("fmodex")
  6215. if os.path.isdir("samples"): pkgs.append("samples")
  6216. for pkg in pkgs:
  6217. identifier = "org.panda3d.panda3d.%s.pkg" % pkg
  6218. plist = open("/tmp/Info_plist", "w")
  6219. plist.write(Info_plist % { "package_id" : identifier, "version" : VERSION })
  6220. plist.close()
  6221. if not os.path.isdir("dstroot/" + pkg):
  6222. os.makedirs("dstroot/" + pkg)
  6223. if OSXTARGET and OSXTARGET <= (10, 5):
  6224. target = '--target %d.%d' % (OSXTARGET)
  6225. else:
  6226. target = ''
  6227. if os.path.exists("/usr/bin/pkgbuild"):
  6228. # This new package builder is used in Lion and above.
  6229. cmd = '/usr/bin/pkgbuild --identifier ' + identifier + ' --version ' + VERSION + ' --root dstroot/' + pkg + '/ dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg'
  6230. # In older versions, we use PackageMaker. Apple keeps changing its location.
  6231. elif os.path.exists("/Developer/usr/bin/packagemaker"):
  6232. 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'
  6233. elif os.path.exists("/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6234. 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'
  6235. elif os.path.exists("/Developer/Tools/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6236. 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'
  6237. elif os.path.exists("/Developer/Tools/packagemaker"):
  6238. cmd = '/Developer/Tools/packagemaker -build -f dstroot/' + pkg + '/ -p dstroot/Panda3D/Panda3D.mpkg/Contents/Packages/' + pkg + '.pkg -i /tmp/Info_plist'
  6239. elif os.path.exists("/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"):
  6240. 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'
  6241. else:
  6242. exit("Neither pkgbuild nor PackageMaker could be found!")
  6243. oscmd(cmd)
  6244. if os.path.isfile("/tmp/Info_plist"):
  6245. oscmd("rm -f /tmp/Info_plist")
  6246. # Now that we've built all of the individual packages, build the metapackage.
  6247. dist = open("dstroot/Panda3D/Panda3D.mpkg/Contents/distribution.dist", "w")
  6248. dist.write('<?xml version="1.0" encoding="utf-8"?>\n')
  6249. dist.write('<installer-script minSpecVersion="1.000000" authoringTool="com.apple.PackageMaker" authoringToolVersion="3.0.3" authoringToolBuild="174">\n')
  6250. dist.write(' <title>Panda3D SDK %s</title>\n' % (VERSION))
  6251. dist.write(' <options customize="always" allow-external-scripts="no" rootVolumeOnly="false"/>\n')
  6252. dist.write(' <license language="en" mime-type="text/plain">%s</license>\n' % ReadFile("doc/LICENSE"))
  6253. dist.write(' <choices-outline>\n')
  6254. for pkg in pkgs:
  6255. dist.write(' <line choice="%s"/>\n' % (pkg))
  6256. dist.write(' </choices-outline>\n')
  6257. 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')
  6258. dist.write(' <pkg-ref id="org.panda3d.panda3d.base.pkg"/>\n')
  6259. dist.write(' </choice>\n')
  6260. 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')
  6261. dist.write(' <pkg-ref id="org.panda3d.panda3d.tools.pkg"/>\n')
  6262. dist.write(' </choice>\n')
  6263. if not PkgSkip("PYTHON"):
  6264. 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')
  6265. dist.write(' <pkg-ref id="org.panda3d.panda3d.pythoncode.pkg"/>\n')
  6266. dist.write(' </choice>\n')
  6267. if not PkgSkip("FFMPEG"):
  6268. 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.')
  6269. if PkgSkip("VORBIS") and PkgSkip("OPUS"):
  6270. dist.write(' It is not required for loading .wav files, which Panda3D can read out of the box.">\n')
  6271. elif PkgSkip("VORBIS"):
  6272. dist.write(' It is not required for loading .wav or .opus files, which Panda3D can read out of the box.">\n')
  6273. elif PkgSkip("OPUS"):
  6274. dist.write(' It is not required for loading .wav or .ogg files, which Panda3D can read out of the box.">\n')
  6275. else:
  6276. dist.write(' It is not required for loading .wav, .ogg or .opus files, which Panda3D can read out of the box.">\n')
  6277. dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
  6278. dist.write(' </choice>\n')
  6279. #if not PkgSkip("OPENAL"):
  6280. # 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')
  6281. # dist.write(' <pkg-ref id="org.panda3d.panda3d.openal.pkg"/>\n')
  6282. # dist.write(' </choice>\n')
  6283. if not PkgSkip("FMODEX"):
  6284. 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')
  6285. dist.write(' <pkg-ref id="org.panda3d.panda3d.fmodex.pkg"/>\n')
  6286. dist.write(' </choice>\n')
  6287. if os.path.isdir("samples"):
  6288. 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')
  6289. dist.write(' <pkg-ref id="org.panda3d.panda3d.samples.pkg"/>\n')
  6290. dist.write(' </choice>\n')
  6291. 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')
  6292. dist.write(' <pkg-ref id="org.panda3d.panda3d.headers.pkg"/>\n')
  6293. dist.write(' </choice>\n')
  6294. for pkg in pkgs:
  6295. size = GetDirectorySize("dstroot/" + pkg) // 1024
  6296. 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))
  6297. dist.write('</installer-script>\n')
  6298. dist.close()
  6299. oscmd('hdiutil create Panda3D-rw.dmg -volname "Panda3D SDK %s" -srcfolder dstroot/Panda3D' % (VERSION))
  6300. oscmd('hdiutil convert Panda3D-rw.dmg -format UDBZ -o %s' % (dmg_name))
  6301. oscmd('rm -f Panda3D-rw.dmg')
  6302. def MakeInstallerFreeBSD():
  6303. oscmd("rm -rf targetroot +DESC pkg-plist +MANIFEST")
  6304. oscmd("mkdir targetroot")
  6305. # Invoke installpanda.py to install it into a temporary dir
  6306. if RUNTIME:
  6307. InstallRuntime(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6308. else:
  6309. InstallPanda(destdir = "targetroot", prefix = "/usr/local", outputdir = GetOutputDir())
  6310. if not os.path.exists("/usr/sbin/pkg"):
  6311. exit("Cannot create an installer without pkg")
  6312. plist_txt = ''
  6313. for root, dirs, files in os.walk("targetroot/usr/local/", True):
  6314. for f in files:
  6315. plist_txt += os.path.join(root, f)[21:] + "\n"
  6316. if not RUNTIME:
  6317. plist_txt += "@postexec /sbin/ldconfig -m /usr/local/lib\n"
  6318. plist_txt += "@postunexec /sbin/ldconfig -R\n"
  6319. for remdir in ("lib/panda3d", "share/panda3d", "include/panda3d"):
  6320. for root, dirs, files in os.walk("targetroot/usr/local/" + remdir, False):
  6321. for d in dirs:
  6322. plist_txt += "@dir %s\n" % os.path.join(root, d)[21:]
  6323. plist_txt += "@dir %s\n" % remdir
  6324. oscmd("echo \"`pkg config abi | tr '[:upper:]' '[:lower:]' | cut -d: -f1,2`:*\" > " + GetOutputDir() + "/tmp/architecture.txt")
  6325. pkg_arch = ReadFile(GetOutputDir()+"/tmp/architecture.txt").strip()
  6326. dependencies = ''
  6327. if PkgSkip("PYTHON") == 0:
  6328. # If this version of Python was installed from a package or ports, let's mark it as dependency.
  6329. oscmd("rm -f %s/tmp/python_dep" % GetOutputDir())
  6330. 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)
  6331. if os.path.isfile(GetOutputDir() + "/tmp/python_dep"):
  6332. python_pkg = ReadFile(GetOutputDir() + "/tmp/python_dep")
  6333. if python_pkg:
  6334. dependencies += python_pkg
  6335. manifest_txt = INSTALLER_PKG_MANIFEST_FILE[1:].replace("NAME", 'Panda3D' if not RUNTIME else 'Panda3D-Runtime')
  6336. manifest_txt = manifest_txt.replace("VERSION", VERSION)
  6337. manifest_txt = manifest_txt.replace("ARCH", pkg_arch)
  6338. manifest_txt = manifest_txt.replace("ORIGIN", 'devel/panda3d' if not RUNTIME else 'graphics/panda3d-runtime')
  6339. manifest_txt = manifest_txt.replace("DEPENDS", dependencies)
  6340. manifest_txt = manifest_txt.replace("INSTSIZE", str(GetDirectorySize("targetroot") / 1024 / 1024))
  6341. WriteFile("pkg-plist", plist_txt)
  6342. WriteFile("+DESC", INSTALLER_PKG_DESCR_FILE[1:] if not RUNTIME else RUNTIME_INSTALLER_PKG_DESCR_FILE[1:])
  6343. WriteFile("+MANIFEST", manifest_txt)
  6344. oscmd("pkg create -p pkg-plist -r %s -m . -o . %s" % (os.path.abspath("targetroot"), "--verbose" if GetVerbose() else "--quiet"))
  6345. try:
  6346. if INSTALLER:
  6347. ProgressOutput(100.0, "Building installer")
  6348. target = GetTarget()
  6349. if target == 'windows':
  6350. fn = "Panda3D-"
  6351. dir = "Panda3D-" + VERSION
  6352. if RUNTIME:
  6353. fn += "Runtime-"
  6354. title = "Panda3D " + VERSION
  6355. else:
  6356. title = "Panda3D SDK " + VERSION
  6357. fn += VERSION
  6358. if not RUNTIME and SDK["PYTHONVERSION"] != "python2.7":
  6359. fn += '-py' + SDK["PYTHONVERSION"][6:]
  6360. if GetOptimize() <= 2:
  6361. fn += "-dbg"
  6362. if GetTargetArch() == 'x64':
  6363. fn += '-x64'
  6364. dir += '-x64'
  6365. MakeInstallerNSIS(fn + '.exe', title, 'C:\\' + dir)
  6366. if not RUNTIME:
  6367. MakeDebugSymbolArchive(fn + '-pdb.zip', dir)
  6368. elif (target == 'linux'):
  6369. MakeInstallerLinux()
  6370. elif (target == 'darwin'):
  6371. MakeInstallerOSX()
  6372. elif (target == 'freebsd'):
  6373. MakeInstallerFreeBSD()
  6374. else:
  6375. exit("Do not know how to make an installer for this platform")
  6376. if WHEEL:
  6377. ProgressOutput(100.0, "Building wheel")
  6378. from makewheel import makewheel
  6379. makewheel(WHLVERSION, GetOutputDir())
  6380. finally:
  6381. SaveDependencyCache()
  6382. ##########################################################################################
  6383. #
  6384. # Print final status report.
  6385. #
  6386. ##########################################################################################
  6387. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6388. printStatus("Makepanda Final Status Report", WARNINGS)
  6389. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())