makepanda.py 300 KB

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