makepanda.py 263 KB

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