makepanda.py 317 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256
  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. RPMVERSION=None
  57. RPMRELEASE="1"
  58. GIT_COMMIT=None
  59. P3DSUFFIX=None
  60. MAJOR_VERSION=None
  61. COREAPI_VERSION=None
  62. PLUGIN_VERSION=None
  63. OSXTARGET=None
  64. OSX_ARCHS=[]
  65. HOST_URL=None
  66. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  67. STRDXSDKVERSION = 'default'
  68. WINDOWS_SDK = None
  69. MSVC_VERSION = None
  70. BOOUSEINTELCOMPILER = False
  71. OPENCV_VER_23 = False
  72. PLATFORM = None
  73. COPY_PYTHON = True
  74. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  75. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  76. PkgListSet(["PYTHON", "DIRECT", # Python support
  77. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  78. "EGL", # OpenGL (ES) integration
  79. "EIGEN", # Linear algebra acceleration
  80. "OPENAL", "FMODEX", # Audio playback
  81. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  82. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  83. "SPEEDTREE", # SpeedTree
  84. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  85. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  86. "FREETYPE", "HARFBUZZ", # Text rendering
  87. "VRPN", "OPENSSL", # Transport
  88. "FFTW", # Algorithm helpers
  89. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  90. "GTK2", # GTK2 is used for PStats on Unix
  91. "MFC", "WX", "FLTK", # Used for web plug-in only
  92. "ROCKET", # GUI libraries
  93. "CARBON", "COCOA", # macOS toolkits
  94. "X11", # Unix platform support
  95. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  96. "SKEL", # Example SKEL project
  97. "PANDAFX", # Some distortion special lenses
  98. "PANDAPARTICLESYSTEM", # Built in particle system
  99. "CONTRIB", # Experimental
  100. "SSE2", "NEON", # Compiler features
  101. "MIMALLOC", # Memory allocators
  102. ])
  103. CheckPandaSourceTree()
  104. def keyboardInterruptHandler(x,y):
  105. exit("keyboard interrupt")
  106. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  107. ########################################################################
  108. ##
  109. ## Command-line parser.
  110. ##
  111. ## You can type "makepanda --help" to see all the options.
  112. ##
  113. ########################################################################
  114. def usage(problem):
  115. if (problem):
  116. print("")
  117. print("Error parsing command-line input: %s" % (problem))
  118. print("")
  119. print("Makepanda generates a 'built' subdirectory containing a")
  120. print("compiled copy of Panda3D. Command-line arguments are:")
  121. print("")
  122. print(" --help (print the help message you're reading now)")
  123. print(" --verbose (print out more information)")
  124. print(" --runtime (build a runtime build instead of an SDK build)")
  125. print(" --tests (run the test suite)")
  126. print(" --installer (build an installer)")
  127. print(" --wheel (build a pip-installable .whl)")
  128. print(" --optimize X (optimization level can be 1,2,3,4)")
  129. print(" --version X (set the panda version number)")
  130. print(" --lzma (use lzma compression when building Windows installer)")
  131. print(" --distributor X (short string identifying the distributor of the build)")
  132. print(" --outputdir X (use the specified directory instead of 'built')")
  133. print(" --host URL (set the host url (runtime build only))")
  134. print(" --threads N (use the multithreaded build system. see manual)")
  135. print(" --osxtarget N (the macOS version number to build for (macOS only))")
  136. print(" --universal (build universal binaries (macOS only))")
  137. print(" --override \"O=V\" (override dtool_config/prc option value)")
  138. print(" --static (builds libraries for static linking)")
  139. print(" --target X (experimental cross-compilation (android only))")
  140. print(" --arch X (target architecture for cross-compilation)")
  141. print("")
  142. for pkg in PkgListGet():
  143. p = pkg.lower()
  144. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  145. if sys.platform != 'win32':
  146. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  147. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  148. print("")
  149. print(" --nothing (disable every third-party lib)")
  150. print(" --everything (enable every third-party lib)")
  151. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  152. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1, 10 or 11. Default is 7.1)")
  153. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)")
  154. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  155. print("")
  156. print("The simplest way to compile panda is to just type:")
  157. print("")
  158. print(" makepanda --everything")
  159. print("")
  160. os._exit(1)
  161. def parseopts(args):
  162. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  163. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  164. global DEBVERSION,WHLVERSION,RPMVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  165. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  166. global COPY_PYTHON
  167. # Options for which to display a deprecation warning.
  168. removedopts = [
  169. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  170. ]
  171. # All recognized options.
  172. longopts = [
  173. "help","distributor=","verbose","runtime","osxtarget=","tests",
  174. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  175. "version=","lzma","no-python","threads=","outputdir=","override=",
  176. "static","host=","debversion=","rpmversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  177. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  178. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  179. "cggl-incdir=", "cggl-libdir=",
  180. ] + removedopts
  181. anything = 0
  182. optimize = ""
  183. target = None
  184. target_archs = []
  185. universal = False
  186. clean_build = False
  187. for pkg in PkgListGet():
  188. longopts.append("use-" + pkg.lower())
  189. longopts.append("no-" + pkg.lower())
  190. longopts.append(pkg.lower() + "-incdir=")
  191. longopts.append(pkg.lower() + "-libdir=")
  192. try:
  193. opts, extras = getopt.getopt(args, "", longopts)
  194. for option, value in opts:
  195. if (option=="--help"): raise Exception
  196. elif (option=="--optimize"): optimize=value
  197. elif (option=="--installer"): INSTALLER=1
  198. elif (option=="--tests"): RUNTESTS=1
  199. elif (option=="--wheel"): WHEEL=1
  200. elif (option=="--verbose"): SetVerbose(True)
  201. elif (option=="--distributor"): DISTRIBUTOR=value
  202. elif (option=="--rtdist"): RTDIST=1
  203. elif (option=="--runtime"): RUNTIME=1
  204. elif (option=="--genman"): GENMAN=1
  205. elif (option=="--everything"): PkgEnableAll()
  206. elif (option=="--nothing"): PkgDisableAll()
  207. elif (option=="--threads"): THREADCOUNT=int(value)
  208. elif (option=="--outputdir"): SetOutputDir(value.strip())
  209. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  210. elif (option=="--universal"): universal = True
  211. elif (option=="--target"): target = value.strip()
  212. elif (option=="--arch"): target_archs.append(value.strip())
  213. elif (option=="--nocolor"): DisableColors()
  214. elif (option=="--version"):
  215. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  216. if not match:
  217. usage("version requires three digits")
  218. WHLVERSION = value
  219. VERSION = match.group()
  220. elif (option=="--lzma"): COMPRESSOR="lzma"
  221. elif (option=="--override"): AddOverride(value.strip())
  222. elif (option=="--static"): SetLinkAllStatic(True)
  223. elif (option=="--host"): HOST_URL=value
  224. elif (option=="--debversion"): DEBVERSION=value
  225. elif (option=="--rpmversion"): RPMVERSION=value
  226. elif (option=="--rpmrelease"): RPMRELEASE=value
  227. elif (option=="--git-commit"): GIT_COMMIT=value
  228. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  229. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  230. # Backward compatibility, OPENGL was renamed to GL
  231. elif (option=="--use-opengl"): PkgEnable("GL")
  232. elif (option=="--no-opengl"): PkgDisable("GL")
  233. elif (option=="--directx-sdk"):
  234. STRDXSDKVERSION = value.strip().lower()
  235. if STRDXSDKVERSION == '':
  236. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  237. STRDXSDKVERSION = 'default'
  238. elif (option=="--windows-sdk"):
  239. WINDOWS_SDK = value.strip().lower()
  240. elif (option=="--msvc-version"):
  241. MSVC_VERSION = value.strip().lower()
  242. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  243. elif (option=="--clean"): clean_build = True
  244. elif (option=="--no-copy-python"): COPY_PYTHON = False
  245. elif (option[2:] in removedopts):
  246. Warn("Ignoring removed option %s" % (option))
  247. else:
  248. for pkg in PkgListGet() + ['CGGL']:
  249. if option == "--use-" + pkg.lower():
  250. PkgEnable(pkg)
  251. break
  252. elif option == "--no-" + pkg.lower():
  253. PkgDisable(pkg)
  254. break
  255. elif option == "--" + pkg.lower() + "-incdir":
  256. PkgSetCustomLocation(pkg)
  257. IncDirectory(pkg, value)
  258. break
  259. elif option == "--" + pkg.lower() + "-libdir":
  260. PkgSetCustomLocation(pkg)
  261. LibDirectory(pkg, value)
  262. break
  263. if (option == "--everything" or option.startswith("--use-")
  264. or option == "--nothing" or option.startswith("--no-")):
  265. anything = 1
  266. except:
  267. usage(sys.exc_info()[1])
  268. if not anything:
  269. if RUNTIME:
  270. PkgEnableAll()
  271. else:
  272. usage("You should specify a list of packages to use or --everything to enable all packages.")
  273. if (RTDIST and RUNTIME):
  274. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  275. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  276. elif (optimize==""): optimize = "3"
  277. if OSXTARGET:
  278. parts = OSXTARGET.strip().split('.')
  279. try:
  280. assert len(parts) <= 2
  281. maj = int(parts[0])
  282. min = 0
  283. if len(parts) > 1:
  284. min = int(parts[1])
  285. OSXTARGET = maj, min
  286. assert OSXTARGET >= (10, 4)
  287. except:
  288. usage("Invalid setting for --osxtarget")
  289. else:
  290. OSXTARGET = None
  291. if target is not None or target_archs:
  292. SetTarget(target, target_archs[-1] if target_archs else None)
  293. if universal:
  294. if target_archs:
  295. exit("--universal is incompatible with --arch")
  296. if OSXTARGET:
  297. osxver = OSXTARGET
  298. else:
  299. maj, min = platform.mac_ver()[0].split('.')[:2]
  300. osxver = int(maj), int(min)
  301. if osxver < (10, 15):
  302. OSX_ARCHS.append("i386")
  303. if osxver < (10, 6):
  304. OSX_ARCHS.append("ppc")
  305. else:
  306. OSX_ARCHS.append("x86_64")
  307. if osxver >= (11, 0):
  308. OSX_ARCHS.append("arm64")
  309. elif target_archs:
  310. OSX_ARCHS = target_archs
  311. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  312. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  313. try:
  314. SetOptimize(int(optimize))
  315. assert GetOptimize() in [1, 2, 3, 4]
  316. except:
  317. usage("Invalid setting for OPTIMIZE")
  318. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  319. usage("Invalid SHA-1 hash given for --git-commit option!")
  320. if GetTarget() == 'windows':
  321. if not MSVC_VERSION:
  322. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  323. MSVC_VERSION = (14, 0)
  324. else:
  325. try:
  326. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  327. if (len(MSVC_VERSION) == 1):
  328. MSVC_VERSION += (0,)
  329. except:
  330. usage("Invalid setting for --msvc-version")
  331. if MSVC_VERSION < (14, 0):
  332. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  333. print("=========================================================================")
  334. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  335. print(warn_prefix + "For more information, or any questions, please visit:")
  336. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  337. print("=========================================================================")
  338. sys.stdout.flush()
  339. time.sleep(1.0)
  340. sys.exit(1)
  341. if not WINDOWS_SDK:
  342. print("No Windows SDK version specified. Defaulting to '7.1'.")
  343. WINDOWS_SDK = '7.1'
  344. if clean_build and os.path.isdir(GetOutputDir()):
  345. print("Deleting %s" % (GetOutputDir()))
  346. shutil.rmtree(GetOutputDir())
  347. parseopts(sys.argv[1:])
  348. ########################################################################
  349. ##
  350. ## Handle environment variables.
  351. ##
  352. ########################################################################
  353. if ("CFLAGS" in os.environ):
  354. CFLAGS = os.environ["CFLAGS"].strip()
  355. if ("CXXFLAGS" in os.environ):
  356. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  357. if ("RPM_OPT_FLAGS" in os.environ):
  358. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  359. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  360. if ("LDFLAGS" in os.environ):
  361. LDFLAGS = os.environ["LDFLAGS"].strip()
  362. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  363. if GetHost() == "darwin" and OSXTARGET is not None:
  364. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  365. ########################################################################
  366. ##
  367. ## Configure things based on the command-line parameters.
  368. ##
  369. ########################################################################
  370. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  371. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  372. if VERSION is None:
  373. if RUNTIME:
  374. VERSION = PLUGIN_VERSION
  375. else:
  376. # Take the value from the setup.cfg file.
  377. VERSION = GetMetadataValue('version')
  378. if WHLVERSION is None:
  379. WHLVERSION = VERSION
  380. print("Version: %s" % VERSION)
  381. if RUNTIME or RTDIST:
  382. print("Core API Version: %s" % COREAPI_VERSION)
  383. if DEBVERSION is None:
  384. DEBVERSION = VERSION
  385. if RPMVERSION is None:
  386. RPMVERSION = VERSION
  387. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  388. if P3DSUFFIX is None:
  389. P3DSUFFIX = MAJOR_VERSION
  390. # Now determine the distutils-style platform tag for the target system.
  391. target = GetTarget()
  392. if target == 'windows':
  393. if GetTargetArch() == 'x64':
  394. PLATFORM = 'win-amd64'
  395. else:
  396. PLATFORM = 'win32'
  397. elif target == 'darwin':
  398. if OSXTARGET:
  399. osxver = OSXTARGET
  400. else:
  401. maj, min = platform.mac_ver()[0].split('.')[:2]
  402. osxver = int(maj), int(min)
  403. if osxver[0] >= 11:
  404. # I think Python pins minor version to 0 from macOS 11 onward
  405. osxver = (osxver[0], 0)
  406. arch_tag = None
  407. if not OSX_ARCHS:
  408. arch_tag = GetTargetArch()
  409. elif len(OSX_ARCHS) == 1:
  410. arch_tag = OSX_ARCHS[0]
  411. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  412. arch_tag = 'fat'
  413. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  414. arch_tag = 'intel'
  415. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  416. arch_tag = 'fat64'
  417. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  418. arch_tag = 'fat32'
  419. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  420. arch_tag = 'universal'
  421. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  422. arch_tag = 'universal2'
  423. else:
  424. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  425. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  426. 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"):
  427. # This is manylinux1. A bit of a sloppy check, though.
  428. if GetTargetArch() in ('x86_64', 'amd64'):
  429. PLATFORM = 'manylinux1-x86_64'
  430. elif GetTargetArch() in ('arm64', 'aarch64'):
  431. PLATFORM = 'manylinux1-aarch64'
  432. else:
  433. PLATFORM = 'manylinux1-i686'
  434. 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"):
  435. # Same sloppy check for manylinux2010.
  436. if GetTargetArch() in ('x86_64', 'amd64'):
  437. PLATFORM = 'manylinux2010-x86_64'
  438. elif GetTargetArch() in ('arm64', 'aarch64'):
  439. PLATFORM = 'manylinux2010-aarch64'
  440. else:
  441. PLATFORM = 'manylinux2010-i686'
  442. 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"):
  443. # Same sloppy check for manylinux2014.
  444. if GetTargetArch() in ('x86_64', 'amd64'):
  445. PLATFORM = 'manylinux2014-x86_64'
  446. elif GetTargetArch() in ('arm64', 'aarch64'):
  447. PLATFORM = 'manylinux2014-aarch64'
  448. else:
  449. PLATFORM = 'manylinux2014-i686'
  450. elif target == 'linux' and (os.path.isfile("/lib/i386-linux-gnu/libc-2.24.so") or os.path.isfile("/lib/x86_64-linux-gnu/libc-2.24.so")) and os.path.isdir("/opt/python"):
  451. # Same sloppy check for manylinux_2_24.
  452. if GetTargetArch() in ('x86_64', 'amd64'):
  453. PLATFORM = 'manylinux_2_24-x86_64'
  454. elif GetTargetArch() in ('arm64', 'aarch64'):
  455. PLATFORM = 'manylinux_2_24-aarch64'
  456. else:
  457. PLATFORM = 'manylinux_2_24-i686'
  458. elif not CrossCompiling():
  459. if HasTargetArch():
  460. # Replace the architecture in the platform string.
  461. platform_parts = get_platform().rsplit('-', 1)
  462. target_arch = GetTargetArch()
  463. if target_arch == 'amd64':
  464. target_arch = 'x86_64'
  465. PLATFORM = platform_parts[0] + '-' + target_arch
  466. else:
  467. # We're not cross-compiling; just take the host arch.
  468. PLATFORM = get_platform()
  469. else:
  470. target_arch = GetTargetArch()
  471. if target_arch == 'amd64':
  472. target_arch = 'x86_64'
  473. PLATFORM = '{0}-{1}'.format(target, target_arch)
  474. print("Platform: %s" % PLATFORM)
  475. outputdir_suffix = ""
  476. if (RUNTIME or RTDIST):
  477. # Compiling Maya/Max is pointless in rtdist build
  478. for ver in MAYAVERSIONS + MAXVERSIONS:
  479. PkgDisable(ver)
  480. if (DISTRIBUTOR.strip() == ""):
  481. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  482. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  483. if (RUNTIME):
  484. outputdir_suffix += "_rt"
  485. if DISTRIBUTOR == "":
  486. DISTRIBUTOR = "makepanda"
  487. elif not RTDIST_VERSION:
  488. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  489. if not RTDIST_VERSION:
  490. RTDIST_VERSION = "dev"
  491. if not IsCustomOutputDir():
  492. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  493. outputdir_suffix += '_x64'
  494. SetOutputDir("built" + outputdir_suffix)
  495. if (RUNTIME):
  496. for pkg in PkgListGet():
  497. if pkg in ["GTK2", "MFC"]:
  498. # Optional package(s) for runtime.
  499. pass
  500. elif pkg in ["OPENSSL", "ZLIB"]:
  501. # Required packages for runtime.
  502. if (PkgSkip(pkg)==1):
  503. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  504. else:
  505. # Unused packages for runtime.
  506. PkgDisable(pkg)
  507. if (INSTALLER and RTDIST):
  508. exit("Cannot build an installer for the rtdist build!")
  509. if (WHEEL and RUNTIME):
  510. exit("Cannot build a wheel for the runtime build!")
  511. if (WHEEL and RTDIST):
  512. exit("Cannot build a wheel for the rtdist build!")
  513. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  514. exit("Cannot build installer on Windows without python")
  515. if WHEEL and PkgSkip("PYTHON"):
  516. exit("Cannot build wheel without Python")
  517. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  518. exit("Cannot build rtdist without wx or fltk")
  519. if (RUNTIME):
  520. SetLinkAllStatic(True)
  521. if not os.path.isdir("contrib"):
  522. PkgDisable("CONTRIB")
  523. ########################################################################
  524. ##
  525. ## Load the dependency cache.
  526. ##
  527. ########################################################################
  528. LoadDependencyCache()
  529. ########################################################################
  530. ##
  531. ## Locate various SDKs.
  532. ##
  533. ########################################################################
  534. MakeBuildTree()
  535. SdkLocateDirectX(STRDXSDKVERSION)
  536. SdkLocateMaya()
  537. SdkLocateMax()
  538. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  539. SdkLocatePython(RTDIST)
  540. SdkLocateWindows(WINDOWS_SDK)
  541. SdkLocatePhysX()
  542. SdkLocateSpeedTree()
  543. SdkLocateAndroid()
  544. SdkAutoDisableDirectX()
  545. SdkAutoDisableMaya()
  546. SdkAutoDisableMax()
  547. SdkAutoDisablePhysX()
  548. SdkAutoDisableSpeedTree()
  549. if RTDIST and DISTRIBUTOR == "cmu":
  550. # Some validation checks for the CMU builds.
  551. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  552. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  553. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  554. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  555. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  556. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  557. if RTDIST and not HOST_URL:
  558. exit("You must specify a host URL when building the rtdist!")
  559. if RUNTIME and not HOST_URL:
  560. # Set this to a nice default.
  561. HOST_URL = "https://runtime.panda3d.org/"
  562. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  563. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  564. print("==========================================================================")
  565. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  566. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  567. print(warn_prefix + "Please upgrade to Python 3 now.")
  568. print("==========================================================================")
  569. sys.stdout.flush()
  570. # Give the user some time to contemplate their sins
  571. time.sleep(6.0)
  572. ########################################################################
  573. ##
  574. ## Choose a Compiler.
  575. ##
  576. ## This should also set up any environment variables needed to make
  577. ## the compiler work.
  578. ##
  579. ########################################################################
  580. if GetHost() == 'windows' and GetTarget() == 'windows':
  581. COMPILER = "MSVC"
  582. SdkLocateVisualStudio(MSVC_VERSION)
  583. else:
  584. COMPILER = "GCC"
  585. SetupBuildEnvironment(COMPILER)
  586. ########################################################################
  587. ##
  588. ## External includes, external libraries, and external defsyms.
  589. ##
  590. ########################################################################
  591. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  592. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  593. if (COMPILER == "MSVC"):
  594. PkgDisable("X11")
  595. PkgDisable("GLES")
  596. PkgDisable("GLES2")
  597. PkgDisable("EGL")
  598. PkgDisable("CARBON")
  599. PkgDisable("COCOA")
  600. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  601. if (PkgSkip("PYTHON")==0):
  602. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  603. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  604. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  605. for pkg in PkgListGet():
  606. if (PkgSkip(pkg)==0):
  607. if (pkg[:4]=="MAYA"):
  608. IncDirectory(pkg, SDK[pkg] + "/include")
  609. DefSymbol(pkg, "MAYAVERSION", pkg)
  610. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  611. elif (pkg[:3]=="MAX"):
  612. IncDirectory(pkg, SDK[pkg] + "/include")
  613. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  614. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  615. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  616. DefSymbol(pkg, "MAX", pkg)
  617. if (int(pkg[3:]) >= 2013):
  618. DefSymbol(pkg, "UNICODE", "")
  619. DefSymbol(pkg, "_UNICODE", "")
  620. elif (pkg[:2]=="DX"):
  621. IncDirectory(pkg, SDK[pkg] + "/include")
  622. elif GetThirdpartyDir() is not None:
  623. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  624. for pkg in DXVERSIONS:
  625. if (PkgSkip(pkg)==0):
  626. vnum=pkg[2:]
  627. if GetTargetArch() == 'x64':
  628. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  629. else:
  630. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  631. LibDirectory(pkg, SDK[pkg] + '/lib')
  632. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  633. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  634. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  635. LibName(pkg, 'dxerr.lib')
  636. else:
  637. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  638. #LibName(pkg, 'ddraw.lib')
  639. LibName(pkg, 'dxguid.lib')
  640. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  641. # dxerr needs this for __vsnwprintf definition.
  642. LibName(pkg, 'legacy_stdio_definitions.lib')
  643. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  644. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  645. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  646. LibName("WINSOCK", "wsock32.lib")
  647. LibName("WINSOCK2", "wsock32.lib")
  648. LibName("WINSOCK2", "ws2_32.lib")
  649. LibName("WINCOMCTL", "comctl32.lib")
  650. LibName("WINCOMDLG", "comdlg32.lib")
  651. LibName("WINUSER", "user32.lib")
  652. LibName("WINMM", "winmm.lib")
  653. LibName("WINIMM", "imm32.lib")
  654. LibName("WINKERNEL", "kernel32.lib")
  655. LibName("WINOLE", "ole32.lib")
  656. LibName("WINOLEAUT", "oleaut32.lib")
  657. LibName("WINOLDNAMES", "oldnames.lib")
  658. LibName("WINSHELL", "shell32.lib")
  659. LibName("WINGDI", "gdi32.lib")
  660. LibName("ADVAPI", "advapi32.lib")
  661. LibName("IPHLPAPI", "iphlpapi.lib")
  662. LibName("SETUPAPI", "setupapi.lib")
  663. LibName("GL", "opengl32.lib")
  664. LibName("GLES", "libgles_cm.lib")
  665. LibName("GLES2", "libGLESv2.lib")
  666. LibName("EGL", "libEGL.lib")
  667. LibName("MSIMG", "msimg32.lib")
  668. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  669. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  670. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  671. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  672. if (PkgSkip("MIMALLOC")==0): LibName("MIMALLOC", GetThirdpartyDir() + "mimalloc/lib/mimalloc-static.lib")
  673. if (PkgSkip("OPENSSL")==0):
  674. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  675. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  676. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  677. elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
  678. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  679. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  680. else:
  681. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
  682. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
  683. LibName("OPENSSL", "crypt32.lib")
  684. LibName("OPENSSL", "ws2_32.lib")
  685. if (PkgSkip("PNG")==0):
  686. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  687. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  688. else:
  689. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  690. if (PkgSkip("TIFF")==0):
  691. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  692. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  693. else:
  694. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  695. if (PkgSkip("OPENEXR")==0):
  696. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXRCore-3_1.lib"):
  697. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_1.lib")
  698. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_1.lib")
  699. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_1.lib")
  700. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_1.lib")
  701. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib"):
  702. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib")
  703. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_0.lib")
  704. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_0.lib")
  705. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_0.lib")
  706. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR.lib"):
  707. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR.lib")
  708. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread.lib")
  709. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath.lib")
  710. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex.lib")
  711. else:
  712. suffix = ""
  713. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  714. suffix = "-2_2"
  715. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  716. suffix = "-2_3"
  717. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  718. suffix = "-2_4"
  719. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  720. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  721. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  722. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  723. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  724. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  725. if suffix == "-2_2":
  726. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  727. else:
  728. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  729. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  730. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath")
  731. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  732. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  733. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  734. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  735. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  736. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  737. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  738. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  739. if (PkgSkip("HARFBUZZ")==0):
  740. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  741. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  742. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  743. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  744. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  745. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  746. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  747. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  748. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  749. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  750. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  751. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  752. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  753. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  754. if (PkgSkip("FCOLLADA")==0):
  755. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  756. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  757. if (PkgSkip("ASSIMP")==0):
  758. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  759. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  760. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  761. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  762. if (PkgSkip("SQUISH")==0):
  763. if GetOptimize() <= 2:
  764. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  765. else:
  766. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  767. if (PkgSkip("ROCKET")==0):
  768. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  769. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  770. if (PkgSkip("PYTHON")==0):
  771. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  772. if (GetOptimize() <= 3):
  773. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  774. if (PkgSkip("OPENAL")==0):
  775. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  776. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  777. # Link OpenAL Soft statically.
  778. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  779. if (PkgSkip("ODE")==0):
  780. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  781. DefSymbol("ODE", "dSINGLE", "")
  782. if (PkgSkip("FMODEX")==0):
  783. if (GetTargetArch() == 'x64'):
  784. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  785. else:
  786. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  787. if (PkgSkip("FLTK")==0 and RTDIST):
  788. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  789. if not PkgSkip("FLTK"):
  790. # If we have fltk, we don't need wx
  791. PkgDisable("WX")
  792. if (PkgSkip("WX")==0 and RTDIST):
  793. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  794. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  795. DefSymbol("WX", "__WXMSW__", "")
  796. DefSymbol("WX", "_UNICODE", "")
  797. DefSymbol("WX", "UNICODE", "")
  798. if (PkgSkip("VORBIS")==0):
  799. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  800. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  801. if not os.path.isfile(path):
  802. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  803. LibName("VORBIS", path)
  804. if (PkgSkip("OPUS")==0):
  805. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  806. for lib in ('ogg', 'opus', 'opusfile'):
  807. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  808. if not os.path.isfile(path):
  809. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  810. LibName("OPUS", path)
  811. for pkg in MAYAVERSIONS:
  812. if (PkgSkip(pkg)==0):
  813. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  814. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  815. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  816. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  817. for pkg in MAXVERSIONS:
  818. if (PkgSkip(pkg)==0):
  819. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  820. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  821. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  822. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  823. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  824. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  825. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  826. if (PkgSkip("PHYSX")==0):
  827. if GetTargetArch() == 'x64':
  828. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  829. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  830. else:
  831. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  832. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  833. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  834. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  835. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  836. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  837. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  838. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  839. if (PkgSkip("SPEEDTREE")==0):
  840. if GetTargetArch() == 'x64':
  841. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  842. p64ext = '64'
  843. else:
  844. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  845. p64ext = ''
  846. debugext = ''
  847. if (GetOptimize() <= 2): debugext = "_d"
  848. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  849. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  850. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  851. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  852. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  853. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  854. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  855. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  856. LibName("SPEEDTREE", "glu32.lib")
  857. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  858. if (PkgSkip("BULLET")==0):
  859. suffix = '.lib'
  860. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  861. suffix = '_x64.lib'
  862. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  863. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  864. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  865. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  866. if (COMPILER=="GCC"):
  867. PkgDisable("MIMALLOC") # no discernable benefit over glibc
  868. if GetTarget() != "darwin":
  869. PkgDisable("CARBON")
  870. PkgDisable("COCOA")
  871. elif RUNTIME:
  872. # We don't support Cocoa in the runtime yet.
  873. PkgDisable("COCOA")
  874. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  875. # 64-bits macOS doesn't have Carbon.
  876. PkgDisable("CARBON")
  877. if GetTarget() == 'darwin':
  878. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  879. # These support only these archs, so don't build them if we're not
  880. # targeting any of the supported archs.
  881. PkgDisable("FMODEX")
  882. PkgDisable("NVIDIACG")
  883. PkgDisable("ROCKET")
  884. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  885. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  886. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  887. # Also, we can't target FMOD Ex with the 10.14 SDK
  888. PkgDisable("FMODEX")
  889. #if (PkgSkip("PYTHON")==0):
  890. # IncDirectory("PYTHON", SDK["PYTHON"])
  891. if (GetHost() == "darwin"):
  892. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  893. IncDirectory("FREETYPE", "/usr/X11/include")
  894. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  895. LibDirectory("FREETYPE", "/usr/X11/lib")
  896. if (GetHost() == "freebsd"):
  897. IncDirectory("ALWAYS", "/usr/local/include")
  898. LibDirectory("ALWAYS", "/usr/local/lib")
  899. if (os.path.isdir("/usr/PCBSD")):
  900. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  901. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  902. SmartPkgEnable("INOTIFY", "libinotify", ("inotify"), "sys/inotify.h")
  903. if GetTarget() != "windows":
  904. PkgDisable("DIRECTCAM")
  905. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  906. # WARNING! The order of the ffmpeg libraries matters!
  907. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  908. assimp_libs = ("libassimp", "libassimpd")
  909. # Name pkg-config libs, include(dir)s
  910. if (not RUNTIME):
  911. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  912. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  913. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  914. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  915. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  916. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  917. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  918. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  919. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  920. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  921. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  922. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  923. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  924. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  925. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  926. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  927. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  928. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  929. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  930. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  931. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h"))
  932. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  933. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  934. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  935. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  936. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  937. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  938. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  939. # because there's a circular dependency between the two libraries.
  940. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  941. for (opt, name) in LIBNAMES:
  942. if opt == "FREETYPE":
  943. LibName("HARFBUZZ", name)
  944. if not PkgSkip("FFMPEG"):
  945. if GetTarget() == "darwin":
  946. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  947. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  948. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  949. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  950. # Needed when linking ffmpeg statically on Linux.
  951. LibName("FFMPEG", "-Wl,-Bsymbolic")
  952. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  953. for ffmpeg_lib in ffmpeg_libs:
  954. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  955. if GetTarget() != "darwin":
  956. for fcollada_lib in fcollada_libs:
  957. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  958. if not PkgSkip("SWSCALE"):
  959. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  960. if not PkgSkip("SWRESAMPLE"):
  961. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  962. if not PkgSkip("JPEG"):
  963. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  964. if not PkgSkip("TIFF"):
  965. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  966. if not PkgSkip("PNG"):
  967. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  968. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  969. if not PkgSkip("SQUISH"):
  970. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  971. if not PkgSkip("OPENEXR"):
  972. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  973. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  974. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  975. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  976. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  977. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  978. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  979. if not PkgSkip("VORBIS"):
  980. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  981. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  982. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  983. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  984. if not PkgSkip("OPUS"):
  985. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  986. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  987. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  988. if not PkgSkip("VRPN"):
  989. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  990. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  991. if not PkgSkip("ARTOOLKIT"):
  992. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  993. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  994. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  995. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  996. if cv_lib == "opencv_core":
  997. OPENCV_VER_23 = True
  998. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  999. else:
  1000. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  1001. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  1002. else:
  1003. PkgDisable("OPENCV")
  1004. if not PkgSkip("OPENAL"):
  1005. if GetTarget() == "darwin":
  1006. LibName("OPENAL", "-framework AudioUnit")
  1007. LibName("OPENAL", "-framework AudioToolbox")
  1008. LibName("OPENAL", "-framework CoreAudio")
  1009. else:
  1010. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  1011. if not PkgSkip("ASSIMP") and \
  1012. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  1013. # Also pick up IrrXML, which is needed when linking statically.
  1014. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  1015. if os.path.isfile(irrxml):
  1016. LibName("ASSIMP", irrxml)
  1017. if GetTarget() != "darwin":
  1018. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  1019. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  1020. rocket_libs = ("RocketCore", "RocketControls")
  1021. if (GetOptimize() <= 3):
  1022. rocket_libs += ("RocketDebugger",)
  1023. rocket_libs += ("boost_python",)
  1024. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  1025. if not PkgSkip("PYTHON"):
  1026. python_lib = SDK["PYTHONVERSION"]
  1027. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  1028. if GetTarget() == "linux":
  1029. LibName("PYTHON", "-lutil")
  1030. LibName("PYTHON", "-lrt")
  1031. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  1032. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  1033. SmartPkgEnable("GTK2", "gtk+-2.0")
  1034. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  1035. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  1036. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  1037. if (RTDIST):
  1038. SmartPkgEnable("WX", tool = "wx-config")
  1039. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  1040. if GetTarget() != 'darwin':
  1041. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  1042. if not PkgSkip("NVIDIACG") and not RUNTIME:
  1043. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1044. if not RUNTIME and GetTarget() != "android":
  1045. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1046. if GetHost() != "darwin":
  1047. # Workaround for an issue where pkg-config does not include this path
  1048. if GetTargetArch() in ("x86_64", "amd64"):
  1049. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1050. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1051. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1052. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1053. if not PkgSkip("X11"):
  1054. if (os.path.isdir("/usr/X11R6/lib64")):
  1055. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1056. else:
  1057. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1058. elif not PkgSkip("X11"):
  1059. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1060. if RUNTIME:
  1061. # For the runtime, these packages are required
  1062. for pkg in ["OPENSSL", "ZLIB"]:
  1063. skips = []
  1064. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1065. skips.append(pkg)
  1066. if skips:
  1067. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1068. for pkg in MAYAVERSIONS:
  1069. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1070. if (GetHost() == "darwin"):
  1071. # Sheesh, Autodesk really can't make up their mind
  1072. # regarding the location of the Maya devkit on macOS.
  1073. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1074. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1075. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1076. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1077. if (os.path.isdir(SDK[pkg] + "/lib")):
  1078. LibDirectory(pkg, SDK[pkg] + "/lib")
  1079. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1080. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1081. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1082. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1083. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1084. IncDirectory(pkg, SDK[pkg] + "/include")
  1085. else:
  1086. LibDirectory(pkg, SDK[pkg] + "/lib")
  1087. IncDirectory(pkg, SDK[pkg] + "/include")
  1088. DefSymbol(pkg, "MAYAVERSION", pkg)
  1089. if GetTarget() == 'darwin':
  1090. LibName("ALWAYS", "-framework AppKit")
  1091. LibName("AGL", "-framework AGL")
  1092. LibName("CARBON", "-framework Carbon")
  1093. LibName("COCOA", "-framework Cocoa")
  1094. # Fix for a bug in OSX Leopard:
  1095. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1096. if GetTarget() == 'android':
  1097. LibName("ALWAYS", '-llog')
  1098. LibName("ANDROID", '-landroid')
  1099. LibName("JNIGRAPHICS", '-ljnigraphics')
  1100. for pkg in MAYAVERSIONS:
  1101. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1102. if GetTarget() == 'darwin':
  1103. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1104. else:
  1105. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1106. LibName(pkg, "-lOpenMaya")
  1107. LibName(pkg, "-lOpenMayaAnim")
  1108. LibName(pkg, "-lOpenMayaUI")
  1109. LibName(pkg, "-lAnimSlice")
  1110. LibName(pkg, "-lDeformSlice")
  1111. LibName(pkg, "-lModifiers")
  1112. LibName(pkg, "-lDynSlice")
  1113. LibName(pkg, "-lKinSlice")
  1114. LibName(pkg, "-lModelSlice")
  1115. LibName(pkg, "-lNurbsSlice")
  1116. LibName(pkg, "-lPolySlice")
  1117. LibName(pkg, "-lProjectSlice")
  1118. LibName(pkg, "-lImage")
  1119. LibName(pkg, "-lShared")
  1120. LibName(pkg, "-lTranslators")
  1121. LibName(pkg, "-lDataModel")
  1122. LibName(pkg, "-lRenderModel")
  1123. LibName(pkg, "-lNurbsEngine")
  1124. LibName(pkg, "-lDependEngine")
  1125. LibName(pkg, "-lCommandEngine")
  1126. LibName(pkg, "-lFoundation")
  1127. if pkg not in ("MAYA2020", "MAYA2022"):
  1128. LibName(pkg, "-lIMFbase")
  1129. if GetTarget() != 'darwin':
  1130. LibName(pkg, "-lOpenMayalib")
  1131. else:
  1132. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1133. if (PkgSkip("PHYSX")==0):
  1134. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1135. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1136. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1137. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1138. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1139. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1140. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1141. if (GetHost() == "darwin"):
  1142. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1143. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1144. else:
  1145. LibName("PHYSX", "-lPhysXLoader")
  1146. LibName("PHYSX", "-lNxCharacter")
  1147. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1148. if GetLinkAllStatic():
  1149. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1150. if GetTarget() == 'android':
  1151. DefSymbol("ALWAYS", "ANDROID")
  1152. if not PkgSkip("EIGEN"):
  1153. if GetOptimize() >= 3:
  1154. if COMPILER == "MSVC":
  1155. # Squeeze out a bit more performance on MSVC builds...
  1156. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1157. # will turn them into runtime assertions.
  1158. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1159. if not PkgSkip("EGL"):
  1160. DefSymbol('EGL', 'HAVE_EGL', '')
  1161. if PkgSkip("X11"):
  1162. DefSymbol('EGL', 'EGL_NO_X11', '')
  1163. if not PkgSkip("X11"):
  1164. DefSymbol('X11', 'USE_X11', '')
  1165. ########################################################################
  1166. ##
  1167. ## Give a Status Report on Command-Line Options
  1168. ##
  1169. ########################################################################
  1170. def printStatus(header,warnings):
  1171. if GetVerbose():
  1172. print("")
  1173. print("-------------------------------------------------------------------")
  1174. print(header)
  1175. tkeep = ""
  1176. tomit = ""
  1177. for x in PkgListGet():
  1178. if PkgSkip(x):
  1179. tomit = tomit + x + " "
  1180. else:
  1181. tkeep = tkeep + x + " "
  1182. if RTDIST:
  1183. print("Makepanda: Runtime distribution build")
  1184. elif RUNTIME:
  1185. print("Makepanda: Runtime build")
  1186. else:
  1187. print("Makepanda: Regular build")
  1188. print("Makepanda: Compiler: %s" % (COMPILER))
  1189. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1190. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1191. print("Makepanda: Omit Pkg: %s" % (tomit))
  1192. if GENMAN:
  1193. print("Makepanda: Generate API reference manual")
  1194. else:
  1195. print("Makepanda: Don't generate API reference manual")
  1196. if GetHost() == "windows" and not RTDIST:
  1197. if INSTALLER:
  1198. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1199. else:
  1200. print("Makepanda: Don't build installer")
  1201. print("Makepanda: Version ID: %s" % (VERSION))
  1202. for x in warnings:
  1203. print("Makepanda: %s" % (x))
  1204. print("-------------------------------------------------------------------")
  1205. print("")
  1206. sys.stdout.flush()
  1207. ########################################################################
  1208. ##
  1209. ## BracketNameWithQuotes
  1210. ##
  1211. ########################################################################
  1212. def BracketNameWithQuotes(name):
  1213. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1214. if (name.startswith("-framework")): return name
  1215. if (name.startswith("-dylib_file")): return name
  1216. # Don't add quotes when it's not necessary.
  1217. if " " not in name: return name
  1218. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1219. if (name.startswith('"') and name.endswith('"')): return name
  1220. else: return '"' + name + '"'
  1221. ########################################################################
  1222. ##
  1223. ## CompileCxx
  1224. ##
  1225. ########################################################################
  1226. def CompileCxx(obj,src,opts):
  1227. ipath = GetListOption(opts, "DIR:")
  1228. optlevel = GetOptimizeOption(opts)
  1229. if (COMPILER=="MSVC"):
  1230. if not BOOUSEINTELCOMPILER:
  1231. cmd = "cl "
  1232. if GetTargetArch() == 'x64':
  1233. cmd += "/favor:blend "
  1234. cmd += "/wd4996 /wd4275 /wd4273 "
  1235. # We still target Windows XP.
  1236. cmd += "/DWINVER=0x501 "
  1237. # Work around a WinXP/2003 bug when using VS 2015+.
  1238. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1239. cmd += "/Zc:threadSafeInit- "
  1240. cmd += "/Fo" + obj + " /nologo /c"
  1241. if GetTargetArch() == 'x86':
  1242. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1243. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1244. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1245. else: # x86 without SSE2
  1246. cmd += " /arch:IA32"
  1247. for x in ipath: cmd += " /I" + x
  1248. for (opt,dir) in INCDIRECTORIES:
  1249. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1250. for (opt,var,val) in DEFSYMBOLS:
  1251. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1252. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1253. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1254. if (optlevel==2): cmd += " /MDd /Zi"
  1255. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1256. if (optlevel==4):
  1257. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1258. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1259. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1260. building = GetValueOption(opts, "BUILDING:")
  1261. if (building):
  1262. cmd += " /DBUILDING_" + building
  1263. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1264. cmd += " /bigobj"
  1265. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1266. if 'EXCEPTIONS' in opts:
  1267. cmd += " /EHsc"
  1268. else:
  1269. cmd += " /D_HAS_EXCEPTIONS=0"
  1270. if 'RTTI' not in opts:
  1271. cmd += " /GR-"
  1272. if GetTargetArch() == 'x64':
  1273. cmd += " /DWIN64_VC /DWIN64"
  1274. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1275. # To preserve Windows XP compatibility.
  1276. cmd += " /D_USING_V110_SDK71_"
  1277. cmd += " /W3 " + BracketNameWithQuotes(src)
  1278. oscmd(cmd)
  1279. else:
  1280. cmd = "icl "
  1281. if GetTargetArch() == 'x64':
  1282. cmd += "/favor:blend "
  1283. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1284. cmd += "/DWINVER=0x501 "
  1285. cmd += "/Fo" + obj + " /c"
  1286. for x in ipath: cmd += " /I" + x
  1287. for (opt,dir) in INCDIRECTORIES:
  1288. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1289. for (opt,var,val) in DEFSYMBOLS:
  1290. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1291. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1292. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1293. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1294. # core changes from jean-claude (dec 2011)
  1295. # ----------------------------------------
  1296. # performance will be seeked at level 3 & 4
  1297. # -----------------------------------------
  1298. if (optlevel==3):
  1299. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1300. cmd += " /Ob0"
  1301. cmd += " /Qipo-" # beware of IPO !!!
  1302. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1303. ## ----------------------------------------------------------------
  1304. if (optlevel==4):
  1305. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1306. cmd += " /Qipo" # optimization multi file
  1307. # for 3 & 4 optimization levels
  1308. # -----------------------------
  1309. if (optlevel>=3):
  1310. cmd += " /fp:fast=2"
  1311. cmd += " /Qftz"
  1312. cmd += " /Qfp-speculation:fast"
  1313. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1314. cmd += " /Qprec-div-"
  1315. cmd += " /Qsimd"
  1316. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1317. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1318. cmd += " /Qparallel" # enable parallelization
  1319. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1320. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1321. ## PCH files with a .pchi filename suffix and reduce build time.
  1322. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1323. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1324. cmd += " /Qpchi-" # keep it this way!
  1325. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1326. ## ------------------------------------
  1327. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1328. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1329. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1330. ## Ctor displacement /vd0 : Disable constructor displacement.
  1331. ## Choose this option only if no class constructors or destructors call virtual functions.
  1332. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1333. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1334. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1335. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1336. ## Alternate: #pragma pointers_to_members
  1337. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1338. building = GetValueOption(opts, "BUILDING:")
  1339. if (building): cmd += " /DBUILDING_" + building
  1340. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1341. cmd += " /bigobj"
  1342. # level of warnings and optimization reports
  1343. if GetVerbose():
  1344. cmd += " /W3 " # or /W4 or /Wall
  1345. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1346. else:
  1347. cmd += " /W1 "
  1348. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1349. if GetTargetArch() == 'x64':
  1350. cmd += " /DWIN64_VC /DWIN64"
  1351. cmd += " " + BracketNameWithQuotes(src)
  1352. oscmd(cmd)
  1353. if (COMPILER=="GCC"):
  1354. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1355. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1356. for (opt, dir) in INCDIRECTORIES:
  1357. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1358. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1359. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1360. for (opt,var,val) in DEFSYMBOLS:
  1361. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1362. for x in ipath: cmd += ' -I' + x
  1363. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1364. cmd += ' -fvisibility=hidden'
  1365. # Mac-specific flags.
  1366. if GetTarget() == "darwin":
  1367. cmd += " -Wno-deprecated-declarations"
  1368. if OSXTARGET is not None:
  1369. cmd += " -isysroot " + SDK["MACOSX"]
  1370. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1371. elif platform.mac_ver()[0].startswith('11.'):
  1372. cmd += " -mmacosx-version-min=11.0"
  1373. for arch in OSX_ARCHS:
  1374. if 'NOARCH:' + arch.upper() not in opts:
  1375. cmd += " -arch %s" % arch
  1376. if "SYSROOT" in SDK:
  1377. if GetTarget() != "android":
  1378. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1379. else:
  1380. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1381. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1382. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1383. cmd += ' -no-canonical-prefixes'
  1384. # Android-specific flags.
  1385. arch = GetTargetArch()
  1386. if GetTarget() == "android":
  1387. # Most of the specific optimization flags here were
  1388. # just copied from the default Android Makefiles.
  1389. if "ANDROID_API" in SDK:
  1390. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1391. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1392. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1393. cmd += ' -ffunction-sections -funwind-tables'
  1394. if arch == 'armv7a':
  1395. cmd += ' -target armv7-none-linux-androideabi'
  1396. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1397. cmd += ' -fno-integrated-as'
  1398. elif arch == 'arm':
  1399. cmd += ' -target armv5te-none-linux-androideabi'
  1400. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1401. cmd += ' -fno-integrated-as'
  1402. elif arch == 'aarch64':
  1403. cmd += ' -target aarch64-none-linux-android'
  1404. elif arch == 'mips':
  1405. cmd += ' -target mipsel-none-linux-android'
  1406. cmd += ' -mips32'
  1407. elif arch == 'mips64':
  1408. cmd += ' -target mips64el-none-linux-android'
  1409. cmd += ' -fintegrated-as'
  1410. elif arch == 'x86':
  1411. cmd += ' -target i686-none-linux-android'
  1412. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1413. cmd += ' -mstackrealign'
  1414. elif arch == 'x86_64':
  1415. cmd += ' -target x86_64-none-linux-android'
  1416. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1417. cmd += " -Wa,--noexecstack"
  1418. # Do we want thumb or arm instructions?
  1419. if arch.startswith('arm'):
  1420. if optlevel >= 3:
  1421. cmd += ' -mthumb'
  1422. else:
  1423. cmd += ' -marm'
  1424. # Enable SIMD instructions if requested
  1425. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1426. cmd += ' -mfpu=neon'
  1427. else:
  1428. cmd += " -pthread"
  1429. if not src.endswith(".c"):
  1430. # We don't use exceptions for most modules.
  1431. if 'EXCEPTIONS' in opts:
  1432. cmd += " -fexceptions"
  1433. else:
  1434. cmd += " -fno-exceptions"
  1435. if src.endswith(".mm"):
  1436. # Work around Apple compiler bug.
  1437. cmd += " -U__EXCEPTIONS"
  1438. target = GetTarget()
  1439. if 'RTTI' not in opts and target != "darwin":
  1440. # We always disable RTTI on Android for memory usage reasons.
  1441. if optlevel >= 4 or target == "android":
  1442. cmd += " -fno-rtti"
  1443. if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
  1444. cmd += " -msse2"
  1445. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1446. cmd += " -fno-strict-aliasing"
  1447. # Certain clang versions crash when passing these math flags while
  1448. # compiling Objective-C++ code
  1449. if not src.endswith(".m") and not src.endswith(".mm"):
  1450. if optlevel >= 3:
  1451. cmd += " -ffast-math -fno-stack-protector"
  1452. if optlevel == 3:
  1453. # Fast math is nice, but we'd like to see NaN in dev builds.
  1454. cmd += " -fno-finite-math-only"
  1455. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1456. cmd += " -fno-unsafe-math-optimizations"
  1457. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1458. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1459. if (optlevel==3): cmd += " -O2"
  1460. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1461. # Enable more warnings.
  1462. cmd += " -Wall -Wno-unused-function"
  1463. if not src.endswith(".c"):
  1464. cmd += " -Wno-reorder"
  1465. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1466. if optlevel == 4:
  1467. cmd += " -Wno-unused-variable"
  1468. if src.endswith(".c"):
  1469. cmd += ' ' + CFLAGS
  1470. else:
  1471. cmd += ' ' + CXXFLAGS
  1472. cmd = cmd.rstrip()
  1473. building = GetValueOption(opts, "BUILDING:")
  1474. if (building): cmd += " -DBUILDING_" + building
  1475. cmd += ' ' + BracketNameWithQuotes(src)
  1476. oscmd(cmd)
  1477. ########################################################################
  1478. ##
  1479. ## CompileBison
  1480. ##
  1481. ########################################################################
  1482. def CompileBison(wobj, wsrc, opts):
  1483. ifile = os.path.basename(wsrc)
  1484. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1485. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1486. pre = GetValueOption(opts, "BISONPREFIX_")
  1487. bison = GetBison()
  1488. if bison is None:
  1489. # We don't have bison. See if there is a prebuilt file.
  1490. base, ext = os.path.splitext(wsrc)
  1491. if os.path.isfile(base + '.h.prebuilt') and \
  1492. os.path.isfile(base + '.cxx.prebuilt'):
  1493. CopyFile(wdstc, base + '.cxx.prebuilt')
  1494. CopyFile(wdsth, base + '.h.prebuilt')
  1495. else:
  1496. exit('Could not find bison!')
  1497. else:
  1498. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1499. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1500. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1501. # Finally, compile the generated source file.
  1502. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1503. ########################################################################
  1504. ##
  1505. ## CompileFlex
  1506. ##
  1507. ########################################################################
  1508. def CompileFlex(wobj,wsrc,opts):
  1509. ifile = os.path.basename(wsrc)
  1510. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1511. pre = GetValueOption(opts, "BISONPREFIX_")
  1512. dashi = opts.count("FLEXDASHI")
  1513. flex = GetFlex()
  1514. want_version = GetValueOption(opts, "FLEXVERSION:")
  1515. if flex and want_version:
  1516. # Is flex at the required version for this file?
  1517. want_version = tuple(map(int, want_version.split('.')))
  1518. have_version = GetFlexVersion()
  1519. if want_version > have_version:
  1520. Warn("Skipping flex %s for file %s, need at least %s" % (
  1521. '.'.join(map(str, have_version)),
  1522. ifile,
  1523. '.'.join(map(str, want_version)),
  1524. ))
  1525. flex = None
  1526. if flex is None:
  1527. # We don't have flex. See if there is a prebuilt file.
  1528. base, ext = os.path.splitext(wsrc)
  1529. if os.path.isfile(base + '.cxx.prebuilt'):
  1530. CopyFile(wdst, base + '.cxx.prebuilt')
  1531. else:
  1532. exit('Could not find flex!')
  1533. else:
  1534. if (dashi):
  1535. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1536. else:
  1537. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1538. # Finally, compile the generated source file.
  1539. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1540. ########################################################################
  1541. ##
  1542. ## CompileIgate
  1543. ##
  1544. ########################################################################
  1545. def CompileIgate(woutd,wsrc,opts):
  1546. outbase = os.path.basename(woutd)[:-3]
  1547. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1548. srcdir = GetValueOption(opts, "SRCDIR:")
  1549. module = GetValueOption(opts, "IMOD:")
  1550. library = GetValueOption(opts, "ILIB:")
  1551. ipath = GetListOption(opts, "DIR:")
  1552. if (PkgSkip("PYTHON")):
  1553. WriteFile(woutc, "")
  1554. WriteFile(woutd, "")
  1555. ConditionalWriteFile(woutd, "")
  1556. return
  1557. if not CrossCompiling():
  1558. # If we're compiling for this platform, we can use the one we've built.
  1559. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1560. else:
  1561. # Assume that interrogate is on the PATH somewhere.
  1562. cmd = 'interrogate'
  1563. if GetVerbose():
  1564. cmd += ' -v'
  1565. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1566. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1567. if (COMPILER=="MSVC"):
  1568. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1569. if GetTargetArch() == 'x64':
  1570. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1571. else:
  1572. cmd += ' -D_M_IX86'
  1573. # NOTE: this 1600 value is the version number for VC2010.
  1574. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1575. if (COMPILER=="GCC"):
  1576. cmd += ' -D__attribute__\\(x\\)='
  1577. target_arch = GetTargetArch()
  1578. if target_arch in ("x86_64", "amd64"):
  1579. cmd += ' -D_LP64'
  1580. elif target_arch in ('aarch64', 'arm64'):
  1581. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1582. else:
  1583. cmd += ' -D__i386__'
  1584. target = GetTarget()
  1585. if target == 'darwin':
  1586. cmd += ' -D__APPLE__'
  1587. elif target == 'android':
  1588. cmd += ' -D__ANDROID__'
  1589. optlevel = GetOptimizeOption(opts)
  1590. if (optlevel==1): cmd += ' -D_DEBUG'
  1591. if (optlevel==2): cmd += ' -D_DEBUG'
  1592. if (optlevel==3): pass
  1593. if (optlevel==4): cmd += ' -DNDEBUG'
  1594. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1595. cmd += ' -fnames -string -refcount -assert -python-native'
  1596. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1597. # Add -I, -S and -D flags
  1598. for x in ipath:
  1599. cmd += ' -I' + BracketNameWithQuotes(x)
  1600. for (opt,dir) in INCDIRECTORIES:
  1601. if (opt=="ALWAYS") or (opt in opts):
  1602. cmd += ' -S' + BracketNameWithQuotes(dir)
  1603. for (opt,var,val) in DEFSYMBOLS:
  1604. if (opt=="ALWAYS") or (opt in opts):
  1605. cmd += ' -D' + var + '=' + val
  1606. #building = GetValueOption(opts, "BUILDING:")
  1607. #if (building): cmd += " -DBUILDING_"+building
  1608. cmd += ' -module ' + module + ' -library ' + library
  1609. for x in wsrc:
  1610. if (x.startswith("/")):
  1611. cmd += ' ' + BracketNameWithQuotes(x)
  1612. else:
  1613. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1614. oscmd(cmd)
  1615. ########################################################################
  1616. ##
  1617. ## CompileImod
  1618. ##
  1619. ########################################################################
  1620. def CompileImod(wobj, wsrc, opts):
  1621. module = GetValueOption(opts, "IMOD:")
  1622. library = GetValueOption(opts, "ILIB:")
  1623. if (COMPILER=="MSVC"):
  1624. woutc = wobj[:-4]+".cxx"
  1625. if (COMPILER=="GCC"):
  1626. woutc = wobj[:-2]+".cxx"
  1627. if (PkgSkip("PYTHON")):
  1628. WriteFile(woutc, "")
  1629. CompileCxx(wobj, woutc, opts)
  1630. return
  1631. if not CrossCompiling():
  1632. # If we're compiling for this platform, we can use the one we've built.
  1633. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1634. else:
  1635. # Assume that interrogate_module is on the PATH somewhere.
  1636. cmd = 'interrogate_module'
  1637. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1638. importmod = GetValueOption(opts, "IMPORT:")
  1639. if importmod:
  1640. cmd += ' -import ' + importmod
  1641. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1642. oscmd(cmd)
  1643. CompileCxx(wobj,woutc,opts)
  1644. return
  1645. ########################################################################
  1646. ##
  1647. ## CompileLib
  1648. ##
  1649. ########################################################################
  1650. def CompileLib(lib, obj, opts):
  1651. if (COMPILER=="MSVC"):
  1652. if not BOOUSEINTELCOMPILER:
  1653. #Use MSVC Linker
  1654. cmd = 'link /lib /nologo'
  1655. if GetOptimizeOption(opts) == 4:
  1656. cmd += " /LTCG"
  1657. if HasTargetArch():
  1658. cmd += " /MACHINE:" + GetTargetArch().upper()
  1659. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1660. for x in obj:
  1661. if not x.endswith('.lib'):
  1662. cmd += ' ' + BracketNameWithQuotes(x)
  1663. oscmd(cmd)
  1664. else:
  1665. # Choose Intel linker; from Jean-Claude
  1666. cmd = 'xilink /verbose:lib /lib '
  1667. if HasTargetArch():
  1668. cmd += " /MACHINE:" + GetTargetArch().upper()
  1669. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1670. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1671. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1672. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1673. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1674. oscmd(cmd)
  1675. if (COMPILER=="GCC"):
  1676. if GetTarget() == 'darwin':
  1677. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1678. else:
  1679. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1680. for x in obj:
  1681. if GetLinkAllStatic() and x.endswith('.a'):
  1682. continue
  1683. cmd += ' ' + BracketNameWithQuotes(x)
  1684. oscmd(cmd)
  1685. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1686. ########################################################################
  1687. ##
  1688. ## CompileLink
  1689. ##
  1690. ########################################################################
  1691. def CompileLink(dll, obj, opts):
  1692. if (COMPILER=="MSVC"):
  1693. if not BOOUSEINTELCOMPILER:
  1694. cmd = "link /nologo "
  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 /nod:atlsd"
  1701. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1702. optlevel = GetOptimizeOption(opts)
  1703. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1704. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1705. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1706. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1707. if ("MFC" in opts):
  1708. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1709. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1710. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1711. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1712. if not PkgSkip("PYTHON"):
  1713. # If we're building without Python, don't pick it up implicitly.
  1714. if "PYTHON" not in opts:
  1715. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1716. if optlevel <= 2:
  1717. cmd += ' /NOD:{}d.lib'.format(pythonv)
  1718. else:
  1719. cmd += ' /NOD:{}.lib'.format(pythonv)
  1720. # Yes, we know we are importing "locally defined symbols".
  1721. for x in obj:
  1722. if x.endswith('libp3pystub.lib'):
  1723. cmd += ' /ignore:4049,4217'
  1724. break
  1725. # Set the subsystem. Specify that we want to target Windows XP.
  1726. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1727. cmd += " /SUBSYSTEM:" + subsystem
  1728. if GetTargetArch() == 'x64':
  1729. cmd += ",5.02"
  1730. else:
  1731. cmd += ",5.01"
  1732. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1733. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1734. for (opt, dir) in LIBDIRECTORIES:
  1735. if (opt=="ALWAYS") or (opt in opts):
  1736. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1737. for x in obj:
  1738. if x.endswith(".dll") or x.endswith(".pyd"):
  1739. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1740. elif x.endswith(".lib"):
  1741. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1742. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1743. exit("Error: in makepanda, specify "+dname+", not "+x)
  1744. cmd += ' ' + BracketNameWithQuotes(x)
  1745. elif x.endswith(".def"):
  1746. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1747. elif x.endswith(".dat"):
  1748. pass
  1749. else:
  1750. cmd += ' ' + BracketNameWithQuotes(x)
  1751. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1752. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1753. for (opt, name) in LIBNAMES:
  1754. if (opt=="ALWAYS") or (opt in opts):
  1755. cmd += " " + BracketNameWithQuotes(name)
  1756. oscmd(cmd)
  1757. else:
  1758. cmd = "xilink"
  1759. if GetVerbose(): cmd += " /verbose:lib"
  1760. if HasTargetArch():
  1761. cmd += " /MACHINE:" + GetTargetArch().upper()
  1762. if ("MFC" not in opts):
  1763. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1764. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1765. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1766. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1767. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1768. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1769. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1770. optlevel = GetOptimizeOption(opts)
  1771. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1772. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1773. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1774. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1775. if ("MFC" in opts):
  1776. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1777. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1778. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1779. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1780. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1781. if subsystem:
  1782. cmd += " /SUBSYSTEM:" + subsystem
  1783. if dll.endswith(".dll"):
  1784. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1785. for (opt, dir) in LIBDIRECTORIES:
  1786. if (opt=="ALWAYS") or (opt in opts):
  1787. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1788. for x in obj:
  1789. if x.endswith(".dll") or x.endswith(".pyd"):
  1790. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1791. elif x.endswith(".lib"):
  1792. dname = os.path.splitext(dll)[0]+".dll"
  1793. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1794. exit("Error: in makepanda, specify "+dname+", not "+x)
  1795. cmd += ' ' + BracketNameWithQuotes(x)
  1796. elif x.endswith(".def"):
  1797. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1798. elif x.endswith(".dat"):
  1799. pass
  1800. else:
  1801. cmd += ' ' + BracketNameWithQuotes(x)
  1802. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1803. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1804. for (opt, name) in LIBNAMES:
  1805. if (opt=="ALWAYS") or (opt in opts):
  1806. cmd += " " + BracketNameWithQuotes(name)
  1807. oscmd(cmd)
  1808. if COMPILER == "GCC":
  1809. cxx = GetCXX()
  1810. if GetOrigExt(dll) == ".exe":
  1811. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1812. if GetTarget() == "android":
  1813. # Necessary to work around an issue with libandroid depending on vendor libraries
  1814. cmd += ' -Wl,--allow-shlib-undefined'
  1815. else:
  1816. if (GetTarget() == "darwin"):
  1817. cmd = cxx + ' -undefined dynamic_lookup'
  1818. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1819. cmd += ' -bundle '
  1820. else:
  1821. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1822. cmd += ' -dynamiclib -install_name ' + install_name
  1823. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1824. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1825. else:
  1826. cmd = cxx + ' -shared'
  1827. # Always set soname on Android to avoid a linker warning when loading the library.
  1828. if "MODULE" not in opts or GetTarget() == 'android':
  1829. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1830. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1831. for x in obj:
  1832. if GetOrigExt(x) != ".dat":
  1833. cmd += ' ' + x
  1834. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1835. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1836. # macOS specific flags.
  1837. if GetTarget() == 'darwin':
  1838. cmd += " -headerpad_max_install_names"
  1839. if OSXTARGET is not None:
  1840. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1841. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1842. elif platform.mac_ver()[0].startswith('11.'):
  1843. cmd += " -mmacosx-version-min=11.0"
  1844. for arch in OSX_ARCHS:
  1845. if 'NOARCH:' + arch.upper() not in opts:
  1846. cmd += " -arch %s" % arch
  1847. elif GetTarget() == 'android':
  1848. arch = GetTargetArch()
  1849. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1850. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1851. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1852. if arch == 'armv7a':
  1853. cmd += ' -target armv7-none-linux-androideabi'
  1854. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1855. elif arch == 'arm':
  1856. cmd += ' -target armv5te-none-linux-androideabi'
  1857. elif arch == 'aarch64':
  1858. cmd += ' -target aarch64-none-linux-android'
  1859. elif arch == 'mips':
  1860. cmd += ' -target mipsel-none-linux-android'
  1861. cmd += ' -mips32'
  1862. elif arch == 'mips64':
  1863. cmd += ' -target mips64el-none-linux-android'
  1864. elif arch == 'x86':
  1865. cmd += ' -target i686-none-linux-android'
  1866. elif arch == 'x86_64':
  1867. cmd += ' -target x86_64-none-linux-android'
  1868. cmd += ' -lc -lm'
  1869. else:
  1870. cmd += " -pthread"
  1871. if "SYSROOT" in SDK:
  1872. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1873. if LDFLAGS != "":
  1874. cmd += " " + LDFLAGS
  1875. # Don't link libraries with Python, except on Android.
  1876. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1877. opts = opts[:]
  1878. opts.remove("PYTHON")
  1879. for (opt, dir) in LIBDIRECTORIES:
  1880. if (opt=="ALWAYS") or (opt in opts):
  1881. cmd += ' -L' + BracketNameWithQuotes(dir)
  1882. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1883. if (opt=="ALWAYS") or (opt in opts):
  1884. cmd += ' -F' + BracketNameWithQuotes(dir)
  1885. for (opt, name) in LIBNAMES:
  1886. if (opt=="ALWAYS") or (opt in opts):
  1887. cmd += ' ' + BracketNameWithQuotes(name)
  1888. if GetTarget() != 'freebsd':
  1889. cmd += " -ldl"
  1890. oscmd(cmd)
  1891. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1892. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1893. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1894. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1895. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1896. if os.path.isfile(newdll):
  1897. os.remove(newdll)
  1898. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1899. elif dll.endswith("." + MAJOR_VERSION):
  1900. newdll = dll[:-len(MAJOR_VERSION)-1]
  1901. if os.path.isfile(newdll):
  1902. os.remove(newdll)
  1903. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1904. ##########################################################################################
  1905. #
  1906. # CompileEgg
  1907. #
  1908. ##########################################################################################
  1909. def CompileEgg(eggfile, src, opts):
  1910. pz = False
  1911. if eggfile.endswith(".pz"):
  1912. pz = True
  1913. eggfile = eggfile[:-3]
  1914. # Determine the location of the pzip and flt2egg tools.
  1915. if CrossCompiling():
  1916. # We may not be able to use our generated versions of these tools,
  1917. # so we'll expect them to already be present in the PATH.
  1918. pzip = 'pzip'
  1919. flt2egg = 'flt2egg'
  1920. else:
  1921. # If we're compiling for this machine, we can use the binaries we've built.
  1922. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1923. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1924. if not os.path.isfile(pzip):
  1925. pzip = 'pzip'
  1926. if not os.path.isfile(flt2egg):
  1927. flt2egg = 'flt2egg'
  1928. if src.endswith(".egg"):
  1929. CopyFile(eggfile, src)
  1930. elif src.endswith(".flt"):
  1931. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1932. if pz:
  1933. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1934. ##########################################################################################
  1935. #
  1936. # CompileRes, CompileRsrc
  1937. #
  1938. ##########################################################################################
  1939. def CompileRes(target, src, opts):
  1940. """Compiles a Windows .rc file into a .res file."""
  1941. ipath = GetListOption(opts, "DIR:")
  1942. if (COMPILER == "MSVC"):
  1943. cmd = "rc"
  1944. cmd += " /Fo" + BracketNameWithQuotes(target)
  1945. for x in ipath: cmd += " /I" + x
  1946. for (opt,dir) in INCDIRECTORIES:
  1947. if (opt=="ALWAYS") or (opt in opts):
  1948. cmd += " /I" + BracketNameWithQuotes(dir)
  1949. for (opt,var,val) in DEFSYMBOLS:
  1950. if (opt=="ALWAYS") or (opt in opts):
  1951. cmd += " /D" + var + "=" + val
  1952. cmd += " " + BracketNameWithQuotes(src)
  1953. else:
  1954. cmd = "windres"
  1955. for x in ipath: cmd += " -I" + x
  1956. for (opt,dir) in INCDIRECTORIES:
  1957. if (opt=="ALWAYS") or (opt in opts):
  1958. cmd += " -I" + BracketNameWithQuotes(dir)
  1959. for (opt,var,val) in DEFSYMBOLS:
  1960. if (opt=="ALWAYS") or (opt in opts):
  1961. cmd += " -D" + var + "=" + val
  1962. cmd += " -i " + BracketNameWithQuotes(src)
  1963. cmd += " -o " + BracketNameWithQuotes(target)
  1964. oscmd(cmd)
  1965. def CompileRsrc(target, src, opts):
  1966. """Compiles a Mac OS .r file into an .rsrc file."""
  1967. ipath = GetListOption(opts, "DIR:")
  1968. if os.path.isfile("/usr/bin/Rez"):
  1969. cmd = "Rez -useDF"
  1970. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1971. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1972. else:
  1973. cmd = "/Developer/Tools/Rez -useDF"
  1974. cmd += " -o " + BracketNameWithQuotes(target)
  1975. for x in ipath:
  1976. cmd += " -i " + x
  1977. for (opt,dir) in INCDIRECTORIES:
  1978. if (opt=="ALWAYS") or (opt in opts):
  1979. cmd += " -i " + BracketNameWithQuotes(dir)
  1980. for (opt,var,val) in DEFSYMBOLS:
  1981. if (opt=="ALWAYS") or (opt in opts):
  1982. if (val == ""):
  1983. cmd += " -d " + var
  1984. else:
  1985. cmd += " -d " + var + " = " + val
  1986. cmd += " " + BracketNameWithQuotes(src)
  1987. oscmd(cmd)
  1988. ##########################################################################################
  1989. #
  1990. # CompileJava (Android only)
  1991. #
  1992. ##########################################################################################
  1993. def CompileJava(target, src, opts):
  1994. """Compiles a .java file into a .class file."""
  1995. if GetHost() == 'android':
  1996. cmd = "ecj "
  1997. else:
  1998. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  1999. optlevel = GetOptimizeOption(opts)
  2000. if optlevel >= 4:
  2001. cmd += "-debug:none "
  2002. cmd += "-cp " + GetOutputDir() + "/classes "
  2003. cmd += "-d " + GetOutputDir() + "/classes "
  2004. cmd += BracketNameWithQuotes(src)
  2005. oscmd(cmd)
  2006. ##########################################################################################
  2007. #
  2008. # FreezePy
  2009. #
  2010. ##########################################################################################
  2011. def FreezePy(target, inputs, opts):
  2012. assert len(inputs) > 0
  2013. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  2014. if sys.version_info >= (2, 6):
  2015. cmdstr += "-B "
  2016. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  2017. if 'FREEZE_STARTUP' in opts:
  2018. cmdstr += " -s"
  2019. if GetOrigExt(target) == '.exe':
  2020. src = inputs.pop(0)
  2021. else:
  2022. src = ""
  2023. for i in inputs:
  2024. i = os.path.splitext(i)[0]
  2025. i = i.replace('/', '.')
  2026. if i.startswith('direct.src'):
  2027. i = i.replace('.src.', '.')
  2028. cmdstr += " -i " + i
  2029. cmdstr += " -o " + target + " " + src
  2030. if ("LINK_PYTHON_STATIC" in opts):
  2031. os.environ["LINK_PYTHON_STATIC"] = "1"
  2032. oscmd(cmdstr)
  2033. if ("LINK_PYTHON_STATIC" in os.environ):
  2034. del os.environ["LINK_PYTHON_STATIC"]
  2035. if (not os.path.exists(target)):
  2036. exit("FREEZER_ERROR")
  2037. ##########################################################################################
  2038. #
  2039. # Package
  2040. #
  2041. ##########################################################################################
  2042. def Package(target, inputs, opts):
  2043. assert len(inputs) == 1
  2044. # Invoke the ppackage script.
  2045. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  2046. if GetOptimizeOption(opts) >= 4:
  2047. command += "-OO "
  2048. if sys.version_info >= (2, 6):
  2049. command += "-B "
  2050. command += "direct/src/p3d/ppackage.py"
  2051. if not RTDIST:
  2052. # Don't compile Python sources, because we might not running in the same
  2053. # Python version as the selected host.
  2054. command += " -N"
  2055. if GetTarget() == "darwin":
  2056. if SDK.get("MACOSX"):
  2057. command += " -R \"%s\"" % SDK["MACOSX"]
  2058. for arch in OSX_ARCHS:
  2059. if arch == "x86_64":
  2060. arch = "amd64"
  2061. command += " -P osx_%s" % arch
  2062. command += " -i \"" + GetOutputDir() + "/stage\""
  2063. if (P3DSUFFIX):
  2064. command += ' -a "' + P3DSUFFIX + '"'
  2065. command += " " + inputs[0]
  2066. if GetOrigExt(target) == '.p3d':
  2067. # Build a specific .p3d file.
  2068. basename = os.path.basename(os.path.splitext(target)[0])
  2069. command += " " + basename
  2070. oscmd(command)
  2071. if GetTarget() == 'windows':
  2072. # Make an .exe that calls this .p3d.
  2073. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2074. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2075. exefile = FindLocation(basename + '.exe', [])
  2076. CompileLink(exefile, [objfile], ['ADVAPI'])
  2077. # Move it to the bin directory.
  2078. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2079. if sys.platform != 'win32':
  2080. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2081. else:
  2082. # This is presumably a package or set of packages.
  2083. oscmd(command)
  2084. ##########################################################################################
  2085. #
  2086. # CompileBundle
  2087. #
  2088. ##########################################################################################
  2089. def CompileBundle(target, inputs, opts):
  2090. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2091. plist = None
  2092. resources = []
  2093. objects = []
  2094. for i in inputs:
  2095. if (i.endswith(".plist")):
  2096. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2097. plist = i
  2098. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2099. resources.append(i)
  2100. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2101. objects.append(i)
  2102. else:
  2103. exit("Don't know how to bundle file %s" % i)
  2104. # Now link the object files to form the bundle.
  2105. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2106. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2107. oscmd("rm -rf %s" % target)
  2108. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2109. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2110. if target.endswith(".app"):
  2111. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2112. else:
  2113. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2114. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2115. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2116. for r in resources:
  2117. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2118. ##########################################################################################
  2119. #
  2120. # CompileMIDL
  2121. #
  2122. ##########################################################################################
  2123. def CompileMIDL(target, src, opts):
  2124. ipath = GetListOption(opts, "DIR:")
  2125. if (COMPILER=="MSVC"):
  2126. cmd = "midl"
  2127. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2128. for x in ipath: cmd += " /I" + x
  2129. for (opt,dir) in INCDIRECTORIES:
  2130. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2131. for (opt,var,val) in DEFSYMBOLS:
  2132. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2133. cmd += " " + BracketNameWithQuotes(src)
  2134. oscmd(cmd)
  2135. ##########################################################################################
  2136. #
  2137. # CompileAnything
  2138. #
  2139. ##########################################################################################
  2140. def CompileAnything(target, inputs, opts, progress = None):
  2141. if (opts.count("DEPENDENCYONLY")):
  2142. return
  2143. if (len(inputs)==0):
  2144. exit("No input files for target "+target)
  2145. infile = inputs[0]
  2146. origsuffix = GetOrigExt(target)
  2147. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2148. # It must be a simple copy operation.
  2149. ProgressOutput(progress, "Copying file", target)
  2150. CopyFile(target, infile)
  2151. if (origsuffix==".exe" and GetHost() != "windows"):
  2152. os.system("chmod +x \"%s\"" % target)
  2153. return
  2154. elif (infile.endswith(".py")):
  2155. if origsuffix == ".obj":
  2156. source = os.path.splitext(target)[0] + ".c"
  2157. SetOrigExt(source, ".c")
  2158. ProgressOutput(progress, "Building frozen source", source)
  2159. FreezePy(source, inputs, opts)
  2160. ProgressOutput(progress, "Building C++ object", target)
  2161. return CompileCxx(target, source, opts)
  2162. if origsuffix == ".exe":
  2163. ProgressOutput(progress, "Building frozen executable", target)
  2164. else:
  2165. ProgressOutput(progress, "Building frozen library", target)
  2166. return FreezePy(target, inputs, opts)
  2167. elif (infile.endswith(".idl")):
  2168. ProgressOutput(progress, "Compiling MIDL file", infile)
  2169. return CompileMIDL(target, infile, opts)
  2170. elif (infile.endswith(".pdef")):
  2171. if origsuffix == '.p3d':
  2172. ProgressOutput(progress, "Building package", target)
  2173. else:
  2174. ProgressOutput(progress, "Building package from pdef file", infile)
  2175. return Package(target, inputs, opts)
  2176. elif origsuffix in SUFFIX_LIB:
  2177. ProgressOutput(progress, "Linking static library", target)
  2178. return CompileLib(target, inputs, opts)
  2179. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2180. if (origsuffix==".exe"):
  2181. ProgressOutput(progress, "Linking executable", target)
  2182. else:
  2183. ProgressOutput(progress, "Linking dynamic library", target)
  2184. # Add version number to the dynamic library, on unix
  2185. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2186. tplatform = GetTarget()
  2187. if tplatform == "darwin":
  2188. # On Mac, libraries are named like libpanda.1.2.dylib
  2189. if target.lower().endswith(".dylib"):
  2190. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2191. SetOrigExt(target, origsuffix)
  2192. elif tplatform != "windows" and tplatform != "android":
  2193. # On Linux, libraries are named like libpanda.so.1.2
  2194. target += "." + MAJOR_VERSION
  2195. SetOrigExt(target, origsuffix)
  2196. return CompileLink(target, inputs, opts)
  2197. elif (origsuffix==".in"):
  2198. ProgressOutput(progress, "Building Interrogate database", target)
  2199. return CompileIgate(target, inputs, opts)
  2200. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2201. ProgressOutput(progress, "Building plugin bundle", target)
  2202. return CompileBundle(target, inputs, opts)
  2203. elif (origsuffix==".app"):
  2204. ProgressOutput(progress, "Building application bundle", target)
  2205. return CompileBundle(target, inputs, opts)
  2206. elif (origsuffix==".pz"):
  2207. ProgressOutput(progress, "Compressing", target)
  2208. return CompileEgg(target, infile, opts)
  2209. elif (origsuffix==".egg"):
  2210. ProgressOutput(progress, "Converting", target)
  2211. return CompileEgg(target, infile, opts)
  2212. elif (origsuffix==".res"):
  2213. ProgressOutput(progress, "Building resource object", target)
  2214. return CompileRes(target, infile, opts)
  2215. elif (origsuffix==".rsrc"):
  2216. ProgressOutput(progress, "Building resource object", target)
  2217. return CompileRsrc(target, infile, opts)
  2218. elif (origsuffix==".class"):
  2219. ProgressOutput(progress, "Building Java class", target)
  2220. return CompileJava(target, infile, opts)
  2221. elif (origsuffix==".obj"):
  2222. if (infile.endswith(".cxx")):
  2223. ProgressOutput(progress, "Building C++ object", target)
  2224. return CompileCxx(target, infile, opts)
  2225. elif (infile.endswith(".c")):
  2226. ProgressOutput(progress, "Building C object", target)
  2227. return CompileCxx(target, infile, opts)
  2228. elif (infile.endswith(".mm")):
  2229. ProgressOutput(progress, "Building Objective-C++ object", target)
  2230. return CompileCxx(target, infile, opts)
  2231. elif (infile.endswith(".yxx")):
  2232. ProgressOutput(progress, "Building Bison object", target)
  2233. return CompileBison(target, infile, opts)
  2234. elif (infile.endswith(".lxx")):
  2235. ProgressOutput(progress, "Building Flex object", target)
  2236. return CompileFlex(target, infile, opts)
  2237. elif (infile.endswith(".in")):
  2238. ProgressOutput(progress, "Building Interrogate object", target)
  2239. return CompileImod(target, inputs, opts)
  2240. elif (infile.endswith(".rc")):
  2241. ProgressOutput(progress, "Building resource object", target)
  2242. return CompileRes(target, infile, opts)
  2243. elif (infile.endswith(".r")):
  2244. ProgressOutput(progress, "Building resource object", target)
  2245. return CompileRsrc(target, infile, opts)
  2246. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2247. ##########################################################################################
  2248. #
  2249. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2250. #
  2251. ##########################################################################################
  2252. DTOOL_CONFIG=[
  2253. #_Variable_________________________Windows___________________Unix__________
  2254. ("HAVE_PYTHON", '1', '1'),
  2255. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2256. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2257. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2258. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2259. ("HAVE_MAYA", '1', '1'),
  2260. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2261. ("USE_PANDAFILESTREAM", '1', '1'),
  2262. ("USE_DELETED_CHAIN", '1', '1'),
  2263. ("HAVE_WGL", '1', 'UNDEF'),
  2264. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2265. ("HAVE_THREADS", '1', '1'),
  2266. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2267. ("OS_SIMPLE_THREADS", '1', '1'),
  2268. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2269. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2270. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2271. ("HAVE_AUDIO", '1', '1'),
  2272. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2273. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2274. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2275. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2276. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2277. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2278. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2279. ("DO_PIPELINING", '1', '1'),
  2280. ("DEFAULT_PATHSEP", '";"', '":"'),
  2281. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2282. ("PHAVE_LOCKF", '1', '1'),
  2283. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2284. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2285. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2286. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2287. ("HAVE_GETOPT", 'UNDEF', '1'),
  2288. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2289. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2290. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2291. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2292. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2293. ("HAVE_IOS_BINARY", '1', '1'),
  2294. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2295. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2296. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2297. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2298. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2299. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2300. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2301. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', 'UNDEF'),
  2302. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2303. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2304. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2305. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2306. ("PHAVE_IO_H", '1', 'UNDEF'),
  2307. ("PHAVE_IOSTREAM", '1', '1'),
  2308. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2309. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2310. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2311. ("PHAVE_MALLOC_H", '1', '1'),
  2312. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2313. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2314. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2315. ("PHAVE_SSTREAM", '1', '1'),
  2316. ("PHAVE_NEW", '1', '1'),
  2317. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2318. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2319. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2320. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2321. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2322. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2323. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2324. ("PHAVE_STDINT_H", '1', '1'),
  2325. ("HAVE_RTTI", '1', '1'),
  2326. ("HAVE_X11", 'UNDEF', '1'),
  2327. ("IS_LINUX", 'UNDEF', '1'),
  2328. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2329. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2330. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2331. ("LINMATH_ALIGN", '1', '1'),
  2332. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2333. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2334. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2335. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2336. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2337. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2338. ("HAVE_SGI_RGB", '1', '1'),
  2339. ("HAVE_TGA", '1', '1'),
  2340. ("HAVE_IMG", '1', '1'),
  2341. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2342. ("HAVE_BMP", '1', '1'),
  2343. ("HAVE_PNM", '1', '1'),
  2344. ("HAVE_STB_IMAGE", '1', '1'),
  2345. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2346. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2347. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2348. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2349. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2350. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2351. ("WANT_NATIVE_NET", '1', '1'),
  2352. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2353. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2354. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2355. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2356. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2357. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2358. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2359. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2360. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2361. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2362. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2363. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2364. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2365. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2366. # ("_SECURE_SCL", '0', 'UNDEF'),
  2367. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2368. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2369. ]
  2370. PRC_PARAMETERS=[
  2371. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2372. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2373. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2374. ("PRC_PATH2_ENVVARS", '""', '""'),
  2375. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2376. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2377. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2378. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2379. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2380. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2381. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2382. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2383. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2384. ]
  2385. def WriteConfigSettings():
  2386. dtool_config={}
  2387. prc_parameters={}
  2388. speedtree_parameters={}
  2389. plugin_config={}
  2390. if (GetTarget() == 'windows'):
  2391. for key,win,unix in DTOOL_CONFIG:
  2392. dtool_config[key] = win
  2393. for key,win,unix in PRC_PARAMETERS:
  2394. prc_parameters[key] = win
  2395. else:
  2396. for key,win,unix in DTOOL_CONFIG:
  2397. dtool_config[key] = unix
  2398. for key,win,unix in PRC_PARAMETERS:
  2399. prc_parameters[key] = unix
  2400. for x in PkgListGet():
  2401. if ("HAVE_"+x in dtool_config):
  2402. if (PkgSkip(x)==0):
  2403. dtool_config["HAVE_"+x] = '1'
  2404. else:
  2405. dtool_config["HAVE_"+x] = 'UNDEF'
  2406. dtool_config["HAVE_NET"] = '1'
  2407. if (PkgSkip("NVIDIACG")==0):
  2408. dtool_config["HAVE_CG"] = '1'
  2409. dtool_config["HAVE_CGGL"] = '1'
  2410. dtool_config["HAVE_CGDX9"] = '1'
  2411. if GetTarget() not in ("linux", "android"):
  2412. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2413. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2414. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2415. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2416. if (GetTarget() == "darwin"):
  2417. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2418. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2419. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2420. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2421. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2422. dtool_config["IS_LINUX"] = 'UNDEF'
  2423. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2424. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2425. dtool_config["IS_OSX"] = '1'
  2426. if (GetTarget() == "freebsd"):
  2427. dtool_config["IS_LINUX"] = 'UNDEF'
  2428. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2429. dtool_config["IS_FREEBSD"] = '1'
  2430. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2431. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2432. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2433. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2434. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2435. if (GetTarget() == "android"):
  2436. # Android does have RTTI, but we disable it anyway.
  2437. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2438. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2439. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2440. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2441. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2442. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2443. # This should probably be more sophisticated, such as based
  2444. # on whether the libRocket Python modules are available.
  2445. if (PkgSkip("PYTHON") != 0):
  2446. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2447. if (GetOptimize() <= 3):
  2448. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2449. if (GetOptimize() <= 3):
  2450. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2451. dtool_config["DO_PSTATS"] = '1'
  2452. if (GetOptimize() <= 3):
  2453. dtool_config["DO_DCAST"] = '1'
  2454. if (GetOptimize() <= 3):
  2455. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2456. if (GetOptimize() <= 3):
  2457. dtool_config["DO_MEMORY_USAGE"] = '1'
  2458. if (GetOptimize() <= 3):
  2459. dtool_config["NOTIFY_DEBUG"] = '1'
  2460. if (GetOptimize() >= 4):
  2461. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2462. if (GetOptimize() >= 4):
  2463. # Disable RTTI on release builds.
  2464. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2465. # Now that we have OS_SIMPLE_THREADS, we can support
  2466. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2467. # longer need to disable it for this platform.
  2468. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2469. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2470. if (RTDIST or RUNTIME):
  2471. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2472. if HOST_URL:
  2473. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2474. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2475. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2476. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2477. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2478. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2479. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2480. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2481. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2482. if PkgSkip("GTK2") == 0:
  2483. plugin_config["HAVE_GTK"] = '1'
  2484. if (RUNTIME):
  2485. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2486. # Whether it's present on the system doesn't matter here,
  2487. # as the runtime itself doesn't include or link with X11.
  2488. if (RUNTIME and GetTarget() == 'linux'):
  2489. dtool_config["HAVE_X11"] = '1'
  2490. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2491. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2492. else:
  2493. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2494. if (PkgSkip("SPEEDTREE")==0):
  2495. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2496. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2497. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2498. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2499. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2500. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2501. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2502. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2503. for key in sorted(prc_parameters.keys()):
  2504. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2505. val = OverrideValue(key, prc_parameters[key])
  2506. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2507. else: conf = conf + "#define " + key + " " + val + "\n"
  2508. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2509. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2510. for key in sorted(dtool_config.keys()):
  2511. val = OverrideValue(key, dtool_config[key])
  2512. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2513. # These are not available for ARM, period.
  2514. conf = conf + "#ifdef __aarch64__\n"
  2515. conf = conf + "#undef " + key + "\n"
  2516. conf = conf + "#else\n"
  2517. conf = conf + "#define " + key + " " + val + "\n"
  2518. conf = conf + "#endif\n"
  2519. elif val == 'UNDEF':
  2520. conf = conf + "#undef " + key + "\n"
  2521. else:
  2522. conf = conf + "#define " + key + " " + val + "\n"
  2523. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2524. if (RTDIST or RUNTIME):
  2525. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2526. for key in sorted(plugin_config.keys()):
  2527. val = plugin_config[key]
  2528. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2529. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2530. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2531. if (PkgSkip("SPEEDTREE")==0):
  2532. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2533. for key in sorted(speedtree_parameters.keys()):
  2534. val = OverrideValue(key, speedtree_parameters[key])
  2535. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2536. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2537. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2538. for x in PkgListGet():
  2539. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2540. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2541. # Finally, write a platform.dat with the platform we are compiling for.
  2542. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2543. # This is useful for tools like makepackage that need to know things about
  2544. # the build parameters.
  2545. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2546. WriteConfigSettings()
  2547. WarnConflictingFiles()
  2548. if SystemLibraryExists("dtoolbase"):
  2549. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2550. if SystemLibraryExists("p3dtoolconfig"):
  2551. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2552. ##########################################################################################
  2553. #
  2554. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2555. #
  2556. ##########################################################################################
  2557. PANDAVERSION_H="""
  2558. #define PANDA_MAJOR_VERSION $VERSION1
  2559. #define PANDA_MINOR_VERSION $VERSION2
  2560. #define PANDA_SEQUENCE_VERSION $VERSION3
  2561. #define PANDA_VERSION $NVERSION
  2562. #define PANDA_NUMERIC_VERSION $NVERSION
  2563. #define PANDA_VERSION_STR "$VERSION"
  2564. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2565. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2566. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2567. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2568. """
  2569. PANDAVERSION_H_RUNTIME="""
  2570. #define PANDA_MAJOR_VERSION 0
  2571. #define PANDA_MINOR_VERSION 0
  2572. #define PANDA_SEQUENCE_VERSION 0
  2573. #define PANDA_VERSION_STR "0.0.0"
  2574. #define PANDA_ABI_VERSION_STR "0.0"
  2575. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2576. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2577. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2578. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2579. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2580. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2581. #define PANDA_PACKAGE_VERSION_STR ""
  2582. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2583. """
  2584. CHECKPANDAVERSION_CXX="""
  2585. # include "dtoolbase.h"
  2586. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2587. """
  2588. CHECKPANDAVERSION_H="""
  2589. # ifndef CHECKPANDAVERSION_H
  2590. # define CHECKPANDAVERSION_H
  2591. # include "dtoolbase.h"
  2592. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2593. // Hack to forcibly depend on the check
  2594. template<typename T>
  2595. class CheckPandaVersion {
  2596. public:
  2597. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2598. };
  2599. template class CheckPandaVersion<void>;
  2600. # endif
  2601. """
  2602. P3DACTIVEX_RC="""#include "resource.h"
  2603. #define APSTUDIO_READONLY_SYMBOLS
  2604. #include "afxres.h"
  2605. #undef APSTUDIO_READONLY_SYMBOLS
  2606. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2607. #ifdef _WIN32
  2608. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2609. #pragma code_page(1252)
  2610. #endif
  2611. #ifdef APSTUDIO_INVOKED
  2612. 1 TEXTINCLUDE
  2613. BEGIN
  2614. "resource.h\\0"
  2615. END
  2616. 2 TEXTINCLUDE
  2617. BEGIN
  2618. "#include ""afxres.h""\\r\\n"
  2619. "\\0"
  2620. END
  2621. 3 TEXTINCLUDE
  2622. BEGIN
  2623. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2624. "\\0"
  2625. END
  2626. #endif
  2627. %s
  2628. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2629. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2630. STYLE DS_SETFONT | WS_CHILD
  2631. FONT 8, "MS Sans Serif"
  2632. BEGIN
  2633. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2634. IDC_STATIC,7,25,229,16
  2635. END
  2636. #ifdef APSTUDIO_INVOKED
  2637. GUIDELINES DESIGNINFO
  2638. BEGIN
  2639. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2640. BEGIN
  2641. LEFTMARGIN, 7
  2642. RIGHTMARGIN, 243
  2643. TOPMARGIN, 7
  2644. BOTTOMMARGIN, 55
  2645. END
  2646. END
  2647. #endif
  2648. STRINGTABLE
  2649. BEGIN
  2650. IDS_P3DACTIVEX "P3DActiveX Control"
  2651. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2652. END
  2653. STRINGTABLE
  2654. BEGIN
  2655. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2656. END
  2657. #endif
  2658. #ifndef APSTUDIO_INVOKED
  2659. 1 TYPELIB "P3DActiveX.tlb"
  2660. #endif"""
  2661. def CreatePandaVersionFiles():
  2662. version1=int(VERSION.split(".")[0])
  2663. version2=int(VERSION.split(".")[1])
  2664. version3=int(VERSION.split(".")[2])
  2665. nversion=version1*1000000+version2*1000+version3
  2666. if (DISTRIBUTOR != "cmu"):
  2667. # Subtract 1 if we are not an official version.
  2668. nversion -= 1
  2669. if (RUNTIME):
  2670. pandaversion_h = PANDAVERSION_H_RUNTIME
  2671. else:
  2672. pandaversion_h = PANDAVERSION_H
  2673. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2674. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2675. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2676. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2677. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2678. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2679. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2680. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2681. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2682. if (DISTRIBUTOR == "cmu"):
  2683. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2684. else:
  2685. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2686. if GIT_COMMIT:
  2687. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2688. # Allow creating a deterministic build by setting this.
  2689. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2690. if source_date:
  2691. # This matches the GCC / Clang format for __DATE__ __TIME__
  2692. source_date = time.gmtime(int(source_date))
  2693. try:
  2694. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2695. except ValueError:
  2696. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2697. if source_date[3:5] == ' 0':
  2698. source_date = source_date[:3] + ' ' + source_date[5:]
  2699. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2700. if not RUNTIME:
  2701. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2702. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2703. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2704. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2705. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2706. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2707. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2708. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2709. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2710. if RUNTIME:
  2711. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2712. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2713. else:
  2714. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2715. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2716. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2717. if RUNTIME:
  2718. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2719. "version" : VERSION,
  2720. "description" : "Runs 3-D games and interactive applets",
  2721. "filename" : "p3dactivex.ocx",
  2722. "mimetype" : "application/x-panda3d",
  2723. "extension" : "p3d",
  2724. "filedesc" : "Panda3D applet"}
  2725. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2726. CreatePandaVersionFiles()
  2727. ##########################################################################################
  2728. #
  2729. # Copy the "direct" tree
  2730. #
  2731. ##########################################################################################
  2732. if (PkgSkip("DIRECT")==0):
  2733. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2734. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2735. # This file used to be copied, but would nowadays cause conflicts.
  2736. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2737. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2738. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2739. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2740. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2741. # This directory doesn't exist at all any more.
  2742. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2743. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2744. # These files used to exist; remove them to avoid conflicts.
  2745. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2746. '_core.pyd', '_core.so',
  2747. 'direct.py', 'direct.pyc', 'direct.pyo',
  2748. '_direct.pyd', '_direct.so',
  2749. 'dtoolconfig.pyd', 'dtoolconfig.so']
  2750. for basename in del_files:
  2751. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2752. if os.path.isfile(path):
  2753. print("Removing %s" % (path))
  2754. os.remove(path)
  2755. # Write an appropriate panda3d/__init__.py
  2756. p3d_init = """"Python bindings for the Panda3D libraries"
  2757. __version__ = '%s'
  2758. """ % (WHLVERSION)
  2759. if GetTarget() == 'windows':
  2760. p3d_init += """
  2761. if '__file__' in locals():
  2762. import os
  2763. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2764. if os.path.isdir(bindir):
  2765. if hasattr(os, 'add_dll_directory'):
  2766. os.add_dll_directory(bindir)
  2767. elif not os.environ.get('PATH'):
  2768. os.environ['PATH'] = bindir
  2769. else:
  2770. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2771. del os, bindir
  2772. """
  2773. if not PkgSkip("PYTHON"):
  2774. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2775. # Also add this file, for backward compatibility.
  2776. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2777. '''Alias of :mod:`panda3d.interrogatedb`.
  2778. .. deprecated:: 1.10.0
  2779. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2780. '''
  2781. if __debug__:
  2782. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2783. from .interrogatedb import *
  2784. """)
  2785. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2786. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2787. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2788. os.remove(fn)
  2789. panda_modules = ['core']
  2790. if not PkgSkip("PANDAPHYSICS"):
  2791. panda_modules.append('physics')
  2792. if not PkgSkip('PANDAFX'):
  2793. panda_modules.append('fx')
  2794. if not PkgSkip("DIRECT"):
  2795. panda_modules.append('direct')
  2796. if not PkgSkip("VISION"):
  2797. panda_modules.append('vision')
  2798. if not PkgSkip("SKEL"):
  2799. panda_modules.append('skel')
  2800. if not PkgSkip("EGG"):
  2801. panda_modules.append('egg')
  2802. if not PkgSkip("ODE"):
  2803. panda_modules.append('ode')
  2804. if not PkgSkip("VRPN"):
  2805. panda_modules.append('vrpn')
  2806. panda_modules_code = """
  2807. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2808. if __debug__:
  2809. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2810. """
  2811. for module in panda_modules:
  2812. panda_modules_code += """
  2813. try:
  2814. from panda3d.%s import *
  2815. except ImportError as err:
  2816. if "No module named %s" not in str(err):
  2817. raise""" % (module, module)
  2818. panda_modules_code += """
  2819. from direct.showbase import DConfig
  2820. def get_config_showbase():
  2821. return DConfig
  2822. def get_config_express():
  2823. return DConfig
  2824. getConfigShowbase = get_config_showbase
  2825. getConfigExpress = get_config_express
  2826. """
  2827. exthelpers_code = """
  2828. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2829. from direct.extensions_native.extension_native_helpers import *
  2830. """
  2831. if not PkgSkip("PYTHON"):
  2832. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2833. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2834. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2835. ##########################################################################################
  2836. #
  2837. # Write the dist-info directory.
  2838. #
  2839. ##########################################################################################
  2840. # This is just some basic stuff since setuptools just needs this file to
  2841. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2842. # eventually want to merge this with the metadata generator in makewheel.py.
  2843. METADATA = """Metadata-Version: 2.0
  2844. Name: Panda3D
  2845. Version: {version}
  2846. License: BSD
  2847. Home-page: https://www.panda3d.org/
  2848. Author: Panda3D Team
  2849. Author-email: [email protected]
  2850. """
  2851. ENTRY_POINTS = """[distutils.commands]
  2852. build_apps = direct.dist.commands:build_apps
  2853. bdist_apps = direct.dist.commands:bdist_apps
  2854. """
  2855. if not PkgSkip("DIRECT"):
  2856. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2857. MakeDirectory(dist_dir)
  2858. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2859. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2860. ##########################################################################################
  2861. #
  2862. # Generate the PRC files into the ETC directory.
  2863. #
  2864. ##########################################################################################
  2865. confautoprc = ReadFile("makepanda/confauto.in")
  2866. if (PkgSkip("SPEEDTREE")==0):
  2867. # If SpeedTree is available, enable it in the config file
  2868. confautoprc = confautoprc.replace('#st#', '')
  2869. else:
  2870. # otherwise, disable it.
  2871. confautoprc = confautoprc.replace('#st#', '#')
  2872. confautoprc = confautoprc.replace('\r\n', '\n')
  2873. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2874. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2875. if PkgSkip("EGG") or GetLinkAllStatic():
  2876. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2877. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2878. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2879. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2880. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2881. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2882. if (os.path.isfile("makepanda/myconfig.in")):
  2883. configprc = ReadFile("makepanda/myconfig.in")
  2884. else:
  2885. configprc = ReadFile("makepanda/config.in")
  2886. configprc = configprc.replace('\r\n', '\n')
  2887. if (GetTarget() == 'windows'):
  2888. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2889. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2890. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2891. else:
  2892. configprc = configprc.replace("aux-display pandadx9", "")
  2893. if (GetTarget() == 'darwin'):
  2894. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2895. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2896. if not PkgSkip("FMODEX"):
  2897. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2898. if PkgSkip("GL") or GetLinkAllStatic():
  2899. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2900. if PkgSkip("GLES") or GetLinkAllStatic():
  2901. configprc = configprc.replace("\n#load-display pandagles", "")
  2902. if PkgSkip("DX9") or GetLinkAllStatic():
  2903. configprc = configprc.replace("\n#load-display pandadx9", "")
  2904. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2905. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2906. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2907. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2908. if GetTarget() == 'windows':
  2909. # Convert to Windows newlines.
  2910. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2911. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2912. else:
  2913. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2914. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2915. ##########################################################################################
  2916. #
  2917. # Copy the precompiled binaries and DLLs into the build.
  2918. #
  2919. ##########################################################################################
  2920. tp_dir = GetThirdpartyDir()
  2921. if tp_dir is not None:
  2922. dylibs = {}
  2923. if GetTarget() == 'darwin':
  2924. # Make a list of all the dylibs we ship, to figure out whether we should use
  2925. # install_name_tool to correct the library reference to point to our copy.
  2926. for pkg in PkgListGet():
  2927. if PkgSkip(pkg):
  2928. continue
  2929. tp_libdir = GetThirdpartyLibDir(pkg)
  2930. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2931. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2932. if not PkgSkip("PYTHON"):
  2933. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2934. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2935. for pkg in PkgListGet():
  2936. if PkgSkip(pkg):
  2937. continue
  2938. tp_pkg = tp_dir + pkg.lower()
  2939. if GetTarget() == 'windows':
  2940. if os.path.exists(tp_pkg + "/bin"):
  2941. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2942. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2943. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2944. elif GetTarget() == 'darwin':
  2945. tp_libdir = GetThirdpartyLibDir(pkg)
  2946. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2947. if not PkgSkip("PYTHON"):
  2948. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2949. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2950. if pkg != 'PYTHON':
  2951. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2952. for tp_lib in tp_libs:
  2953. basename = os.path.basename(tp_lib)
  2954. if basename.endswith('.dylib'):
  2955. # It's a dynamic link library. Put it in the lib directory.
  2956. target = GetOutputDir() + "/lib/" + basename
  2957. dep_prefix = "@loader_path/../lib/"
  2958. lib_id = dep_prefix + basename
  2959. else:
  2960. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2961. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2962. target = GetOutputDir() + "/" + basename
  2963. dep_prefix = "@loader_path/lib/"
  2964. lib_id = basename
  2965. if not NeedsBuild([target], [tp_lib]):
  2966. continue
  2967. CopyFile(target, tp_lib)
  2968. if os.path.islink(target) or target.endswith('.py'):
  2969. continue
  2970. # Correct the inter-library dependencies so that the build is relocatable.
  2971. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  2972. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  2973. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  2974. line = line.strip()
  2975. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  2976. continue
  2977. libdep = line.split(" ", 1)[0]
  2978. dep_basename = os.path.basename(libdep)
  2979. if dep_basename in dylibs:
  2980. dep_target = dylibs[dep_basename]
  2981. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  2982. JustBuilt([target], [tp_lib])
  2983. for fwx in glob.glob(tp_pkg + "/*.framework"):
  2984. MakeDirectory(GetOutputDir() + "/Frameworks")
  2985. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  2986. else: # Linux / FreeBSD case.
  2987. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  2988. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  2989. if not PkgSkip("PYTHON"):
  2990. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  2991. base = os.path.basename(tp_lib)
  2992. if base.startswith('lib'):
  2993. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  2994. else:
  2995. # It's a Python module, like _rocketcore.so.
  2996. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  2997. if GetTarget() == 'windows':
  2998. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  2999. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  3000. if not PkgSkip("PYTHON") and not RTDIST:
  3001. # We need to copy the Python DLL to the bin directory for now.
  3002. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  3003. if GetOptimize() <= 2:
  3004. pydll += "_d.dll"
  3005. else:
  3006. pydll += ".dll"
  3007. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  3008. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  3009. CopyFile(GetOutputDir() + "/bin/", fn)
  3010. # Copy the whole Python directory.
  3011. if COPY_PYTHON:
  3012. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  3013. # NB: Python does not always ship with the correct manifest/dll.
  3014. # Figure out the correct one to ship, and grab it from WinSxS dir.
  3015. manifest = GetOutputDir() + '/tmp/python.manifest'
  3016. if os.path.isfile(manifest):
  3017. os.unlink(manifest)
  3018. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  3019. if COPY_PYTHON and os.path.isfile(manifest):
  3020. import xml.etree.ElementTree as ET
  3021. tree = ET.parse(manifest)
  3022. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  3023. else:
  3024. idents = ()
  3025. for ident in idents:
  3026. sxs_name = '_'.join([
  3027. ident.get('processorArchitecture'),
  3028. ident.get('name').lower(),
  3029. ident.get('publicKeyToken'),
  3030. ident.get('version'),
  3031. ])
  3032. # Find the manifest matching these parameters.
  3033. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  3034. manifests = glob.glob(pattern)
  3035. if not manifests:
  3036. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  3037. continue
  3038. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  3039. # Also copy the corresponding msvcr dll.
  3040. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  3041. for file in glob.glob(pattern):
  3042. CopyFile(GetOutputDir() + "/python/", file)
  3043. # Copy python.exe to ppython.exe.
  3044. if COPY_PYTHON:
  3045. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  3046. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  3047. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  3048. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  3049. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  3050. # Copy over the MSVC runtime.
  3051. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  3052. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  3053. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3054. if ("VCTOOLSVERSION" in SDK):
  3055. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3056. else:
  3057. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3058. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3059. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3060. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3061. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3062. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3063. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3064. ########################################################################
  3065. ##
  3066. ## Copy various stuff into the build.
  3067. ##
  3068. ########################################################################
  3069. if GetTarget() == 'windows':
  3070. # Convert to Windows newlines so they can be opened by notepad.
  3071. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3072. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3073. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3074. else:
  3075. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3076. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3077. if (PkgSkip("PANDATOOL")==0):
  3078. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3079. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3080. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3081. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3082. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3083. # Since Eigen is included by all sorts of core headers, as a convenience
  3084. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3085. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3086. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3087. ########################################################################
  3088. #
  3089. # Copy header files to the built/include/parser-inc directory.
  3090. #
  3091. ########################################################################
  3092. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3093. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3094. ########################################################################
  3095. #
  3096. # Transfer all header files to the built/include directory.
  3097. #
  3098. ########################################################################
  3099. CopyAllHeaders('dtool/src/dtoolbase')
  3100. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3101. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3102. CopyAllHeaders('dtool/metalibs/dtool')
  3103. CopyAllHeaders('dtool/src/cppparser')
  3104. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3105. CopyAllHeaders('dtool/src/dconfig')
  3106. CopyAllHeaders('dtool/src/interrogatedb')
  3107. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3108. CopyAllHeaders('dtool/src/pystub')
  3109. CopyAllHeaders('dtool/src/interrogate')
  3110. CopyAllHeaders('dtool/src/test_interrogate')
  3111. CopyAllHeaders('panda/src/putil')
  3112. CopyAllHeaders('panda/src/pandabase')
  3113. CopyAllHeaders('panda/src/express')
  3114. CopyAllHeaders('panda/src/downloader')
  3115. CopyAllHeaders('panda/metalibs/pandaexpress')
  3116. CopyAllHeaders('panda/src/pipeline')
  3117. CopyAllHeaders('panda/src/linmath')
  3118. CopyAllHeaders('panda/src/putil')
  3119. CopyAllHeaders('dtool/src/prckeys')
  3120. CopyAllHeaders('panda/src/audio')
  3121. CopyAllHeaders('panda/src/event')
  3122. CopyAllHeaders('panda/src/mathutil')
  3123. CopyAllHeaders('panda/src/gsgbase')
  3124. CopyAllHeaders('panda/src/pnmimage')
  3125. CopyAllHeaders('panda/src/nativenet')
  3126. CopyAllHeaders('panda/src/net')
  3127. CopyAllHeaders('panda/src/pstatclient')
  3128. CopyAllHeaders('panda/src/gobj')
  3129. CopyAllHeaders('panda/src/movies')
  3130. CopyAllHeaders('panda/src/pgraphnodes')
  3131. CopyAllHeaders('panda/src/pgraph')
  3132. CopyAllHeaders('panda/src/cull')
  3133. CopyAllHeaders('panda/src/display')
  3134. CopyAllHeaders('panda/src/chan')
  3135. CopyAllHeaders('panda/src/char')
  3136. CopyAllHeaders('panda/src/dgraph')
  3137. CopyAllHeaders('panda/src/device')
  3138. CopyAllHeaders('panda/src/pnmtext')
  3139. CopyAllHeaders('panda/src/text')
  3140. CopyAllHeaders('panda/src/grutil')
  3141. if (PkgSkip("VISION")==0):
  3142. CopyAllHeaders('panda/src/vision')
  3143. if (PkgSkip("FFMPEG")==0):
  3144. CopyAllHeaders('panda/src/ffmpeg')
  3145. CopyAllHeaders('panda/src/tform')
  3146. CopyAllHeaders('panda/src/collide')
  3147. CopyAllHeaders('panda/src/parametrics')
  3148. CopyAllHeaders('panda/src/pgui')
  3149. CopyAllHeaders('panda/src/pnmimagetypes')
  3150. CopyAllHeaders('panda/src/recorder')
  3151. if (PkgSkip("ROCKET")==0):
  3152. CopyAllHeaders('panda/src/rocket')
  3153. if (PkgSkip("VRPN")==0):
  3154. CopyAllHeaders('panda/src/vrpn')
  3155. CopyAllHeaders('panda/src/wgldisplay')
  3156. CopyAllHeaders('panda/src/ode')
  3157. CopyAllHeaders('panda/metalibs/pandaode')
  3158. if (PkgSkip("PANDAPHYSICS")==0):
  3159. CopyAllHeaders('panda/src/physics')
  3160. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3161. CopyAllHeaders('panda/src/particlesystem')
  3162. CopyAllHeaders('panda/src/dxml')
  3163. CopyAllHeaders('panda/metalibs/panda')
  3164. CopyAllHeaders('panda/src/audiotraits')
  3165. CopyAllHeaders('panda/src/audiotraits')
  3166. CopyAllHeaders('panda/src/distort')
  3167. CopyAllHeaders('panda/src/downloadertools')
  3168. CopyAllHeaders('panda/src/windisplay')
  3169. CopyAllHeaders('panda/src/dxgsg9')
  3170. CopyAllHeaders('panda/metalibs/pandadx9')
  3171. if not PkgSkip("EGG"):
  3172. CopyAllHeaders('panda/src/egg')
  3173. CopyAllHeaders('panda/src/egg2pg')
  3174. CopyAllHeaders('panda/src/framework')
  3175. CopyAllHeaders('panda/metalibs/pandafx')
  3176. CopyAllHeaders('panda/src/glstuff')
  3177. CopyAllHeaders('panda/src/glgsg')
  3178. CopyAllHeaders('panda/src/glesgsg')
  3179. CopyAllHeaders('panda/src/gles2gsg')
  3180. if not PkgSkip("EGG"):
  3181. CopyAllHeaders('panda/metalibs/pandaegg')
  3182. if GetTarget() == 'windows':
  3183. CopyAllHeaders('panda/src/wgldisplay')
  3184. elif GetTarget() == 'darwin':
  3185. CopyAllHeaders('panda/src/osxdisplay')
  3186. CopyAllHeaders('panda/src/cocoadisplay')
  3187. elif GetTarget() == 'android':
  3188. CopyAllHeaders('panda/src/android')
  3189. CopyAllHeaders('panda/src/androiddisplay')
  3190. if not PkgSkip('X11'):
  3191. CopyAllHeaders('panda/src/x11display')
  3192. if not PkgSkip('GL'):
  3193. CopyAllHeaders('panda/src/glxdisplay')
  3194. CopyAllHeaders('panda/src/egldisplay')
  3195. CopyAllHeaders('panda/metalibs/pandagl')
  3196. CopyAllHeaders('panda/metalibs/pandagles')
  3197. CopyAllHeaders('panda/metalibs/pandagles2')
  3198. CopyAllHeaders('panda/metalibs/pandaphysics')
  3199. CopyAllHeaders('panda/src/testbed')
  3200. if (PkgSkip("PHYSX")==0):
  3201. CopyAllHeaders('panda/src/physx')
  3202. CopyAllHeaders('panda/metalibs/pandaphysx')
  3203. if (PkgSkip("BULLET")==0):
  3204. CopyAllHeaders('panda/src/bullet')
  3205. CopyAllHeaders('panda/metalibs/pandabullet')
  3206. if (PkgSkip("SPEEDTREE")==0):
  3207. CopyAllHeaders('panda/src/speedtree')
  3208. if (PkgSkip("DIRECT")==0):
  3209. CopyAllHeaders('direct/src/directbase')
  3210. CopyAllHeaders('direct/src/dcparser')
  3211. CopyAllHeaders('direct/src/deadrec')
  3212. CopyAllHeaders('direct/src/distributed')
  3213. CopyAllHeaders('direct/src/interval')
  3214. CopyAllHeaders('direct/src/showbase')
  3215. CopyAllHeaders('direct/src/dcparse')
  3216. if (RUNTIME or RTDIST):
  3217. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3218. if (RUNTIME):
  3219. CopyAllHeaders('direct/src/plugin_npapi')
  3220. CopyAllHeaders('direct/src/plugin_standalone')
  3221. if (PkgSkip("PANDATOOL")==0):
  3222. CopyAllHeaders('pandatool/src/pandatoolbase')
  3223. CopyAllHeaders('pandatool/src/converter')
  3224. CopyAllHeaders('pandatool/src/progbase')
  3225. CopyAllHeaders('pandatool/src/eggbase')
  3226. CopyAllHeaders('pandatool/src/bam')
  3227. CopyAllHeaders('pandatool/src/cvscopy')
  3228. CopyAllHeaders('pandatool/src/daeegg')
  3229. CopyAllHeaders('pandatool/src/daeprogs')
  3230. CopyAllHeaders('pandatool/src/dxf')
  3231. CopyAllHeaders('pandatool/src/dxfegg')
  3232. CopyAllHeaders('pandatool/src/dxfprogs')
  3233. CopyAllHeaders('pandatool/src/palettizer')
  3234. CopyAllHeaders('pandatool/src/egg-mkfont')
  3235. CopyAllHeaders('pandatool/src/eggcharbase')
  3236. CopyAllHeaders('pandatool/src/egg-optchar')
  3237. CopyAllHeaders('pandatool/src/egg-palettize')
  3238. CopyAllHeaders('pandatool/src/egg-qtess')
  3239. CopyAllHeaders('pandatool/src/eggprogs')
  3240. CopyAllHeaders('pandatool/src/flt')
  3241. CopyAllHeaders('pandatool/src/fltegg')
  3242. CopyAllHeaders('pandatool/src/fltprogs')
  3243. CopyAllHeaders('pandatool/src/imagebase')
  3244. CopyAllHeaders('pandatool/src/imageprogs')
  3245. CopyAllHeaders('pandatool/src/pfmprogs')
  3246. CopyAllHeaders('pandatool/src/lwo')
  3247. CopyAllHeaders('pandatool/src/lwoegg')
  3248. CopyAllHeaders('pandatool/src/lwoprogs')
  3249. CopyAllHeaders('pandatool/src/maya')
  3250. CopyAllHeaders('pandatool/src/mayaegg')
  3251. CopyAllHeaders('pandatool/src/maxegg')
  3252. CopyAllHeaders('pandatool/src/maxprogs')
  3253. CopyAllHeaders('pandatool/src/objegg')
  3254. CopyAllHeaders('pandatool/src/objprogs')
  3255. CopyAllHeaders('pandatool/src/vrml')
  3256. CopyAllHeaders('pandatool/src/vrmlegg')
  3257. CopyAllHeaders('pandatool/src/xfile')
  3258. CopyAllHeaders('pandatool/src/xfileegg')
  3259. CopyAllHeaders('pandatool/src/ptloader')
  3260. CopyAllHeaders('pandatool/src/miscprogs')
  3261. CopyAllHeaders('pandatool/src/pstatserver')
  3262. CopyAllHeaders('pandatool/src/text-stats')
  3263. CopyAllHeaders('pandatool/src/vrmlprogs')
  3264. CopyAllHeaders('pandatool/src/win-stats')
  3265. CopyAllHeaders('pandatool/src/xfileprogs')
  3266. if (PkgSkip("CONTRIB")==0):
  3267. CopyAllHeaders('contrib/src/contribbase')
  3268. CopyAllHeaders('contrib/src/ai')
  3269. ########################################################################
  3270. #
  3271. # These definitions are syntactic shorthand. They make it easy
  3272. # to link with the usual libraries without listing them all.
  3273. #
  3274. ########################################################################
  3275. COMMON_DTOOL_LIBS=[
  3276. 'libp3dtool.dll',
  3277. 'libp3dtoolconfig.dll',
  3278. ]
  3279. COMMON_PANDA_LIBS=[
  3280. 'libpanda.dll',
  3281. 'libpandaexpress.dll'
  3282. ] + COMMON_DTOOL_LIBS
  3283. COMMON_EGG2X_LIBS=[
  3284. 'libp3eggbase.lib',
  3285. 'libp3progbase.lib',
  3286. 'libp3converter.lib',
  3287. 'libp3pandatoolbase.lib',
  3288. 'libpandaegg.dll',
  3289. ] + COMMON_PANDA_LIBS
  3290. ########################################################################
  3291. #
  3292. # This section contains a list of all the files that need to be compiled.
  3293. #
  3294. ########################################################################
  3295. print("Generating dependencies...")
  3296. sys.stdout.flush()
  3297. #
  3298. # Compile Panda icon resource file.
  3299. # We do it first because we need it at
  3300. # the time we compile an executable.
  3301. #
  3302. if GetTarget() == 'windows':
  3303. OPTS=['DIR:panda/src/configfiles']
  3304. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3305. #
  3306. # DIRECTORY: dtool/src/dtoolbase/
  3307. #
  3308. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL', 'MIMALLOC']
  3309. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3310. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3311. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3312. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3313. #
  3314. # DIRECTORY: dtool/src/dtoolutil/
  3315. #
  3316. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3317. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3318. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3319. if GetTarget() == 'darwin':
  3320. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3321. #
  3322. # DIRECTORY: dtool/metalibs/dtool/
  3323. #
  3324. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3325. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3326. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3327. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3328. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3329. if GetTarget() == 'darwin':
  3330. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3331. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3332. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3333. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3334. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3335. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL','MIMALLOC'])
  3336. #
  3337. # DIRECTORY: dtool/src/cppparser/
  3338. #
  3339. if (not RUNTIME):
  3340. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3341. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3342. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3343. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3344. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3345. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3346. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3347. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3348. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3349. #
  3350. # DIRECTORY: dtool/src/prc/
  3351. #
  3352. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3353. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3354. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3355. #
  3356. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3357. #
  3358. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3359. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3360. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3361. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3362. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3363. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3364. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3365. #
  3366. # DIRECTORY: dtool/src/interrogatedb/
  3367. #
  3368. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3369. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3370. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3371. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3372. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3373. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3374. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3375. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3376. # stuff, so it has been renamed appropriately.
  3377. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3378. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3379. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3380. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3381. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3382. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3383. #
  3384. # DIRECTORY: dtool/src/pystub/
  3385. #
  3386. if not RUNTIME and not RTDIST:
  3387. OPTS=['DIR:dtool/src/pystub']
  3388. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3389. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3390. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3391. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3392. #
  3393. # DIRECTORY: dtool/src/interrogate/
  3394. #
  3395. if (not RUNTIME):
  3396. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3397. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3398. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3399. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3400. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3401. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3402. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3403. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3404. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3405. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3406. 'dtool/src/interrogatedb/py_panda.cxx',
  3407. 'dtool/src/interrogatedb/py_compat.cxx',
  3408. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3409. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3410. ])
  3411. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3412. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3413. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3414. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3415. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3416. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3417. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3418. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3419. if (not RTDIST):
  3420. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3421. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3422. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3423. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3424. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3425. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3426. #
  3427. # DIRECTORY: dtool/src/prckeys/
  3428. #
  3429. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3430. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3431. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3432. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3433. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3434. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3435. #
  3436. # DIRECTORY: dtool/src/test_interrogate/
  3437. #
  3438. if (not RTDIST and not RUNTIME):
  3439. OPTS=['DIR:dtool/src/test_interrogate']
  3440. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3441. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3442. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3443. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3444. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3445. #
  3446. # DIRECTORY: dtool/src/dtoolbase/
  3447. #
  3448. OPTS=['DIR:dtool/src/dtoolbase']
  3449. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3450. IGATEFILES += [
  3451. "typeHandle.h",
  3452. "typeHandle_ext.h",
  3453. "typeRegistry.h",
  3454. "typedObject.h",
  3455. "neverFreeMemory.h",
  3456. ]
  3457. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3458. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3459. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3460. #
  3461. # DIRECTORY: dtool/src/dtoolutil/
  3462. #
  3463. OPTS=['DIR:dtool/src/dtoolutil']
  3464. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3465. IGATEFILES += [
  3466. "config_dtoolutil.h",
  3467. "pandaSystem.h",
  3468. "dSearchPath.h",
  3469. "executionEnvironment.h",
  3470. "textEncoder.h",
  3471. "textEncoder_ext.h",
  3472. "filename.h",
  3473. "filename_ext.h",
  3474. "globPattern.h",
  3475. "globPattern_ext.h",
  3476. "pandaFileStream.h",
  3477. "lineStream.h",
  3478. ]
  3479. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3480. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3481. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3482. #
  3483. # DIRECTORY: dtool/src/prc/
  3484. #
  3485. OPTS=['DIR:dtool/src/prc']
  3486. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3487. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3488. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3489. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3490. #
  3491. # DIRECTORY: panda/src/pandabase/
  3492. #
  3493. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3494. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3495. #
  3496. # DIRECTORY: panda/src/express/
  3497. #
  3498. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3499. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3500. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3501. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3502. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3503. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3504. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3505. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3506. #
  3507. # DIRECTORY: panda/src/downloader/
  3508. #
  3509. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3510. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3511. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3512. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3513. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3514. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3515. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3516. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3517. #
  3518. # DIRECTORY: panda/metalibs/pandaexpress/
  3519. #
  3520. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3521. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3522. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3523. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3524. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3525. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3526. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3527. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3528. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3529. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3530. #
  3531. # DIRECTORY: panda/src/pipeline/
  3532. #
  3533. if (not RUNTIME):
  3534. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3535. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3536. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3537. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3538. OPTS=['DIR:panda/src/pipeline']
  3539. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3540. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3541. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3542. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3543. #
  3544. # DIRECTORY: panda/src/linmath/
  3545. #
  3546. if (not RUNTIME):
  3547. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3548. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3549. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3550. OPTS=['DIR:panda/src/linmath']
  3551. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3552. for ifile in IGATEFILES[:]:
  3553. if "_src." in ifile:
  3554. IGATEFILES.remove(ifile)
  3555. IGATEFILES.remove('cast_to_double.h')
  3556. IGATEFILES.remove('lmat_ops.h')
  3557. IGATEFILES.remove('cast_to_float.h')
  3558. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3559. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3560. #
  3561. # DIRECTORY: panda/src/putil/
  3562. #
  3563. if (not RUNTIME):
  3564. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3565. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3566. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3567. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3568. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3569. IGATEFILES.remove("test_bam.h")
  3570. IGATEFILES.remove("config_util.h")
  3571. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3572. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3573. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3574. #
  3575. # DIRECTORY: panda/src/audio/
  3576. #
  3577. if (not RUNTIME):
  3578. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3579. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3580. OPTS=['DIR:panda/src/audio']
  3581. IGATEFILES=["audio.h"]
  3582. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3583. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3584. #
  3585. # DIRECTORY: panda/src/event/
  3586. #
  3587. if (not RUNTIME):
  3588. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3589. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3590. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3591. OPTS=['DIR:panda/src/event']
  3592. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3593. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3594. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3595. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3596. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3597. #
  3598. # DIRECTORY: panda/src/mathutil/
  3599. #
  3600. if (not RUNTIME):
  3601. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3602. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3603. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3604. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3605. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3606. for ifile in IGATEFILES[:]:
  3607. if "_src." in ifile:
  3608. IGATEFILES.remove(ifile)
  3609. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3610. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3611. #
  3612. # DIRECTORY: panda/src/gsgbase/
  3613. #
  3614. if (not RUNTIME):
  3615. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3616. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3617. OPTS=['DIR:panda/src/gsgbase']
  3618. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3619. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3620. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3621. #
  3622. # DIRECTORY: panda/src/pnmimage/
  3623. #
  3624. if (not RUNTIME):
  3625. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3626. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3627. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3628. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3629. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3630. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3631. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3632. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3633. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3634. #
  3635. # DIRECTORY: panda/src/nativenet/
  3636. #
  3637. if (not RUNTIME):
  3638. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3639. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3640. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3641. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3642. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3643. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3644. #
  3645. # DIRECTORY: panda/src/net/
  3646. #
  3647. if (not RUNTIME):
  3648. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3649. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3650. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3651. OPTS=['DIR:panda/src/net']
  3652. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3653. IGATEFILES.remove("datagram_ui.h")
  3654. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3655. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3656. #
  3657. # DIRECTORY: panda/src/pstatclient/
  3658. #
  3659. if (not RUNTIME):
  3660. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3661. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3662. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3663. OPTS=['DIR:panda/src/pstatclient']
  3664. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3665. IGATEFILES.remove("config_pstats.h")
  3666. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3667. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3668. #
  3669. # DIRECTORY: panda/src/gobj/
  3670. #
  3671. if (not RUNTIME):
  3672. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3673. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3674. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3675. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3676. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3677. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3678. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3679. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3680. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3681. #
  3682. # DIRECTORY: panda/src/pgraphnodes/
  3683. #
  3684. if (not RUNTIME):
  3685. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3686. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3687. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3688. OPTS=['DIR:panda/src/pgraphnodes']
  3689. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3690. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3691. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3692. #
  3693. # DIRECTORY: panda/src/pgraph/
  3694. #
  3695. if (not RUNTIME):
  3696. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3697. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3698. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3699. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3700. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3701. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3702. OPTS=['DIR:panda/src/pgraph']
  3703. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3704. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3705. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3706. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3707. #
  3708. # DIRECTORY: panda/src/cull/
  3709. #
  3710. if (not RUNTIME):
  3711. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3712. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3713. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3714. OPTS=['DIR:panda/src/cull']
  3715. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3716. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3717. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3718. #
  3719. # DIRECTORY: panda/src/dgraph/
  3720. #
  3721. if (not RUNTIME):
  3722. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3723. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3724. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3725. OPTS=['DIR:panda/src/dgraph']
  3726. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3727. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3728. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3729. #
  3730. # DIRECTORY: panda/src/device/
  3731. #
  3732. if (not RUNTIME):
  3733. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3734. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3735. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3736. OPTS=['DIR:panda/src/device']
  3737. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3738. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3739. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3740. #
  3741. # DIRECTORY: panda/src/display/
  3742. #
  3743. if (not RUNTIME):
  3744. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3745. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3746. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3747. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3748. OPTS=['DIR:panda/src/display', 'X11']
  3749. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3750. IGATEFILES.remove("renderBuffer.h")
  3751. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3752. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3753. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3754. if RTDIST and GetTarget() == 'darwin':
  3755. OPTS=['DIR:panda/src/display']
  3756. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3757. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3758. #
  3759. # DIRECTORY: panda/src/chan/
  3760. #
  3761. if (not RUNTIME):
  3762. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3763. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3764. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3765. OPTS=['DIR:panda/src/chan']
  3766. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3767. IGATEFILES.remove('movingPart.h')
  3768. IGATEFILES.remove('animChannelFixed.h')
  3769. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3770. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3771. # DIRECTORY: panda/src/char/
  3772. #
  3773. if (not RUNTIME):
  3774. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3775. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3776. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3777. OPTS=['DIR:panda/src/char']
  3778. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3779. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3780. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3781. #
  3782. # DIRECTORY: panda/src/pnmtext/
  3783. #
  3784. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3785. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3786. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3787. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3788. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3789. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3790. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3791. #
  3792. # DIRECTORY: panda/src/text/
  3793. #
  3794. if (not RUNTIME):
  3795. if not PkgSkip("HARFBUZZ"):
  3796. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3797. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3798. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3799. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3800. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3801. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3802. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3803. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3804. #
  3805. # DIRECTORY: panda/src/movies/
  3806. #
  3807. if (not RUNTIME):
  3808. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3809. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3810. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3811. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3812. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3813. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3814. #
  3815. # DIRECTORY: panda/src/grutil/
  3816. #
  3817. if (not RUNTIME):
  3818. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3819. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3820. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3821. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3822. OPTS=['DIR:panda/src/grutil']
  3823. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3824. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3825. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3826. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3827. #
  3828. # DIRECTORY: panda/src/tform/
  3829. #
  3830. if (not RUNTIME):
  3831. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3832. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3833. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3834. OPTS=['DIR:panda/src/tform']
  3835. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3836. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3837. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3838. #
  3839. # DIRECTORY: panda/src/collide/
  3840. #
  3841. if (not RUNTIME):
  3842. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3843. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3844. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3845. OPTS=['DIR:panda/src/collide']
  3846. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3847. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3848. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3849. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3850. #
  3851. # DIRECTORY: panda/src/parametrics/
  3852. #
  3853. if (not RUNTIME):
  3854. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3855. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3856. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3857. OPTS=['DIR:panda/src/parametrics']
  3858. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3859. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3860. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3861. #
  3862. # DIRECTORY: panda/src/pgui/
  3863. #
  3864. if (not RUNTIME):
  3865. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3866. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3867. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3868. OPTS=['DIR:panda/src/pgui']
  3869. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3870. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3871. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3872. #
  3873. # DIRECTORY: panda/src/pnmimagetypes/
  3874. #
  3875. if (not RUNTIME):
  3876. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3877. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3878. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3879. #
  3880. # DIRECTORY: panda/src/recorder/
  3881. #
  3882. if (not RUNTIME):
  3883. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3884. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3885. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3886. OPTS=['DIR:panda/src/recorder']
  3887. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3888. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3889. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3890. #
  3891. # DIRECTORY: panda/src/dxml/
  3892. #
  3893. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3894. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3895. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3896. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3897. if (not RUNTIME):
  3898. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3899. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3900. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3901. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3902. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3903. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3904. #
  3905. # DIRECTORY: panda/metalibs/panda/
  3906. #
  3907. if (not RUNTIME):
  3908. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3909. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3910. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3911. 'SETUPAPI', 'INOTIFY']
  3912. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3913. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3914. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3915. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3916. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3917. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3918. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3919. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3920. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3921. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3922. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3923. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3924. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3925. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3926. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3927. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3928. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3929. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3930. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3931. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3932. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3933. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3934. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3935. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3936. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3937. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3938. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3939. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3940. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3941. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3942. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3943. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3944. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3945. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3946. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3947. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3948. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3949. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3950. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3951. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3952. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3953. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3954. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3955. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3956. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3957. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3958. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3959. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3960. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3961. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3962. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3963. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3964. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3965. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3966. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3967. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3968. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  3969. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  3970. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  3971. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  3972. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  3973. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  3974. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  3975. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  3976. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  3977. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  3978. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  3979. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  3980. if PkgSkip("FREETYPE")==0:
  3981. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  3982. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  3983. TargetAdd('libpanda.dll', opts=OPTS)
  3984. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  3985. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  3986. PyTargetAdd('core_module.obj', input='libp3prc.in')
  3987. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  3988. PyTargetAdd('core_module.obj', input='libp3express.in')
  3989. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  3990. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  3991. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  3992. PyTargetAdd('core_module.obj', input='libp3cull.in')
  3993. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  3994. PyTargetAdd('core_module.obj', input='libp3chan.in')
  3995. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  3996. PyTargetAdd('core_module.obj', input='libp3char.in')
  3997. PyTargetAdd('core_module.obj', input='libp3collide.in')
  3998. PyTargetAdd('core_module.obj', input='libp3device.in')
  3999. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  4000. PyTargetAdd('core_module.obj', input='libp3display.in')
  4001. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  4002. PyTargetAdd('core_module.obj', input='libp3event.in')
  4003. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  4004. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  4005. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  4006. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  4007. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  4008. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  4009. PyTargetAdd('core_module.obj', input='libp3text.in')
  4010. PyTargetAdd('core_module.obj', input='libp3tform.in')
  4011. PyTargetAdd('core_module.obj', input='libp3putil.in')
  4012. PyTargetAdd('core_module.obj', input='libp3audio.in')
  4013. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  4014. PyTargetAdd('core_module.obj', input='libp3net.in')
  4015. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  4016. PyTargetAdd('core_module.obj', input='libp3movies.in')
  4017. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  4018. if PkgSkip("FREETYPE")==0:
  4019. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  4020. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  4021. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  4022. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  4023. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  4024. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  4025. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  4026. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  4027. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  4028. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  4029. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  4030. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  4031. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  4032. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  4033. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  4034. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  4035. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  4036. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  4037. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  4038. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  4039. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  4040. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  4041. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  4042. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  4043. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  4044. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  4045. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  4046. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  4047. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  4048. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  4049. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  4050. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  4051. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  4052. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  4053. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  4054. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4055. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4056. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4057. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4058. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4059. if PkgSkip("FREETYPE")==0:
  4060. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4061. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4062. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4063. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4064. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4065. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4066. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4067. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4068. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4069. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4070. PyTargetAdd('core.pyd', input='core_module.obj')
  4071. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4072. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4073. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4074. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4075. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4076. #
  4077. # DIRECTORY: panda/src/vision/
  4078. #
  4079. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4080. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4081. if not PkgSkip("FFMPEG"):
  4082. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4083. if not PkgSkip("OPENCV"):
  4084. DefSymbol("OPENCV", "HAVE_OPENCV")
  4085. if OPENCV_VER_23:
  4086. DefSymbol("OPENCV", "OPENCV_VER_23")
  4087. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4088. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4089. 'dtool_have_ffmpeg.dat',
  4090. 'dtool_have_opencv.dat',
  4091. 'dtool_have_directcam.dat',
  4092. ])
  4093. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4094. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4095. TargetAdd('libp3vision.dll', opts=OPTS)
  4096. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4097. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4098. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4099. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4100. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4101. PyTargetAdd('vision_module.obj', opts=OPTS)
  4102. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4103. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4104. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4105. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4106. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4107. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4108. #
  4109. # DIRECTORY: panda/src/rocket/
  4110. #
  4111. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4112. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4113. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4114. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4115. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4116. TargetAdd('libp3rocket.dll', opts=OPTS)
  4117. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4118. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4119. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4120. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4121. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4122. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4123. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4124. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4125. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4126. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4127. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4128. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4129. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4130. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4131. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4132. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4133. #
  4134. # DIRECTORY: panda/src/p3skel
  4135. #
  4136. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4137. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4138. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4139. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4140. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4141. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4142. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4143. #
  4144. # DIRECTORY: panda/src/p3skel
  4145. #
  4146. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4147. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4148. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4149. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4150. TargetAdd('libpandaskel.dll', opts=OPTS)
  4151. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4152. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4153. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4154. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4155. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4156. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4157. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4158. #
  4159. # DIRECTORY: panda/src/distort/
  4160. #
  4161. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4162. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4163. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4164. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4165. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4166. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4167. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4168. #
  4169. # DIRECTORY: panda/metalibs/pandafx/
  4170. #
  4171. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4172. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4173. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4174. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4175. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4176. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4177. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4178. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4179. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4180. PyTargetAdd('fx_module.obj', opts=OPTS)
  4181. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4182. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4183. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4184. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4185. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4186. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4187. #
  4188. # DIRECTORY: panda/src/vrpn/
  4189. #
  4190. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4191. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4192. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4193. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4194. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4195. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4196. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4197. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4198. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4199. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4200. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4201. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4202. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4203. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4204. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4205. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4206. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4207. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4208. #
  4209. # DIRECTORY: panda/src/ffmpeg
  4210. #
  4211. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4212. if not PkgSkip("SWSCALE"):
  4213. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4214. if not PkgSkip("SWRESAMPLE"):
  4215. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4216. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4217. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4218. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4219. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4220. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4221. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4222. #
  4223. # DIRECTORY: panda/src/audiotraits/
  4224. #
  4225. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4226. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4227. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4228. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4229. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4230. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4231. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4232. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4233. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4234. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4235. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4236. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4237. #
  4238. # DIRECTORY: panda/src/downloadertools/
  4239. #
  4240. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4241. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4242. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4243. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4244. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4245. TargetAdd('apply_patch.exe', opts=OPTS)
  4246. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4247. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4248. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4249. TargetAdd('build_patch.exe', opts=OPTS)
  4250. if not PkgSkip("ZLIB"):
  4251. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4252. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4253. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4254. TargetAdd('check_adler.exe', opts=OPTS)
  4255. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4256. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4257. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4258. TargetAdd('check_crc.exe', opts=OPTS)
  4259. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4260. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4261. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4262. TargetAdd('check_md5.exe', opts=OPTS)
  4263. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4264. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4265. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4266. TargetAdd('pdecrypt.exe', opts=OPTS)
  4267. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4268. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4269. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4270. TargetAdd('pencrypt.exe', opts=OPTS)
  4271. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4272. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4273. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4274. TargetAdd('show_ddb.exe', opts=OPTS)
  4275. #
  4276. # DIRECTORY: panda/src/downloadertools/
  4277. #
  4278. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4279. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4280. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4281. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4282. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4283. TargetAdd('multify.exe', opts=OPTS)
  4284. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4285. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4286. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4287. TargetAdd('pzip.exe', opts=OPTS)
  4288. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4289. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4290. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4291. TargetAdd('punzip.exe', opts=OPTS)
  4292. #
  4293. # DIRECTORY: panda/src/windisplay/
  4294. #
  4295. if (GetTarget() == 'windows' and not RUNTIME):
  4296. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4297. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4298. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4299. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4300. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4301. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4302. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4303. #
  4304. # DIRECTORY: panda/metalibs/pandadx9/
  4305. #
  4306. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4307. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4308. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4309. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4310. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4311. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4312. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4313. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4314. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4315. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4316. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4317. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4318. #
  4319. # DIRECTORY: panda/src/egg/
  4320. #
  4321. if not RUNTIME and not PkgSkip("EGG"):
  4322. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4323. CreateFile(GetOutputDir()+"/include/parser.h")
  4324. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4325. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4326. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4327. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4328. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4329. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4330. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4331. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4332. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4333. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4334. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4335. #
  4336. # DIRECTORY: panda/src/egg2pg/
  4337. #
  4338. if not RUNTIME and not PkgSkip("EGG"):
  4339. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4340. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4341. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4342. OPTS=['DIR:panda/src/egg2pg']
  4343. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4344. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4345. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4346. #
  4347. # DIRECTORY: panda/src/framework/
  4348. #
  4349. if (not RUNTIME):
  4350. deps = []
  4351. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4352. if GetLinkAllStatic():
  4353. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4354. if not PkgSkip("GL"):
  4355. DefSymbol("FRAMEWORK", "HAVE_GL")
  4356. if not PkgSkip("TINYDISPLAY"):
  4357. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4358. if not PkgSkip("EGG"):
  4359. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4360. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4361. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4362. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4363. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4364. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4365. #
  4366. # DIRECTORY: panda/src/glgsg/
  4367. #
  4368. if (not RUNTIME and PkgSkip("GL")==0):
  4369. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4370. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4371. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4372. #
  4373. # DIRECTORY: panda/src/glesgsg/
  4374. #
  4375. if (not RUNTIME and PkgSkip("GLES")==0):
  4376. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4377. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4378. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4379. #
  4380. # DIRECTORY: panda/src/gles2gsg/
  4381. #
  4382. if (not RUNTIME and PkgSkip("GLES2")==0):
  4383. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4384. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4385. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4386. #
  4387. # DIRECTORY: panda/metalibs/pandaegg/
  4388. #
  4389. if not RUNTIME and not PkgSkip("EGG"):
  4390. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4391. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4392. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4393. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4394. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4395. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4396. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4397. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4398. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4399. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4400. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4401. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4402. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4403. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4404. PyTargetAdd('egg_module.obj', opts=OPTS)
  4405. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4406. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4407. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4408. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4409. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4410. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4411. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4412. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4413. #
  4414. # DIRECTORY: panda/src/x11display/
  4415. #
  4416. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4417. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4418. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4419. #
  4420. # DIRECTORY: panda/src/glxdisplay/
  4421. #
  4422. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4423. DefSymbol('GLX', 'HAVE_GLX', '')
  4424. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4425. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4426. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4427. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4428. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4429. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4430. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4431. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4432. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4433. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4434. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4435. #
  4436. # DIRECTORY: panda/src/cocoadisplay/
  4437. #
  4438. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4439. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4440. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4441. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4442. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4443. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4444. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4445. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4446. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4447. if (PkgSkip('PANDAFX')==0):
  4448. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4449. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4450. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4451. #
  4452. # DIRECTORY: panda/src/osxdisplay/
  4453. #
  4454. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4455. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4456. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4457. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4458. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4459. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4460. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4461. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4462. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4463. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4464. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4465. if (PkgSkip('PANDAFX')==0):
  4466. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4467. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4468. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4469. #
  4470. # DIRECTORY: panda/src/wgldisplay/
  4471. #
  4472. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4473. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4474. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4475. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4476. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4477. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4478. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4479. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4480. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4481. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4482. if (PkgSkip('PANDAFX')==0):
  4483. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4484. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4485. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4486. #
  4487. # DIRECTORY: panda/src/egldisplay/
  4488. #
  4489. # If we're not compiling with any windowing system at all, but we do have EGL,
  4490. # we can use that to create a headless libpandagl instead.
  4491. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4492. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4493. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4494. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4495. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4496. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4497. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4498. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4499. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4500. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4501. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4502. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4503. # As a temporary solution for #1086, build this module, which we can use as a
  4504. # fallback to OpenGL for headless systems.
  4505. DefSymbol('EGL', 'HAVE_EGL', '')
  4506. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4507. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4508. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4509. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4510. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4511. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4512. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4513. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4514. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4515. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4516. #
  4517. # DIRECTORY: panda/src/egldisplay/
  4518. #
  4519. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4520. DefSymbol('GLES', 'OPENGLES_1', '')
  4521. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4522. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4523. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4524. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4525. if not PkgSkip("X11"):
  4526. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4527. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4528. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4529. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4530. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4531. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4532. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4533. #
  4534. # DIRECTORY: panda/src/egldisplay/
  4535. #
  4536. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4537. DefSymbol('GLES2', 'OPENGLES_2', '')
  4538. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4539. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4540. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4541. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4542. if not PkgSkip("X11"):
  4543. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4544. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4545. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4546. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4547. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4548. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4549. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4550. #
  4551. # DIRECTORY: panda/src/ode/
  4552. #
  4553. if (PkgSkip("ODE")==0 and not RUNTIME):
  4554. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4555. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4556. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4557. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4558. OPTS=['DIR:panda/src/ode', 'ODE']
  4559. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4560. IGATEFILES.remove("odeConvexGeom.h")
  4561. IGATEFILES.remove("odeHelperStructs.h")
  4562. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4563. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4564. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4565. #
  4566. # DIRECTORY: panda/metalibs/pandaode/
  4567. #
  4568. if (PkgSkip("ODE")==0 and not RUNTIME):
  4569. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4570. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4571. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4572. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4573. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4574. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4575. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4576. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4577. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4578. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4579. PyTargetAdd('ode_module.obj', opts=OPTS)
  4580. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4581. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4582. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4583. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4584. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4585. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4586. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4587. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4588. #
  4589. # DIRECTORY: panda/src/bullet/
  4590. #
  4591. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4592. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4593. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4594. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4595. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4596. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4597. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4598. #
  4599. # DIRECTORY: panda/metalibs/pandabullet/
  4600. #
  4601. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4602. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4603. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4604. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4605. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4606. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4607. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4608. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4609. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4610. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4611. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4612. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4613. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4614. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4615. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4616. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4617. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4618. #
  4619. # DIRECTORY: panda/src/physx/
  4620. #
  4621. if (PkgSkip("PHYSX")==0):
  4622. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4623. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4624. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4625. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4626. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4627. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4628. #
  4629. # DIRECTORY: panda/metalibs/pandaphysx/
  4630. #
  4631. if (PkgSkip("PHYSX")==0):
  4632. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4633. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4634. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4635. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4636. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4637. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4638. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4639. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4640. PyTargetAdd('physx_module.obj', opts=OPTS)
  4641. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4642. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4643. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4644. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4645. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4646. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4647. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4648. #
  4649. # DIRECTORY: panda/src/physics/
  4650. #
  4651. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4652. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4653. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4654. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4655. OPTS=['DIR:panda/src/physics']
  4656. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4657. IGATEFILES.remove("forces.h")
  4658. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4659. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4660. #
  4661. # DIRECTORY: panda/src/particlesystem/
  4662. #
  4663. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4664. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4665. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4666. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4667. OPTS=['DIR:panda/src/particlesystem']
  4668. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4669. IGATEFILES.remove('orientedParticle.h')
  4670. IGATEFILES.remove('orientedParticleFactory.h')
  4671. IGATEFILES.remove('particlefactories.h')
  4672. IGATEFILES.remove('emitters.h')
  4673. IGATEFILES.remove('particles.h')
  4674. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4675. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4676. #
  4677. # DIRECTORY: panda/metalibs/pandaphysics/
  4678. #
  4679. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4680. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4681. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4682. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4683. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4684. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4685. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4686. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4687. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4688. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4689. OPTS=['DIR:panda/metalibs/pandaphysics']
  4690. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4691. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4692. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4693. PyTargetAdd('physics_module.obj', opts=OPTS)
  4694. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4695. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4696. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4697. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4698. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4699. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4700. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4701. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4702. #
  4703. # DIRECTORY: panda/src/speedtree/
  4704. #
  4705. if (PkgSkip("SPEEDTREE")==0):
  4706. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4707. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4708. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4709. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4710. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4711. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4712. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4713. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4714. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4715. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4716. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4717. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4718. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4719. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4720. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4721. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4722. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4723. #
  4724. # DIRECTORY: panda/src/testbed/
  4725. #
  4726. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4727. OPTS=['DIR:panda/src/testbed']
  4728. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4729. TargetAdd('pview.exe', input='pview_pview.obj')
  4730. TargetAdd('pview.exe', input='libp3framework.dll')
  4731. if not PkgSkip("EGG"):
  4732. TargetAdd('pview.exe', input='libpandaegg.dll')
  4733. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4734. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4735. if GetLinkAllStatic() and not PkgSkip("GL"):
  4736. TargetAdd('pview.exe', input='libpandagl.dll')
  4737. #
  4738. # DIRECTORY: panda/src/android/
  4739. #
  4740. if (not RUNTIME and GetTarget() == 'android'):
  4741. OPTS=['DIR:panda/src/android']
  4742. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4743. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4744. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4745. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4746. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4747. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4748. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4749. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4750. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4751. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4752. if (not RTDIST and PkgSkip("PVIEW")==0):
  4753. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4754. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4755. TargetAdd('libpview.dll', input='android_main.obj')
  4756. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4757. TargetAdd('libpview.dll', input='libp3framework.dll')
  4758. if not PkgSkip("EGG"):
  4759. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4760. TargetAdd('libpview.dll', input='libp3android.dll')
  4761. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4762. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4763. if (not RTDIST and PkgSkip("PYTHON")==0):
  4764. OPTS += ['PYTHON']
  4765. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4766. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4767. TargetAdd('libppython.dll', input='android_main.obj')
  4768. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4769. TargetAdd('libppython.dll', input='libp3framework.dll')
  4770. TargetAdd('libppython.dll', input='libp3android.dll')
  4771. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4772. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4773. #
  4774. # DIRECTORY: panda/src/androiddisplay/
  4775. #
  4776. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4777. DefSymbol('GLES', 'OPENGLES_1', '')
  4778. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4779. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4780. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4781. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4782. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4783. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4784. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4785. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4786. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4787. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4788. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4789. #
  4790. # DIRECTORY: panda/src/tinydisplay/
  4791. #
  4792. if not RUNTIME and not PkgSkip("TINYDISPLAY"):
  4793. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4794. if not PkgSkip("X11"):
  4795. OPTS += ['X11']
  4796. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4797. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4798. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4799. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4800. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4801. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4802. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4803. if GetTarget() == 'darwin':
  4804. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4805. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4806. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4807. elif GetTarget() == 'windows':
  4808. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4809. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4810. elif not PkgSkip("X11"):
  4811. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4812. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4813. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4814. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4815. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4816. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4817. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4818. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4819. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4820. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4821. #
  4822. # DIRECTORY: direct/src/directbase/
  4823. #
  4824. if (PkgSkip("DIRECT")==0):
  4825. OPTS=['DIR:direct/src/directbase']
  4826. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4827. #
  4828. # DIRECTORY: direct/src/dcparser/
  4829. #
  4830. if (PkgSkip("DIRECT")==0):
  4831. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4832. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4833. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4834. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4835. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4836. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4837. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4838. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4839. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4840. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4841. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4842. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4843. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4844. #
  4845. # DIRECTORY: direct/src/deadrec/
  4846. #
  4847. if (PkgSkip("DIRECT")==0):
  4848. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4849. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4850. OPTS=['DIR:direct/src/deadrec']
  4851. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4852. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4853. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4854. #
  4855. # DIRECTORY: direct/src/distributed/
  4856. #
  4857. if (PkgSkip("DIRECT")==0):
  4858. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4859. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4860. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4861. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4862. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4863. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4864. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4865. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4866. #
  4867. # DIRECTORY: direct/src/interval/
  4868. #
  4869. if (PkgSkip("DIRECT")==0):
  4870. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4871. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4872. OPTS=['DIR:direct/src/interval']
  4873. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4874. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4875. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4876. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4877. #
  4878. # DIRECTORY: direct/src/showbase/
  4879. #
  4880. if (PkgSkip("DIRECT")==0):
  4881. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4882. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4883. if GetTarget() == 'darwin':
  4884. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4885. OPTS=['DIR:direct/src/showbase']
  4886. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4887. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4888. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4889. #
  4890. # DIRECTORY: direct/src/motiontrail/
  4891. #
  4892. if (PkgSkip("DIRECT")==0):
  4893. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4894. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4895. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4896. OPTS=['DIR:direct/src/motiontrail']
  4897. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4898. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4899. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4900. #
  4901. # DIRECTORY: direct/metalibs/direct/
  4902. #
  4903. if (PkgSkip("DIRECT")==0):
  4904. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4905. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4906. if GetTarget() == 'darwin':
  4907. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4908. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4909. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4910. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4911. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4912. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4913. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4914. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4915. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4916. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4917. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4918. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4919. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4920. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4921. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4922. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4923. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4924. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4925. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4926. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4927. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4928. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4929. # the Python libraries. If a C++ user needs these modules, we can move them
  4930. # back and filter out the Python-specific code.
  4931. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4932. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4933. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4934. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4935. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4936. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4937. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4938. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4939. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4940. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4941. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4942. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4943. #
  4944. # DIRECTORY: direct/src/dcparse/
  4945. #
  4946. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4947. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4948. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4949. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4950. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4951. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4952. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4953. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4954. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4955. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4956. PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4957. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4958. #
  4959. # DIRECTORY: direct/src/plugin/
  4960. #
  4961. if (RTDIST or RUNTIME):
  4962. # Explicitly define this as we don't include dtool_config.h here.
  4963. if GetTarget() not in ('windows', 'darwin'):
  4964. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4965. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4966. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  4967. OPTS += ['ZLIB', 'MSIMG']
  4968. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  4969. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  4970. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  4971. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  4972. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  4973. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  4974. if GetTarget() == 'darwin':
  4975. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  4976. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  4977. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  4978. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  4979. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  4980. if (RTDIST):
  4981. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  4982. TargetAdd(fname, input='plugin_plugin.obj')
  4983. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  4984. TargetAdd(fname, input='plugin_wstring_encode.obj')
  4985. TargetAdd(fname, input='plugin_parse_color.obj')
  4986. TargetAdd(fname, input='plugin_find_root_dir.obj')
  4987. if GetTarget() == 'darwin':
  4988. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  4989. TargetAdd(fname, input='plugin_fileSpec.obj')
  4990. TargetAdd(fname, input='plugin_binaryXml.obj')
  4991. TargetAdd(fname, input='plugin_handleStream.obj')
  4992. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  4993. TargetAdd(fname, input='libp3tinyxml.ilb')
  4994. if GetTarget() == 'darwin':
  4995. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  4996. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  4997. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  4998. if (PkgSkip("PYTHON")==0 and RTDIST):
  4999. # Freeze VFSImporter and its dependency modules into p3dpython.
  5000. # Mark panda3d.core as a dependency to make sure to build that first.
  5001. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  5002. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  5003. OPTS += ['PYTHON']
  5004. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5005. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5006. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  5007. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  5008. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  5009. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  5010. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  5011. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  5012. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  5013. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  5014. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  5015. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  5016. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  5017. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  5018. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  5019. if GetTarget() == 'windows':
  5020. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  5021. OPTS.append("NON_CONSOLE")
  5022. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5023. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5024. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  5025. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  5026. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  5027. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  5028. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  5029. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  5030. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  5031. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  5032. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  5033. if GetTarget() == 'darwin':
  5034. OPTS += ['OPT:2']
  5035. if (PkgSkip("FLTK")==0):
  5036. OPTS.append("FLTK")
  5037. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  5038. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  5039. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5040. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5041. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5042. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  5043. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  5044. if GetTarget() == 'darwin':
  5045. OPTS += ['OPT:2']
  5046. TargetAdd('p3dcert.exe', opts=OPTS)
  5047. elif (PkgSkip("WX")==0):
  5048. OPTS += ["WX", "RTTI"]
  5049. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  5050. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5051. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5052. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5053. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  5054. if GetTarget() == "darwin":
  5055. OPTS += ['GL', 'OPT:2']
  5056. TargetAdd('p3dcert.exe', opts=OPTS)
  5057. #
  5058. # DIRECTORY: direct/src/plugin_npapi/
  5059. #
  5060. if RUNTIME:
  5061. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  5062. if GetTarget() == 'windows':
  5063. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5064. "version" : VERSION,
  5065. "description" : "Runs 3-D games and interactive applets",
  5066. "filename" : "nppanda3d.dll",
  5067. "mimetype" : "application/x-panda3d",
  5068. "extension" : "p3d",
  5069. "filedesc" : "Panda3D applet"}
  5070. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5071. elif GetTarget() == 'darwin':
  5072. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5073. OPTS += ['GTK2']
  5074. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5075. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5076. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5077. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5078. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5079. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5080. if GetTarget() == 'windows':
  5081. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5082. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5083. elif GetTarget() == 'darwin':
  5084. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5085. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5086. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5087. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5088. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5089. #
  5090. # DIRECTORY: direct/src/plugin_activex/
  5091. #
  5092. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5093. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5094. DefSymbol('ACTIVEX', '_USRDLL', '')
  5095. DefSymbol('ACTIVEX', '_WINDLL', '')
  5096. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5097. DefSymbol('ACTIVEX', '_MBCS', '')
  5098. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5099. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5100. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5101. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5102. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5103. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5104. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5105. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5106. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5107. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5108. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5109. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5110. #
  5111. # DIRECTORY: direct/src/plugin_standalone/
  5112. #
  5113. if (RUNTIME):
  5114. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5115. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5116. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5117. if GetTarget() == 'windows':
  5118. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5119. "version" : VERSION,
  5120. "description" : "Runs 3-D games and interactive applets",
  5121. "filename" : "panda3d.exe",
  5122. "mimetype" : "application/x-panda3d",
  5123. "extension" : "p3d",
  5124. "filedesc" : "Panda3D applet",
  5125. "icon" : "panda3d.ico"}
  5126. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5127. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5128. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5129. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5130. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5131. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5132. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5133. if GetTarget() == 'darwin':
  5134. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5135. elif GetTarget() == 'windows':
  5136. TargetAdd('panda3d.exe', input='panda3d.res')
  5137. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5138. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5139. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5140. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5141. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5142. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5143. if (GetTarget() == 'darwin'):
  5144. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5145. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5146. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5147. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5148. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5149. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5150. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5151. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5152. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5153. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5154. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5155. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5156. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5157. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5158. elif (GetTarget() == 'windows'):
  5159. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5160. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5161. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5162. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5163. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5164. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5165. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5166. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5167. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5168. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5169. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5170. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5171. if (RTDIST):
  5172. 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']
  5173. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5174. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5175. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5176. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5177. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5178. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5179. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5180. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5181. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5182. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5183. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5184. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5185. if (GetTarget() == 'darwin'):
  5186. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5187. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5188. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5189. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5190. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5191. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5192. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5193. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5194. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5195. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5196. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5197. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5198. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5199. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5200. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5201. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5202. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5203. if GetTarget() == 'darwin':
  5204. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5205. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5206. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5207. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5208. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5209. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5210. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5211. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5212. if GetTarget() == 'darwin':
  5213. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5214. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5215. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5216. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5217. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5218. if GetTarget() == 'windows':
  5219. OPTS.append("P3DEMBEDW")
  5220. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5221. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5222. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5223. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5224. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5225. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5226. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5227. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5228. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5229. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5230. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5231. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5232. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5233. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5234. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5235. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5236. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5237. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5238. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5239. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5240. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5241. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5242. #
  5243. # DIRECTORY: pandatool/src/pandatoolbase/
  5244. #
  5245. if (PkgSkip("PANDATOOL")==0):
  5246. OPTS=['DIR:pandatool/src/pandatoolbase']
  5247. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5248. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5249. #
  5250. # DIRECTORY: pandatool/src/converter/
  5251. #
  5252. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5253. OPTS=['DIR:pandatool/src/converter']
  5254. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5255. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5256. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5257. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5258. #
  5259. # DIRECTORY: pandatool/src/progbase/
  5260. #
  5261. if not PkgSkip("PANDATOOL"):
  5262. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5263. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5264. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5265. #
  5266. # DIRECTORY: pandatool/src/eggbase/
  5267. #
  5268. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5269. OPTS=['DIR:pandatool/src/eggbase']
  5270. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5271. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5272. #
  5273. # DIRECTORY: pandatool/src/bam/
  5274. #
  5275. if not PkgSkip("PANDATOOL"):
  5276. OPTS=['DIR:pandatool/src/bam']
  5277. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5278. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5279. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5280. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5281. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5282. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5283. if not PkgSkip("EGG"):
  5284. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5285. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5286. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5287. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5288. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5289. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5290. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5291. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5292. #
  5293. # DIRECTORY: pandatool/src/cvscopy/
  5294. #
  5295. if not PkgSkip("PANDATOOL"):
  5296. OPTS=['DIR:pandatool/src/cvscopy']
  5297. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5298. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5299. #
  5300. # DIRECTORY: pandatool/src/daeegg/
  5301. #
  5302. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5303. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5304. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5305. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5306. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5307. #
  5308. # DIRECTORY: pandatool/src/assimp
  5309. #
  5310. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5311. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5312. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5313. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5314. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5315. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5316. #
  5317. # DIRECTORY: pandatool/src/daeprogs/
  5318. #
  5319. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5320. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5321. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5322. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5323. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5324. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5325. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5326. #
  5327. # DIRECTORY: pandatool/src/dxf/
  5328. #
  5329. if not PkgSkip("PANDATOOL"):
  5330. OPTS=['DIR:pandatool/src/dxf']
  5331. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5332. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5333. #
  5334. # DIRECTORY: pandatool/src/dxfegg/
  5335. #
  5336. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5337. OPTS=['DIR:pandatool/src/dxfegg']
  5338. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5339. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5340. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5341. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5342. #
  5343. # DIRECTORY: pandatool/src/dxfprogs/
  5344. #
  5345. if not PkgSkip("PANDATOOL"):
  5346. OPTS=['DIR:pandatool/src/dxfprogs']
  5347. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5348. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5349. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5350. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5351. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5352. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5353. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5354. if not PkgSkip("EGG"):
  5355. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5356. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5357. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5358. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5359. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5360. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5361. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5362. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5363. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5364. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5365. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5366. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5367. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5368. #
  5369. # DIRECTORY: pandatool/src/objegg/
  5370. #
  5371. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5372. OPTS=['DIR:pandatool/src/objegg']
  5373. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5374. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5375. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5376. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5377. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5378. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5379. #
  5380. # DIRECTORY: pandatool/src/objprogs/
  5381. #
  5382. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5383. OPTS=['DIR:pandatool/src/objprogs']
  5384. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5385. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5386. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5387. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5388. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5389. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5390. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5391. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5392. #
  5393. # DIRECTORY: pandatool/src/palettizer/
  5394. #
  5395. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5396. OPTS=['DIR:pandatool/src/palettizer']
  5397. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5398. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5399. #
  5400. # DIRECTORY: pandatool/src/egg-mkfont/
  5401. #
  5402. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5403. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5404. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5405. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5406. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5407. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5408. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5409. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5410. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5411. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5412. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5413. #
  5414. # DIRECTORY: pandatool/src/eggcharbase/
  5415. #
  5416. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5417. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5418. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5419. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5420. #
  5421. # DIRECTORY: pandatool/src/egg-optchar/
  5422. #
  5423. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5424. OPTS=['DIR:pandatool/src/egg-optchar']
  5425. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5426. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5427. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5428. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5429. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5430. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5431. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5432. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5433. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5434. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5435. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5436. #
  5437. # DIRECTORY: pandatool/src/egg-palettize/
  5438. #
  5439. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5440. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5441. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5442. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5443. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5444. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5445. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5446. #
  5447. # DIRECTORY: pandatool/src/egg-qtess/
  5448. #
  5449. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5450. OPTS=['DIR:pandatool/src/egg-qtess']
  5451. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5452. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5453. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5454. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5455. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5456. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5457. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5458. #
  5459. # DIRECTORY: pandatool/src/eggprogs/
  5460. #
  5461. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5462. OPTS=['DIR:pandatool/src/eggprogs']
  5463. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5464. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5465. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5466. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5467. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5468. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5469. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5470. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5471. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5472. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5473. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5474. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5475. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5476. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5477. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5478. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5479. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5480. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5481. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5482. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5483. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5484. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5485. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5486. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5487. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5488. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5489. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5490. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5491. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5492. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5493. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5494. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5495. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5496. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5497. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5498. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5499. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5500. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5501. #
  5502. # DIRECTORY: pandatool/src/flt/
  5503. #
  5504. if not PkgSkip("PANDATOOL"):
  5505. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5506. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5507. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5508. #
  5509. # DIRECTORY: pandatool/src/fltegg/
  5510. #
  5511. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5512. OPTS=['DIR:pandatool/src/fltegg']
  5513. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5514. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5515. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5516. #
  5517. # DIRECTORY: pandatool/src/fltprogs/
  5518. #
  5519. if not PkgSkip("PANDATOOL"):
  5520. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5521. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5522. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5523. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5524. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5525. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5526. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5527. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5528. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5529. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5530. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5531. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5532. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5533. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5534. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5535. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5536. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5537. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5538. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5539. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5540. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5541. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5542. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5543. if not PkgSkip("EGG"):
  5544. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5545. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5546. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5547. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5548. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5549. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5550. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5551. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5552. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5553. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5554. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5555. #
  5556. # DIRECTORY: pandatool/src/imagebase/
  5557. #
  5558. if not PkgSkip("PANDATOOL"):
  5559. OPTS=['DIR:pandatool/src/imagebase']
  5560. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5561. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5562. #
  5563. # DIRECTORY: pandatool/src/imageprogs/
  5564. #
  5565. if not PkgSkip("PANDATOOL"):
  5566. OPTS=['DIR:pandatool/src/imageprogs']
  5567. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5568. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5569. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5570. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5571. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5572. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5573. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5574. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5575. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5576. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5577. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5578. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5579. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5580. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5581. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5582. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5583. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5584. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5585. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5586. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5587. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5588. #
  5589. # DIRECTORY: pandatool/src/pfmprogs/
  5590. #
  5591. if not PkgSkip("PANDATOOL"):
  5592. OPTS=['DIR:pandatool/src/pfmprogs']
  5593. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5594. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5595. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5596. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5597. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5598. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5599. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5600. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5601. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5602. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5603. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5604. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5605. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5606. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5607. #
  5608. # DIRECTORY: pandatool/src/lwo/
  5609. #
  5610. if not PkgSkip("PANDATOOL"):
  5611. OPTS=['DIR:pandatool/src/lwo']
  5612. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5613. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5614. #
  5615. # DIRECTORY: pandatool/src/lwoegg/
  5616. #
  5617. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5618. OPTS=['DIR:pandatool/src/lwoegg']
  5619. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5620. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5621. #
  5622. # DIRECTORY: pandatool/src/lwoprogs/
  5623. #
  5624. if not PkgSkip("PANDATOOL"):
  5625. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5626. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5627. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5628. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5629. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5630. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5631. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5632. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5633. if not PkgSkip("EGG"):
  5634. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5635. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5636. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5637. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5638. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5639. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5640. #
  5641. # DIRECTORY: pandatool/src/maya/
  5642. #
  5643. for VER in MAYAVERSIONS:
  5644. VNUM=VER[4:]
  5645. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5646. OPTS=['DIR:pandatool/src/maya', VER]
  5647. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5648. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5649. #
  5650. # DIRECTORY: pandatool/src/mayaegg/
  5651. #
  5652. for VER in MAYAVERSIONS:
  5653. VNUM=VER[4:]
  5654. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5655. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5656. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5657. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5658. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5659. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5660. #
  5661. # DIRECTORY: pandatool/src/maxegg/
  5662. #
  5663. for VER in MAXVERSIONS:
  5664. VNUM=VER[3:]
  5665. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5666. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5667. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5668. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5669. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5670. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5671. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5672. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5673. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5674. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5675. #
  5676. # DIRECTORY: pandatool/src/maxprogs/
  5677. #
  5678. for VER in MAXVERSIONS:
  5679. VNUM=VER[3:]
  5680. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5681. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5682. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5683. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5684. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5685. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5686. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5687. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5688. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5689. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5690. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5691. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5692. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5693. #
  5694. # DIRECTORY: pandatool/src/vrml/
  5695. #
  5696. if not PkgSkip("PANDATOOL"):
  5697. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5698. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5699. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5700. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5701. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5702. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5703. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5704. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5705. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5706. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5707. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5708. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5709. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5710. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5711. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5712. #
  5713. # DIRECTORY: pandatool/src/vrmlegg/
  5714. #
  5715. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5716. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5717. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5718. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5719. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5720. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5721. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5722. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5723. #
  5724. # DIRECTORY: pandatool/src/xfile/
  5725. #
  5726. if not PkgSkip("PANDATOOL"):
  5727. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5728. CreateFile(GetOutputDir()+"/include/xParser.h")
  5729. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5730. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5731. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5732. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5733. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5734. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5735. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5736. #
  5737. # DIRECTORY: pandatool/src/xfileegg/
  5738. #
  5739. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5740. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5741. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5742. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5743. #
  5744. # DIRECTORY: pandatool/src/ptloader/
  5745. #
  5746. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5747. if not PkgSkip("FCOLLADA"):
  5748. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5749. 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']
  5750. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5751. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5752. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5753. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5754. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5755. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5756. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5757. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5758. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5759. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5760. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5761. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5762. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5763. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5764. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5765. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5766. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5767. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5768. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5769. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5770. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5771. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5772. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5773. #
  5774. # DIRECTORY: pandatool/src/miscprogs/
  5775. #
  5776. # This is a bit of an esoteric tool, and it causes issues because
  5777. # it conflicts with tools of the same name in different packages.
  5778. #if (PkgSkip("PANDATOOL")==0):
  5779. # OPTS=['DIR:pandatool/src/miscprogs']
  5780. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5781. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5782. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5783. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5784. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5785. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5786. #
  5787. # DIRECTORY: pandatool/src/pstatserver/
  5788. #
  5789. if (PkgSkip("PANDATOOL")==0):
  5790. OPTS=['DIR:pandatool/src/pstatserver']
  5791. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5792. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5793. #
  5794. # DIRECTORY: pandatool/src/text-stats/
  5795. #
  5796. if (PkgSkip("PANDATOOL")==0):
  5797. OPTS=['DIR:pandatool/src/text-stats']
  5798. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5799. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5800. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5801. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5802. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5803. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5804. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5805. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5806. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5807. #
  5808. # DIRECTORY: pandatool/src/vrmlprogs/
  5809. #
  5810. if not PkgSkip("PANDATOOL"):
  5811. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5812. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5813. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5814. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5815. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5816. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5817. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5818. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5819. if not PkgSkip("EGG"):
  5820. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5821. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5822. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5823. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5824. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5825. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5826. #
  5827. # DIRECTORY: pandatool/src/win-stats/
  5828. # DIRECTORY: pandatool/src/gtk-stats/
  5829. #
  5830. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5831. if GetTarget() == 'windows':
  5832. OPTS=['DIR:pandatool/src/win-stats']
  5833. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5834. else:
  5835. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5836. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5837. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5838. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5839. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5840. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5841. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5842. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5843. #
  5844. # DIRECTORY: pandatool/src/xfileprogs/
  5845. #
  5846. if not PkgSkip("PANDATOOL"):
  5847. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5848. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5849. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5850. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5851. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5852. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5853. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5854. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5855. if not PkgSkip("EGG"):
  5856. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5857. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5858. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5859. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5860. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5861. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5862. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5863. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5864. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5865. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5866. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5867. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5868. #
  5869. # DIRECTORY: pandatool/src/mayaprogs/
  5870. #
  5871. for VER in MAYAVERSIONS:
  5872. VNUM = VER[4:]
  5873. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5874. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5875. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5876. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5877. continue
  5878. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5879. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5880. elif GetTarget() == 'darwin':
  5881. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5882. else:
  5883. ARCH_OPTS = []
  5884. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5885. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5886. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5887. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5888. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5889. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5890. #if GetTarget() == 'windows':
  5891. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5892. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5893. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5894. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5895. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5896. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5897. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5898. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5899. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5900. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5901. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5902. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5903. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5904. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5905. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5906. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5907. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5908. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5909. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5910. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5911. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5912. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5913. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5914. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5915. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5916. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5917. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5918. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5919. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5920. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5921. if GetTarget() == 'windows':
  5922. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5923. else:
  5924. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5925. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5926. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5927. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5928. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5929. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5930. if GetTarget() == 'windows':
  5931. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5932. else:
  5933. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5934. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5935. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5936. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5937. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5938. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5939. if GetTarget() == 'windows':
  5940. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5941. else:
  5942. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5943. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5944. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5945. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5946. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5947. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5948. if GetTarget() == 'windows':
  5949. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5950. else:
  5951. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5952. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5953. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5954. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5955. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5956. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5957. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5958. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5959. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5960. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5961. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5962. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5963. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5964. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5965. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5966. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  5967. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5968. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5969. #
  5970. # DIRECTORY: contrib/src/ai/
  5971. #
  5972. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  5973. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  5974. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  5975. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  5976. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  5977. OPTS=['DIR:contrib/src/ai']
  5978. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  5979. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  5980. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  5981. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  5982. PyTargetAdd('ai_module.obj', opts=OPTS)
  5983. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  5984. PyTargetAdd('ai.pyd', input='ai_module.obj')
  5985. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  5986. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  5987. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  5988. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  5989. #
  5990. # DIRECTORY: contrib/src/rplight/
  5991. #
  5992. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  5993. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  5994. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  5995. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  5996. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  5997. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  5998. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  5999. PyTargetAdd('rplight_module.obj', opts=OPTS)
  6000. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  6001. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  6002. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  6003. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  6004. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  6005. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  6006. #
  6007. # DIRECTORY: pandatool/src/deploy-stub
  6008. #
  6009. if PkgSkip("PYTHON") == 0:
  6010. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  6011. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  6012. if GetTarget() == 'windows':
  6013. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  6014. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  6015. # Setup rpath so libs can be found in the same directory as the deployed game
  6016. LibName('DEPLOYSTUB', "-Wl,--disable-new-dtags,-rpath,\\$ORIGIN")
  6017. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  6018. LibName('DEPLOYSTUB', "-rdynamic")
  6019. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  6020. if GetTarget() == 'windows':
  6021. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  6022. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6023. if GetTarget() == 'windows':
  6024. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  6025. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  6026. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6027. elif GetTarget() == 'darwin':
  6028. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  6029. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  6030. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  6031. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  6032. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  6033. #
  6034. # Generate the models directory and samples directory
  6035. #
  6036. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  6037. model_extensions = ["*.egg"]
  6038. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  6039. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  6040. model_extensions.append("*.flt")
  6041. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  6042. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6043. newname = model[:-4] + ".egg.pz"
  6044. else:
  6045. newname = model[:-4] + ".egg"
  6046. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  6047. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  6048. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6049. newname = model[:-4] + ".egg.pz"
  6050. else:
  6051. newname = model[:-4] + ".egg"
  6052. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  6053. for model in GetDirectoryContents("models", model_extensions):
  6054. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6055. newname = model[:-4] + ".egg.pz"
  6056. else:
  6057. newname = model[:-4] + ".egg"
  6058. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  6059. if not PkgSkip("DIRECT") and not RUNTIME:
  6060. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  6061. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  6062. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  6063. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  6064. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  6065. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  6066. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  6067. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  6068. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  6069. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6070. #
  6071. # Build the rtdist.
  6072. #
  6073. if (RTDIST):
  6074. OPTS=['DIR:direct/src/p3d']
  6075. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6076. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6077. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6078. #
  6079. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6080. #
  6081. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6082. OPTS=['DIR:direct/src/p3d']
  6083. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6084. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6085. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6086. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6087. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6088. ##########################################################################################
  6089. #
  6090. # Dependency-Based Distributed Build System.
  6091. #
  6092. ##########################################################################################
  6093. DEPENDENCYQUEUE=[]
  6094. for target in TARGET_LIST:
  6095. name = target.name
  6096. inputs = target.inputs
  6097. opts = target.opts
  6098. deps = target.deps
  6099. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6100. def BuildWorker(taskqueue, donequeue):
  6101. while True:
  6102. try:
  6103. task = taskqueue.get(timeout=1)
  6104. except:
  6105. ProgressOutput(None, "Waiting for tasks...")
  6106. task = taskqueue.get()
  6107. sys.stdout.flush()
  6108. if (task == 0): return
  6109. try:
  6110. task[0](*task[1])
  6111. donequeue.put(task)
  6112. except:
  6113. donequeue.put(0)
  6114. def AllSourcesReady(task, pending):
  6115. sources = task[3]
  6116. for x in sources:
  6117. if (x in pending):
  6118. return 0
  6119. sources = task[1][1]
  6120. for x in sources:
  6121. if (x in pending):
  6122. return 0
  6123. altsources = task[4]
  6124. for x in altsources:
  6125. if (x in pending):
  6126. return 0
  6127. return 1
  6128. def ParallelMake(tasklist):
  6129. # Create the communication queues.
  6130. donequeue = queue.Queue()
  6131. taskqueue = queue.Queue()
  6132. # Build up a table listing all the pending targets
  6133. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6134. # task[2] = [name]
  6135. # task[3] = deps
  6136. # The python tool package, in particular fltegg seems to throw parallelmake off
  6137. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6138. # and another subpart to be built sequentially. The most time consuming part of the process
  6139. # is the c++ code generation anyways.
  6140. tasklist_seq = []
  6141. i = 0
  6142. while i < len(tasklist):
  6143. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6144. break
  6145. i += 1
  6146. if i < len(tasklist):
  6147. tasklist_seq = tasklist[i:]
  6148. tasklist = tasklist[:i]
  6149. iNumStartingTasks = len(tasklist)
  6150. pending = {}
  6151. for task in tasklist:
  6152. for target in task[2]:
  6153. pending[target] = 1
  6154. # Create the workers
  6155. for slave in range(THREADCOUNT):
  6156. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6157. th.daemon = True
  6158. th.start()
  6159. # Feed tasks to the workers.
  6160. tasksqueued = 0
  6161. while True:
  6162. if (tasksqueued < THREADCOUNT):
  6163. extras = []
  6164. for task in tasklist:
  6165. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6166. if (NeedsBuild(task[2], task[3])):
  6167. tasksqueued += 1
  6168. taskqueue.put(task)
  6169. else:
  6170. for target in task[2]:
  6171. del pending[target]
  6172. else:
  6173. extras.append(task)
  6174. tasklist = extras
  6175. sys.stdout.flush()
  6176. if (tasksqueued == 0): break
  6177. donetask = donequeue.get()
  6178. if (donetask == 0):
  6179. exit("Build process aborting.")
  6180. sys.stdout.flush()
  6181. tasksqueued -= 1
  6182. JustBuilt(donetask[2], donetask[3])
  6183. for target in donetask[2]:
  6184. del pending[target]
  6185. # Kill the workers.
  6186. for slave in range(THREADCOUNT):
  6187. taskqueue.put(0)
  6188. # Make sure there aren't any unsatisfied tasks
  6189. if len(tasklist) > 0:
  6190. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6191. SequentialMake(tasklist_seq)
  6192. def SequentialMake(tasklist):
  6193. i = 0
  6194. for task in tasklist:
  6195. if (NeedsBuild(task[2], task[3])):
  6196. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6197. JustBuilt(task[2], task[3])
  6198. i += 1
  6199. def RunDependencyQueue(tasklist):
  6200. if (THREADCOUNT!=0):
  6201. ParallelMake(tasklist)
  6202. else:
  6203. SequentialMake(tasklist)
  6204. try:
  6205. RunDependencyQueue(DEPENDENCYQUEUE)
  6206. finally:
  6207. SaveDependencyCache()
  6208. # Run the test suite.
  6209. if RUNTESTS:
  6210. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6211. if sys.version_info >= (2, 6):
  6212. cmdstr += " -B"
  6213. cmdstr += " -m pytest tests"
  6214. if GetVerbose():
  6215. cmdstr += " --verbose"
  6216. oscmd(cmdstr)
  6217. # Write out information about the Python versions in the built dir.
  6218. python_version_info = GetCurrentPythonVersionInfo()
  6219. UpdatePythonVersionInfoFile(python_version_info)
  6220. ##########################################################################################
  6221. #
  6222. # The Installers
  6223. #
  6224. # Under windows, we can build an 'exe' package using NSIS
  6225. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6226. # Under OSX, we can make a 'dmg' package.
  6227. #
  6228. ##########################################################################################
  6229. if INSTALLER:
  6230. ProgressOutput(100.0, "Building installer")
  6231. from makepackage import MakeInstaller
  6232. # When using the --installer flag, only install for the current version.
  6233. python_versions = []
  6234. if python_version_info:
  6235. python_versions.append(python_version_info)
  6236. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6237. optimize=GetOptimize(), compressor=COMPRESSOR,
  6238. debversion=DEBVERSION, rpmversion=RPMVERSION, rpmrelease=RPMRELEASE,
  6239. runtime=RUNTIME, python_versions=python_versions)
  6240. if WHEEL:
  6241. ProgressOutput(100.0, "Building wheel")
  6242. from makewheel import makewheel
  6243. makewheel(WHLVERSION, GetOutputDir())
  6244. ##########################################################################################
  6245. #
  6246. # Print final status report.
  6247. #
  6248. ##########################################################################################
  6249. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6250. printStatus("Makepanda Final Status Report", WARNINGS)
  6251. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())