makepanda.py 307 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079
  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 KeyboardInterrupt:
  19. raise
  20. except:
  21. print("You are either using an incomplete or an old version of Python!")
  22. print("Please install the development package of Python and try again.")
  23. exit(1)
  24. from makepandacore import *
  25. from distutils.util import get_platform
  26. import time
  27. import os
  28. import sys
  29. ########################################################################
  30. ##
  31. ## PARSING THE COMMAND LINE OPTIONS
  32. ##
  33. ## You might be tempted to change the defaults by editing them
  34. ## here. Don't do it. Instead, create a script that compiles
  35. ## panda with your preferred options. Or, create
  36. ## a 'makepandaPreferences' file and put it into your python path.
  37. ##
  38. ########################################################################
  39. COMPILER=0
  40. INSTALLER=0
  41. WHEEL=0
  42. RUNTESTS=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. CXXFLAGS=""
  48. LDFLAGS=""
  49. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMRELEASE="1"
  57. GIT_COMMIT=None
  58. P3DSUFFIX=None
  59. MAJOR_VERSION=None
  60. COREAPI_VERSION=None
  61. PLUGIN_VERSION=None
  62. OSXTARGET=None
  63. OSX_ARCHS=[]
  64. HOST_URL=None
  65. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  66. STRDXSDKVERSION = 'default'
  67. WINDOWS_SDK = None
  68. MSVC_VERSION = None
  69. BOOUSEINTELCOMPILER = False
  70. OPENCV_VER_23 = False
  71. PLATFORM = None
  72. COPY_PYTHON = True
  73. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  74. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  75. PkgListSet(["PYTHON", "DIRECT", # Python support
  76. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  77. "EGL", # OpenGL (ES) integration
  78. "EIGEN", # Linear algebra acceleration
  79. "OPENAL", "FMODEX", # Audio playback
  80. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  81. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  82. "SPEEDTREE", # SpeedTree
  83. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  84. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  85. "FREETYPE", "HARFBUZZ", # Text rendering
  86. "VRPN", "OPENSSL", # Transport
  87. "FFTW", # Algorithm helpers
  88. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  89. "GTK2", # GTK2 is used for PStats on Unix
  90. "MFC", "WX", "FLTK", # Used for web plug-in only
  91. "ROCKET", # GUI libraries
  92. "CARBON", "COCOA", # Mac OS X toolkits
  93. "X11", # Unix platform support
  94. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  95. "SKEL", # Example SKEL project
  96. "PANDAFX", # Some distortion special lenses
  97. "PANDAPARTICLESYSTEM", # Built in particle system
  98. "CONTRIB", # Experimental
  99. "SSE2", "NEON", # Compiler features
  100. ])
  101. CheckPandaSourceTree()
  102. def keyboardInterruptHandler(x,y):
  103. exit("keyboard interrupt")
  104. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  105. ########################################################################
  106. ##
  107. ## Command-line parser.
  108. ##
  109. ## You can type "makepanda --help" to see all the options.
  110. ##
  111. ########################################################################
  112. def usage(problem):
  113. if (problem):
  114. print("")
  115. print("Error parsing command-line input: %s" % (problem))
  116. print("")
  117. print("Makepanda generates a 'built' subdirectory containing a")
  118. print("compiled copy of Panda3D. Command-line arguments are:")
  119. print("")
  120. print(" --help (print the help message you're reading now)")
  121. print(" --verbose (print out more information)")
  122. print(" --runtime (build a runtime build instead of an SDK build)")
  123. print(" --tests (run the test suite)")
  124. print(" --installer (build an installer)")
  125. print(" --wheel (build a pip-installable .whl)")
  126. print(" --optimize X (optimization level can be 1,2,3,4)")
  127. print(" --version X (set the panda version number)")
  128. print(" --lzma (use lzma compression when building Windows installer)")
  129. print(" --distributor X (short string identifying the distributor of the build)")
  130. print(" --outputdir X (use the specified directory instead of 'built')")
  131. print(" --host URL (set the host url (runtime build only))")
  132. print(" --threads N (use the multithreaded build system. see manual)")
  133. print(" --osxtarget N (the OS X version number to build for (OS X only))")
  134. print(" --universal (build universal binaries (OS X only))")
  135. print(" --override \"O=V\" (override dtool_config/prc option value)")
  136. print(" --static (builds libraries for static linking)")
  137. print(" --target X (experimental cross-compilation (android only))")
  138. print(" --arch X (target architecture for cross-compilation)")
  139. print("")
  140. for pkg in PkgListGet():
  141. p = pkg.lower()
  142. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  143. if sys.platform != 'win32':
  144. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  145. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  146. print("")
  147. print(" --nothing (disable every third-party lib)")
  148. print(" --everything (enable every third-party lib)")
  149. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  150. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1 or 10. Default is 7.1)")
  151. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2. Default is 14)")
  152. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  153. print("")
  154. print("The simplest way to compile panda is to just type:")
  155. print("")
  156. print(" makepanda --everything")
  157. print("")
  158. os._exit(1)
  159. def parseopts(args):
  160. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  161. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  162. global DEBVERSION,WHLVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  163. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  164. global COPY_PYTHON
  165. # Options for which to display a deprecation warning.
  166. removedopts = [
  167. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  168. ]
  169. # All recognized options.
  170. longopts = [
  171. "help","distributor=","verbose","runtime","osxtarget=","tests",
  172. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  173. "version=","lzma","no-python","threads=","outputdir=","override=",
  174. "static","host=","debversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  175. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  176. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  177. "cggl-incdir=", "cggl-libdir=",
  178. ] + removedopts
  179. anything = 0
  180. optimize = ""
  181. target = None
  182. target_arch = None
  183. universal = False
  184. clean_build = False
  185. for pkg in PkgListGet():
  186. longopts.append("use-" + pkg.lower())
  187. longopts.append("no-" + pkg.lower())
  188. longopts.append(pkg.lower() + "-incdir=")
  189. longopts.append(pkg.lower() + "-libdir=")
  190. try:
  191. opts, extras = getopt.getopt(args, "", longopts)
  192. for option, value in opts:
  193. if (option=="--help"): raise Exception
  194. elif (option=="--optimize"): optimize=value
  195. elif (option=="--installer"): INSTALLER=1
  196. elif (option=="--tests"): RUNTESTS=1
  197. elif (option=="--wheel"): WHEEL=1
  198. elif (option=="--verbose"): SetVerbose(True)
  199. elif (option=="--distributor"): DISTRIBUTOR=value
  200. elif (option=="--rtdist"): RTDIST=1
  201. elif (option=="--runtime"): RUNTIME=1
  202. elif (option=="--genman"): GENMAN=1
  203. elif (option=="--everything"): PkgEnableAll()
  204. elif (option=="--nothing"): PkgDisableAll()
  205. elif (option=="--threads"): THREADCOUNT=int(value)
  206. elif (option=="--outputdir"): SetOutputDir(value.strip())
  207. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  208. elif (option=="--universal"): universal = True
  209. elif (option=="--target"): target = value.strip()
  210. elif (option=="--arch"): target_arch = value.strip()
  211. elif (option=="--nocolor"): DisableColors()
  212. elif (option=="--version"):
  213. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  214. if not match:
  215. usage("version requires three digits")
  216. WHLVERSION = value
  217. VERSION = match.group()
  218. elif (option=="--lzma"): COMPRESSOR="lzma"
  219. elif (option=="--override"): AddOverride(value.strip())
  220. elif (option=="--static"): SetLinkAllStatic(True)
  221. elif (option=="--host"): HOST_URL=value
  222. elif (option=="--debversion"): DEBVERSION=value
  223. elif (option=="--rpmrelease"): RPMRELEASE=value
  224. elif (option=="--git-commit"): GIT_COMMIT=value
  225. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  226. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  227. # Backward compatibility, OPENGL was renamed to GL
  228. elif (option=="--use-opengl"): PkgEnable("GL")
  229. elif (option=="--no-opengl"): PkgDisable("GL")
  230. elif (option=="--directx-sdk"):
  231. STRDXSDKVERSION = value.strip().lower()
  232. if STRDXSDKVERSION == '':
  233. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  234. STRDXSDKVERSION = 'default'
  235. elif (option=="--windows-sdk"):
  236. WINDOWS_SDK = value.strip().lower()
  237. elif (option=="--msvc-version"):
  238. MSVC_VERSION = value.strip().lower()
  239. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  240. elif (option=="--clean"): clean_build = True
  241. elif (option=="--no-copy-python"): COPY_PYTHON = False
  242. elif (option[2:] in removedopts):
  243. Warn("Ignoring removed option %s" % (option))
  244. else:
  245. for pkg in PkgListGet() + ['CGGL']:
  246. if option == "--use-" + pkg.lower():
  247. PkgEnable(pkg)
  248. break
  249. elif option == "--no-" + pkg.lower():
  250. PkgDisable(pkg)
  251. break
  252. elif option == "--" + pkg.lower() + "-incdir":
  253. PkgSetCustomLocation(pkg)
  254. IncDirectory(pkg, value)
  255. break
  256. elif option == "--" + pkg.lower() + "-libdir":
  257. PkgSetCustomLocation(pkg)
  258. LibDirectory(pkg, value)
  259. break
  260. if (option == "--everything" or option.startswith("--use-")
  261. or option == "--nothing" or option.startswith("--no-")):
  262. anything = 1
  263. except:
  264. usage(sys.exc_info()[1])
  265. if not anything:
  266. if RUNTIME:
  267. PkgEnableAll()
  268. else:
  269. usage("You should specify a list of packages to use or --everything to enable all packages.")
  270. if (RTDIST and RUNTIME):
  271. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  272. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  273. elif (optimize==""): optimize = "3"
  274. if OSXTARGET:
  275. try:
  276. maj, min = OSXTARGET.strip().split('.')
  277. OSXTARGET = int(maj), int(min)
  278. assert OSXTARGET[0] == 10
  279. except:
  280. usage("Invalid setting for OSXTARGET")
  281. else:
  282. OSXTARGET = None
  283. if target is not None or target_arch is not None:
  284. SetTarget(target, target_arch)
  285. if universal:
  286. if target_arch:
  287. exit("--universal is incompatible with --arch")
  288. if OSXTARGET:
  289. osxver = OSXTARGET
  290. else:
  291. maj, min = platform.mac_ver()[0].split('.')[:2]
  292. osxver = int(maj), int(min)
  293. if osxver[1] < 15:
  294. OSX_ARCHS.append("i386")
  295. if osxver[1] < 6:
  296. OSX_ARCHS.append("ppc")
  297. else:
  298. OSX_ARCHS.append("x86_64")
  299. elif HasTargetArch():
  300. OSX_ARCHS.append(GetTargetArch())
  301. try:
  302. SetOptimize(int(optimize))
  303. assert GetOptimize() in [1, 2, 3, 4]
  304. except:
  305. usage("Invalid setting for OPTIMIZE")
  306. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  307. usage("Invalid SHA-1 hash given for --git-commit option!")
  308. if GetTarget() == 'windows':
  309. if not MSVC_VERSION:
  310. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  311. MSVC_VERSION = (14, 0)
  312. else:
  313. try:
  314. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  315. if (len(MSVC_VERSION) == 1):
  316. MSVC_VERSION += (0,)
  317. except:
  318. usage("Invalid setting for --msvc-version")
  319. if MSVC_VERSION < (14, 0):
  320. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  321. print("=========================================================================")
  322. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  323. print(warn_prefix + "For more information, or any questions, please visit:")
  324. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  325. print("=========================================================================")
  326. sys.stdout.flush()
  327. time.sleep(1.0)
  328. sys.exit(1)
  329. if not WINDOWS_SDK:
  330. print("No Windows SDK version specified. Defaulting to '7.1'.")
  331. WINDOWS_SDK = '7.1'
  332. if clean_build and os.path.isdir(GetOutputDir()):
  333. print("Deleting %s" % (GetOutputDir()))
  334. shutil.rmtree(GetOutputDir())
  335. parseopts(sys.argv[1:])
  336. ########################################################################
  337. ##
  338. ## Handle environment variables.
  339. ##
  340. ########################################################################
  341. if ("CFLAGS" in os.environ):
  342. CFLAGS = os.environ["CFLAGS"].strip()
  343. if ("CXXFLAGS" in os.environ):
  344. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  345. if ("RPM_OPT_FLAGS" in os.environ):
  346. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  347. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  348. if ("LDFLAGS" in os.environ):
  349. LDFLAGS = os.environ["LDFLAGS"].strip()
  350. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  351. if GetHost() == "darwin" and OSXTARGET is not None:
  352. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  353. ########################################################################
  354. ##
  355. ## Configure things based on the command-line parameters.
  356. ##
  357. ########################################################################
  358. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  359. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  360. if VERSION is None:
  361. if RUNTIME:
  362. VERSION = PLUGIN_VERSION
  363. else:
  364. # Take the value from the setup.cfg file.
  365. VERSION = GetMetadataValue('version')
  366. if WHLVERSION is None:
  367. WHLVERSION = VERSION
  368. print("Version: %s" % VERSION)
  369. if RUNTIME or RTDIST:
  370. print("Core API Version: %s" % COREAPI_VERSION)
  371. if DEBVERSION is None:
  372. DEBVERSION = VERSION
  373. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  374. if P3DSUFFIX is None:
  375. P3DSUFFIX = MAJOR_VERSION
  376. # Now determine the distutils-style platform tag for the target system.
  377. target = GetTarget()
  378. if target == 'windows':
  379. if GetTargetArch() == 'x64':
  380. PLATFORM = 'win-amd64'
  381. else:
  382. PLATFORM = 'win32'
  383. elif target == 'darwin':
  384. if OSXTARGET:
  385. osxver = OSXTARGET
  386. else:
  387. maj, min = platform.mac_ver()[0].split('.')[:2]
  388. osxver = int(maj), int(min)
  389. arch_tag = None
  390. if not OSX_ARCHS:
  391. arch_tag = GetTargetArch()
  392. elif len(OSX_ARCHS) == 1:
  393. arch_tag = OSX_ARCHS[0]
  394. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  395. arch_tag = 'fat'
  396. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  397. arch_tag = 'intel'
  398. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  399. arch_tag = 'fat64'
  400. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  401. arch_tag = 'fat32'
  402. else:
  403. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  404. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  405. elif target == 'linux' and (os.path.isfile("/lib/libc-2.5.so") or os.path.isfile("/lib64/libc-2.5.so")) and os.path.isdir("/opt/python"):
  406. # This is manylinux1. A bit of a sloppy check, though.
  407. if GetTargetArch() in ('x86_64', 'amd64'):
  408. PLATFORM = 'manylinux1-x86_64'
  409. else:
  410. PLATFORM = 'manylinux1-i686'
  411. elif target == 'linux' and (os.path.isfile("/lib/libc-2.12.so") or os.path.isfile("/lib64/libc-2.12.so")) and os.path.isdir("/opt/python"):
  412. # Same sloppy check for manylinux2010.
  413. if GetTargetArch() in ('x86_64', 'amd64'):
  414. PLATFORM = 'manylinux2010-x86_64'
  415. else:
  416. PLATFORM = 'manylinux2010-i686'
  417. elif target == 'linux' and (os.path.isfile("/lib/libc-2.17.so") or os.path.isfile("/lib64/libc-2.17.so")) and os.path.isdir("/opt/python"):
  418. # Same sloppy check for manylinux2014.
  419. if GetTargetArch() in ('x86_64', 'amd64'):
  420. PLATFORM = 'manylinux2014-x86_64'
  421. else:
  422. PLATFORM = 'manylinux2014-i686'
  423. elif not CrossCompiling():
  424. if HasTargetArch():
  425. # Replace the architecture in the platform string.
  426. platform_parts = get_platform().rsplit('-', 1)
  427. target_arch = GetTargetArch()
  428. if target_arch == 'amd64':
  429. target_arch = 'x86_64'
  430. PLATFORM = platform_parts[0] + '-' + target_arch
  431. else:
  432. # We're not cross-compiling; just take the host arch.
  433. PLATFORM = get_platform()
  434. else:
  435. target_arch = GetTargetArch()
  436. if target_arch == 'amd64':
  437. target_arch = 'x86_64'
  438. PLATFORM = '{0}-{1}'.format(target, target_arch)
  439. print("Platform: %s" % PLATFORM)
  440. outputdir_suffix = ""
  441. if (RUNTIME or RTDIST):
  442. # Compiling Maya/Max is pointless in rtdist build
  443. for ver in MAYAVERSIONS + MAXVERSIONS:
  444. PkgDisable(ver)
  445. if (DISTRIBUTOR.strip() == ""):
  446. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  447. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  448. if (RUNTIME):
  449. outputdir_suffix += "_rt"
  450. if DISTRIBUTOR == "":
  451. DISTRIBUTOR = "makepanda"
  452. elif not RTDIST_VERSION:
  453. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  454. if not RTDIST_VERSION:
  455. RTDIST_VERSION = "dev"
  456. if not IsCustomOutputDir():
  457. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  458. outputdir_suffix += '_x64'
  459. SetOutputDir("built" + outputdir_suffix)
  460. if (RUNTIME):
  461. for pkg in PkgListGet():
  462. if pkg in ["GTK2", "MFC"]:
  463. # Optional package(s) for runtime.
  464. pass
  465. elif pkg in ["OPENSSL", "ZLIB"]:
  466. # Required packages for runtime.
  467. if (PkgSkip(pkg)==1):
  468. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  469. else:
  470. # Unused packages for runtime.
  471. PkgDisable(pkg)
  472. if (INSTALLER and RTDIST):
  473. exit("Cannot build an installer for the rtdist build!")
  474. if (WHEEL and RUNTIME):
  475. exit("Cannot build a wheel for the runtime build!")
  476. if (WHEEL and RTDIST):
  477. exit("Cannot build a wheel for the rtdist build!")
  478. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  479. exit("Cannot build installer on Windows without python")
  480. if WHEEL and PkgSkip("PYTHON"):
  481. exit("Cannot build wheel without Python")
  482. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  483. exit("Cannot build rtdist without wx or fltk")
  484. if (RUNTIME):
  485. SetLinkAllStatic(True)
  486. if not os.path.isdir("contrib"):
  487. PkgDisable("CONTRIB")
  488. ########################################################################
  489. ##
  490. ## Load the dependency cache.
  491. ##
  492. ########################################################################
  493. LoadDependencyCache()
  494. ########################################################################
  495. ##
  496. ## Locate various SDKs.
  497. ##
  498. ########################################################################
  499. MakeBuildTree()
  500. SdkLocateDirectX(STRDXSDKVERSION)
  501. SdkLocateMaya()
  502. SdkLocateMax()
  503. SdkLocateMacOSX(OSXTARGET)
  504. SdkLocatePython(RTDIST)
  505. SdkLocateWindows(WINDOWS_SDK)
  506. SdkLocatePhysX()
  507. SdkLocateSpeedTree()
  508. SdkLocateAndroid()
  509. SdkAutoDisableDirectX()
  510. SdkAutoDisableMaya()
  511. SdkAutoDisableMax()
  512. SdkAutoDisablePhysX()
  513. SdkAutoDisableSpeedTree()
  514. if RTDIST and DISTRIBUTOR == "cmu":
  515. # Some validation checks for the CMU builds.
  516. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  517. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  518. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  519. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  520. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  521. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  522. if RTDIST and not HOST_URL:
  523. exit("You must specify a host URL when building the rtdist!")
  524. if RUNTIME and not HOST_URL:
  525. # Set this to a nice default.
  526. HOST_URL = "https://runtime.panda3d.org/"
  527. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  528. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  529. print("==========================================================================")
  530. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  531. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  532. print(warn_prefix + "Please upgrade to Python 3 now.")
  533. print("==========================================================================")
  534. sys.stdout.flush()
  535. # Give the user some time to contemplate their sins
  536. time.sleep(6.0)
  537. ########################################################################
  538. ##
  539. ## Choose a Compiler.
  540. ##
  541. ## This should also set up any environment variables needed to make
  542. ## the compiler work.
  543. ##
  544. ########################################################################
  545. if GetHost() == 'windows' and GetTarget() == 'windows':
  546. COMPILER = "MSVC"
  547. SdkLocateVisualStudio(MSVC_VERSION)
  548. else:
  549. COMPILER = "GCC"
  550. SetupBuildEnvironment(COMPILER)
  551. ########################################################################
  552. ##
  553. ## External includes, external libraries, and external defsyms.
  554. ##
  555. ########################################################################
  556. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  557. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  558. if (COMPILER == "MSVC"):
  559. PkgDisable("X11")
  560. PkgDisable("GLES")
  561. PkgDisable("GLES2")
  562. PkgDisable("EGL")
  563. PkgDisable("CARBON")
  564. PkgDisable("COCOA")
  565. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  566. if (PkgSkip("PYTHON")==0):
  567. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  568. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  569. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  570. for pkg in PkgListGet():
  571. if (PkgSkip(pkg)==0):
  572. if (pkg[:4]=="MAYA"):
  573. IncDirectory(pkg, SDK[pkg] + "/include")
  574. DefSymbol(pkg, "MAYAVERSION", pkg)
  575. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  576. elif (pkg[:3]=="MAX"):
  577. IncDirectory(pkg, SDK[pkg] + "/include")
  578. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  579. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  580. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  581. DefSymbol(pkg, "MAX", pkg)
  582. if (int(pkg[3:]) >= 2013):
  583. DefSymbol(pkg, "UNICODE", "")
  584. DefSymbol(pkg, "_UNICODE", "")
  585. elif (pkg[:2]=="DX"):
  586. IncDirectory(pkg, SDK[pkg] + "/include")
  587. elif GetThirdpartyDir() is not None:
  588. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  589. for pkg in DXVERSIONS:
  590. if (PkgSkip(pkg)==0):
  591. vnum=pkg[2:]
  592. if GetTargetArch() == 'x64':
  593. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  594. else:
  595. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  596. LibDirectory(pkg, SDK[pkg] + '/lib')
  597. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  598. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  599. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  600. LibName(pkg, 'dxerr.lib')
  601. else:
  602. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  603. #LibName(pkg, 'ddraw.lib')
  604. LibName(pkg, 'dxguid.lib')
  605. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  606. # dxerr needs this for __vsnwprintf definition.
  607. LibName(pkg, 'legacy_stdio_definitions.lib')
  608. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  609. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  610. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  611. LibName("WINSOCK", "wsock32.lib")
  612. LibName("WINSOCK2", "wsock32.lib")
  613. LibName("WINSOCK2", "ws2_32.lib")
  614. LibName("WINCOMCTL", "comctl32.lib")
  615. LibName("WINCOMDLG", "comdlg32.lib")
  616. LibName("WINUSER", "user32.lib")
  617. LibName("WINMM", "winmm.lib")
  618. LibName("WINIMM", "imm32.lib")
  619. LibName("WINKERNEL", "kernel32.lib")
  620. LibName("WINOLE", "ole32.lib")
  621. LibName("WINOLEAUT", "oleaut32.lib")
  622. LibName("WINOLDNAMES", "oldnames.lib")
  623. LibName("WINSHELL", "shell32.lib")
  624. LibName("WINGDI", "gdi32.lib")
  625. LibName("ADVAPI", "advapi32.lib")
  626. LibName("IPHLPAPI", "iphlpapi.lib")
  627. LibName("SETUPAPI", "setupapi.lib")
  628. LibName("GL", "opengl32.lib")
  629. LibName("GLES", "libgles_cm.lib")
  630. LibName("GLES2", "libGLESv2.lib")
  631. LibName("EGL", "libEGL.lib")
  632. LibName("MSIMG", "msimg32.lib")
  633. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  634. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  635. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  636. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  637. if (PkgSkip("OPENSSL")==0):
  638. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  639. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  640. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  641. else:
  642. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  643. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  644. if (PkgSkip("PNG")==0):
  645. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  646. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  647. else:
  648. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  649. if (PkgSkip("TIFF")==0):
  650. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  651. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  652. else:
  653. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  654. if (PkgSkip("OPENEXR")==0):
  655. suffix = ""
  656. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  657. suffix = "-2_2"
  658. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  659. suffix = "-2_3"
  660. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  661. suffix = "-2_4"
  662. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  663. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  664. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  665. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  666. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  667. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  668. if suffix == "-2_2":
  669. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  670. else:
  671. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  672. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  673. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  674. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  675. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  676. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  677. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  678. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  679. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  680. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  681. if (PkgSkip("HARFBUZZ")==0):
  682. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  683. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  684. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  685. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  686. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  687. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  688. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  689. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  690. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  691. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  692. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  693. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  694. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  695. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  696. if (PkgSkip("FCOLLADA")==0):
  697. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  698. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  699. if (PkgSkip("ASSIMP")==0):
  700. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  701. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  702. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  703. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  704. if (PkgSkip("SQUISH")==0):
  705. if GetOptimize() <= 2:
  706. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  707. else:
  708. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  709. if (PkgSkip("ROCKET")==0):
  710. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  711. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  712. if (PkgSkip("PYTHON")==0):
  713. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  714. if (GetOptimize() <= 3):
  715. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  716. if (PkgSkip("OPENAL")==0):
  717. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  718. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  719. # Link OpenAL Soft statically.
  720. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  721. if (PkgSkip("ODE")==0):
  722. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  723. DefSymbol("ODE", "dSINGLE", "")
  724. if (PkgSkip("FMODEX")==0):
  725. if (GetTargetArch() == 'x64'):
  726. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  727. else:
  728. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  729. if (PkgSkip("FLTK")==0 and RTDIST):
  730. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  731. if not PkgSkip("FLTK"):
  732. # If we have fltk, we don't need wx
  733. PkgDisable("WX")
  734. if (PkgSkip("WX")==0 and RTDIST):
  735. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  736. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  737. DefSymbol("WX", "__WXMSW__", "")
  738. DefSymbol("WX", "_UNICODE", "")
  739. DefSymbol("WX", "UNICODE", "")
  740. if (PkgSkip("VORBIS")==0):
  741. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  742. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  743. if not os.path.isfile(path):
  744. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  745. LibName("VORBIS", path)
  746. if (PkgSkip("OPUS")==0):
  747. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  748. for lib in ('ogg', 'opus', 'opusfile'):
  749. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  750. if not os.path.isfile(path):
  751. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  752. LibName("OPUS", path)
  753. for pkg in MAYAVERSIONS:
  754. if (PkgSkip(pkg)==0):
  755. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  756. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  757. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  758. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  759. for pkg in MAXVERSIONS:
  760. if (PkgSkip(pkg)==0):
  761. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  762. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  763. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  764. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  765. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  766. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  767. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  768. if (PkgSkip("PHYSX")==0):
  769. if GetTargetArch() == 'x64':
  770. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  771. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  772. else:
  773. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  774. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  775. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  776. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  777. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  778. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  779. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  780. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  781. if (PkgSkip("SPEEDTREE")==0):
  782. if GetTargetArch() == 'x64':
  783. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  784. p64ext = '64'
  785. else:
  786. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  787. p64ext = ''
  788. debugext = ''
  789. if (GetOptimize() <= 2): debugext = "_d"
  790. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  791. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  792. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  793. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  794. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  795. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  796. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  797. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  798. LibName("SPEEDTREE", "glu32.lib")
  799. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  800. if (PkgSkip("BULLET")==0):
  801. suffix = '.lib'
  802. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  803. suffix = '_x64.lib'
  804. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  805. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  806. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  807. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  808. if (COMPILER=="GCC"):
  809. if GetTarget() != "darwin":
  810. PkgDisable("CARBON")
  811. PkgDisable("COCOA")
  812. elif RUNTIME:
  813. # We don't support Cocoa in the runtime yet.
  814. PkgDisable("COCOA")
  815. if 'x86_64' in OSX_ARCHS:
  816. # 64-bits OS X doesn't have Carbon.
  817. PkgDisable("CARBON")
  818. #if (PkgSkip("PYTHON")==0):
  819. # IncDirectory("PYTHON", SDK["PYTHON"])
  820. if (GetHost() == "darwin"):
  821. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  822. IncDirectory("FREETYPE", "/usr/X11/include")
  823. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  824. LibDirectory("FREETYPE", "/usr/X11/lib")
  825. if (GetHost() == "freebsd"):
  826. IncDirectory("ALWAYS", "/usr/local/include")
  827. LibDirectory("ALWAYS", "/usr/local/lib")
  828. if (os.path.isdir("/usr/PCBSD")):
  829. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  830. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  831. if GetTarget() != "windows":
  832. PkgDisable("DIRECTCAM")
  833. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  834. # WARNING! The order of the ffmpeg libraries matters!
  835. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  836. assimp_libs = ("libassimp", "libassimpd")
  837. # Name pkg-config libs, include(dir)s
  838. if (not RUNTIME):
  839. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  840. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  841. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  842. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  843. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  844. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  845. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  846. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  847. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  848. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  849. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  850. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  851. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  852. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  853. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  854. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  855. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  856. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  857. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  858. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  859. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  860. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  861. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  862. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  863. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  864. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  865. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  866. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  867. # because there's a circular dependency between the two libraries.
  868. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  869. for (opt, name) in LIBNAMES:
  870. if opt == "FREETYPE":
  871. LibName("HARFBUZZ", name)
  872. if not PkgSkip("FFMPEG"):
  873. if GetTarget() == "darwin":
  874. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  875. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  876. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  877. # Needed when linking ffmpeg statically on Linux.
  878. LibName("FFMPEG", "-Wl,-Bsymbolic")
  879. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  880. for ffmpeg_lib in ffmpeg_libs:
  881. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  882. if GetTarget() != "darwin":
  883. for fcollada_lib in fcollada_libs:
  884. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  885. if not PkgSkip("SWSCALE"):
  886. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  887. if not PkgSkip("SWRESAMPLE"):
  888. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  889. if not PkgSkip("JPEG"):
  890. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  891. if not PkgSkip("TIFF"):
  892. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  893. if not PkgSkip("PNG"):
  894. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  895. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  896. if not PkgSkip("SQUISH"):
  897. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  898. if not PkgSkip("OPENEXR"):
  899. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  900. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  901. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  902. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  903. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  904. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  905. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  906. if not PkgSkip("VORBIS"):
  907. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  908. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  909. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  910. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  911. if not PkgSkip("OPUS"):
  912. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  913. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  914. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  915. if not PkgSkip("VRPN"):
  916. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  917. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  918. if not PkgSkip("ARTOOLKIT"):
  919. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  920. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  921. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  922. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  923. if cv_lib == "opencv_core":
  924. OPENCV_VER_23 = True
  925. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  926. else:
  927. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  928. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  929. else:
  930. PkgDisable("OPENCV")
  931. if not PkgSkip("OPENAL"):
  932. if GetTarget() == "darwin":
  933. LibName("OPENAL", "-framework AudioUnit")
  934. LibName("OPENAL", "-framework AudioToolbox")
  935. LibName("OPENAL", "-framework CoreAudio")
  936. else:
  937. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  938. if not PkgSkip("ASSIMP") and \
  939. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  940. # Also pick up IrrXML, which is needed when linking statically.
  941. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  942. if os.path.isfile(irrxml):
  943. LibName("ASSIMP", irrxml)
  944. if GetTarget() != "darwin":
  945. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  946. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  947. rocket_libs = ("RocketCore", "RocketControls")
  948. if (GetOptimize() <= 3):
  949. rocket_libs += ("RocketDebugger",)
  950. rocket_libs += ("boost_python",)
  951. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  952. if not PkgSkip("PYTHON"):
  953. python_lib = SDK["PYTHONVERSION"]
  954. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  955. if GetTarget() == "linux":
  956. LibName("PYTHON", "-lutil")
  957. LibName("PYTHON", "-lrt")
  958. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  959. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  960. SmartPkgEnable("GTK2", "gtk+-2.0")
  961. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  962. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  963. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  964. if (RTDIST):
  965. SmartPkgEnable("WX", tool = "wx-config")
  966. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  967. if GetTarget() != 'darwin':
  968. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  969. if not PkgSkip("NVIDIACG") and not RUNTIME:
  970. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  971. if not RUNTIME:
  972. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  973. if GetHost() != "darwin":
  974. # Workaround for an issue where pkg-config does not include this path
  975. if GetTargetArch() in ("x86_64", "amd64"):
  976. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  977. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  978. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  979. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  980. if not PkgSkip("X11"):
  981. if (os.path.isdir("/usr/X11R6/lib64")):
  982. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  983. else:
  984. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  985. elif not PkgSkip("X11"):
  986. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  987. if RUNTIME:
  988. # For the runtime, these packages are required
  989. for pkg in ["OPENSSL", "ZLIB"]:
  990. skips = []
  991. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  992. skips.append(pkg)
  993. if skips:
  994. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  995. for pkg in MAYAVERSIONS:
  996. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  997. if (GetHost() == "darwin"):
  998. # Sheesh, Autodesk really can't make up their mind
  999. # regarding the location of the Maya devkit on OS X.
  1000. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1001. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1002. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1003. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1004. if (os.path.isdir(SDK[pkg] + "/lib")):
  1005. LibDirectory(pkg, SDK[pkg] + "/lib")
  1006. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1007. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1008. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1009. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1010. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1011. IncDirectory(pkg, SDK[pkg] + "/include")
  1012. else:
  1013. LibDirectory(pkg, SDK[pkg] + "/lib")
  1014. IncDirectory(pkg, SDK[pkg] + "/include")
  1015. DefSymbol(pkg, "MAYAVERSION", pkg)
  1016. if GetTarget() == 'darwin':
  1017. LibName("ALWAYS", "-framework AppKit")
  1018. LibName("AGL", "-framework AGL")
  1019. LibName("CARBON", "-framework Carbon")
  1020. LibName("COCOA", "-framework Cocoa")
  1021. # Fix for a bug in OSX Leopard:
  1022. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1023. if GetTarget() == 'android':
  1024. LibName("ALWAYS", '-llog')
  1025. LibName("ANDROID", '-landroid')
  1026. LibName("JNIGRAPHICS", '-ljnigraphics')
  1027. for pkg in MAYAVERSIONS:
  1028. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1029. if GetTarget() == 'darwin':
  1030. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1031. else:
  1032. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1033. LibName(pkg, "-lOpenMaya")
  1034. LibName(pkg, "-lOpenMayaAnim")
  1035. LibName(pkg, "-lOpenMayaUI")
  1036. LibName(pkg, "-lAnimSlice")
  1037. LibName(pkg, "-lDeformSlice")
  1038. LibName(pkg, "-lModifiers")
  1039. LibName(pkg, "-lDynSlice")
  1040. LibName(pkg, "-lKinSlice")
  1041. LibName(pkg, "-lModelSlice")
  1042. LibName(pkg, "-lNurbsSlice")
  1043. LibName(pkg, "-lPolySlice")
  1044. LibName(pkg, "-lProjectSlice")
  1045. LibName(pkg, "-lImage")
  1046. LibName(pkg, "-lShared")
  1047. LibName(pkg, "-lTranslators")
  1048. LibName(pkg, "-lDataModel")
  1049. LibName(pkg, "-lRenderModel")
  1050. LibName(pkg, "-lNurbsEngine")
  1051. LibName(pkg, "-lDependEngine")
  1052. LibName(pkg, "-lCommandEngine")
  1053. LibName(pkg, "-lFoundation")
  1054. if pkg != "MAYA2020":
  1055. LibName(pkg, "-lIMFbase")
  1056. if GetTarget() != 'darwin':
  1057. LibName(pkg, "-lOpenMayalib")
  1058. else:
  1059. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1060. if (PkgSkip("PHYSX")==0):
  1061. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1062. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1063. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1064. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1065. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1066. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1067. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1068. if (GetHost() == "darwin"):
  1069. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1070. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1071. else:
  1072. LibName("PHYSX", "-lPhysXLoader")
  1073. LibName("PHYSX", "-lNxCharacter")
  1074. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1075. if GetLinkAllStatic():
  1076. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1077. if GetTarget() == 'android':
  1078. DefSymbol("ALWAYS", "ANDROID")
  1079. if not PkgSkip("EIGEN"):
  1080. if GetOptimize() >= 3:
  1081. if COMPILER == "MSVC":
  1082. # Squeeze out a bit more performance on MSVC builds...
  1083. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1084. # will turn them into runtime assertions.
  1085. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1086. ########################################################################
  1087. ##
  1088. ## Give a Status Report on Command-Line Options
  1089. ##
  1090. ########################################################################
  1091. def printStatus(header,warnings):
  1092. if GetVerbose():
  1093. print("")
  1094. print("-------------------------------------------------------------------")
  1095. print(header)
  1096. tkeep = ""
  1097. tomit = ""
  1098. for x in PkgListGet():
  1099. if PkgSkip(x):
  1100. tomit = tomit + x + " "
  1101. else:
  1102. tkeep = tkeep + x + " "
  1103. if RTDIST:
  1104. print("Makepanda: Runtime distribution build")
  1105. elif RUNTIME:
  1106. print("Makepanda: Runtime build")
  1107. else:
  1108. print("Makepanda: Regular build")
  1109. print("Makepanda: Compiler: %s" % (COMPILER))
  1110. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1111. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1112. print("Makepanda: Omit Pkg: %s" % (tomit))
  1113. if GENMAN:
  1114. print("Makepanda: Generate API reference manual")
  1115. else:
  1116. print("Makepanda: Don't generate API reference manual")
  1117. if GetHost() == "windows" and not RTDIST:
  1118. if INSTALLER:
  1119. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1120. else:
  1121. print("Makepanda: Don't build installer")
  1122. print("Makepanda: Version ID: %s" % (VERSION))
  1123. for x in warnings:
  1124. print("Makepanda: %s" % (x))
  1125. print("-------------------------------------------------------------------")
  1126. print("")
  1127. sys.stdout.flush()
  1128. ########################################################################
  1129. ##
  1130. ## BracketNameWithQuotes
  1131. ##
  1132. ########################################################################
  1133. def BracketNameWithQuotes(name):
  1134. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1135. if (name.startswith("-framework")): return name
  1136. if (name.startswith("-dylib_file")): return name
  1137. # Don't add quotes when it's not necessary.
  1138. if " " not in name: return name
  1139. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1140. if (name.startswith('"') and name.endswith('"')): return name
  1141. else: return '"' + name + '"'
  1142. ########################################################################
  1143. ##
  1144. ## CompileCxx
  1145. ##
  1146. ########################################################################
  1147. def CompileCxx(obj,src,opts):
  1148. ipath = GetListOption(opts, "DIR:")
  1149. optlevel = GetOptimizeOption(opts)
  1150. if (COMPILER=="MSVC"):
  1151. if not BOOUSEINTELCOMPILER:
  1152. cmd = "cl "
  1153. if GetTargetArch() == 'x64':
  1154. cmd += "/favor:blend "
  1155. cmd += "/wd4996 /wd4275 /wd4273 "
  1156. # We still target Windows XP.
  1157. cmd += "/DWINVER=0x501 "
  1158. # Work around a WinXP/2003 bug when using VS 2015+.
  1159. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1160. cmd += "/Zc:threadSafeInit- "
  1161. cmd += "/Fo" + obj + " /nologo /c"
  1162. if GetTargetArch() == 'x86':
  1163. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1164. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1165. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1166. else: # x86 without SSE2
  1167. cmd += " /arch:IA32"
  1168. for x in ipath: cmd += " /I" + x
  1169. for (opt,dir) in INCDIRECTORIES:
  1170. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1171. for (opt,var,val) in DEFSYMBOLS:
  1172. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1173. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1174. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1175. if (optlevel==2): cmd += " /MDd /Zi"
  1176. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1177. if (optlevel==4):
  1178. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1179. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1180. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1181. building = GetValueOption(opts, "BUILDING:")
  1182. if (building):
  1183. cmd += " /DBUILDING_" + building
  1184. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1185. cmd += " /bigobj"
  1186. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1187. if 'EXCEPTIONS' in opts:
  1188. cmd += " /EHsc"
  1189. else:
  1190. cmd += " /D_HAS_EXCEPTIONS=0"
  1191. if 'RTTI' not in opts:
  1192. cmd += " /GR-"
  1193. if GetTargetArch() == 'x64':
  1194. cmd += " /DWIN64_VC /DWIN64"
  1195. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1196. # To preserve Windows XP compatibility.
  1197. cmd += " /D_USING_V110_SDK71_"
  1198. cmd += " /W3 " + BracketNameWithQuotes(src)
  1199. oscmd(cmd)
  1200. else:
  1201. cmd = "icl "
  1202. if GetTargetArch() == 'x64':
  1203. cmd += "/favor:blend "
  1204. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1205. cmd += "/DWINVER=0x501 "
  1206. cmd += "/Fo" + obj + " /c"
  1207. for x in ipath: cmd += " /I" + x
  1208. for (opt,dir) in INCDIRECTORIES:
  1209. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1210. for (opt,var,val) in DEFSYMBOLS:
  1211. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1212. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1213. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1214. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1215. # core changes from jean-claude (dec 2011)
  1216. # ----------------------------------------
  1217. # performance will be seeked at level 3 & 4
  1218. # -----------------------------------------
  1219. if (optlevel==3):
  1220. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1221. cmd += " /Ob0"
  1222. cmd += " /Qipo-" # beware of IPO !!!
  1223. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1224. ## ----------------------------------------------------------------
  1225. if (optlevel==4):
  1226. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1227. cmd += " /Qipo" # optimization multi file
  1228. # for 3 & 4 optimization levels
  1229. # -----------------------------
  1230. if (optlevel>=3):
  1231. cmd += " /fp:fast=2"
  1232. cmd += " /Qftz"
  1233. cmd += " /Qfp-speculation:fast"
  1234. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1235. cmd += " /Qprec-div-"
  1236. cmd += " /Qsimd"
  1237. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1238. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1239. cmd += " /Qparallel" # enable parallelization
  1240. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1241. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1242. ## PCH files with a .pchi filename suffix and reduce build time.
  1243. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1244. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1245. cmd += " /Qpchi-" # keep it this way!
  1246. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1247. ## ------------------------------------
  1248. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1249. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1250. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1251. ## Ctor displacement /vd0 : Disable constructor displacement.
  1252. ## Choose this option only if no class constructors or destructors call virtual functions.
  1253. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1254. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1255. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1256. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1257. ## Alternate: #pragma pointers_to_members
  1258. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1259. building = GetValueOption(opts, "BUILDING:")
  1260. if (building): cmd += " /DBUILDING_" + building
  1261. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1262. cmd += " /bigobj"
  1263. # level of warnings and optimization reports
  1264. if GetVerbose():
  1265. cmd += " /W3 " # or /W4 or /Wall
  1266. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1267. else:
  1268. cmd += " /W1 "
  1269. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1270. if GetTargetArch() == 'x64':
  1271. cmd += " /DWIN64_VC /DWIN64"
  1272. cmd += " " + BracketNameWithQuotes(src)
  1273. oscmd(cmd)
  1274. if (COMPILER=="GCC"):
  1275. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1276. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1277. for (opt, dir) in INCDIRECTORIES:
  1278. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1279. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1280. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1281. for (opt,var,val) in DEFSYMBOLS:
  1282. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1283. for x in ipath: cmd += ' -I' + x
  1284. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1285. cmd += ' -fvisibility=hidden'
  1286. # Mac-specific flags.
  1287. if GetTarget() == "darwin":
  1288. cmd += " -Wno-deprecated-declarations"
  1289. if OSXTARGET is not None:
  1290. cmd += " -isysroot " + SDK["MACOSX"]
  1291. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1292. for arch in OSX_ARCHS:
  1293. if 'NOARCH:' + arch.upper() not in opts:
  1294. cmd += " -arch %s" % arch
  1295. if "SYSROOT" in SDK:
  1296. if GetTarget() != "android":
  1297. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1298. else:
  1299. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1300. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1301. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1302. cmd += ' -no-canonical-prefixes'
  1303. # Android-specific flags.
  1304. arch = GetTargetArch()
  1305. if GetTarget() == "android":
  1306. # Most of the specific optimization flags here were
  1307. # just copied from the default Android Makefiles.
  1308. if "ANDROID_API" in SDK:
  1309. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1310. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1311. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1312. cmd += ' -ffunction-sections -funwind-tables'
  1313. if arch == 'armv7a':
  1314. cmd += ' -target armv7-none-linux-androideabi'
  1315. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1316. cmd += ' -fno-integrated-as'
  1317. elif arch == 'arm':
  1318. cmd += ' -target armv5te-none-linux-androideabi'
  1319. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1320. cmd += ' -fno-integrated-as'
  1321. elif arch == 'aarch64':
  1322. cmd += ' -target aarch64-none-linux-android'
  1323. elif arch == 'mips':
  1324. cmd += ' -target mipsel-none-linux-android'
  1325. cmd += ' -mips32'
  1326. elif arch == 'mips64':
  1327. cmd += ' -target mips64el-none-linux-android'
  1328. cmd += ' -fintegrated-as'
  1329. elif arch == 'x86':
  1330. cmd += ' -target i686-none-linux-android'
  1331. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1332. cmd += ' -mstackrealign'
  1333. elif arch == 'x86_64':
  1334. cmd += ' -target x86_64-none-linux-android'
  1335. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1336. cmd += " -Wa,--noexecstack"
  1337. # Do we want thumb or arm instructions?
  1338. if arch.startswith('arm'):
  1339. if optlevel >= 3:
  1340. cmd += ' -mthumb'
  1341. else:
  1342. cmd += ' -marm'
  1343. # Enable SIMD instructions if requested
  1344. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1345. cmd += ' -mfpu=neon'
  1346. else:
  1347. cmd += " -pthread"
  1348. if not src.endswith(".c"):
  1349. # We don't use exceptions for most modules.
  1350. if 'EXCEPTIONS' in opts:
  1351. cmd += " -fexceptions"
  1352. else:
  1353. cmd += " -fno-exceptions"
  1354. if src.endswith(".mm"):
  1355. # Work around Apple compiler bug.
  1356. cmd += " -U__EXCEPTIONS"
  1357. target = GetTarget()
  1358. if 'RTTI' not in opts and target != "darwin":
  1359. # We always disable RTTI on Android for memory usage reasons.
  1360. if optlevel >= 4 or target == "android":
  1361. cmd += " -fno-rtti"
  1362. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1363. cmd += " -msse2"
  1364. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1365. cmd += " -fno-strict-aliasing"
  1366. if optlevel >= 3:
  1367. cmd += " -ffast-math -fno-stack-protector"
  1368. if optlevel == 3:
  1369. # Fast math is nice, but we'd like to see NaN in dev builds.
  1370. cmd += " -fno-finite-math-only"
  1371. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1372. cmd += " -fno-unsafe-math-optimizations"
  1373. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1374. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1375. if (optlevel==3): cmd += " -O2"
  1376. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1377. # Enable more warnings.
  1378. cmd += " -Wall -Wno-unused-function"
  1379. if not src.endswith(".c"):
  1380. cmd += " -Wno-reorder"
  1381. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1382. if optlevel == 4:
  1383. cmd += " -Wno-unused-variable"
  1384. if src.endswith(".c"):
  1385. cmd += ' ' + CFLAGS
  1386. else:
  1387. cmd += ' ' + CXXFLAGS
  1388. cmd = cmd.rstrip()
  1389. building = GetValueOption(opts, "BUILDING:")
  1390. if (building): cmd += " -DBUILDING_" + building
  1391. cmd += ' ' + BracketNameWithQuotes(src)
  1392. oscmd(cmd)
  1393. ########################################################################
  1394. ##
  1395. ## CompileBison
  1396. ##
  1397. ########################################################################
  1398. def CompileBison(wobj, wsrc, opts):
  1399. ifile = os.path.basename(wsrc)
  1400. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1401. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1402. pre = GetValueOption(opts, "BISONPREFIX_")
  1403. bison = GetBison()
  1404. if bison is None:
  1405. # We don't have bison. See if there is a prebuilt file.
  1406. base, ext = os.path.splitext(wsrc)
  1407. if os.path.isfile(base + '.h.prebuilt') and \
  1408. os.path.isfile(base + '.cxx.prebuilt'):
  1409. CopyFile(wdstc, base + '.cxx.prebuilt')
  1410. CopyFile(wdsth, base + '.h.prebuilt')
  1411. else:
  1412. exit('Could not find bison!')
  1413. else:
  1414. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1415. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1416. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1417. # Finally, compile the generated source file.
  1418. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1419. ########################################################################
  1420. ##
  1421. ## CompileFlex
  1422. ##
  1423. ########################################################################
  1424. def CompileFlex(wobj,wsrc,opts):
  1425. ifile = os.path.basename(wsrc)
  1426. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1427. pre = GetValueOption(opts, "BISONPREFIX_")
  1428. dashi = opts.count("FLEXDASHI")
  1429. flex = GetFlex()
  1430. if flex is None:
  1431. # We don't have flex. See if there is a prebuilt file.
  1432. base, ext = os.path.splitext(wsrc)
  1433. if os.path.isfile(base + '.cxx.prebuilt'):
  1434. CopyFile(wdst, base + '.cxx.prebuilt')
  1435. else:
  1436. exit('Could not find flex!')
  1437. else:
  1438. if (dashi):
  1439. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1440. else:
  1441. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1442. # Finally, compile the generated source file.
  1443. CompileCxx(wobj,wdst,opts)
  1444. ########################################################################
  1445. ##
  1446. ## CompileIgate
  1447. ##
  1448. ########################################################################
  1449. def CompileIgate(woutd,wsrc,opts):
  1450. outbase = os.path.basename(woutd)[:-3]
  1451. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1452. srcdir = GetValueOption(opts, "SRCDIR:")
  1453. module = GetValueOption(opts, "IMOD:")
  1454. library = GetValueOption(opts, "ILIB:")
  1455. ipath = GetListOption(opts, "DIR:")
  1456. if (PkgSkip("PYTHON")):
  1457. WriteFile(woutc, "")
  1458. WriteFile(woutd, "")
  1459. ConditionalWriteFile(woutd, "")
  1460. return
  1461. if not CrossCompiling():
  1462. # If we're compiling for this platform, we can use the one we've built.
  1463. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1464. else:
  1465. # Assume that interrogate is on the PATH somewhere.
  1466. cmd = 'interrogate'
  1467. if GetVerbose():
  1468. cmd += ' -v'
  1469. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1470. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1471. if (COMPILER=="MSVC"):
  1472. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1473. if GetTargetArch() == 'x64':
  1474. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1475. else:
  1476. cmd += ' -D_M_IX86'
  1477. # NOTE: this 1600 value is the version number for VC2010.
  1478. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1479. if (COMPILER=="GCC"):
  1480. cmd += ' -D__attribute__\\(x\\)='
  1481. target_arch = GetTargetArch()
  1482. if target_arch in ("x86_64", "amd64"):
  1483. cmd += ' -D_LP64'
  1484. elif target_arch == 'aarch64':
  1485. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1486. else:
  1487. cmd += ' -D__i386__'
  1488. target = GetTarget()
  1489. if target == 'darwin':
  1490. cmd += ' -D__APPLE__'
  1491. elif target == 'android':
  1492. cmd += ' -D__ANDROID__'
  1493. optlevel = GetOptimizeOption(opts)
  1494. if (optlevel==1): cmd += ' -D_DEBUG'
  1495. if (optlevel==2): cmd += ' -D_DEBUG'
  1496. if (optlevel==3): pass
  1497. if (optlevel==4): cmd += ' -DNDEBUG'
  1498. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1499. cmd += ' -fnames -string -refcount -assert -python-native'
  1500. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1501. # Add -I, -S and -D flags
  1502. for x in ipath:
  1503. cmd += ' -I' + BracketNameWithQuotes(x)
  1504. for (opt,dir) in INCDIRECTORIES:
  1505. if (opt=="ALWAYS") or (opt in opts):
  1506. cmd += ' -S' + BracketNameWithQuotes(dir)
  1507. for (opt,var,val) in DEFSYMBOLS:
  1508. if (opt=="ALWAYS") or (opt in opts):
  1509. cmd += ' -D' + var + '=' + val
  1510. #building = GetValueOption(opts, "BUILDING:")
  1511. #if (building): cmd += " -DBUILDING_"+building
  1512. cmd += ' -module ' + module + ' -library ' + library
  1513. for x in wsrc:
  1514. if (x.startswith("/")):
  1515. cmd += ' ' + BracketNameWithQuotes(x)
  1516. else:
  1517. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1518. oscmd(cmd)
  1519. ########################################################################
  1520. ##
  1521. ## CompileImod
  1522. ##
  1523. ########################################################################
  1524. def CompileImod(wobj, wsrc, opts):
  1525. module = GetValueOption(opts, "IMOD:")
  1526. library = GetValueOption(opts, "ILIB:")
  1527. if (COMPILER=="MSVC"):
  1528. woutc = wobj[:-4]+".cxx"
  1529. if (COMPILER=="GCC"):
  1530. woutc = wobj[:-2]+".cxx"
  1531. if (PkgSkip("PYTHON")):
  1532. WriteFile(woutc, "")
  1533. CompileCxx(wobj, woutc, opts)
  1534. return
  1535. if not CrossCompiling():
  1536. # If we're compiling for this platform, we can use the one we've built.
  1537. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1538. else:
  1539. # Assume that interrogate_module is on the PATH somewhere.
  1540. cmd = 'interrogate_module'
  1541. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1542. importmod = GetValueOption(opts, "IMPORT:")
  1543. if importmod:
  1544. cmd += ' -import ' + importmod
  1545. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1546. oscmd(cmd)
  1547. CompileCxx(wobj,woutc,opts)
  1548. return
  1549. ########################################################################
  1550. ##
  1551. ## CompileLib
  1552. ##
  1553. ########################################################################
  1554. def CompileLib(lib, obj, opts):
  1555. if (COMPILER=="MSVC"):
  1556. if not BOOUSEINTELCOMPILER:
  1557. #Use MSVC Linker
  1558. cmd = 'link /lib /nologo'
  1559. if GetOptimizeOption(opts) == 4:
  1560. cmd += " /LTCG"
  1561. if HasTargetArch():
  1562. cmd += " /MACHINE:" + GetTargetArch().upper()
  1563. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1564. for x in obj:
  1565. if not x.endswith('.lib'):
  1566. cmd += ' ' + BracketNameWithQuotes(x)
  1567. oscmd(cmd)
  1568. else:
  1569. # Choose Intel linker; from Jean-Claude
  1570. cmd = 'xilink /verbose:lib /lib '
  1571. if HasTargetArch():
  1572. cmd += " /MACHINE:" + GetTargetArch().upper()
  1573. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1574. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1575. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1576. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1577. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1578. oscmd(cmd)
  1579. if (COMPILER=="GCC"):
  1580. if GetTarget() == 'darwin':
  1581. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1582. else:
  1583. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1584. for x in obj:
  1585. if GetLinkAllStatic() and x.endswith('.a'):
  1586. continue
  1587. cmd += ' ' + BracketNameWithQuotes(x)
  1588. oscmd(cmd)
  1589. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1590. ########################################################################
  1591. ##
  1592. ## CompileLink
  1593. ##
  1594. ########################################################################
  1595. def CompileLink(dll, obj, opts):
  1596. if (COMPILER=="MSVC"):
  1597. if not BOOUSEINTELCOMPILER:
  1598. cmd = "link /nologo "
  1599. if HasTargetArch():
  1600. cmd += " /MACHINE:" + GetTargetArch().upper()
  1601. if ("MFC" not in opts):
  1602. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1603. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1604. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1605. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1606. optlevel = GetOptimizeOption(opts)
  1607. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1608. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1609. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1610. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1611. if ("MFC" in opts):
  1612. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1613. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1614. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1615. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1616. if not PkgSkip("PYTHON"):
  1617. # If we're building without Python, don't pick it up implicitly.
  1618. if "PYTHON" not in opts:
  1619. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1620. if optlevel <= 2:
  1621. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1622. else:
  1623. cmd += ' /NOD:{}.lib'.format(pythonv)
  1624. # Yes, we know we are importing "locally defined symbols".
  1625. for x in obj:
  1626. if x.endswith('libp3pystub.lib'):
  1627. cmd += ' /ignore:4049,4217'
  1628. break
  1629. # Set the subsystem. Specify that we want to target Windows XP.
  1630. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1631. cmd += " /SUBSYSTEM:" + subsystem
  1632. if GetTargetArch() == 'x64':
  1633. cmd += ",5.02"
  1634. else:
  1635. cmd += ",5.01"
  1636. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1637. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1638. for (opt, dir) in LIBDIRECTORIES:
  1639. if (opt=="ALWAYS") or (opt in opts):
  1640. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1641. for x in obj:
  1642. if x.endswith(".dll") or x.endswith(".pyd"):
  1643. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1644. elif x.endswith(".lib"):
  1645. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1646. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1647. exit("Error: in makepanda, specify "+dname+", not "+x)
  1648. cmd += ' ' + BracketNameWithQuotes(x)
  1649. elif x.endswith(".def"):
  1650. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1651. elif x.endswith(".dat"):
  1652. pass
  1653. else:
  1654. cmd += ' ' + BracketNameWithQuotes(x)
  1655. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1656. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1657. for (opt, name) in LIBNAMES:
  1658. if (opt=="ALWAYS") or (opt in opts):
  1659. cmd += " " + BracketNameWithQuotes(name)
  1660. oscmd(cmd)
  1661. else:
  1662. cmd = "xilink"
  1663. if GetVerbose(): cmd += " /verbose:lib"
  1664. if HasTargetArch():
  1665. cmd += " /MACHINE:" + GetTargetArch().upper()
  1666. if ("MFC" not in opts):
  1667. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1668. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1669. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1670. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1671. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1672. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1673. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1674. optlevel = GetOptimizeOption(opts)
  1675. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1676. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1677. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1678. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1679. if ("MFC" in opts):
  1680. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1681. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1682. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1683. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1684. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1685. if subsystem:
  1686. cmd += " /SUBSYSTEM:" + subsystem
  1687. if dll.endswith(".dll"):
  1688. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1689. for (opt, dir) in LIBDIRECTORIES:
  1690. if (opt=="ALWAYS") or (opt in opts):
  1691. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1692. for x in obj:
  1693. if x.endswith(".dll") or x.endswith(".pyd"):
  1694. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1695. elif x.endswith(".lib"):
  1696. dname = os.path.splitext(dll)[0]+".dll"
  1697. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1698. exit("Error: in makepanda, specify "+dname+", not "+x)
  1699. cmd += ' ' + BracketNameWithQuotes(x)
  1700. elif x.endswith(".def"):
  1701. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1702. elif x.endswith(".dat"):
  1703. pass
  1704. else:
  1705. cmd += ' ' + BracketNameWithQuotes(x)
  1706. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1707. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1708. for (opt, name) in LIBNAMES:
  1709. if (opt=="ALWAYS") or (opt in opts):
  1710. cmd += " " + BracketNameWithQuotes(name)
  1711. oscmd(cmd)
  1712. if COMPILER == "GCC":
  1713. cxx = GetCXX()
  1714. if GetOrigExt(dll) == ".exe":
  1715. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1716. if GetTarget() == "android":
  1717. # Necessary to work around an issue with libandroid depending on vendor libraries
  1718. cmd += ' -Wl,--allow-shlib-undefined'
  1719. else:
  1720. if (GetTarget() == "darwin"):
  1721. cmd = cxx + ' -undefined dynamic_lookup'
  1722. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1723. cmd += ' -bundle '
  1724. else:
  1725. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1726. cmd += ' -dynamiclib -install_name ' + install_name
  1727. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1728. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1729. else:
  1730. cmd = cxx + ' -shared'
  1731. # Always set soname on Android to avoid a linker warning when loading the library.
  1732. if "MODULE" not in opts or GetTarget() == 'android':
  1733. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1734. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1735. for x in obj:
  1736. if GetOrigExt(x) != ".dat":
  1737. cmd += ' ' + x
  1738. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1739. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1740. # Mac OS X specific flags.
  1741. if GetTarget() == 'darwin':
  1742. cmd += " -headerpad_max_install_names"
  1743. if OSXTARGET is not None:
  1744. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1745. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1746. for arch in OSX_ARCHS:
  1747. if 'NOARCH:' + arch.upper() not in opts:
  1748. cmd += " -arch %s" % arch
  1749. elif GetTarget() == 'android':
  1750. arch = GetTargetArch()
  1751. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1752. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1753. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1754. if arch == 'armv7a':
  1755. cmd += ' -target armv7-none-linux-androideabi'
  1756. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1757. elif arch == 'arm':
  1758. cmd += ' -target armv5te-none-linux-androideabi'
  1759. elif arch == 'aarch64':
  1760. cmd += ' -target aarch64-none-linux-android'
  1761. elif arch == 'mips':
  1762. cmd += ' -target mipsel-none-linux-android'
  1763. cmd += ' -mips32'
  1764. elif arch == 'mips64':
  1765. cmd += ' -target mips64el-none-linux-android'
  1766. elif arch == 'x86':
  1767. cmd += ' -target i686-none-linux-android'
  1768. elif arch == 'x86_64':
  1769. cmd += ' -target x86_64-none-linux-android'
  1770. cmd += ' -lc -lm'
  1771. else:
  1772. cmd += " -pthread"
  1773. if "SYSROOT" in SDK:
  1774. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1775. if LDFLAGS != "":
  1776. cmd += " " + LDFLAGS
  1777. # Don't link libraries with Python, except on Android.
  1778. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1779. opts = opts[:]
  1780. opts.remove("PYTHON")
  1781. for (opt, dir) in LIBDIRECTORIES:
  1782. if (opt=="ALWAYS") or (opt in opts):
  1783. cmd += ' -L' + BracketNameWithQuotes(dir)
  1784. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1785. if (opt=="ALWAYS") or (opt in opts):
  1786. cmd += ' -F' + BracketNameWithQuotes(dir)
  1787. for (opt, name) in LIBNAMES:
  1788. if (opt=="ALWAYS") or (opt in opts):
  1789. cmd += ' ' + BracketNameWithQuotes(name)
  1790. if GetTarget() != 'freebsd':
  1791. cmd += " -ldl"
  1792. oscmd(cmd)
  1793. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1794. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1795. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1796. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1797. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1798. if os.path.isfile(newdll):
  1799. os.remove(newdll)
  1800. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1801. elif dll.endswith("." + MAJOR_VERSION):
  1802. newdll = dll[:-len(MAJOR_VERSION)-1]
  1803. if os.path.isfile(newdll):
  1804. os.remove(newdll)
  1805. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1806. ##########################################################################################
  1807. #
  1808. # CompileEgg
  1809. #
  1810. ##########################################################################################
  1811. def CompileEgg(eggfile, src, opts):
  1812. pz = False
  1813. if eggfile.endswith(".pz"):
  1814. pz = True
  1815. eggfile = eggfile[:-3]
  1816. # Determine the location of the pzip and flt2egg tools.
  1817. if CrossCompiling():
  1818. # We may not be able to use our generated versions of these tools,
  1819. # so we'll expect them to already be present in the PATH.
  1820. pzip = 'pzip'
  1821. flt2egg = 'flt2egg'
  1822. else:
  1823. # If we're compiling for this machine, we can use the binaries we've built.
  1824. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1825. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1826. if not os.path.isfile(pzip):
  1827. pzip = 'pzip'
  1828. if not os.path.isfile(flt2egg):
  1829. flt2egg = 'flt2egg'
  1830. if src.endswith(".egg"):
  1831. CopyFile(eggfile, src)
  1832. elif src.endswith(".flt"):
  1833. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1834. if pz:
  1835. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1836. ##########################################################################################
  1837. #
  1838. # CompileRes, CompileRsrc
  1839. #
  1840. ##########################################################################################
  1841. def CompileRes(target, src, opts):
  1842. """Compiles a Windows .rc file into a .res file."""
  1843. ipath = GetListOption(opts, "DIR:")
  1844. if (COMPILER == "MSVC"):
  1845. cmd = "rc"
  1846. cmd += " /Fo" + BracketNameWithQuotes(target)
  1847. for x in ipath: cmd += " /I" + x
  1848. for (opt,dir) in INCDIRECTORIES:
  1849. if (opt=="ALWAYS") or (opt in opts):
  1850. cmd += " /I" + BracketNameWithQuotes(dir)
  1851. for (opt,var,val) in DEFSYMBOLS:
  1852. if (opt=="ALWAYS") or (opt in opts):
  1853. cmd += " /D" + var + "=" + val
  1854. cmd += " " + BracketNameWithQuotes(src)
  1855. else:
  1856. cmd = "windres"
  1857. for x in ipath: cmd += " -I" + x
  1858. for (opt,dir) in INCDIRECTORIES:
  1859. if (opt=="ALWAYS") or (opt in opts):
  1860. cmd += " -I" + BracketNameWithQuotes(dir)
  1861. for (opt,var,val) in DEFSYMBOLS:
  1862. if (opt=="ALWAYS") or (opt in opts):
  1863. cmd += " -D" + var + "=" + val
  1864. cmd += " -i " + BracketNameWithQuotes(src)
  1865. cmd += " -o " + BracketNameWithQuotes(target)
  1866. oscmd(cmd)
  1867. def CompileRsrc(target, src, opts):
  1868. """Compiles a Mac OS .r file into an .rsrc file."""
  1869. ipath = GetListOption(opts, "DIR:")
  1870. if os.path.isfile("/usr/bin/Rez"):
  1871. cmd = "Rez -useDF"
  1872. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1873. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1874. else:
  1875. cmd = "/Developer/Tools/Rez -useDF"
  1876. cmd += " -o " + BracketNameWithQuotes(target)
  1877. for x in ipath:
  1878. cmd += " -i " + x
  1879. for (opt,dir) in INCDIRECTORIES:
  1880. if (opt=="ALWAYS") or (opt in opts):
  1881. cmd += " -i " + BracketNameWithQuotes(dir)
  1882. for (opt,var,val) in DEFSYMBOLS:
  1883. if (opt=="ALWAYS") or (opt in opts):
  1884. if (val == ""):
  1885. cmd += " -d " + var
  1886. else:
  1887. cmd += " -d " + var + " = " + val
  1888. cmd += " " + BracketNameWithQuotes(src)
  1889. oscmd(cmd)
  1890. ##########################################################################################
  1891. #
  1892. # CompileJava (Android only)
  1893. #
  1894. ##########################################################################################
  1895. def CompileJava(target, src, opts):
  1896. """Compiles a .java file into a .class file."""
  1897. if GetHost() == 'android':
  1898. cmd = "ecj "
  1899. else:
  1900. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1901. optlevel = GetOptimizeOption(opts)
  1902. if optlevel >= 4:
  1903. cmd += "-debug:none "
  1904. cmd += "-cp " + GetOutputDir() + "/classes "
  1905. cmd += "-d " + GetOutputDir() + "/classes "
  1906. cmd += BracketNameWithQuotes(src)
  1907. oscmd(cmd)
  1908. ##########################################################################################
  1909. #
  1910. # FreezePy
  1911. #
  1912. ##########################################################################################
  1913. def FreezePy(target, inputs, opts):
  1914. assert len(inputs) > 0
  1915. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1916. if sys.version_info >= (2, 6):
  1917. cmdstr += "-B "
  1918. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1919. if 'FREEZE_STARTUP' in opts:
  1920. cmdstr += " -s"
  1921. if GetOrigExt(target) == '.exe':
  1922. src = inputs.pop(0)
  1923. else:
  1924. src = ""
  1925. for i in inputs:
  1926. i = os.path.splitext(i)[0]
  1927. i = i.replace('/', '.')
  1928. if i.startswith('direct.src'):
  1929. i = i.replace('.src.', '.')
  1930. cmdstr += " -i " + i
  1931. cmdstr += " -o " + target + " " + src
  1932. if ("LINK_PYTHON_STATIC" in opts):
  1933. os.environ["LINK_PYTHON_STATIC"] = "1"
  1934. oscmd(cmdstr)
  1935. if ("LINK_PYTHON_STATIC" in os.environ):
  1936. del os.environ["LINK_PYTHON_STATIC"]
  1937. if (not os.path.exists(target)):
  1938. exit("FREEZER_ERROR")
  1939. ##########################################################################################
  1940. #
  1941. # Package
  1942. #
  1943. ##########################################################################################
  1944. def Package(target, inputs, opts):
  1945. assert len(inputs) == 1
  1946. # Invoke the ppackage script.
  1947. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1948. if GetOptimizeOption(opts) >= 4:
  1949. command += "-OO "
  1950. if sys.version_info >= (2, 6):
  1951. command += "-B "
  1952. command += "direct/src/p3d/ppackage.py"
  1953. if not RTDIST:
  1954. # Don't compile Python sources, because we might not running in the same
  1955. # Python version as the selected host.
  1956. command += " -N"
  1957. if GetTarget() == "darwin":
  1958. if SDK.get("MACOSX"):
  1959. command += " -R \"%s\"" % SDK["MACOSX"]
  1960. for arch in OSX_ARCHS:
  1961. if arch == "x86_64":
  1962. arch = "amd64"
  1963. command += " -P osx_%s" % arch
  1964. command += " -i \"" + GetOutputDir() + "/stage\""
  1965. if (P3DSUFFIX):
  1966. command += ' -a "' + P3DSUFFIX + '"'
  1967. command += " " + inputs[0]
  1968. if GetOrigExt(target) == '.p3d':
  1969. # Build a specific .p3d file.
  1970. basename = os.path.basename(os.path.splitext(target)[0])
  1971. command += " " + basename
  1972. oscmd(command)
  1973. if GetTarget() == 'windows':
  1974. # Make an .exe that calls this .p3d.
  1975. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  1976. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  1977. exefile = FindLocation(basename + '.exe', [])
  1978. CompileLink(exefile, [objfile], ['ADVAPI'])
  1979. # Move it to the bin directory.
  1980. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  1981. if sys.platform != 'win32':
  1982. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  1983. else:
  1984. # This is presumably a package or set of packages.
  1985. oscmd(command)
  1986. ##########################################################################################
  1987. #
  1988. # CompileBundle
  1989. #
  1990. ##########################################################################################
  1991. def CompileBundle(target, inputs, opts):
  1992. assert GetTarget() == "darwin", 'bundles can only be made for Mac OS X'
  1993. plist = None
  1994. resources = []
  1995. objects = []
  1996. for i in inputs:
  1997. if (i.endswith(".plist")):
  1998. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  1999. plist = i
  2000. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2001. resources.append(i)
  2002. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2003. objects.append(i)
  2004. else:
  2005. exit("Don't know how to bundle file %s" % i)
  2006. # Now link the object files to form the bundle.
  2007. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2008. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2009. oscmd("rm -rf %s" % target)
  2010. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2011. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2012. if target.endswith(".app"):
  2013. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2014. else:
  2015. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2016. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2017. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2018. for r in resources:
  2019. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2020. ##########################################################################################
  2021. #
  2022. # CompileMIDL
  2023. #
  2024. ##########################################################################################
  2025. def CompileMIDL(target, src, opts):
  2026. ipath = GetListOption(opts, "DIR:")
  2027. if (COMPILER=="MSVC"):
  2028. cmd = "midl"
  2029. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2030. for x in ipath: cmd += " /I" + x
  2031. for (opt,dir) in INCDIRECTORIES:
  2032. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2033. for (opt,var,val) in DEFSYMBOLS:
  2034. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2035. cmd += " " + BracketNameWithQuotes(src)
  2036. oscmd(cmd)
  2037. ##########################################################################################
  2038. #
  2039. # CompileAnything
  2040. #
  2041. ##########################################################################################
  2042. def CompileAnything(target, inputs, opts, progress = None):
  2043. if (opts.count("DEPENDENCYONLY")):
  2044. return
  2045. if (len(inputs)==0):
  2046. exit("No input files for target "+target)
  2047. infile = inputs[0]
  2048. origsuffix = GetOrigExt(target)
  2049. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2050. # It must be a simple copy operation.
  2051. ProgressOutput(progress, "Copying file", target)
  2052. CopyFile(target, infile)
  2053. if (origsuffix==".exe" and GetHost() != "windows"):
  2054. os.system("chmod +x \"%s\"" % target)
  2055. return
  2056. elif (infile.endswith(".py")):
  2057. if origsuffix == ".obj":
  2058. source = os.path.splitext(target)[0] + ".c"
  2059. SetOrigExt(source, ".c")
  2060. ProgressOutput(progress, "Building frozen source", source)
  2061. FreezePy(source, inputs, opts)
  2062. ProgressOutput(progress, "Building C++ object", target)
  2063. return CompileCxx(target, source, opts)
  2064. if origsuffix == ".exe":
  2065. ProgressOutput(progress, "Building frozen executable", target)
  2066. else:
  2067. ProgressOutput(progress, "Building frozen library", target)
  2068. return FreezePy(target, inputs, opts)
  2069. elif (infile.endswith(".idl")):
  2070. ProgressOutput(progress, "Compiling MIDL file", infile)
  2071. return CompileMIDL(target, infile, opts)
  2072. elif (infile.endswith(".pdef")):
  2073. if origsuffix == '.p3d':
  2074. ProgressOutput(progress, "Building package", target)
  2075. else:
  2076. ProgressOutput(progress, "Building package from pdef file", infile)
  2077. return Package(target, inputs, opts)
  2078. elif origsuffix in SUFFIX_LIB:
  2079. ProgressOutput(progress, "Linking static library", target)
  2080. return CompileLib(target, inputs, opts)
  2081. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2082. if (origsuffix==".exe"):
  2083. ProgressOutput(progress, "Linking executable", target)
  2084. else:
  2085. ProgressOutput(progress, "Linking dynamic library", target)
  2086. # Add version number to the dynamic library, on unix
  2087. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2088. tplatform = GetTarget()
  2089. if tplatform == "darwin":
  2090. # On Mac, libraries are named like libpanda.1.2.dylib
  2091. if target.lower().endswith(".dylib"):
  2092. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2093. SetOrigExt(target, origsuffix)
  2094. elif tplatform != "windows" and tplatform != "android":
  2095. # On Linux, libraries are named like libpanda.so.1.2
  2096. target += "." + MAJOR_VERSION
  2097. SetOrigExt(target, origsuffix)
  2098. return CompileLink(target, inputs, opts)
  2099. elif (origsuffix==".in"):
  2100. ProgressOutput(progress, "Building Interrogate database", target)
  2101. return CompileIgate(target, inputs, opts)
  2102. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2103. ProgressOutput(progress, "Building plugin bundle", target)
  2104. return CompileBundle(target, inputs, opts)
  2105. elif (origsuffix==".app"):
  2106. ProgressOutput(progress, "Building application bundle", target)
  2107. return CompileBundle(target, inputs, opts)
  2108. elif (origsuffix==".pz"):
  2109. ProgressOutput(progress, "Compressing", target)
  2110. return CompileEgg(target, infile, opts)
  2111. elif (origsuffix==".egg"):
  2112. ProgressOutput(progress, "Converting", target)
  2113. return CompileEgg(target, infile, opts)
  2114. elif (origsuffix==".res"):
  2115. ProgressOutput(progress, "Building resource object", target)
  2116. return CompileRes(target, infile, opts)
  2117. elif (origsuffix==".rsrc"):
  2118. ProgressOutput(progress, "Building resource object", target)
  2119. return CompileRsrc(target, infile, opts)
  2120. elif (origsuffix==".class"):
  2121. ProgressOutput(progress, "Building Java class", target)
  2122. return CompileJava(target, infile, opts)
  2123. elif (origsuffix==".obj"):
  2124. if (infile.endswith(".cxx")):
  2125. ProgressOutput(progress, "Building C++ object", target)
  2126. return CompileCxx(target, infile, opts)
  2127. elif (infile.endswith(".c")):
  2128. ProgressOutput(progress, "Building C object", target)
  2129. return CompileCxx(target, infile, opts)
  2130. elif (infile.endswith(".mm")):
  2131. ProgressOutput(progress, "Building Objective-C++ object", target)
  2132. return CompileCxx(target, infile, opts)
  2133. elif (infile.endswith(".yxx")):
  2134. ProgressOutput(progress, "Building Bison object", target)
  2135. return CompileBison(target, infile, opts)
  2136. elif (infile.endswith(".lxx")):
  2137. ProgressOutput(progress, "Building Flex object", target)
  2138. return CompileFlex(target, infile, opts)
  2139. elif (infile.endswith(".in")):
  2140. ProgressOutput(progress, "Building Interrogate object", target)
  2141. return CompileImod(target, inputs, opts)
  2142. elif (infile.endswith(".rc")):
  2143. ProgressOutput(progress, "Building resource object", target)
  2144. return CompileRes(target, infile, opts)
  2145. elif (infile.endswith(".r")):
  2146. ProgressOutput(progress, "Building resource object", target)
  2147. return CompileRsrc(target, infile, opts)
  2148. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2149. ##########################################################################################
  2150. #
  2151. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2152. #
  2153. ##########################################################################################
  2154. DTOOL_CONFIG=[
  2155. #_Variable_________________________Windows___________________Unix__________
  2156. ("HAVE_PYTHON", '1', '1'),
  2157. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2158. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2159. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2160. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2161. ("HAVE_MAYA", '1', '1'),
  2162. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2163. ("USE_PANDAFILESTREAM", '1', '1'),
  2164. ("USE_DELETED_CHAIN", '1', '1'),
  2165. ("HAVE_GLX", 'UNDEF', '1'),
  2166. ("HAVE_WGL", '1', 'UNDEF'),
  2167. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2168. ("HAVE_THREADS", '1', '1'),
  2169. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2170. ("OS_SIMPLE_THREADS", '1', '1'),
  2171. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2172. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2173. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2174. ("HAVE_AUDIO", '1', '1'),
  2175. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2176. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2177. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2178. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2179. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2180. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2181. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2182. ("DO_PIPELINING", '1', '1'),
  2183. ("DEFAULT_PATHSEP", '";"', '":"'),
  2184. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2185. ("PHAVE_LOCKF", '1', '1'),
  2186. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2187. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2188. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2189. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2190. ("HAVE_GETOPT", 'UNDEF', '1'),
  2191. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2192. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2193. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2194. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2195. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2196. ("HAVE_IOS_BINARY", '1', '1'),
  2197. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2198. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2199. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2200. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2201. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2202. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2203. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2204. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2205. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2206. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2207. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2208. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2209. ("PHAVE_IO_H", '1', 'UNDEF'),
  2210. ("PHAVE_IOSTREAM", '1', '1'),
  2211. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2212. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2213. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2214. ("PHAVE_MALLOC_H", '1', '1'),
  2215. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2216. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2217. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2218. ("PHAVE_SSTREAM", '1', '1'),
  2219. ("PHAVE_NEW", '1', '1'),
  2220. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2221. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2222. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2223. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2224. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2225. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2226. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2227. ("PHAVE_STDINT_H", '1', '1'),
  2228. ("HAVE_RTTI", '1', '1'),
  2229. ("HAVE_X11", 'UNDEF', '1'),
  2230. ("IS_LINUX", 'UNDEF', '1'),
  2231. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2232. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2233. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2234. ("LINMATH_ALIGN", '1', '1'),
  2235. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2236. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2237. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2238. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2239. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2240. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2241. ("HAVE_SGI_RGB", '1', '1'),
  2242. ("HAVE_TGA", '1', '1'),
  2243. ("HAVE_IMG", '1', '1'),
  2244. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2245. ("HAVE_BMP", '1', '1'),
  2246. ("HAVE_PNM", '1', '1'),
  2247. ("HAVE_STB_IMAGE", '1', '1'),
  2248. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2249. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2250. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2251. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2252. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2253. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2254. ("WANT_NATIVE_NET", '1', '1'),
  2255. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2256. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2257. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2258. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2259. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2260. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2261. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2262. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2263. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2264. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2265. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2266. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2267. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2268. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2269. # ("_SECURE_SCL", '0', 'UNDEF'),
  2270. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2271. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2272. ]
  2273. PRC_PARAMETERS=[
  2274. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2275. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2276. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2277. ("PRC_PATH2_ENVVARS", '""', '""'),
  2278. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2279. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2280. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2281. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2282. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2283. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2284. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2285. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2286. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2287. ]
  2288. def WriteConfigSettings():
  2289. dtool_config={}
  2290. prc_parameters={}
  2291. speedtree_parameters={}
  2292. plugin_config={}
  2293. if (GetTarget() == 'windows'):
  2294. for key,win,unix in DTOOL_CONFIG:
  2295. dtool_config[key] = win
  2296. for key,win,unix in PRC_PARAMETERS:
  2297. prc_parameters[key] = win
  2298. else:
  2299. for key,win,unix in DTOOL_CONFIG:
  2300. dtool_config[key] = unix
  2301. for key,win,unix in PRC_PARAMETERS:
  2302. prc_parameters[key] = unix
  2303. for x in PkgListGet():
  2304. if ("HAVE_"+x in dtool_config):
  2305. if (PkgSkip(x)==0):
  2306. dtool_config["HAVE_"+x] = '1'
  2307. else:
  2308. dtool_config["HAVE_"+x] = 'UNDEF'
  2309. dtool_config["HAVE_NET"] = '1'
  2310. if (PkgSkip("NVIDIACG")==0):
  2311. dtool_config["HAVE_CG"] = '1'
  2312. dtool_config["HAVE_CGGL"] = '1'
  2313. dtool_config["HAVE_CGDX9"] = '1'
  2314. if GetTarget() not in ("linux", "android"):
  2315. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2316. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2317. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2318. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2319. if (GetTarget() == "darwin"):
  2320. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2321. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2322. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2323. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2324. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2325. dtool_config["HAVE_GLX"] = 'UNDEF'
  2326. dtool_config["IS_LINUX"] = 'UNDEF'
  2327. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2328. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2329. dtool_config["IS_OSX"] = '1'
  2330. # 10.4 had a broken ucontext implementation
  2331. if int(platform.mac_ver()[0][3]) <= 4:
  2332. dtool_config["PHAVE_UCONTEXT_H"] = 'UNDEF'
  2333. if (GetTarget() == "freebsd"):
  2334. dtool_config["IS_LINUX"] = 'UNDEF'
  2335. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2336. dtool_config["IS_FREEBSD"] = '1'
  2337. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2338. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2339. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2340. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2341. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2342. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2343. if (GetTarget() == "android"):
  2344. # Android does have RTTI, but we disable it anyway.
  2345. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2346. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2347. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2348. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2349. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2350. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2351. # This should probably be more sophisticated, such as based
  2352. # on whether the libRocket Python modules are available.
  2353. if (PkgSkip("PYTHON") != 0):
  2354. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2355. if (GetOptimize() <= 3):
  2356. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2357. if (GetOptimize() <= 3):
  2358. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2359. dtool_config["DO_PSTATS"] = '1'
  2360. if (GetOptimize() <= 3):
  2361. dtool_config["DO_DCAST"] = '1'
  2362. if (GetOptimize() <= 3):
  2363. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2364. if (GetOptimize() <= 3):
  2365. dtool_config["DO_MEMORY_USAGE"] = '1'
  2366. if (GetOptimize() <= 3):
  2367. dtool_config["NOTIFY_DEBUG"] = '1'
  2368. if (GetOptimize() >= 4):
  2369. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2370. if (GetOptimize() >= 4):
  2371. # Disable RTTI on release builds.
  2372. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2373. # Now that we have OS_SIMPLE_THREADS, we can support
  2374. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2375. # longer need to disable it for this platform.
  2376. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2377. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2378. if (RTDIST or RUNTIME):
  2379. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2380. if HOST_URL:
  2381. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2382. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2383. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2384. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2385. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2386. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2387. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2388. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2389. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2390. if PkgSkip("GTK2") == 0:
  2391. plugin_config["HAVE_GTK"] = '1'
  2392. if (RUNTIME):
  2393. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2394. # Whether it's present on the system doesn't matter here,
  2395. # as the runtime itself doesn't include or link with X11.
  2396. if (RUNTIME and GetTarget() == 'linux'):
  2397. dtool_config["HAVE_X11"] = '1'
  2398. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2399. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2400. else:
  2401. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2402. if (PkgSkip("SPEEDTREE")==0):
  2403. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2404. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2405. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2406. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2407. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2408. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2409. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2410. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2411. for key in sorted(prc_parameters.keys()):
  2412. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2413. val = OverrideValue(key, prc_parameters[key])
  2414. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2415. else: conf = conf + "#define " + key + " " + val + "\n"
  2416. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2417. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2418. for key in sorted(dtool_config.keys()):
  2419. val = OverrideValue(key, dtool_config[key])
  2420. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2421. else: conf = conf + "#define " + key + " " + val + "\n"
  2422. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2423. if (RTDIST or RUNTIME):
  2424. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2425. for key in sorted(plugin_config.keys()):
  2426. val = plugin_config[key]
  2427. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2428. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2429. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2430. if (PkgSkip("SPEEDTREE")==0):
  2431. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2432. for key in sorted(speedtree_parameters.keys()):
  2433. val = OverrideValue(key, speedtree_parameters[key])
  2434. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2435. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2436. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2437. for x in PkgListGet():
  2438. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2439. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2440. # Finally, write a platform.dat with the platform we are compiling for.
  2441. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2442. # This is useful for tools like makepackage that need to know things about
  2443. # the build parameters.
  2444. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2445. WriteConfigSettings()
  2446. WarnConflictingFiles()
  2447. if SystemLibraryExists("dtoolbase"):
  2448. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2449. if SystemLibraryExists("p3dtoolconfig"):
  2450. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2451. ##########################################################################################
  2452. #
  2453. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2454. #
  2455. ##########################################################################################
  2456. PANDAVERSION_H="""
  2457. #define PANDA_MAJOR_VERSION $VERSION1
  2458. #define PANDA_MINOR_VERSION $VERSION2
  2459. #define PANDA_SEQUENCE_VERSION $VERSION3
  2460. #define PANDA_VERSION $NVERSION
  2461. #define PANDA_NUMERIC_VERSION $NVERSION
  2462. #define PANDA_VERSION_STR "$VERSION"
  2463. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2464. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2465. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2466. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2467. """
  2468. PANDAVERSION_H_RUNTIME="""
  2469. #define PANDA_MAJOR_VERSION 0
  2470. #define PANDA_MINOR_VERSION 0
  2471. #define PANDA_SEQUENCE_VERSION 0
  2472. #define PANDA_VERSION_STR "0.0.0"
  2473. #define PANDA_ABI_VERSION_STR "0.0"
  2474. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2475. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2476. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2477. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2478. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2479. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2480. #define PANDA_PACKAGE_VERSION_STR ""
  2481. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2482. """
  2483. CHECKPANDAVERSION_CXX="""
  2484. # include "dtoolbase.h"
  2485. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2486. """
  2487. CHECKPANDAVERSION_H="""
  2488. # ifndef CHECKPANDAVERSION_H
  2489. # define CHECKPANDAVERSION_H
  2490. # include "dtoolbase.h"
  2491. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2492. // Hack to forcibly depend on the check
  2493. template<typename T>
  2494. class CheckPandaVersion {
  2495. public:
  2496. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2497. };
  2498. template class CheckPandaVersion<void>;
  2499. # endif
  2500. """
  2501. P3DACTIVEX_RC="""#include "resource.h"
  2502. #define APSTUDIO_READONLY_SYMBOLS
  2503. #include "afxres.h"
  2504. #undef APSTUDIO_READONLY_SYMBOLS
  2505. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2506. #ifdef _WIN32
  2507. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2508. #pragma code_page(1252)
  2509. #endif
  2510. #ifdef APSTUDIO_INVOKED
  2511. 1 TEXTINCLUDE
  2512. BEGIN
  2513. "resource.h\\0"
  2514. END
  2515. 2 TEXTINCLUDE
  2516. BEGIN
  2517. "#include ""afxres.h""\\r\\n"
  2518. "\\0"
  2519. END
  2520. 3 TEXTINCLUDE
  2521. BEGIN
  2522. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2523. "\\0"
  2524. END
  2525. #endif
  2526. %s
  2527. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2528. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2529. STYLE DS_SETFONT | WS_CHILD
  2530. FONT 8, "MS Sans Serif"
  2531. BEGIN
  2532. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2533. IDC_STATIC,7,25,229,16
  2534. END
  2535. #ifdef APSTUDIO_INVOKED
  2536. GUIDELINES DESIGNINFO
  2537. BEGIN
  2538. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2539. BEGIN
  2540. LEFTMARGIN, 7
  2541. RIGHTMARGIN, 243
  2542. TOPMARGIN, 7
  2543. BOTTOMMARGIN, 55
  2544. END
  2545. END
  2546. #endif
  2547. STRINGTABLE
  2548. BEGIN
  2549. IDS_P3DACTIVEX "P3DActiveX Control"
  2550. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2551. END
  2552. STRINGTABLE
  2553. BEGIN
  2554. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2555. END
  2556. #endif
  2557. #ifndef APSTUDIO_INVOKED
  2558. 1 TYPELIB "P3DActiveX.tlb"
  2559. #endif"""
  2560. def CreatePandaVersionFiles():
  2561. version1=int(VERSION.split(".")[0])
  2562. version2=int(VERSION.split(".")[1])
  2563. version3=int(VERSION.split(".")[2])
  2564. nversion=version1*1000000+version2*1000+version3
  2565. if (DISTRIBUTOR != "cmu"):
  2566. # Subtract 1 if we are not an official version.
  2567. nversion -= 1
  2568. if (RUNTIME):
  2569. pandaversion_h = PANDAVERSION_H_RUNTIME
  2570. else:
  2571. pandaversion_h = PANDAVERSION_H
  2572. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2573. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2574. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2575. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2576. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2577. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2578. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2579. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2580. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2581. if (DISTRIBUTOR == "cmu"):
  2582. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2583. else:
  2584. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2585. if GIT_COMMIT:
  2586. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2587. if not RUNTIME:
  2588. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2589. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2590. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2591. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2592. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2593. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2594. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2595. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2596. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2597. if RUNTIME:
  2598. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2599. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2600. else:
  2601. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2602. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2603. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2604. if RUNTIME:
  2605. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2606. "version" : VERSION,
  2607. "description" : "Runs 3-D games and interactive applets",
  2608. "filename" : "p3dactivex.ocx",
  2609. "mimetype" : "application/x-panda3d",
  2610. "extension" : "p3d",
  2611. "filedesc" : "Panda3D applet"}
  2612. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2613. CreatePandaVersionFiles()
  2614. ##########################################################################################
  2615. #
  2616. # Copy the "direct" tree
  2617. #
  2618. ##########################################################################################
  2619. if (PkgSkip("DIRECT")==0):
  2620. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2621. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2622. # This file used to be copied, but would nowadays cause conflicts.
  2623. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2624. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2625. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2626. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2627. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2628. # This directory doesn't exist at all any more.
  2629. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2630. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2631. # These files used to exist; remove them to avoid conflicts.
  2632. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2633. '_core.pyd', '_core.so',
  2634. 'direct.py', 'direct.pyc', 'direct.pyo',
  2635. '_direct.pyd', '_direct.so',
  2636. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2637. for basename in del_files:
  2638. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2639. if os.path.isfile(path):
  2640. print("Removing %s" % (path))
  2641. os.remove(path)
  2642. # Write an appropriate panda3d/__init__.py
  2643. p3d_init = """"Python bindings for the Panda3D libraries"
  2644. __version__ = '%s'
  2645. """ % (WHLVERSION)
  2646. if GetTarget() == 'windows':
  2647. p3d_init += """
  2648. if '__file__' in locals():
  2649. import os
  2650. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2651. if os.path.isdir(bindir):
  2652. if hasattr(os, 'add_dll_directory'):
  2653. os.add_dll_directory(bindir)
  2654. elif not os.environ.get('PATH'):
  2655. os.environ['PATH'] = bindir
  2656. else:
  2657. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2658. del os, bindir
  2659. """
  2660. if not PkgSkip("PYTHON"):
  2661. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2662. # Also add this file, for backward compatibility.
  2663. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2664. '''Alias of :mod:`panda3d.interrogatedb`.
  2665. .. deprecated:: 1.10.0
  2666. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2667. '''
  2668. if __debug__:
  2669. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2670. from .interrogatedb import *
  2671. """)
  2672. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2673. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2674. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2675. os.remove(fn)
  2676. panda_modules = ['core']
  2677. if not PkgSkip("PANDAPHYSICS"):
  2678. panda_modules.append('physics')
  2679. if not PkgSkip('PANDAFX'):
  2680. panda_modules.append('fx')
  2681. if not PkgSkip("DIRECT"):
  2682. panda_modules.append('direct')
  2683. if not PkgSkip("VISION"):
  2684. panda_modules.append('vision')
  2685. if not PkgSkip("SKEL"):
  2686. panda_modules.append('skel')
  2687. if not PkgSkip("EGG"):
  2688. panda_modules.append('egg')
  2689. if not PkgSkip("ODE"):
  2690. panda_modules.append('ode')
  2691. if not PkgSkip("VRPN"):
  2692. panda_modules.append('vrpn')
  2693. panda_modules_code = """
  2694. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2695. if __debug__:
  2696. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2697. """
  2698. for module in panda_modules:
  2699. panda_modules_code += """
  2700. try:
  2701. from panda3d.%s import *
  2702. except ImportError as err:
  2703. if "No module named %s" not in str(err):
  2704. raise""" % (module, module)
  2705. panda_modules_code += """
  2706. from direct.showbase import DConfig
  2707. def get_config_showbase():
  2708. return DConfig
  2709. def get_config_express():
  2710. return DConfig
  2711. getConfigShowbase = get_config_showbase
  2712. getConfigExpress = get_config_express
  2713. """
  2714. exthelpers_code = """
  2715. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2716. from direct.extensions_native.extension_native_helpers import *
  2717. """
  2718. if not PkgSkip("PYTHON"):
  2719. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2720. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2721. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2722. ##########################################################################################
  2723. #
  2724. # Write the dist-info directory.
  2725. #
  2726. ##########################################################################################
  2727. # This is just some basic stuff since setuptools just needs this file to
  2728. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2729. # eventually want to merge this with the metadata generator in makewheel.py.
  2730. METADATA = """Metadata-Version: 2.0
  2731. Name: Panda3D
  2732. Version: {version}
  2733. License: BSD
  2734. Home-page: https://www.panda3d.org/
  2735. Author: Panda3D Team
  2736. Author-email: [email protected]
  2737. """
  2738. ENTRY_POINTS = """[distutils.commands]
  2739. build_apps = direct.dist.commands:build_apps
  2740. bdist_apps = direct.dist.commands:bdist_apps
  2741. """
  2742. if not PkgSkip("DIRECT"):
  2743. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2744. MakeDirectory(dist_dir)
  2745. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2746. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2747. ##########################################################################################
  2748. #
  2749. # Generate the PRC files into the ETC directory.
  2750. #
  2751. ##########################################################################################
  2752. confautoprc = ReadFile("makepanda/confauto.in")
  2753. if (PkgSkip("SPEEDTREE")==0):
  2754. # If SpeedTree is available, enable it in the config file
  2755. confautoprc = confautoprc.replace('#st#', '')
  2756. else:
  2757. # otherwise, disable it.
  2758. confautoprc = confautoprc.replace('#st#', '#')
  2759. confautoprc = confautoprc.replace('\r\n', '\n')
  2760. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2761. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2762. if PkgSkip("EGG") or GetLinkAllStatic():
  2763. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2764. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2765. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2766. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2767. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2768. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2769. if (os.path.isfile("makepanda/myconfig.in")):
  2770. configprc = ReadFile("makepanda/myconfig.in")
  2771. else:
  2772. configprc = ReadFile("makepanda/config.in")
  2773. configprc = configprc.replace('\r\n', '\n')
  2774. if (GetTarget() == 'windows'):
  2775. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2776. else:
  2777. configprc = configprc.replace("aux-display pandadx9", "")
  2778. if (GetTarget() == 'darwin'):
  2779. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2780. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2781. if not PkgSkip("FMODEX"):
  2782. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2783. if PkgSkip("GL") or GetLinkAllStatic():
  2784. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2785. if PkgSkip("GLES") or GetLinkAllStatic():
  2786. configprc = configprc.replace("\n#load-display pandagles", "")
  2787. if PkgSkip("DX9") or GetLinkAllStatic():
  2788. configprc = configprc.replace("\n#load-display pandadx9", "")
  2789. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2790. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2791. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2792. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2793. if GetTarget() == 'windows':
  2794. # Convert to Windows newlines.
  2795. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2796. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2797. else:
  2798. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2799. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2800. ##########################################################################################
  2801. #
  2802. # Copy the precompiled binaries and DLLs into the build.
  2803. #
  2804. ##########################################################################################
  2805. tp_dir = GetThirdpartyDir()
  2806. if tp_dir is not None:
  2807. dylibs = {}
  2808. if GetTarget() == 'darwin':
  2809. # Make a list of all the dylibs we ship, to figure out whether we should use
  2810. # install_name_tool to correct the library reference to point to our copy.
  2811. for lib in glob.glob(tp_dir + "/*/lib/*.dylib"):
  2812. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2813. if not PkgSkip("PYTHON"):
  2814. for lib in glob.glob(tp_dir + "/*/lib/" + SDK["PYTHONVERSION"] + "/*.dylib"):
  2815. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2816. for pkg in PkgListGet():
  2817. if PkgSkip(pkg):
  2818. continue
  2819. tp_pkg = tp_dir + pkg.lower()
  2820. if GetTarget() == 'windows':
  2821. if os.path.exists(tp_pkg + "/bin"):
  2822. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2823. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2824. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2825. elif GetTarget() == 'darwin':
  2826. tp_libs = glob.glob(tp_pkg + "/lib/*.dylib")
  2827. if not PkgSkip("PYTHON"):
  2828. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.dylib"))
  2829. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so"))
  2830. if pkg != 'PYTHON':
  2831. tp_libs += glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.py"))
  2832. for tp_lib in tp_libs:
  2833. basename = os.path.basename(tp_lib)
  2834. if basename.endswith('.dylib'):
  2835. # It's a dynamic link library. Put it in the lib directory.
  2836. target = GetOutputDir() + "/lib/" + basename
  2837. dep_prefix = "@loader_path/../lib/"
  2838. lib_id = dep_prefix + basename
  2839. else:
  2840. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2841. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2842. target = GetOutputDir() + "/" + basename
  2843. dep_prefix = "@loader_path/lib/"
  2844. lib_id = basename
  2845. if not NeedsBuild([target], [tp_lib]):
  2846. continue
  2847. CopyFile(target, tp_lib)
  2848. if os.path.islink(target) or target.endswith('.py'):
  2849. continue
  2850. # Correct the inter-library dependencies so that the build is relocatable.
  2851. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2852. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2853. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2854. line = line.strip()
  2855. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2856. continue
  2857. libdep = line.split(" ", 1)[0]
  2858. dep_basename = os.path.basename(libdep)
  2859. if dep_basename in dylibs:
  2860. dep_target = dylibs[dep_basename]
  2861. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2862. JustBuilt([target], [tp_lib])
  2863. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2864. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2865. else: # Linux / FreeBSD case.
  2866. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2867. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2868. if not PkgSkip("PYTHON"):
  2869. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2870. base = os.path.basename(tp_lib)
  2871. if base.startswith('lib'):
  2872. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2873. else:
  2874. # It's a Python module, like _rocketcore.so.
  2875. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2876. if GetTarget() == 'windows':
  2877. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2878. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2879. if not PkgSkip("PYTHON") and not RTDIST:
  2880. # We need to copy the Python DLL to the bin directory for now.
  2881. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2882. if GetOptimize() <= 2:
  2883. pydll += "_d.dll"
  2884. else:
  2885. pydll += ".dll"
  2886. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2887. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2888. CopyFile(GetOutputDir() + "/bin/", fn)
  2889. # Copy the whole Python directory.
  2890. if COPY_PYTHON:
  2891. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2892. # NB: Python does not always ship with the correct manifest/dll.
  2893. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2894. manifest = GetOutputDir() + '/tmp/python.manifest'
  2895. if os.path.isfile(manifest):
  2896. os.unlink(manifest)
  2897. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2898. if COPY_PYTHON and os.path.isfile(manifest):
  2899. import xml.etree.ElementTree as ET
  2900. tree = ET.parse(manifest)
  2901. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2902. else:
  2903. idents = ()
  2904. for ident in idents:
  2905. sxs_name = '_'.join([
  2906. ident.get('processorArchitecture'),
  2907. ident.get('name').lower(),
  2908. ident.get('publicKeyToken'),
  2909. ident.get('version'),
  2910. ])
  2911. # Find the manifest matching these parameters.
  2912. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2913. manifests = glob.glob(pattern)
  2914. if not manifests:
  2915. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2916. continue
  2917. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2918. # Also copy the corresponding msvcr dll.
  2919. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2920. for file in glob.glob(pattern):
  2921. CopyFile(GetOutputDir() + "/python/", file)
  2922. # Copy python.exe to ppython.exe.
  2923. if COPY_PYTHON:
  2924. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2925. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2926. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2927. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2928. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2929. # Copy over the MSVC runtime.
  2930. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2931. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2932. crtname = "Microsoft.VC%s.CRT" % (vcver)
  2933. if ("VCTOOLSVERSION" in SDK):
  2934. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  2935. else:
  2936. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2937. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2938. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2939. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2940. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2941. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2942. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2943. ########################################################################
  2944. ##
  2945. ## Copy various stuff into the build.
  2946. ##
  2947. ########################################################################
  2948. if GetTarget() == 'windows':
  2949. # Convert to Windows newlines so they can be opened by notepad.
  2950. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2951. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2952. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2953. else:
  2954. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  2955. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  2956. if (PkgSkip("PANDATOOL")==0):
  2957. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  2958. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  2959. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  2960. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  2961. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  2962. # Since Eigen is included by all sorts of core headers, as a convenience
  2963. # to C++ users on Win and Mac, we include it in the Panda include directory.
  2964. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  2965. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  2966. ########################################################################
  2967. #
  2968. # Copy header files to the built/include/parser-inc directory.
  2969. #
  2970. ########################################################################
  2971. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  2972. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  2973. ########################################################################
  2974. #
  2975. # Transfer all header files to the built/include directory.
  2976. #
  2977. ########################################################################
  2978. CopyAllHeaders('dtool/src/dtoolbase')
  2979. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  2980. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  2981. CopyAllHeaders('dtool/metalibs/dtool')
  2982. CopyAllHeaders('dtool/src/cppparser')
  2983. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  2984. CopyAllHeaders('dtool/src/dconfig')
  2985. CopyAllHeaders('dtool/src/interrogatedb')
  2986. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  2987. CopyAllHeaders('dtool/src/pystub')
  2988. CopyAllHeaders('dtool/src/interrogate')
  2989. CopyAllHeaders('dtool/src/test_interrogate')
  2990. CopyAllHeaders('panda/src/putil')
  2991. CopyAllHeaders('panda/src/pandabase')
  2992. CopyAllHeaders('panda/src/express')
  2993. CopyAllHeaders('panda/src/downloader')
  2994. CopyAllHeaders('panda/metalibs/pandaexpress')
  2995. CopyAllHeaders('panda/src/pipeline')
  2996. CopyAllHeaders('panda/src/linmath')
  2997. CopyAllHeaders('panda/src/putil')
  2998. CopyAllHeaders('dtool/src/prckeys')
  2999. CopyAllHeaders('panda/src/audio')
  3000. CopyAllHeaders('panda/src/event')
  3001. CopyAllHeaders('panda/src/mathutil')
  3002. CopyAllHeaders('panda/src/gsgbase')
  3003. CopyAllHeaders('panda/src/pnmimage')
  3004. CopyAllHeaders('panda/src/nativenet')
  3005. CopyAllHeaders('panda/src/net')
  3006. CopyAllHeaders('panda/src/pstatclient')
  3007. CopyAllHeaders('panda/src/gobj')
  3008. CopyAllHeaders('panda/src/movies')
  3009. CopyAllHeaders('panda/src/pgraphnodes')
  3010. CopyAllHeaders('panda/src/pgraph')
  3011. CopyAllHeaders('panda/src/cull')
  3012. CopyAllHeaders('panda/src/display')
  3013. CopyAllHeaders('panda/src/chan')
  3014. CopyAllHeaders('panda/src/char')
  3015. CopyAllHeaders('panda/src/dgraph')
  3016. CopyAllHeaders('panda/src/device')
  3017. CopyAllHeaders('panda/src/pnmtext')
  3018. CopyAllHeaders('panda/src/text')
  3019. CopyAllHeaders('panda/src/grutil')
  3020. if (PkgSkip("VISION")==0):
  3021. CopyAllHeaders('panda/src/vision')
  3022. if (PkgSkip("FFMPEG")==0):
  3023. CopyAllHeaders('panda/src/ffmpeg')
  3024. CopyAllHeaders('panda/src/tform')
  3025. CopyAllHeaders('panda/src/collide')
  3026. CopyAllHeaders('panda/src/parametrics')
  3027. CopyAllHeaders('panda/src/pgui')
  3028. CopyAllHeaders('panda/src/pnmimagetypes')
  3029. CopyAllHeaders('panda/src/recorder')
  3030. if (PkgSkip("ROCKET")==0):
  3031. CopyAllHeaders('panda/src/rocket')
  3032. if (PkgSkip("VRPN")==0):
  3033. CopyAllHeaders('panda/src/vrpn')
  3034. CopyAllHeaders('panda/src/wgldisplay')
  3035. CopyAllHeaders('panda/src/ode')
  3036. CopyAllHeaders('panda/metalibs/pandaode')
  3037. if (PkgSkip("PANDAPHYSICS")==0):
  3038. CopyAllHeaders('panda/src/physics')
  3039. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3040. CopyAllHeaders('panda/src/particlesystem')
  3041. CopyAllHeaders('panda/src/dxml')
  3042. CopyAllHeaders('panda/metalibs/panda')
  3043. CopyAllHeaders('panda/src/audiotraits')
  3044. CopyAllHeaders('panda/src/audiotraits')
  3045. CopyAllHeaders('panda/src/distort')
  3046. CopyAllHeaders('panda/src/downloadertools')
  3047. CopyAllHeaders('panda/src/windisplay')
  3048. CopyAllHeaders('panda/src/dxgsg9')
  3049. CopyAllHeaders('panda/metalibs/pandadx9')
  3050. if not PkgSkip("EGG"):
  3051. CopyAllHeaders('panda/src/egg')
  3052. CopyAllHeaders('panda/src/egg2pg')
  3053. CopyAllHeaders('panda/src/framework')
  3054. CopyAllHeaders('panda/metalibs/pandafx')
  3055. CopyAllHeaders('panda/src/glstuff')
  3056. CopyAllHeaders('panda/src/glgsg')
  3057. CopyAllHeaders('panda/src/glesgsg')
  3058. CopyAllHeaders('panda/src/gles2gsg')
  3059. if not PkgSkip("EGG"):
  3060. CopyAllHeaders('panda/metalibs/pandaegg')
  3061. if GetTarget() == 'windows':
  3062. CopyAllHeaders('panda/src/wgldisplay')
  3063. elif GetTarget() == 'darwin':
  3064. CopyAllHeaders('panda/src/osxdisplay')
  3065. CopyAllHeaders('panda/src/cocoadisplay')
  3066. elif GetTarget() == 'android':
  3067. CopyAllHeaders('panda/src/android')
  3068. CopyAllHeaders('panda/src/androiddisplay')
  3069. else:
  3070. CopyAllHeaders('panda/src/x11display')
  3071. CopyAllHeaders('panda/src/glxdisplay')
  3072. CopyAllHeaders('panda/src/egldisplay')
  3073. CopyAllHeaders('panda/metalibs/pandagl')
  3074. CopyAllHeaders('panda/metalibs/pandagles')
  3075. CopyAllHeaders('panda/metalibs/pandagles2')
  3076. CopyAllHeaders('panda/metalibs/pandaphysics')
  3077. CopyAllHeaders('panda/src/testbed')
  3078. if (PkgSkip("PHYSX")==0):
  3079. CopyAllHeaders('panda/src/physx')
  3080. CopyAllHeaders('panda/metalibs/pandaphysx')
  3081. if (PkgSkip("BULLET")==0):
  3082. CopyAllHeaders('panda/src/bullet')
  3083. CopyAllHeaders('panda/metalibs/pandabullet')
  3084. if (PkgSkip("SPEEDTREE")==0):
  3085. CopyAllHeaders('panda/src/speedtree')
  3086. if (PkgSkip("DIRECT")==0):
  3087. CopyAllHeaders('direct/src/directbase')
  3088. CopyAllHeaders('direct/src/dcparser')
  3089. CopyAllHeaders('direct/src/deadrec')
  3090. CopyAllHeaders('direct/src/distributed')
  3091. CopyAllHeaders('direct/src/interval')
  3092. CopyAllHeaders('direct/src/showbase')
  3093. CopyAllHeaders('direct/src/dcparse')
  3094. if (RUNTIME or RTDIST):
  3095. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3096. if (RUNTIME):
  3097. CopyAllHeaders('direct/src/plugin_npapi')
  3098. CopyAllHeaders('direct/src/plugin_standalone')
  3099. if (PkgSkip("PANDATOOL")==0):
  3100. CopyAllHeaders('pandatool/src/pandatoolbase')
  3101. CopyAllHeaders('pandatool/src/converter')
  3102. CopyAllHeaders('pandatool/src/progbase')
  3103. CopyAllHeaders('pandatool/src/eggbase')
  3104. CopyAllHeaders('pandatool/src/bam')
  3105. CopyAllHeaders('pandatool/src/cvscopy')
  3106. CopyAllHeaders('pandatool/src/daeegg')
  3107. CopyAllHeaders('pandatool/src/daeprogs')
  3108. CopyAllHeaders('pandatool/src/dxf')
  3109. CopyAllHeaders('pandatool/src/dxfegg')
  3110. CopyAllHeaders('pandatool/src/dxfprogs')
  3111. CopyAllHeaders('pandatool/src/palettizer')
  3112. CopyAllHeaders('pandatool/src/egg-mkfont')
  3113. CopyAllHeaders('pandatool/src/eggcharbase')
  3114. CopyAllHeaders('pandatool/src/egg-optchar')
  3115. CopyAllHeaders('pandatool/src/egg-palettize')
  3116. CopyAllHeaders('pandatool/src/egg-qtess')
  3117. CopyAllHeaders('pandatool/src/eggprogs')
  3118. CopyAllHeaders('pandatool/src/flt')
  3119. CopyAllHeaders('pandatool/src/fltegg')
  3120. CopyAllHeaders('pandatool/src/fltprogs')
  3121. CopyAllHeaders('pandatool/src/imagebase')
  3122. CopyAllHeaders('pandatool/src/imageprogs')
  3123. CopyAllHeaders('pandatool/src/pfmprogs')
  3124. CopyAllHeaders('pandatool/src/lwo')
  3125. CopyAllHeaders('pandatool/src/lwoegg')
  3126. CopyAllHeaders('pandatool/src/lwoprogs')
  3127. CopyAllHeaders('pandatool/src/maya')
  3128. CopyAllHeaders('pandatool/src/mayaegg')
  3129. CopyAllHeaders('pandatool/src/maxegg')
  3130. CopyAllHeaders('pandatool/src/maxprogs')
  3131. CopyAllHeaders('pandatool/src/objegg')
  3132. CopyAllHeaders('pandatool/src/objprogs')
  3133. CopyAllHeaders('pandatool/src/vrml')
  3134. CopyAllHeaders('pandatool/src/vrmlegg')
  3135. CopyAllHeaders('pandatool/src/xfile')
  3136. CopyAllHeaders('pandatool/src/xfileegg')
  3137. CopyAllHeaders('pandatool/src/ptloader')
  3138. CopyAllHeaders('pandatool/src/miscprogs')
  3139. CopyAllHeaders('pandatool/src/pstatserver')
  3140. CopyAllHeaders('pandatool/src/text-stats')
  3141. CopyAllHeaders('pandatool/src/vrmlprogs')
  3142. CopyAllHeaders('pandatool/src/win-stats')
  3143. CopyAllHeaders('pandatool/src/xfileprogs')
  3144. if (PkgSkip("CONTRIB")==0):
  3145. CopyAllHeaders('contrib/src/contribbase')
  3146. CopyAllHeaders('contrib/src/ai')
  3147. ########################################################################
  3148. #
  3149. # These definitions are syntactic shorthand. They make it easy
  3150. # to link with the usual libraries without listing them all.
  3151. #
  3152. ########################################################################
  3153. COMMON_DTOOL_LIBS=[
  3154. 'libp3dtool.dll',
  3155. 'libp3dtoolconfig.dll',
  3156. ]
  3157. COMMON_PANDA_LIBS=[
  3158. 'libpanda.dll',
  3159. 'libpandaexpress.dll'
  3160. ] + COMMON_DTOOL_LIBS
  3161. COMMON_EGG2X_LIBS=[
  3162. 'libp3eggbase.lib',
  3163. 'libp3progbase.lib',
  3164. 'libp3converter.lib',
  3165. 'libp3pandatoolbase.lib',
  3166. 'libpandaegg.dll',
  3167. ] + COMMON_PANDA_LIBS
  3168. ########################################################################
  3169. #
  3170. # This section contains a list of all the files that need to be compiled.
  3171. #
  3172. ########################################################################
  3173. print("Generating dependencies...")
  3174. sys.stdout.flush()
  3175. #
  3176. # Compile Panda icon resource file.
  3177. # We do it first because we need it at
  3178. # the time we compile an executable.
  3179. #
  3180. if GetTarget() == 'windows':
  3181. OPTS=['DIR:panda/src/configfiles']
  3182. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3183. #
  3184. # DIRECTORY: dtool/src/dtoolbase/
  3185. #
  3186. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  3187. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3188. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3189. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3190. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3191. #
  3192. # DIRECTORY: dtool/src/dtoolutil/
  3193. #
  3194. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3195. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3196. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3197. if GetTarget() == 'darwin':
  3198. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3199. #
  3200. # DIRECTORY: dtool/metalibs/dtool/
  3201. #
  3202. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3203. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3204. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3205. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3206. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3207. if GetTarget() == 'darwin':
  3208. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3209. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3210. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3211. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3212. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3213. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  3214. #
  3215. # DIRECTORY: dtool/src/cppparser/
  3216. #
  3217. if (not RUNTIME):
  3218. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3219. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3220. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3221. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3222. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3223. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3224. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3225. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3226. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3227. #
  3228. # DIRECTORY: dtool/src/prc/
  3229. #
  3230. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3231. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3232. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3233. #
  3234. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3235. #
  3236. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3237. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3238. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3239. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3240. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3241. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3242. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3243. #
  3244. # DIRECTORY: dtool/src/interrogatedb/
  3245. #
  3246. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3247. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3248. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3249. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3250. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3251. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3252. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3253. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3254. # stuff, so it has been renamed appropriately.
  3255. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3256. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3257. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3258. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3259. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3260. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3261. #
  3262. # DIRECTORY: dtool/src/pystub/
  3263. #
  3264. if not RUNTIME and not RTDIST:
  3265. OPTS=['DIR:dtool/src/pystub']
  3266. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3267. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3268. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3269. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3270. #
  3271. # DIRECTORY: dtool/src/interrogate/
  3272. #
  3273. if (not RUNTIME):
  3274. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3275. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3276. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3277. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3278. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3279. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3280. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3281. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3282. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3283. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3284. 'dtool/src/interrogatedb/py_panda.cxx',
  3285. 'dtool/src/interrogatedb/py_compat.cxx',
  3286. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3287. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3288. ])
  3289. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3290. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3291. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3292. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3293. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3294. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3295. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3296. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3297. if (not RTDIST):
  3298. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3299. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3300. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3301. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3302. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3303. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3304. #
  3305. # DIRECTORY: dtool/src/prckeys/
  3306. #
  3307. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3308. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3309. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3310. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3311. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3312. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3313. #
  3314. # DIRECTORY: dtool/src/test_interrogate/
  3315. #
  3316. if (not RTDIST and not RUNTIME):
  3317. OPTS=['DIR:dtool/src/test_interrogate']
  3318. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3319. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3320. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3321. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3322. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3323. #
  3324. # DIRECTORY: dtool/src/dtoolbase/
  3325. #
  3326. OPTS=['DIR:dtool/src/dtoolbase']
  3327. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3328. IGATEFILES += [
  3329. "typeHandle.h",
  3330. "typeHandle_ext.h",
  3331. "typeRegistry.h",
  3332. "typedObject.h",
  3333. "neverFreeMemory.h",
  3334. ]
  3335. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3336. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3337. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3338. #
  3339. # DIRECTORY: dtool/src/dtoolutil/
  3340. #
  3341. OPTS=['DIR:dtool/src/dtoolutil']
  3342. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3343. IGATEFILES += [
  3344. "config_dtoolutil.h",
  3345. "pandaSystem.h",
  3346. "dSearchPath.h",
  3347. "executionEnvironment.h",
  3348. "textEncoder.h",
  3349. "textEncoder_ext.h",
  3350. "filename.h",
  3351. "filename_ext.h",
  3352. "globPattern.h",
  3353. "globPattern_ext.h",
  3354. "pandaFileStream.h",
  3355. "lineStream.h",
  3356. ]
  3357. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3358. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3359. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3360. #
  3361. # DIRECTORY: dtool/src/prc/
  3362. #
  3363. OPTS=['DIR:dtool/src/prc']
  3364. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3365. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3366. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3367. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3368. #
  3369. # DIRECTORY: panda/src/pandabase/
  3370. #
  3371. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3372. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3373. #
  3374. # DIRECTORY: panda/src/express/
  3375. #
  3376. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3377. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3378. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3379. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3380. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3381. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3382. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3383. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3384. #
  3385. # DIRECTORY: panda/src/downloader/
  3386. #
  3387. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3388. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3389. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3390. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3391. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3392. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3393. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3394. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3395. #
  3396. # DIRECTORY: panda/metalibs/pandaexpress/
  3397. #
  3398. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3399. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3400. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3401. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3402. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3403. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3404. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3405. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3406. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3407. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3408. #
  3409. # DIRECTORY: panda/src/pipeline/
  3410. #
  3411. if (not RUNTIME):
  3412. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3413. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3414. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3415. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3416. OPTS=['DIR:panda/src/pipeline']
  3417. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3418. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3419. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3420. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3421. #
  3422. # DIRECTORY: panda/src/linmath/
  3423. #
  3424. if (not RUNTIME):
  3425. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3426. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3427. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3428. OPTS=['DIR:panda/src/linmath']
  3429. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3430. for ifile in IGATEFILES[:]:
  3431. if "_src." in ifile:
  3432. IGATEFILES.remove(ifile)
  3433. IGATEFILES.remove('cast_to_double.h')
  3434. IGATEFILES.remove('lmat_ops.h')
  3435. IGATEFILES.remove('cast_to_float.h')
  3436. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3437. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3438. #
  3439. # DIRECTORY: panda/src/putil/
  3440. #
  3441. if (not RUNTIME):
  3442. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3443. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3444. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3445. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3446. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3447. IGATEFILES.remove("test_bam.h")
  3448. IGATEFILES.remove("config_util.h")
  3449. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3450. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3451. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3452. #
  3453. # DIRECTORY: panda/src/audio/
  3454. #
  3455. if (not RUNTIME):
  3456. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3457. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3458. OPTS=['DIR:panda/src/audio']
  3459. IGATEFILES=["audio.h"]
  3460. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3461. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3462. #
  3463. # DIRECTORY: panda/src/event/
  3464. #
  3465. if (not RUNTIME):
  3466. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3467. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3468. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3469. OPTS=['DIR:panda/src/event']
  3470. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3471. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3472. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3473. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3474. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3475. #
  3476. # DIRECTORY: panda/src/mathutil/
  3477. #
  3478. if (not RUNTIME):
  3479. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3480. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3481. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3482. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3483. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3484. for ifile in IGATEFILES[:]:
  3485. if "_src." in ifile:
  3486. IGATEFILES.remove(ifile)
  3487. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3488. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3489. #
  3490. # DIRECTORY: panda/src/gsgbase/
  3491. #
  3492. if (not RUNTIME):
  3493. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3494. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3495. OPTS=['DIR:panda/src/gsgbase']
  3496. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3497. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3498. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3499. #
  3500. # DIRECTORY: panda/src/pnmimage/
  3501. #
  3502. if (not RUNTIME):
  3503. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3504. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3505. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3506. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3507. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3508. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3509. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3510. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3511. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3512. #
  3513. # DIRECTORY: panda/src/nativenet/
  3514. #
  3515. if (not RUNTIME):
  3516. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3517. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3518. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3519. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3520. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3521. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3522. #
  3523. # DIRECTORY: panda/src/net/
  3524. #
  3525. if (not RUNTIME):
  3526. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3527. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3528. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3529. OPTS=['DIR:panda/src/net']
  3530. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3531. IGATEFILES.remove("datagram_ui.h")
  3532. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3533. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3534. #
  3535. # DIRECTORY: panda/src/pstatclient/
  3536. #
  3537. if (not RUNTIME):
  3538. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3539. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3540. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3541. OPTS=['DIR:panda/src/pstatclient']
  3542. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3543. IGATEFILES.remove("config_pstats.h")
  3544. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3545. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3546. #
  3547. # DIRECTORY: panda/src/gobj/
  3548. #
  3549. if (not RUNTIME):
  3550. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3551. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3552. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3553. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3554. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3555. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3556. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3557. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3558. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3559. #
  3560. # DIRECTORY: panda/src/pgraphnodes/
  3561. #
  3562. if (not RUNTIME):
  3563. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3564. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3565. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3566. OPTS=['DIR:panda/src/pgraphnodes']
  3567. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3568. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3569. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3570. #
  3571. # DIRECTORY: panda/src/pgraph/
  3572. #
  3573. if (not RUNTIME):
  3574. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3575. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3576. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3577. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3578. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3579. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3580. OPTS=['DIR:panda/src/pgraph']
  3581. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3582. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3583. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3584. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3585. #
  3586. # DIRECTORY: panda/src/cull/
  3587. #
  3588. if (not RUNTIME):
  3589. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3590. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3591. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3592. OPTS=['DIR:panda/src/cull']
  3593. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3594. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3595. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3596. #
  3597. # DIRECTORY: panda/src/dgraph/
  3598. #
  3599. if (not RUNTIME):
  3600. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3601. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3602. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3603. OPTS=['DIR:panda/src/dgraph']
  3604. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3605. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3606. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3607. #
  3608. # DIRECTORY: panda/src/device/
  3609. #
  3610. if (not RUNTIME):
  3611. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3612. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3613. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3614. OPTS=['DIR:panda/src/device']
  3615. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3616. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3617. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3618. #
  3619. # DIRECTORY: panda/src/display/
  3620. #
  3621. if (not RUNTIME):
  3622. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3623. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3624. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3625. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3626. OPTS=['DIR:panda/src/display', 'X11']
  3627. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3628. IGATEFILES.remove("renderBuffer.h")
  3629. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3630. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3631. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3632. if RTDIST and GetTarget() == 'darwin':
  3633. OPTS=['DIR:panda/src/display']
  3634. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3635. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3636. #
  3637. # DIRECTORY: panda/src/chan/
  3638. #
  3639. if (not RUNTIME):
  3640. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3641. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3642. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3643. OPTS=['DIR:panda/src/chan']
  3644. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3645. IGATEFILES.remove('movingPart.h')
  3646. IGATEFILES.remove('animChannelFixed.h')
  3647. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3648. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3649. # DIRECTORY: panda/src/char/
  3650. #
  3651. if (not RUNTIME):
  3652. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3653. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3654. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3655. OPTS=['DIR:panda/src/char']
  3656. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3657. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3658. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3659. #
  3660. # DIRECTORY: panda/src/pnmtext/
  3661. #
  3662. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3663. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3664. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3665. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3666. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3667. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3668. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3669. #
  3670. # DIRECTORY: panda/src/text/
  3671. #
  3672. if (not RUNTIME):
  3673. if not PkgSkip("HARFBUZZ"):
  3674. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3675. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3676. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3677. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3678. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3679. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3680. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3681. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3682. #
  3683. # DIRECTORY: panda/src/movies/
  3684. #
  3685. if (not RUNTIME):
  3686. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3687. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3688. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3689. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3690. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3691. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3692. #
  3693. # DIRECTORY: panda/src/grutil/
  3694. #
  3695. if (not RUNTIME):
  3696. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3697. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3698. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3699. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3700. OPTS=['DIR:panda/src/grutil']
  3701. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3702. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3703. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3704. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3705. #
  3706. # DIRECTORY: panda/src/tform/
  3707. #
  3708. if (not RUNTIME):
  3709. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3710. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3711. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3712. OPTS=['DIR:panda/src/tform']
  3713. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3714. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3715. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3716. #
  3717. # DIRECTORY: panda/src/collide/
  3718. #
  3719. if (not RUNTIME):
  3720. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3721. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3722. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3723. OPTS=['DIR:panda/src/collide']
  3724. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3725. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3726. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3727. #
  3728. # DIRECTORY: panda/src/parametrics/
  3729. #
  3730. if (not RUNTIME):
  3731. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3732. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3733. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3734. OPTS=['DIR:panda/src/parametrics']
  3735. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3736. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3737. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3738. #
  3739. # DIRECTORY: panda/src/pgui/
  3740. #
  3741. if (not RUNTIME):
  3742. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3743. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3744. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3745. OPTS=['DIR:panda/src/pgui']
  3746. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3747. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3748. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3749. #
  3750. # DIRECTORY: panda/src/pnmimagetypes/
  3751. #
  3752. if (not RUNTIME):
  3753. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3754. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3755. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3756. #
  3757. # DIRECTORY: panda/src/recorder/
  3758. #
  3759. if (not RUNTIME):
  3760. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3761. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3762. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3763. OPTS=['DIR:panda/src/recorder']
  3764. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3765. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3766. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3767. #
  3768. # DIRECTORY: panda/src/dxml/
  3769. #
  3770. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3771. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3772. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3773. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3774. if (not RUNTIME):
  3775. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3776. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3777. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3778. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3779. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3780. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3781. #
  3782. # DIRECTORY: panda/metalibs/panda/
  3783. #
  3784. if (not RUNTIME):
  3785. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3786. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3787. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3788. 'SETUPAPI']
  3789. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3790. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3791. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3792. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3793. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3794. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3795. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3796. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3797. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3798. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3799. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3800. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3801. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3802. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3803. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3804. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3805. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3806. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3807. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3808. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3809. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3810. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3811. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3812. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3813. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3814. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3815. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3816. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3817. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3818. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3819. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3820. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3821. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3822. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3823. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3824. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3825. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3826. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3827. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3828. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3829. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3830. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3831. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3832. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3833. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3834. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3835. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3836. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3837. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3838. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3839. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3840. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3841. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3842. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3843. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3844. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3845. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3846. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3847. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3848. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3849. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3850. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3851. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3852. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3853. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3854. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3855. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3856. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3857. if PkgSkip("FREETYPE")==0:
  3858. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3859. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3860. TargetAdd('libpanda.dll', opts=OPTS)
  3861. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3862. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3863. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3864. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3865. PyTargetAdd('core_module.obj', input='libp3express.in')
  3866. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3867. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3868. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3869. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3870. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3871. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3872. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3873. PyTargetAdd('core_module.obj', input='libp3char.in')
  3874. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3875. PyTargetAdd('core_module.obj', input='libp3device.in')
  3876. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3877. PyTargetAdd('core_module.obj', input='libp3display.in')
  3878. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3879. PyTargetAdd('core_module.obj', input='libp3event.in')
  3880. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3881. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3882. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3883. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3884. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3885. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3886. PyTargetAdd('core_module.obj', input='libp3text.in')
  3887. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3888. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3889. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3890. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3891. PyTargetAdd('core_module.obj', input='libp3net.in')
  3892. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3893. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3894. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3895. if PkgSkip("FREETYPE")==0:
  3896. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3897. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3898. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3899. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3900. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3901. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3902. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3903. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3904. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3905. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3906. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3907. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3908. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3909. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3910. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3911. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3912. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3913. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3914. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3915. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3916. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3917. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3918. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3919. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3920. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3921. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  3922. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3923. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3924. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3925. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3926. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3927. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3928. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  3929. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  3930. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  3931. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  3932. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3933. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  3934. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3935. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3936. if PkgSkip("FREETYPE")==0:
  3937. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3938. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3939. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3940. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3941. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  3942. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3943. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3944. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3945. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  3946. PyTargetAdd('core.pyd', input='core_module.obj')
  3947. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3948. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3949. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3950. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3951. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  3952. #
  3953. # DIRECTORY: panda/src/vision/
  3954. #
  3955. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  3956. # We want to know whether we have ffmpeg so that we can override the .avi association.
  3957. if not PkgSkip("FFMPEG"):
  3958. DefSymbol("OPENCV", "HAVE_FFMPEG")
  3959. if not PkgSkip("OPENCV"):
  3960. DefSymbol("OPENCV", "HAVE_OPENCV")
  3961. if OPENCV_VER_23:
  3962. DefSymbol("OPENCV", "OPENCV_VER_23")
  3963. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3964. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  3965. 'dtool_have_ffmpeg.dat',
  3966. 'dtool_have_opencv.dat',
  3967. 'dtool_have_directcam.dat',
  3968. ])
  3969. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  3970. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  3971. TargetAdd('libp3vision.dll', opts=OPTS)
  3972. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  3973. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  3974. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  3975. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  3976. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  3977. PyTargetAdd('vision_module.obj', opts=OPTS)
  3978. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  3979. PyTargetAdd('vision.pyd', input='vision_module.obj')
  3980. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  3981. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  3982. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  3983. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  3984. #
  3985. # DIRECTORY: panda/src/rocket/
  3986. #
  3987. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  3988. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON']
  3989. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  3990. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  3991. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  3992. TargetAdd('libp3rocket.dll', opts=OPTS)
  3993. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS']
  3994. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  3995. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  3996. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  3997. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  3998. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  3999. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4000. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4001. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4002. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4003. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4004. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4005. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4006. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4007. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4008. PyTargetAdd('rocket.pyd', opts=['ROCKET'])
  4009. #
  4010. # DIRECTORY: panda/src/p3skel
  4011. #
  4012. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4013. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4014. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4015. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4016. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4017. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4018. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4019. #
  4020. # DIRECTORY: panda/src/p3skel
  4021. #
  4022. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4023. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4024. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4025. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4026. TargetAdd('libpandaskel.dll', opts=OPTS)
  4027. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4028. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4029. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4030. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4031. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4032. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4033. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4034. #
  4035. # DIRECTORY: panda/src/distort/
  4036. #
  4037. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4038. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4039. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4040. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4041. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4042. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4043. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4044. #
  4045. # DIRECTORY: panda/metalibs/pandafx/
  4046. #
  4047. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4048. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4049. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4050. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4051. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4052. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4053. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4054. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4055. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4056. PyTargetAdd('fx_module.obj', opts=OPTS)
  4057. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4058. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4059. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4060. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4061. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4062. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4063. #
  4064. # DIRECTORY: panda/src/vrpn/
  4065. #
  4066. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4067. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4068. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4069. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4070. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4071. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4072. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4073. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4074. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4075. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4076. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4077. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4078. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4079. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4080. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4081. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4082. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4083. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4084. #
  4085. # DIRECTORY: panda/src/ffmpeg
  4086. #
  4087. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4088. if not PkgSkip("SWSCALE"):
  4089. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4090. if not PkgSkip("SWRESAMPLE"):
  4091. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4092. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4093. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4094. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4095. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4096. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4097. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4098. #
  4099. # DIRECTORY: panda/src/audiotraits/
  4100. #
  4101. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4102. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4103. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4104. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4105. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4106. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4107. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4108. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4109. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4110. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4111. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4112. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4113. #
  4114. # DIRECTORY: panda/src/downloadertools/
  4115. #
  4116. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4117. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4118. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4119. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4120. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4121. TargetAdd('apply_patch.exe', opts=OPTS)
  4122. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4123. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4124. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4125. TargetAdd('build_patch.exe', opts=OPTS)
  4126. if not PkgSkip("ZLIB"):
  4127. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4128. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4129. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4130. TargetAdd('check_adler.exe', opts=OPTS)
  4131. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4132. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4133. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4134. TargetAdd('check_crc.exe', opts=OPTS)
  4135. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4136. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4137. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4138. TargetAdd('check_md5.exe', opts=OPTS)
  4139. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4140. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4141. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4142. TargetAdd('pdecrypt.exe', opts=OPTS)
  4143. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4144. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4145. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4146. TargetAdd('pencrypt.exe', opts=OPTS)
  4147. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4148. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4149. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4150. TargetAdd('show_ddb.exe', opts=OPTS)
  4151. #
  4152. # DIRECTORY: panda/src/downloadertools/
  4153. #
  4154. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4155. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4156. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4157. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4158. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4159. TargetAdd('multify.exe', opts=OPTS)
  4160. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4161. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4162. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4163. TargetAdd('pzip.exe', opts=OPTS)
  4164. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4165. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4166. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4167. TargetAdd('punzip.exe', opts=OPTS)
  4168. #
  4169. # DIRECTORY: panda/src/windisplay/
  4170. #
  4171. if (GetTarget() == 'windows' and not RUNTIME):
  4172. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4173. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4174. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4175. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4176. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4177. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4178. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4179. #
  4180. # DIRECTORY: panda/metalibs/pandadx9/
  4181. #
  4182. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4183. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4184. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4185. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4186. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4187. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4188. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4189. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4190. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4191. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4192. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4193. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4194. #
  4195. # DIRECTORY: panda/src/egg/
  4196. #
  4197. if not RUNTIME and not PkgSkip("EGG"):
  4198. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  4199. CreateFile(GetOutputDir()+"/include/parser.h")
  4200. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4201. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4202. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4203. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4204. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4205. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4206. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4207. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4208. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4209. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4210. PyTargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  4211. #
  4212. # DIRECTORY: panda/src/egg2pg/
  4213. #
  4214. if not RUNTIME and not PkgSkip("EGG"):
  4215. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4216. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4217. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4218. OPTS=['DIR:panda/src/egg2pg']
  4219. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4220. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4221. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4222. #
  4223. # DIRECTORY: panda/src/framework/
  4224. #
  4225. if (not RUNTIME):
  4226. deps = []
  4227. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4228. if GetLinkAllStatic():
  4229. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4230. if not PkgSkip("GL"):
  4231. DefSymbol("FRAMEWORK", "HAVE_GL")
  4232. if not PkgSkip("TINYDISPLAY"):
  4233. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4234. if not PkgSkip("EGG"):
  4235. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4236. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4237. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4238. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4239. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4240. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4241. #
  4242. # DIRECTORY: panda/src/glgsg/
  4243. #
  4244. if (not RUNTIME and PkgSkip("GL")==0):
  4245. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4246. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4247. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4248. #
  4249. # DIRECTORY: panda/src/glesgsg/
  4250. #
  4251. if (not RUNTIME and PkgSkip("GLES")==0):
  4252. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4253. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4254. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4255. #
  4256. # DIRECTORY: panda/src/gles2gsg/
  4257. #
  4258. if (not RUNTIME and PkgSkip("GLES2")==0):
  4259. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4260. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4261. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4262. #
  4263. # DIRECTORY: panda/metalibs/pandaegg/
  4264. #
  4265. if not RUNTIME and not PkgSkip("EGG"):
  4266. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4267. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4268. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4269. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4270. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4271. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4272. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4273. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4274. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4275. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4276. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4277. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4278. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4279. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4280. PyTargetAdd('egg_module.obj', opts=OPTS)
  4281. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4282. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4283. PyTargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4284. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4285. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4286. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4287. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4288. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4289. #
  4290. # DIRECTORY: panda/src/x11display/
  4291. #
  4292. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4293. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4294. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4295. #
  4296. # DIRECTORY: panda/src/glxdisplay/
  4297. #
  4298. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4299. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4300. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4301. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4302. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4303. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4304. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4305. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4306. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4307. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4308. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4309. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4310. #
  4311. # DIRECTORY: panda/src/cocoadisplay/
  4312. #
  4313. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4314. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4315. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4316. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4317. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4318. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4319. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4320. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4321. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4322. if (PkgSkip('PANDAFX')==0):
  4323. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4324. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4325. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4326. #
  4327. # DIRECTORY: panda/src/osxdisplay/
  4328. #
  4329. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4330. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4331. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4332. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4333. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4334. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4335. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4336. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4337. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4338. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4339. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4340. if (PkgSkip('PANDAFX')==0):
  4341. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4342. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4343. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4344. #
  4345. # DIRECTORY: panda/src/wgldisplay/
  4346. #
  4347. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4348. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4349. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4350. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4351. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4352. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4353. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4354. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4355. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4356. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4357. if (PkgSkip('PANDAFX')==0):
  4358. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4359. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4360. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4361. #
  4362. # DIRECTORY: panda/src/egldisplay/
  4363. #
  4364. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4365. DefSymbol('GLES', 'OPENGLES_1', '')
  4366. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4367. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4368. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4369. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4370. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4371. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4372. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4373. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4374. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4375. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4376. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4377. #
  4378. # DIRECTORY: panda/src/egldisplay/
  4379. #
  4380. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4381. DefSymbol('GLES2', 'OPENGLES_2', '')
  4382. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4383. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4384. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4385. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4386. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4387. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4388. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4389. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4390. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4391. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4392. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4393. #
  4394. # DIRECTORY: panda/src/ode/
  4395. #
  4396. if (PkgSkip("ODE")==0 and not RUNTIME):
  4397. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4398. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4399. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4400. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4401. OPTS=['DIR:panda/src/ode', 'ODE']
  4402. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4403. IGATEFILES.remove("odeConvexGeom.h")
  4404. IGATEFILES.remove("odeHelperStructs.h")
  4405. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4406. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4407. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4408. #
  4409. # DIRECTORY: panda/metalibs/pandaode/
  4410. #
  4411. if (PkgSkip("ODE")==0 and not RUNTIME):
  4412. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4413. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4414. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4415. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4416. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4417. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4418. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4419. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4420. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4421. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4422. PyTargetAdd('ode_module.obj', opts=OPTS)
  4423. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4424. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4425. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4426. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4427. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4428. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4429. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4430. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4431. #
  4432. # DIRECTORY: panda/src/bullet/
  4433. #
  4434. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4435. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4436. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4437. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4438. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4439. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4440. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4441. #
  4442. # DIRECTORY: panda/metalibs/pandabullet/
  4443. #
  4444. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4445. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4446. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4447. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4448. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4449. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4450. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4451. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4452. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4453. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4454. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4455. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4456. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4457. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4458. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4459. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4460. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4461. #
  4462. # DIRECTORY: panda/src/physx/
  4463. #
  4464. if (PkgSkip("PHYSX")==0):
  4465. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC']
  4466. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4467. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC']
  4468. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4469. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4470. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4471. #
  4472. # DIRECTORY: panda/metalibs/pandaphysx/
  4473. #
  4474. if (PkgSkip("PHYSX")==0):
  4475. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'PYTHON']
  4476. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4477. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4478. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4479. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4480. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'PYTHON'])
  4481. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC']
  4482. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4483. PyTargetAdd('physx_module.obj', opts=OPTS)
  4484. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4485. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4486. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4487. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4488. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4489. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4490. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC'])
  4491. #
  4492. # DIRECTORY: panda/src/physics/
  4493. #
  4494. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4495. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4496. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4497. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4498. OPTS=['DIR:panda/src/physics']
  4499. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4500. IGATEFILES.remove("forces.h")
  4501. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4502. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4503. #
  4504. # DIRECTORY: panda/src/particlesystem/
  4505. #
  4506. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4507. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4508. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4509. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4510. OPTS=['DIR:panda/src/particlesystem']
  4511. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4512. IGATEFILES.remove('orientedParticle.h')
  4513. IGATEFILES.remove('orientedParticleFactory.h')
  4514. IGATEFILES.remove('particlefactories.h')
  4515. IGATEFILES.remove('emitters.h')
  4516. IGATEFILES.remove('particles.h')
  4517. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4518. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4519. #
  4520. # DIRECTORY: panda/metalibs/pandaphysics/
  4521. #
  4522. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4523. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4524. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4525. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4526. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4527. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4528. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4529. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4530. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4531. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4532. OPTS=['DIR:panda/metalibs/pandaphysics']
  4533. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4534. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4535. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4536. PyTargetAdd('physics_module.obj', opts=OPTS)
  4537. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4538. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4539. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4540. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4541. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4542. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4543. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4544. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4545. #
  4546. # DIRECTORY: panda/src/speedtree/
  4547. #
  4548. if (PkgSkip("SPEEDTREE")==0):
  4549. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4550. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4551. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4552. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4553. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4554. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4555. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4556. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4557. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4558. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4559. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4560. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4561. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4562. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4563. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4564. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4565. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4566. #
  4567. # DIRECTORY: panda/src/testbed/
  4568. #
  4569. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4570. OPTS=['DIR:panda/src/testbed']
  4571. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4572. TargetAdd('pview.exe', input='pview_pview.obj')
  4573. TargetAdd('pview.exe', input='libp3framework.dll')
  4574. if not PkgSkip("EGG"):
  4575. TargetAdd('pview.exe', input='libpandaegg.dll')
  4576. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4577. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4578. if GetLinkAllStatic() and not PkgSkip("GL"):
  4579. TargetAdd('pview.exe', input='libpandagl.dll')
  4580. #
  4581. # DIRECTORY: panda/src/android/
  4582. #
  4583. if (not RUNTIME and GetTarget() == 'android'):
  4584. OPTS=['DIR:panda/src/android']
  4585. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4586. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4587. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4588. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4589. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4590. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4591. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4592. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4593. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4594. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4595. if (not RTDIST and PkgSkip("PVIEW")==0):
  4596. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4597. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4598. TargetAdd('libpview.dll', input='android_main.obj')
  4599. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4600. TargetAdd('libpview.dll', input='libp3framework.dll')
  4601. if not PkgSkip("EGG"):
  4602. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4603. TargetAdd('libpview.dll', input='libp3android.dll')
  4604. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4605. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4606. if (not RTDIST and PkgSkip("PYTHON")==0):
  4607. OPTS += ['PYTHON']
  4608. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4609. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4610. TargetAdd('libppython.dll', input='android_main.obj')
  4611. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4612. TargetAdd('libppython.dll', input='libp3framework.dll')
  4613. TargetAdd('libppython.dll', input='libp3android.dll')
  4614. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4615. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4616. #
  4617. # DIRECTORY: panda/src/androiddisplay/
  4618. #
  4619. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4620. DefSymbol('GLES', 'OPENGLES_1', '')
  4621. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4622. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4623. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4624. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4625. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4626. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4627. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4628. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4629. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4630. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4631. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4632. #
  4633. # DIRECTORY: panda/src/tinydisplay/
  4634. #
  4635. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4636. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4637. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4638. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4639. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4640. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4641. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4642. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4643. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4644. if GetTarget() == 'darwin':
  4645. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4646. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4647. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4648. elif GetTarget() == 'windows':
  4649. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4650. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4651. else:
  4652. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4653. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4654. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4655. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4656. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4657. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4658. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4659. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4660. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4661. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4662. #
  4663. # DIRECTORY: direct/src/directbase/
  4664. #
  4665. if (PkgSkip("DIRECT")==0):
  4666. OPTS=['DIR:direct/src/directbase']
  4667. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4668. #
  4669. # DIRECTORY: direct/src/dcparser/
  4670. #
  4671. if (PkgSkip("DIRECT")==0):
  4672. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4673. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4674. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4675. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4676. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4677. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4678. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4679. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4680. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4681. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4682. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4683. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4684. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4685. #
  4686. # DIRECTORY: direct/src/deadrec/
  4687. #
  4688. if (PkgSkip("DIRECT")==0):
  4689. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4690. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4691. OPTS=['DIR:direct/src/deadrec']
  4692. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4693. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4694. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4695. #
  4696. # DIRECTORY: direct/src/distributed/
  4697. #
  4698. if (PkgSkip("DIRECT")==0):
  4699. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4700. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4701. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4702. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4703. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4704. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4705. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4706. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4707. #
  4708. # DIRECTORY: direct/src/interval/
  4709. #
  4710. if (PkgSkip("DIRECT")==0):
  4711. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4712. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4713. OPTS=['DIR:direct/src/interval']
  4714. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4715. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4716. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4717. #
  4718. # DIRECTORY: direct/src/showbase/
  4719. #
  4720. if (PkgSkip("DIRECT")==0):
  4721. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4722. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4723. if GetTarget() == 'darwin':
  4724. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4725. OPTS=['DIR:direct/src/showbase']
  4726. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4727. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4728. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4729. #
  4730. # DIRECTORY: direct/src/motiontrail/
  4731. #
  4732. if (PkgSkip("DIRECT")==0):
  4733. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4734. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4735. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4736. OPTS=['DIR:direct/src/motiontrail']
  4737. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4738. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4739. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4740. #
  4741. # DIRECTORY: direct/metalibs/direct/
  4742. #
  4743. if (PkgSkip("DIRECT")==0):
  4744. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4745. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4746. if GetTarget() == 'darwin':
  4747. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4748. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4749. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4750. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4751. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4752. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4753. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4754. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4755. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4756. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4757. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4758. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4759. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4760. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4761. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4762. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4763. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4764. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4765. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4766. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4767. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4768. # the Python libraries. If a C++ user needs these modules, we can move them
  4769. # back and filter out the Python-specific code.
  4770. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4771. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4772. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4773. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4774. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4775. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4776. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4777. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4778. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4779. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4780. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4781. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4782. #
  4783. # DIRECTORY: direct/src/dcparse/
  4784. #
  4785. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4786. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4787. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4788. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4789. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4790. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4791. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4792. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4793. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4794. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4795. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4796. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4797. #
  4798. # DIRECTORY: direct/src/plugin/
  4799. #
  4800. if (RTDIST or RUNTIME):
  4801. # Explicitly define this as we don't include dtool_config.h here.
  4802. if GetTarget() not in ('windows', 'darwin'):
  4803. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4804. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4805. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4806. OPTS += ['ZLIB', 'MSIMG']
  4807. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4808. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4809. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4810. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4811. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4812. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4813. if GetTarget() == 'darwin':
  4814. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4815. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4816. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4817. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4818. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4819. if (RTDIST):
  4820. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4821. TargetAdd(fname, input='plugin_plugin.obj')
  4822. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4823. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4824. TargetAdd(fname, input='plugin_parse_color.obj')
  4825. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4826. if GetTarget() == 'darwin':
  4827. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4828. TargetAdd(fname, input='plugin_fileSpec.obj')
  4829. TargetAdd(fname, input='plugin_binaryXml.obj')
  4830. TargetAdd(fname, input='plugin_handleStream.obj')
  4831. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4832. TargetAdd(fname, input='libp3tinyxml.ilb')
  4833. if GetTarget() == 'darwin':
  4834. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4835. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4836. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4837. if (PkgSkip("PYTHON")==0 and RTDIST):
  4838. # Freeze VFSImporter and its dependency modules into p3dpython.
  4839. # Mark panda3d.core as a dependency to make sure to build that first.
  4840. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  4841. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4842. OPTS += ['PYTHON']
  4843. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4844. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4845. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4846. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4847. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4848. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4849. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4850. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4851. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4852. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4853. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4854. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4855. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4856. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4857. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4858. if GetTarget() == 'windows':
  4859. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4860. OPTS.append("NON_CONSOLE")
  4861. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4862. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4863. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4864. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4865. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4866. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4867. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4868. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4869. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  4870. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4871. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4872. if GetTarget() == 'darwin':
  4873. OPTS += ['OPT:2']
  4874. if (PkgSkip("FLTK")==0):
  4875. OPTS.append("FLTK")
  4876. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4877. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4878. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4879. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4880. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4881. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4882. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4883. if GetTarget() == 'darwin':
  4884. OPTS += ['OPT:2']
  4885. TargetAdd('p3dcert.exe', opts=OPTS)
  4886. elif (PkgSkip("WX")==0):
  4887. OPTS += ["WX", "RTTI"]
  4888. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4889. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4890. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4891. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4892. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4893. if GetTarget() == "darwin":
  4894. OPTS += ['GL', 'OPT:2']
  4895. TargetAdd('p3dcert.exe', opts=OPTS)
  4896. #
  4897. # DIRECTORY: direct/src/plugin_npapi/
  4898. #
  4899. if RUNTIME:
  4900. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4901. if GetTarget() == 'windows':
  4902. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4903. "version" : VERSION,
  4904. "description" : "Runs 3-D games and interactive applets",
  4905. "filename" : "nppanda3d.dll",
  4906. "mimetype" : "application/x-panda3d",
  4907. "extension" : "p3d",
  4908. "filedesc" : "Panda3D applet"}
  4909. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4910. elif GetTarget() == 'darwin':
  4911. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4912. OPTS += ['GTK2']
  4913. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4914. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4915. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4916. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4917. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4918. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4919. if GetTarget() == 'windows':
  4920. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4921. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4922. elif GetTarget() == 'darwin':
  4923. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4924. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4925. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4926. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4927. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4928. #
  4929. # DIRECTORY: direct/src/plugin_activex/
  4930. #
  4931. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4932. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4933. DefSymbol('ACTIVEX', '_USRDLL', '')
  4934. DefSymbol('ACTIVEX', '_WINDLL', '')
  4935. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4936. DefSymbol('ACTIVEX', '_MBCS', '')
  4937. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4938. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4939. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4940. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4941. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4942. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4943. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4944. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4945. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4946. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4947. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4948. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4949. #
  4950. # DIRECTORY: direct/src/plugin_standalone/
  4951. #
  4952. if (RUNTIME):
  4953. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4954. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  4955. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  4956. if GetTarget() == 'windows':
  4957. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4958. "version" : VERSION,
  4959. "description" : "Runs 3-D games and interactive applets",
  4960. "filename" : "panda3d.exe",
  4961. "mimetype" : "application/x-panda3d",
  4962. "extension" : "p3d",
  4963. "filedesc" : "Panda3D applet",
  4964. "icon" : "panda3d.ico"}
  4965. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  4966. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  4967. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  4968. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  4969. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  4970. TargetAdd('panda3d.exe', input='plugin_common.obj')
  4971. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  4972. if GetTarget() == 'darwin':
  4973. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  4974. elif GetTarget() == 'windows':
  4975. TargetAdd('panda3d.exe', input='panda3d.res')
  4976. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  4977. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  4978. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  4979. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  4980. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  4981. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4982. if (GetTarget() == 'darwin'):
  4983. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  4984. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  4985. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  4986. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  4987. TargetAdd('Panda3D.app', input='plugin_common.obj')
  4988. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  4989. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  4990. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  4991. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  4992. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  4993. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  4994. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  4995. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  4996. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  4997. elif (GetTarget() == 'windows'):
  4998. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  4999. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5000. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5001. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5002. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5003. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5004. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5005. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5006. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5007. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5008. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5009. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5010. if (RTDIST):
  5011. 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']
  5012. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5013. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5014. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5015. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5016. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5017. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5018. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5019. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5020. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5021. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5022. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5023. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5024. if (GetTarget() == 'darwin'):
  5025. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5026. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5027. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5028. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5029. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5030. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5031. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5032. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5033. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5034. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5035. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5036. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5037. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5038. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5039. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5040. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5041. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5042. if GetTarget() == 'darwin':
  5043. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5044. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5045. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5046. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5047. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5048. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5049. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5050. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5051. if GetTarget() == 'darwin':
  5052. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5053. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5054. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5055. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5056. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5057. if GetTarget() == 'windows':
  5058. OPTS.append("P3DEMBEDW")
  5059. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5060. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5061. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5062. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5063. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5064. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5065. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5066. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5067. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5068. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5069. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5070. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5071. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5072. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5073. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5074. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5075. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5076. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5077. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5078. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5079. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5080. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5081. #
  5082. # DIRECTORY: pandatool/src/pandatoolbase/
  5083. #
  5084. if (PkgSkip("PANDATOOL")==0):
  5085. OPTS=['DIR:pandatool/src/pandatoolbase']
  5086. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5087. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5088. #
  5089. # DIRECTORY: pandatool/src/converter/
  5090. #
  5091. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5092. OPTS=['DIR:pandatool/src/converter']
  5093. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5094. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5095. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5096. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5097. #
  5098. # DIRECTORY: pandatool/src/progbase/
  5099. #
  5100. if not PkgSkip("PANDATOOL"):
  5101. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5102. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5103. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5104. #
  5105. # DIRECTORY: pandatool/src/eggbase/
  5106. #
  5107. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5108. OPTS=['DIR:pandatool/src/eggbase']
  5109. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5110. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5111. #
  5112. # DIRECTORY: pandatool/src/bam/
  5113. #
  5114. if not PkgSkip("PANDATOOL"):
  5115. OPTS=['DIR:pandatool/src/bam']
  5116. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5117. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5118. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5119. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5120. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5121. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5122. if not PkgSkip("EGG"):
  5123. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5124. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5125. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5126. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5127. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5128. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5129. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5130. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5131. #
  5132. # DIRECTORY: pandatool/src/cvscopy/
  5133. #
  5134. if not PkgSkip("PANDATOOL"):
  5135. OPTS=['DIR:pandatool/src/cvscopy']
  5136. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5137. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5138. #
  5139. # DIRECTORY: pandatool/src/daeegg/
  5140. #
  5141. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5142. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5143. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5144. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5145. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5146. #
  5147. # DIRECTORY: pandatool/src/assimp
  5148. #
  5149. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5150. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5151. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5152. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5153. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5154. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5155. #
  5156. # DIRECTORY: pandatool/src/daeprogs/
  5157. #
  5158. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5159. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5160. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5161. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5162. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5163. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5164. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5165. #
  5166. # DIRECTORY: pandatool/src/dxf/
  5167. #
  5168. if not PkgSkip("PANDATOOL"):
  5169. OPTS=['DIR:pandatool/src/dxf']
  5170. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5171. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5172. #
  5173. # DIRECTORY: pandatool/src/dxfegg/
  5174. #
  5175. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5176. OPTS=['DIR:pandatool/src/dxfegg']
  5177. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5178. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5179. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5180. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5181. #
  5182. # DIRECTORY: pandatool/src/dxfprogs/
  5183. #
  5184. if not PkgSkip("PANDATOOL"):
  5185. OPTS=['DIR:pandatool/src/dxfprogs']
  5186. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5187. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5188. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5189. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5190. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5191. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5192. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5193. if not PkgSkip("EGG"):
  5194. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5195. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5196. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5197. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5198. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5199. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5200. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5201. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5202. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5203. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5204. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5205. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5206. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5207. #
  5208. # DIRECTORY: pandatool/src/objegg/
  5209. #
  5210. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5211. OPTS=['DIR:pandatool/src/objegg']
  5212. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5213. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5214. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5215. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5216. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5217. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5218. #
  5219. # DIRECTORY: pandatool/src/objprogs/
  5220. #
  5221. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5222. OPTS=['DIR:pandatool/src/objprogs']
  5223. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5224. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5225. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5226. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5227. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5228. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5229. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5230. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5231. #
  5232. # DIRECTORY: pandatool/src/palettizer/
  5233. #
  5234. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5235. OPTS=['DIR:pandatool/src/palettizer']
  5236. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5237. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5238. #
  5239. # DIRECTORY: pandatool/src/egg-mkfont/
  5240. #
  5241. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5242. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5243. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5244. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5245. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5246. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5247. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5248. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5249. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5250. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5251. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5252. #
  5253. # DIRECTORY: pandatool/src/eggcharbase/
  5254. #
  5255. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5256. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5257. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5258. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5259. #
  5260. # DIRECTORY: pandatool/src/egg-optchar/
  5261. #
  5262. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5263. OPTS=['DIR:pandatool/src/egg-optchar']
  5264. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5265. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5266. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5267. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5268. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5269. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5270. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5271. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5272. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5273. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5274. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5275. #
  5276. # DIRECTORY: pandatool/src/egg-palettize/
  5277. #
  5278. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5279. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5280. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5281. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5282. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5283. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5284. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5285. #
  5286. # DIRECTORY: pandatool/src/egg-qtess/
  5287. #
  5288. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5289. OPTS=['DIR:pandatool/src/egg-qtess']
  5290. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5291. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5292. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5293. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5294. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5295. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5296. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5297. #
  5298. # DIRECTORY: pandatool/src/eggprogs/
  5299. #
  5300. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5301. OPTS=['DIR:pandatool/src/eggprogs']
  5302. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5303. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5304. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5305. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5306. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5307. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5308. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5309. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5310. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5311. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5312. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5313. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5314. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5315. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5316. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5317. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5318. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5319. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5320. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5321. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5322. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5323. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5324. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5325. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5326. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5327. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5328. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5329. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5330. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5331. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5332. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5333. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5334. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5335. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5336. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5337. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5338. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5339. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5340. #
  5341. # DIRECTORY: pandatool/src/flt/
  5342. #
  5343. if not PkgSkip("PANDATOOL"):
  5344. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5345. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5346. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5347. #
  5348. # DIRECTORY: pandatool/src/fltegg/
  5349. #
  5350. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5351. OPTS=['DIR:pandatool/src/fltegg']
  5352. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5353. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5354. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5355. #
  5356. # DIRECTORY: pandatool/src/fltprogs/
  5357. #
  5358. if not PkgSkip("PANDATOOL"):
  5359. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5360. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5361. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5362. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5363. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5364. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5365. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5366. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5367. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5368. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5369. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5370. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5371. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5372. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5373. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5374. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5375. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5376. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5377. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5378. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5379. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5380. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5381. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5382. if not PkgSkip("EGG"):
  5383. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5384. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5385. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5386. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5387. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5388. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5389. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5390. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5391. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5392. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5393. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5394. #
  5395. # DIRECTORY: pandatool/src/imagebase/
  5396. #
  5397. if not PkgSkip("PANDATOOL"):
  5398. OPTS=['DIR:pandatool/src/imagebase']
  5399. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5400. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5401. #
  5402. # DIRECTORY: pandatool/src/imageprogs/
  5403. #
  5404. if not PkgSkip("PANDATOOL"):
  5405. OPTS=['DIR:pandatool/src/imageprogs']
  5406. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5407. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5408. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5409. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5410. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5411. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5412. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5413. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5414. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5415. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5416. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5417. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5418. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5419. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5420. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5421. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5422. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5423. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5424. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5425. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5426. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5427. #
  5428. # DIRECTORY: pandatool/src/pfmprogs/
  5429. #
  5430. if not PkgSkip("PANDATOOL"):
  5431. OPTS=['DIR:pandatool/src/pfmprogs']
  5432. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5433. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5434. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5435. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5436. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5437. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5438. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5439. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5440. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5441. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5442. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5443. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5444. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5445. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5446. #
  5447. # DIRECTORY: pandatool/src/lwo/
  5448. #
  5449. if not PkgSkip("PANDATOOL"):
  5450. OPTS=['DIR:pandatool/src/lwo']
  5451. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5452. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5453. #
  5454. # DIRECTORY: pandatool/src/lwoegg/
  5455. #
  5456. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5457. OPTS=['DIR:pandatool/src/lwoegg']
  5458. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5459. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5460. #
  5461. # DIRECTORY: pandatool/src/lwoprogs/
  5462. #
  5463. if not PkgSkip("PANDATOOL"):
  5464. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5465. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5466. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5467. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5468. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5469. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5470. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5471. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5472. if not PkgSkip("EGG"):
  5473. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5474. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5475. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5476. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5477. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5478. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5479. #
  5480. # DIRECTORY: pandatool/src/maya/
  5481. #
  5482. for VER in MAYAVERSIONS:
  5483. VNUM=VER[4:]
  5484. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5485. OPTS=['DIR:pandatool/src/maya', VER]
  5486. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5487. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5488. #
  5489. # DIRECTORY: pandatool/src/mayaegg/
  5490. #
  5491. for VER in MAYAVERSIONS:
  5492. VNUM=VER[4:]
  5493. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5494. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5495. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5496. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5497. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5498. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5499. #
  5500. # DIRECTORY: pandatool/src/maxegg/
  5501. #
  5502. for VER in MAXVERSIONS:
  5503. VNUM=VER[3:]
  5504. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5505. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5506. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5507. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5508. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5509. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5510. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5511. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5512. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5513. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5514. #
  5515. # DIRECTORY: pandatool/src/maxprogs/
  5516. #
  5517. for VER in MAXVERSIONS:
  5518. VNUM=VER[3:]
  5519. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5520. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5521. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5522. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5523. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5524. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5525. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5526. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5527. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5528. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5529. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5530. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5531. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5532. #
  5533. # DIRECTORY: pandatool/src/vrml/
  5534. #
  5535. if not PkgSkip("PANDATOOL"):
  5536. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5537. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5538. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5539. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5540. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5541. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5542. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5543. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5544. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5545. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5546. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5547. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5548. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5549. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5550. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5551. #
  5552. # DIRECTORY: pandatool/src/vrmlegg/
  5553. #
  5554. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5555. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5556. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5557. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5558. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5559. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5560. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5561. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5562. #
  5563. # DIRECTORY: pandatool/src/xfile/
  5564. #
  5565. if not PkgSkip("PANDATOOL"):
  5566. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5567. CreateFile(GetOutputDir()+"/include/xParser.h")
  5568. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5569. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5570. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5571. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5572. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5573. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5574. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5575. #
  5576. # DIRECTORY: pandatool/src/xfileegg/
  5577. #
  5578. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5579. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5580. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5581. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5582. #
  5583. # DIRECTORY: pandatool/src/ptloader/
  5584. #
  5585. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5586. if not PkgSkip("FCOLLADA"):
  5587. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5588. 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']
  5589. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5590. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5591. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5592. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5593. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5594. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5595. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5596. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5597. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5598. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5599. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5600. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5601. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5602. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5603. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5604. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5605. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5606. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5607. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5608. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5609. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5610. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5611. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5612. #
  5613. # DIRECTORY: pandatool/src/miscprogs/
  5614. #
  5615. # This is a bit of an esoteric tool, and it causes issues because
  5616. # it conflicts with tools of the same name in different packages.
  5617. #if (PkgSkip("PANDATOOL")==0):
  5618. # OPTS=['DIR:pandatool/src/miscprogs']
  5619. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5620. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5621. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5622. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5623. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5624. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5625. #
  5626. # DIRECTORY: pandatool/src/pstatserver/
  5627. #
  5628. if (PkgSkip("PANDATOOL")==0):
  5629. OPTS=['DIR:pandatool/src/pstatserver']
  5630. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5631. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5632. #
  5633. # DIRECTORY: pandatool/src/text-stats/
  5634. #
  5635. if (PkgSkip("PANDATOOL")==0):
  5636. OPTS=['DIR:pandatool/src/text-stats']
  5637. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5638. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5639. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5640. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5641. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5642. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5643. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5644. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5645. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5646. #
  5647. # DIRECTORY: pandatool/src/vrmlprogs/
  5648. #
  5649. if not PkgSkip("PANDATOOL"):
  5650. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5651. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5652. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5653. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5654. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5655. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5656. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5657. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5658. if not PkgSkip("EGG"):
  5659. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5660. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5661. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5662. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5663. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5664. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5665. #
  5666. # DIRECTORY: pandatool/src/win-stats/
  5667. # DIRECTORY: pandatool/src/gtk-stats/
  5668. #
  5669. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5670. if GetTarget() == 'windows':
  5671. OPTS=['DIR:pandatool/src/win-stats']
  5672. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5673. else:
  5674. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5675. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5676. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5677. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5678. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5679. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5680. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5681. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5682. #
  5683. # DIRECTORY: pandatool/src/xfileprogs/
  5684. #
  5685. if not PkgSkip("PANDATOOL"):
  5686. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5687. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5688. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5689. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5690. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5691. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5692. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5693. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5694. if not PkgSkip("EGG"):
  5695. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5696. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5697. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5698. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5699. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5700. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5701. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5702. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5703. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5704. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5705. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5706. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5707. #
  5708. # DIRECTORY: pandatool/src/mayaprogs/
  5709. #
  5710. for VER in MAYAVERSIONS:
  5711. VNUM = VER[4:]
  5712. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5713. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5714. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386']
  5715. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5716. continue
  5717. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5718. ARCH_OPTS = ['NOARCH:PPC']
  5719. elif GetTarget() == 'darwin':
  5720. ARCH_OPTS = ['NOARCH:X86_64']
  5721. else:
  5722. ARCH_OPTS = []
  5723. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5724. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5725. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5726. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5727. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5728. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5729. #if GetTarget() == 'windows':
  5730. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5731. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5732. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5733. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5734. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5735. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5736. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5737. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5738. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5739. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5740. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5741. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5742. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5743. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5744. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5745. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5746. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5747. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5748. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5749. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5750. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5751. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5752. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5753. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5754. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5755. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5756. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5757. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5758. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5759. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5760. if GetTarget() == 'windows':
  5761. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5762. else:
  5763. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5764. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5765. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5766. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5767. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5768. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5769. if GetTarget() == 'windows':
  5770. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5771. else:
  5772. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5773. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5774. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5775. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5776. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5777. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5778. if GetTarget() == 'windows':
  5779. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5780. else:
  5781. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5782. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5783. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5784. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5785. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5786. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5787. if GetTarget() == 'windows':
  5788. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5789. else:
  5790. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5791. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5792. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5793. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5794. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5795. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5796. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5797. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5798. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5799. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5800. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5801. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5802. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5803. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5804. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5805. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5806. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5807. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5808. #
  5809. # DIRECTORY: contrib/src/ai/
  5810. #
  5811. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5812. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5813. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5814. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5815. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5816. OPTS=['DIR:contrib/src/ai']
  5817. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5818. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5819. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5820. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5821. PyTargetAdd('ai_module.obj', opts=OPTS)
  5822. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5823. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5824. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5825. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5826. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5827. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5828. #
  5829. # DIRECTORY: contrib/src/rplight/
  5830. #
  5831. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5832. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5833. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5834. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5835. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5836. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5837. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5838. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5839. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5840. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5841. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5842. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5843. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5844. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5845. #
  5846. # DIRECTORY: pandatool/src/deploy-stub
  5847. #
  5848. if PkgSkip("PYTHON") == 0:
  5849. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5850. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5851. if GetTarget() == 'windows':
  5852. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5853. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5854. # Setup rpath so libs can be found in the same directory as the deployed game
  5855. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5856. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5857. LibName('DEPLOYSTUB', "-rdynamic")
  5858. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5859. if GetTarget() == 'windows':
  5860. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5861. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5862. if GetTarget() == 'windows':
  5863. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5864. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5865. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5866. elif GetTarget() == 'darwin':
  5867. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5868. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5869. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5870. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5871. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5872. #
  5873. # Generate the models directory and samples directory
  5874. #
  5875. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5876. model_extensions = ["*.egg"]
  5877. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5878. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5879. model_extensions.append("*.flt")
  5880. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5881. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5882. newname = model[:-4] + ".egg.pz"
  5883. else:
  5884. newname = model[:-4] + ".egg"
  5885. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5886. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5887. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5888. newname = model[:-4] + ".egg.pz"
  5889. else:
  5890. newname = model[:-4] + ".egg"
  5891. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5892. for model in GetDirectoryContents("models", model_extensions):
  5893. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5894. newname = model[:-4] + ".egg.pz"
  5895. else:
  5896. newname = model[:-4] + ".egg"
  5897. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5898. if not PkgSkip("DIRECT") and not RUNTIME:
  5899. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5900. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5901. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5902. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5903. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5904. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5905. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5906. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5907. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5908. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5909. #
  5910. # Build the rtdist.
  5911. #
  5912. if (RTDIST):
  5913. OPTS=['DIR:direct/src/p3d']
  5914. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5915. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5916. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5917. #
  5918. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5919. #
  5920. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5921. OPTS=['DIR:direct/src/p3d']
  5922. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5923. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5924. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5925. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5926. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5927. ##########################################################################################
  5928. #
  5929. # Dependency-Based Distributed Build System.
  5930. #
  5931. ##########################################################################################
  5932. DEPENDENCYQUEUE=[]
  5933. for target in TARGET_LIST:
  5934. name = target.name
  5935. inputs = target.inputs
  5936. opts = target.opts
  5937. deps = target.deps
  5938. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5939. def BuildWorker(taskqueue, donequeue):
  5940. while True:
  5941. try:
  5942. task = taskqueue.get(timeout=1)
  5943. except:
  5944. ProgressOutput(None, "Waiting for tasks...")
  5945. task = taskqueue.get()
  5946. sys.stdout.flush()
  5947. if (task == 0): return
  5948. try:
  5949. task[0](*task[1])
  5950. donequeue.put(task)
  5951. except:
  5952. donequeue.put(0)
  5953. def AllSourcesReady(task, pending):
  5954. sources = task[3]
  5955. for x in sources:
  5956. if (x in pending):
  5957. return 0
  5958. sources = task[1][1]
  5959. for x in sources:
  5960. if (x in pending):
  5961. return 0
  5962. altsources = task[4]
  5963. for x in altsources:
  5964. if (x in pending):
  5965. return 0
  5966. return 1
  5967. def ParallelMake(tasklist):
  5968. # Create the communication queues.
  5969. donequeue = queue.Queue()
  5970. taskqueue = queue.Queue()
  5971. # Build up a table listing all the pending targets
  5972. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  5973. # task[2] = [name]
  5974. # task[3] = deps
  5975. # The python tool package, in particular fltegg seems to throw parallelmake off
  5976. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  5977. # and another subpart to be built sequentially. The most time consuming part of the process
  5978. # is the c++ code generation anyways.
  5979. tasklist_seq = []
  5980. i = 0
  5981. while i < len(tasklist):
  5982. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  5983. break
  5984. i += 1
  5985. if i < len(tasklist):
  5986. tasklist_seq = tasklist[i:]
  5987. tasklist = tasklist[:i]
  5988. iNumStartingTasks = len(tasklist)
  5989. pending = {}
  5990. for task in tasklist:
  5991. for target in task[2]:
  5992. pending[target] = 1
  5993. # Create the workers
  5994. for slave in range(THREADCOUNT):
  5995. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  5996. th.setDaemon(1)
  5997. th.start()
  5998. # Feed tasks to the workers.
  5999. tasksqueued = 0
  6000. while True:
  6001. if (tasksqueued < THREADCOUNT):
  6002. extras = []
  6003. for task in tasklist:
  6004. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6005. if (NeedsBuild(task[2], task[3])):
  6006. tasksqueued += 1
  6007. taskqueue.put(task)
  6008. else:
  6009. for target in task[2]:
  6010. del pending[target]
  6011. else:
  6012. extras.append(task)
  6013. tasklist = extras
  6014. sys.stdout.flush()
  6015. if (tasksqueued == 0): break
  6016. donetask = donequeue.get()
  6017. if (donetask == 0):
  6018. exit("Build process aborting.")
  6019. sys.stdout.flush()
  6020. tasksqueued -= 1
  6021. JustBuilt(donetask[2], donetask[3])
  6022. for target in donetask[2]:
  6023. del pending[target]
  6024. # Kill the workers.
  6025. for slave in range(THREADCOUNT):
  6026. taskqueue.put(0)
  6027. # Make sure there aren't any unsatisfied tasks
  6028. if len(tasklist) > 0:
  6029. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6030. SequentialMake(tasklist_seq)
  6031. def SequentialMake(tasklist):
  6032. i = 0
  6033. for task in tasklist:
  6034. if (NeedsBuild(task[2], task[3])):
  6035. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6036. JustBuilt(task[2], task[3])
  6037. i += 1
  6038. def RunDependencyQueue(tasklist):
  6039. if (THREADCOUNT!=0):
  6040. ParallelMake(tasklist)
  6041. else:
  6042. SequentialMake(tasklist)
  6043. try:
  6044. RunDependencyQueue(DEPENDENCYQUEUE)
  6045. finally:
  6046. SaveDependencyCache()
  6047. # Run the test suite.
  6048. if RUNTESTS:
  6049. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6050. if sys.version_info >= (2, 6):
  6051. cmdstr += " -B"
  6052. cmdstr += " -m pytest tests"
  6053. if GetVerbose():
  6054. cmdstr += " --verbose"
  6055. oscmd(cmdstr)
  6056. # Write out information about the Python versions in the built dir.
  6057. python_version_info = GetCurrentPythonVersionInfo()
  6058. UpdatePythonVersionInfoFile(python_version_info)
  6059. ##########################################################################################
  6060. #
  6061. # The Installers
  6062. #
  6063. # Under windows, we can build an 'exe' package using NSIS
  6064. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6065. # Under OSX, we can make a 'dmg' package.
  6066. #
  6067. ##########################################################################################
  6068. if INSTALLER:
  6069. ProgressOutput(100.0, "Building installer")
  6070. from makepackage import MakeInstaller
  6071. # When using the --installer flag, only install for the current version.
  6072. python_versions = []
  6073. if python_version_info:
  6074. python_versions.append(python_version_info)
  6075. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6076. optimize=GetOptimize(), compressor=COMPRESSOR,
  6077. debversion=DEBVERSION, rpmrelease=RPMRELEASE,
  6078. runtime=RUNTIME, python_versions=python_versions)
  6079. if WHEEL:
  6080. ProgressOutput(100.0, "Building wheel")
  6081. from makewheel import makewheel
  6082. makewheel(WHLVERSION, GetOutputDir())
  6083. ##########################################################################################
  6084. #
  6085. # Print final status report.
  6086. #
  6087. ##########################################################################################
  6088. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6089. printStatus("Makepanda Final Status Report", WARNINGS)
  6090. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())