makepanda.py 310 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130
  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", # macOS 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 macOS version number to build for (macOS only))")
  134. print(" --universal (build universal binaries (macOS 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_archs = []
  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_archs.append(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. parts = OSXTARGET.strip().split('.')
  276. try:
  277. assert len(parts) <= 2
  278. maj = int(parts[0])
  279. min = 0
  280. if len(parts) > 1:
  281. min = int(parts[1])
  282. OSXTARGET = maj, min
  283. assert OSXTARGET >= (10, 4)
  284. except:
  285. usage("Invalid setting for --osxtarget")
  286. else:
  287. OSXTARGET = None
  288. if target is not None or target_archs:
  289. SetTarget(target, target_archs[-1] if target_archs else None)
  290. if universal:
  291. if target_archs:
  292. exit("--universal is incompatible with --arch")
  293. if OSXTARGET:
  294. osxver = OSXTARGET
  295. else:
  296. maj, min = platform.mac_ver()[0].split('.')[:2]
  297. osxver = int(maj), int(min)
  298. if osxver < (10, 15):
  299. OSX_ARCHS.append("i386")
  300. if osxver < (10, 6):
  301. OSX_ARCHS.append("ppc")
  302. else:
  303. OSX_ARCHS.append("x86_64")
  304. if osxver >= (11, 0):
  305. OSX_ARCHS.append("arm64")
  306. elif target_archs:
  307. OSX_ARCHS = target_archs
  308. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  309. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  310. try:
  311. SetOptimize(int(optimize))
  312. assert GetOptimize() in [1, 2, 3, 4]
  313. except:
  314. usage("Invalid setting for OPTIMIZE")
  315. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  316. usage("Invalid SHA-1 hash given for --git-commit option!")
  317. if GetTarget() == 'windows':
  318. if not MSVC_VERSION:
  319. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  320. MSVC_VERSION = (14, 0)
  321. else:
  322. try:
  323. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  324. if (len(MSVC_VERSION) == 1):
  325. MSVC_VERSION += (0,)
  326. except:
  327. usage("Invalid setting for --msvc-version")
  328. if MSVC_VERSION < (14, 0):
  329. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  330. print("=========================================================================")
  331. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  332. print(warn_prefix + "For more information, or any questions, please visit:")
  333. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  334. print("=========================================================================")
  335. sys.stdout.flush()
  336. time.sleep(1.0)
  337. sys.exit(1)
  338. if not WINDOWS_SDK:
  339. print("No Windows SDK version specified. Defaulting to '7.1'.")
  340. WINDOWS_SDK = '7.1'
  341. if clean_build and os.path.isdir(GetOutputDir()):
  342. print("Deleting %s" % (GetOutputDir()))
  343. shutil.rmtree(GetOutputDir())
  344. parseopts(sys.argv[1:])
  345. ########################################################################
  346. ##
  347. ## Handle environment variables.
  348. ##
  349. ########################################################################
  350. if ("CFLAGS" in os.environ):
  351. CFLAGS = os.environ["CFLAGS"].strip()
  352. if ("CXXFLAGS" in os.environ):
  353. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  354. if ("RPM_OPT_FLAGS" in os.environ):
  355. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  356. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  357. if ("LDFLAGS" in os.environ):
  358. LDFLAGS = os.environ["LDFLAGS"].strip()
  359. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  360. if GetHost() == "darwin" and OSXTARGET is not None:
  361. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  362. ########################################################################
  363. ##
  364. ## Configure things based on the command-line parameters.
  365. ##
  366. ########################################################################
  367. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  368. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  369. if VERSION is None:
  370. if RUNTIME:
  371. VERSION = PLUGIN_VERSION
  372. else:
  373. # Take the value from the setup.cfg file.
  374. VERSION = GetMetadataValue('version')
  375. if WHLVERSION is None:
  376. WHLVERSION = VERSION
  377. print("Version: %s" % VERSION)
  378. if RUNTIME or RTDIST:
  379. print("Core API Version: %s" % COREAPI_VERSION)
  380. if DEBVERSION is None:
  381. DEBVERSION = VERSION
  382. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  383. if P3DSUFFIX is None:
  384. P3DSUFFIX = MAJOR_VERSION
  385. # Now determine the distutils-style platform tag for the target system.
  386. target = GetTarget()
  387. if target == 'windows':
  388. if GetTargetArch() == 'x64':
  389. PLATFORM = 'win-amd64'
  390. else:
  391. PLATFORM = 'win32'
  392. elif target == 'darwin':
  393. if OSXTARGET:
  394. osxver = OSXTARGET
  395. else:
  396. maj, min = platform.mac_ver()[0].split('.')[:2]
  397. osxver = int(maj), int(min)
  398. if osxver[0] == 11:
  399. # I think Python pins minor version to 0 from macOS 11 onward
  400. osxver = (osxver[0], 0)
  401. arch_tag = None
  402. if not OSX_ARCHS:
  403. arch_tag = GetTargetArch()
  404. elif len(OSX_ARCHS) == 1:
  405. arch_tag = OSX_ARCHS[0]
  406. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  407. arch_tag = 'fat'
  408. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  409. arch_tag = 'intel'
  410. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  411. arch_tag = 'fat64'
  412. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  413. arch_tag = 'fat32'
  414. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  415. arch_tag = 'universal'
  416. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  417. arch_tag = 'universal2'
  418. else:
  419. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  420. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  421. 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"):
  422. # This is manylinux1. A bit of a sloppy check, though.
  423. if GetTargetArch() in ('x86_64', 'amd64'):
  424. PLATFORM = 'manylinux1-x86_64'
  425. else:
  426. PLATFORM = 'manylinux1-i686'
  427. 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"):
  428. # Same sloppy check for manylinux2010.
  429. if GetTargetArch() in ('x86_64', 'amd64'):
  430. PLATFORM = 'manylinux2010-x86_64'
  431. else:
  432. PLATFORM = 'manylinux2010-i686'
  433. 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"):
  434. # Same sloppy check for manylinux2014.
  435. if GetTargetArch() in ('x86_64', 'amd64'):
  436. PLATFORM = 'manylinux2014-x86_64'
  437. else:
  438. PLATFORM = 'manylinux2014-i686'
  439. elif not CrossCompiling():
  440. if HasTargetArch():
  441. # Replace the architecture in the platform string.
  442. platform_parts = get_platform().rsplit('-', 1)
  443. target_arch = GetTargetArch()
  444. if target_arch == 'amd64':
  445. target_arch = 'x86_64'
  446. PLATFORM = platform_parts[0] + '-' + target_arch
  447. else:
  448. # We're not cross-compiling; just take the host arch.
  449. PLATFORM = get_platform()
  450. else:
  451. target_arch = GetTargetArch()
  452. if target_arch == 'amd64':
  453. target_arch = 'x86_64'
  454. PLATFORM = '{0}-{1}'.format(target, target_arch)
  455. print("Platform: %s" % PLATFORM)
  456. outputdir_suffix = ""
  457. if (RUNTIME or RTDIST):
  458. # Compiling Maya/Max is pointless in rtdist build
  459. for ver in MAYAVERSIONS + MAXVERSIONS:
  460. PkgDisable(ver)
  461. if (DISTRIBUTOR.strip() == ""):
  462. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  463. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  464. if (RUNTIME):
  465. outputdir_suffix += "_rt"
  466. if DISTRIBUTOR == "":
  467. DISTRIBUTOR = "makepanda"
  468. elif not RTDIST_VERSION:
  469. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  470. if not RTDIST_VERSION:
  471. RTDIST_VERSION = "dev"
  472. if not IsCustomOutputDir():
  473. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  474. outputdir_suffix += '_x64'
  475. SetOutputDir("built" + outputdir_suffix)
  476. if (RUNTIME):
  477. for pkg in PkgListGet():
  478. if pkg in ["GTK2", "MFC"]:
  479. # Optional package(s) for runtime.
  480. pass
  481. elif pkg in ["OPENSSL", "ZLIB"]:
  482. # Required packages for runtime.
  483. if (PkgSkip(pkg)==1):
  484. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  485. else:
  486. # Unused packages for runtime.
  487. PkgDisable(pkg)
  488. if (INSTALLER and RTDIST):
  489. exit("Cannot build an installer for the rtdist build!")
  490. if (WHEEL and RUNTIME):
  491. exit("Cannot build a wheel for the runtime build!")
  492. if (WHEEL and RTDIST):
  493. exit("Cannot build a wheel for the rtdist build!")
  494. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  495. exit("Cannot build installer on Windows without python")
  496. if WHEEL and PkgSkip("PYTHON"):
  497. exit("Cannot build wheel without Python")
  498. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  499. exit("Cannot build rtdist without wx or fltk")
  500. if (RUNTIME):
  501. SetLinkAllStatic(True)
  502. if not os.path.isdir("contrib"):
  503. PkgDisable("CONTRIB")
  504. ########################################################################
  505. ##
  506. ## Load the dependency cache.
  507. ##
  508. ########################################################################
  509. LoadDependencyCache()
  510. ########################################################################
  511. ##
  512. ## Locate various SDKs.
  513. ##
  514. ########################################################################
  515. MakeBuildTree()
  516. SdkLocateDirectX(STRDXSDKVERSION)
  517. SdkLocateMaya()
  518. SdkLocateMax()
  519. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  520. SdkLocatePython(RTDIST)
  521. SdkLocateWindows(WINDOWS_SDK)
  522. SdkLocatePhysX()
  523. SdkLocateSpeedTree()
  524. SdkLocateAndroid()
  525. SdkAutoDisableDirectX()
  526. SdkAutoDisableMaya()
  527. SdkAutoDisableMax()
  528. SdkAutoDisablePhysX()
  529. SdkAutoDisableSpeedTree()
  530. if RTDIST and DISTRIBUTOR == "cmu":
  531. # Some validation checks for the CMU builds.
  532. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  533. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  534. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  535. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  536. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  537. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  538. if RTDIST and not HOST_URL:
  539. exit("You must specify a host URL when building the rtdist!")
  540. if RUNTIME and not HOST_URL:
  541. # Set this to a nice default.
  542. HOST_URL = "https://runtime.panda3d.org/"
  543. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  544. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  545. print("==========================================================================")
  546. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  547. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  548. print(warn_prefix + "Please upgrade to Python 3 now.")
  549. print("==========================================================================")
  550. sys.stdout.flush()
  551. # Give the user some time to contemplate their sins
  552. time.sleep(6.0)
  553. ########################################################################
  554. ##
  555. ## Choose a Compiler.
  556. ##
  557. ## This should also set up any environment variables needed to make
  558. ## the compiler work.
  559. ##
  560. ########################################################################
  561. if GetHost() == 'windows' and GetTarget() == 'windows':
  562. COMPILER = "MSVC"
  563. SdkLocateVisualStudio(MSVC_VERSION)
  564. else:
  565. COMPILER = "GCC"
  566. SetupBuildEnvironment(COMPILER)
  567. ########################################################################
  568. ##
  569. ## External includes, external libraries, and external defsyms.
  570. ##
  571. ########################################################################
  572. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  573. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  574. if (COMPILER == "MSVC"):
  575. PkgDisable("X11")
  576. PkgDisable("GLES")
  577. PkgDisable("GLES2")
  578. PkgDisable("EGL")
  579. PkgDisable("CARBON")
  580. PkgDisable("COCOA")
  581. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  582. if (PkgSkip("PYTHON")==0):
  583. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  584. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  585. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  586. for pkg in PkgListGet():
  587. if (PkgSkip(pkg)==0):
  588. if (pkg[:4]=="MAYA"):
  589. IncDirectory(pkg, SDK[pkg] + "/include")
  590. DefSymbol(pkg, "MAYAVERSION", pkg)
  591. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  592. elif (pkg[:3]=="MAX"):
  593. IncDirectory(pkg, SDK[pkg] + "/include")
  594. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  595. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  596. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  597. DefSymbol(pkg, "MAX", pkg)
  598. if (int(pkg[3:]) >= 2013):
  599. DefSymbol(pkg, "UNICODE", "")
  600. DefSymbol(pkg, "_UNICODE", "")
  601. elif (pkg[:2]=="DX"):
  602. IncDirectory(pkg, SDK[pkg] + "/include")
  603. elif GetThirdpartyDir() is not None:
  604. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  605. for pkg in DXVERSIONS:
  606. if (PkgSkip(pkg)==0):
  607. vnum=pkg[2:]
  608. if GetTargetArch() == 'x64':
  609. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  610. else:
  611. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  612. LibDirectory(pkg, SDK[pkg] + '/lib')
  613. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  614. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  615. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  616. LibName(pkg, 'dxerr.lib')
  617. else:
  618. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  619. #LibName(pkg, 'ddraw.lib')
  620. LibName(pkg, 'dxguid.lib')
  621. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  622. # dxerr needs this for __vsnwprintf definition.
  623. LibName(pkg, 'legacy_stdio_definitions.lib')
  624. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  625. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  626. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  627. LibName("WINSOCK", "wsock32.lib")
  628. LibName("WINSOCK2", "wsock32.lib")
  629. LibName("WINSOCK2", "ws2_32.lib")
  630. LibName("WINCOMCTL", "comctl32.lib")
  631. LibName("WINCOMDLG", "comdlg32.lib")
  632. LibName("WINUSER", "user32.lib")
  633. LibName("WINMM", "winmm.lib")
  634. LibName("WINIMM", "imm32.lib")
  635. LibName("WINKERNEL", "kernel32.lib")
  636. LibName("WINOLE", "ole32.lib")
  637. LibName("WINOLEAUT", "oleaut32.lib")
  638. LibName("WINOLDNAMES", "oldnames.lib")
  639. LibName("WINSHELL", "shell32.lib")
  640. LibName("WINGDI", "gdi32.lib")
  641. LibName("ADVAPI", "advapi32.lib")
  642. LibName("IPHLPAPI", "iphlpapi.lib")
  643. LibName("SETUPAPI", "setupapi.lib")
  644. LibName("GL", "opengl32.lib")
  645. LibName("GLES", "libgles_cm.lib")
  646. LibName("GLES2", "libGLESv2.lib")
  647. LibName("EGL", "libEGL.lib")
  648. LibName("MSIMG", "msimg32.lib")
  649. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  650. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  651. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  652. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  653. if (PkgSkip("OPENSSL")==0):
  654. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  655. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  656. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  657. else:
  658. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  659. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  660. if (PkgSkip("PNG")==0):
  661. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  662. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  663. else:
  664. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  665. if (PkgSkip("TIFF")==0):
  666. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  667. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  668. else:
  669. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  670. if (PkgSkip("OPENEXR")==0):
  671. suffix = ""
  672. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  673. suffix = "-2_2"
  674. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  675. suffix = "-2_3"
  676. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  677. suffix = "-2_4"
  678. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  679. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  680. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  681. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  682. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  683. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  684. if suffix == "-2_2":
  685. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  686. else:
  687. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  688. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  689. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  690. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  691. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  692. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  693. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  694. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  695. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  696. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  697. if (PkgSkip("HARFBUZZ")==0):
  698. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  699. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  700. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  701. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  702. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  703. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  704. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  705. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  706. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  707. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  708. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  709. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  710. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  711. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  712. if (PkgSkip("FCOLLADA")==0):
  713. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  714. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  715. if (PkgSkip("ASSIMP")==0):
  716. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  717. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  718. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  719. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  720. if (PkgSkip("SQUISH")==0):
  721. if GetOptimize() <= 2:
  722. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  723. else:
  724. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  725. if (PkgSkip("ROCKET")==0):
  726. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  727. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  728. if (PkgSkip("PYTHON")==0):
  729. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  730. if (GetOptimize() <= 3):
  731. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  732. if (PkgSkip("OPENAL")==0):
  733. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  734. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  735. # Link OpenAL Soft statically.
  736. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  737. if (PkgSkip("ODE")==0):
  738. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  739. DefSymbol("ODE", "dSINGLE", "")
  740. if (PkgSkip("FMODEX")==0):
  741. if (GetTargetArch() == 'x64'):
  742. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  743. else:
  744. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  745. if (PkgSkip("FLTK")==0 and RTDIST):
  746. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  747. if not PkgSkip("FLTK"):
  748. # If we have fltk, we don't need wx
  749. PkgDisable("WX")
  750. if (PkgSkip("WX")==0 and RTDIST):
  751. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  752. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  753. DefSymbol("WX", "__WXMSW__", "")
  754. DefSymbol("WX", "_UNICODE", "")
  755. DefSymbol("WX", "UNICODE", "")
  756. if (PkgSkip("VORBIS")==0):
  757. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  758. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  759. if not os.path.isfile(path):
  760. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  761. LibName("VORBIS", path)
  762. if (PkgSkip("OPUS")==0):
  763. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  764. for lib in ('ogg', 'opus', 'opusfile'):
  765. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  766. if not os.path.isfile(path):
  767. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  768. LibName("OPUS", path)
  769. for pkg in MAYAVERSIONS:
  770. if (PkgSkip(pkg)==0):
  771. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  772. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  773. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  774. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  775. for pkg in MAXVERSIONS:
  776. if (PkgSkip(pkg)==0):
  777. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  778. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  779. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  780. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  781. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  782. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  783. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  784. if (PkgSkip("PHYSX")==0):
  785. if GetTargetArch() == 'x64':
  786. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  787. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  788. else:
  789. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  790. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  791. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  792. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  793. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  794. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  795. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  796. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  797. if (PkgSkip("SPEEDTREE")==0):
  798. if GetTargetArch() == 'x64':
  799. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  800. p64ext = '64'
  801. else:
  802. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  803. p64ext = ''
  804. debugext = ''
  805. if (GetOptimize() <= 2): debugext = "_d"
  806. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  807. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  808. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  809. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  810. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  811. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  812. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  813. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  814. LibName("SPEEDTREE", "glu32.lib")
  815. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  816. if (PkgSkip("BULLET")==0):
  817. suffix = '.lib'
  818. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  819. suffix = '_x64.lib'
  820. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  821. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  822. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  823. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  824. if (COMPILER=="GCC"):
  825. if GetTarget() != "darwin":
  826. PkgDisable("CARBON")
  827. PkgDisable("COCOA")
  828. elif RUNTIME:
  829. # We don't support Cocoa in the runtime yet.
  830. PkgDisable("COCOA")
  831. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  832. # 64-bits macOS doesn't have Carbon.
  833. PkgDisable("CARBON")
  834. if GetTarget() == 'darwin':
  835. if 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  836. # These support only these archs, so don't build them if we're not
  837. # targeting any of the supported archs.
  838. PkgDisable("FMODEX")
  839. PkgDisable("NVIDIACG")
  840. PkgDisable("ROCKET")
  841. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  842. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  843. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  844. # Also, we can't target FMOD Ex with the 10.14 SDK
  845. PkgDisable("FMODEX")
  846. #if (PkgSkip("PYTHON")==0):
  847. # IncDirectory("PYTHON", SDK["PYTHON"])
  848. if (GetHost() == "darwin"):
  849. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  850. IncDirectory("FREETYPE", "/usr/X11/include")
  851. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  852. LibDirectory("FREETYPE", "/usr/X11/lib")
  853. if (GetHost() == "freebsd"):
  854. IncDirectory("ALWAYS", "/usr/local/include")
  855. LibDirectory("ALWAYS", "/usr/local/lib")
  856. if (os.path.isdir("/usr/PCBSD")):
  857. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  858. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  859. if GetTarget() != "windows":
  860. PkgDisable("DIRECTCAM")
  861. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  862. # WARNING! The order of the ffmpeg libraries matters!
  863. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  864. assimp_libs = ("libassimp", "libassimpd")
  865. # Name pkg-config libs, include(dir)s
  866. if (not RUNTIME):
  867. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  868. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  869. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  870. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  871. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  872. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  873. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  874. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  875. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  876. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  877. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  878. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  879. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  880. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  881. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  882. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  883. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  884. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  885. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  886. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  887. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "OpenEXR/ImfOutputFile.h"))
  888. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  889. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  890. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  891. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  892. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  893. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  894. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  895. # because there's a circular dependency between the two libraries.
  896. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  897. for (opt, name) in LIBNAMES:
  898. if opt == "FREETYPE":
  899. LibName("HARFBUZZ", name)
  900. if not PkgSkip("FFMPEG"):
  901. if GetTarget() == "darwin":
  902. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  903. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  904. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  905. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  906. # Needed when linking ffmpeg statically on Linux.
  907. LibName("FFMPEG", "-Wl,-Bsymbolic")
  908. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  909. for ffmpeg_lib in ffmpeg_libs:
  910. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  911. if GetTarget() != "darwin":
  912. for fcollada_lib in fcollada_libs:
  913. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  914. if not PkgSkip("SWSCALE"):
  915. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  916. if not PkgSkip("SWRESAMPLE"):
  917. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  918. if not PkgSkip("JPEG"):
  919. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  920. if not PkgSkip("TIFF"):
  921. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  922. if not PkgSkip("PNG"):
  923. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  924. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  925. if not PkgSkip("SQUISH"):
  926. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  927. if not PkgSkip("OPENEXR"):
  928. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  929. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  930. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  931. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  932. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  933. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  934. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  935. if not PkgSkip("VORBIS"):
  936. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  937. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  938. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  939. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  940. if not PkgSkip("OPUS"):
  941. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  942. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  943. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  944. if not PkgSkip("VRPN"):
  945. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  946. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  947. if not PkgSkip("ARTOOLKIT"):
  948. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  949. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  950. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  951. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  952. if cv_lib == "opencv_core":
  953. OPENCV_VER_23 = True
  954. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  955. else:
  956. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  957. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  958. else:
  959. PkgDisable("OPENCV")
  960. if not PkgSkip("OPENAL"):
  961. if GetTarget() == "darwin":
  962. LibName("OPENAL", "-framework AudioUnit")
  963. LibName("OPENAL", "-framework AudioToolbox")
  964. LibName("OPENAL", "-framework CoreAudio")
  965. else:
  966. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  967. if not PkgSkip("ASSIMP") and \
  968. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  969. # Also pick up IrrXML, which is needed when linking statically.
  970. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  971. if os.path.isfile(irrxml):
  972. LibName("ASSIMP", irrxml)
  973. if GetTarget() != "darwin":
  974. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  975. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  976. rocket_libs = ("RocketCore", "RocketControls")
  977. if (GetOptimize() <= 3):
  978. rocket_libs += ("RocketDebugger",)
  979. rocket_libs += ("boost_python",)
  980. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  981. if not PkgSkip("PYTHON"):
  982. python_lib = SDK["PYTHONVERSION"]
  983. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  984. if GetTarget() == "linux":
  985. LibName("PYTHON", "-lutil")
  986. LibName("PYTHON", "-lrt")
  987. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  988. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  989. SmartPkgEnable("GTK2", "gtk+-2.0")
  990. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  991. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  992. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  993. if (RTDIST):
  994. SmartPkgEnable("WX", tool = "wx-config")
  995. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  996. if GetTarget() != 'darwin':
  997. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  998. if not PkgSkip("NVIDIACG") and not RUNTIME:
  999. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1000. if not RUNTIME:
  1001. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1002. if GetHost() != "darwin":
  1003. # Workaround for an issue where pkg-config does not include this path
  1004. if GetTargetArch() in ("x86_64", "amd64"):
  1005. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1006. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1007. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1008. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1009. if not PkgSkip("X11"):
  1010. if (os.path.isdir("/usr/X11R6/lib64")):
  1011. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1012. else:
  1013. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1014. elif not PkgSkip("X11"):
  1015. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1016. if RUNTIME:
  1017. # For the runtime, these packages are required
  1018. for pkg in ["OPENSSL", "ZLIB"]:
  1019. skips = []
  1020. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1021. skips.append(pkg)
  1022. if skips:
  1023. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1024. for pkg in MAYAVERSIONS:
  1025. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1026. if (GetHost() == "darwin"):
  1027. # Sheesh, Autodesk really can't make up their mind
  1028. # regarding the location of the Maya devkit on macOS.
  1029. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1030. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1031. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1032. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1033. if (os.path.isdir(SDK[pkg] + "/lib")):
  1034. LibDirectory(pkg, SDK[pkg] + "/lib")
  1035. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1036. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1037. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1038. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1039. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1040. IncDirectory(pkg, SDK[pkg] + "/include")
  1041. else:
  1042. LibDirectory(pkg, SDK[pkg] + "/lib")
  1043. IncDirectory(pkg, SDK[pkg] + "/include")
  1044. DefSymbol(pkg, "MAYAVERSION", pkg)
  1045. if GetTarget() == 'darwin':
  1046. LibName("ALWAYS", "-framework AppKit")
  1047. LibName("AGL", "-framework AGL")
  1048. LibName("CARBON", "-framework Carbon")
  1049. LibName("COCOA", "-framework Cocoa")
  1050. # Fix for a bug in OSX Leopard:
  1051. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1052. if GetTarget() == 'android':
  1053. LibName("ALWAYS", '-llog')
  1054. LibName("ANDROID", '-landroid')
  1055. LibName("JNIGRAPHICS", '-ljnigraphics')
  1056. for pkg in MAYAVERSIONS:
  1057. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1058. if GetTarget() == 'darwin':
  1059. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1060. else:
  1061. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1062. LibName(pkg, "-lOpenMaya")
  1063. LibName(pkg, "-lOpenMayaAnim")
  1064. LibName(pkg, "-lOpenMayaUI")
  1065. LibName(pkg, "-lAnimSlice")
  1066. LibName(pkg, "-lDeformSlice")
  1067. LibName(pkg, "-lModifiers")
  1068. LibName(pkg, "-lDynSlice")
  1069. LibName(pkg, "-lKinSlice")
  1070. LibName(pkg, "-lModelSlice")
  1071. LibName(pkg, "-lNurbsSlice")
  1072. LibName(pkg, "-lPolySlice")
  1073. LibName(pkg, "-lProjectSlice")
  1074. LibName(pkg, "-lImage")
  1075. LibName(pkg, "-lShared")
  1076. LibName(pkg, "-lTranslators")
  1077. LibName(pkg, "-lDataModel")
  1078. LibName(pkg, "-lRenderModel")
  1079. LibName(pkg, "-lNurbsEngine")
  1080. LibName(pkg, "-lDependEngine")
  1081. LibName(pkg, "-lCommandEngine")
  1082. LibName(pkg, "-lFoundation")
  1083. if pkg != "MAYA2020":
  1084. LibName(pkg, "-lIMFbase")
  1085. if GetTarget() != 'darwin':
  1086. LibName(pkg, "-lOpenMayalib")
  1087. else:
  1088. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1089. if (PkgSkip("PHYSX")==0):
  1090. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1091. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1092. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1093. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1094. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1095. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1096. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1097. if (GetHost() == "darwin"):
  1098. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1099. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1100. else:
  1101. LibName("PHYSX", "-lPhysXLoader")
  1102. LibName("PHYSX", "-lNxCharacter")
  1103. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1104. if GetLinkAllStatic():
  1105. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1106. if GetTarget() == 'android':
  1107. DefSymbol("ALWAYS", "ANDROID")
  1108. if not PkgSkip("EIGEN"):
  1109. if GetOptimize() >= 3:
  1110. if COMPILER == "MSVC":
  1111. # Squeeze out a bit more performance on MSVC builds...
  1112. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1113. # will turn them into runtime assertions.
  1114. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1115. ########################################################################
  1116. ##
  1117. ## Give a Status Report on Command-Line Options
  1118. ##
  1119. ########################################################################
  1120. def printStatus(header,warnings):
  1121. if GetVerbose():
  1122. print("")
  1123. print("-------------------------------------------------------------------")
  1124. print(header)
  1125. tkeep = ""
  1126. tomit = ""
  1127. for x in PkgListGet():
  1128. if PkgSkip(x):
  1129. tomit = tomit + x + " "
  1130. else:
  1131. tkeep = tkeep + x + " "
  1132. if RTDIST:
  1133. print("Makepanda: Runtime distribution build")
  1134. elif RUNTIME:
  1135. print("Makepanda: Runtime build")
  1136. else:
  1137. print("Makepanda: Regular build")
  1138. print("Makepanda: Compiler: %s" % (COMPILER))
  1139. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1140. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1141. print("Makepanda: Omit Pkg: %s" % (tomit))
  1142. if GENMAN:
  1143. print("Makepanda: Generate API reference manual")
  1144. else:
  1145. print("Makepanda: Don't generate API reference manual")
  1146. if GetHost() == "windows" and not RTDIST:
  1147. if INSTALLER:
  1148. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1149. else:
  1150. print("Makepanda: Don't build installer")
  1151. print("Makepanda: Version ID: %s" % (VERSION))
  1152. for x in warnings:
  1153. print("Makepanda: %s" % (x))
  1154. print("-------------------------------------------------------------------")
  1155. print("")
  1156. sys.stdout.flush()
  1157. ########################################################################
  1158. ##
  1159. ## BracketNameWithQuotes
  1160. ##
  1161. ########################################################################
  1162. def BracketNameWithQuotes(name):
  1163. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1164. if (name.startswith("-framework")): return name
  1165. if (name.startswith("-dylib_file")): return name
  1166. # Don't add quotes when it's not necessary.
  1167. if " " not in name: return name
  1168. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1169. if (name.startswith('"') and name.endswith('"')): return name
  1170. else: return '"' + name + '"'
  1171. ########################################################################
  1172. ##
  1173. ## CompileCxx
  1174. ##
  1175. ########################################################################
  1176. def CompileCxx(obj,src,opts):
  1177. ipath = GetListOption(opts, "DIR:")
  1178. optlevel = GetOptimizeOption(opts)
  1179. if (COMPILER=="MSVC"):
  1180. if not BOOUSEINTELCOMPILER:
  1181. cmd = "cl "
  1182. if GetTargetArch() == 'x64':
  1183. cmd += "/favor:blend "
  1184. cmd += "/wd4996 /wd4275 /wd4273 "
  1185. # We still target Windows XP.
  1186. cmd += "/DWINVER=0x501 "
  1187. # Work around a WinXP/2003 bug when using VS 2015+.
  1188. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1189. cmd += "/Zc:threadSafeInit- "
  1190. cmd += "/Fo" + obj + " /nologo /c"
  1191. if GetTargetArch() == 'x86':
  1192. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1193. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1194. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1195. else: # x86 without SSE2
  1196. cmd += " /arch:IA32"
  1197. for x in ipath: cmd += " /I" + x
  1198. for (opt,dir) in INCDIRECTORIES:
  1199. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1200. for (opt,var,val) in DEFSYMBOLS:
  1201. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1202. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1203. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1204. if (optlevel==2): cmd += " /MDd /Zi"
  1205. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1206. if (optlevel==4):
  1207. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1208. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1209. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1210. building = GetValueOption(opts, "BUILDING:")
  1211. if (building):
  1212. cmd += " /DBUILDING_" + building
  1213. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1214. cmd += " /bigobj"
  1215. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1216. if 'EXCEPTIONS' in opts:
  1217. cmd += " /EHsc"
  1218. else:
  1219. cmd += " /D_HAS_EXCEPTIONS=0"
  1220. if 'RTTI' not in opts:
  1221. cmd += " /GR-"
  1222. if GetTargetArch() == 'x64':
  1223. cmd += " /DWIN64_VC /DWIN64"
  1224. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1225. # To preserve Windows XP compatibility.
  1226. cmd += " /D_USING_V110_SDK71_"
  1227. cmd += " /W3 " + BracketNameWithQuotes(src)
  1228. oscmd(cmd)
  1229. else:
  1230. cmd = "icl "
  1231. if GetTargetArch() == 'x64':
  1232. cmd += "/favor:blend "
  1233. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1234. cmd += "/DWINVER=0x501 "
  1235. cmd += "/Fo" + obj + " /c"
  1236. for x in ipath: cmd += " /I" + x
  1237. for (opt,dir) in INCDIRECTORIES:
  1238. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1239. for (opt,var,val) in DEFSYMBOLS:
  1240. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1241. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1242. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1243. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1244. # core changes from jean-claude (dec 2011)
  1245. # ----------------------------------------
  1246. # performance will be seeked at level 3 & 4
  1247. # -----------------------------------------
  1248. if (optlevel==3):
  1249. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1250. cmd += " /Ob0"
  1251. cmd += " /Qipo-" # beware of IPO !!!
  1252. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1253. ## ----------------------------------------------------------------
  1254. if (optlevel==4):
  1255. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1256. cmd += " /Qipo" # optimization multi file
  1257. # for 3 & 4 optimization levels
  1258. # -----------------------------
  1259. if (optlevel>=3):
  1260. cmd += " /fp:fast=2"
  1261. cmd += " /Qftz"
  1262. cmd += " /Qfp-speculation:fast"
  1263. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1264. cmd += " /Qprec-div-"
  1265. cmd += " /Qsimd"
  1266. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1267. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1268. cmd += " /Qparallel" # enable parallelization
  1269. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1270. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1271. ## PCH files with a .pchi filename suffix and reduce build time.
  1272. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1273. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1274. cmd += " /Qpchi-" # keep it this way!
  1275. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1276. ## ------------------------------------
  1277. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1278. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1279. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1280. ## Ctor displacement /vd0 : Disable constructor displacement.
  1281. ## Choose this option only if no class constructors or destructors call virtual functions.
  1282. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1283. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1284. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1285. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1286. ## Alternate: #pragma pointers_to_members
  1287. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1288. building = GetValueOption(opts, "BUILDING:")
  1289. if (building): cmd += " /DBUILDING_" + building
  1290. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1291. cmd += " /bigobj"
  1292. # level of warnings and optimization reports
  1293. if GetVerbose():
  1294. cmd += " /W3 " # or /W4 or /Wall
  1295. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1296. else:
  1297. cmd += " /W1 "
  1298. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1299. if GetTargetArch() == 'x64':
  1300. cmd += " /DWIN64_VC /DWIN64"
  1301. cmd += " " + BracketNameWithQuotes(src)
  1302. oscmd(cmd)
  1303. if (COMPILER=="GCC"):
  1304. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1305. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1306. for (opt, dir) in INCDIRECTORIES:
  1307. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1308. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1309. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1310. for (opt,var,val) in DEFSYMBOLS:
  1311. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1312. for x in ipath: cmd += ' -I' + x
  1313. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1314. cmd += ' -fvisibility=hidden'
  1315. # Mac-specific flags.
  1316. if GetTarget() == "darwin":
  1317. cmd += " -Wno-deprecated-declarations"
  1318. if OSXTARGET is not None:
  1319. cmd += " -isysroot " + SDK["MACOSX"]
  1320. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1321. elif platform.mac_ver()[0].startswith('11.'):
  1322. cmd += " -mmacosx-version-min=11.0"
  1323. for arch in OSX_ARCHS:
  1324. if 'NOARCH:' + arch.upper() not in opts:
  1325. cmd += " -arch %s" % arch
  1326. if "SYSROOT" in SDK:
  1327. if GetTarget() != "android":
  1328. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1329. else:
  1330. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1331. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1332. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1333. cmd += ' -no-canonical-prefixes'
  1334. # Android-specific flags.
  1335. arch = GetTargetArch()
  1336. if GetTarget() == "android":
  1337. # Most of the specific optimization flags here were
  1338. # just copied from the default Android Makefiles.
  1339. if "ANDROID_API" in SDK:
  1340. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1341. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1342. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1343. cmd += ' -ffunction-sections -funwind-tables'
  1344. if arch == 'armv7a':
  1345. cmd += ' -target armv7-none-linux-androideabi'
  1346. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1347. cmd += ' -fno-integrated-as'
  1348. elif arch == 'arm':
  1349. cmd += ' -target armv5te-none-linux-androideabi'
  1350. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1351. cmd += ' -fno-integrated-as'
  1352. elif arch == 'aarch64':
  1353. cmd += ' -target aarch64-none-linux-android'
  1354. elif arch == 'mips':
  1355. cmd += ' -target mipsel-none-linux-android'
  1356. cmd += ' -mips32'
  1357. elif arch == 'mips64':
  1358. cmd += ' -target mips64el-none-linux-android'
  1359. cmd += ' -fintegrated-as'
  1360. elif arch == 'x86':
  1361. cmd += ' -target i686-none-linux-android'
  1362. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1363. cmd += ' -mstackrealign'
  1364. elif arch == 'x86_64':
  1365. cmd += ' -target x86_64-none-linux-android'
  1366. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1367. cmd += " -Wa,--noexecstack"
  1368. # Do we want thumb or arm instructions?
  1369. if arch.startswith('arm'):
  1370. if optlevel >= 3:
  1371. cmd += ' -mthumb'
  1372. else:
  1373. cmd += ' -marm'
  1374. # Enable SIMD instructions if requested
  1375. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1376. cmd += ' -mfpu=neon'
  1377. else:
  1378. cmd += " -pthread"
  1379. if not src.endswith(".c"):
  1380. # We don't use exceptions for most modules.
  1381. if 'EXCEPTIONS' in opts:
  1382. cmd += " -fexceptions"
  1383. else:
  1384. cmd += " -fno-exceptions"
  1385. if src.endswith(".mm"):
  1386. # Work around Apple compiler bug.
  1387. cmd += " -U__EXCEPTIONS"
  1388. target = GetTarget()
  1389. if 'RTTI' not in opts and target != "darwin":
  1390. # We always disable RTTI on Android for memory usage reasons.
  1391. if optlevel >= 4 or target == "android":
  1392. cmd += " -fno-rtti"
  1393. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1394. cmd += " -msse2"
  1395. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1396. cmd += " -fno-strict-aliasing"
  1397. if optlevel >= 3:
  1398. cmd += " -ffast-math -fno-stack-protector"
  1399. if optlevel == 3:
  1400. # Fast math is nice, but we'd like to see NaN in dev builds.
  1401. cmd += " -fno-finite-math-only"
  1402. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1403. cmd += " -fno-unsafe-math-optimizations"
  1404. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1405. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1406. if (optlevel==3): cmd += " -O2"
  1407. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1408. # Enable more warnings.
  1409. cmd += " -Wall -Wno-unused-function"
  1410. if not src.endswith(".c"):
  1411. cmd += " -Wno-reorder"
  1412. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1413. if optlevel == 4:
  1414. cmd += " -Wno-unused-variable"
  1415. if src.endswith(".c"):
  1416. cmd += ' ' + CFLAGS
  1417. else:
  1418. cmd += ' ' + CXXFLAGS
  1419. cmd = cmd.rstrip()
  1420. building = GetValueOption(opts, "BUILDING:")
  1421. if (building): cmd += " -DBUILDING_" + building
  1422. cmd += ' ' + BracketNameWithQuotes(src)
  1423. oscmd(cmd)
  1424. ########################################################################
  1425. ##
  1426. ## CompileBison
  1427. ##
  1428. ########################################################################
  1429. def CompileBison(wobj, wsrc, opts):
  1430. ifile = os.path.basename(wsrc)
  1431. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1432. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1433. pre = GetValueOption(opts, "BISONPREFIX_")
  1434. bison = GetBison()
  1435. if bison is None:
  1436. # We don't have bison. See if there is a prebuilt file.
  1437. base, ext = os.path.splitext(wsrc)
  1438. if os.path.isfile(base + '.h.prebuilt') and \
  1439. os.path.isfile(base + '.cxx.prebuilt'):
  1440. CopyFile(wdstc, base + '.cxx.prebuilt')
  1441. CopyFile(wdsth, base + '.h.prebuilt')
  1442. else:
  1443. exit('Could not find bison!')
  1444. else:
  1445. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1446. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1447. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1448. # Finally, compile the generated source file.
  1449. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1450. ########################################################################
  1451. ##
  1452. ## CompileFlex
  1453. ##
  1454. ########################################################################
  1455. def CompileFlex(wobj,wsrc,opts):
  1456. ifile = os.path.basename(wsrc)
  1457. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1458. pre = GetValueOption(opts, "BISONPREFIX_")
  1459. dashi = opts.count("FLEXDASHI")
  1460. flex = GetFlex()
  1461. if flex is None:
  1462. # We don't have flex. See if there is a prebuilt file.
  1463. base, ext = os.path.splitext(wsrc)
  1464. if os.path.isfile(base + '.cxx.prebuilt'):
  1465. CopyFile(wdst, base + '.cxx.prebuilt')
  1466. else:
  1467. exit('Could not find flex!')
  1468. else:
  1469. if (dashi):
  1470. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1471. else:
  1472. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1473. # Finally, compile the generated source file.
  1474. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1475. ########################################################################
  1476. ##
  1477. ## CompileIgate
  1478. ##
  1479. ########################################################################
  1480. def CompileIgate(woutd,wsrc,opts):
  1481. outbase = os.path.basename(woutd)[:-3]
  1482. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1483. srcdir = GetValueOption(opts, "SRCDIR:")
  1484. module = GetValueOption(opts, "IMOD:")
  1485. library = GetValueOption(opts, "ILIB:")
  1486. ipath = GetListOption(opts, "DIR:")
  1487. if (PkgSkip("PYTHON")):
  1488. WriteFile(woutc, "")
  1489. WriteFile(woutd, "")
  1490. ConditionalWriteFile(woutd, "")
  1491. return
  1492. if not CrossCompiling():
  1493. # If we're compiling for this platform, we can use the one we've built.
  1494. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1495. else:
  1496. # Assume that interrogate is on the PATH somewhere.
  1497. cmd = 'interrogate'
  1498. if GetVerbose():
  1499. cmd += ' -v'
  1500. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1501. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1502. if (COMPILER=="MSVC"):
  1503. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1504. if GetTargetArch() == 'x64':
  1505. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1506. else:
  1507. cmd += ' -D_M_IX86'
  1508. # NOTE: this 1600 value is the version number for VC2010.
  1509. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1510. if (COMPILER=="GCC"):
  1511. cmd += ' -D__attribute__\\(x\\)='
  1512. target_arch = GetTargetArch()
  1513. if target_arch in ("x86_64", "amd64"):
  1514. cmd += ' -D_LP64'
  1515. elif target_arch in ('aarch64', 'arm64'):
  1516. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1517. else:
  1518. cmd += ' -D__i386__'
  1519. target = GetTarget()
  1520. if target == 'darwin':
  1521. cmd += ' -D__APPLE__'
  1522. elif target == 'android':
  1523. cmd += ' -D__ANDROID__'
  1524. optlevel = GetOptimizeOption(opts)
  1525. if (optlevel==1): cmd += ' -D_DEBUG'
  1526. if (optlevel==2): cmd += ' -D_DEBUG'
  1527. if (optlevel==3): pass
  1528. if (optlevel==4): cmd += ' -DNDEBUG'
  1529. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1530. cmd += ' -fnames -string -refcount -assert -python-native'
  1531. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1532. # Add -I, -S and -D flags
  1533. for x in ipath:
  1534. cmd += ' -I' + BracketNameWithQuotes(x)
  1535. for (opt,dir) in INCDIRECTORIES:
  1536. if (opt=="ALWAYS") or (opt in opts):
  1537. cmd += ' -S' + BracketNameWithQuotes(dir)
  1538. for (opt,var,val) in DEFSYMBOLS:
  1539. if (opt=="ALWAYS") or (opt in opts):
  1540. cmd += ' -D' + var + '=' + val
  1541. #building = GetValueOption(opts, "BUILDING:")
  1542. #if (building): cmd += " -DBUILDING_"+building
  1543. cmd += ' -module ' + module + ' -library ' + library
  1544. for x in wsrc:
  1545. if (x.startswith("/")):
  1546. cmd += ' ' + BracketNameWithQuotes(x)
  1547. else:
  1548. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1549. oscmd(cmd)
  1550. ########################################################################
  1551. ##
  1552. ## CompileImod
  1553. ##
  1554. ########################################################################
  1555. def CompileImod(wobj, wsrc, opts):
  1556. module = GetValueOption(opts, "IMOD:")
  1557. library = GetValueOption(opts, "ILIB:")
  1558. if (COMPILER=="MSVC"):
  1559. woutc = wobj[:-4]+".cxx"
  1560. if (COMPILER=="GCC"):
  1561. woutc = wobj[:-2]+".cxx"
  1562. if (PkgSkip("PYTHON")):
  1563. WriteFile(woutc, "")
  1564. CompileCxx(wobj, woutc, opts)
  1565. return
  1566. if not CrossCompiling():
  1567. # If we're compiling for this platform, we can use the one we've built.
  1568. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1569. else:
  1570. # Assume that interrogate_module is on the PATH somewhere.
  1571. cmd = 'interrogate_module'
  1572. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1573. importmod = GetValueOption(opts, "IMPORT:")
  1574. if importmod:
  1575. cmd += ' -import ' + importmod
  1576. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1577. oscmd(cmd)
  1578. CompileCxx(wobj,woutc,opts)
  1579. return
  1580. ########################################################################
  1581. ##
  1582. ## CompileLib
  1583. ##
  1584. ########################################################################
  1585. def CompileLib(lib, obj, opts):
  1586. if (COMPILER=="MSVC"):
  1587. if not BOOUSEINTELCOMPILER:
  1588. #Use MSVC Linker
  1589. cmd = 'link /lib /nologo'
  1590. if GetOptimizeOption(opts) == 4:
  1591. cmd += " /LTCG"
  1592. if HasTargetArch():
  1593. cmd += " /MACHINE:" + GetTargetArch().upper()
  1594. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1595. for x in obj:
  1596. if not x.endswith('.lib'):
  1597. cmd += ' ' + BracketNameWithQuotes(x)
  1598. oscmd(cmd)
  1599. else:
  1600. # Choose Intel linker; from Jean-Claude
  1601. cmd = 'xilink /verbose:lib /lib '
  1602. if HasTargetArch():
  1603. cmd += " /MACHINE:" + GetTargetArch().upper()
  1604. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1605. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1606. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1607. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1608. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1609. oscmd(cmd)
  1610. if (COMPILER=="GCC"):
  1611. if GetTarget() == 'darwin':
  1612. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1613. else:
  1614. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1615. for x in obj:
  1616. if GetLinkAllStatic() and x.endswith('.a'):
  1617. continue
  1618. cmd += ' ' + BracketNameWithQuotes(x)
  1619. oscmd(cmd)
  1620. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1621. ########################################################################
  1622. ##
  1623. ## CompileLink
  1624. ##
  1625. ########################################################################
  1626. def CompileLink(dll, obj, opts):
  1627. if (COMPILER=="MSVC"):
  1628. if not BOOUSEINTELCOMPILER:
  1629. cmd = "link /nologo "
  1630. if HasTargetArch():
  1631. cmd += " /MACHINE:" + GetTargetArch().upper()
  1632. if ("MFC" not in opts):
  1633. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1634. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1635. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1636. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1637. optlevel = GetOptimizeOption(opts)
  1638. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1639. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1640. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1641. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1642. if ("MFC" in opts):
  1643. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1644. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1645. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1646. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1647. if not PkgSkip("PYTHON"):
  1648. # If we're building without Python, don't pick it up implicitly.
  1649. if "PYTHON" not in opts:
  1650. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1651. if optlevel <= 2:
  1652. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1653. else:
  1654. cmd += ' /NOD:{}.lib'.format(pythonv)
  1655. # Yes, we know we are importing "locally defined symbols".
  1656. for x in obj:
  1657. if x.endswith('libp3pystub.lib'):
  1658. cmd += ' /ignore:4049,4217'
  1659. break
  1660. # Set the subsystem. Specify that we want to target Windows XP.
  1661. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1662. cmd += " /SUBSYSTEM:" + subsystem
  1663. if GetTargetArch() == 'x64':
  1664. cmd += ",5.02"
  1665. else:
  1666. cmd += ",5.01"
  1667. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1668. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1669. for (opt, dir) in LIBDIRECTORIES:
  1670. if (opt=="ALWAYS") or (opt in opts):
  1671. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1672. for x in obj:
  1673. if x.endswith(".dll") or x.endswith(".pyd"):
  1674. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1675. elif x.endswith(".lib"):
  1676. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1677. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1678. exit("Error: in makepanda, specify "+dname+", not "+x)
  1679. cmd += ' ' + BracketNameWithQuotes(x)
  1680. elif x.endswith(".def"):
  1681. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1682. elif x.endswith(".dat"):
  1683. pass
  1684. else:
  1685. cmd += ' ' + BracketNameWithQuotes(x)
  1686. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1687. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1688. for (opt, name) in LIBNAMES:
  1689. if (opt=="ALWAYS") or (opt in opts):
  1690. cmd += " " + BracketNameWithQuotes(name)
  1691. oscmd(cmd)
  1692. else:
  1693. cmd = "xilink"
  1694. if GetVerbose(): cmd += " /verbose:lib"
  1695. if HasTargetArch():
  1696. cmd += " /MACHINE:" + GetTargetArch().upper()
  1697. if ("MFC" not in opts):
  1698. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1699. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1700. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1701. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1702. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1703. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1704. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1705. optlevel = GetOptimizeOption(opts)
  1706. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1707. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1708. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1709. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1710. if ("MFC" in opts):
  1711. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1712. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1713. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1714. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1715. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1716. if subsystem:
  1717. cmd += " /SUBSYSTEM:" + subsystem
  1718. if dll.endswith(".dll"):
  1719. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1720. for (opt, dir) in LIBDIRECTORIES:
  1721. if (opt=="ALWAYS") or (opt in opts):
  1722. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1723. for x in obj:
  1724. if x.endswith(".dll") or x.endswith(".pyd"):
  1725. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1726. elif x.endswith(".lib"):
  1727. dname = os.path.splitext(dll)[0]+".dll"
  1728. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1729. exit("Error: in makepanda, specify "+dname+", not "+x)
  1730. cmd += ' ' + BracketNameWithQuotes(x)
  1731. elif x.endswith(".def"):
  1732. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1733. elif x.endswith(".dat"):
  1734. pass
  1735. else:
  1736. cmd += ' ' + BracketNameWithQuotes(x)
  1737. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1738. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1739. for (opt, name) in LIBNAMES:
  1740. if (opt=="ALWAYS") or (opt in opts):
  1741. cmd += " " + BracketNameWithQuotes(name)
  1742. oscmd(cmd)
  1743. if COMPILER == "GCC":
  1744. cxx = GetCXX()
  1745. if GetOrigExt(dll) == ".exe":
  1746. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1747. if GetTarget() == "android":
  1748. # Necessary to work around an issue with libandroid depending on vendor libraries
  1749. cmd += ' -Wl,--allow-shlib-undefined'
  1750. else:
  1751. if (GetTarget() == "darwin"):
  1752. cmd = cxx + ' -undefined dynamic_lookup'
  1753. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1754. cmd += ' -bundle '
  1755. else:
  1756. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1757. cmd += ' -dynamiclib -install_name ' + install_name
  1758. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1759. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1760. else:
  1761. cmd = cxx + ' -shared'
  1762. # Always set soname on Android to avoid a linker warning when loading the library.
  1763. if "MODULE" not in opts or GetTarget() == 'android':
  1764. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1765. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1766. for x in obj:
  1767. if GetOrigExt(x) != ".dat":
  1768. cmd += ' ' + x
  1769. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1770. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1771. # macOS specific flags.
  1772. if GetTarget() == 'darwin':
  1773. cmd += " -headerpad_max_install_names"
  1774. if OSXTARGET is not None:
  1775. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1776. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1777. elif platform.mac_ver()[0].startswith('11.'):
  1778. cmd += " -mmacosx-version-min=11.0"
  1779. for arch in OSX_ARCHS:
  1780. if 'NOARCH:' + arch.upper() not in opts:
  1781. cmd += " -arch %s" % arch
  1782. elif GetTarget() == 'android':
  1783. arch = GetTargetArch()
  1784. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1785. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1786. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1787. if arch == 'armv7a':
  1788. cmd += ' -target armv7-none-linux-androideabi'
  1789. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1790. elif arch == 'arm':
  1791. cmd += ' -target armv5te-none-linux-androideabi'
  1792. elif arch == 'aarch64':
  1793. cmd += ' -target aarch64-none-linux-android'
  1794. elif arch == 'mips':
  1795. cmd += ' -target mipsel-none-linux-android'
  1796. cmd += ' -mips32'
  1797. elif arch == 'mips64':
  1798. cmd += ' -target mips64el-none-linux-android'
  1799. elif arch == 'x86':
  1800. cmd += ' -target i686-none-linux-android'
  1801. elif arch == 'x86_64':
  1802. cmd += ' -target x86_64-none-linux-android'
  1803. cmd += ' -lc -lm'
  1804. else:
  1805. cmd += " -pthread"
  1806. if "SYSROOT" in SDK:
  1807. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1808. if LDFLAGS != "":
  1809. cmd += " " + LDFLAGS
  1810. # Don't link libraries with Python, except on Android.
  1811. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1812. opts = opts[:]
  1813. opts.remove("PYTHON")
  1814. for (opt, dir) in LIBDIRECTORIES:
  1815. if (opt=="ALWAYS") or (opt in opts):
  1816. cmd += ' -L' + BracketNameWithQuotes(dir)
  1817. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1818. if (opt=="ALWAYS") or (opt in opts):
  1819. cmd += ' -F' + BracketNameWithQuotes(dir)
  1820. for (opt, name) in LIBNAMES:
  1821. if (opt=="ALWAYS") or (opt in opts):
  1822. cmd += ' ' + BracketNameWithQuotes(name)
  1823. if GetTarget() != 'freebsd':
  1824. cmd += " -ldl"
  1825. oscmd(cmd)
  1826. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1827. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1828. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1829. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1830. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1831. if os.path.isfile(newdll):
  1832. os.remove(newdll)
  1833. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1834. elif dll.endswith("." + MAJOR_VERSION):
  1835. newdll = dll[:-len(MAJOR_VERSION)-1]
  1836. if os.path.isfile(newdll):
  1837. os.remove(newdll)
  1838. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1839. ##########################################################################################
  1840. #
  1841. # CompileEgg
  1842. #
  1843. ##########################################################################################
  1844. def CompileEgg(eggfile, src, opts):
  1845. pz = False
  1846. if eggfile.endswith(".pz"):
  1847. pz = True
  1848. eggfile = eggfile[:-3]
  1849. # Determine the location of the pzip and flt2egg tools.
  1850. if CrossCompiling():
  1851. # We may not be able to use our generated versions of these tools,
  1852. # so we'll expect them to already be present in the PATH.
  1853. pzip = 'pzip'
  1854. flt2egg = 'flt2egg'
  1855. else:
  1856. # If we're compiling for this machine, we can use the binaries we've built.
  1857. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1858. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1859. if not os.path.isfile(pzip):
  1860. pzip = 'pzip'
  1861. if not os.path.isfile(flt2egg):
  1862. flt2egg = 'flt2egg'
  1863. if src.endswith(".egg"):
  1864. CopyFile(eggfile, src)
  1865. elif src.endswith(".flt"):
  1866. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1867. if pz:
  1868. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1869. ##########################################################################################
  1870. #
  1871. # CompileRes, CompileRsrc
  1872. #
  1873. ##########################################################################################
  1874. def CompileRes(target, src, opts):
  1875. """Compiles a Windows .rc file into a .res file."""
  1876. ipath = GetListOption(opts, "DIR:")
  1877. if (COMPILER == "MSVC"):
  1878. cmd = "rc"
  1879. cmd += " /Fo" + BracketNameWithQuotes(target)
  1880. for x in ipath: cmd += " /I" + x
  1881. for (opt,dir) in INCDIRECTORIES:
  1882. if (opt=="ALWAYS") or (opt in opts):
  1883. cmd += " /I" + BracketNameWithQuotes(dir)
  1884. for (opt,var,val) in DEFSYMBOLS:
  1885. if (opt=="ALWAYS") or (opt in opts):
  1886. cmd += " /D" + var + "=" + val
  1887. cmd += " " + BracketNameWithQuotes(src)
  1888. else:
  1889. cmd = "windres"
  1890. for x in ipath: cmd += " -I" + x
  1891. for (opt,dir) in INCDIRECTORIES:
  1892. if (opt=="ALWAYS") or (opt in opts):
  1893. cmd += " -I" + BracketNameWithQuotes(dir)
  1894. for (opt,var,val) in DEFSYMBOLS:
  1895. if (opt=="ALWAYS") or (opt in opts):
  1896. cmd += " -D" + var + "=" + val
  1897. cmd += " -i " + BracketNameWithQuotes(src)
  1898. cmd += " -o " + BracketNameWithQuotes(target)
  1899. oscmd(cmd)
  1900. def CompileRsrc(target, src, opts):
  1901. """Compiles a Mac OS .r file into an .rsrc file."""
  1902. ipath = GetListOption(opts, "DIR:")
  1903. if os.path.isfile("/usr/bin/Rez"):
  1904. cmd = "Rez -useDF"
  1905. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1906. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1907. else:
  1908. cmd = "/Developer/Tools/Rez -useDF"
  1909. cmd += " -o " + BracketNameWithQuotes(target)
  1910. for x in ipath:
  1911. cmd += " -i " + x
  1912. for (opt,dir) in INCDIRECTORIES:
  1913. if (opt=="ALWAYS") or (opt in opts):
  1914. cmd += " -i " + BracketNameWithQuotes(dir)
  1915. for (opt,var,val) in DEFSYMBOLS:
  1916. if (opt=="ALWAYS") or (opt in opts):
  1917. if (val == ""):
  1918. cmd += " -d " + var
  1919. else:
  1920. cmd += " -d " + var + " = " + val
  1921. cmd += " " + BracketNameWithQuotes(src)
  1922. oscmd(cmd)
  1923. ##########################################################################################
  1924. #
  1925. # CompileJava (Android only)
  1926. #
  1927. ##########################################################################################
  1928. def CompileJava(target, src, opts):
  1929. """Compiles a .java file into a .class file."""
  1930. if GetHost() == 'android':
  1931. cmd = "ecj "
  1932. else:
  1933. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1934. optlevel = GetOptimizeOption(opts)
  1935. if optlevel >= 4:
  1936. cmd += "-debug:none "
  1937. cmd += "-cp " + GetOutputDir() + "/classes "
  1938. cmd += "-d " + GetOutputDir() + "/classes "
  1939. cmd += BracketNameWithQuotes(src)
  1940. oscmd(cmd)
  1941. ##########################################################################################
  1942. #
  1943. # FreezePy
  1944. #
  1945. ##########################################################################################
  1946. def FreezePy(target, inputs, opts):
  1947. assert len(inputs) > 0
  1948. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  1949. if sys.version_info >= (2, 6):
  1950. cmdstr += "-B "
  1951. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  1952. if 'FREEZE_STARTUP' in opts:
  1953. cmdstr += " -s"
  1954. if GetOrigExt(target) == '.exe':
  1955. src = inputs.pop(0)
  1956. else:
  1957. src = ""
  1958. for i in inputs:
  1959. i = os.path.splitext(i)[0]
  1960. i = i.replace('/', '.')
  1961. if i.startswith('direct.src'):
  1962. i = i.replace('.src.', '.')
  1963. cmdstr += " -i " + i
  1964. cmdstr += " -o " + target + " " + src
  1965. if ("LINK_PYTHON_STATIC" in opts):
  1966. os.environ["LINK_PYTHON_STATIC"] = "1"
  1967. oscmd(cmdstr)
  1968. if ("LINK_PYTHON_STATIC" in os.environ):
  1969. del os.environ["LINK_PYTHON_STATIC"]
  1970. if (not os.path.exists(target)):
  1971. exit("FREEZER_ERROR")
  1972. ##########################################################################################
  1973. #
  1974. # Package
  1975. #
  1976. ##########################################################################################
  1977. def Package(target, inputs, opts):
  1978. assert len(inputs) == 1
  1979. # Invoke the ppackage script.
  1980. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  1981. if GetOptimizeOption(opts) >= 4:
  1982. command += "-OO "
  1983. if sys.version_info >= (2, 6):
  1984. command += "-B "
  1985. command += "direct/src/p3d/ppackage.py"
  1986. if not RTDIST:
  1987. # Don't compile Python sources, because we might not running in the same
  1988. # Python version as the selected host.
  1989. command += " -N"
  1990. if GetTarget() == "darwin":
  1991. if SDK.get("MACOSX"):
  1992. command += " -R \"%s\"" % SDK["MACOSX"]
  1993. for arch in OSX_ARCHS:
  1994. if arch == "x86_64":
  1995. arch = "amd64"
  1996. command += " -P osx_%s" % arch
  1997. command += " -i \"" + GetOutputDir() + "/stage\""
  1998. if (P3DSUFFIX):
  1999. command += ' -a "' + P3DSUFFIX + '"'
  2000. command += " " + inputs[0]
  2001. if GetOrigExt(target) == '.p3d':
  2002. # Build a specific .p3d file.
  2003. basename = os.path.basename(os.path.splitext(target)[0])
  2004. command += " " + basename
  2005. oscmd(command)
  2006. if GetTarget() == 'windows':
  2007. # Make an .exe that calls this .p3d.
  2008. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2009. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2010. exefile = FindLocation(basename + '.exe', [])
  2011. CompileLink(exefile, [objfile], ['ADVAPI'])
  2012. # Move it to the bin directory.
  2013. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2014. if sys.platform != 'win32':
  2015. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2016. else:
  2017. # This is presumably a package or set of packages.
  2018. oscmd(command)
  2019. ##########################################################################################
  2020. #
  2021. # CompileBundle
  2022. #
  2023. ##########################################################################################
  2024. def CompileBundle(target, inputs, opts):
  2025. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2026. plist = None
  2027. resources = []
  2028. objects = []
  2029. for i in inputs:
  2030. if (i.endswith(".plist")):
  2031. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2032. plist = i
  2033. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2034. resources.append(i)
  2035. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2036. objects.append(i)
  2037. else:
  2038. exit("Don't know how to bundle file %s" % i)
  2039. # Now link the object files to form the bundle.
  2040. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2041. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2042. oscmd("rm -rf %s" % target)
  2043. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2044. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2045. if target.endswith(".app"):
  2046. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2047. else:
  2048. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2049. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2050. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2051. for r in resources:
  2052. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2053. ##########################################################################################
  2054. #
  2055. # CompileMIDL
  2056. #
  2057. ##########################################################################################
  2058. def CompileMIDL(target, src, opts):
  2059. ipath = GetListOption(opts, "DIR:")
  2060. if (COMPILER=="MSVC"):
  2061. cmd = "midl"
  2062. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2063. for x in ipath: cmd += " /I" + x
  2064. for (opt,dir) in INCDIRECTORIES:
  2065. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2066. for (opt,var,val) in DEFSYMBOLS:
  2067. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2068. cmd += " " + BracketNameWithQuotes(src)
  2069. oscmd(cmd)
  2070. ##########################################################################################
  2071. #
  2072. # CompileAnything
  2073. #
  2074. ##########################################################################################
  2075. def CompileAnything(target, inputs, opts, progress = None):
  2076. if (opts.count("DEPENDENCYONLY")):
  2077. return
  2078. if (len(inputs)==0):
  2079. exit("No input files for target "+target)
  2080. infile = inputs[0]
  2081. origsuffix = GetOrigExt(target)
  2082. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2083. # It must be a simple copy operation.
  2084. ProgressOutput(progress, "Copying file", target)
  2085. CopyFile(target, infile)
  2086. if (origsuffix==".exe" and GetHost() != "windows"):
  2087. os.system("chmod +x \"%s\"" % target)
  2088. return
  2089. elif (infile.endswith(".py")):
  2090. if origsuffix == ".obj":
  2091. source = os.path.splitext(target)[0] + ".c"
  2092. SetOrigExt(source, ".c")
  2093. ProgressOutput(progress, "Building frozen source", source)
  2094. FreezePy(source, inputs, opts)
  2095. ProgressOutput(progress, "Building C++ object", target)
  2096. return CompileCxx(target, source, opts)
  2097. if origsuffix == ".exe":
  2098. ProgressOutput(progress, "Building frozen executable", target)
  2099. else:
  2100. ProgressOutput(progress, "Building frozen library", target)
  2101. return FreezePy(target, inputs, opts)
  2102. elif (infile.endswith(".idl")):
  2103. ProgressOutput(progress, "Compiling MIDL file", infile)
  2104. return CompileMIDL(target, infile, opts)
  2105. elif (infile.endswith(".pdef")):
  2106. if origsuffix == '.p3d':
  2107. ProgressOutput(progress, "Building package", target)
  2108. else:
  2109. ProgressOutput(progress, "Building package from pdef file", infile)
  2110. return Package(target, inputs, opts)
  2111. elif origsuffix in SUFFIX_LIB:
  2112. ProgressOutput(progress, "Linking static library", target)
  2113. return CompileLib(target, inputs, opts)
  2114. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2115. if (origsuffix==".exe"):
  2116. ProgressOutput(progress, "Linking executable", target)
  2117. else:
  2118. ProgressOutput(progress, "Linking dynamic library", target)
  2119. # Add version number to the dynamic library, on unix
  2120. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2121. tplatform = GetTarget()
  2122. if tplatform == "darwin":
  2123. # On Mac, libraries are named like libpanda.1.2.dylib
  2124. if target.lower().endswith(".dylib"):
  2125. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2126. SetOrigExt(target, origsuffix)
  2127. elif tplatform != "windows" and tplatform != "android":
  2128. # On Linux, libraries are named like libpanda.so.1.2
  2129. target += "." + MAJOR_VERSION
  2130. SetOrigExt(target, origsuffix)
  2131. return CompileLink(target, inputs, opts)
  2132. elif (origsuffix==".in"):
  2133. ProgressOutput(progress, "Building Interrogate database", target)
  2134. return CompileIgate(target, inputs, opts)
  2135. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2136. ProgressOutput(progress, "Building plugin bundle", target)
  2137. return CompileBundle(target, inputs, opts)
  2138. elif (origsuffix==".app"):
  2139. ProgressOutput(progress, "Building application bundle", target)
  2140. return CompileBundle(target, inputs, opts)
  2141. elif (origsuffix==".pz"):
  2142. ProgressOutput(progress, "Compressing", target)
  2143. return CompileEgg(target, infile, opts)
  2144. elif (origsuffix==".egg"):
  2145. ProgressOutput(progress, "Converting", target)
  2146. return CompileEgg(target, infile, opts)
  2147. elif (origsuffix==".res"):
  2148. ProgressOutput(progress, "Building resource object", target)
  2149. return CompileRes(target, infile, opts)
  2150. elif (origsuffix==".rsrc"):
  2151. ProgressOutput(progress, "Building resource object", target)
  2152. return CompileRsrc(target, infile, opts)
  2153. elif (origsuffix==".class"):
  2154. ProgressOutput(progress, "Building Java class", target)
  2155. return CompileJava(target, infile, opts)
  2156. elif (origsuffix==".obj"):
  2157. if (infile.endswith(".cxx")):
  2158. ProgressOutput(progress, "Building C++ object", target)
  2159. return CompileCxx(target, infile, opts)
  2160. elif (infile.endswith(".c")):
  2161. ProgressOutput(progress, "Building C object", target)
  2162. return CompileCxx(target, infile, opts)
  2163. elif (infile.endswith(".mm")):
  2164. ProgressOutput(progress, "Building Objective-C++ object", target)
  2165. return CompileCxx(target, infile, opts)
  2166. elif (infile.endswith(".yxx")):
  2167. ProgressOutput(progress, "Building Bison object", target)
  2168. return CompileBison(target, infile, opts)
  2169. elif (infile.endswith(".lxx")):
  2170. ProgressOutput(progress, "Building Flex object", target)
  2171. return CompileFlex(target, infile, opts)
  2172. elif (infile.endswith(".in")):
  2173. ProgressOutput(progress, "Building Interrogate object", target)
  2174. return CompileImod(target, inputs, opts)
  2175. elif (infile.endswith(".rc")):
  2176. ProgressOutput(progress, "Building resource object", target)
  2177. return CompileRes(target, infile, opts)
  2178. elif (infile.endswith(".r")):
  2179. ProgressOutput(progress, "Building resource object", target)
  2180. return CompileRsrc(target, infile, opts)
  2181. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2182. ##########################################################################################
  2183. #
  2184. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2185. #
  2186. ##########################################################################################
  2187. DTOOL_CONFIG=[
  2188. #_Variable_________________________Windows___________________Unix__________
  2189. ("HAVE_PYTHON", '1', '1'),
  2190. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2191. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2192. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2193. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2194. ("HAVE_MAYA", '1', '1'),
  2195. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2196. ("USE_PANDAFILESTREAM", '1', '1'),
  2197. ("USE_DELETED_CHAIN", '1', '1'),
  2198. ("HAVE_GLX", 'UNDEF', '1'),
  2199. ("HAVE_WGL", '1', 'UNDEF'),
  2200. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2201. ("HAVE_THREADS", '1', '1'),
  2202. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2203. ("OS_SIMPLE_THREADS", '1', '1'),
  2204. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2205. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2206. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2207. ("HAVE_AUDIO", '1', '1'),
  2208. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2209. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2210. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2211. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2212. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2213. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2214. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2215. ("DO_PIPELINING", '1', '1'),
  2216. ("DEFAULT_PATHSEP", '";"', '":"'),
  2217. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2218. ("PHAVE_LOCKF", '1', '1'),
  2219. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2220. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2221. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2222. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2223. ("HAVE_GETOPT", 'UNDEF', '1'),
  2224. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2225. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2226. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2227. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2228. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2229. ("HAVE_IOS_BINARY", '1', '1'),
  2230. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2231. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2232. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2233. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2234. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2235. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2236. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2237. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2238. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2239. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2240. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2241. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2242. ("PHAVE_IO_H", '1', 'UNDEF'),
  2243. ("PHAVE_IOSTREAM", '1', '1'),
  2244. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2245. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2246. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2247. ("PHAVE_MALLOC_H", '1', '1'),
  2248. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2249. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2250. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2251. ("PHAVE_SSTREAM", '1', '1'),
  2252. ("PHAVE_NEW", '1', '1'),
  2253. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2254. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2255. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2256. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2257. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2258. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2259. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2260. ("PHAVE_STDINT_H", '1', '1'),
  2261. ("HAVE_RTTI", '1', '1'),
  2262. ("HAVE_X11", 'UNDEF', '1'),
  2263. ("IS_LINUX", 'UNDEF', '1'),
  2264. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2265. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2266. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2267. ("LINMATH_ALIGN", '1', '1'),
  2268. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2269. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2270. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2271. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2272. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2273. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2274. ("HAVE_SGI_RGB", '1', '1'),
  2275. ("HAVE_TGA", '1', '1'),
  2276. ("HAVE_IMG", '1', '1'),
  2277. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2278. ("HAVE_BMP", '1', '1'),
  2279. ("HAVE_PNM", '1', '1'),
  2280. ("HAVE_STB_IMAGE", '1', '1'),
  2281. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2282. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2283. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2284. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2285. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2286. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2287. ("WANT_NATIVE_NET", '1', '1'),
  2288. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2289. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2290. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2291. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2292. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2293. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2294. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2295. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2296. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2297. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2298. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2299. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2300. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2301. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2302. # ("_SECURE_SCL", '0', 'UNDEF'),
  2303. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2304. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2305. ]
  2306. PRC_PARAMETERS=[
  2307. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2308. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2309. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2310. ("PRC_PATH2_ENVVARS", '""', '""'),
  2311. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2312. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2313. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2314. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2315. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2316. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2317. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2318. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2319. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2320. ]
  2321. def WriteConfigSettings():
  2322. dtool_config={}
  2323. prc_parameters={}
  2324. speedtree_parameters={}
  2325. plugin_config={}
  2326. if (GetTarget() == 'windows'):
  2327. for key,win,unix in DTOOL_CONFIG:
  2328. dtool_config[key] = win
  2329. for key,win,unix in PRC_PARAMETERS:
  2330. prc_parameters[key] = win
  2331. else:
  2332. for key,win,unix in DTOOL_CONFIG:
  2333. dtool_config[key] = unix
  2334. for key,win,unix in PRC_PARAMETERS:
  2335. prc_parameters[key] = unix
  2336. for x in PkgListGet():
  2337. if ("HAVE_"+x in dtool_config):
  2338. if (PkgSkip(x)==0):
  2339. dtool_config["HAVE_"+x] = '1'
  2340. else:
  2341. dtool_config["HAVE_"+x] = 'UNDEF'
  2342. dtool_config["HAVE_NET"] = '1'
  2343. if (PkgSkip("NVIDIACG")==0):
  2344. dtool_config["HAVE_CG"] = '1'
  2345. dtool_config["HAVE_CGGL"] = '1'
  2346. dtool_config["HAVE_CGDX9"] = '1'
  2347. if GetTarget() not in ("linux", "android"):
  2348. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2349. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2350. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2351. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2352. if (GetTarget() == "darwin"):
  2353. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2354. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2355. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2356. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2357. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2358. dtool_config["HAVE_GLX"] = 'UNDEF'
  2359. dtool_config["IS_LINUX"] = 'UNDEF'
  2360. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2361. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2362. dtool_config["IS_OSX"] = '1'
  2363. if (GetTarget() == "freebsd"):
  2364. dtool_config["IS_LINUX"] = 'UNDEF'
  2365. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2366. dtool_config["IS_FREEBSD"] = '1'
  2367. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2368. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2369. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2370. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2371. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2372. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2373. if (GetTarget() == "android"):
  2374. # Android does have RTTI, but we disable it anyway.
  2375. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2376. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2377. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2378. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2379. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2380. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2381. # This should probably be more sophisticated, such as based
  2382. # on whether the libRocket Python modules are available.
  2383. if (PkgSkip("PYTHON") != 0):
  2384. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2385. if (GetOptimize() <= 3):
  2386. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2387. if (GetOptimize() <= 3):
  2388. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2389. dtool_config["DO_PSTATS"] = '1'
  2390. if (GetOptimize() <= 3):
  2391. dtool_config["DO_DCAST"] = '1'
  2392. if (GetOptimize() <= 3):
  2393. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2394. if (GetOptimize() <= 3):
  2395. dtool_config["DO_MEMORY_USAGE"] = '1'
  2396. if (GetOptimize() <= 3):
  2397. dtool_config["NOTIFY_DEBUG"] = '1'
  2398. if (GetOptimize() >= 4):
  2399. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2400. if (GetOptimize() >= 4):
  2401. # Disable RTTI on release builds.
  2402. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2403. # Now that we have OS_SIMPLE_THREADS, we can support
  2404. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2405. # longer need to disable it for this platform.
  2406. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2407. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2408. if (RTDIST or RUNTIME):
  2409. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2410. if HOST_URL:
  2411. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2412. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2413. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2414. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2415. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2416. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2417. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2418. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2419. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2420. if PkgSkip("GTK2") == 0:
  2421. plugin_config["HAVE_GTK"] = '1'
  2422. if (RUNTIME):
  2423. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2424. # Whether it's present on the system doesn't matter here,
  2425. # as the runtime itself doesn't include or link with X11.
  2426. if (RUNTIME and GetTarget() == 'linux'):
  2427. dtool_config["HAVE_X11"] = '1'
  2428. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2429. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2430. else:
  2431. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2432. if (PkgSkip("SPEEDTREE")==0):
  2433. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2434. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2435. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2436. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2437. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2438. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2439. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2440. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2441. for key in sorted(prc_parameters.keys()):
  2442. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2443. val = OverrideValue(key, prc_parameters[key])
  2444. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2445. else: conf = conf + "#define " + key + " " + val + "\n"
  2446. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2447. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2448. for key in sorted(dtool_config.keys()):
  2449. val = OverrideValue(key, dtool_config[key])
  2450. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2451. # These are not available for ARM, period.
  2452. conf = conf + "#ifdef __aarch64__\n"
  2453. conf = conf + "#undef " + key + "\n"
  2454. conf = conf + "#else\n"
  2455. conf = conf + "#define " + key + " " + val + "\n"
  2456. conf = conf + "#endif\n"
  2457. elif val == 'UNDEF':
  2458. conf = conf + "#undef " + key + "\n"
  2459. else:
  2460. conf = conf + "#define " + key + " " + val + "\n"
  2461. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2462. if (RTDIST or RUNTIME):
  2463. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2464. for key in sorted(plugin_config.keys()):
  2465. val = plugin_config[key]
  2466. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2467. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2468. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2469. if (PkgSkip("SPEEDTREE")==0):
  2470. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2471. for key in sorted(speedtree_parameters.keys()):
  2472. val = OverrideValue(key, speedtree_parameters[key])
  2473. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2474. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2475. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2476. for x in PkgListGet():
  2477. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2478. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2479. # Finally, write a platform.dat with the platform we are compiling for.
  2480. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2481. # This is useful for tools like makepackage that need to know things about
  2482. # the build parameters.
  2483. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2484. WriteConfigSettings()
  2485. WarnConflictingFiles()
  2486. if SystemLibraryExists("dtoolbase"):
  2487. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2488. if SystemLibraryExists("p3dtoolconfig"):
  2489. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2490. ##########################################################################################
  2491. #
  2492. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2493. #
  2494. ##########################################################################################
  2495. PANDAVERSION_H="""
  2496. #define PANDA_MAJOR_VERSION $VERSION1
  2497. #define PANDA_MINOR_VERSION $VERSION2
  2498. #define PANDA_SEQUENCE_VERSION $VERSION3
  2499. #define PANDA_VERSION $NVERSION
  2500. #define PANDA_NUMERIC_VERSION $NVERSION
  2501. #define PANDA_VERSION_STR "$VERSION"
  2502. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2503. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2504. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2505. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2506. """
  2507. PANDAVERSION_H_RUNTIME="""
  2508. #define PANDA_MAJOR_VERSION 0
  2509. #define PANDA_MINOR_VERSION 0
  2510. #define PANDA_SEQUENCE_VERSION 0
  2511. #define PANDA_VERSION_STR "0.0.0"
  2512. #define PANDA_ABI_VERSION_STR "0.0"
  2513. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2514. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2515. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2516. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2517. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2518. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2519. #define PANDA_PACKAGE_VERSION_STR ""
  2520. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2521. """
  2522. CHECKPANDAVERSION_CXX="""
  2523. # include "dtoolbase.h"
  2524. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2525. """
  2526. CHECKPANDAVERSION_H="""
  2527. # ifndef CHECKPANDAVERSION_H
  2528. # define CHECKPANDAVERSION_H
  2529. # include "dtoolbase.h"
  2530. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2531. // Hack to forcibly depend on the check
  2532. template<typename T>
  2533. class CheckPandaVersion {
  2534. public:
  2535. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2536. };
  2537. template class CheckPandaVersion<void>;
  2538. # endif
  2539. """
  2540. P3DACTIVEX_RC="""#include "resource.h"
  2541. #define APSTUDIO_READONLY_SYMBOLS
  2542. #include "afxres.h"
  2543. #undef APSTUDIO_READONLY_SYMBOLS
  2544. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2545. #ifdef _WIN32
  2546. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2547. #pragma code_page(1252)
  2548. #endif
  2549. #ifdef APSTUDIO_INVOKED
  2550. 1 TEXTINCLUDE
  2551. BEGIN
  2552. "resource.h\\0"
  2553. END
  2554. 2 TEXTINCLUDE
  2555. BEGIN
  2556. "#include ""afxres.h""\\r\\n"
  2557. "\\0"
  2558. END
  2559. 3 TEXTINCLUDE
  2560. BEGIN
  2561. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2562. "\\0"
  2563. END
  2564. #endif
  2565. %s
  2566. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2567. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2568. STYLE DS_SETFONT | WS_CHILD
  2569. FONT 8, "MS Sans Serif"
  2570. BEGIN
  2571. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2572. IDC_STATIC,7,25,229,16
  2573. END
  2574. #ifdef APSTUDIO_INVOKED
  2575. GUIDELINES DESIGNINFO
  2576. BEGIN
  2577. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2578. BEGIN
  2579. LEFTMARGIN, 7
  2580. RIGHTMARGIN, 243
  2581. TOPMARGIN, 7
  2582. BOTTOMMARGIN, 55
  2583. END
  2584. END
  2585. #endif
  2586. STRINGTABLE
  2587. BEGIN
  2588. IDS_P3DACTIVEX "P3DActiveX Control"
  2589. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2590. END
  2591. STRINGTABLE
  2592. BEGIN
  2593. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2594. END
  2595. #endif
  2596. #ifndef APSTUDIO_INVOKED
  2597. 1 TYPELIB "P3DActiveX.tlb"
  2598. #endif"""
  2599. def CreatePandaVersionFiles():
  2600. version1=int(VERSION.split(".")[0])
  2601. version2=int(VERSION.split(".")[1])
  2602. version3=int(VERSION.split(".")[2])
  2603. nversion=version1*1000000+version2*1000+version3
  2604. if (DISTRIBUTOR != "cmu"):
  2605. # Subtract 1 if we are not an official version.
  2606. nversion -= 1
  2607. if (RUNTIME):
  2608. pandaversion_h = PANDAVERSION_H_RUNTIME
  2609. else:
  2610. pandaversion_h = PANDAVERSION_H
  2611. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2612. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2613. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2614. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2615. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2616. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2617. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2618. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2619. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2620. if (DISTRIBUTOR == "cmu"):
  2621. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2622. else:
  2623. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2624. if GIT_COMMIT:
  2625. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2626. if not RUNTIME:
  2627. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2628. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2629. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2630. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2631. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2632. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2633. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2634. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2635. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2636. if RUNTIME:
  2637. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2638. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2639. else:
  2640. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2641. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2642. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2643. if RUNTIME:
  2644. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2645. "version" : VERSION,
  2646. "description" : "Runs 3-D games and interactive applets",
  2647. "filename" : "p3dactivex.ocx",
  2648. "mimetype" : "application/x-panda3d",
  2649. "extension" : "p3d",
  2650. "filedesc" : "Panda3D applet"}
  2651. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2652. CreatePandaVersionFiles()
  2653. ##########################################################################################
  2654. #
  2655. # Copy the "direct" tree
  2656. #
  2657. ##########################################################################################
  2658. if (PkgSkip("DIRECT")==0):
  2659. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2660. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2661. # This file used to be copied, but would nowadays cause conflicts.
  2662. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2663. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2664. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2665. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2666. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2667. # This directory doesn't exist at all any more.
  2668. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2669. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2670. # These files used to exist; remove them to avoid conflicts.
  2671. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2672. '_core.pyd', '_core.so',
  2673. 'direct.py', 'direct.pyc', 'direct.pyo',
  2674. '_direct.pyd', '_direct.so',
  2675. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2676. for basename in del_files:
  2677. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2678. if os.path.isfile(path):
  2679. print("Removing %s" % (path))
  2680. os.remove(path)
  2681. # Write an appropriate panda3d/__init__.py
  2682. p3d_init = """"Python bindings for the Panda3D libraries"
  2683. __version__ = '%s'
  2684. """ % (WHLVERSION)
  2685. if GetTarget() == 'windows':
  2686. p3d_init += """
  2687. if '__file__' in locals():
  2688. import os
  2689. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2690. if os.path.isdir(bindir):
  2691. if hasattr(os, 'add_dll_directory'):
  2692. os.add_dll_directory(bindir)
  2693. elif not os.environ.get('PATH'):
  2694. os.environ['PATH'] = bindir
  2695. else:
  2696. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2697. del os, bindir
  2698. """
  2699. if not PkgSkip("PYTHON"):
  2700. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2701. # Also add this file, for backward compatibility.
  2702. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2703. '''Alias of :mod:`panda3d.interrogatedb`.
  2704. .. deprecated:: 1.10.0
  2705. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2706. '''
  2707. if __debug__:
  2708. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2709. from .interrogatedb import *
  2710. """)
  2711. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2712. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2713. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2714. os.remove(fn)
  2715. panda_modules = ['core']
  2716. if not PkgSkip("PANDAPHYSICS"):
  2717. panda_modules.append('physics')
  2718. if not PkgSkip('PANDAFX'):
  2719. panda_modules.append('fx')
  2720. if not PkgSkip("DIRECT"):
  2721. panda_modules.append('direct')
  2722. if not PkgSkip("VISION"):
  2723. panda_modules.append('vision')
  2724. if not PkgSkip("SKEL"):
  2725. panda_modules.append('skel')
  2726. if not PkgSkip("EGG"):
  2727. panda_modules.append('egg')
  2728. if not PkgSkip("ODE"):
  2729. panda_modules.append('ode')
  2730. if not PkgSkip("VRPN"):
  2731. panda_modules.append('vrpn')
  2732. panda_modules_code = """
  2733. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2734. if __debug__:
  2735. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2736. """
  2737. for module in panda_modules:
  2738. panda_modules_code += """
  2739. try:
  2740. from panda3d.%s import *
  2741. except ImportError as err:
  2742. if "No module named %s" not in str(err):
  2743. raise""" % (module, module)
  2744. panda_modules_code += """
  2745. from direct.showbase import DConfig
  2746. def get_config_showbase():
  2747. return DConfig
  2748. def get_config_express():
  2749. return DConfig
  2750. getConfigShowbase = get_config_showbase
  2751. getConfigExpress = get_config_express
  2752. """
  2753. exthelpers_code = """
  2754. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2755. from direct.extensions_native.extension_native_helpers import *
  2756. """
  2757. if not PkgSkip("PYTHON"):
  2758. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2759. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2760. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2761. ##########################################################################################
  2762. #
  2763. # Write the dist-info directory.
  2764. #
  2765. ##########################################################################################
  2766. # This is just some basic stuff since setuptools just needs this file to
  2767. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2768. # eventually want to merge this with the metadata generator in makewheel.py.
  2769. METADATA = """Metadata-Version: 2.0
  2770. Name: Panda3D
  2771. Version: {version}
  2772. License: BSD
  2773. Home-page: https://www.panda3d.org/
  2774. Author: Panda3D Team
  2775. Author-email: [email protected]
  2776. """
  2777. ENTRY_POINTS = """[distutils.commands]
  2778. build_apps = direct.dist.commands:build_apps
  2779. bdist_apps = direct.dist.commands:bdist_apps
  2780. """
  2781. if not PkgSkip("DIRECT"):
  2782. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2783. MakeDirectory(dist_dir)
  2784. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2785. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2786. ##########################################################################################
  2787. #
  2788. # Generate the PRC files into the ETC directory.
  2789. #
  2790. ##########################################################################################
  2791. confautoprc = ReadFile("makepanda/confauto.in")
  2792. if (PkgSkip("SPEEDTREE")==0):
  2793. # If SpeedTree is available, enable it in the config file
  2794. confautoprc = confautoprc.replace('#st#', '')
  2795. else:
  2796. # otherwise, disable it.
  2797. confautoprc = confautoprc.replace('#st#', '#')
  2798. confautoprc = confautoprc.replace('\r\n', '\n')
  2799. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2800. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2801. if PkgSkip("EGG") or GetLinkAllStatic():
  2802. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2803. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2804. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2805. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2806. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2807. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2808. if (os.path.isfile("makepanda/myconfig.in")):
  2809. configprc = ReadFile("makepanda/myconfig.in")
  2810. else:
  2811. configprc = ReadFile("makepanda/config.in")
  2812. configprc = configprc.replace('\r\n', '\n')
  2813. if (GetTarget() == 'windows'):
  2814. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2815. else:
  2816. configprc = configprc.replace("aux-display pandadx9", "")
  2817. if (GetTarget() == 'darwin'):
  2818. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2819. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2820. if not PkgSkip("FMODEX"):
  2821. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2822. if PkgSkip("GL") or GetLinkAllStatic():
  2823. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2824. if PkgSkip("GLES") or GetLinkAllStatic():
  2825. configprc = configprc.replace("\n#load-display pandagles", "")
  2826. if PkgSkip("DX9") or GetLinkAllStatic():
  2827. configprc = configprc.replace("\n#load-display pandadx9", "")
  2828. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2829. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2830. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2831. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2832. if GetTarget() == 'windows':
  2833. # Convert to Windows newlines.
  2834. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2835. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2836. else:
  2837. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2838. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2839. ##########################################################################################
  2840. #
  2841. # Copy the precompiled binaries and DLLs into the build.
  2842. #
  2843. ##########################################################################################
  2844. tp_dir = GetThirdpartyDir()
  2845. if tp_dir is not None:
  2846. dylibs = {}
  2847. if GetTarget() == 'darwin':
  2848. # Make a list of all the dylibs we ship, to figure out whether we should use
  2849. # install_name_tool to correct the library reference to point to our copy.
  2850. for pkg in PkgListGet():
  2851. if PkgSkip(pkg):
  2852. continue
  2853. tp_libdir = GetThirdpartyLibDir(pkg)
  2854. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2855. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2856. if not PkgSkip("PYTHON"):
  2857. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2858. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2859. for pkg in PkgListGet():
  2860. if PkgSkip(pkg):
  2861. continue
  2862. tp_pkg = tp_dir + pkg.lower()
  2863. if GetTarget() == 'windows':
  2864. if os.path.exists(tp_pkg + "/bin"):
  2865. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2866. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2867. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2868. elif GetTarget() == 'darwin':
  2869. tp_libdir = GetThirdpartyLibDir(pkg)
  2870. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2871. if not PkgSkip("PYTHON"):
  2872. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2873. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2874. if pkg != 'PYTHON':
  2875. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2876. for tp_lib in tp_libs:
  2877. basename = os.path.basename(tp_lib)
  2878. if basename.endswith('.dylib'):
  2879. # It's a dynamic link library. Put it in the lib directory.
  2880. target = GetOutputDir() + "/lib/" + basename
  2881. dep_prefix = "@loader_path/../lib/"
  2882. lib_id = dep_prefix + basename
  2883. else:
  2884. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2885. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2886. target = GetOutputDir() + "/" + basename
  2887. dep_prefix = "@loader_path/lib/"
  2888. lib_id = basename
  2889. if not NeedsBuild([target], [tp_lib]):
  2890. continue
  2891. CopyFile(target, tp_lib)
  2892. if os.path.islink(target) or target.endswith('.py'):
  2893. continue
  2894. # Correct the inter-library dependencies so that the build is relocatable.
  2895. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2896. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2897. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2898. line = line.strip()
  2899. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2900. continue
  2901. libdep = line.split(" ", 1)[0]
  2902. dep_basename = os.path.basename(libdep)
  2903. if dep_basename in dylibs:
  2904. dep_target = dylibs[dep_basename]
  2905. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2906. JustBuilt([target], [tp_lib])
  2907. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2908. MakeDirectory(GetOutputDir() + "/Frameworks")
  2909. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2910. else: # Linux / FreeBSD case.
  2911. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2912. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2913. if not PkgSkip("PYTHON"):
  2914. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2915. base = os.path.basename(tp_lib)
  2916. if base.startswith('lib'):
  2917. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2918. else:
  2919. # It's a Python module, like _rocketcore.so.
  2920. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2921. if GetTarget() == 'windows':
  2922. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2923. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  2924. if not PkgSkip("PYTHON") and not RTDIST:
  2925. # We need to copy the Python DLL to the bin directory for now.
  2926. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  2927. if GetOptimize() <= 2:
  2928. pydll += "_d.dll"
  2929. else:
  2930. pydll += ".dll"
  2931. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  2932. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  2933. CopyFile(GetOutputDir() + "/bin/", fn)
  2934. # Copy the whole Python directory.
  2935. if COPY_PYTHON:
  2936. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  2937. # NB: Python does not always ship with the correct manifest/dll.
  2938. # Figure out the correct one to ship, and grab it from WinSxS dir.
  2939. manifest = GetOutputDir() + '/tmp/python.manifest'
  2940. if os.path.isfile(manifest):
  2941. os.unlink(manifest)
  2942. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  2943. if COPY_PYTHON and os.path.isfile(manifest):
  2944. import xml.etree.ElementTree as ET
  2945. tree = ET.parse(manifest)
  2946. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  2947. else:
  2948. idents = ()
  2949. for ident in idents:
  2950. sxs_name = '_'.join([
  2951. ident.get('processorArchitecture'),
  2952. ident.get('name').lower(),
  2953. ident.get('publicKeyToken'),
  2954. ident.get('version'),
  2955. ])
  2956. # Find the manifest matching these parameters.
  2957. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  2958. manifests = glob.glob(pattern)
  2959. if not manifests:
  2960. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  2961. continue
  2962. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  2963. # Also copy the corresponding msvcr dll.
  2964. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  2965. for file in glob.glob(pattern):
  2966. CopyFile(GetOutputDir() + "/python/", file)
  2967. # Copy python.exe to ppython.exe.
  2968. if COPY_PYTHON:
  2969. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  2970. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  2971. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  2972. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  2973. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  2974. # Copy over the MSVC runtime.
  2975. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  2976. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  2977. crtname = "Microsoft.VC%s.CRT" % (vcver)
  2978. if ("VCTOOLSVERSION" in SDK):
  2979. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  2980. else:
  2981. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  2982. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  2983. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  2984. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  2985. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  2986. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  2987. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  2988. ########################################################################
  2989. ##
  2990. ## Copy various stuff into the build.
  2991. ##
  2992. ########################################################################
  2993. if GetTarget() == 'windows':
  2994. # Convert to Windows newlines so they can be opened by notepad.
  2995. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  2996. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  2997. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  2998. else:
  2999. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3000. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3001. if (PkgSkip("PANDATOOL")==0):
  3002. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3003. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3004. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3005. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3006. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3007. # Since Eigen is included by all sorts of core headers, as a convenience
  3008. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3009. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3010. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3011. ########################################################################
  3012. #
  3013. # Copy header files to the built/include/parser-inc directory.
  3014. #
  3015. ########################################################################
  3016. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3017. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3018. ########################################################################
  3019. #
  3020. # Transfer all header files to the built/include directory.
  3021. #
  3022. ########################################################################
  3023. CopyAllHeaders('dtool/src/dtoolbase')
  3024. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3025. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3026. CopyAllHeaders('dtool/metalibs/dtool')
  3027. CopyAllHeaders('dtool/src/cppparser')
  3028. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3029. CopyAllHeaders('dtool/src/dconfig')
  3030. CopyAllHeaders('dtool/src/interrogatedb')
  3031. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3032. CopyAllHeaders('dtool/src/pystub')
  3033. CopyAllHeaders('dtool/src/interrogate')
  3034. CopyAllHeaders('dtool/src/test_interrogate')
  3035. CopyAllHeaders('panda/src/putil')
  3036. CopyAllHeaders('panda/src/pandabase')
  3037. CopyAllHeaders('panda/src/express')
  3038. CopyAllHeaders('panda/src/downloader')
  3039. CopyAllHeaders('panda/metalibs/pandaexpress')
  3040. CopyAllHeaders('panda/src/pipeline')
  3041. CopyAllHeaders('panda/src/linmath')
  3042. CopyAllHeaders('panda/src/putil')
  3043. CopyAllHeaders('dtool/src/prckeys')
  3044. CopyAllHeaders('panda/src/audio')
  3045. CopyAllHeaders('panda/src/event')
  3046. CopyAllHeaders('panda/src/mathutil')
  3047. CopyAllHeaders('panda/src/gsgbase')
  3048. CopyAllHeaders('panda/src/pnmimage')
  3049. CopyAllHeaders('panda/src/nativenet')
  3050. CopyAllHeaders('panda/src/net')
  3051. CopyAllHeaders('panda/src/pstatclient')
  3052. CopyAllHeaders('panda/src/gobj')
  3053. CopyAllHeaders('panda/src/movies')
  3054. CopyAllHeaders('panda/src/pgraphnodes')
  3055. CopyAllHeaders('panda/src/pgraph')
  3056. CopyAllHeaders('panda/src/cull')
  3057. CopyAllHeaders('panda/src/display')
  3058. CopyAllHeaders('panda/src/chan')
  3059. CopyAllHeaders('panda/src/char')
  3060. CopyAllHeaders('panda/src/dgraph')
  3061. CopyAllHeaders('panda/src/device')
  3062. CopyAllHeaders('panda/src/pnmtext')
  3063. CopyAllHeaders('panda/src/text')
  3064. CopyAllHeaders('panda/src/grutil')
  3065. if (PkgSkip("VISION")==0):
  3066. CopyAllHeaders('panda/src/vision')
  3067. if (PkgSkip("FFMPEG")==0):
  3068. CopyAllHeaders('panda/src/ffmpeg')
  3069. CopyAllHeaders('panda/src/tform')
  3070. CopyAllHeaders('panda/src/collide')
  3071. CopyAllHeaders('panda/src/parametrics')
  3072. CopyAllHeaders('panda/src/pgui')
  3073. CopyAllHeaders('panda/src/pnmimagetypes')
  3074. CopyAllHeaders('panda/src/recorder')
  3075. if (PkgSkip("ROCKET")==0):
  3076. CopyAllHeaders('panda/src/rocket')
  3077. if (PkgSkip("VRPN")==0):
  3078. CopyAllHeaders('panda/src/vrpn')
  3079. CopyAllHeaders('panda/src/wgldisplay')
  3080. CopyAllHeaders('panda/src/ode')
  3081. CopyAllHeaders('panda/metalibs/pandaode')
  3082. if (PkgSkip("PANDAPHYSICS")==0):
  3083. CopyAllHeaders('panda/src/physics')
  3084. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3085. CopyAllHeaders('panda/src/particlesystem')
  3086. CopyAllHeaders('panda/src/dxml')
  3087. CopyAllHeaders('panda/metalibs/panda')
  3088. CopyAllHeaders('panda/src/audiotraits')
  3089. CopyAllHeaders('panda/src/audiotraits')
  3090. CopyAllHeaders('panda/src/distort')
  3091. CopyAllHeaders('panda/src/downloadertools')
  3092. CopyAllHeaders('panda/src/windisplay')
  3093. CopyAllHeaders('panda/src/dxgsg9')
  3094. CopyAllHeaders('panda/metalibs/pandadx9')
  3095. if not PkgSkip("EGG"):
  3096. CopyAllHeaders('panda/src/egg')
  3097. CopyAllHeaders('panda/src/egg2pg')
  3098. CopyAllHeaders('panda/src/framework')
  3099. CopyAllHeaders('panda/metalibs/pandafx')
  3100. CopyAllHeaders('panda/src/glstuff')
  3101. CopyAllHeaders('panda/src/glgsg')
  3102. CopyAllHeaders('panda/src/glesgsg')
  3103. CopyAllHeaders('panda/src/gles2gsg')
  3104. if not PkgSkip("EGG"):
  3105. CopyAllHeaders('panda/metalibs/pandaegg')
  3106. if GetTarget() == 'windows':
  3107. CopyAllHeaders('panda/src/wgldisplay')
  3108. elif GetTarget() == 'darwin':
  3109. CopyAllHeaders('panda/src/osxdisplay')
  3110. CopyAllHeaders('panda/src/cocoadisplay')
  3111. elif GetTarget() == 'android':
  3112. CopyAllHeaders('panda/src/android')
  3113. CopyAllHeaders('panda/src/androiddisplay')
  3114. else:
  3115. CopyAllHeaders('panda/src/x11display')
  3116. CopyAllHeaders('panda/src/glxdisplay')
  3117. CopyAllHeaders('panda/src/egldisplay')
  3118. CopyAllHeaders('panda/metalibs/pandagl')
  3119. CopyAllHeaders('panda/metalibs/pandagles')
  3120. CopyAllHeaders('panda/metalibs/pandagles2')
  3121. CopyAllHeaders('panda/metalibs/pandaphysics')
  3122. CopyAllHeaders('panda/src/testbed')
  3123. if (PkgSkip("PHYSX")==0):
  3124. CopyAllHeaders('panda/src/physx')
  3125. CopyAllHeaders('panda/metalibs/pandaphysx')
  3126. if (PkgSkip("BULLET")==0):
  3127. CopyAllHeaders('panda/src/bullet')
  3128. CopyAllHeaders('panda/metalibs/pandabullet')
  3129. if (PkgSkip("SPEEDTREE")==0):
  3130. CopyAllHeaders('panda/src/speedtree')
  3131. if (PkgSkip("DIRECT")==0):
  3132. CopyAllHeaders('direct/src/directbase')
  3133. CopyAllHeaders('direct/src/dcparser')
  3134. CopyAllHeaders('direct/src/deadrec')
  3135. CopyAllHeaders('direct/src/distributed')
  3136. CopyAllHeaders('direct/src/interval')
  3137. CopyAllHeaders('direct/src/showbase')
  3138. CopyAllHeaders('direct/src/dcparse')
  3139. if (RUNTIME or RTDIST):
  3140. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3141. if (RUNTIME):
  3142. CopyAllHeaders('direct/src/plugin_npapi')
  3143. CopyAllHeaders('direct/src/plugin_standalone')
  3144. if (PkgSkip("PANDATOOL")==0):
  3145. CopyAllHeaders('pandatool/src/pandatoolbase')
  3146. CopyAllHeaders('pandatool/src/converter')
  3147. CopyAllHeaders('pandatool/src/progbase')
  3148. CopyAllHeaders('pandatool/src/eggbase')
  3149. CopyAllHeaders('pandatool/src/bam')
  3150. CopyAllHeaders('pandatool/src/cvscopy')
  3151. CopyAllHeaders('pandatool/src/daeegg')
  3152. CopyAllHeaders('pandatool/src/daeprogs')
  3153. CopyAllHeaders('pandatool/src/dxf')
  3154. CopyAllHeaders('pandatool/src/dxfegg')
  3155. CopyAllHeaders('pandatool/src/dxfprogs')
  3156. CopyAllHeaders('pandatool/src/palettizer')
  3157. CopyAllHeaders('pandatool/src/egg-mkfont')
  3158. CopyAllHeaders('pandatool/src/eggcharbase')
  3159. CopyAllHeaders('pandatool/src/egg-optchar')
  3160. CopyAllHeaders('pandatool/src/egg-palettize')
  3161. CopyAllHeaders('pandatool/src/egg-qtess')
  3162. CopyAllHeaders('pandatool/src/eggprogs')
  3163. CopyAllHeaders('pandatool/src/flt')
  3164. CopyAllHeaders('pandatool/src/fltegg')
  3165. CopyAllHeaders('pandatool/src/fltprogs')
  3166. CopyAllHeaders('pandatool/src/imagebase')
  3167. CopyAllHeaders('pandatool/src/imageprogs')
  3168. CopyAllHeaders('pandatool/src/pfmprogs')
  3169. CopyAllHeaders('pandatool/src/lwo')
  3170. CopyAllHeaders('pandatool/src/lwoegg')
  3171. CopyAllHeaders('pandatool/src/lwoprogs')
  3172. CopyAllHeaders('pandatool/src/maya')
  3173. CopyAllHeaders('pandatool/src/mayaegg')
  3174. CopyAllHeaders('pandatool/src/maxegg')
  3175. CopyAllHeaders('pandatool/src/maxprogs')
  3176. CopyAllHeaders('pandatool/src/objegg')
  3177. CopyAllHeaders('pandatool/src/objprogs')
  3178. CopyAllHeaders('pandatool/src/vrml')
  3179. CopyAllHeaders('pandatool/src/vrmlegg')
  3180. CopyAllHeaders('pandatool/src/xfile')
  3181. CopyAllHeaders('pandatool/src/xfileegg')
  3182. CopyAllHeaders('pandatool/src/ptloader')
  3183. CopyAllHeaders('pandatool/src/miscprogs')
  3184. CopyAllHeaders('pandatool/src/pstatserver')
  3185. CopyAllHeaders('pandatool/src/text-stats')
  3186. CopyAllHeaders('pandatool/src/vrmlprogs')
  3187. CopyAllHeaders('pandatool/src/win-stats')
  3188. CopyAllHeaders('pandatool/src/xfileprogs')
  3189. if (PkgSkip("CONTRIB")==0):
  3190. CopyAllHeaders('contrib/src/contribbase')
  3191. CopyAllHeaders('contrib/src/ai')
  3192. ########################################################################
  3193. #
  3194. # These definitions are syntactic shorthand. They make it easy
  3195. # to link with the usual libraries without listing them all.
  3196. #
  3197. ########################################################################
  3198. COMMON_DTOOL_LIBS=[
  3199. 'libp3dtool.dll',
  3200. 'libp3dtoolconfig.dll',
  3201. ]
  3202. COMMON_PANDA_LIBS=[
  3203. 'libpanda.dll',
  3204. 'libpandaexpress.dll'
  3205. ] + COMMON_DTOOL_LIBS
  3206. COMMON_EGG2X_LIBS=[
  3207. 'libp3eggbase.lib',
  3208. 'libp3progbase.lib',
  3209. 'libp3converter.lib',
  3210. 'libp3pandatoolbase.lib',
  3211. 'libpandaegg.dll',
  3212. ] + COMMON_PANDA_LIBS
  3213. ########################################################################
  3214. #
  3215. # This section contains a list of all the files that need to be compiled.
  3216. #
  3217. ########################################################################
  3218. print("Generating dependencies...")
  3219. sys.stdout.flush()
  3220. #
  3221. # Compile Panda icon resource file.
  3222. # We do it first because we need it at
  3223. # the time we compile an executable.
  3224. #
  3225. if GetTarget() == 'windows':
  3226. OPTS=['DIR:panda/src/configfiles']
  3227. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3228. #
  3229. # DIRECTORY: dtool/src/dtoolbase/
  3230. #
  3231. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL']
  3232. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3233. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3234. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3235. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3236. #
  3237. # DIRECTORY: dtool/src/dtoolutil/
  3238. #
  3239. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3240. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3241. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3242. if GetTarget() == 'darwin':
  3243. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3244. #
  3245. # DIRECTORY: dtool/metalibs/dtool/
  3246. #
  3247. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3248. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3249. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3250. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3251. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3252. if GetTarget() == 'darwin':
  3253. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3254. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3255. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3256. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3257. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3258. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL'])
  3259. #
  3260. # DIRECTORY: dtool/src/cppparser/
  3261. #
  3262. if (not RUNTIME):
  3263. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3264. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3265. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3266. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3267. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3268. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3269. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3270. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3271. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3272. #
  3273. # DIRECTORY: dtool/src/prc/
  3274. #
  3275. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3276. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3277. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3278. #
  3279. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3280. #
  3281. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3282. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3283. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3284. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3285. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3286. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3287. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3288. #
  3289. # DIRECTORY: dtool/src/interrogatedb/
  3290. #
  3291. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3292. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3293. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3294. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3295. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3296. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3297. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3298. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3299. # stuff, so it has been renamed appropriately.
  3300. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3301. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3302. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3303. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3304. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3305. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3306. #
  3307. # DIRECTORY: dtool/src/pystub/
  3308. #
  3309. if not RUNTIME and not RTDIST:
  3310. OPTS=['DIR:dtool/src/pystub']
  3311. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3312. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3313. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3314. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3315. #
  3316. # DIRECTORY: dtool/src/interrogate/
  3317. #
  3318. if (not RUNTIME):
  3319. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3320. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3321. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3322. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3323. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3324. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3325. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3326. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3327. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3328. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3329. 'dtool/src/interrogatedb/py_panda.cxx',
  3330. 'dtool/src/interrogatedb/py_compat.cxx',
  3331. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3332. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3333. ])
  3334. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3335. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3336. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3337. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3338. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3339. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3340. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3341. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3342. if (not RTDIST):
  3343. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3344. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3345. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3346. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3347. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3348. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3349. #
  3350. # DIRECTORY: dtool/src/prckeys/
  3351. #
  3352. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3353. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3354. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3355. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3356. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3357. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3358. #
  3359. # DIRECTORY: dtool/src/test_interrogate/
  3360. #
  3361. if (not RTDIST and not RUNTIME):
  3362. OPTS=['DIR:dtool/src/test_interrogate']
  3363. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3364. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3365. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3366. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3367. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3368. #
  3369. # DIRECTORY: dtool/src/dtoolbase/
  3370. #
  3371. OPTS=['DIR:dtool/src/dtoolbase']
  3372. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3373. IGATEFILES += [
  3374. "typeHandle.h",
  3375. "typeHandle_ext.h",
  3376. "typeRegistry.h",
  3377. "typedObject.h",
  3378. "neverFreeMemory.h",
  3379. ]
  3380. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3381. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3382. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3383. #
  3384. # DIRECTORY: dtool/src/dtoolutil/
  3385. #
  3386. OPTS=['DIR:dtool/src/dtoolutil']
  3387. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3388. IGATEFILES += [
  3389. "config_dtoolutil.h",
  3390. "pandaSystem.h",
  3391. "dSearchPath.h",
  3392. "executionEnvironment.h",
  3393. "textEncoder.h",
  3394. "textEncoder_ext.h",
  3395. "filename.h",
  3396. "filename_ext.h",
  3397. "globPattern.h",
  3398. "globPattern_ext.h",
  3399. "pandaFileStream.h",
  3400. "lineStream.h",
  3401. ]
  3402. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3403. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3404. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3405. #
  3406. # DIRECTORY: dtool/src/prc/
  3407. #
  3408. OPTS=['DIR:dtool/src/prc']
  3409. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3410. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3411. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3412. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3413. #
  3414. # DIRECTORY: panda/src/pandabase/
  3415. #
  3416. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3417. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3418. #
  3419. # DIRECTORY: panda/src/express/
  3420. #
  3421. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3422. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3423. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3424. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3425. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3426. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3427. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3428. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3429. #
  3430. # DIRECTORY: panda/src/downloader/
  3431. #
  3432. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3433. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3434. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3435. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3436. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3437. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3438. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3439. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3440. #
  3441. # DIRECTORY: panda/metalibs/pandaexpress/
  3442. #
  3443. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3444. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3445. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3446. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3447. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3448. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3449. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3450. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3451. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3452. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3453. #
  3454. # DIRECTORY: panda/src/pipeline/
  3455. #
  3456. if (not RUNTIME):
  3457. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3458. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3459. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3460. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3461. OPTS=['DIR:panda/src/pipeline']
  3462. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3463. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3464. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3465. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3466. #
  3467. # DIRECTORY: panda/src/linmath/
  3468. #
  3469. if (not RUNTIME):
  3470. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3471. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3472. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3473. OPTS=['DIR:panda/src/linmath']
  3474. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3475. for ifile in IGATEFILES[:]:
  3476. if "_src." in ifile:
  3477. IGATEFILES.remove(ifile)
  3478. IGATEFILES.remove('cast_to_double.h')
  3479. IGATEFILES.remove('lmat_ops.h')
  3480. IGATEFILES.remove('cast_to_float.h')
  3481. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3482. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3483. #
  3484. # DIRECTORY: panda/src/putil/
  3485. #
  3486. if (not RUNTIME):
  3487. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3488. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3489. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3490. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3491. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3492. IGATEFILES.remove("test_bam.h")
  3493. IGATEFILES.remove("config_util.h")
  3494. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3495. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3496. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3497. #
  3498. # DIRECTORY: panda/src/audio/
  3499. #
  3500. if (not RUNTIME):
  3501. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3502. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3503. OPTS=['DIR:panda/src/audio']
  3504. IGATEFILES=["audio.h"]
  3505. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3506. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3507. #
  3508. # DIRECTORY: panda/src/event/
  3509. #
  3510. if (not RUNTIME):
  3511. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3512. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3513. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3514. OPTS=['DIR:panda/src/event']
  3515. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3516. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3517. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3518. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3519. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3520. #
  3521. # DIRECTORY: panda/src/mathutil/
  3522. #
  3523. if (not RUNTIME):
  3524. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3525. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3526. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3527. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3528. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3529. for ifile in IGATEFILES[:]:
  3530. if "_src." in ifile:
  3531. IGATEFILES.remove(ifile)
  3532. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3533. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3534. #
  3535. # DIRECTORY: panda/src/gsgbase/
  3536. #
  3537. if (not RUNTIME):
  3538. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3539. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3540. OPTS=['DIR:panda/src/gsgbase']
  3541. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3542. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3543. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3544. #
  3545. # DIRECTORY: panda/src/pnmimage/
  3546. #
  3547. if (not RUNTIME):
  3548. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3549. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3550. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3551. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3552. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3553. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3554. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3555. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3556. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3557. #
  3558. # DIRECTORY: panda/src/nativenet/
  3559. #
  3560. if (not RUNTIME):
  3561. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3562. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3563. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3564. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3565. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3566. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3567. #
  3568. # DIRECTORY: panda/src/net/
  3569. #
  3570. if (not RUNTIME):
  3571. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3572. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3573. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3574. OPTS=['DIR:panda/src/net']
  3575. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3576. IGATEFILES.remove("datagram_ui.h")
  3577. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3578. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3579. #
  3580. # DIRECTORY: panda/src/pstatclient/
  3581. #
  3582. if (not RUNTIME):
  3583. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3584. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3585. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3586. OPTS=['DIR:panda/src/pstatclient']
  3587. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3588. IGATEFILES.remove("config_pstats.h")
  3589. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3590. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3591. #
  3592. # DIRECTORY: panda/src/gobj/
  3593. #
  3594. if (not RUNTIME):
  3595. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3596. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3597. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3598. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3599. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3600. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3601. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3602. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3603. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3604. #
  3605. # DIRECTORY: panda/src/pgraphnodes/
  3606. #
  3607. if (not RUNTIME):
  3608. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3609. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3610. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3611. OPTS=['DIR:panda/src/pgraphnodes']
  3612. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3613. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3614. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3615. #
  3616. # DIRECTORY: panda/src/pgraph/
  3617. #
  3618. if (not RUNTIME):
  3619. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3620. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3621. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3622. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3623. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3624. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3625. OPTS=['DIR:panda/src/pgraph']
  3626. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3627. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3628. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3629. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3630. #
  3631. # DIRECTORY: panda/src/cull/
  3632. #
  3633. if (not RUNTIME):
  3634. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3635. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3636. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3637. OPTS=['DIR:panda/src/cull']
  3638. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3639. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3640. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3641. #
  3642. # DIRECTORY: panda/src/dgraph/
  3643. #
  3644. if (not RUNTIME):
  3645. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3646. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3647. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3648. OPTS=['DIR:panda/src/dgraph']
  3649. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3650. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3651. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3652. #
  3653. # DIRECTORY: panda/src/device/
  3654. #
  3655. if (not RUNTIME):
  3656. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3657. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3658. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3659. OPTS=['DIR:panda/src/device']
  3660. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3661. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3662. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3663. #
  3664. # DIRECTORY: panda/src/display/
  3665. #
  3666. if (not RUNTIME):
  3667. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3668. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3669. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3670. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3671. OPTS=['DIR:panda/src/display', 'X11']
  3672. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3673. IGATEFILES.remove("renderBuffer.h")
  3674. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3675. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3676. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3677. if RTDIST and GetTarget() == 'darwin':
  3678. OPTS=['DIR:panda/src/display']
  3679. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3680. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3681. #
  3682. # DIRECTORY: panda/src/chan/
  3683. #
  3684. if (not RUNTIME):
  3685. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3686. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3687. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3688. OPTS=['DIR:panda/src/chan']
  3689. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3690. IGATEFILES.remove('movingPart.h')
  3691. IGATEFILES.remove('animChannelFixed.h')
  3692. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3693. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3694. # DIRECTORY: panda/src/char/
  3695. #
  3696. if (not RUNTIME):
  3697. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3698. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3699. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3700. OPTS=['DIR:panda/src/char']
  3701. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3702. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3703. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3704. #
  3705. # DIRECTORY: panda/src/pnmtext/
  3706. #
  3707. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3708. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3709. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3710. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3711. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3712. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3713. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3714. #
  3715. # DIRECTORY: panda/src/text/
  3716. #
  3717. if (not RUNTIME):
  3718. if not PkgSkip("HARFBUZZ"):
  3719. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3720. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3721. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3722. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3723. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3724. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3725. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3726. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3727. #
  3728. # DIRECTORY: panda/src/movies/
  3729. #
  3730. if (not RUNTIME):
  3731. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3732. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3733. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3734. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3735. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3736. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3737. #
  3738. # DIRECTORY: panda/src/grutil/
  3739. #
  3740. if (not RUNTIME):
  3741. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3742. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3743. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3744. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3745. OPTS=['DIR:panda/src/grutil']
  3746. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3747. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3748. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3749. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3750. #
  3751. # DIRECTORY: panda/src/tform/
  3752. #
  3753. if (not RUNTIME):
  3754. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3755. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3756. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3757. OPTS=['DIR:panda/src/tform']
  3758. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3759. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3760. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3761. #
  3762. # DIRECTORY: panda/src/collide/
  3763. #
  3764. if (not RUNTIME):
  3765. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3766. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3767. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3768. OPTS=['DIR:panda/src/collide']
  3769. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3770. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3771. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3772. #
  3773. # DIRECTORY: panda/src/parametrics/
  3774. #
  3775. if (not RUNTIME):
  3776. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3777. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3778. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3779. OPTS=['DIR:panda/src/parametrics']
  3780. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3781. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3782. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3783. #
  3784. # DIRECTORY: panda/src/pgui/
  3785. #
  3786. if (not RUNTIME):
  3787. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3788. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3789. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3790. OPTS=['DIR:panda/src/pgui']
  3791. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3792. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3793. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3794. #
  3795. # DIRECTORY: panda/src/pnmimagetypes/
  3796. #
  3797. if (not RUNTIME):
  3798. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3799. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3800. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3801. #
  3802. # DIRECTORY: panda/src/recorder/
  3803. #
  3804. if (not RUNTIME):
  3805. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3806. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3807. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3808. OPTS=['DIR:panda/src/recorder']
  3809. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3810. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3811. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3812. #
  3813. # DIRECTORY: panda/src/dxml/
  3814. #
  3815. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3816. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3817. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3818. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3819. if (not RUNTIME):
  3820. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3821. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3822. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3823. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3824. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3825. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3826. #
  3827. # DIRECTORY: panda/metalibs/panda/
  3828. #
  3829. if (not RUNTIME):
  3830. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3831. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3832. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3833. 'SETUPAPI']
  3834. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3835. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3836. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3837. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3838. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3839. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3840. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3841. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3842. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3843. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3844. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3845. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3846. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3847. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3848. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3849. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3850. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3851. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3852. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3853. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3854. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3855. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3856. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3857. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3858. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3859. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3860. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3861. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3862. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3863. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3864. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3865. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3866. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3867. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3868. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3869. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3870. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3871. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3872. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3873. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3874. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3875. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3876. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3877. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3878. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3879. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3880. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3881. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3882. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3883. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3884. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3885. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3886. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3887. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3888. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3889. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3890. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3891. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3892. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3893. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3894. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3895. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3896. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3897. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3898. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3899. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3900. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3901. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3902. if PkgSkip("FREETYPE")==0:
  3903. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3904. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3905. TargetAdd('libpanda.dll', opts=OPTS)
  3906. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3907. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3908. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3909. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3910. PyTargetAdd('core_module.obj', input='libp3express.in')
  3911. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3912. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3913. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3914. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3915. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3916. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3917. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3918. PyTargetAdd('core_module.obj', input='libp3char.in')
  3919. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3920. PyTargetAdd('core_module.obj', input='libp3device.in')
  3921. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  3922. PyTargetAdd('core_module.obj', input='libp3display.in')
  3923. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  3924. PyTargetAdd('core_module.obj', input='libp3event.in')
  3925. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  3926. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  3927. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  3928. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  3929. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  3930. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  3931. PyTargetAdd('core_module.obj', input='libp3text.in')
  3932. PyTargetAdd('core_module.obj', input='libp3tform.in')
  3933. PyTargetAdd('core_module.obj', input='libp3putil.in')
  3934. PyTargetAdd('core_module.obj', input='libp3audio.in')
  3935. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  3936. PyTargetAdd('core_module.obj', input='libp3net.in')
  3937. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  3938. PyTargetAdd('core_module.obj', input='libp3movies.in')
  3939. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  3940. if PkgSkip("FREETYPE")==0:
  3941. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  3942. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  3943. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  3944. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  3945. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  3946. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  3947. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  3948. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  3949. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  3950. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  3951. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  3952. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  3953. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  3954. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  3955. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  3956. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  3957. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  3958. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  3959. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  3960. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  3961. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  3962. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  3963. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  3964. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  3965. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  3966. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  3967. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  3968. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  3969. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  3970. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  3971. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  3972. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  3973. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  3974. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  3975. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  3976. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  3977. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  3978. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  3979. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  3980. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  3981. if PkgSkip("FREETYPE")==0:
  3982. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  3983. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  3984. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  3985. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  3986. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  3987. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  3988. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  3989. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  3990. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  3991. PyTargetAdd('core.pyd', input='core_module.obj')
  3992. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  3993. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  3994. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  3995. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  3996. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  3997. #
  3998. # DIRECTORY: panda/src/vision/
  3999. #
  4000. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4001. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4002. if not PkgSkip("FFMPEG"):
  4003. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4004. if not PkgSkip("OPENCV"):
  4005. DefSymbol("OPENCV", "HAVE_OPENCV")
  4006. if OPENCV_VER_23:
  4007. DefSymbol("OPENCV", "OPENCV_VER_23")
  4008. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4009. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4010. 'dtool_have_ffmpeg.dat',
  4011. 'dtool_have_opencv.dat',
  4012. 'dtool_have_directcam.dat',
  4013. ])
  4014. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4015. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4016. TargetAdd('libp3vision.dll', opts=OPTS)
  4017. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4018. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4019. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4020. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4021. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4022. PyTargetAdd('vision_module.obj', opts=OPTS)
  4023. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4024. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4025. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4026. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4027. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4028. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4029. #
  4030. # DIRECTORY: panda/src/rocket/
  4031. #
  4032. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4033. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4034. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4035. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4036. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4037. TargetAdd('libp3rocket.dll', opts=OPTS)
  4038. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4039. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4040. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4041. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4042. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4043. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4044. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4045. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4046. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4047. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4048. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4049. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4050. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4051. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4052. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4053. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4054. #
  4055. # DIRECTORY: panda/src/p3skel
  4056. #
  4057. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4058. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4059. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4060. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4061. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4062. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4063. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4064. #
  4065. # DIRECTORY: panda/src/p3skel
  4066. #
  4067. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4068. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4069. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4070. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4071. TargetAdd('libpandaskel.dll', opts=OPTS)
  4072. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4073. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4074. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4075. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4076. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4077. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4078. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4079. #
  4080. # DIRECTORY: panda/src/distort/
  4081. #
  4082. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4083. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4084. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4085. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4086. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4087. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4088. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4089. #
  4090. # DIRECTORY: panda/metalibs/pandafx/
  4091. #
  4092. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4093. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4094. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4095. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4096. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4097. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4098. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4099. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4100. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4101. PyTargetAdd('fx_module.obj', opts=OPTS)
  4102. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4103. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4104. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4105. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4106. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4107. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4108. #
  4109. # DIRECTORY: panda/src/vrpn/
  4110. #
  4111. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4112. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4113. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4114. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4115. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4116. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4117. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4118. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4119. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4120. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4121. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4122. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4123. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4124. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4125. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4126. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4127. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4128. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4129. #
  4130. # DIRECTORY: panda/src/ffmpeg
  4131. #
  4132. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4133. if not PkgSkip("SWSCALE"):
  4134. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4135. if not PkgSkip("SWRESAMPLE"):
  4136. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4137. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4138. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4139. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4140. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4141. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4142. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4143. #
  4144. # DIRECTORY: panda/src/audiotraits/
  4145. #
  4146. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4147. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4148. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4149. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4150. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4151. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4152. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4153. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4154. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4155. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4156. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4157. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4158. #
  4159. # DIRECTORY: panda/src/downloadertools/
  4160. #
  4161. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4162. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4163. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4164. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4165. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4166. TargetAdd('apply_patch.exe', opts=OPTS)
  4167. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4168. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4169. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4170. TargetAdd('build_patch.exe', opts=OPTS)
  4171. if not PkgSkip("ZLIB"):
  4172. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4173. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4174. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4175. TargetAdd('check_adler.exe', opts=OPTS)
  4176. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4177. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4178. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4179. TargetAdd('check_crc.exe', opts=OPTS)
  4180. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4181. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4182. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4183. TargetAdd('check_md5.exe', opts=OPTS)
  4184. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4185. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4186. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4187. TargetAdd('pdecrypt.exe', opts=OPTS)
  4188. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4189. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4190. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4191. TargetAdd('pencrypt.exe', opts=OPTS)
  4192. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4193. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4194. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4195. TargetAdd('show_ddb.exe', opts=OPTS)
  4196. #
  4197. # DIRECTORY: panda/src/downloadertools/
  4198. #
  4199. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4200. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4201. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4202. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4203. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4204. TargetAdd('multify.exe', opts=OPTS)
  4205. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4206. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4207. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4208. TargetAdd('pzip.exe', opts=OPTS)
  4209. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4210. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4211. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4212. TargetAdd('punzip.exe', opts=OPTS)
  4213. #
  4214. # DIRECTORY: panda/src/windisplay/
  4215. #
  4216. if (GetTarget() == 'windows' and not RUNTIME):
  4217. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4218. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4219. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4220. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4221. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4222. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4223. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4224. #
  4225. # DIRECTORY: panda/metalibs/pandadx9/
  4226. #
  4227. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4228. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4229. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4230. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4231. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4232. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4233. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4234. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4235. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4236. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4237. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4238. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4239. #
  4240. # DIRECTORY: panda/src/egg/
  4241. #
  4242. if not RUNTIME and not PkgSkip("EGG"):
  4243. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI']
  4244. CreateFile(GetOutputDir()+"/include/parser.h")
  4245. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4246. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4247. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4248. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4249. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4250. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4251. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4252. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4253. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4254. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4255. PyTargetAdd('p3egg_eggGroupNode_ext.obj', opts=OPTS, input='eggGroupNode_ext.cxx')
  4256. #
  4257. # DIRECTORY: panda/src/egg2pg/
  4258. #
  4259. if not RUNTIME and not PkgSkip("EGG"):
  4260. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4261. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4262. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4263. OPTS=['DIR:panda/src/egg2pg']
  4264. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4265. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4266. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4267. #
  4268. # DIRECTORY: panda/src/framework/
  4269. #
  4270. if (not RUNTIME):
  4271. deps = []
  4272. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4273. if GetLinkAllStatic():
  4274. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4275. if not PkgSkip("GL"):
  4276. DefSymbol("FRAMEWORK", "HAVE_GL")
  4277. if not PkgSkip("TINYDISPLAY"):
  4278. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4279. if not PkgSkip("EGG"):
  4280. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4281. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4282. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4283. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4284. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4285. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4286. #
  4287. # DIRECTORY: panda/src/glgsg/
  4288. #
  4289. if (not RUNTIME and PkgSkip("GL")==0):
  4290. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4291. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4292. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4293. #
  4294. # DIRECTORY: panda/src/glesgsg/
  4295. #
  4296. if (not RUNTIME and PkgSkip("GLES")==0):
  4297. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4298. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4299. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4300. #
  4301. # DIRECTORY: panda/src/gles2gsg/
  4302. #
  4303. if (not RUNTIME and PkgSkip("GLES2")==0):
  4304. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4305. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4306. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4307. #
  4308. # DIRECTORY: panda/metalibs/pandaegg/
  4309. #
  4310. if not RUNTIME and not PkgSkip("EGG"):
  4311. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4312. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4313. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4314. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4315. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4316. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4317. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4318. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4319. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4320. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4321. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4322. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4323. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4324. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4325. PyTargetAdd('egg_module.obj', opts=OPTS)
  4326. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4327. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4328. PyTargetAdd('egg.pyd', input='p3egg_eggGroupNode_ext.obj')
  4329. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4330. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4331. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4332. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4333. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4334. #
  4335. # DIRECTORY: panda/src/x11display/
  4336. #
  4337. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4338. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4339. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4340. #
  4341. # DIRECTORY: panda/src/glxdisplay/
  4342. #
  4343. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4344. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4345. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4346. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4347. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4348. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4349. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4350. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4351. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4352. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4353. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4354. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4355. #
  4356. # DIRECTORY: panda/src/cocoadisplay/
  4357. #
  4358. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4359. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4360. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4361. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4362. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4363. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4364. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4365. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4366. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4367. if (PkgSkip('PANDAFX')==0):
  4368. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4369. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4370. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4371. #
  4372. # DIRECTORY: panda/src/osxdisplay/
  4373. #
  4374. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4375. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4376. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4377. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4378. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4379. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4380. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4381. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4382. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4383. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4384. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4385. if (PkgSkip('PANDAFX')==0):
  4386. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4387. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4388. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4389. #
  4390. # DIRECTORY: panda/src/wgldisplay/
  4391. #
  4392. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4393. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4394. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4395. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4396. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4397. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4398. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4399. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4400. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4401. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4402. if (PkgSkip('PANDAFX')==0):
  4403. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4404. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4405. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4406. #
  4407. # DIRECTORY: panda/src/egldisplay/
  4408. #
  4409. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4410. DefSymbol('GLES', 'OPENGLES_1', '')
  4411. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4412. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4413. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4414. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4415. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4416. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4417. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4418. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4419. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4420. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4421. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4422. #
  4423. # DIRECTORY: panda/src/egldisplay/
  4424. #
  4425. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4426. DefSymbol('GLES2', 'OPENGLES_2', '')
  4427. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4428. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4429. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4430. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4431. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4432. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4433. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4434. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4435. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4436. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4437. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4438. #
  4439. # DIRECTORY: panda/src/ode/
  4440. #
  4441. if (PkgSkip("ODE")==0 and not RUNTIME):
  4442. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4443. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4444. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4445. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4446. OPTS=['DIR:panda/src/ode', 'ODE']
  4447. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4448. IGATEFILES.remove("odeConvexGeom.h")
  4449. IGATEFILES.remove("odeHelperStructs.h")
  4450. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4451. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4452. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4453. #
  4454. # DIRECTORY: panda/metalibs/pandaode/
  4455. #
  4456. if (PkgSkip("ODE")==0 and not RUNTIME):
  4457. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4458. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4459. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4460. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4461. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4462. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4463. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4464. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4465. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4466. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4467. PyTargetAdd('ode_module.obj', opts=OPTS)
  4468. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4469. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4470. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4471. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4472. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4473. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4474. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4475. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4476. #
  4477. # DIRECTORY: panda/src/bullet/
  4478. #
  4479. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4480. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4481. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4482. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4483. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4484. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4485. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4486. #
  4487. # DIRECTORY: panda/metalibs/pandabullet/
  4488. #
  4489. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4490. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4491. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4492. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4493. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4494. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4495. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4496. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4497. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4498. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4499. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4500. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4501. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4502. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4503. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4504. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4505. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4506. #
  4507. # DIRECTORY: panda/src/physx/
  4508. #
  4509. if (PkgSkip("PHYSX")==0):
  4510. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4511. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4512. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4513. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4514. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4515. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4516. #
  4517. # DIRECTORY: panda/metalibs/pandaphysx/
  4518. #
  4519. if (PkgSkip("PHYSX")==0):
  4520. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4521. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4522. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4523. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4524. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4525. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4526. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4527. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4528. PyTargetAdd('physx_module.obj', opts=OPTS)
  4529. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4530. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4531. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4532. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4533. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4534. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4535. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4536. #
  4537. # DIRECTORY: panda/src/physics/
  4538. #
  4539. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4540. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4541. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4542. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4543. OPTS=['DIR:panda/src/physics']
  4544. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4545. IGATEFILES.remove("forces.h")
  4546. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4547. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4548. #
  4549. # DIRECTORY: panda/src/particlesystem/
  4550. #
  4551. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4552. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4553. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4554. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4555. OPTS=['DIR:panda/src/particlesystem']
  4556. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4557. IGATEFILES.remove('orientedParticle.h')
  4558. IGATEFILES.remove('orientedParticleFactory.h')
  4559. IGATEFILES.remove('particlefactories.h')
  4560. IGATEFILES.remove('emitters.h')
  4561. IGATEFILES.remove('particles.h')
  4562. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4563. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4564. #
  4565. # DIRECTORY: panda/metalibs/pandaphysics/
  4566. #
  4567. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4568. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4569. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4570. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4571. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4572. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4573. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4574. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4575. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4576. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4577. OPTS=['DIR:panda/metalibs/pandaphysics']
  4578. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4579. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4580. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4581. PyTargetAdd('physics_module.obj', opts=OPTS)
  4582. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4583. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4584. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4585. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4586. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4587. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4588. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4589. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4590. #
  4591. # DIRECTORY: panda/src/speedtree/
  4592. #
  4593. if (PkgSkip("SPEEDTREE")==0):
  4594. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4595. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4596. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4597. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4598. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4599. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4600. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4601. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4602. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4603. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4604. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4605. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4606. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4607. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4608. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4609. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4610. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4611. #
  4612. # DIRECTORY: panda/src/testbed/
  4613. #
  4614. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4615. OPTS=['DIR:panda/src/testbed']
  4616. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4617. TargetAdd('pview.exe', input='pview_pview.obj')
  4618. TargetAdd('pview.exe', input='libp3framework.dll')
  4619. if not PkgSkip("EGG"):
  4620. TargetAdd('pview.exe', input='libpandaegg.dll')
  4621. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4622. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4623. if GetLinkAllStatic() and not PkgSkip("GL"):
  4624. TargetAdd('pview.exe', input='libpandagl.dll')
  4625. #
  4626. # DIRECTORY: panda/src/android/
  4627. #
  4628. if (not RUNTIME and GetTarget() == 'android'):
  4629. OPTS=['DIR:panda/src/android']
  4630. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4631. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4632. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4633. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4634. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4635. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4636. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4637. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4638. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4639. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4640. if (not RTDIST and PkgSkip("PVIEW")==0):
  4641. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4642. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4643. TargetAdd('libpview.dll', input='android_main.obj')
  4644. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4645. TargetAdd('libpview.dll', input='libp3framework.dll')
  4646. if not PkgSkip("EGG"):
  4647. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4648. TargetAdd('libpview.dll', input='libp3android.dll')
  4649. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4650. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4651. if (not RTDIST and PkgSkip("PYTHON")==0):
  4652. OPTS += ['PYTHON']
  4653. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4654. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4655. TargetAdd('libppython.dll', input='android_main.obj')
  4656. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4657. TargetAdd('libppython.dll', input='libp3framework.dll')
  4658. TargetAdd('libppython.dll', input='libp3android.dll')
  4659. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4660. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4661. #
  4662. # DIRECTORY: panda/src/androiddisplay/
  4663. #
  4664. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4665. DefSymbol('GLES', 'OPENGLES_1', '')
  4666. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4667. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4668. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4669. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4670. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4671. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4672. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4673. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4674. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4675. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4676. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4677. #
  4678. # DIRECTORY: panda/src/tinydisplay/
  4679. #
  4680. if (not RUNTIME and (GetTarget() in ('windows', 'darwin') or PkgSkip("X11")==0) and PkgSkip("TINYDISPLAY")==0):
  4681. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY', 'X11']
  4682. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4683. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4684. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4685. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4686. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4687. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4688. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4689. if GetTarget() == 'darwin':
  4690. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4691. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4692. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4693. elif GetTarget() == 'windows':
  4694. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4695. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4696. else:
  4697. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4698. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4699. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4700. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4701. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4702. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4703. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4704. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4705. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4706. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4707. #
  4708. # DIRECTORY: direct/src/directbase/
  4709. #
  4710. if (PkgSkip("DIRECT")==0):
  4711. OPTS=['DIR:direct/src/directbase']
  4712. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4713. #
  4714. # DIRECTORY: direct/src/dcparser/
  4715. #
  4716. if (PkgSkip("DIRECT")==0):
  4717. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4718. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4719. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4720. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4721. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4722. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4723. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4724. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4725. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4726. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4727. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4728. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4729. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4730. #
  4731. # DIRECTORY: direct/src/deadrec/
  4732. #
  4733. if (PkgSkip("DIRECT")==0):
  4734. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4735. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4736. OPTS=['DIR:direct/src/deadrec']
  4737. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4738. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4739. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4740. #
  4741. # DIRECTORY: direct/src/distributed/
  4742. #
  4743. if (PkgSkip("DIRECT")==0):
  4744. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4745. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4746. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4747. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4748. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4749. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4750. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4751. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4752. #
  4753. # DIRECTORY: direct/src/interval/
  4754. #
  4755. if (PkgSkip("DIRECT")==0):
  4756. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4757. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4758. OPTS=['DIR:direct/src/interval']
  4759. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4760. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4761. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4762. #
  4763. # DIRECTORY: direct/src/showbase/
  4764. #
  4765. if (PkgSkip("DIRECT")==0):
  4766. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4767. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4768. if GetTarget() == 'darwin':
  4769. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4770. OPTS=['DIR:direct/src/showbase']
  4771. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4772. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4773. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4774. #
  4775. # DIRECTORY: direct/src/motiontrail/
  4776. #
  4777. if (PkgSkip("DIRECT")==0):
  4778. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4779. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4780. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4781. OPTS=['DIR:direct/src/motiontrail']
  4782. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4783. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4784. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4785. #
  4786. # DIRECTORY: direct/metalibs/direct/
  4787. #
  4788. if (PkgSkip("DIRECT")==0):
  4789. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4790. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4791. if GetTarget() == 'darwin':
  4792. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4793. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4794. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4795. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4796. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4797. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4798. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4799. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4800. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4801. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4802. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4803. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4804. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4805. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4806. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4807. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4808. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4809. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4810. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4811. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4812. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4813. # the Python libraries. If a C++ user needs these modules, we can move them
  4814. # back and filter out the Python-specific code.
  4815. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4816. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4817. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4818. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4819. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4820. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4821. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4822. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4823. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4824. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4825. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4826. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4827. #
  4828. # DIRECTORY: direct/src/dcparse/
  4829. #
  4830. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4831. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4832. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4833. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4834. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4835. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4836. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4837. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4838. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4839. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4840. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4841. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4842. #
  4843. # DIRECTORY: direct/src/plugin/
  4844. #
  4845. if (RTDIST or RUNTIME):
  4846. # Explicitly define this as we don't include dtool_config.h here.
  4847. if GetTarget() not in ('windows', 'darwin'):
  4848. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4849. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4850. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4851. OPTS += ['ZLIB', 'MSIMG']
  4852. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4853. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4854. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4855. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4856. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4857. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4858. if GetTarget() == 'darwin':
  4859. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4860. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4861. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4862. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4863. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4864. if (RTDIST):
  4865. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4866. TargetAdd(fname, input='plugin_plugin.obj')
  4867. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4868. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4869. TargetAdd(fname, input='plugin_parse_color.obj')
  4870. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4871. if GetTarget() == 'darwin':
  4872. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4873. TargetAdd(fname, input='plugin_fileSpec.obj')
  4874. TargetAdd(fname, input='plugin_binaryXml.obj')
  4875. TargetAdd(fname, input='plugin_handleStream.obj')
  4876. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4877. TargetAdd(fname, input='libp3tinyxml.ilb')
  4878. if GetTarget() == 'darwin':
  4879. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4880. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4881. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4882. if (PkgSkip("PYTHON")==0 and RTDIST):
  4883. # Freeze VFSImporter and its dependency modules into p3dpython.
  4884. # Mark panda3d.core as a dependency to make sure to build that first.
  4885. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  4886. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  4887. OPTS += ['PYTHON']
  4888. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4889. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4890. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  4891. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  4892. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  4893. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  4894. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  4895. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  4896. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  4897. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  4898. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  4899. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  4900. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  4901. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  4902. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  4903. if GetTarget() == 'windows':
  4904. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  4905. OPTS.append("NON_CONSOLE")
  4906. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  4907. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  4908. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  4909. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  4910. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  4911. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  4912. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  4913. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  4914. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  4915. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  4916. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  4917. if GetTarget() == 'darwin':
  4918. OPTS += ['OPT:2']
  4919. if (PkgSkip("FLTK")==0):
  4920. OPTS.append("FLTK")
  4921. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  4922. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  4923. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4924. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4925. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4926. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  4927. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  4928. if GetTarget() == 'darwin':
  4929. OPTS += ['OPT:2']
  4930. TargetAdd('p3dcert.exe', opts=OPTS)
  4931. elif (PkgSkip("WX")==0):
  4932. OPTS += ["WX", "RTTI"]
  4933. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  4934. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  4935. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  4936. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  4937. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  4938. if GetTarget() == "darwin":
  4939. OPTS += ['GL', 'OPT:2']
  4940. TargetAdd('p3dcert.exe', opts=OPTS)
  4941. #
  4942. # DIRECTORY: direct/src/plugin_npapi/
  4943. #
  4944. if RUNTIME:
  4945. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  4946. if GetTarget() == 'windows':
  4947. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  4948. "version" : VERSION,
  4949. "description" : "Runs 3-D games and interactive applets",
  4950. "filename" : "nppanda3d.dll",
  4951. "mimetype" : "application/x-panda3d",
  4952. "extension" : "p3d",
  4953. "filedesc" : "Panda3D applet"}
  4954. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  4955. elif GetTarget() == 'darwin':
  4956. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  4957. OPTS += ['GTK2']
  4958. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  4959. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  4960. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  4961. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  4962. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  4963. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  4964. if GetTarget() == 'windows':
  4965. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  4966. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  4967. elif GetTarget() == 'darwin':
  4968. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  4969. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  4970. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  4971. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  4972. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  4973. #
  4974. # DIRECTORY: direct/src/plugin_activex/
  4975. #
  4976. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  4977. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  4978. DefSymbol('ACTIVEX', '_USRDLL', '')
  4979. DefSymbol('ACTIVEX', '_WINDLL', '')
  4980. DefSymbol('ACTIVEX', '_AFXDLL', '')
  4981. DefSymbol('ACTIVEX', '_MBCS', '')
  4982. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  4983. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  4984. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  4985. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  4986. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  4987. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  4988. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  4989. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  4990. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  4991. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  4992. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  4993. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  4994. #
  4995. # DIRECTORY: direct/src/plugin_standalone/
  4996. #
  4997. if (RUNTIME):
  4998. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  4999. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5000. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5001. if GetTarget() == 'windows':
  5002. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5003. "version" : VERSION,
  5004. "description" : "Runs 3-D games and interactive applets",
  5005. "filename" : "panda3d.exe",
  5006. "mimetype" : "application/x-panda3d",
  5007. "extension" : "p3d",
  5008. "filedesc" : "Panda3D applet",
  5009. "icon" : "panda3d.ico"}
  5010. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5011. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5012. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5013. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5014. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5015. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5016. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5017. if GetTarget() == 'darwin':
  5018. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5019. elif GetTarget() == 'windows':
  5020. TargetAdd('panda3d.exe', input='panda3d.res')
  5021. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5022. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5023. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5024. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5025. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5026. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5027. if (GetTarget() == 'darwin'):
  5028. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5029. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5030. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5031. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5032. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5033. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5034. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5035. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5036. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5037. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5038. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5039. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5040. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5041. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5042. elif (GetTarget() == 'windows'):
  5043. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5044. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5045. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5046. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5047. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5048. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5049. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5050. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5051. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5052. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5053. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5054. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5055. if (RTDIST):
  5056. 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']
  5057. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5058. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5059. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5060. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5061. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5062. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5063. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5064. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5065. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5066. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5067. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5068. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5069. if (GetTarget() == 'darwin'):
  5070. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5071. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5072. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5073. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5074. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5075. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5076. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5077. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5078. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5079. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5080. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5081. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5082. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5083. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5084. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5085. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5086. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5087. if GetTarget() == 'darwin':
  5088. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5089. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5090. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5091. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5092. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5093. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5094. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5095. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5096. if GetTarget() == 'darwin':
  5097. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5098. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5099. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5100. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5101. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5102. if GetTarget() == 'windows':
  5103. OPTS.append("P3DEMBEDW")
  5104. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5105. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5106. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5107. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5108. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5109. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5110. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5111. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5112. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5113. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5114. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5115. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5116. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5117. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5118. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5119. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5120. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5121. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5122. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5123. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5124. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5125. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5126. #
  5127. # DIRECTORY: pandatool/src/pandatoolbase/
  5128. #
  5129. if (PkgSkip("PANDATOOL")==0):
  5130. OPTS=['DIR:pandatool/src/pandatoolbase']
  5131. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5132. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5133. #
  5134. # DIRECTORY: pandatool/src/converter/
  5135. #
  5136. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5137. OPTS=['DIR:pandatool/src/converter']
  5138. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5139. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5140. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5141. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5142. #
  5143. # DIRECTORY: pandatool/src/progbase/
  5144. #
  5145. if not PkgSkip("PANDATOOL"):
  5146. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5147. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5148. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5149. #
  5150. # DIRECTORY: pandatool/src/eggbase/
  5151. #
  5152. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5153. OPTS=['DIR:pandatool/src/eggbase']
  5154. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5155. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5156. #
  5157. # DIRECTORY: pandatool/src/bam/
  5158. #
  5159. if not PkgSkip("PANDATOOL"):
  5160. OPTS=['DIR:pandatool/src/bam']
  5161. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5162. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5163. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5164. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5165. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5166. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5167. if not PkgSkip("EGG"):
  5168. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5169. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5170. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5171. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5172. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5173. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5174. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5175. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5176. #
  5177. # DIRECTORY: pandatool/src/cvscopy/
  5178. #
  5179. if not PkgSkip("PANDATOOL"):
  5180. OPTS=['DIR:pandatool/src/cvscopy']
  5181. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5182. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5183. #
  5184. # DIRECTORY: pandatool/src/daeegg/
  5185. #
  5186. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5187. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5188. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5189. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5190. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5191. #
  5192. # DIRECTORY: pandatool/src/assimp
  5193. #
  5194. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5195. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5196. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5197. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5198. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5199. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5200. #
  5201. # DIRECTORY: pandatool/src/daeprogs/
  5202. #
  5203. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5204. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5205. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5206. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5207. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5208. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5209. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5210. #
  5211. # DIRECTORY: pandatool/src/dxf/
  5212. #
  5213. if not PkgSkip("PANDATOOL"):
  5214. OPTS=['DIR:pandatool/src/dxf']
  5215. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5216. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5217. #
  5218. # DIRECTORY: pandatool/src/dxfegg/
  5219. #
  5220. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5221. OPTS=['DIR:pandatool/src/dxfegg']
  5222. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5223. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5224. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5225. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5226. #
  5227. # DIRECTORY: pandatool/src/dxfprogs/
  5228. #
  5229. if not PkgSkip("PANDATOOL"):
  5230. OPTS=['DIR:pandatool/src/dxfprogs']
  5231. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5232. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5233. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5234. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5235. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5236. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5237. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5238. if not PkgSkip("EGG"):
  5239. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5240. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5241. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5242. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5243. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5244. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5245. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5246. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5247. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5248. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5249. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5250. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5251. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5252. #
  5253. # DIRECTORY: pandatool/src/objegg/
  5254. #
  5255. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5256. OPTS=['DIR:pandatool/src/objegg']
  5257. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5258. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5259. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5260. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5261. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5262. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5263. #
  5264. # DIRECTORY: pandatool/src/objprogs/
  5265. #
  5266. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5267. OPTS=['DIR:pandatool/src/objprogs']
  5268. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5269. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5270. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5271. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5272. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5273. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5274. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5275. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5276. #
  5277. # DIRECTORY: pandatool/src/palettizer/
  5278. #
  5279. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5280. OPTS=['DIR:pandatool/src/palettizer']
  5281. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5282. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5283. #
  5284. # DIRECTORY: pandatool/src/egg-mkfont/
  5285. #
  5286. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5287. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5288. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5289. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5290. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5291. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5292. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5293. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5294. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5295. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5296. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5297. #
  5298. # DIRECTORY: pandatool/src/eggcharbase/
  5299. #
  5300. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5301. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5302. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5303. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5304. #
  5305. # DIRECTORY: pandatool/src/egg-optchar/
  5306. #
  5307. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5308. OPTS=['DIR:pandatool/src/egg-optchar']
  5309. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5310. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5311. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5312. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5313. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5314. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5315. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5316. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5317. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5318. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5319. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5320. #
  5321. # DIRECTORY: pandatool/src/egg-palettize/
  5322. #
  5323. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5324. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5325. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5326. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5327. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5328. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5329. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5330. #
  5331. # DIRECTORY: pandatool/src/egg-qtess/
  5332. #
  5333. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5334. OPTS=['DIR:pandatool/src/egg-qtess']
  5335. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5336. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5337. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5338. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5339. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5340. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5341. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5342. #
  5343. # DIRECTORY: pandatool/src/eggprogs/
  5344. #
  5345. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5346. OPTS=['DIR:pandatool/src/eggprogs']
  5347. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5348. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5349. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5350. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5351. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5352. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5353. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5354. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5355. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5356. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5357. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5358. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5359. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5360. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5361. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5362. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5363. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5364. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5365. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5366. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5367. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5368. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5369. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5370. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5371. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5372. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5373. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5374. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5375. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5376. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5377. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5378. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5379. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5380. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5381. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5382. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5383. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5384. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5385. #
  5386. # DIRECTORY: pandatool/src/flt/
  5387. #
  5388. if not PkgSkip("PANDATOOL"):
  5389. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5390. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5391. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5392. #
  5393. # DIRECTORY: pandatool/src/fltegg/
  5394. #
  5395. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5396. OPTS=['DIR:pandatool/src/fltegg']
  5397. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5398. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5399. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5400. #
  5401. # DIRECTORY: pandatool/src/fltprogs/
  5402. #
  5403. if not PkgSkip("PANDATOOL"):
  5404. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5405. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5406. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5407. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5408. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5409. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5410. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5411. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5412. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5413. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5414. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5415. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5416. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5417. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5418. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5419. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5420. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5421. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5422. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5423. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5424. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5425. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5426. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5427. if not PkgSkip("EGG"):
  5428. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5429. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5430. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5431. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5432. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5433. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5434. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5435. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5436. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5437. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5438. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5439. #
  5440. # DIRECTORY: pandatool/src/imagebase/
  5441. #
  5442. if not PkgSkip("PANDATOOL"):
  5443. OPTS=['DIR:pandatool/src/imagebase']
  5444. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5445. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5446. #
  5447. # DIRECTORY: pandatool/src/imageprogs/
  5448. #
  5449. if not PkgSkip("PANDATOOL"):
  5450. OPTS=['DIR:pandatool/src/imageprogs']
  5451. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5452. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5453. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5454. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5455. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5456. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5457. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5458. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5459. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5460. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5461. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5462. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5463. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5464. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5465. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5466. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5467. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5468. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5469. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5470. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5471. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5472. #
  5473. # DIRECTORY: pandatool/src/pfmprogs/
  5474. #
  5475. if not PkgSkip("PANDATOOL"):
  5476. OPTS=['DIR:pandatool/src/pfmprogs']
  5477. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5478. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5479. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5480. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5481. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5482. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5483. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5484. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5485. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5486. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5487. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5488. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5489. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5490. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5491. #
  5492. # DIRECTORY: pandatool/src/lwo/
  5493. #
  5494. if not PkgSkip("PANDATOOL"):
  5495. OPTS=['DIR:pandatool/src/lwo']
  5496. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5497. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5498. #
  5499. # DIRECTORY: pandatool/src/lwoegg/
  5500. #
  5501. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5502. OPTS=['DIR:pandatool/src/lwoegg']
  5503. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5504. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5505. #
  5506. # DIRECTORY: pandatool/src/lwoprogs/
  5507. #
  5508. if not PkgSkip("PANDATOOL"):
  5509. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5510. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5511. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5512. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5513. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5514. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5515. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5516. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5517. if not PkgSkip("EGG"):
  5518. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5519. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5520. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5521. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5522. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5523. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5524. #
  5525. # DIRECTORY: pandatool/src/maya/
  5526. #
  5527. for VER in MAYAVERSIONS:
  5528. VNUM=VER[4:]
  5529. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5530. OPTS=['DIR:pandatool/src/maya', VER]
  5531. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5532. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5533. #
  5534. # DIRECTORY: pandatool/src/mayaegg/
  5535. #
  5536. for VER in MAYAVERSIONS:
  5537. VNUM=VER[4:]
  5538. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5539. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5540. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5541. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5542. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5543. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5544. #
  5545. # DIRECTORY: pandatool/src/maxegg/
  5546. #
  5547. for VER in MAXVERSIONS:
  5548. VNUM=VER[3:]
  5549. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5550. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5551. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5552. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5553. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5554. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5555. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5556. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5557. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5558. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5559. #
  5560. # DIRECTORY: pandatool/src/maxprogs/
  5561. #
  5562. for VER in MAXVERSIONS:
  5563. VNUM=VER[3:]
  5564. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5565. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5566. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5567. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5568. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5569. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5570. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5571. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5572. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5573. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5574. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5575. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5576. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5577. #
  5578. # DIRECTORY: pandatool/src/vrml/
  5579. #
  5580. if not PkgSkip("PANDATOOL"):
  5581. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5582. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5583. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5584. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5585. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5586. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5587. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5588. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5589. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5590. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5591. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5592. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5593. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5594. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5595. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5596. #
  5597. # DIRECTORY: pandatool/src/vrmlegg/
  5598. #
  5599. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5600. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5601. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5602. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5603. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5604. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5605. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5606. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5607. #
  5608. # DIRECTORY: pandatool/src/xfile/
  5609. #
  5610. if not PkgSkip("PANDATOOL"):
  5611. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5612. CreateFile(GetOutputDir()+"/include/xParser.h")
  5613. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5614. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5615. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5616. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5617. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5618. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5619. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5620. #
  5621. # DIRECTORY: pandatool/src/xfileegg/
  5622. #
  5623. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5624. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5625. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5626. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5627. #
  5628. # DIRECTORY: pandatool/src/ptloader/
  5629. #
  5630. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5631. if not PkgSkip("FCOLLADA"):
  5632. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5633. 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']
  5634. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5635. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5636. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5637. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5638. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5639. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5640. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5641. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5642. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5643. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5644. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5645. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5646. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5647. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5648. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5649. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5650. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5651. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5652. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5653. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5654. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5655. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5656. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5657. #
  5658. # DIRECTORY: pandatool/src/miscprogs/
  5659. #
  5660. # This is a bit of an esoteric tool, and it causes issues because
  5661. # it conflicts with tools of the same name in different packages.
  5662. #if (PkgSkip("PANDATOOL")==0):
  5663. # OPTS=['DIR:pandatool/src/miscprogs']
  5664. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5665. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5666. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5667. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5668. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5669. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5670. #
  5671. # DIRECTORY: pandatool/src/pstatserver/
  5672. #
  5673. if (PkgSkip("PANDATOOL")==0):
  5674. OPTS=['DIR:pandatool/src/pstatserver']
  5675. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5676. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5677. #
  5678. # DIRECTORY: pandatool/src/text-stats/
  5679. #
  5680. if (PkgSkip("PANDATOOL")==0):
  5681. OPTS=['DIR:pandatool/src/text-stats']
  5682. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5683. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5684. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5685. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5686. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5687. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5688. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5689. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5690. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5691. #
  5692. # DIRECTORY: pandatool/src/vrmlprogs/
  5693. #
  5694. if not PkgSkip("PANDATOOL"):
  5695. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5696. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5697. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5698. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5699. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5700. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5701. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5702. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5703. if not PkgSkip("EGG"):
  5704. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5705. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5706. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5707. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5708. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5709. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5710. #
  5711. # DIRECTORY: pandatool/src/win-stats/
  5712. # DIRECTORY: pandatool/src/gtk-stats/
  5713. #
  5714. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5715. if GetTarget() == 'windows':
  5716. OPTS=['DIR:pandatool/src/win-stats']
  5717. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5718. else:
  5719. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5720. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5721. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5722. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5723. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5724. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5725. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5726. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5727. #
  5728. # DIRECTORY: pandatool/src/xfileprogs/
  5729. #
  5730. if not PkgSkip("PANDATOOL"):
  5731. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5732. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5733. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5734. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5735. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5736. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5737. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5738. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5739. if not PkgSkip("EGG"):
  5740. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5741. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5742. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5743. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5744. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5745. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5746. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5747. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5748. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5749. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5750. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5751. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5752. #
  5753. # DIRECTORY: pandatool/src/mayaprogs/
  5754. #
  5755. for VER in MAYAVERSIONS:
  5756. VNUM = VER[4:]
  5757. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5758. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5759. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5760. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5761. continue
  5762. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5763. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5764. elif GetTarget() == 'darwin':
  5765. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5766. else:
  5767. ARCH_OPTS = []
  5768. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5769. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5770. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5771. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5772. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5773. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5774. #if GetTarget() == 'windows':
  5775. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5776. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5777. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5778. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5779. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5780. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5781. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5782. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5783. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5784. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5785. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5786. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5787. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5788. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5789. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5790. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5791. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5792. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5793. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5794. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5795. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5796. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5797. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5798. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5799. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5800. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5801. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5802. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5803. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5804. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5805. if GetTarget() == 'windows':
  5806. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5807. else:
  5808. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5809. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5810. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5811. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5812. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5813. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5814. if GetTarget() == 'windows':
  5815. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5816. else:
  5817. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5818. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5819. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5820. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5821. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5822. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5823. if GetTarget() == 'windows':
  5824. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5825. else:
  5826. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5827. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5828. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5829. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5830. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5831. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5832. if GetTarget() == 'windows':
  5833. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5834. else:
  5835. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5836. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5837. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5838. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5839. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5840. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5841. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5842. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5843. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5844. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5845. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5846. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5847. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5848. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5849. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5850. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5851. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5852. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5853. #
  5854. # DIRECTORY: contrib/src/ai/
  5855. #
  5856. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5857. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5858. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5859. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5860. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5861. OPTS=['DIR:contrib/src/ai']
  5862. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5863. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5864. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5865. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5866. PyTargetAdd('ai_module.obj', opts=OPTS)
  5867. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5868. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5869. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5870. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5871. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5872. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5873. #
  5874. # DIRECTORY: contrib/src/rplight/
  5875. #
  5876. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5877. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5878. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5879. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5880. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5881. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5882. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5883. PyTargetAdd('rplight_module.obj', opts=OPTS)
  5884. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  5885. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  5886. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  5887. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  5888. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  5889. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  5890. #
  5891. # DIRECTORY: pandatool/src/deploy-stub
  5892. #
  5893. if PkgSkip("PYTHON") == 0:
  5894. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  5895. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  5896. if GetTarget() == 'windows':
  5897. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  5898. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  5899. # Setup rpath so libs can be found in the same directory as the deployed game
  5900. LibName('DEPLOYSTUB', "-Wl,-rpath,\\$ORIGIN")
  5901. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  5902. LibName('DEPLOYSTUB', "-rdynamic")
  5903. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  5904. if GetTarget() == 'windows':
  5905. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  5906. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5907. if GetTarget() == 'windows':
  5908. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  5909. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  5910. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  5911. elif GetTarget() == 'darwin':
  5912. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  5913. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  5914. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  5915. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  5916. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  5917. #
  5918. # Generate the models directory and samples directory
  5919. #
  5920. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  5921. model_extensions = ["*.egg"]
  5922. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  5923. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  5924. model_extensions.append("*.flt")
  5925. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  5926. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5927. newname = model[:-4] + ".egg.pz"
  5928. else:
  5929. newname = model[:-4] + ".egg"
  5930. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  5931. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  5932. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5933. newname = model[:-4] + ".egg.pz"
  5934. else:
  5935. newname = model[:-4] + ".egg"
  5936. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  5937. for model in GetDirectoryContents("models", model_extensions):
  5938. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  5939. newname = model[:-4] + ".egg.pz"
  5940. else:
  5941. newname = model[:-4] + ".egg"
  5942. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  5943. if not PkgSkip("DIRECT") and not RUNTIME:
  5944. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  5945. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  5946. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  5947. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  5948. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  5949. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  5950. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  5951. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  5952. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  5953. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  5954. #
  5955. # Build the rtdist.
  5956. #
  5957. if (RTDIST):
  5958. OPTS=['DIR:direct/src/p3d']
  5959. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  5960. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  5961. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  5962. #
  5963. # If we have a host URL and distributor, we can make .p3d deployment tools.
  5964. #
  5965. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  5966. OPTS=['DIR:direct/src/p3d']
  5967. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  5968. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  5969. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  5970. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  5971. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  5972. ##########################################################################################
  5973. #
  5974. # Dependency-Based Distributed Build System.
  5975. #
  5976. ##########################################################################################
  5977. DEPENDENCYQUEUE=[]
  5978. for target in TARGET_LIST:
  5979. name = target.name
  5980. inputs = target.inputs
  5981. opts = target.opts
  5982. deps = target.deps
  5983. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  5984. def BuildWorker(taskqueue, donequeue):
  5985. while True:
  5986. try:
  5987. task = taskqueue.get(timeout=1)
  5988. except:
  5989. ProgressOutput(None, "Waiting for tasks...")
  5990. task = taskqueue.get()
  5991. sys.stdout.flush()
  5992. if (task == 0): return
  5993. try:
  5994. task[0](*task[1])
  5995. donequeue.put(task)
  5996. except:
  5997. donequeue.put(0)
  5998. def AllSourcesReady(task, pending):
  5999. sources = task[3]
  6000. for x in sources:
  6001. if (x in pending):
  6002. return 0
  6003. sources = task[1][1]
  6004. for x in sources:
  6005. if (x in pending):
  6006. return 0
  6007. altsources = task[4]
  6008. for x in altsources:
  6009. if (x in pending):
  6010. return 0
  6011. return 1
  6012. def ParallelMake(tasklist):
  6013. # Create the communication queues.
  6014. donequeue = queue.Queue()
  6015. taskqueue = queue.Queue()
  6016. # Build up a table listing all the pending targets
  6017. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6018. # task[2] = [name]
  6019. # task[3] = deps
  6020. # The python tool package, in particular fltegg seems to throw parallelmake off
  6021. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6022. # and another subpart to be built sequentially. The most time consuming part of the process
  6023. # is the c++ code generation anyways.
  6024. tasklist_seq = []
  6025. i = 0
  6026. while i < len(tasklist):
  6027. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6028. break
  6029. i += 1
  6030. if i < len(tasklist):
  6031. tasklist_seq = tasklist[i:]
  6032. tasklist = tasklist[:i]
  6033. iNumStartingTasks = len(tasklist)
  6034. pending = {}
  6035. for task in tasklist:
  6036. for target in task[2]:
  6037. pending[target] = 1
  6038. # Create the workers
  6039. for slave in range(THREADCOUNT):
  6040. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6041. th.setDaemon(1)
  6042. th.start()
  6043. # Feed tasks to the workers.
  6044. tasksqueued = 0
  6045. while True:
  6046. if (tasksqueued < THREADCOUNT):
  6047. extras = []
  6048. for task in tasklist:
  6049. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6050. if (NeedsBuild(task[2], task[3])):
  6051. tasksqueued += 1
  6052. taskqueue.put(task)
  6053. else:
  6054. for target in task[2]:
  6055. del pending[target]
  6056. else:
  6057. extras.append(task)
  6058. tasklist = extras
  6059. sys.stdout.flush()
  6060. if (tasksqueued == 0): break
  6061. donetask = donequeue.get()
  6062. if (donetask == 0):
  6063. exit("Build process aborting.")
  6064. sys.stdout.flush()
  6065. tasksqueued -= 1
  6066. JustBuilt(donetask[2], donetask[3])
  6067. for target in donetask[2]:
  6068. del pending[target]
  6069. # Kill the workers.
  6070. for slave in range(THREADCOUNT):
  6071. taskqueue.put(0)
  6072. # Make sure there aren't any unsatisfied tasks
  6073. if len(tasklist) > 0:
  6074. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6075. SequentialMake(tasklist_seq)
  6076. def SequentialMake(tasklist):
  6077. i = 0
  6078. for task in tasklist:
  6079. if (NeedsBuild(task[2], task[3])):
  6080. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6081. JustBuilt(task[2], task[3])
  6082. i += 1
  6083. def RunDependencyQueue(tasklist):
  6084. if (THREADCOUNT!=0):
  6085. ParallelMake(tasklist)
  6086. else:
  6087. SequentialMake(tasklist)
  6088. try:
  6089. RunDependencyQueue(DEPENDENCYQUEUE)
  6090. finally:
  6091. SaveDependencyCache()
  6092. # Run the test suite.
  6093. if RUNTESTS:
  6094. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6095. if sys.version_info >= (2, 6):
  6096. cmdstr += " -B"
  6097. cmdstr += " -m pytest tests"
  6098. if GetVerbose():
  6099. cmdstr += " --verbose"
  6100. oscmd(cmdstr)
  6101. # Write out information about the Python versions in the built dir.
  6102. python_version_info = GetCurrentPythonVersionInfo()
  6103. UpdatePythonVersionInfoFile(python_version_info)
  6104. ##########################################################################################
  6105. #
  6106. # The Installers
  6107. #
  6108. # Under windows, we can build an 'exe' package using NSIS
  6109. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6110. # Under OSX, we can make a 'dmg' package.
  6111. #
  6112. ##########################################################################################
  6113. if INSTALLER:
  6114. ProgressOutput(100.0, "Building installer")
  6115. from makepackage import MakeInstaller
  6116. # When using the --installer flag, only install for the current version.
  6117. python_versions = []
  6118. if python_version_info:
  6119. python_versions.append(python_version_info)
  6120. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6121. optimize=GetOptimize(), compressor=COMPRESSOR,
  6122. debversion=DEBVERSION, rpmrelease=RPMRELEASE,
  6123. runtime=RUNTIME, python_versions=python_versions)
  6124. if WHEEL:
  6125. ProgressOutput(100.0, "Building wheel")
  6126. from makewheel import makewheel
  6127. makewheel(WHLVERSION, GetOutputDir())
  6128. ##########################################################################################
  6129. #
  6130. # Print final status report.
  6131. #
  6132. ##########################################################################################
  6133. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6134. printStatus("Makepanda Final Status Report", WARNINGS)
  6135. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())