makepanda.py 318 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294
  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. import time
  26. import os
  27. import sys
  28. from sysconfig import get_platform
  29. ########################################################################
  30. ##
  31. ## PARSING THE COMMAND LINE OPTIONS
  32. ##
  33. ## You might be tempted to change the defaults by editing them
  34. ## here. Don't do it. Instead, create a script that compiles
  35. ## panda with your preferred options. Or, create
  36. ## a 'makepandaPreferences' file and put it into your python path.
  37. ##
  38. ########################################################################
  39. COMPILER=0
  40. INSTALLER=0
  41. WHEEL=0
  42. RUNTESTS=0
  43. GENMAN=0
  44. COMPRESSOR="zlib"
  45. THREADCOUNT=0
  46. CFLAGS=""
  47. CXXFLAGS=""
  48. LDFLAGS=""
  49. RTDIST=0
  50. RTDIST_VERSION=None
  51. RUNTIME=0
  52. DISTRIBUTOR=""
  53. VERSION=None
  54. DEBVERSION=None
  55. WHLVERSION=None
  56. RPMVERSION=None
  57. RPMRELEASE="1"
  58. GIT_COMMIT=None
  59. P3DSUFFIX=None
  60. MAJOR_VERSION=None
  61. COREAPI_VERSION=None
  62. PLUGIN_VERSION=None
  63. OSXTARGET=None
  64. OSX_ARCHS=[]
  65. HOST_URL=None
  66. global STRDXSDKVERSION, BOOUSEINTELCOMPILER
  67. STRDXSDKVERSION = 'default'
  68. WINDOWS_SDK = None
  69. MSVC_VERSION = None
  70. BOOUSEINTELCOMPILER = False
  71. OPENCV_VER_23 = False
  72. PLATFORM = None
  73. COPY_PYTHON = True
  74. if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
  75. OSXTARGET=os.environ["MACOSX_DEPLOYMENT_TARGET"]
  76. PkgListSet(["PYTHON", "DIRECT", # Python support
  77. "GL", "GLES", "GLES2"] + DXVERSIONS + ["TINYDISPLAY", "NVIDIACG", # 3D graphics
  78. "EGL", # OpenGL (ES) integration
  79. "EIGEN", # Linear algebra acceleration
  80. "OPENAL", "FMODEX", # Audio playback
  81. "VORBIS", "OPUS", "FFMPEG", "SWSCALE", "SWRESAMPLE", # Audio decoding
  82. "ODE", "PHYSX", "BULLET", "PANDAPHYSICS", # Physics
  83. "SPEEDTREE", # SpeedTree
  84. "ZLIB", "PNG", "JPEG", "TIFF", "OPENEXR", "SQUISH", # 2D Formats support
  85. ] + MAYAVERSIONS + MAXVERSIONS + [ "FCOLLADA", "ASSIMP", "EGG", # 3D Formats support
  86. "FREETYPE", "HARFBUZZ", # Text rendering
  87. "VRPN", "OPENSSL", # Transport
  88. "FFTW", # Algorithm helpers
  89. "ARTOOLKIT", "OPENCV", "DIRECTCAM", "VISION", # Augmented Reality
  90. "GTK2", # GTK2 is used for PStats on Unix
  91. "MFC", "WX", "FLTK", # Used for web plug-in only
  92. "ROCKET", # GUI libraries
  93. "CARBON", "COCOA", # macOS toolkits
  94. "X11", # Unix platform support
  95. "PANDATOOL", "PVIEW", "DEPLOYTOOLS", # Toolchain
  96. "SKEL", # Example SKEL project
  97. "PANDAFX", # Some distortion special lenses
  98. "PANDAPARTICLESYSTEM", # Built in particle system
  99. "CONTRIB", # Experimental
  100. "SSE2", "NEON", # Compiler features
  101. "MIMALLOC", # Memory allocators
  102. ])
  103. CheckPandaSourceTree()
  104. def keyboardInterruptHandler(x,y):
  105. exit("keyboard interrupt")
  106. signal.signal(signal.SIGINT, keyboardInterruptHandler)
  107. ########################################################################
  108. ##
  109. ## Command-line parser.
  110. ##
  111. ## You can type "makepanda --help" to see all the options.
  112. ##
  113. ########################################################################
  114. def usage(problem):
  115. if (problem):
  116. print("")
  117. print("Error parsing command-line input: %s" % (problem))
  118. print("")
  119. print("Makepanda generates a 'built' subdirectory containing a")
  120. print("compiled copy of Panda3D. Command-line arguments are:")
  121. print("")
  122. print(" --help (print the help message you're reading now)")
  123. print(" --verbose (print out more information)")
  124. print(" --runtime (build a runtime build instead of an SDK build)")
  125. print(" --tests (run the test suite)")
  126. print(" --installer (build an installer)")
  127. print(" --wheel (build a pip-installable .whl)")
  128. print(" --optimize X (optimization level can be 1,2,3,4)")
  129. print(" --version X (set the panda version number)")
  130. print(" --lzma (use lzma compression when building Windows installer)")
  131. print(" --distributor X (short string identifying the distributor of the build)")
  132. print(" --outputdir X (use the specified directory instead of 'built')")
  133. print(" --host URL (set the host url (runtime build only))")
  134. print(" --threads N (use the multithreaded build system. see manual)")
  135. print(" --osxtarget N (the macOS version number to build for (macOS only))")
  136. print(" --universal (build universal binaries (macOS only))")
  137. print(" --override \"O=V\" (override dtool_config/prc option value)")
  138. print(" --static (builds libraries for static linking)")
  139. print(" --target X (experimental cross-compilation (android only))")
  140. print(" --arch X (target architecture for cross-compilation)")
  141. print("")
  142. for pkg in PkgListGet():
  143. p = pkg.lower()
  144. print(" --use-%-9s --no-%-9s (enable/disable use of %s)"%(p, p, pkg))
  145. if sys.platform != 'win32':
  146. print(" --<PKG>-incdir (custom location for header files of thirdparty package)")
  147. print(" --<PKG>-libdir (custom location for library files of thirdparty package)")
  148. print("")
  149. print(" --nothing (disable every third-party lib)")
  150. print(" --everything (enable every third-party lib)")
  151. print(" --directx-sdk=X (specify version of DirectX SDK to use: jun2010, aug2009, mar2009, aug2006)")
  152. print(" --windows-sdk=X (specify Windows SDK version, eg. 7.0, 7.1, 10 or 11. Default is 7.1)")
  153. print(" --msvc-version=X (specify Visual C++ version, eg. 10, 11, 12, 14, 14.1, 14.2, 14.3. Default is 14)")
  154. print(" --use-icl (experimental setting to use an intel compiler instead of MSVC on Windows)")
  155. print("")
  156. print("The simplest way to compile panda is to just type:")
  157. print("")
  158. print(" makepanda --everything")
  159. print("")
  160. os._exit(1)
  161. def parseopts(args):
  162. global INSTALLER,WHEEL,RUNTESTS,RTDIST,RUNTIME,GENMAN,DISTRIBUTOR,VERSION
  163. global COMPRESSOR,THREADCOUNT,OSXTARGET,OSX_ARCHS,HOST_URL
  164. global DEBVERSION,WHLVERSION,RPMVERSION,RPMRELEASE,GIT_COMMIT,P3DSUFFIX,RTDIST_VERSION
  165. global STRDXSDKVERSION, WINDOWS_SDK, MSVC_VERSION, BOOUSEINTELCOMPILER
  166. global COPY_PYTHON
  167. # Options for which to display a deprecation warning.
  168. removedopts = [
  169. "use-touchinput", "no-touchinput", "no-awesomium", "no-directscripts",
  170. ]
  171. # All recognized options.
  172. longopts = [
  173. "help","distributor=","verbose","runtime","osxtarget=","tests",
  174. "optimize=","everything","nothing","installer","wheel","rtdist","nocolor",
  175. "version=","lzma","no-python","threads=","outputdir=","override=",
  176. "static","host=","debversion=","rpmversion=","rpmrelease=","p3dsuffix=","rtdist-version=",
  177. "directx-sdk=", "windows-sdk=", "msvc-version=", "clean", "use-icl",
  178. "universal", "target=", "arch=", "git-commit=", "no-copy-python",
  179. "cggl-incdir=", "cggl-libdir=",
  180. ] + removedopts
  181. anything = 0
  182. optimize = ""
  183. target = None
  184. target_archs = []
  185. universal = False
  186. clean_build = False
  187. for pkg in PkgListGet():
  188. longopts.append("use-" + pkg.lower())
  189. longopts.append("no-" + pkg.lower())
  190. longopts.append(pkg.lower() + "-incdir=")
  191. longopts.append(pkg.lower() + "-libdir=")
  192. try:
  193. opts, extras = getopt.getopt(args, "", longopts)
  194. for option, value in opts:
  195. if (option=="--help"): raise Exception
  196. elif (option=="--optimize"): optimize=value
  197. elif (option=="--installer"): INSTALLER=1
  198. elif (option=="--tests"): RUNTESTS=1
  199. elif (option=="--wheel"): WHEEL=1
  200. elif (option=="--verbose"): SetVerbose(True)
  201. elif (option=="--distributor"): DISTRIBUTOR=value
  202. elif (option=="--rtdist"): RTDIST=1
  203. elif (option=="--runtime"): RUNTIME=1
  204. elif (option=="--genman"): GENMAN=1
  205. elif (option=="--everything"): PkgEnableAll()
  206. elif (option=="--nothing"): PkgDisableAll()
  207. elif (option=="--threads"): THREADCOUNT=int(value)
  208. elif (option=="--outputdir"): SetOutputDir(value.strip())
  209. elif (option=="--osxtarget"): OSXTARGET=value.strip()
  210. elif (option=="--universal"): universal = True
  211. elif (option=="--target"): target = value.strip()
  212. elif (option=="--arch"): target_archs.append(value.strip())
  213. elif (option=="--nocolor"): DisableColors()
  214. elif (option=="--version"):
  215. match = re.match(r'^\d+\.\d+(\.\d+)+', value)
  216. if not match:
  217. usage("version requires three digits")
  218. WHLVERSION = value
  219. VERSION = match.group()
  220. elif (option=="--lzma"): COMPRESSOR="lzma"
  221. elif (option=="--override"): AddOverride(value.strip())
  222. elif (option=="--static"): SetLinkAllStatic(True)
  223. elif (option=="--host"): HOST_URL=value
  224. elif (option=="--debversion"): DEBVERSION=value
  225. elif (option=="--rpmversion"): RPMVERSION=value
  226. elif (option=="--rpmrelease"): RPMRELEASE=value
  227. elif (option=="--git-commit"): GIT_COMMIT=value
  228. elif (option=="--p3dsuffix"): P3DSUFFIX=value
  229. elif (option=="--rtdist-version"): RTDIST_VERSION=value
  230. # Backward compatibility, OPENGL was renamed to GL
  231. elif (option=="--use-opengl"): PkgEnable("GL")
  232. elif (option=="--no-opengl"): PkgDisable("GL")
  233. elif (option=="--directx-sdk"):
  234. STRDXSDKVERSION = value.strip().lower()
  235. if STRDXSDKVERSION == '':
  236. print("No DirectX SDK version specified. Using 'default' DirectX SDK search")
  237. STRDXSDKVERSION = 'default'
  238. elif (option=="--windows-sdk"):
  239. WINDOWS_SDK = value.strip().lower()
  240. elif (option=="--msvc-version"):
  241. MSVC_VERSION = value.strip().lower()
  242. elif (option=="--use-icl"): BOOUSEINTELCOMPILER = True
  243. elif (option=="--clean"): clean_build = True
  244. elif (option=="--no-copy-python"): COPY_PYTHON = False
  245. elif (option[2:] in removedopts):
  246. Warn("Ignoring removed option %s" % (option))
  247. else:
  248. for pkg in PkgListGet() + ['CGGL']:
  249. if option == "--use-" + pkg.lower():
  250. PkgEnable(pkg)
  251. break
  252. elif option == "--no-" + pkg.lower():
  253. PkgDisable(pkg)
  254. break
  255. elif option == "--" + pkg.lower() + "-incdir":
  256. PkgSetCustomLocation(pkg)
  257. IncDirectory(pkg, value)
  258. break
  259. elif option == "--" + pkg.lower() + "-libdir":
  260. PkgSetCustomLocation(pkg)
  261. LibDirectory(pkg, value)
  262. break
  263. if (option == "--everything" or option.startswith("--use-")
  264. or option == "--nothing" or option.startswith("--no-")):
  265. anything = 1
  266. except:
  267. usage(sys.exc_info()[1])
  268. if not anything:
  269. if RUNTIME:
  270. PkgEnableAll()
  271. else:
  272. usage("You should specify a list of packages to use or --everything to enable all packages.")
  273. if (RTDIST and RUNTIME):
  274. usage("Options --runtime and --rtdist cannot be specified at the same time!")
  275. if (optimize=="" and (RTDIST or RUNTIME)): optimize = "4"
  276. elif (optimize==""): optimize = "3"
  277. if OSXTARGET:
  278. parts = OSXTARGET.strip().split('.')
  279. try:
  280. assert len(parts) <= 2
  281. maj = int(parts[0])
  282. min = 0
  283. if len(parts) > 1:
  284. min = int(parts[1])
  285. OSXTARGET = maj, min
  286. assert OSXTARGET >= (10, 4)
  287. except:
  288. usage("Invalid setting for --osxtarget")
  289. else:
  290. OSXTARGET = None
  291. if target is not None or target_archs:
  292. SetTarget(target, target_archs[-1] if target_archs else None)
  293. if universal:
  294. if target_archs:
  295. exit("--universal is incompatible with --arch")
  296. if OSXTARGET:
  297. osxver = OSXTARGET
  298. else:
  299. maj, min = platform.mac_ver()[0].split('.')[:2]
  300. osxver = int(maj), int(min)
  301. if osxver < (10, 15):
  302. OSX_ARCHS.append("i386")
  303. if osxver < (10, 6):
  304. OSX_ARCHS.append("ppc")
  305. else:
  306. OSX_ARCHS.append("x86_64")
  307. if osxver >= (11, 0):
  308. OSX_ARCHS.append("arm64")
  309. elif target_archs:
  310. OSX_ARCHS = target_archs
  311. if 'arm64' in target_archs and OSXTARGET and OSXTARGET < (10, 9):
  312. exit("Must have at least --osxtarget 10.9 when targeting arm64")
  313. elif platform.machine() == 'arm64':
  314. OSX_ARCHS = ('arm64',)
  315. try:
  316. SetOptimize(int(optimize))
  317. assert GetOptimize() in [1, 2, 3, 4]
  318. except:
  319. usage("Invalid setting for OPTIMIZE")
  320. if GIT_COMMIT is not None and not re.match("^[a-f0-9]{40}$", GIT_COMMIT):
  321. usage("Invalid SHA-1 hash given for --git-commit option!")
  322. if GetTarget() == 'windows':
  323. if not MSVC_VERSION:
  324. print("No MSVC version specified. Defaulting to 14 (Visual Studio 2015).")
  325. MSVC_VERSION = (14, 0)
  326. else:
  327. try:
  328. MSVC_VERSION = tuple(int(d) for d in MSVC_VERSION.split('.'))[:2]
  329. if (len(MSVC_VERSION) == 1):
  330. MSVC_VERSION += (0,)
  331. except:
  332. usage("Invalid setting for --msvc-version")
  333. if MSVC_VERSION < (14, 0):
  334. warn_prefix = "%sERROR:%s " % (GetColor("red"), GetColor())
  335. print("=========================================================================")
  336. print(warn_prefix + "Support for MSVC versions before 2015 has been discontinued.")
  337. print(warn_prefix + "For more information, or any questions, please visit:")
  338. print(warn_prefix + " https://github.com/panda3d/panda3d/issues/288")
  339. print("=========================================================================")
  340. sys.stdout.flush()
  341. time.sleep(1.0)
  342. sys.exit(1)
  343. if not WINDOWS_SDK:
  344. print("No Windows SDK version specified. Defaulting to '7.1'.")
  345. WINDOWS_SDK = '7.1'
  346. if clean_build and os.path.isdir(GetOutputDir()):
  347. print("Deleting %s" % (GetOutputDir()))
  348. shutil.rmtree(GetOutputDir())
  349. parseopts(sys.argv[1:])
  350. ########################################################################
  351. ##
  352. ## Handle environment variables.
  353. ##
  354. ########################################################################
  355. if ("CFLAGS" in os.environ):
  356. CFLAGS = os.environ["CFLAGS"].strip()
  357. if ("CXXFLAGS" in os.environ):
  358. CXXFLAGS = os.environ["CXXFLAGS"].strip()
  359. if ("RPM_OPT_FLAGS" in os.environ):
  360. CFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  361. CXXFLAGS += " " + os.environ["RPM_OPT_FLAGS"].strip()
  362. if ("LDFLAGS" in os.environ):
  363. LDFLAGS = os.environ["LDFLAGS"].strip()
  364. os.environ["MAKEPANDA"] = os.path.abspath(sys.argv[0])
  365. if GetHost() == "darwin" and OSXTARGET is not None:
  366. os.environ["MACOSX_DEPLOYMENT_TARGET"] = "%d.%d" % OSXTARGET
  367. ########################################################################
  368. ##
  369. ## Configure things based on the command-line parameters.
  370. ##
  371. ########################################################################
  372. PLUGIN_VERSION = ParsePluginVersion("dtool/PandaVersion.pp")
  373. COREAPI_VERSION = PLUGIN_VERSION + "." + ParseCoreapiVersion("dtool/PandaVersion.pp")
  374. if VERSION is None:
  375. if RUNTIME:
  376. VERSION = PLUGIN_VERSION
  377. else:
  378. # Take the value from the setup.cfg file.
  379. VERSION = GetMetadataValue('version')
  380. match = re.match(r'^\d+\.\d+(\.\d+)+', VERSION)
  381. if not match:
  382. exit("Invalid version %s in setup.cfg, three digits are required" % (VERSION))
  383. if WHLVERSION is None:
  384. WHLVERSION = VERSION
  385. VERSION = match.group()
  386. if WHLVERSION is None:
  387. WHLVERSION = VERSION
  388. print("Version: %s" % VERSION)
  389. if RUNTIME or RTDIST:
  390. print("Core API Version: %s" % COREAPI_VERSION)
  391. if DEBVERSION is None:
  392. DEBVERSION = VERSION
  393. if RPMVERSION is None:
  394. RPMVERSION = VERSION
  395. MAJOR_VERSION = '.'.join(VERSION.split('.')[:2])
  396. if P3DSUFFIX is None:
  397. P3DSUFFIX = MAJOR_VERSION
  398. # Now determine the distutils-style platform tag for the target system.
  399. target = GetTarget()
  400. target_arch = GetTargetArch()
  401. if target == 'windows':
  402. if target_arch == 'x64':
  403. PLATFORM = 'win-amd64'
  404. else:
  405. PLATFORM = 'win32'
  406. elif target == 'darwin':
  407. if OSXTARGET:
  408. osxver = OSXTARGET
  409. else:
  410. maj, min = platform.mac_ver()[0].split('.')[:2]
  411. osxver = int(maj), int(min)
  412. if osxver[0] >= 11:
  413. # I think Python pins minor version to 0 from macOS 11 onward
  414. osxver = (osxver[0], 0)
  415. arch_tag = None
  416. if not OSX_ARCHS:
  417. arch_tag = target_arch
  418. elif len(OSX_ARCHS) == 1:
  419. arch_tag = OSX_ARCHS[0]
  420. elif frozenset(OSX_ARCHS) == frozenset(('i386', 'ppc')):
  421. arch_tag = 'fat'
  422. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386')):
  423. arch_tag = 'intel'
  424. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'ppc64')):
  425. arch_tag = 'fat64'
  426. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc')):
  427. arch_tag = 'fat32'
  428. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'i386', 'ppc64', 'ppc')):
  429. arch_tag = 'universal'
  430. elif frozenset(OSX_ARCHS) == frozenset(('x86_64', 'arm64')):
  431. arch_tag = 'universal2'
  432. else:
  433. raise RuntimeError('No arch tag for arch combination %s' % OSX_ARCHS)
  434. PLATFORM = 'macosx-{0}.{1}-{2}'.format(osxver[0], osxver[1], arch_tag)
  435. 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"):
  436. # This is manylinux1. A bit of a sloppy check, though.
  437. if target_arch in ('x86_64', 'amd64'):
  438. PLATFORM = 'manylinux1-x86_64'
  439. elif target_arch in ('arm64', 'aarch64'):
  440. PLATFORM = 'manylinux1-aarch64'
  441. else:
  442. PLATFORM = 'manylinux1-i686'
  443. elif target == 'linux' and (os.path.isfile("/lib/libc-2.12.so") or os.path.isfile("/lib64/libc-2.12.so")) and os.path.isdir("/opt/python"):
  444. # Same sloppy check for manylinux2010.
  445. if target_arch in ('x86_64', 'amd64'):
  446. PLATFORM = 'manylinux2010-x86_64'
  447. elif target_arch in ('arm64', 'aarch64'):
  448. PLATFORM = 'manylinux2010-aarch64'
  449. else:
  450. PLATFORM = 'manylinux2010-i686'
  451. elif target == 'linux' and (os.path.isfile("/lib/libc-2.17.so") or os.path.isfile("/lib64/libc-2.17.so")) and os.path.isdir("/opt/python"):
  452. # Same sloppy check for manylinux2014.
  453. if target_arch in ('x86_64', 'amd64'):
  454. PLATFORM = 'manylinux2014-x86_64'
  455. elif target_arch in ('arm64', 'aarch64'):
  456. PLATFORM = 'manylinux2014-aarch64'
  457. else:
  458. PLATFORM = 'manylinux2014-i686'
  459. elif target == 'linux' and (os.path.isfile("/lib/i386-linux-gnu/libc-2.24.so") or os.path.isfile("/lib/x86_64-linux-gnu/libc-2.24.so")) and os.path.isdir("/opt/python"):
  460. # Same sloppy check for manylinux_2_24.
  461. if target_arch in ('x86_64', 'amd64'):
  462. PLATFORM = 'manylinux_2_24-x86_64'
  463. elif target_arch in ('arm64', 'aarch64'):
  464. PLATFORM = 'manylinux_2_24-aarch64'
  465. else:
  466. PLATFORM = 'manylinux_2_24-i686'
  467. elif target == 'linux' and os.path.isfile("/lib64/libc-2.28.so") and os.path.isfile('/etc/almalinux-release') and os.path.isdir("/opt/python"):
  468. # Same sloppy check for manylinux_2_28.
  469. if target_arch in ('x86_64', 'amd64'):
  470. PLATFORM = 'manylinux_2_28-x86_64'
  471. elif target_arch in ('arm64', 'aarch64'):
  472. PLATFORM = 'manylinux_2_28-aarch64'
  473. else:
  474. raise RuntimeError('Unhandled arch %s, please file a bug report!' % (target_arch))
  475. elif not CrossCompiling():
  476. if HasTargetArch():
  477. # Replace the architecture in the platform string.
  478. platform_parts = get_platform().rsplit('-', 1)
  479. if target_arch == 'amd64':
  480. target_arch = 'x86_64'
  481. PLATFORM = platform_parts[0] + '-' + target_arch
  482. else:
  483. # We're not cross-compiling; just take the host arch.
  484. PLATFORM = get_platform()
  485. else:
  486. if target_arch == 'amd64':
  487. target_arch = 'x86_64'
  488. PLATFORM = '{0}-{1}'.format(target, target_arch)
  489. print("Platform: %s" % PLATFORM)
  490. outputdir_suffix = ""
  491. if (RUNTIME or RTDIST):
  492. # Compiling Maya/Max is pointless in rtdist build
  493. for ver in MAYAVERSIONS + MAXVERSIONS:
  494. PkgDisable(ver)
  495. if (DISTRIBUTOR.strip() == ""):
  496. exit("You must provide a valid distributor name when making a runtime or rtdist build!")
  497. outputdir_suffix += "_" + DISTRIBUTOR.strip()
  498. if (RUNTIME):
  499. outputdir_suffix += "_rt"
  500. if DISTRIBUTOR == "":
  501. DISTRIBUTOR = "makepanda"
  502. elif not RTDIST_VERSION:
  503. RTDIST_VERSION = DISTRIBUTOR.strip() + "_" + MAJOR_VERSION
  504. if not RTDIST_VERSION:
  505. RTDIST_VERSION = "dev"
  506. if not IsCustomOutputDir():
  507. if GetTarget() == "windows" and GetTargetArch() == 'x64':
  508. outputdir_suffix += '_x64'
  509. SetOutputDir("built" + outputdir_suffix)
  510. if (RUNTIME):
  511. for pkg in PkgListGet():
  512. if pkg in ["GTK2", "MFC"]:
  513. # Optional package(s) for runtime.
  514. pass
  515. elif pkg in ["OPENSSL", "ZLIB"]:
  516. # Required packages for runtime.
  517. if (PkgSkip(pkg)==1):
  518. exit("Runtime must be compiled with OpenSSL and ZLib support!")
  519. else:
  520. # Unused packages for runtime.
  521. PkgDisable(pkg)
  522. if (INSTALLER and RTDIST):
  523. exit("Cannot build an installer for the rtdist build!")
  524. if (WHEEL and RUNTIME):
  525. exit("Cannot build a wheel for the runtime build!")
  526. if (WHEEL and RTDIST):
  527. exit("Cannot build a wheel for the rtdist build!")
  528. if (INSTALLER) and (PkgSkip("PYTHON")) and (not RUNTIME) and GetTarget() == 'windows':
  529. exit("Cannot build installer on Windows without python")
  530. if WHEEL and PkgSkip("PYTHON"):
  531. exit("Cannot build wheel without Python")
  532. if (RTDIST) and (PkgSkip("WX") and PkgSkip("FLTK")):
  533. exit("Cannot build rtdist without wx or fltk")
  534. if (RUNTIME):
  535. SetLinkAllStatic(True)
  536. if not os.path.isdir("contrib"):
  537. PkgDisable("CONTRIB")
  538. ########################################################################
  539. ##
  540. ## Load the dependency cache.
  541. ##
  542. ########################################################################
  543. LoadDependencyCache()
  544. ########################################################################
  545. ##
  546. ## Locate various SDKs.
  547. ##
  548. ########################################################################
  549. MakeBuildTree()
  550. SdkLocateDirectX(STRDXSDKVERSION)
  551. SdkLocateMaya()
  552. SdkLocateMax()
  553. SdkLocateMacOSX(OSXTARGET, OSX_ARCHS)
  554. SdkLocatePython(RTDIST)
  555. SdkLocateWindows(WINDOWS_SDK)
  556. SdkLocatePhysX()
  557. SdkLocateSpeedTree()
  558. SdkLocateAndroid()
  559. SdkAutoDisableDirectX()
  560. SdkAutoDisableMaya()
  561. SdkAutoDisableMax()
  562. SdkAutoDisablePhysX()
  563. SdkAutoDisableSpeedTree()
  564. if RTDIST and DISTRIBUTOR == "cmu":
  565. # Some validation checks for the CMU builds.
  566. if (RTDIST_VERSION == "cmu_1.7" and SDK["PYTHONVERSION"] != "python2.6"):
  567. exit("The CMU 1.7 runtime distribution must be built against Python 2.6!")
  568. elif (RTDIST_VERSION == "cmu_1.8" and SDK["PYTHONVERSION"] != "python2.7"):
  569. exit("The CMU 1.8 runtime distribution must be built against Python 2.7!")
  570. elif (RTDIST_VERSION == "cmu_1.9" and SDK["PYTHONVERSION"] != "python2.7"):
  571. exit("The CMU 1.9 runtime distribution must be built against Python 2.7!")
  572. if RTDIST and not HOST_URL:
  573. exit("You must specify a host URL when building the rtdist!")
  574. if RUNTIME and not HOST_URL:
  575. # Set this to a nice default.
  576. HOST_URL = "https://runtime.panda3d.org/"
  577. if not PkgSkip("PYTHON") and SDK["PYTHONVERSION"] == "python2.7":
  578. warn_prefix = "%sWARNING:%s " % (GetColor("red"), GetColor())
  579. print("==========================================================================")
  580. print(warn_prefix + "Python 2.7 has reached EOL as of January 1, 2020 and is no longer")
  581. print(warn_prefix + "maintained. Panda3D will soon cease to work with this version.")
  582. print(warn_prefix + "Please upgrade to Python 3 now.")
  583. print("==========================================================================")
  584. sys.stdout.flush()
  585. # Give the user some time to contemplate their sins
  586. time.sleep(6.0)
  587. ########################################################################
  588. ##
  589. ## Choose a Compiler.
  590. ##
  591. ## This should also set up any environment variables needed to make
  592. ## the compiler work.
  593. ##
  594. ########################################################################
  595. if GetHost() == 'windows' and GetTarget() == 'windows':
  596. COMPILER = "MSVC"
  597. SdkLocateVisualStudio(MSVC_VERSION)
  598. else:
  599. COMPILER = "GCC"
  600. SetupBuildEnvironment(COMPILER)
  601. ########################################################################
  602. ##
  603. ## External includes, external libraries, and external defsyms.
  604. ##
  605. ########################################################################
  606. IncDirectory("ALWAYS", GetOutputDir()+"/tmp")
  607. IncDirectory("ALWAYS", GetOutputDir()+"/include")
  608. if (COMPILER == "MSVC"):
  609. PkgDisable("X11")
  610. PkgDisable("GLES")
  611. PkgDisable("GLES2")
  612. PkgDisable("EGL")
  613. PkgDisable("CARBON")
  614. PkgDisable("COCOA")
  615. DefSymbol("FLEX", "YY_NO_UNISTD_H")
  616. if (PkgSkip("PYTHON")==0):
  617. IncDirectory("ALWAYS", SDK["PYTHON"] + "/include")
  618. LibDirectory("ALWAYS", SDK["PYTHON"] + "/libs")
  619. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  620. for pkg in PkgListGet():
  621. if (PkgSkip(pkg)==0):
  622. if (pkg[:4]=="MAYA"):
  623. IncDirectory(pkg, SDK[pkg] + "/include")
  624. DefSymbol(pkg, "MAYAVERSION", pkg)
  625. DefSymbol(pkg, "MLIBRARY_DONTUSE_MFC_MANIFEST", "")
  626. elif (pkg[:3]=="MAX"):
  627. IncDirectory(pkg, SDK[pkg] + "/include")
  628. IncDirectory(pkg, SDK[pkg] + "/include/CS")
  629. IncDirectory(pkg, SDK[pkg+"CS"] + "/include")
  630. IncDirectory(pkg, SDK[pkg+"CS"] + "/include/CS")
  631. DefSymbol(pkg, "MAX", pkg)
  632. if (int(pkg[3:]) >= 2013):
  633. DefSymbol(pkg, "UNICODE", "")
  634. DefSymbol(pkg, "_UNICODE", "")
  635. elif (pkg[:2]=="DX"):
  636. IncDirectory(pkg, SDK[pkg] + "/include")
  637. elif GetThirdpartyDir() is not None:
  638. IncDirectory(pkg, GetThirdpartyDir() + pkg.lower() + "/include")
  639. for pkg in DXVERSIONS:
  640. if (PkgSkip(pkg)==0):
  641. vnum=pkg[2:]
  642. if GetTargetArch() == 'x64':
  643. LibDirectory(pkg, SDK[pkg] + '/lib/x64')
  644. else:
  645. LibDirectory(pkg, SDK[pkg] + '/lib/x86')
  646. LibDirectory(pkg, SDK[pkg] + '/lib')
  647. LibName(pkg, 'd3dVNUM.lib'.replace("VNUM", vnum))
  648. LibName(pkg, 'd3dxVNUM.lib'.replace("VNUM", vnum))
  649. if int(vnum) >= 9 and "GENERIC_DXERR_LIBRARY" in SDK:
  650. LibName(pkg, 'dxerr.lib')
  651. else:
  652. LibName(pkg, 'dxerrVNUM.lib'.replace("VNUM", vnum))
  653. #LibName(pkg, 'ddraw.lib')
  654. LibName(pkg, 'dxguid.lib')
  655. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  656. # dxerr needs this for __vsnwprintf definition.
  657. LibName(pkg, 'legacy_stdio_definitions.lib')
  658. if not PkgSkip("FREETYPE") and os.path.isdir(GetThirdpartyDir() + "freetype/include/freetype2"):
  659. IncDirectory("FREETYPE", GetThirdpartyDir() + "freetype/include/freetype2")
  660. IncDirectory("ALWAYS", GetThirdpartyDir() + "extras/include")
  661. LibName("WINSOCK", "wsock32.lib")
  662. LibName("WINSOCK2", "wsock32.lib")
  663. LibName("WINSOCK2", "ws2_32.lib")
  664. LibName("WINCOMCTL", "comctl32.lib")
  665. LibName("WINCOMDLG", "comdlg32.lib")
  666. LibName("WINUSER", "user32.lib")
  667. LibName("WINMM", "winmm.lib")
  668. LibName("WINIMM", "imm32.lib")
  669. LibName("WINKERNEL", "kernel32.lib")
  670. LibName("WINOLE", "ole32.lib")
  671. LibName("WINOLEAUT", "oleaut32.lib")
  672. LibName("WINOLDNAMES", "oldnames.lib")
  673. LibName("WINSHELL", "shell32.lib")
  674. LibName("WINGDI", "gdi32.lib")
  675. LibName("ADVAPI", "advapi32.lib")
  676. LibName("IPHLPAPI", "iphlpapi.lib")
  677. LibName("SETUPAPI", "setupapi.lib")
  678. LibName("GL", "opengl32.lib")
  679. LibName("GLES", "libgles_cm.lib")
  680. LibName("GLES2", "libGLESv2.lib")
  681. LibName("EGL", "libEGL.lib")
  682. LibName("MSIMG", "msimg32.lib")
  683. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "strmiids.lib")
  684. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "quartz.lib")
  685. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbc32.lib")
  686. if (PkgSkip("DIRECTCAM")==0): LibName("DIRECTCAM", "odbccp32.lib")
  687. if (PkgSkip("MIMALLOC")==0): LibName("MIMALLOC", GetThirdpartyDir() + "mimalloc/lib/mimalloc-static.lib")
  688. if (PkgSkip("OPENSSL")==0):
  689. if os.path.isfile(GetThirdpartyDir() + "openssl/lib/libpandassl.lib"):
  690. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandassl.lib")
  691. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libpandaeay.lib")
  692. elif os.path.isfile(GetThirdpartyDir() + "openssl/lib/ssleay32.lib"):
  693. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libeay32.lib")
  694. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/ssleay32.lib")
  695. else:
  696. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libssl.lib")
  697. LibName("OPENSSL", GetThirdpartyDir() + "openssl/lib/libcrypto.lib")
  698. LibName("OPENSSL", "crypt32.lib")
  699. LibName("OPENSSL", "ws2_32.lib")
  700. if (PkgSkip("PNG")==0):
  701. if os.path.isfile(GetThirdpartyDir() + "png/lib/libpng16_static.lib"):
  702. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng16_static.lib")
  703. else:
  704. LibName("PNG", GetThirdpartyDir() + "png/lib/libpng_static.lib")
  705. if (PkgSkip("TIFF")==0):
  706. if os.path.isfile(GetThirdpartyDir() + "tiff/lib/libtiff.lib"):
  707. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/libtiff.lib")
  708. else:
  709. LibName("TIFF", GetThirdpartyDir() + "tiff/lib/tiff.lib")
  710. if (PkgSkip("OPENEXR")==0):
  711. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXRCore-3_1.lib"):
  712. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_1.lib")
  713. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_1.lib")
  714. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_1.lib")
  715. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_1.lib")
  716. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib"):
  717. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR-3_0.lib")
  718. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread-3_0.lib")
  719. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath-3_0.lib")
  720. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex-3_0.lib")
  721. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/OpenEXR.lib"):
  722. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/OpenEXR.lib")
  723. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread.lib")
  724. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath.lib")
  725. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex.lib")
  726. else:
  727. suffix = ""
  728. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_2.lib"):
  729. suffix = "-2_2"
  730. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_3.lib"):
  731. suffix = "-2_3"
  732. elif os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf-2_4.lib"):
  733. suffix = "-2_4"
  734. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Imath" + suffix + ".lib")
  735. if os.path.isfile(GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + "_s.lib"):
  736. suffix += "_s" # _s suffix observed for OpenEXR 2.3 only so far
  737. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmImf" + suffix + ".lib")
  738. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/IlmThread" + suffix + ".lib")
  739. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Iex" + suffix + ".lib")
  740. if suffix == "-2_2":
  741. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half.lib")
  742. else:
  743. LibName("OPENEXR", GetThirdpartyDir() + "openexr/lib/Half" + suffix + ".lib")
  744. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/OpenEXR")
  745. IncDirectory("OPENEXR", GetThirdpartyDir() + "openexr/include/Imath")
  746. if (PkgSkip("JPEG")==0): LibName("JPEG", GetThirdpartyDir() + "jpeg/lib/jpeg-static.lib")
  747. if (PkgSkip("ZLIB")==0): LibName("ZLIB", GetThirdpartyDir() + "zlib/lib/zlibstatic.lib")
  748. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/vrpn.lib")
  749. if (PkgSkip("VRPN")==0): LibName("VRPN", GetThirdpartyDir() + "vrpn/lib/quat.lib")
  750. if (PkgSkip("NVIDIACG")==0): LibName("CGGL", GetThirdpartyDir() + "nvidiacg/lib/cgGL.lib")
  751. if (PkgSkip("NVIDIACG")==0): LibName("CGDX9", GetThirdpartyDir() + "nvidiacg/lib/cgD3D9.lib")
  752. if (PkgSkip("NVIDIACG")==0): LibName("NVIDIACG", GetThirdpartyDir() + "nvidiacg/lib/cg.lib")
  753. if (PkgSkip("FREETYPE")==0): LibName("FREETYPE", GetThirdpartyDir() + "freetype/lib/freetype.lib")
  754. if (PkgSkip("HARFBUZZ")==0):
  755. LibName("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/lib/harfbuzz.lib")
  756. IncDirectory("HARFBUZZ", GetThirdpartyDir() + "harfbuzz/include/harfbuzz")
  757. if (PkgSkip("FFTW")==0): LibName("FFTW", GetThirdpartyDir() + "fftw/lib/fftw3.lib")
  758. if (PkgSkip("ARTOOLKIT")==0):LibName("ARTOOLKIT",GetThirdpartyDir() + "artoolkit/lib/libAR.lib")
  759. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cv.lib")
  760. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/highgui.lib")
  761. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cvaux.lib")
  762. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/ml.lib")
  763. if (PkgSkip("OPENCV")==0): LibName("OPENCV", GetThirdpartyDir() + "opencv/lib/cxcore.lib")
  764. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avcodec.lib")
  765. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avformat.lib")
  766. if (PkgSkip("FFMPEG")==0): LibName("FFMPEG", GetThirdpartyDir() + "ffmpeg/lib/avutil.lib")
  767. if (PkgSkip("SWSCALE")==0): LibName("SWSCALE", GetThirdpartyDir() + "ffmpeg/lib/swscale.lib")
  768. if (PkgSkip("SWRESAMPLE")==0):LibName("SWRESAMPLE",GetThirdpartyDir() + "ffmpeg/lib/swresample.lib")
  769. if (PkgSkip("FCOLLADA")==0):
  770. LibName("FCOLLADA", GetThirdpartyDir() + "fcollada/lib/FCollada.lib")
  771. IncDirectory("FCOLLADA", GetThirdpartyDir() + "fcollada/include/FCollada")
  772. if (PkgSkip("ASSIMP")==0):
  773. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/assimp.lib")
  774. if os.path.isfile(GetThirdpartyDir() + "assimp/lib/IrrXML.lib"):
  775. LibName("ASSIMP", GetThirdpartyDir() + "assimp/lib/IrrXML.lib")
  776. IncDirectory("ASSIMP", GetThirdpartyDir() + "assimp/include")
  777. if (PkgSkip("SQUISH")==0):
  778. if GetOptimize() <= 2:
  779. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squishd.lib")
  780. else:
  781. LibName("SQUISH", GetThirdpartyDir() + "squish/lib/squish.lib")
  782. if (PkgSkip("ROCKET")==0):
  783. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketCore.lib")
  784. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketControls.lib")
  785. if (PkgSkip("PYTHON")==0):
  786. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/" + SDK["PYTHONVERSION"] + "/boost_python-vc100-mt-1_54.lib")
  787. if (GetOptimize() <= 3):
  788. LibName("ROCKET", GetThirdpartyDir() + "rocket/lib/RocketDebugger.lib")
  789. if (PkgSkip("OPENAL")==0):
  790. LibName("OPENAL", GetThirdpartyDir() + "openal/lib/OpenAL32.lib")
  791. if not os.path.isfile(GetThirdpartyDir() + "openal/bin/OpenAL32.dll"):
  792. # Link OpenAL Soft statically.
  793. DefSymbol("OPENAL", "AL_LIBTYPE_STATIC")
  794. if (PkgSkip("ODE")==0):
  795. LibName("ODE", GetThirdpartyDir() + "ode/lib/ode_single.lib")
  796. DefSymbol("ODE", "dSINGLE", "")
  797. if (PkgSkip("FMODEX")==0):
  798. if (GetTargetArch() == 'x64'):
  799. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex64_vc.lib")
  800. else:
  801. LibName("FMODEX", GetThirdpartyDir() + "fmodex/lib/fmodex_vc.lib")
  802. if (PkgSkip("FLTK")==0 and RTDIST):
  803. LibName("FLTK", GetThirdpartyDir() + "fltk/lib/fltk.lib")
  804. if not PkgSkip("FLTK"):
  805. # If we have fltk, we don't need wx
  806. PkgDisable("WX")
  807. if (PkgSkip("WX")==0 and RTDIST):
  808. LibName("WX", GetThirdpartyDir() + "wx/lib/wxbase28u.lib")
  809. LibName("WX", GetThirdpartyDir() + "wx/lib/wxmsw28u_core.lib")
  810. DefSymbol("WX", "__WXMSW__", "")
  811. DefSymbol("WX", "_UNICODE", "")
  812. DefSymbol("WX", "UNICODE", "")
  813. if (PkgSkip("VORBIS")==0):
  814. for lib in ('ogg', 'vorbis', 'vorbisfile'):
  815. path = GetThirdpartyDir() + "vorbis/lib/lib{0}_static.lib".format(lib)
  816. if not os.path.isfile(path):
  817. path = GetThirdpartyDir() + "vorbis/lib/{0}.lib".format(lib)
  818. LibName("VORBIS", path)
  819. if (PkgSkip("OPUS")==0):
  820. IncDirectory("OPUS", GetThirdpartyDir() + "opus/include/opus")
  821. for lib in ('ogg', 'opus', 'opusfile'):
  822. path = GetThirdpartyDir() + "opus/lib/lib{0}_static.lib".format(lib)
  823. if not os.path.isfile(path):
  824. path = GetThirdpartyDir() + "opus/lib/{0}.lib".format(lib)
  825. LibName("OPUS", path)
  826. for pkg in MAYAVERSIONS:
  827. if (PkgSkip(pkg)==0):
  828. LibName(pkg, '"' + SDK[pkg] + '/lib/Foundation.lib"')
  829. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMaya.lib"')
  830. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaAnim.lib"')
  831. LibName(pkg, '"' + SDK[pkg] + '/lib/OpenMayaUI.lib"')
  832. for pkg in MAXVERSIONS:
  833. if (PkgSkip(pkg)==0):
  834. LibName(pkg, SDK[pkg] + '/lib/core.lib')
  835. LibName(pkg, SDK[pkg] + '/lib/edmodel.lib')
  836. LibName(pkg, SDK[pkg] + '/lib/gfx.lib')
  837. LibName(pkg, SDK[pkg] + '/lib/geom.lib')
  838. LibName(pkg, SDK[pkg] + '/lib/mesh.lib')
  839. LibName(pkg, SDK[pkg] + '/lib/maxutil.lib')
  840. LibName(pkg, SDK[pkg] + '/lib/paramblk2.lib')
  841. if (PkgSkip("PHYSX")==0):
  842. if GetTargetArch() == 'x64':
  843. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader64.lib")
  844. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter64.lib")
  845. else:
  846. LibName("PHYSX", SDK["PHYSXLIBS"] + "/PhysXLoader.lib")
  847. LibName("PHYSX", SDK["PHYSXLIBS"] + "/NxCharacter.lib")
  848. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  849. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  850. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  851. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  852. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  853. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  854. if (PkgSkip("SPEEDTREE")==0):
  855. if GetTargetArch() == 'x64':
  856. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10.x64/"
  857. p64ext = '64'
  858. else:
  859. libdir = SDK["SPEEDTREE"] + "/Lib/Windows/VC10/"
  860. p64ext = ''
  861. debugext = ''
  862. if (GetOptimize() <= 2): debugext = "_d"
  863. libsuffix = "_v%s_VC100MT%s_Static%s.lib" % (
  864. SDK["SPEEDTREEVERSION"], p64ext, debugext)
  865. LibName("SPEEDTREE", "%sSpeedTreeCore%s" % (libdir, libsuffix))
  866. LibName("SPEEDTREE", "%sSpeedTreeForest%s" % (libdir, libsuffix))
  867. LibName("SPEEDTREE", "%sSpeedTree%sRenderer%s" % (libdir, SDK["SPEEDTREEAPI"], libsuffix))
  868. LibName("SPEEDTREE", "%sSpeedTreeRenderInterface%s" % (libdir, libsuffix))
  869. if (SDK["SPEEDTREEAPI"] == "OpenGL"):
  870. LibName("SPEEDTREE", "%sglew32.lib" % (libdir))
  871. LibName("SPEEDTREE", "glu32.lib")
  872. IncDirectory("SPEEDTREE", SDK["SPEEDTREE"] + "/Include")
  873. if (PkgSkip("BULLET")==0):
  874. suffix = '.lib'
  875. if GetTargetArch() == 'x64' and os.path.isfile(GetThirdpartyDir() + "bullet/lib/BulletCollision_x64.lib"):
  876. suffix = '_x64.lib'
  877. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/LinearMath" + suffix)
  878. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletCollision" + suffix)
  879. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletDynamics" + suffix)
  880. LibName("BULLET", GetThirdpartyDir() + "bullet/lib/BulletSoftBody" + suffix)
  881. if (COMPILER=="GCC"):
  882. PkgDisable("MIMALLOC") # no discernable benefit over glibc
  883. if GetTarget() != "darwin":
  884. PkgDisable("CARBON")
  885. PkgDisable("COCOA")
  886. elif RUNTIME:
  887. # We don't support Cocoa in the runtime yet.
  888. PkgDisable("COCOA")
  889. if 'x86_64' in OSX_ARCHS or 'arm64' in OSX_ARCHS:
  890. # 64-bits macOS doesn't have Carbon.
  891. PkgDisable("CARBON")
  892. if GetTarget() == 'darwin':
  893. if OSX_ARCHS and 'x86_64' not in OSX_ARCHS and 'i386' not in OSX_ARCHS:
  894. # These support only these archs, so don't build them if we're not
  895. # targeting any of the supported archs.
  896. PkgDisable("FMODEX")
  897. PkgDisable("NVIDIACG")
  898. PkgDisable("ROCKET")
  899. elif (OSX_ARCHS and 'arm64' in OSX_ARCHS) or \
  900. (OSXTARGET and OSXTARGET >= (10, 14)) or \
  901. (not OSXTARGET and not os.path.isfile('/usr/lib/libstdc++.6.0.9.dylib')):
  902. # Also, we can't target FMOD Ex with the 10.14 SDK
  903. PkgDisable("FMODEX")
  904. #if (PkgSkip("PYTHON")==0):
  905. # IncDirectory("PYTHON", SDK["PYTHON"])
  906. if (GetHost() == "darwin"):
  907. if (PkgSkip("FREETYPE")==0 and not os.path.isdir(GetThirdpartyDir() + 'freetype')):
  908. IncDirectory("FREETYPE", "/usr/X11/include")
  909. IncDirectory("FREETYPE", "/usr/X11/include/freetype2")
  910. LibDirectory("FREETYPE", "/usr/X11/lib")
  911. if (GetHost() == "freebsd"):
  912. IncDirectory("ALWAYS", "/usr/local/include")
  913. LibDirectory("ALWAYS", "/usr/local/lib")
  914. if (os.path.isdir("/usr/PCBSD")):
  915. IncDirectory("ALWAYS", "/usr/PCBSD/local/include")
  916. LibDirectory("ALWAYS", "/usr/PCBSD/local/lib")
  917. SmartPkgEnable("INOTIFY", "libinotify", ("inotify"), "sys/inotify.h")
  918. if GetTarget() != "windows":
  919. PkgDisable("DIRECTCAM")
  920. fcollada_libs = ("FColladaD", "FColladaSD", "FColladaS")
  921. # WARNING! The order of the ffmpeg libraries matters!
  922. ffmpeg_libs = ("libavformat", "libavcodec", "libavutil")
  923. assimp_libs = ("libassimp", "libassimpd")
  924. # Name pkg-config libs, include(dir)s
  925. if (not RUNTIME):
  926. SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
  927. SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
  928. SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
  929. SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
  930. SmartPkgEnable("FFMPEG", ffmpeg_libs, ffmpeg_libs, ("libavformat/avformat.h", "libavcodec/avcodec.h", "libavutil/avutil.h"))
  931. SmartPkgEnable("SWSCALE", "libswscale", "libswscale", ("libswscale/swscale.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  932. SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
  933. SmartPkgEnable("FFTW", "", ("fftw3"), ("fftw.h"))
  934. SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
  935. SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
  936. SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
  937. SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
  938. SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
  939. SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
  940. SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
  941. SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
  942. SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
  943. SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
  944. SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
  945. SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
  946. SmartPkgEnable("OPENEXR", "OpenEXR", ("IlmImf", "Imath", "Half", "Iex", "IexMath", "IlmThread"), ("OpenEXR", "Imath", "OpenEXR/ImfOutputFile.h"))
  947. SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
  948. SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
  949. SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
  950. SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
  951. SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
  952. SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
  953. # Copy freetype libraries to be specified after harfbuzz libraries as well,
  954. # because there's a circular dependency between the two libraries.
  955. if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
  956. for (opt, name) in LIBNAMES:
  957. if opt == "FREETYPE":
  958. LibName("HARFBUZZ", name)
  959. if not PkgSkip("FFMPEG"):
  960. if GetTarget() == "darwin":
  961. if 'i386' in OSX_ARCHS or 'ppc' in OSX_ARCHS:
  962. LibName("FFMPEG", "-Wl,-read_only_relocs,suppress")
  963. LibName("FFMPEG", "-framework VideoDecodeAcceleration")
  964. elif os.path.isfile(GetThirdpartyDir() + "ffmpeg/lib/libavcodec.a"):
  965. # Needed when linking ffmpeg statically on Linux.
  966. LibName("FFMPEG", "-Wl,-Bsymbolic")
  967. # Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
  968. for ffmpeg_lib in ffmpeg_libs:
  969. LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
  970. if GetTarget() != "darwin":
  971. for fcollada_lib in fcollada_libs:
  972. LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
  973. if not PkgSkip("SWSCALE"):
  974. LibName("SWSCALE", "-Wl,--exclude-libs,libswscale.a")
  975. if not PkgSkip("SWRESAMPLE"):
  976. LibName("SWRESAMPLE", "-Wl,--exclude-libs,libswresample.a")
  977. if not PkgSkip("JPEG"):
  978. LibName("JPEG", "-Wl,--exclude-libs,libjpeg.a")
  979. if not PkgSkip("TIFF"):
  980. LibName("TIFF", "-Wl,--exclude-libs,libtiff.a")
  981. if not PkgSkip("PNG"):
  982. LibName("PNG", "-Wl,--exclude-libs,libpng.a")
  983. LibName("PNG", "-Wl,--exclude-libs,libpng16.a")
  984. if not PkgSkip("SQUISH"):
  985. LibName("SQUISH", "-Wl,--exclude-libs,libsquish.a")
  986. if not PkgSkip("OPENEXR"):
  987. LibName("OPENEXR", "-Wl,--exclude-libs,libHalf.a")
  988. LibName("OPENEXR", "-Wl,--exclude-libs,libIex.a")
  989. LibName("OPENEXR", "-Wl,--exclude-libs,libIexMath.a")
  990. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImf.a")
  991. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmImfUtil.a")
  992. LibName("OPENEXR", "-Wl,--exclude-libs,libIlmThread.a")
  993. LibName("OPENEXR", "-Wl,--exclude-libs,libImath.a")
  994. if not PkgSkip("VORBIS"):
  995. LibName("VORBIS", "-Wl,--exclude-libs,libogg.a")
  996. LibName("VORBIS", "-Wl,--exclude-libs,libvorbis.a")
  997. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisenc.a")
  998. LibName("VORBIS", "-Wl,--exclude-libs,libvorbisfile.a")
  999. if not PkgSkip("OPUS"):
  1000. LibName("OPUS", "-Wl,--exclude-libs,libogg.a")
  1001. LibName("OPUS", "-Wl,--exclude-libs,libopus.a")
  1002. LibName("OPUS", "-Wl,--exclude-libs,libopusfile.a")
  1003. if not PkgSkip("VRPN"):
  1004. LibName("VRPN", "-Wl,--exclude-libs,libvrpn.a")
  1005. LibName("VRPN", "-Wl,--exclude-libs,libquat.a")
  1006. if not PkgSkip("ARTOOLKIT"):
  1007. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libAR.a")
  1008. LibName("ARTOOLKIT", "-Wl,--exclude-libs,libARMulti.a")
  1009. if not PkgSkip("HARFBUZZ"):
  1010. LibName("HARFBUZZ", "-Wl,--exclude-libs,libharfbuzz.a")
  1011. if PkgSkip("FFMPEG") or GetTarget() == "darwin":
  1012. cv_lib = ChooseLib(("opencv_core", "cv"), "OPENCV")
  1013. if cv_lib == "opencv_core":
  1014. OPENCV_VER_23 = True
  1015. SmartPkgEnable("OPENCV", "opencv", ("opencv_core", "opencv_highgui"), ("opencv2/core/core.hpp"))
  1016. else:
  1017. SmartPkgEnable("OPENCV", "opencv", ("cv", "highgui", "cvaux", "ml", "cxcore"),
  1018. ("opencv", "opencv/cv.h", "opencv/cxcore.h", "opencv/highgui.h"))
  1019. else:
  1020. PkgDisable("OPENCV")
  1021. if not PkgSkip("OPENAL"):
  1022. if GetTarget() == "darwin":
  1023. LibName("OPENAL", "-framework AudioUnit")
  1024. LibName("OPENAL", "-framework AudioToolbox")
  1025. LibName("OPENAL", "-framework CoreAudio")
  1026. else:
  1027. LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
  1028. if not PkgSkip("ASSIMP") and \
  1029. os.path.isfile(GetThirdpartyDir() + "assimp/lib/libassimp.a"):
  1030. # Also pick up IrrXML, which is needed when linking statically.
  1031. irrxml = GetThirdpartyDir() + "assimp/lib/libIrrXML.a"
  1032. if os.path.isfile(irrxml):
  1033. LibName("ASSIMP", irrxml)
  1034. if GetTarget() != "darwin":
  1035. LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
  1036. LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
  1037. rocket_libs = ("RocketCore", "RocketControls")
  1038. if (GetOptimize() <= 3):
  1039. rocket_libs += ("RocketDebugger",)
  1040. rocket_libs += ("boost_python",)
  1041. SmartPkgEnable("ROCKET", "", rocket_libs, "Rocket/Core.h")
  1042. if not PkgSkip("PYTHON"):
  1043. python_lib = SDK["PYTHONVERSION"]
  1044. SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
  1045. if GetTarget() == "linux":
  1046. LibName("PYTHON", "-lutil")
  1047. LibName("PYTHON", "-lrt")
  1048. SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
  1049. SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
  1050. SmartPkgEnable("GTK2", "gtk+-2.0")
  1051. if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
  1052. LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
  1053. LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
  1054. if (RTDIST):
  1055. SmartPkgEnable("WX", tool = "wx-config")
  1056. SmartPkgEnable("FLTK", "", ("fltk"), ("FL/Fl.H"), tool = "fltk-config")
  1057. if GetTarget() != 'darwin':
  1058. # CgGL is covered by the Cg framework, and we don't need X11 components on OSX
  1059. if not PkgSkip("NVIDIACG") and not RUNTIME:
  1060. SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
  1061. if not RUNTIME and GetTarget() != "android":
  1062. SmartPkgEnable("X11", "x11", "X11", ("X11", "X11/Xlib.h", "X11/XKBlib.h"))
  1063. if GetHost() != "darwin":
  1064. # Workaround for an issue where pkg-config does not include this path
  1065. if GetTargetArch() in ("x86_64", "amd64"):
  1066. if (os.path.isdir("/usr/lib64/glib-2.0/include")):
  1067. IncDirectory("GTK2", "/usr/lib64/glib-2.0/include")
  1068. if (os.path.isdir("/usr/lib64/gtk-2.0/include")):
  1069. IncDirectory("GTK2", "/usr/lib64/gtk-2.0/include")
  1070. if not PkgSkip("X11"):
  1071. if (os.path.isdir("/usr/X11R6/lib64")):
  1072. LibDirectory("ALWAYS", "/usr/X11R6/lib64")
  1073. else:
  1074. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1075. elif not PkgSkip("X11"):
  1076. LibDirectory("ALWAYS", "/usr/X11R6/lib")
  1077. if RUNTIME:
  1078. # For the runtime, these packages are required
  1079. for pkg in ["OPENSSL", "ZLIB"]:
  1080. skips = []
  1081. if (pkg in PkgListGet() and PkgSkip(pkg)==1):
  1082. skips.append(pkg)
  1083. if skips:
  1084. exit("Runtime must be compiled with OpenSSL and ZLib support (missing %s)" % (', '.join(skips)))
  1085. for pkg in MAYAVERSIONS:
  1086. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1087. if (GetHost() == "darwin"):
  1088. # Sheesh, Autodesk really can't make up their mind
  1089. # regarding the location of the Maya devkit on macOS.
  1090. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/lib")):
  1091. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/lib")
  1092. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/MacOS")):
  1093. LibDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/MacOS")
  1094. if (os.path.isdir(SDK[pkg] + "/lib")):
  1095. LibDirectory(pkg, SDK[pkg] + "/lib")
  1096. if (os.path.isdir(SDK[pkg] + "/Maya.app/Contents/include/maya")):
  1097. IncDirectory(pkg, SDK[pkg] + "/Maya.app/Contents/include")
  1098. if (os.path.isdir(SDK[pkg] + "/devkit/include/maya")):
  1099. IncDirectory(pkg, SDK[pkg] + "/devkit/include")
  1100. if (os.path.isdir(SDK[pkg] + "/include/maya")):
  1101. IncDirectory(pkg, SDK[pkg] + "/include")
  1102. else:
  1103. LibDirectory(pkg, SDK[pkg] + "/lib")
  1104. IncDirectory(pkg, SDK[pkg] + "/include")
  1105. DefSymbol(pkg, "MAYAVERSION", pkg)
  1106. if GetTarget() == 'darwin':
  1107. LibName("ALWAYS", "-framework AppKit")
  1108. if SDK["OSXTARGET"] < (26, 0):
  1109. LibName("AGL", "-framework AGL")
  1110. LibName("CARBON", "-framework Carbon")
  1111. LibName("COCOA", "-framework Cocoa")
  1112. # Fix for a bug in OSX Leopard:
  1113. LibName("GL", "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1114. if GetTarget() == 'android':
  1115. LibName("ALWAYS", '-llog')
  1116. LibName("ANDROID", '-landroid')
  1117. LibName("JNIGRAPHICS", '-ljnigraphics')
  1118. for pkg in MAYAVERSIONS:
  1119. if (PkgSkip(pkg)==0 and (pkg in SDK)):
  1120. if GetTarget() == 'darwin':
  1121. LibName(pkg, "-Wl,-rpath,/Applications/Autodesk/" + pkg.lower() + "/Maya.app/Contents/MacOS")
  1122. else:
  1123. LibName(pkg, "-Wl,-rpath," + SDK[pkg] + "/lib")
  1124. LibName(pkg, "-lOpenMaya")
  1125. LibName(pkg, "-lOpenMayaAnim")
  1126. LibName(pkg, "-lOpenMayaUI")
  1127. LibName(pkg, "-lAnimSlice")
  1128. LibName(pkg, "-lDeformSlice")
  1129. LibName(pkg, "-lModifiers")
  1130. LibName(pkg, "-lDynSlice")
  1131. LibName(pkg, "-lKinSlice")
  1132. LibName(pkg, "-lModelSlice")
  1133. LibName(pkg, "-lNurbsSlice")
  1134. LibName(pkg, "-lPolySlice")
  1135. LibName(pkg, "-lProjectSlice")
  1136. LibName(pkg, "-lImage")
  1137. LibName(pkg, "-lShared")
  1138. LibName(pkg, "-lTranslators")
  1139. LibName(pkg, "-lDataModel")
  1140. LibName(pkg, "-lRenderModel")
  1141. LibName(pkg, "-lNurbsEngine")
  1142. LibName(pkg, "-lDependEngine")
  1143. LibName(pkg, "-lCommandEngine")
  1144. LibName(pkg, "-lFoundation")
  1145. if pkg not in ("MAYA2020", "MAYA2022"):
  1146. LibName(pkg, "-lIMFbase")
  1147. if GetTarget() != 'darwin':
  1148. LibName(pkg, "-lOpenMayalib")
  1149. else:
  1150. LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
  1151. if (PkgSkip("PHYSX")==0):
  1152. IncDirectory("PHYSX", SDK["PHYSX"] + "/Physics/include")
  1153. IncDirectory("PHYSX", SDK["PHYSX"] + "/PhysXLoader/include")
  1154. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxCharacter/include")
  1155. IncDirectory("PHYSX", SDK["PHYSX"] + "/NxExtensions/include")
  1156. IncDirectory("PHYSX", SDK["PHYSX"] + "/Foundation/include")
  1157. IncDirectory("PHYSX", SDK["PHYSX"] + "/Cooking/include")
  1158. LibDirectory("PHYSX", SDK["PHYSXLIBS"])
  1159. if (GetHost() == "darwin"):
  1160. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCooking.a")
  1161. LibName("PHYSX", SDK["PHYSXLIBS"] + "/osxstatic/PhysXCore.a")
  1162. else:
  1163. LibName("PHYSX", "-lPhysXLoader")
  1164. LibName("PHYSX", "-lNxCharacter")
  1165. DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
  1166. if GetLinkAllStatic():
  1167. DefSymbol("ALWAYS", "LINK_ALL_STATIC")
  1168. if GetTarget() == 'android':
  1169. DefSymbol("ALWAYS", "ANDROID")
  1170. if not PkgSkip("EIGEN"):
  1171. if GetOptimize() >= 3:
  1172. if COMPILER == "MSVC":
  1173. # Squeeze out a bit more performance on MSVC builds...
  1174. # Only do this if EIGEN_NO_DEBUG is also set, otherwise it
  1175. # will turn them into runtime assertions.
  1176. DefSymbol("ALWAYS", "EIGEN_NO_STATIC_ASSERT")
  1177. if not PkgSkip("EGL"):
  1178. DefSymbol('EGL', 'HAVE_EGL', '')
  1179. if PkgSkip("X11"):
  1180. DefSymbol('EGL', 'EGL_NO_X11', '')
  1181. if not PkgSkip("X11"):
  1182. DefSymbol('X11', 'USE_X11', '')
  1183. ########################################################################
  1184. ##
  1185. ## Give a Status Report on Command-Line Options
  1186. ##
  1187. ########################################################################
  1188. def printStatus(header,warnings):
  1189. if GetVerbose():
  1190. print("")
  1191. print("-------------------------------------------------------------------")
  1192. print(header)
  1193. tkeep = ""
  1194. tomit = ""
  1195. for x in PkgListGet():
  1196. if PkgSkip(x):
  1197. tomit = tomit + x + " "
  1198. else:
  1199. tkeep = tkeep + x + " "
  1200. if RTDIST:
  1201. print("Makepanda: Runtime distribution build")
  1202. elif RUNTIME:
  1203. print("Makepanda: Runtime build")
  1204. else:
  1205. print("Makepanda: Regular build")
  1206. print("Makepanda: Compiler: %s" % (COMPILER))
  1207. print("Makepanda: Optimize: %d" % (GetOptimize()))
  1208. print("Makepanda: Keep Pkg: %s" % (tkeep))
  1209. print("Makepanda: Omit Pkg: %s" % (tomit))
  1210. if GENMAN:
  1211. print("Makepanda: Generate API reference manual")
  1212. else:
  1213. print("Makepanda: Don't generate API reference manual")
  1214. if GetHost() == "windows" and not RTDIST:
  1215. if INSTALLER:
  1216. print("Makepanda: Build installer, using %s" % (COMPRESSOR))
  1217. else:
  1218. print("Makepanda: Don't build installer")
  1219. print("Makepanda: Version ID: %s" % (VERSION))
  1220. for x in warnings:
  1221. print("Makepanda: %s" % (x))
  1222. print("-------------------------------------------------------------------")
  1223. print("")
  1224. sys.stdout.flush()
  1225. ########################################################################
  1226. ##
  1227. ## BracketNameWithQuotes
  1228. ##
  1229. ########################################################################
  1230. def BracketNameWithQuotes(name):
  1231. # Workaround for OSX bug - compiler doesn't like those flags quoted.
  1232. if (name.startswith("-framework")): return name
  1233. if (name.startswith("-dylib_file")): return name
  1234. # Don't add quotes when it's not necessary.
  1235. if " " not in name: return name
  1236. # Account for quoted name (leave as is) but quote everything else (e.g., to protect spaces within paths from improper parsing)
  1237. if (name.startswith('"') and name.endswith('"')): return name
  1238. else: return '"' + name + '"'
  1239. ########################################################################
  1240. ##
  1241. ## CompileCxx
  1242. ##
  1243. ########################################################################
  1244. def CompileCxx(obj,src,opts):
  1245. ipath = GetListOption(opts, "DIR:")
  1246. optlevel = GetOptimizeOption(opts)
  1247. if (COMPILER=="MSVC"):
  1248. if not BOOUSEINTELCOMPILER:
  1249. cmd = "cl "
  1250. if GetTargetArch() == 'x64':
  1251. cmd += "/favor:blend "
  1252. cmd += "/wd4996 /wd4275 /wd4273 "
  1253. # We still target Windows XP.
  1254. cmd += "/DWINVER=0x501 "
  1255. # Work around a WinXP/2003 bug when using VS 2015+.
  1256. if SDK.get("VISUALSTUDIO_VERSION") >= (14,0):
  1257. cmd += "/Zc:threadSafeInit- "
  1258. cmd += "/Fo" + obj + " /nologo /c"
  1259. if GetTargetArch() == 'x86':
  1260. # x86 (32 bit) MSVC 2015+ defaults to /arch:SSE2
  1261. if not PkgSkip("SSE2") or 'SSE2' in opts: # x86 with SSE2
  1262. cmd += " /arch:SSE2" # let's still be explicit and pass in /arch:SSE2
  1263. else: # x86 without SSE2
  1264. cmd += " /arch:IA32"
  1265. for x in ipath: cmd += " /I" + x
  1266. for (opt,dir) in INCDIRECTORIES:
  1267. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1268. for (opt,var,val) in DEFSYMBOLS:
  1269. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1270. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1271. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1272. if (optlevel==2): cmd += " /MDd /Zi"
  1273. if (optlevel==3): cmd += " /MD /Zi /GS- /O2 /Ob2 /Oi /Ot /fp:fast"
  1274. if (optlevel==4):
  1275. cmd += " /MD /Zi /GS- /Ox /Ob2 /Oi /Ot /fp:fast /DFORCE_INLINING /DNDEBUG /GL"
  1276. cmd += " /Oy /Zp16" # jean-claude add /Zp16 insures correct static alignment for SSEx
  1277. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1278. building = GetValueOption(opts, "BUILDING:")
  1279. if (building):
  1280. cmd += " /DBUILDING_" + building
  1281. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1282. cmd += " /bigobj"
  1283. cmd += " /Zm300 /DWIN32_VC /DWIN32"
  1284. if 'EXCEPTIONS' in opts:
  1285. cmd += " /EHsc"
  1286. else:
  1287. cmd += " /D_HAS_EXCEPTIONS=0"
  1288. if 'RTTI' not in opts:
  1289. cmd += " /GR-"
  1290. if GetTargetArch() == 'x64':
  1291. cmd += " /DWIN64_VC /DWIN64"
  1292. if WINDOWS_SDK.startswith('7.') and MSVC_VERSION > (10,):
  1293. # To preserve Windows XP compatibility.
  1294. cmd += " /D_USING_V110_SDK71_"
  1295. cmd += " /W3 " + BracketNameWithQuotes(src)
  1296. oscmd(cmd)
  1297. else:
  1298. cmd = "icl "
  1299. if GetTargetArch() == 'x64':
  1300. cmd += "/favor:blend "
  1301. cmd += "/wd4996 /wd4275 /wd4267 /wd4101 /wd4273 "
  1302. cmd += "/DWINVER=0x501 "
  1303. cmd += "/Fo" + obj + " /c"
  1304. for x in ipath: cmd += " /I" + x
  1305. for (opt,dir) in INCDIRECTORIES:
  1306. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  1307. for (opt,var,val) in DEFSYMBOLS:
  1308. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  1309. if (opts.count('MSFORSCOPE')): cmd += ' /Zc:forScope-'
  1310. if (optlevel==1): cmd += " /MDd /Zi /RTCs /GS"
  1311. if (optlevel==2): cmd += " /MDd /Zi /arch:SSE3"
  1312. # core changes from jean-claude (dec 2011)
  1313. # ----------------------------------------
  1314. # performance will be seeked at level 3 & 4
  1315. # -----------------------------------------
  1316. if (optlevel==3):
  1317. cmd += " /MD /Zi /O2 /Oi /Ot /arch:SSE3"
  1318. cmd += " /Ob0"
  1319. cmd += " /Qipo-" # beware of IPO !!!
  1320. ## Lesson learned: Don't use /GL flag -> end result is MESSY
  1321. ## ----------------------------------------------------------------
  1322. if (optlevel==4):
  1323. cmd += " /MD /Zi /O3 /Oi /Ot /Ob0 /Yc /DNDEBUG" # /Ob0 a ete rajoute en cours de route a 47%
  1324. cmd += " /Qipo" # optimization multi file
  1325. # for 3 & 4 optimization levels
  1326. # -----------------------------
  1327. if (optlevel>=3):
  1328. cmd += " /fp:fast=2"
  1329. cmd += " /Qftz"
  1330. cmd += " /Qfp-speculation:fast"
  1331. cmd += " /Qopt-matmul" # needs /O2 or /O3
  1332. cmd += " /Qprec-div-"
  1333. cmd += " /Qsimd"
  1334. cmd += " /QxHost" # compile for target host; Compiling for distribs should probably strictly enforce /arch:..
  1335. cmd += " /Quse-intel-optimized-headers" # use intel optimized headers
  1336. cmd += " /Qparallel" # enable parallelization
  1337. cmd += " /Qvc10" # for Microsoft Visual C++ 2010
  1338. ## PCH files coexistence: the /Qpchi option causes the Intel C++ Compiler to name its
  1339. ## PCH files with a .pchi filename suffix and reduce build time.
  1340. ## The /Qpchi option is on by default but interferes with Microsoft libs; so use /Qpchi- to turn it off.
  1341. ## I need to have a deeper look at this since the compile time is quite influenced by this setting !!!
  1342. cmd += " /Qpchi-" # keep it this way!
  1343. ## Inlining seems to be an issue here ! (the linker doesn't find necessary info later on)
  1344. ## ------------------------------------
  1345. ## so don't use cmd += " /DFORCE_INLINING" (need to check why with Panda developpers!)
  1346. ## Inline expansion /Ob1 : Allow functions marked inline to be inlined.
  1347. ## Inline any /Ob2 : Inline functions deemed appropriate by compiler.
  1348. ## Ctor displacement /vd0 : Disable constructor displacement.
  1349. ## Choose this option only if no class constructors or destructors call virtual functions.
  1350. ## Use /vd1 (default) to enable. Alternate: #pragma vtordisp
  1351. ## Best case ptrs /vmb : Use best case "pointer to class member" representation.
  1352. ## Use this option if you always define a class before you declare a pointer to a member of the class.
  1353. ## The compiler will issue an error if it encounters a pointer declaration before the class is defined.
  1354. ## Alternate: #pragma pointers_to_members
  1355. cmd += " /Fd" + os.path.splitext(obj)[0] + ".pdb"
  1356. building = GetValueOption(opts, "BUILDING:")
  1357. if (building): cmd += " /DBUILDING_" + building
  1358. if ("BIGOBJ" in opts) or GetTargetArch() == 'x64':
  1359. cmd += " /bigobj"
  1360. # level of warnings and optimization reports
  1361. if GetVerbose():
  1362. cmd += " /W3 " # or /W4 or /Wall
  1363. cmd += " /Qopt-report:2 /Qopt-report-phase:hlo /Qopt-report-phase:hpo" # some optimization reports
  1364. else:
  1365. cmd += " /W1 "
  1366. cmd += " /EHa /Zm300 /DWIN32_VC /DWIN32"
  1367. if GetTargetArch() == 'x64':
  1368. cmd += " /DWIN64_VC /DWIN64"
  1369. cmd += " " + BracketNameWithQuotes(src)
  1370. oscmd(cmd)
  1371. if (COMPILER=="GCC"):
  1372. if (src.endswith(".c")): cmd = GetCC() +' -fPIC -c -o ' + obj
  1373. else: cmd = GetCXX()+' -std=gnu++11 -ftemplate-depth-70 -fPIC -c -o ' + obj
  1374. for (opt, dir) in INCDIRECTORIES:
  1375. if (opt=="ALWAYS") or (opt in opts): cmd += ' -I' + BracketNameWithQuotes(dir)
  1376. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1377. if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
  1378. for (opt,var,val) in DEFSYMBOLS:
  1379. if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
  1380. for x in ipath: cmd += ' -I' + x
  1381. if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
  1382. cmd += ' -fvisibility=hidden'
  1383. # Mac-specific flags.
  1384. if GetTarget() == "darwin":
  1385. cmd += " -Wno-deprecated-declarations"
  1386. if OSXTARGET is not None:
  1387. cmd += " -isysroot " + SDK["MACOSX"]
  1388. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1389. elif platform.mac_ver()[0].startswith('11.'):
  1390. cmd += " -mmacosx-version-min=11.0"
  1391. for arch in OSX_ARCHS:
  1392. if 'NOARCH:' + arch.upper() not in opts:
  1393. cmd += " -arch %s" % arch
  1394. if "SYSROOT" in SDK:
  1395. if GetTarget() != "android":
  1396. cmd += ' --sysroot=%s' % (SDK["SYSROOT"])
  1397. else:
  1398. ndk_dir = SDK["ANDROID_NDK"].replace('\\', '/')
  1399. cmd += ' -isystem %s/sysroot/usr/include' % (ndk_dir)
  1400. cmd += ' -isystem %s/sysroot/usr/include/%s' % (ndk_dir, SDK["ANDROID_TRIPLE"])
  1401. cmd += ' -no-canonical-prefixes'
  1402. # Android-specific flags.
  1403. arch = GetTargetArch()
  1404. if GetTarget() == "android":
  1405. # Most of the specific optimization flags here were
  1406. # just copied from the default Android Makefiles.
  1407. if "ANDROID_API" in SDK:
  1408. cmd += ' -D__ANDROID_API__=' + str(SDK["ANDROID_API"])
  1409. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1410. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1411. cmd += ' -ffunction-sections -funwind-tables'
  1412. if arch == 'armv7a':
  1413. cmd += ' -target armv7-none-linux-androideabi'
  1414. cmd += ' -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16'
  1415. cmd += ' -fno-integrated-as'
  1416. elif arch == 'arm':
  1417. cmd += ' -target armv5te-none-linux-androideabi'
  1418. cmd += ' -march=armv5te -mtune=xscale -msoft-float'
  1419. cmd += ' -fno-integrated-as'
  1420. elif arch == 'aarch64':
  1421. cmd += ' -target aarch64-none-linux-android'
  1422. elif arch == 'mips':
  1423. cmd += ' -target mipsel-none-linux-android'
  1424. cmd += ' -mips32'
  1425. elif arch == 'mips64':
  1426. cmd += ' -target mips64el-none-linux-android'
  1427. cmd += ' -fintegrated-as'
  1428. elif arch == 'x86':
  1429. cmd += ' -target i686-none-linux-android'
  1430. cmd += ' -march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32'
  1431. cmd += ' -mstackrealign'
  1432. elif arch == 'x86_64':
  1433. cmd += ' -target x86_64-none-linux-android'
  1434. cmd += ' -march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel'
  1435. cmd += " -Wa,--noexecstack"
  1436. # Do we want thumb or arm instructions?
  1437. if arch.startswith('arm'):
  1438. if optlevel >= 3:
  1439. cmd += ' -mthumb'
  1440. else:
  1441. cmd += ' -marm'
  1442. # Enable SIMD instructions if requested
  1443. if arch.startswith('arm') and PkgSkip("NEON") == 0:
  1444. cmd += ' -mfpu=neon'
  1445. else:
  1446. cmd += " -pthread"
  1447. if not src.endswith(".c"):
  1448. # We don't use exceptions for most modules.
  1449. if 'EXCEPTIONS' in opts:
  1450. cmd += " -fexceptions"
  1451. else:
  1452. cmd += " -fno-exceptions"
  1453. if src.endswith(".mm"):
  1454. # Work around Apple compiler bug.
  1455. cmd += " -U__EXCEPTIONS"
  1456. target = GetTarget()
  1457. if 'RTTI' not in opts and target != "darwin":
  1458. # We always disable RTTI on Android for memory usage reasons.
  1459. if optlevel >= 4 or target == "android":
  1460. cmd += " -fno-rtti"
  1461. if ('SSE2' in opts or not PkgSkip("SSE2")) and arch.find('86') > 0:
  1462. cmd += " -msse2"
  1463. # Needed by both Python, Panda, Eigen, all of which break aliasing rules.
  1464. cmd += " -fno-strict-aliasing"
  1465. # Certain clang versions crash when passing these math flags while
  1466. # compiling Objective-C++ code
  1467. if not src.endswith(".m") and not src.endswith(".mm"):
  1468. if optlevel >= 3:
  1469. cmd += " -ffast-math -fno-stack-protector"
  1470. if optlevel == 3:
  1471. # Fast math is nice, but we'd like to see NaN in dev builds.
  1472. cmd += " -fno-finite-math-only"
  1473. # Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
  1474. cmd += " -fno-unsafe-math-optimizations"
  1475. if (optlevel==1): cmd += " -ggdb -D_DEBUG"
  1476. if (optlevel==2): cmd += " -O1 -D_DEBUG"
  1477. if (optlevel==3): cmd += " -O2"
  1478. if (optlevel==4): cmd += " -O3 -DNDEBUG"
  1479. # Enable more warnings.
  1480. cmd += " -Wall -Wno-unused-function"
  1481. if not src.endswith(".c"):
  1482. cmd += " -Wno-reorder"
  1483. # Ignore unused variables in NDEBUG builds, often used in asserts.
  1484. if optlevel == 4:
  1485. cmd += " -Wno-unused-variable"
  1486. if src.endswith(".c"):
  1487. cmd += ' ' + CFLAGS
  1488. else:
  1489. cmd += ' ' + CXXFLAGS
  1490. cmd = cmd.rstrip()
  1491. building = GetValueOption(opts, "BUILDING:")
  1492. if (building): cmd += " -DBUILDING_" + building
  1493. cmd += ' ' + BracketNameWithQuotes(src)
  1494. oscmd(cmd)
  1495. ########################################################################
  1496. ##
  1497. ## CompileBison
  1498. ##
  1499. ########################################################################
  1500. def CompileBison(wobj, wsrc, opts):
  1501. ifile = os.path.basename(wsrc)
  1502. wdsth = GetOutputDir()+"/include/" + ifile[:-4] + ".h"
  1503. wdstc = GetOutputDir()+"/tmp/" + ifile + ".cxx"
  1504. pre = GetValueOption(opts, "BISONPREFIX_")
  1505. bison = GetBison()
  1506. if bison is None:
  1507. # We don't have bison. See if there is a prebuilt file.
  1508. base, ext = os.path.splitext(wsrc)
  1509. if os.path.isfile(base + '.h.prebuilt') and \
  1510. os.path.isfile(base + '.cxx.prebuilt'):
  1511. CopyFile(wdstc, base + '.cxx.prebuilt')
  1512. CopyFile(wdsth, base + '.h.prebuilt')
  1513. else:
  1514. exit('Could not find bison!')
  1515. else:
  1516. oscmd(bison + ' -y -d -o'+GetOutputDir()+'/tmp/'+ifile+'.c -p '+pre+' '+wsrc)
  1517. CopyFile(wdstc, GetOutputDir()+"/tmp/"+ifile+".c")
  1518. CopyFile(wdsth, GetOutputDir()+"/tmp/"+ifile+".h")
  1519. # Finally, compile the generated source file.
  1520. CompileCxx(wobj, wdstc, opts + ["FLEX"])
  1521. ########################################################################
  1522. ##
  1523. ## CompileFlex
  1524. ##
  1525. ########################################################################
  1526. def CompileFlex(wobj,wsrc,opts):
  1527. ifile = os.path.basename(wsrc)
  1528. wdst = GetOutputDir()+"/tmp/"+ifile+".cxx"
  1529. pre = GetValueOption(opts, "BISONPREFIX_")
  1530. dashi = opts.count("FLEXDASHI")
  1531. flex = GetFlex()
  1532. want_version = GetValueOption(opts, "FLEXVERSION:")
  1533. if flex and want_version:
  1534. # Is flex at the required version for this file?
  1535. want_version = tuple(map(int, want_version.split('.')))
  1536. have_version = GetFlexVersion()
  1537. if want_version > have_version:
  1538. Warn("Skipping flex %s for file %s, need at least %s" % (
  1539. '.'.join(map(str, have_version)),
  1540. ifile,
  1541. '.'.join(map(str, want_version)),
  1542. ))
  1543. flex = None
  1544. if flex is None:
  1545. # We don't have flex. See if there is a prebuilt file.
  1546. base, ext = os.path.splitext(wsrc)
  1547. if os.path.isfile(base + '.cxx.prebuilt'):
  1548. CopyFile(wdst, base + '.cxx.prebuilt')
  1549. else:
  1550. exit('Could not find flex!')
  1551. else:
  1552. if (dashi):
  1553. oscmd(flex + " -i -P" + pre + " -o"+wdst+" "+wsrc)
  1554. else:
  1555. oscmd(flex + " -P" + pre + " -o"+wdst+" "+wsrc)
  1556. # Finally, compile the generated source file.
  1557. CompileCxx(wobj, wdst, opts + ["FLEX"])
  1558. ########################################################################
  1559. ##
  1560. ## CompileIgate
  1561. ##
  1562. ########################################################################
  1563. def CompileIgate(woutd,wsrc,opts):
  1564. outbase = os.path.basename(woutd)[:-3]
  1565. woutc = GetOutputDir()+"/tmp/"+outbase+"_igate.cxx"
  1566. srcdir = GetValueOption(opts, "SRCDIR:")
  1567. module = GetValueOption(opts, "IMOD:")
  1568. library = GetValueOption(opts, "ILIB:")
  1569. ipath = GetListOption(opts, "DIR:")
  1570. if (PkgSkip("PYTHON")):
  1571. WriteFile(woutc, "")
  1572. WriteFile(woutd, "")
  1573. ConditionalWriteFile(woutd, "")
  1574. return
  1575. if not CrossCompiling():
  1576. # If we're compiling for this platform, we can use the one we've built.
  1577. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate')
  1578. else:
  1579. # Assume that interrogate is on the PATH somewhere.
  1580. cmd = 'interrogate'
  1581. if GetVerbose():
  1582. cmd += ' -v'
  1583. cmd += ' -srcdir %s -I%s' % (srcdir, srcdir)
  1584. cmd += ' -DCPPPARSER -D__STDC__=1 -D__cplusplus=201103L'
  1585. if (COMPILER=="MSVC"):
  1586. cmd += ' -DWIN32_VC -DWIN32 -D_WIN32'
  1587. if GetTargetArch() == 'x64':
  1588. cmd += ' -DWIN64_VC -DWIN64 -D_WIN64 -D_M_X64 -D_M_AMD64'
  1589. else:
  1590. cmd += ' -D_M_IX86'
  1591. # NOTE: this 1600 value is the version number for VC2010.
  1592. cmd += ' -D_MSC_VER=1600 -D"__declspec(param)=" -D__cdecl -D_near -D_far -D__near -D__far -D__stdcall'
  1593. if (COMPILER=="GCC"):
  1594. cmd += ' -D__attribute__\\(x\\)='
  1595. target_arch = GetTargetArch()
  1596. if target_arch in ("x86_64", "amd64"):
  1597. cmd += ' -D_LP64'
  1598. elif target_arch in ('aarch64', 'arm64'):
  1599. cmd += ' -D_LP64 -D__LP64__ -D__aarch64__'
  1600. else:
  1601. cmd += ' -D__i386__'
  1602. target = GetTarget()
  1603. if target == 'darwin':
  1604. cmd += ' -D__APPLE__'
  1605. elif target == 'android':
  1606. cmd += ' -D__ANDROID__'
  1607. optlevel = GetOptimizeOption(opts)
  1608. if (optlevel==1): cmd += ' -D_DEBUG'
  1609. if (optlevel==2): cmd += ' -D_DEBUG'
  1610. if (optlevel==3): pass
  1611. if (optlevel==4): cmd += ' -DNDEBUG'
  1612. cmd += ' -oc ' + woutc + ' -od ' + woutd
  1613. cmd += ' -fnames -string -refcount -assert -python-native'
  1614. cmd += ' -S' + GetOutputDir() + '/include/parser-inc'
  1615. # Add -I, -S and -D flags
  1616. for x in ipath:
  1617. cmd += ' -I' + BracketNameWithQuotes(x)
  1618. for (opt,dir) in INCDIRECTORIES:
  1619. if (opt=="ALWAYS") or (opt in opts):
  1620. cmd += ' -S' + BracketNameWithQuotes(dir)
  1621. for (opt,var,val) in DEFSYMBOLS:
  1622. if (opt=="ALWAYS") or (opt in opts):
  1623. cmd += ' -D' + var + '=' + val
  1624. #building = GetValueOption(opts, "BUILDING:")
  1625. #if (building): cmd += " -DBUILDING_"+building
  1626. cmd += ' -module ' + module + ' -library ' + library
  1627. for x in wsrc:
  1628. if (x.startswith("/")):
  1629. cmd += ' ' + BracketNameWithQuotes(x)
  1630. else:
  1631. cmd += ' ' + BracketNameWithQuotes(os.path.basename(x))
  1632. oscmd(cmd)
  1633. ########################################################################
  1634. ##
  1635. ## CompileImod
  1636. ##
  1637. ########################################################################
  1638. def CompileImod(wobj, wsrc, opts):
  1639. module = GetValueOption(opts, "IMOD:")
  1640. library = GetValueOption(opts, "ILIB:")
  1641. if (COMPILER=="MSVC"):
  1642. woutc = wobj[:-4]+".cxx"
  1643. if (COMPILER=="GCC"):
  1644. woutc = wobj[:-2]+".cxx"
  1645. if (PkgSkip("PYTHON")):
  1646. WriteFile(woutc, "")
  1647. CompileCxx(wobj, woutc, opts)
  1648. return
  1649. if not CrossCompiling():
  1650. # If we're compiling for this platform, we can use the one we've built.
  1651. cmd = os.path.join(GetOutputDir(), 'bin', 'interrogate_module')
  1652. else:
  1653. # Assume that interrogate_module is on the PATH somewhere.
  1654. cmd = 'interrogate_module'
  1655. cmd += ' -oc ' + woutc + ' -module ' + module + ' -library ' + library + ' -python-native'
  1656. importmod = GetValueOption(opts, "IMPORT:")
  1657. if importmod:
  1658. cmd += ' -import ' + importmod
  1659. for x in wsrc: cmd += ' ' + BracketNameWithQuotes(x)
  1660. oscmd(cmd)
  1661. CompileCxx(wobj,woutc,opts)
  1662. return
  1663. ########################################################################
  1664. ##
  1665. ## CompileLib
  1666. ##
  1667. ########################################################################
  1668. def CompileLib(lib, obj, opts):
  1669. if (COMPILER=="MSVC"):
  1670. if not BOOUSEINTELCOMPILER:
  1671. #Use MSVC Linker
  1672. cmd = 'link /lib /nologo'
  1673. if GetOptimizeOption(opts) == 4:
  1674. cmd += " /LTCG"
  1675. if HasTargetArch():
  1676. cmd += " /MACHINE:" + GetTargetArch().upper()
  1677. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1678. for x in obj:
  1679. if not x.endswith('.lib'):
  1680. cmd += ' ' + BracketNameWithQuotes(x)
  1681. oscmd(cmd)
  1682. else:
  1683. # Choose Intel linker; from Jean-Claude
  1684. cmd = 'xilink /verbose:lib /lib '
  1685. if HasTargetArch():
  1686. cmd += " /MACHINE:" + GetTargetArch().upper()
  1687. cmd += ' /OUT:' + BracketNameWithQuotes(lib)
  1688. for x in obj: cmd += ' ' + BracketNameWithQuotes(x)
  1689. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1690. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1691. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1692. oscmd(cmd)
  1693. if (COMPILER=="GCC"):
  1694. if GetTarget() == 'darwin':
  1695. cmd = 'libtool -static -o ' + BracketNameWithQuotes(lib)
  1696. else:
  1697. cmd = GetAR() + ' cru ' + BracketNameWithQuotes(lib)
  1698. for x in obj:
  1699. if GetLinkAllStatic() and x.endswith('.a'):
  1700. continue
  1701. cmd += ' ' + BracketNameWithQuotes(x)
  1702. oscmd(cmd)
  1703. oscmd(GetRanlib() + ' ' + BracketNameWithQuotes(lib))
  1704. ########################################################################
  1705. ##
  1706. ## CompileLink
  1707. ##
  1708. ########################################################################
  1709. def CompileLink(dll, obj, opts):
  1710. if (COMPILER=="MSVC"):
  1711. if not BOOUSEINTELCOMPILER:
  1712. cmd = "link /nologo "
  1713. if HasTargetArch():
  1714. cmd += " /MACHINE:" + GetTargetArch().upper()
  1715. if ("MFC" not in opts):
  1716. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1717. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1718. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls /nod:atlsd"
  1719. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1720. optlevel = GetOptimizeOption(opts)
  1721. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1722. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1723. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1724. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1725. if ("MFC" in opts):
  1726. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1727. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1728. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1729. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1730. if not PkgSkip("PYTHON"):
  1731. # If we're building without Python, don't pick it up implicitly.
  1732. if "PYTHON" not in opts:
  1733. pythonv = SDK["PYTHONVERSION"].replace('.', '')
  1734. if optlevel <= 2:
  1735. cmd += ' /NOD:{}_d.lib'.format(pythonv)
  1736. else:
  1737. cmd += ' /NOD:{}.lib'.format(pythonv)
  1738. # Yes, we know we are importing "locally defined symbols".
  1739. for x in obj:
  1740. if x.endswith('libp3pystub.lib'):
  1741. cmd += ' /ignore:4049,4217'
  1742. break
  1743. # Set the subsystem. Specify that we want to target Windows XP.
  1744. subsystem = GetValueOption(opts, "SUBSYSTEM:") or "CONSOLE"
  1745. cmd += " /SUBSYSTEM:" + subsystem
  1746. if GetTargetArch() == 'x64':
  1747. cmd += ",5.02"
  1748. else:
  1749. cmd += ",5.01"
  1750. if dll.endswith(".dll") or dll.endswith(".pyd"):
  1751. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1752. for (opt, dir) in LIBDIRECTORIES:
  1753. if (opt=="ALWAYS") or (opt in opts):
  1754. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1755. for x in obj:
  1756. if x.endswith(".dll") or x.endswith(".pyd"):
  1757. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1758. elif x.endswith(".lib"):
  1759. dname = os.path.splitext(os.path.basename(x))[0] + ".dll"
  1760. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + dname)):
  1761. exit("Error: in makepanda, specify "+dname+", not "+x)
  1762. cmd += ' ' + BracketNameWithQuotes(x)
  1763. elif x.endswith(".def"):
  1764. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1765. elif x.endswith(".dat"):
  1766. pass
  1767. else:
  1768. cmd += ' ' + BracketNameWithQuotes(x)
  1769. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1770. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1771. for (opt, name) in LIBNAMES:
  1772. if (opt=="ALWAYS") or (opt in opts):
  1773. cmd += " " + BracketNameWithQuotes(name)
  1774. oscmd(cmd)
  1775. else:
  1776. cmd = "xilink"
  1777. if GetVerbose(): cmd += " /verbose:lib"
  1778. if HasTargetArch():
  1779. cmd += " /MACHINE:" + GetTargetArch().upper()
  1780. if ("MFC" not in opts):
  1781. cmd += " /NOD:MFC90.LIB /NOD:MFC80.LIB /NOD:LIBCMT"
  1782. cmd += " /NOD:LIBCI.LIB /DEBUG"
  1783. cmd += " /nod:libc /nod:libcmtd /nod:atlthunk /nod:atls"
  1784. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\ipp\\lib\\ia32"'
  1785. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\TBB\\Lib\\ia32\\vc10"'
  1786. cmd += ' /LIBPATH:"C:\\Program Files (x86)\\Intel\\Composer XE 2011 SP1\\compiler\\lib\\ia32"'
  1787. if (GetOrigExt(dll) != ".exe"): cmd += " /DLL"
  1788. optlevel = GetOptimizeOption(opts)
  1789. if (optlevel==1): cmd += " /MAP /MAPINFO:EXPORTS /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1790. if (optlevel==2): cmd += " /MAP:NUL /NOD:MSVCRT.LIB /NOD:MSVCPRT.LIB /NOD:MSVCIRT.LIB"
  1791. if (optlevel==3): cmd += " /MAP:NUL /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1792. if (optlevel==4): cmd += " /MAP:NUL /LTCG /NOD:MSVCRTD.LIB /NOD:MSVCPRTD.LIB /NOD:MSVCIRTD.LIB"
  1793. if ("MFC" in opts):
  1794. if (optlevel<=2): cmd += " /NOD:MSVCRTD.LIB mfcs100d.lib MSVCRTD.lib"
  1795. else: cmd += " /NOD:MSVCRT.LIB mfcs100.lib MSVCRT.lib"
  1796. cmd += " /FIXED:NO /OPT:REF /STACK:4194304 /INCREMENTAL:NO "
  1797. cmd += ' /OUT:' + BracketNameWithQuotes(dll)
  1798. subsystem = GetValueOption(opts, "SUBSYSTEM:")
  1799. if subsystem:
  1800. cmd += " /SUBSYSTEM:" + subsystem
  1801. if dll.endswith(".dll"):
  1802. cmd += ' /IMPLIB:' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(dll))[0] + ".lib"
  1803. for (opt, dir) in LIBDIRECTORIES:
  1804. if (opt=="ALWAYS") or (opt in opts):
  1805. cmd += ' /LIBPATH:' + BracketNameWithQuotes(dir)
  1806. for x in obj:
  1807. if x.endswith(".dll") or x.endswith(".pyd"):
  1808. cmd += ' ' + GetOutputDir() + '/lib/' + os.path.splitext(os.path.basename(x))[0] + ".lib"
  1809. elif x.endswith(".lib"):
  1810. dname = os.path.splitext(dll)[0]+".dll"
  1811. if (GetOrigExt(x) != ".ilb" and os.path.exists(GetOutputDir()+"/bin/" + os.path.splitext(os.path.basename(x))[0] + ".dll")):
  1812. exit("Error: in makepanda, specify "+dname+", not "+x)
  1813. cmd += ' ' + BracketNameWithQuotes(x)
  1814. elif x.endswith(".def"):
  1815. cmd += ' /DEF:' + BracketNameWithQuotes(x)
  1816. elif x.endswith(".dat"):
  1817. pass
  1818. else:
  1819. cmd += ' ' + BracketNameWithQuotes(x)
  1820. if (GetOrigExt(dll)==".exe" and "NOICON" not in opts):
  1821. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1822. for (opt, name) in LIBNAMES:
  1823. if (opt=="ALWAYS") or (opt in opts):
  1824. cmd += " " + BracketNameWithQuotes(name)
  1825. oscmd(cmd)
  1826. if COMPILER == "GCC":
  1827. cxx = GetCXX()
  1828. if GetOrigExt(dll) == ".exe":
  1829. cmd = cxx + ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1830. if GetTarget() == "android":
  1831. # Necessary to work around an issue with libandroid depending on vendor libraries
  1832. cmd += ' -Wl,--allow-shlib-undefined'
  1833. else:
  1834. if (GetTarget() == "darwin"):
  1835. cmd = cxx + ' -undefined dynamic_lookup'
  1836. if ("BUNDLE" in opts or GetOrigExt(dll) == ".pyd"):
  1837. cmd += ' -bundle '
  1838. else:
  1839. install_name = '@loader_path/../lib/' + os.path.basename(dll)
  1840. cmd += ' -dynamiclib -install_name ' + install_name
  1841. cmd += ' -compatibility_version ' + MAJOR_VERSION + ' -current_version ' + VERSION
  1842. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1843. else:
  1844. cmd = cxx + ' -shared'
  1845. # Always set soname on Android to avoid a linker warning when loading the library.
  1846. if "MODULE" not in opts or GetTarget() == 'android':
  1847. cmd += " -Wl,-soname=" + os.path.basename(dll)
  1848. cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
  1849. for x in obj:
  1850. if GetOrigExt(x) != ".dat":
  1851. cmd += ' ' + x
  1852. if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
  1853. cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
  1854. # macOS specific flags.
  1855. if GetTarget() == 'darwin':
  1856. cmd += " -headerpad_max_install_names"
  1857. if OSXTARGET is not None:
  1858. cmd += " -isysroot " + SDK["MACOSX"] + " -Wl,-syslibroot," + SDK["MACOSX"]
  1859. cmd += " -mmacosx-version-min=%d.%d" % (OSXTARGET)
  1860. elif platform.mac_ver()[0].startswith('11.'):
  1861. cmd += " -mmacosx-version-min=11.0"
  1862. for arch in OSX_ARCHS:
  1863. if 'NOARCH:' + arch.upper() not in opts:
  1864. cmd += " -arch %s" % arch
  1865. elif GetTarget() == 'android':
  1866. arch = GetTargetArch()
  1867. if "ANDROID_GCC_TOOLCHAIN" in SDK:
  1868. cmd += ' -gcc-toolchain ' + SDK["ANDROID_GCC_TOOLCHAIN"].replace('\\', '/')
  1869. cmd += " -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now"
  1870. if arch == 'armv7a':
  1871. cmd += ' -target armv7-none-linux-androideabi'
  1872. cmd += " -march=armv7-a -Wl,--fix-cortex-a8"
  1873. elif arch == 'arm':
  1874. cmd += ' -target armv5te-none-linux-androideabi'
  1875. elif arch == 'aarch64':
  1876. cmd += ' -target aarch64-none-linux-android'
  1877. elif arch == 'mips':
  1878. cmd += ' -target mipsel-none-linux-android'
  1879. cmd += ' -mips32'
  1880. elif arch == 'mips64':
  1881. cmd += ' -target mips64el-none-linux-android'
  1882. elif arch == 'x86':
  1883. cmd += ' -target i686-none-linux-android'
  1884. elif arch == 'x86_64':
  1885. cmd += ' -target x86_64-none-linux-android'
  1886. cmd += ' -lc -lm'
  1887. else:
  1888. cmd += " -pthread"
  1889. if "SYSROOT" in SDK:
  1890. cmd += " --sysroot=%s -no-canonical-prefixes" % (SDK["SYSROOT"])
  1891. if LDFLAGS != "":
  1892. cmd += " " + LDFLAGS
  1893. # Don't link libraries with Python, except on Android.
  1894. if "PYTHON" in opts and GetOrigExt(dll) != ".exe" and not RTDIST and GetTarget() != 'android':
  1895. opts = opts[:]
  1896. opts.remove("PYTHON")
  1897. for (opt, dir) in LIBDIRECTORIES:
  1898. if (opt=="ALWAYS") or (opt in opts):
  1899. cmd += ' -L' + BracketNameWithQuotes(dir)
  1900. for (opt, dir) in FRAMEWORKDIRECTORIES:
  1901. if (opt=="ALWAYS") or (opt in opts):
  1902. cmd += ' -F' + BracketNameWithQuotes(dir)
  1903. for (opt, name) in LIBNAMES:
  1904. if (opt=="ALWAYS") or (opt in opts):
  1905. cmd += ' ' + BracketNameWithQuotes(name)
  1906. if GetTarget() != 'freebsd':
  1907. cmd += " -ldl"
  1908. oscmd(cmd)
  1909. if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
  1910. oscmd(GetStrip() + " --strip-unneeded " + BracketNameWithQuotes(dll))
  1911. os.system("chmod +x " + BracketNameWithQuotes(dll))
  1912. if dll.endswith("." + MAJOR_VERSION + ".dylib"):
  1913. newdll = dll[:-6-len(MAJOR_VERSION)] + "dylib"
  1914. if os.path.isfile(newdll):
  1915. os.remove(newdll)
  1916. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1917. elif dll.endswith("." + MAJOR_VERSION):
  1918. newdll = dll[:-len(MAJOR_VERSION)-1]
  1919. if os.path.isfile(newdll):
  1920. os.remove(newdll)
  1921. oscmd("ln -s " + BracketNameWithQuotes(os.path.basename(dll)) + " " + BracketNameWithQuotes(newdll))
  1922. ##########################################################################################
  1923. #
  1924. # CompileEgg
  1925. #
  1926. ##########################################################################################
  1927. def CompileEgg(eggfile, src, opts):
  1928. pz = False
  1929. if eggfile.endswith(".pz"):
  1930. pz = True
  1931. eggfile = eggfile[:-3]
  1932. # Determine the location of the pzip and flt2egg tools.
  1933. if CrossCompiling():
  1934. # We may not be able to use our generated versions of these tools,
  1935. # so we'll expect them to already be present in the PATH.
  1936. pzip = 'pzip'
  1937. flt2egg = 'flt2egg'
  1938. else:
  1939. # If we're compiling for this machine, we can use the binaries we've built.
  1940. pzip = os.path.join(GetOutputDir(), 'bin', 'pzip')
  1941. flt2egg = os.path.join(GetOutputDir(), 'bin', 'flt2egg')
  1942. if not os.path.isfile(pzip):
  1943. pzip = 'pzip'
  1944. if not os.path.isfile(flt2egg):
  1945. flt2egg = 'flt2egg'
  1946. if src.endswith(".egg"):
  1947. CopyFile(eggfile, src)
  1948. elif src.endswith(".flt"):
  1949. oscmd(flt2egg + ' -ps keep -o ' + BracketNameWithQuotes(eggfile) + ' ' + BracketNameWithQuotes(src))
  1950. if pz:
  1951. oscmd(pzip + ' ' + BracketNameWithQuotes(eggfile))
  1952. ##########################################################################################
  1953. #
  1954. # CompileRes, CompileRsrc
  1955. #
  1956. ##########################################################################################
  1957. def CompileRes(target, src, opts):
  1958. """Compiles a Windows .rc file into a .res file."""
  1959. ipath = GetListOption(opts, "DIR:")
  1960. if (COMPILER == "MSVC"):
  1961. cmd = "rc"
  1962. cmd += " /Fo" + BracketNameWithQuotes(target)
  1963. for x in ipath: cmd += " /I" + x
  1964. for (opt,dir) in INCDIRECTORIES:
  1965. if (opt=="ALWAYS") or (opt in opts):
  1966. cmd += " /I" + BracketNameWithQuotes(dir)
  1967. for (opt,var,val) in DEFSYMBOLS:
  1968. if (opt=="ALWAYS") or (opt in opts):
  1969. cmd += " /D" + var + "=" + val
  1970. cmd += " " + BracketNameWithQuotes(src)
  1971. else:
  1972. cmd = "windres"
  1973. for x in ipath: cmd += " -I" + x
  1974. for (opt,dir) in INCDIRECTORIES:
  1975. if (opt=="ALWAYS") or (opt in opts):
  1976. cmd += " -I" + BracketNameWithQuotes(dir)
  1977. for (opt,var,val) in DEFSYMBOLS:
  1978. if (opt=="ALWAYS") or (opt in opts):
  1979. cmd += " -D" + var + "=" + val
  1980. cmd += " -i " + BracketNameWithQuotes(src)
  1981. cmd += " -o " + BracketNameWithQuotes(target)
  1982. oscmd(cmd)
  1983. def CompileRsrc(target, src, opts):
  1984. """Compiles a Mac OS .r file into an .rsrc file."""
  1985. ipath = GetListOption(opts, "DIR:")
  1986. if os.path.isfile("/usr/bin/Rez"):
  1987. cmd = "Rez -useDF"
  1988. elif os.path.isfile("/Library/Developer/CommandLineTools/usr/bin/Rez"):
  1989. cmd = "/Library/Developer/CommandLineTools/usr/bin/Rez -useDF"
  1990. else:
  1991. cmd = "/Developer/Tools/Rez -useDF"
  1992. cmd += " -o " + BracketNameWithQuotes(target)
  1993. for x in ipath:
  1994. cmd += " -i " + x
  1995. for (opt,dir) in INCDIRECTORIES:
  1996. if (opt=="ALWAYS") or (opt in opts):
  1997. cmd += " -i " + BracketNameWithQuotes(dir)
  1998. for (opt,var,val) in DEFSYMBOLS:
  1999. if (opt=="ALWAYS") or (opt in opts):
  2000. if (val == ""):
  2001. cmd += " -d " + var
  2002. else:
  2003. cmd += " -d " + var + " = " + val
  2004. cmd += " " + BracketNameWithQuotes(src)
  2005. oscmd(cmd)
  2006. ##########################################################################################
  2007. #
  2008. # CompileJava (Android only)
  2009. #
  2010. ##########################################################################################
  2011. def CompileJava(target, src, opts):
  2012. """Compiles a .java file into a .class file."""
  2013. if GetHost() == 'android':
  2014. cmd = "ecj "
  2015. else:
  2016. cmd = "javac -bootclasspath " + BracketNameWithQuotes(SDK["ANDROID_JAR"]) + " "
  2017. optlevel = GetOptimizeOption(opts)
  2018. if optlevel >= 4:
  2019. cmd += "-debug:none "
  2020. cmd += "-cp " + GetOutputDir() + "/classes "
  2021. cmd += "-d " + GetOutputDir() + "/classes "
  2022. cmd += BracketNameWithQuotes(src)
  2023. oscmd(cmd)
  2024. ##########################################################################################
  2025. #
  2026. # FreezePy
  2027. #
  2028. ##########################################################################################
  2029. def FreezePy(target, inputs, opts):
  2030. assert len(inputs) > 0
  2031. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/')) + " "
  2032. if sys.version_info >= (2, 6):
  2033. cmdstr += "-B "
  2034. cmdstr += os.path.join(GetOutputDir(), "direct", "dist", "pfreeze.py")
  2035. if 'FREEZE_STARTUP' in opts:
  2036. cmdstr += " -s"
  2037. if GetOrigExt(target) == '.exe':
  2038. src = inputs.pop(0)
  2039. else:
  2040. src = ""
  2041. for i in inputs:
  2042. i = os.path.splitext(i)[0]
  2043. i = i.replace('/', '.')
  2044. if i.startswith('direct.src'):
  2045. i = i.replace('.src.', '.')
  2046. cmdstr += " -i " + i
  2047. cmdstr += " -o " + target + " " + src
  2048. if ("LINK_PYTHON_STATIC" in opts):
  2049. os.environ["LINK_PYTHON_STATIC"] = "1"
  2050. oscmd(cmdstr)
  2051. if ("LINK_PYTHON_STATIC" in os.environ):
  2052. del os.environ["LINK_PYTHON_STATIC"]
  2053. if (not os.path.exists(target)):
  2054. exit("FREEZER_ERROR")
  2055. ##########################################################################################
  2056. #
  2057. # Package
  2058. #
  2059. ##########################################################################################
  2060. def Package(target, inputs, opts):
  2061. assert len(inputs) == 1
  2062. # Invoke the ppackage script.
  2063. command = BracketNameWithQuotes(SDK["PYTHONEXEC"]) + " "
  2064. if GetOptimizeOption(opts) >= 4:
  2065. command += "-OO "
  2066. if sys.version_info >= (2, 6):
  2067. command += "-B "
  2068. command += "direct/src/p3d/ppackage.py"
  2069. if not RTDIST:
  2070. # Don't compile Python sources, because we might not running in the same
  2071. # Python version as the selected host.
  2072. command += " -N"
  2073. if GetTarget() == "darwin":
  2074. if SDK.get("MACOSX"):
  2075. command += " -R \"%s\"" % SDK["MACOSX"]
  2076. for arch in OSX_ARCHS:
  2077. if arch == "x86_64":
  2078. arch = "amd64"
  2079. command += " -P osx_%s" % arch
  2080. command += " -i \"" + GetOutputDir() + "/stage\""
  2081. if (P3DSUFFIX):
  2082. command += ' -a "' + P3DSUFFIX + '"'
  2083. command += " " + inputs[0]
  2084. if GetOrigExt(target) == '.p3d':
  2085. # Build a specific .p3d file.
  2086. basename = os.path.basename(os.path.splitext(target)[0])
  2087. command += " " + basename
  2088. oscmd(command)
  2089. if GetTarget() == 'windows':
  2090. # Make an .exe that calls this .p3d.
  2091. objfile = FindLocation('p3dWrapper_' + basename + '.obj', [])
  2092. CompileCxx(objfile, 'direct/src/p3d/p3dWrapper.c', [])
  2093. exefile = FindLocation(basename + '.exe', [])
  2094. CompileLink(exefile, [objfile], ['ADVAPI'])
  2095. # Move it to the bin directory.
  2096. os.rename(GetOutputDir() + '/stage/' + basename + P3DSUFFIX + '.p3d', target)
  2097. if sys.platform != 'win32':
  2098. oscmd('chmod +x ' + BracketNameWithQuotes(target))
  2099. else:
  2100. # This is presumably a package or set of packages.
  2101. oscmd(command)
  2102. ##########################################################################################
  2103. #
  2104. # CompileBundle
  2105. #
  2106. ##########################################################################################
  2107. def CompileBundle(target, inputs, opts):
  2108. assert GetTarget() == "darwin", 'bundles can only be made for macOS'
  2109. plist = None
  2110. resources = []
  2111. objects = []
  2112. for i in inputs:
  2113. if (i.endswith(".plist")):
  2114. if (plist != None): exit("Only one plist file can be used when creating a bundle!")
  2115. plist = i
  2116. elif (i.endswith(".rsrc") or i.endswith(".icns")):
  2117. resources.append(i)
  2118. elif (GetOrigExt(i) == ".obj" or GetOrigExt(i) in SUFFIX_LIB or GetOrigExt(i) in SUFFIX_DLL):
  2119. objects.append(i)
  2120. else:
  2121. exit("Don't know how to bundle file %s" % i)
  2122. # Now link the object files to form the bundle.
  2123. if (plist == None): exit("One plist file must be used when creating a bundle!")
  2124. bundleName = plistlib.readPlist(plist)["CFBundleExecutable"]
  2125. oscmd("rm -rf %s" % target)
  2126. oscmd("mkdir -p %s/Contents/MacOS/" % target)
  2127. oscmd("mkdir -p %s/Contents/Resources/" % target)
  2128. if target.endswith(".app"):
  2129. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".exe")
  2130. else:
  2131. SetOrigExt("%s/Contents/MacOS/%s" % (target, bundleName), ".dll")
  2132. CompileLink("%s/Contents/MacOS/%s" % (target, bundleName), objects, opts + ["BUNDLE"])
  2133. oscmd("cp %s %s/Contents/Info.plist" % (plist, target))
  2134. for r in resources:
  2135. oscmd("cp %s %s/Contents/Resources/" % (r, target))
  2136. ##########################################################################################
  2137. #
  2138. # CompileMIDL
  2139. #
  2140. ##########################################################################################
  2141. def CompileMIDL(target, src, opts):
  2142. ipath = GetListOption(opts, "DIR:")
  2143. if (COMPILER=="MSVC"):
  2144. cmd = "midl"
  2145. cmd += " /out" + BracketNameWithQuotes(os.path.dirname(target))
  2146. for x in ipath: cmd += " /I" + x
  2147. for (opt,dir) in INCDIRECTORIES:
  2148. if (opt=="ALWAYS") or (opt in opts): cmd += " /I" + BracketNameWithQuotes(dir)
  2149. for (opt,var,val) in DEFSYMBOLS:
  2150. if (opt=="ALWAYS") or (opt in opts): cmd += " /D" + var + "=" + val
  2151. cmd += " " + BracketNameWithQuotes(src)
  2152. oscmd(cmd)
  2153. ##########################################################################################
  2154. #
  2155. # CompileAnything
  2156. #
  2157. ##########################################################################################
  2158. def CompileAnything(target, inputs, opts, progress = None):
  2159. if (opts.count("DEPENDENCYONLY")):
  2160. return
  2161. if (len(inputs)==0):
  2162. exit("No input files for target "+target)
  2163. infile = inputs[0]
  2164. origsuffix = GetOrigExt(target)
  2165. if (len(inputs) == 1 and origsuffix == GetOrigExt(infile)):
  2166. # It must be a simple copy operation.
  2167. ProgressOutput(progress, "Copying file", target)
  2168. CopyFile(target, infile)
  2169. if (origsuffix==".exe" and GetHost() != "windows"):
  2170. os.system("chmod +x \"%s\"" % target)
  2171. return
  2172. elif (infile.endswith(".py")):
  2173. if origsuffix == ".obj":
  2174. source = os.path.splitext(target)[0] + ".c"
  2175. SetOrigExt(source, ".c")
  2176. ProgressOutput(progress, "Building frozen source", source)
  2177. FreezePy(source, inputs, opts)
  2178. ProgressOutput(progress, "Building C++ object", target)
  2179. return CompileCxx(target, source, opts)
  2180. if origsuffix == ".exe":
  2181. ProgressOutput(progress, "Building frozen executable", target)
  2182. else:
  2183. ProgressOutput(progress, "Building frozen library", target)
  2184. return FreezePy(target, inputs, opts)
  2185. elif (infile.endswith(".idl")):
  2186. ProgressOutput(progress, "Compiling MIDL file", infile)
  2187. return CompileMIDL(target, infile, opts)
  2188. elif (infile.endswith(".pdef")):
  2189. if origsuffix == '.p3d':
  2190. ProgressOutput(progress, "Building package", target)
  2191. else:
  2192. ProgressOutput(progress, "Building package from pdef file", infile)
  2193. return Package(target, inputs, opts)
  2194. elif origsuffix in SUFFIX_LIB:
  2195. ProgressOutput(progress, "Linking static library", target)
  2196. return CompileLib(target, inputs, opts)
  2197. elif origsuffix in SUFFIX_DLL or (origsuffix==".plugin" and GetTarget() != "darwin"):
  2198. if (origsuffix==".exe"):
  2199. ProgressOutput(progress, "Linking executable", target)
  2200. else:
  2201. ProgressOutput(progress, "Linking dynamic library", target)
  2202. # Add version number to the dynamic library, on unix
  2203. if origsuffix == ".dll" and "MODULE" not in opts and not RTDIST:
  2204. tplatform = GetTarget()
  2205. if tplatform == "darwin":
  2206. # On Mac, libraries are named like libpanda.1.2.dylib
  2207. if target.lower().endswith(".dylib"):
  2208. target = target[:-5] + MAJOR_VERSION + ".dylib"
  2209. SetOrigExt(target, origsuffix)
  2210. elif tplatform != "windows" and tplatform != "android":
  2211. # On Linux, libraries are named like libpanda.so.1.2
  2212. target += "." + MAJOR_VERSION
  2213. SetOrigExt(target, origsuffix)
  2214. return CompileLink(target, inputs, opts)
  2215. elif (origsuffix==".in"):
  2216. ProgressOutput(progress, "Building Interrogate database", target)
  2217. return CompileIgate(target, inputs, opts)
  2218. elif (origsuffix==".plugin" and GetTarget() == "darwin"):
  2219. ProgressOutput(progress, "Building plugin bundle", target)
  2220. return CompileBundle(target, inputs, opts)
  2221. elif (origsuffix==".app"):
  2222. ProgressOutput(progress, "Building application bundle", target)
  2223. return CompileBundle(target, inputs, opts)
  2224. elif (origsuffix==".pz"):
  2225. ProgressOutput(progress, "Compressing", target)
  2226. return CompileEgg(target, infile, opts)
  2227. elif (origsuffix==".egg"):
  2228. ProgressOutput(progress, "Converting", target)
  2229. return CompileEgg(target, infile, opts)
  2230. elif (origsuffix==".res"):
  2231. ProgressOutput(progress, "Building resource object", target)
  2232. return CompileRes(target, infile, opts)
  2233. elif (origsuffix==".rsrc"):
  2234. ProgressOutput(progress, "Building resource object", target)
  2235. return CompileRsrc(target, infile, opts)
  2236. elif (origsuffix==".class"):
  2237. ProgressOutput(progress, "Building Java class", target)
  2238. return CompileJava(target, infile, opts)
  2239. elif (origsuffix==".obj"):
  2240. if (infile.endswith(".cxx")):
  2241. ProgressOutput(progress, "Building C++ object", target)
  2242. return CompileCxx(target, infile, opts)
  2243. elif (infile.endswith(".c")):
  2244. ProgressOutput(progress, "Building C object", target)
  2245. return CompileCxx(target, infile, opts)
  2246. elif (infile.endswith(".mm")):
  2247. ProgressOutput(progress, "Building Objective-C++ object", target)
  2248. return CompileCxx(target, infile, opts)
  2249. elif (infile.endswith(".yxx")):
  2250. ProgressOutput(progress, "Building Bison object", target)
  2251. return CompileBison(target, infile, opts)
  2252. elif (infile.endswith(".lxx")):
  2253. ProgressOutput(progress, "Building Flex object", target)
  2254. return CompileFlex(target, infile, opts)
  2255. elif (infile.endswith(".in")):
  2256. ProgressOutput(progress, "Building Interrogate object", target)
  2257. return CompileImod(target, inputs, opts)
  2258. elif (infile.endswith(".rc")):
  2259. ProgressOutput(progress, "Building resource object", target)
  2260. return CompileRes(target, infile, opts)
  2261. elif (infile.endswith(".r")):
  2262. ProgressOutput(progress, "Building resource object", target)
  2263. return CompileRsrc(target, infile, opts)
  2264. exit("Don't know how to compile: %s from %s" % (target, inputs))
  2265. ##########################################################################################
  2266. #
  2267. # Generate dtool_config.h, prc_parameters.h, and dtool_have_xxx.dat
  2268. #
  2269. ##########################################################################################
  2270. DTOOL_CONFIG=[
  2271. #_Variable_________________________Windows___________________Unix__________
  2272. ("HAVE_PYTHON", '1', '1'),
  2273. ("USE_DEBUG_PYTHON", 'UNDEF', 'UNDEF'),
  2274. ("PYTHON_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2275. ("COMPILE_IN_DEFAULT_FONT", '1', '1'),
  2276. ("STDFLOAT_DOUBLE", 'UNDEF', 'UNDEF'),
  2277. ("HAVE_MAYA", '1', '1'),
  2278. ("REPORT_OPENSSL_ERRORS", '1', '1'),
  2279. ("USE_PANDAFILESTREAM", '1', '1'),
  2280. ("USE_DELETED_CHAIN", '1', '1'),
  2281. ("HAVE_WGL", '1', 'UNDEF'),
  2282. ("HAVE_DX9", 'UNDEF', 'UNDEF'),
  2283. ("HAVE_THREADS", '1', '1'),
  2284. ("SIMPLE_THREADS", 'UNDEF', 'UNDEF'),
  2285. ("OS_SIMPLE_THREADS", '1', '1'),
  2286. ("DEBUG_THREADS", 'UNDEF', 'UNDEF'),
  2287. ("HAVE_POSIX_THREADS", 'UNDEF', '1'),
  2288. ("MUTEX_SPINLOCK", 'UNDEF', 'UNDEF'),
  2289. ("HAVE_AUDIO", '1', '1'),
  2290. ("NOTIFY_DEBUG", 'UNDEF', 'UNDEF'),
  2291. ("DO_PSTATS", 'UNDEF', 'UNDEF'),
  2292. ("DO_DCAST", 'UNDEF', 'UNDEF'),
  2293. ("DO_COLLISION_RECORDING", 'UNDEF', 'UNDEF'),
  2294. ("SUPPORT_IMMEDIATE_MODE", 'UNDEF', 'UNDEF'),
  2295. ("SUPPORT_FIXED_FUNCTION", '1', '1'),
  2296. ("DO_MEMORY_USAGE", 'UNDEF', 'UNDEF'),
  2297. ("DO_PIPELINING", '1', '1'),
  2298. ("DEFAULT_PATHSEP", '";"', '":"'),
  2299. ("WORDS_BIGENDIAN", 'UNDEF', 'UNDEF'),
  2300. ("PHAVE_LOCKF", '1', '1'),
  2301. ("SIMPLE_STRUCT_POINTERS", '1', 'UNDEF'),
  2302. ("HAVE_DINKUM", 'UNDEF', 'UNDEF'),
  2303. ("HAVE_STL_HASH", 'UNDEF', 'UNDEF'),
  2304. ("GETTIMEOFDAY_ONE_PARAM", 'UNDEF', 'UNDEF'),
  2305. ("HAVE_GETOPT", 'UNDEF', '1'),
  2306. ("HAVE_GETOPT_LONG_ONLY", 'UNDEF', '1'),
  2307. ("PHAVE_GETOPT_H", 'UNDEF', '1'),
  2308. ("PHAVE_LINUX_INPUT_H", 'UNDEF', '1'),
  2309. ("IOCTL_TERMINAL_WIDTH", 'UNDEF', '1'),
  2310. ("HAVE_IOS_TYPEDEFS", '1', '1'),
  2311. ("HAVE_IOS_BINARY", '1', '1'),
  2312. ("STATIC_INIT_GETENV", '1', 'UNDEF'),
  2313. ("HAVE_PROC_SELF_EXE", 'UNDEF', '1'),
  2314. ("HAVE_PROC_SELF_MAPS", 'UNDEF', '1'),
  2315. ("HAVE_PROC_SELF_ENVIRON", 'UNDEF', '1'),
  2316. ("HAVE_PROC_SELF_CMDLINE", 'UNDEF', '1'),
  2317. ("HAVE_PROC_CURPROC_FILE", 'UNDEF', 'UNDEF'),
  2318. ("HAVE_PROC_CURPROC_MAP", 'UNDEF', 'UNDEF'),
  2319. ("HAVE_PROC_CURPROC_CMDLINE", 'UNDEF', 'UNDEF'),
  2320. ("HAVE_GLOBAL_ARGV", '1', 'UNDEF'),
  2321. ("PROTOTYPE_GLOBAL_ARGV", 'UNDEF', 'UNDEF'),
  2322. ("GLOBAL_ARGV", '__argv', 'UNDEF'),
  2323. ("GLOBAL_ARGC", '__argc', 'UNDEF'),
  2324. ("PHAVE_IO_H", '1', 'UNDEF'),
  2325. ("PHAVE_IOSTREAM", '1', '1'),
  2326. ("PHAVE_STRING_H", 'UNDEF', '1'),
  2327. ("PHAVE_LIMITS_H", 'UNDEF', '1'),
  2328. ("PHAVE_STDLIB_H", 'UNDEF', '1'),
  2329. ("PHAVE_MALLOC_H", '1', '1'),
  2330. ("PHAVE_SYS_MALLOC_H", 'UNDEF', 'UNDEF'),
  2331. ("PHAVE_ALLOCA_H", 'UNDEF', '1'),
  2332. ("PHAVE_LOCALE_H", 'UNDEF', '1'),
  2333. ("PHAVE_SSTREAM", '1', '1'),
  2334. ("PHAVE_NEW", '1', '1'),
  2335. ("PHAVE_SYS_TYPES_H", '1', '1'),
  2336. ("PHAVE_SYS_TIME_H", 'UNDEF', '1'),
  2337. ("PHAVE_UNISTD_H", 'UNDEF', '1'),
  2338. ("PHAVE_UTIME_H", 'UNDEF', '1'),
  2339. ("PHAVE_GLOB_H", 'UNDEF', '1'),
  2340. ("PHAVE_DIRENT_H", 'UNDEF', '1'),
  2341. ("PHAVE_UCONTEXT_H", 'UNDEF', '1'),
  2342. ("PHAVE_STDINT_H", '1', '1'),
  2343. ("HAVE_RTTI", '1', '1'),
  2344. ("HAVE_X11", 'UNDEF', '1'),
  2345. ("IS_LINUX", 'UNDEF', '1'),
  2346. ("IS_OSX", 'UNDEF', 'UNDEF'),
  2347. ("IS_FREEBSD", 'UNDEF', 'UNDEF'),
  2348. ("HAVE_EIGEN", 'UNDEF', 'UNDEF'),
  2349. ("LINMATH_ALIGN", '1', '1'),
  2350. ("HAVE_ZLIB", 'UNDEF', 'UNDEF'),
  2351. ("HAVE_PNG", 'UNDEF', 'UNDEF'),
  2352. ("HAVE_JPEG", 'UNDEF', 'UNDEF'),
  2353. ("HAVE_VIDEO4LINUX", 'UNDEF', '1'),
  2354. ("HAVE_TIFF", 'UNDEF', 'UNDEF'),
  2355. ("HAVE_OPENEXR", 'UNDEF', 'UNDEF'),
  2356. ("HAVE_SGI_RGB", '1', '1'),
  2357. ("HAVE_TGA", '1', '1'),
  2358. ("HAVE_IMG", '1', '1'),
  2359. ("HAVE_SOFTIMAGE_PIC", '1', '1'),
  2360. ("HAVE_BMP", '1', '1'),
  2361. ("HAVE_PNM", '1', '1'),
  2362. ("HAVE_STB_IMAGE", '1', '1'),
  2363. ("HAVE_VORBIS", 'UNDEF', 'UNDEF'),
  2364. ("HAVE_OPUS", 'UNDEF', 'UNDEF'),
  2365. ("HAVE_FREETYPE", 'UNDEF', 'UNDEF'),
  2366. ("HAVE_FFTW", 'UNDEF', 'UNDEF'),
  2367. ("HAVE_OPENSSL", 'UNDEF', 'UNDEF'),
  2368. ("HAVE_NET", 'UNDEF', 'UNDEF'),
  2369. ("WANT_NATIVE_NET", '1', '1'),
  2370. ("SIMULATE_NETWORK_DELAY", 'UNDEF', 'UNDEF'),
  2371. ("HAVE_CG", 'UNDEF', 'UNDEF'),
  2372. ("HAVE_CGGL", 'UNDEF', 'UNDEF'),
  2373. ("HAVE_CGDX9", 'UNDEF', 'UNDEF'),
  2374. ("HAVE_ARTOOLKIT", 'UNDEF', 'UNDEF'),
  2375. ("HAVE_DIRECTCAM", 'UNDEF', 'UNDEF'),
  2376. ("HAVE_SQUISH", 'UNDEF', 'UNDEF'),
  2377. ("HAVE_CARBON", 'UNDEF', 'UNDEF'),
  2378. ("HAVE_COCOA", 'UNDEF', 'UNDEF'),
  2379. ("HAVE_OPENAL_FRAMEWORK", 'UNDEF', 'UNDEF'),
  2380. ("HAVE_ROCKET_PYTHON", '1', '1'),
  2381. ("HAVE_ROCKET_DEBUGGER", 'UNDEF', 'UNDEF'),
  2382. ("USE_TAU", 'UNDEF', 'UNDEF'),
  2383. ("PRC_SAVE_DESCRIPTIONS", '1', '1'),
  2384. # ("_SECURE_SCL", '0', 'UNDEF'),
  2385. # ("_SECURE_SCL_THROWS", '0', 'UNDEF'),
  2386. ("HAVE_P3D_PLUGIN", 'UNDEF', 'UNDEF'),
  2387. ]
  2388. PRC_PARAMETERS=[
  2389. ("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
  2390. ("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
  2391. ("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
  2392. ("PRC_PATH2_ENVVARS", '""', '""'),
  2393. ("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
  2394. ("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
  2395. ("PRC_ENCRYPTION_KEY", '""', '""'),
  2396. ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
  2397. ("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
  2398. ("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
  2399. ("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
  2400. ("PRC_DCONFIG_TRUST_LEVEL", '0', '0'),
  2401. ("PRC_INC_TRUST_LEVEL", '0', '0'),
  2402. ]
  2403. def WriteConfigSettings():
  2404. dtool_config={}
  2405. prc_parameters={}
  2406. speedtree_parameters={}
  2407. plugin_config={}
  2408. if (GetTarget() == 'windows'):
  2409. for key,win,unix in DTOOL_CONFIG:
  2410. dtool_config[key] = win
  2411. for key,win,unix in PRC_PARAMETERS:
  2412. prc_parameters[key] = win
  2413. else:
  2414. for key,win,unix in DTOOL_CONFIG:
  2415. dtool_config[key] = unix
  2416. for key,win,unix in PRC_PARAMETERS:
  2417. prc_parameters[key] = unix
  2418. for x in PkgListGet():
  2419. if ("HAVE_"+x in dtool_config):
  2420. if (PkgSkip(x)==0):
  2421. dtool_config["HAVE_"+x] = '1'
  2422. else:
  2423. dtool_config["HAVE_"+x] = 'UNDEF'
  2424. dtool_config["HAVE_NET"] = '1'
  2425. if (PkgSkip("NVIDIACG")==0):
  2426. dtool_config["HAVE_CG"] = '1'
  2427. dtool_config["HAVE_CGGL"] = '1'
  2428. dtool_config["HAVE_CGDX9"] = '1'
  2429. if GetTarget() not in ("linux", "android"):
  2430. dtool_config["HAVE_PROC_SELF_EXE"] = 'UNDEF'
  2431. dtool_config["HAVE_PROC_SELF_MAPS"] = 'UNDEF'
  2432. dtool_config["HAVE_PROC_SELF_CMDLINE"] = 'UNDEF'
  2433. dtool_config["HAVE_PROC_SELF_ENVIRON"] = 'UNDEF'
  2434. if (GetTarget() == "darwin"):
  2435. dtool_config["PYTHON_FRAMEWORK"] = 'Python'
  2436. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2437. dtool_config["PHAVE_SYS_MALLOC_H"] = '1'
  2438. dtool_config["HAVE_OPENAL_FRAMEWORK"] = '1'
  2439. dtool_config["HAVE_X11"] = 'UNDEF' # We might have X11, but we don't need it.
  2440. dtool_config["IS_LINUX"] = 'UNDEF'
  2441. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2442. dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
  2443. dtool_config["IS_OSX"] = '1'
  2444. if (GetTarget() == "freebsd"):
  2445. dtool_config["IS_LINUX"] = 'UNDEF'
  2446. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2447. dtool_config["IS_FREEBSD"] = '1'
  2448. dtool_config["PHAVE_ALLOCA_H"] = 'UNDEF'
  2449. dtool_config["PHAVE_MALLOC_H"] = 'UNDEF'
  2450. dtool_config["HAVE_PROC_CURPROC_FILE"] = '1'
  2451. dtool_config["HAVE_PROC_CURPROC_MAP"] = '1'
  2452. dtool_config["HAVE_PROC_CURPROC_CMDLINE"] = '1'
  2453. if (GetTarget() == "android"):
  2454. # Android does have RTTI, but we disable it anyway.
  2455. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2456. dtool_config["PHAVE_GLOB_H"] = 'UNDEF'
  2457. dtool_config["PHAVE_LOCKF"] = 'UNDEF'
  2458. dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
  2459. if (GetOptimize() <= 2 and GetTarget() == "windows"):
  2460. dtool_config["USE_DEBUG_PYTHON"] = '1'
  2461. # This should probably be more sophisticated, such as based
  2462. # on whether the libRocket Python modules are available.
  2463. if (PkgSkip("PYTHON") != 0):
  2464. dtool_config["HAVE_ROCKET_PYTHON"] = 'UNDEF'
  2465. if (GetOptimize() <= 3):
  2466. dtool_config["HAVE_ROCKET_DEBUGGER"] = '1'
  2467. if (GetOptimize() <= 3):
  2468. if (dtool_config["HAVE_NET"] != 'UNDEF'):
  2469. dtool_config["DO_PSTATS"] = '1'
  2470. if (GetOptimize() <= 3):
  2471. dtool_config["DO_DCAST"] = '1'
  2472. if (GetOptimize() <= 3):
  2473. dtool_config["DO_COLLISION_RECORDING"] = '1'
  2474. if (GetOptimize() <= 3):
  2475. dtool_config["DO_MEMORY_USAGE"] = '1'
  2476. if (GetOptimize() <= 3):
  2477. dtool_config["NOTIFY_DEBUG"] = '1'
  2478. if (GetOptimize() >= 4):
  2479. dtool_config["PRC_SAVE_DESCRIPTIONS"] = 'UNDEF'
  2480. if (GetOptimize() >= 4):
  2481. # Disable RTTI on release builds.
  2482. dtool_config["HAVE_RTTI"] = 'UNDEF'
  2483. # Now that we have OS_SIMPLE_THREADS, we can support
  2484. # SIMPLE_THREADS on exotic architectures like win64, so we no
  2485. # longer need to disable it for this platform.
  2486. ## if GetTarget() == 'windows' and GetTargetArch() == 'x64':
  2487. ## dtool_config["SIMPLE_THREADS"] = 'UNDEF'
  2488. if (RTDIST or RUNTIME):
  2489. prc_parameters["DEFAULT_PRC_DIR"] = '""'
  2490. if HOST_URL:
  2491. plugin_config["PANDA_PACKAGE_HOST_URL"] = HOST_URL
  2492. #plugin_config["P3D_PLUGIN_LOG_DIRECTORY"] = ""
  2493. plugin_config["P3D_PLUGIN_LOG_BASENAME1"] = ""
  2494. plugin_config["P3D_PLUGIN_LOG_BASENAME2"] = ""
  2495. plugin_config["P3D_PLUGIN_LOG_BASENAME3"] = ""
  2496. plugin_config["P3D_PLUGIN_P3D_PLUGIN"] = ""
  2497. plugin_config["P3D_PLUGIN_P3DPYTHON"] = ""
  2498. plugin_config["P3D_COREAPI_VERSION_STR"] = COREAPI_VERSION
  2499. plugin_config["P3D_PLUGIN_VERSION_STR"] = PLUGIN_VERSION
  2500. if PkgSkip("GTK2") == 0:
  2501. plugin_config["HAVE_GTK"] = '1'
  2502. if (RUNTIME):
  2503. dtool_config["HAVE_P3D_PLUGIN"] = '1'
  2504. # Whether it's present on the system doesn't matter here,
  2505. # as the runtime itself doesn't include or link with X11.
  2506. if (RUNTIME and GetTarget() == 'linux'):
  2507. dtool_config["HAVE_X11"] = '1'
  2508. if ("GENERIC_DXERR_LIBRARY" in SDK):
  2509. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "1"
  2510. else:
  2511. dtool_config["USE_GENERIC_DXERR_LIBRARY"] = "UNDEF"
  2512. if (PkgSkip("SPEEDTREE")==0):
  2513. speedtree_parameters["SPEEDTREE_OPENGL"] = "UNDEF"
  2514. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "UNDEF"
  2515. if SDK["SPEEDTREEAPI"] == "OpenGL":
  2516. speedtree_parameters["SPEEDTREE_OPENGL"] = "1"
  2517. elif SDK["SPEEDTREEAPI"] == "DirectX9":
  2518. speedtree_parameters["SPEEDTREE_DIRECTX9"] = "1"
  2519. speedtree_parameters["SPEEDTREE_BIN_DIR"] = (SDK["SPEEDTREE"] + "/Bin")
  2520. conf = "/* prc_parameters.h. Generated automatically by makepanda.py */\n"
  2521. for key in sorted(prc_parameters.keys()):
  2522. if ((key == "DEFAULT_PRC_DIR") or (key[:4]=="PRC_")):
  2523. val = OverrideValue(key, prc_parameters[key])
  2524. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2525. else: conf = conf + "#define " + key + " " + val + "\n"
  2526. ConditionalWriteFile(GetOutputDir() + '/include/prc_parameters.h', conf)
  2527. conf = "/* dtool_config.h. Generated automatically by makepanda.py */\n"
  2528. for key in sorted(dtool_config.keys()):
  2529. val = OverrideValue(key, dtool_config[key])
  2530. if key in ('HAVE_CG', 'HAVE_CGGL', 'HAVE_CGDX9') and val != 'UNDEF':
  2531. # These are not available for ARM, period.
  2532. conf = conf + "#ifdef __aarch64__\n"
  2533. conf = conf + "#undef " + key + "\n"
  2534. conf = conf + "#else\n"
  2535. conf = conf + "#define " + key + " " + val + "\n"
  2536. conf = conf + "#endif\n"
  2537. elif val == 'UNDEF':
  2538. conf = conf + "#undef " + key + "\n"
  2539. else:
  2540. conf = conf + "#define " + key + " " + val + "\n"
  2541. ConditionalWriteFile(GetOutputDir() + '/include/dtool_config.h', conf)
  2542. if (RTDIST or RUNTIME):
  2543. conf = "/* p3d_plugin_config.h. Generated automatically by makepanda.py */\n"
  2544. for key in sorted(plugin_config.keys()):
  2545. val = plugin_config[key]
  2546. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2547. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2548. ConditionalWriteFile(GetOutputDir() + '/include/p3d_plugin_config.h', conf)
  2549. if (PkgSkip("SPEEDTREE")==0):
  2550. conf = "/* speedtree_parameters.h. Generated automatically by makepanda.py */\n"
  2551. for key in sorted(speedtree_parameters.keys()):
  2552. val = OverrideValue(key, speedtree_parameters[key])
  2553. if (val == 'UNDEF'): conf = conf + "#undef " + key + "\n"
  2554. else: conf = conf + "#define " + key + " \"" + val.replace("\\", "\\\\") + "\"\n"
  2555. ConditionalWriteFile(GetOutputDir() + '/include/speedtree_parameters.h', conf)
  2556. for x in PkgListGet():
  2557. if (PkgSkip(x)): ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "0\n")
  2558. else: ConditionalWriteFile(GetOutputDir() + '/tmp/dtool_have_'+x.lower()+'.dat', "1\n")
  2559. # Finally, write a platform.dat with the platform we are compiling for.
  2560. ConditionalWriteFile(GetOutputDir() + '/tmp/platform.dat', PLATFORM)
  2561. # This is useful for tools like makepackage that need to know things about
  2562. # the build parameters.
  2563. ConditionalWriteFile(GetOutputDir() + '/tmp/optimize.dat', str(GetOptimize()))
  2564. WriteConfigSettings()
  2565. WarnConflictingFiles()
  2566. if SystemLibraryExists("dtoolbase"):
  2567. Warn("Found conflicting Panda3D libraries from other ppremake build!")
  2568. if SystemLibraryExists("p3dtoolconfig"):
  2569. Warn("Found conflicting Panda3D libraries from other makepanda build!")
  2570. ##########################################################################################
  2571. #
  2572. # Generate pandaVersion.h, pythonversion, null.cxx, etc.
  2573. #
  2574. ##########################################################################################
  2575. PANDAVERSION_H="""
  2576. #define PANDA_MAJOR_VERSION $VERSION1
  2577. #define PANDA_MINOR_VERSION $VERSION2
  2578. #define PANDA_SEQUENCE_VERSION $VERSION3
  2579. #define PANDA_VERSION $NVERSION
  2580. #define PANDA_NUMERIC_VERSION $NVERSION
  2581. #define PANDA_VERSION_STR "$VERSION"
  2582. #define PANDA_ABI_VERSION_STR "$VERSION1.$VERSION2"
  2583. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2584. #define PANDA_PACKAGE_VERSION_STR "$RTDIST_VERSION"
  2585. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2586. """
  2587. PANDAVERSION_H_RUNTIME="""
  2588. #define PANDA_MAJOR_VERSION 0
  2589. #define PANDA_MINOR_VERSION 0
  2590. #define PANDA_SEQUENCE_VERSION 0
  2591. #define PANDA_VERSION_STR "0.0.0"
  2592. #define PANDA_ABI_VERSION_STR "0.0"
  2593. #define P3D_PLUGIN_MAJOR_VERSION $VERSION1
  2594. #define P3D_PLUGIN_MINOR_VERSION $VERSION2
  2595. #define P3D_PLUGIN_SEQUENCE_VERSION $VERSION3
  2596. #define P3D_PLUGIN_VERSION_STR "$VERSION1.$VERSION2.$VERSION3"
  2597. #define P3D_COREAPI_VERSION_STR "$COREAPI_VERSION"
  2598. #define PANDA_DISTRIBUTOR "$DISTRIBUTOR"
  2599. #define PANDA_PACKAGE_VERSION_STR ""
  2600. #define PANDA_PACKAGE_HOST_URL "$HOST_URL"
  2601. """
  2602. CHECKPANDAVERSION_CXX="""
  2603. # include "dtoolbase.h"
  2604. EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2 = 0;
  2605. """
  2606. CHECKPANDAVERSION_H="""
  2607. # ifndef CHECKPANDAVERSION_H
  2608. # define CHECKPANDAVERSION_H
  2609. # include "dtoolbase.h"
  2610. extern EXPCL_DTOOL_DTOOLBASE int panda_version_$VERSION1_$VERSION2;
  2611. // Hack to forcibly depend on the check
  2612. template<typename T>
  2613. class CheckPandaVersion {
  2614. public:
  2615. int check_version() { return panda_version_$VERSION1_$VERSION2; }
  2616. };
  2617. template class CheckPandaVersion<void>;
  2618. # endif
  2619. """
  2620. P3DACTIVEX_RC="""#include "resource.h"
  2621. #define APSTUDIO_READONLY_SYMBOLS
  2622. #include "afxres.h"
  2623. #undef APSTUDIO_READONLY_SYMBOLS
  2624. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
  2625. #ifdef _WIN32
  2626. LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
  2627. #pragma code_page(1252)
  2628. #endif
  2629. #ifdef APSTUDIO_INVOKED
  2630. 1 TEXTINCLUDE
  2631. BEGIN
  2632. "resource.h\\0"
  2633. END
  2634. 2 TEXTINCLUDE
  2635. BEGIN
  2636. "#include ""afxres.h""\\r\\n"
  2637. "\\0"
  2638. END
  2639. 3 TEXTINCLUDE
  2640. BEGIN
  2641. "1 TYPELIB ""P3DActiveX.tlb""\\r\\n"
  2642. "\\0"
  2643. END
  2644. #endif
  2645. %s
  2646. IDB_P3DACTIVEX BITMAP "P3DActiveXCtrl.bmp"
  2647. IDD_PROPPAGE_P3DACTIVEX DIALOG 0, 0, 250, 62
  2648. STYLE DS_SETFONT | WS_CHILD
  2649. FONT 8, "MS Sans Serif"
  2650. BEGIN
  2651. LTEXT "TODO: Place controls to manipulate properties of P3DActiveX Control on this dialog.",
  2652. IDC_STATIC,7,25,229,16
  2653. END
  2654. #ifdef APSTUDIO_INVOKED
  2655. GUIDELINES DESIGNINFO
  2656. BEGIN
  2657. IDD_PROPPAGE_P3DACTIVEX, DIALOG
  2658. BEGIN
  2659. LEFTMARGIN, 7
  2660. RIGHTMARGIN, 243
  2661. TOPMARGIN, 7
  2662. BOTTOMMARGIN, 55
  2663. END
  2664. END
  2665. #endif
  2666. STRINGTABLE
  2667. BEGIN
  2668. IDS_P3DACTIVEX "P3DActiveX Control"
  2669. IDS_P3DACTIVEX_PPG "P3DActiveX Property Page"
  2670. END
  2671. STRINGTABLE
  2672. BEGIN
  2673. IDS_P3DACTIVEX_PPG_CAPTION "General"
  2674. END
  2675. #endif
  2676. #ifndef APSTUDIO_INVOKED
  2677. 1 TYPELIB "P3DActiveX.tlb"
  2678. #endif"""
  2679. def CreatePandaVersionFiles():
  2680. parts = VERSION.split(".", 2)
  2681. version1 = int(parts[0])
  2682. version2 = int(parts[1])
  2683. version3 = 0
  2684. if len(parts) > 2:
  2685. for c in parts[2]:
  2686. if c.isdigit():
  2687. version3 = version3 * 10 + ord(c) - 48
  2688. else:
  2689. break
  2690. nversion = version1 * 1000000 + version2 * 1000 + version3
  2691. if DISTRIBUTOR != "cmu":
  2692. # Subtract 1 if we are not an official version.
  2693. nversion -= 1
  2694. if (RUNTIME):
  2695. pandaversion_h = PANDAVERSION_H_RUNTIME
  2696. else:
  2697. pandaversion_h = PANDAVERSION_H
  2698. pandaversion_h = pandaversion_h.replace("$VERSION1",str(version1))
  2699. pandaversion_h = pandaversion_h.replace("$VERSION2",str(version2))
  2700. pandaversion_h = pandaversion_h.replace("$VERSION3",str(version3))
  2701. pandaversion_h = pandaversion_h.replace("$VERSION",VERSION)
  2702. pandaversion_h = pandaversion_h.replace("$NVERSION",str(nversion))
  2703. pandaversion_h = pandaversion_h.replace("$DISTRIBUTOR",DISTRIBUTOR)
  2704. pandaversion_h = pandaversion_h.replace("$RTDIST_VERSION",RTDIST_VERSION)
  2705. pandaversion_h = pandaversion_h.replace("$COREAPI_VERSION",COREAPI_VERSION)
  2706. pandaversion_h = pandaversion_h.replace("$HOST_URL",(HOST_URL or ""))
  2707. if (DISTRIBUTOR == "cmu"):
  2708. pandaversion_h += "\n#define PANDA_OFFICIAL_VERSION\n"
  2709. else:
  2710. pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
  2711. if GIT_COMMIT:
  2712. pandaversion_h += "\n#define PANDA_GIT_COMMIT_STR \"%s\"\n" % (GIT_COMMIT)
  2713. # Allow creating a deterministic build by setting this.
  2714. source_date = os.environ.get("SOURCE_DATE_EPOCH")
  2715. if source_date:
  2716. # This matches the GCC / Clang format for __DATE__ __TIME__
  2717. source_date = time.gmtime(int(source_date))
  2718. try:
  2719. source_date = time.strftime('%b %e %Y %H:%M:%S', source_date)
  2720. except ValueError:
  2721. source_date = time.strftime('%b %d %Y %H:%M:%S', source_date)
  2722. if source_date[3:5] == ' 0':
  2723. source_date = source_date[:3] + ' ' + source_date[5:]
  2724. pandaversion_h += "\n#define PANDA_BUILD_DATE_STR \"%s\"\n" % (source_date)
  2725. if not RUNTIME:
  2726. checkpandaversion_cxx = CHECKPANDAVERSION_CXX.replace("$VERSION1",str(version1))
  2727. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION2",str(version2))
  2728. checkpandaversion_cxx = checkpandaversion_cxx.replace("$VERSION3",str(version3))
  2729. checkpandaversion_cxx = checkpandaversion_cxx.replace("$NVERSION",str(nversion))
  2730. checkpandaversion_h = CHECKPANDAVERSION_H.replace("$VERSION1",str(version1))
  2731. checkpandaversion_h = checkpandaversion_h.replace("$VERSION2",str(version2))
  2732. checkpandaversion_h = checkpandaversion_h.replace("$VERSION3",str(version3))
  2733. checkpandaversion_h = checkpandaversion_h.replace("$NVERSION",str(nversion))
  2734. ConditionalWriteFile(GetOutputDir()+'/include/pandaVersion.h', pandaversion_h)
  2735. if RUNTIME:
  2736. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', '')
  2737. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', '')
  2738. else:
  2739. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.cxx', checkpandaversion_cxx)
  2740. ConditionalWriteFile(GetOutputDir()+'/include/checkPandaVersion.h', checkpandaversion_h)
  2741. ConditionalWriteFile(GetOutputDir()+"/tmp/null.cxx","")
  2742. if RUNTIME:
  2743. p3dactivex_rc = {"name" : "Panda3D Game Engine Plug-in",
  2744. "version" : VERSION,
  2745. "description" : "Runs 3-D games and interactive applets",
  2746. "filename" : "p3dactivex.ocx",
  2747. "mimetype" : "application/x-panda3d",
  2748. "extension" : "p3d",
  2749. "filedesc" : "Panda3D applet"}
  2750. ConditionalWriteFile(GetOutputDir()+"/include/P3DActiveX.rc", P3DACTIVEX_RC % GenerateResourceFile(**p3dactivex_rc))
  2751. CreatePandaVersionFiles()
  2752. ##########################################################################################
  2753. #
  2754. # Copy the "direct" tree
  2755. #
  2756. ##########################################################################################
  2757. if (PkgSkip("DIRECT")==0):
  2758. CopyPythonTree(GetOutputDir() + '/direct', 'direct/src', threads=THREADCOUNT)
  2759. ConditionalWriteFile(GetOutputDir() + '/direct/__init__.py', "")
  2760. # This file used to be copied, but would nowadays cause conflicts.
  2761. # Let's get it out of the way in case someone hasn't cleaned their build since.
  2762. if os.path.isfile(GetOutputDir() + '/bin/panda3d.py'):
  2763. os.remove(GetOutputDir() + '/bin/panda3d.py')
  2764. if os.path.isfile(GetOutputDir() + '/lib/panda3d.py'):
  2765. os.remove(GetOutputDir() + '/lib/panda3d.py')
  2766. # This directory doesn't exist at all any more.
  2767. if os.path.isdir(os.path.join(GetOutputDir(), 'direct', 'ffi')):
  2768. shutil.rmtree(os.path.join(GetOutputDir(), 'direct', 'ffi'))
  2769. # These files used to exist; remove them to avoid conflicts.
  2770. del_files = ['core.py', 'core.pyc', 'core.pyo',
  2771. '_core.pyd', '_core.so',
  2772. 'direct.py', 'direct.pyc', 'direct.pyo',
  2773. '_direct.pyd', '_direct.so',
  2774. 'dtoolconfig.pyd', 'dtoolconfig.so',
  2775. 'net.pyd', 'net.so',
  2776. 'net.py', 'net.pyc', 'net.pyo']
  2777. for basename in del_files:
  2778. path = os.path.join(GetOutputDir(), 'panda3d', basename)
  2779. if os.path.isfile(path):
  2780. print("Removing %s" % (path))
  2781. os.remove(path)
  2782. # Write an appropriate panda3d/__init__.py
  2783. p3d_init = """"Python bindings for the Panda3D libraries"
  2784. __version__ = '%s'
  2785. """ % (WHLVERSION)
  2786. if GetTarget() == 'windows':
  2787. p3d_init += """
  2788. if '__file__' in locals():
  2789. import os
  2790. bindir = os.path.join(os.path.dirname(__file__), '..', 'bin')
  2791. if os.path.isdir(bindir):
  2792. if hasattr(os, 'add_dll_directory'):
  2793. os.add_dll_directory(bindir)
  2794. elif not os.environ.get('PATH'):
  2795. os.environ['PATH'] = bindir
  2796. else:
  2797. os.environ['PATH'] = bindir + os.pathsep + os.environ['PATH']
  2798. del os, bindir
  2799. """
  2800. if not PkgSkip("PYTHON"):
  2801. ConditionalWriteFile(GetOutputDir() + '/panda3d/__init__.py', p3d_init)
  2802. # Also add this file, for backward compatibility.
  2803. ConditionalWriteFile(GetOutputDir() + '/panda3d/dtoolconfig.py', """\
  2804. '''Alias of :mod:`panda3d.interrogatedb`.
  2805. .. deprecated:: 1.10.0
  2806. This module has been renamed to :mod:`panda3d.interrogatedb`.
  2807. '''
  2808. if __debug__:
  2809. print("Warning: panda3d.dtoolconfig is deprecated, use panda3d.interrogatedb instead.")
  2810. from .interrogatedb import *
  2811. """)
  2812. # PandaModules is now deprecated; generate a shim for backward compatibility.
  2813. for fn in glob.glob(GetOutputDir() + '/pandac/*.py') + glob.glob(GetOutputDir() + '/pandac/*.py[co]'):
  2814. if os.path.basename(fn) not in ('PandaModules.py', '__init__.py'):
  2815. os.remove(fn)
  2816. panda_modules = ['core']
  2817. if not PkgSkip("PANDAPHYSICS"):
  2818. panda_modules.append('physics')
  2819. if not PkgSkip('PANDAFX'):
  2820. panda_modules.append('fx')
  2821. if not PkgSkip("DIRECT"):
  2822. panda_modules.append('direct')
  2823. if not PkgSkip("VISION"):
  2824. panda_modules.append('vision')
  2825. if not PkgSkip("SKEL"):
  2826. panda_modules.append('skel')
  2827. if not PkgSkip("EGG"):
  2828. panda_modules.append('egg')
  2829. if not PkgSkip("ODE"):
  2830. panda_modules.append('ode')
  2831. if not PkgSkip("VRPN"):
  2832. panda_modules.append('vrpn')
  2833. panda_modules_code = """
  2834. "This module is deprecated. Import from panda3d.core and other panda3d.* modules instead."
  2835. if __debug__:
  2836. print("Warning: pandac.PandaModules is deprecated, import from panda3d.core instead")
  2837. """
  2838. for module in panda_modules:
  2839. panda_modules_code += """
  2840. try:
  2841. from panda3d.%s import *
  2842. except ImportError as err:
  2843. if "No module named %s" not in str(err):
  2844. raise""" % (module, module)
  2845. panda_modules_code += """
  2846. from direct.showbase import DConfig
  2847. def get_config_showbase():
  2848. return DConfig
  2849. def get_config_express():
  2850. return DConfig
  2851. getConfigShowbase = get_config_showbase
  2852. getConfigExpress = get_config_express
  2853. """
  2854. exthelpers_code = """
  2855. "This module is deprecated. Import from direct.extensions_native.extension_native_helpers instead."
  2856. from direct.extensions_native.extension_native_helpers import *
  2857. """
  2858. if not PkgSkip("PYTHON"):
  2859. ConditionalWriteFile(GetOutputDir() + '/pandac/PandaModules.py', panda_modules_code)
  2860. ConditionalWriteFile(GetOutputDir() + '/pandac/extension_native_helpers.py', exthelpers_code)
  2861. ConditionalWriteFile(GetOutputDir() + '/pandac/__init__.py', '')
  2862. ##########################################################################################
  2863. #
  2864. # Write the dist-info directory.
  2865. #
  2866. ##########################################################################################
  2867. # This is just some basic stuff since setuptools just needs this file to
  2868. # exist, otherwise it will not read the entry_points.txt file. Maybe we will
  2869. # eventually want to merge this with the metadata generator in makewheel.py.
  2870. METADATA = """Metadata-Version: 2.1
  2871. Name: Panda3D
  2872. Version: {version}
  2873. License: BSD
  2874. Home-page: https://www.panda3d.org/
  2875. Author: Panda3D Team
  2876. Author-email: [email protected]
  2877. """
  2878. ENTRY_POINTS = """[distutils.commands]
  2879. build_apps = direct.dist.commands:build_apps
  2880. bdist_apps = direct.dist.commands:bdist_apps
  2881. [setuptools.finalize_distribution_options]
  2882. build_apps = direct.dist._dist_hooks:finalize_distribution_options
  2883. """
  2884. if not PkgSkip("DIRECT"):
  2885. dist_dir = os.path.join(GetOutputDir(), 'panda3d.dist-info')
  2886. MakeDirectory(dist_dir)
  2887. ConditionalWriteFile(os.path.join(dist_dir, 'METADATA'), METADATA.format(version=VERSION))
  2888. ConditionalWriteFile(os.path.join(dist_dir, 'entry_points.txt'), ENTRY_POINTS)
  2889. ##########################################################################################
  2890. #
  2891. # Generate the PRC files into the ETC directory.
  2892. #
  2893. ##########################################################################################
  2894. confautoprc = ReadFile("makepanda/confauto.in")
  2895. if (PkgSkip("SPEEDTREE")==0):
  2896. # If SpeedTree is available, enable it in the config file
  2897. confautoprc = confautoprc.replace('#st#', '')
  2898. else:
  2899. # otherwise, disable it.
  2900. confautoprc = confautoprc.replace('#st#', '#')
  2901. confautoprc = confautoprc.replace('\r\n', '\n')
  2902. if PkgSkip("ASSIMP") or GetLinkAllStatic():
  2903. confautoprc = confautoprc.replace("load-file-type p3assimp", "#load-file-type p3assimp")
  2904. if PkgSkip("EGG") or GetLinkAllStatic():
  2905. confautoprc = confautoprc.replace("load-file-type egg pandaegg", "#load-file-type egg pandaegg")
  2906. if PkgSkip("PANDATOOL") or PkgSkip("EGG") or GetLinkAllStatic():
  2907. confautoprc = confautoprc.replace("load-file-type p3ptloader", "#load-file-type p3ptloader")
  2908. if PkgSkip("FFMPEG") or GetLinkAllStatic():
  2909. confautoprc = confautoprc.replace("load-audio-type * p3ffmpeg", "#load-audio-type * p3ffmpeg")
  2910. confautoprc = confautoprc.replace("load-video-type * p3ffmpeg", "#load-video-type * p3ffmpeg")
  2911. if (os.path.isfile("makepanda/myconfig.in")):
  2912. configprc = ReadFile("makepanda/myconfig.in")
  2913. else:
  2914. configprc = ReadFile("makepanda/config.in")
  2915. configprc = configprc.replace('\r\n', '\n')
  2916. if (GetTarget() == 'windows'):
  2917. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$USER_APPDATA/Panda3D-%s" % MAJOR_VERSION)
  2918. elif not PkgSkip("X11") and not PkgSkip("GL") and not PkgSkip("EGL") and not GetLinkAllStatic():
  2919. configprc = configprc.replace("#load-display pandadx9", "aux-display p3headlessgl")
  2920. else:
  2921. configprc = configprc.replace("aux-display pandadx9", "")
  2922. if (GetTarget() == 'darwin'):
  2923. configprc = configprc.replace("$XDG_CACHE_HOME/panda3d", "$HOME/Library/Caches/Panda3D-%s" % MAJOR_VERSION)
  2924. # OpenAL is not yet working well on OSX for us, so let's do this for now.
  2925. if not PkgSkip("FMODEX"):
  2926. configprc = configprc.replace("p3openal_audio", "p3fmod_audio")
  2927. if PkgSkip("GL") or GetLinkAllStatic():
  2928. configprc = configprc.replace("\nload-display pandagl", "\n#load-display pandagl")
  2929. if PkgSkip("GLES") or GetLinkAllStatic():
  2930. configprc = configprc.replace("\n#load-display pandagles", "")
  2931. if PkgSkip("DX9") or GetLinkAllStatic():
  2932. configprc = configprc.replace("\n#load-display pandadx9", "")
  2933. if PkgSkip("TINYDISPLAY") or GetLinkAllStatic():
  2934. configprc = configprc.replace("\n#load-display p3tinydisplay", "")
  2935. if PkgSkip("OPENAL") or GetLinkAllStatic():
  2936. configprc = configprc.replace("audio-library-name p3openal_audio", "#audio-library-name p3openal_audio")
  2937. if GetTarget() == 'windows':
  2938. # Convert to Windows newlines.
  2939. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc, newline='\r\n')
  2940. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc, newline='\r\n')
  2941. else:
  2942. ConditionalWriteFile(GetOutputDir()+"/etc/Config.prc", configprc)
  2943. ConditionalWriteFile(GetOutputDir()+"/etc/Confauto.prc", confautoprc)
  2944. ##########################################################################################
  2945. #
  2946. # Copy the precompiled binaries and DLLs into the build.
  2947. #
  2948. ##########################################################################################
  2949. tp_dir = GetThirdpartyDir()
  2950. if tp_dir is not None:
  2951. dylibs = {}
  2952. if GetTarget() == 'darwin':
  2953. # Make a list of all the dylibs we ship, to figure out whether we should use
  2954. # install_name_tool to correct the library reference to point to our copy.
  2955. for pkg in PkgListGet():
  2956. if PkgSkip(pkg):
  2957. continue
  2958. tp_libdir = GetThirdpartyLibDir(pkg)
  2959. for lib in glob.glob(os.path.join(tp_libdir, "*.dylib")):
  2960. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2961. if not PkgSkip("PYTHON"):
  2962. for lib in glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib")):
  2963. dylibs[os.path.basename(lib)] = os.path.basename(os.path.realpath(lib))
  2964. for pkg in PkgListGet():
  2965. if PkgSkip(pkg):
  2966. continue
  2967. tp_pkg = tp_dir + pkg.lower()
  2968. if GetTarget() == 'windows':
  2969. if os.path.exists(tp_pkg + "/bin"):
  2970. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/")
  2971. if (PkgSkip("PYTHON")==0 and os.path.exists(tp_pkg + "/bin/" + SDK["PYTHONVERSION"])):
  2972. CopyAllFiles(GetOutputDir() + "/bin/", tp_pkg + "/bin/" + SDK["PYTHONVERSION"] + "/")
  2973. elif GetTarget() == 'darwin':
  2974. tp_libdir = GetThirdpartyLibDir(pkg)
  2975. tp_libs = glob.glob(os.path.join(tp_libdir, "*.dylib"))
  2976. if not PkgSkip("PYTHON"):
  2977. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.dylib"))
  2978. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.so"))
  2979. if pkg != 'PYTHON':
  2980. tp_libs += glob.glob(os.path.join(tp_libdir, SDK["PYTHONVERSION"], "*.py"))
  2981. for tp_lib in tp_libs:
  2982. basename = os.path.basename(tp_lib)
  2983. if basename.endswith('.dylib'):
  2984. # It's a dynamic link library. Put it in the lib directory.
  2985. target = GetOutputDir() + "/lib/" + basename
  2986. dep_prefix = "@loader_path/../lib/"
  2987. lib_id = dep_prefix + basename
  2988. else:
  2989. # It's a Python module, like _rocketcore.so. Copy it to the root, because
  2990. # nowadays the 'lib' directory may no longer be on the PYTHONPATH.
  2991. target = GetOutputDir() + "/" + basename
  2992. dep_prefix = "@loader_path/lib/"
  2993. lib_id = basename
  2994. if not NeedsBuild([target], [tp_lib]):
  2995. continue
  2996. CopyFile(target, tp_lib)
  2997. if os.path.islink(target) or target.endswith('.py'):
  2998. continue
  2999. # Correct the inter-library dependencies so that the build is relocatable.
  3000. oscmd('install_name_tool -id %s %s' % (lib_id, target))
  3001. oscmd("otool -L %s | grep .dylib > %s/tmp/otool-libs.txt" % (target, GetOutputDir()), True)
  3002. for line in open(GetOutputDir() + "/tmp/otool-libs.txt", "r"):
  3003. line = line.strip()
  3004. if not line or line.startswith(dep_prefix) or line.endswith(":"):
  3005. continue
  3006. libdep = line.split(" ", 1)[0]
  3007. dep_basename = os.path.basename(libdep)
  3008. if dep_basename in dylibs:
  3009. dep_target = dylibs[dep_basename]
  3010. oscmd("install_name_tool -change %s %s%s %s" % (libdep, dep_prefix, dep_target, target), True)
  3011. JustBuilt([target], [tp_lib])
  3012. for fwx in glob.glob(tp_pkg + "/*.framework"):
  3013. MakeDirectory(GetOutputDir() + "/Frameworks")
  3014. CopyTree(GetOutputDir() + "/Frameworks/" + os.path.basename(fwx), fwx)
  3015. else: # Linux / FreeBSD case.
  3016. for tp_lib in glob.glob(tp_pkg + "/lib/*.so*"):
  3017. CopyFile(GetOutputDir() + "/lib/" + os.path.basename(tp_lib), tp_lib)
  3018. if not PkgSkip("PYTHON"):
  3019. for tp_lib in glob.glob(os.path.join(tp_pkg, "lib", SDK["PYTHONVERSION"], "*.so*")):
  3020. base = os.path.basename(tp_lib)
  3021. if base.startswith('lib'):
  3022. CopyFile(GetOutputDir() + "/lib/" + base, tp_lib)
  3023. else:
  3024. # It's a Python module, like _rocketcore.so.
  3025. CopyFile(GetOutputDir() + "/" + base, tp_lib)
  3026. if GetTarget() == 'windows':
  3027. if os.path.isdir(os.path.join(tp_dir, "extras", "bin")):
  3028. CopyAllFiles(GetOutputDir() + "/bin/", tp_dir + "extras/bin/")
  3029. if not PkgSkip("PYTHON") and not RTDIST:
  3030. # We need to copy the Python DLL to the bin directory for now.
  3031. pydll = "/" + SDK["PYTHONVERSION"].replace(".", "")
  3032. if GetOptimize() <= 2:
  3033. pydll += "_d.dll"
  3034. else:
  3035. pydll += ".dll"
  3036. CopyFile(GetOutputDir() + "/bin" + pydll, SDK["PYTHON"] + pydll)
  3037. for fn in glob.glob(SDK["PYTHON"] + "/vcruntime*.dll"):
  3038. CopyFile(GetOutputDir() + "/bin/", fn)
  3039. # Copy the whole Python directory.
  3040. if COPY_PYTHON:
  3041. CopyTree(GetOutputDir() + "/python", SDK["PYTHON"])
  3042. # NB: Python does not always ship with the correct manifest/dll.
  3043. # Figure out the correct one to ship, and grab it from WinSxS dir.
  3044. manifest = GetOutputDir() + '/tmp/python.manifest'
  3045. if os.path.isfile(manifest):
  3046. os.unlink(manifest)
  3047. oscmd('mt -inputresource:"%s\\python.exe";#1 -out:"%s" -nologo' % (SDK["PYTHON"], manifest), True)
  3048. if COPY_PYTHON and os.path.isfile(manifest):
  3049. import xml.etree.ElementTree as ET
  3050. tree = ET.parse(manifest)
  3051. idents = tree.findall('./{urn:schemas-microsoft-com:asm.v1}dependency/{urn:schemas-microsoft-com:asm.v1}dependentAssembly/{urn:schemas-microsoft-com:asm.v1}assemblyIdentity')
  3052. else:
  3053. idents = ()
  3054. for ident in idents:
  3055. sxs_name = '_'.join([
  3056. ident.get('processorArchitecture'),
  3057. ident.get('name').lower(),
  3058. ident.get('publicKeyToken'),
  3059. ident.get('version'),
  3060. ])
  3061. # Find the manifest matching these parameters.
  3062. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', 'Manifests', sxs_name + '_*.manifest')
  3063. manifests = glob.glob(pattern)
  3064. if not manifests:
  3065. Warn("Could not locate manifest %s. You may need to reinstall the Visual C++ Redistributable." % (pattern))
  3066. continue
  3067. CopyFile(GetOutputDir() + "/python/" + ident.get('name') + ".manifest", manifests[0])
  3068. # Also copy the corresponding msvcr dll.
  3069. pattern = os.path.join('C:' + os.sep, 'Windows', 'WinSxS', sxs_name + '_*', 'msvcr*.dll')
  3070. for file in glob.glob(pattern):
  3071. CopyFile(GetOutputDir() + "/python/", file)
  3072. # Copy python.exe to ppython.exe.
  3073. if COPY_PYTHON:
  3074. if not os.path.isfile(SDK["PYTHON"] + "/ppython.exe") and os.path.isfile(SDK["PYTHON"] + "/python.exe"):
  3075. CopyFile(GetOutputDir() + "/python/ppython.exe", SDK["PYTHON"] + "/python.exe")
  3076. if not os.path.isfile(SDK["PYTHON"] + "/ppythonw.exe") and os.path.isfile(SDK["PYTHON"] + "/pythonw.exe"):
  3077. CopyFile(GetOutputDir() + "/python/ppythonw.exe", SDK["PYTHON"] + "/pythonw.exe")
  3078. ConditionalWriteFile(GetOutputDir() + "/python/panda.pth", "..\n../bin\n")
  3079. # Copy over the MSVC runtime.
  3080. if GetTarget() == 'windows' and "VISUALSTUDIO" in SDK:
  3081. vcver = "%s%s" % (SDK["MSVC_VERSION"][0], 0) # ignore minor version.
  3082. crtname = "Microsoft.VC%s.CRT" % (vcver)
  3083. if ("VCTOOLSVERSION" in SDK):
  3084. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "Redist", "MSVC", SDK["VCTOOLSVERSION"], "onecore", GetTargetArch(), crtname)
  3085. else:
  3086. dir = os.path.join(SDK["VISUALSTUDIO"], "VC", "redist", GetTargetArch(), crtname)
  3087. if os.path.isfile(os.path.join(dir, "msvcr" + vcver + ".dll")):
  3088. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcr" + vcver + ".dll"))
  3089. if os.path.isfile(os.path.join(dir, "msvcp" + vcver + ".dll")):
  3090. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "msvcp" + vcver + ".dll"))
  3091. if os.path.isfile(os.path.join(dir, "vcruntime" + vcver + ".dll")):
  3092. CopyFile(GetOutputDir() + "/bin/", os.path.join(dir, "vcruntime" + vcver + ".dll"))
  3093. ########################################################################
  3094. ##
  3095. ## Copy various stuff into the build.
  3096. ##
  3097. ########################################################################
  3098. if GetTarget() == 'windows':
  3099. # Convert to Windows newlines so they can be opened by notepad.
  3100. WriteFile(GetOutputDir() + "/LICENSE", ReadFile("doc/LICENSE"), newline='\r\n')
  3101. WriteFile(GetOutputDir() + "/ReleaseNotes", ReadFile("doc/ReleaseNotes"), newline='\r\n')
  3102. CopyFile(GetOutputDir() + "/pandaIcon.ico", "panda/src/configfiles/pandaIcon.ico")
  3103. else:
  3104. CopyFile(GetOutputDir()+"/", "doc/LICENSE")
  3105. CopyFile(GetOutputDir()+"/", "doc/ReleaseNotes")
  3106. if (PkgSkip("PANDATOOL")==0):
  3107. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".mel")
  3108. CopyAllFiles(GetOutputDir()+"/plugins/", "pandatool/src/scripts/", ".ms")
  3109. if (PkgSkip("PYTHON")==0 and os.path.isdir(GetThirdpartyBase()+"/Pmw")):
  3110. CopyTree(GetOutputDir()+'/Pmw', GetThirdpartyBase()+'/Pmw')
  3111. ConditionalWriteFile(GetOutputDir()+'/include/ctl3d.h', '/* dummy file to make MAX happy */')
  3112. # Since Eigen is included by all sorts of core headers, as a convenience
  3113. # to C++ users on Win and Mac, we include it in the Panda include directory.
  3114. if not PkgSkip("EIGEN") and GetTarget() in ("windows", "darwin") and GetThirdpartyDir():
  3115. CopyTree(GetOutputDir()+'/include/Eigen', GetThirdpartyDir()+'eigen/include/Eigen')
  3116. ########################################################################
  3117. #
  3118. # Copy header files to the built/include/parser-inc directory.
  3119. #
  3120. ########################################################################
  3121. CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc')
  3122. DeleteVCS(GetOutputDir()+'/include/parser-inc')
  3123. ########################################################################
  3124. #
  3125. # Transfer all header files to the built/include directory.
  3126. #
  3127. ########################################################################
  3128. CopyAllHeaders('dtool/src/dtoolbase')
  3129. CopyAllHeaders('dtool/src/dtoolutil', skip=["pandaVersion.h", "checkPandaVersion.h"])
  3130. CopyFile(GetOutputDir()+'/include/','dtool/src/dtoolutil/vector_src.cxx')
  3131. CopyAllHeaders('dtool/metalibs/dtool')
  3132. CopyAllHeaders('dtool/src/cppparser')
  3133. CopyAllHeaders('dtool/src/prc', skip=["prc_parameters.h"])
  3134. CopyAllHeaders('dtool/src/dconfig')
  3135. CopyAllHeaders('dtool/src/interrogatedb')
  3136. CopyAllHeaders('dtool/metalibs/dtoolconfig')
  3137. CopyAllHeaders('dtool/src/pystub')
  3138. CopyAllHeaders('dtool/src/interrogate')
  3139. CopyAllHeaders('dtool/src/test_interrogate')
  3140. CopyAllHeaders('panda/src/putil')
  3141. CopyAllHeaders('panda/src/pandabase')
  3142. CopyAllHeaders('panda/src/express')
  3143. CopyAllHeaders('panda/src/downloader')
  3144. CopyAllHeaders('panda/metalibs/pandaexpress')
  3145. CopyAllHeaders('panda/src/pipeline')
  3146. CopyAllHeaders('panda/src/linmath')
  3147. CopyAllHeaders('panda/src/putil')
  3148. CopyAllHeaders('dtool/src/prckeys')
  3149. CopyAllHeaders('panda/src/audio')
  3150. CopyAllHeaders('panda/src/event')
  3151. CopyAllHeaders('panda/src/mathutil')
  3152. CopyAllHeaders('panda/src/gsgbase')
  3153. CopyAllHeaders('panda/src/pnmimage')
  3154. CopyAllHeaders('panda/src/nativenet')
  3155. CopyAllHeaders('panda/src/net')
  3156. CopyAllHeaders('panda/src/pstatclient')
  3157. CopyAllHeaders('panda/src/gobj')
  3158. CopyAllHeaders('panda/src/movies')
  3159. CopyAllHeaders('panda/src/pgraphnodes')
  3160. CopyAllHeaders('panda/src/pgraph')
  3161. CopyAllHeaders('panda/src/cull')
  3162. CopyAllHeaders('panda/src/display')
  3163. CopyAllHeaders('panda/src/chan')
  3164. CopyAllHeaders('panda/src/char')
  3165. CopyAllHeaders('panda/src/dgraph')
  3166. CopyAllHeaders('panda/src/device')
  3167. CopyAllHeaders('panda/src/pnmtext')
  3168. CopyAllHeaders('panda/src/text')
  3169. CopyAllHeaders('panda/src/grutil')
  3170. if (PkgSkip("VISION")==0):
  3171. CopyAllHeaders('panda/src/vision')
  3172. if (PkgSkip("FFMPEG")==0):
  3173. CopyAllHeaders('panda/src/ffmpeg')
  3174. CopyAllHeaders('panda/src/tform')
  3175. CopyAllHeaders('panda/src/collide')
  3176. CopyAllHeaders('panda/src/parametrics')
  3177. CopyAllHeaders('panda/src/pgui')
  3178. CopyAllHeaders('panda/src/pnmimagetypes')
  3179. CopyAllHeaders('panda/src/recorder')
  3180. if (PkgSkip("ROCKET")==0):
  3181. CopyAllHeaders('panda/src/rocket')
  3182. if (PkgSkip("VRPN")==0):
  3183. CopyAllHeaders('panda/src/vrpn')
  3184. CopyAllHeaders('panda/src/wgldisplay')
  3185. CopyAllHeaders('panda/src/ode')
  3186. CopyAllHeaders('panda/metalibs/pandaode')
  3187. if (PkgSkip("PANDAPHYSICS")==0):
  3188. CopyAllHeaders('panda/src/physics')
  3189. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  3190. CopyAllHeaders('panda/src/particlesystem')
  3191. CopyAllHeaders('panda/src/dxml')
  3192. CopyAllHeaders('panda/metalibs/panda')
  3193. CopyAllHeaders('panda/src/audiotraits')
  3194. CopyAllHeaders('panda/src/audiotraits')
  3195. CopyAllHeaders('panda/src/distort')
  3196. CopyAllHeaders('panda/src/downloadertools')
  3197. CopyAllHeaders('panda/src/windisplay')
  3198. CopyAllHeaders('panda/src/dxgsg9')
  3199. CopyAllHeaders('panda/metalibs/pandadx9')
  3200. if not PkgSkip("EGG"):
  3201. CopyAllHeaders('panda/src/egg')
  3202. CopyAllHeaders('panda/src/egg2pg')
  3203. CopyAllHeaders('panda/src/framework')
  3204. CopyAllHeaders('panda/metalibs/pandafx')
  3205. CopyAllHeaders('panda/src/glstuff')
  3206. CopyAllHeaders('panda/src/glgsg')
  3207. CopyAllHeaders('panda/src/glesgsg')
  3208. CopyAllHeaders('panda/src/gles2gsg')
  3209. if not PkgSkip("EGG"):
  3210. CopyAllHeaders('panda/metalibs/pandaegg')
  3211. if GetTarget() == 'windows':
  3212. CopyAllHeaders('panda/src/wgldisplay')
  3213. elif GetTarget() == 'darwin':
  3214. CopyAllHeaders('panda/src/osxdisplay')
  3215. CopyAllHeaders('panda/src/cocoadisplay')
  3216. elif GetTarget() == 'android':
  3217. CopyAllHeaders('panda/src/android')
  3218. CopyAllHeaders('panda/src/androiddisplay')
  3219. if not PkgSkip('X11'):
  3220. CopyAllHeaders('panda/src/x11display')
  3221. if not PkgSkip('GL'):
  3222. CopyAllHeaders('panda/src/glxdisplay')
  3223. CopyAllHeaders('panda/src/egldisplay')
  3224. CopyAllHeaders('panda/metalibs/pandagl')
  3225. CopyAllHeaders('panda/metalibs/pandagles')
  3226. CopyAllHeaders('panda/metalibs/pandagles2')
  3227. CopyAllHeaders('panda/metalibs/pandaphysics')
  3228. CopyAllHeaders('panda/src/testbed')
  3229. if (PkgSkip("PHYSX")==0):
  3230. CopyAllHeaders('panda/src/physx')
  3231. CopyAllHeaders('panda/metalibs/pandaphysx')
  3232. if (PkgSkip("BULLET")==0):
  3233. CopyAllHeaders('panda/src/bullet')
  3234. CopyAllHeaders('panda/metalibs/pandabullet')
  3235. if (PkgSkip("SPEEDTREE")==0):
  3236. CopyAllHeaders('panda/src/speedtree')
  3237. if (PkgSkip("DIRECT")==0):
  3238. CopyAllHeaders('direct/src/directbase')
  3239. CopyAllHeaders('direct/src/dcparser')
  3240. CopyAllHeaders('direct/src/deadrec')
  3241. CopyAllHeaders('direct/src/distributed')
  3242. CopyAllHeaders('direct/src/interval')
  3243. CopyAllHeaders('direct/src/showbase')
  3244. CopyAllHeaders('direct/src/motiontrail')
  3245. CopyAllHeaders('direct/src/dcparse')
  3246. if (RUNTIME or RTDIST):
  3247. CopyAllHeaders('direct/src/plugin', skip=["p3d_plugin_config.h"])
  3248. if (RUNTIME):
  3249. CopyAllHeaders('direct/src/plugin_npapi')
  3250. CopyAllHeaders('direct/src/plugin_standalone')
  3251. if (PkgSkip("PANDATOOL")==0):
  3252. CopyAllHeaders('pandatool/src/pandatoolbase')
  3253. CopyAllHeaders('pandatool/src/converter')
  3254. CopyAllHeaders('pandatool/src/progbase')
  3255. CopyAllHeaders('pandatool/src/eggbase')
  3256. CopyAllHeaders('pandatool/src/bam')
  3257. CopyAllHeaders('pandatool/src/cvscopy')
  3258. CopyAllHeaders('pandatool/src/daeegg')
  3259. CopyAllHeaders('pandatool/src/daeprogs')
  3260. CopyAllHeaders('pandatool/src/dxf')
  3261. CopyAllHeaders('pandatool/src/dxfegg')
  3262. CopyAllHeaders('pandatool/src/dxfprogs')
  3263. CopyAllHeaders('pandatool/src/palettizer')
  3264. CopyAllHeaders('pandatool/src/egg-mkfont')
  3265. CopyAllHeaders('pandatool/src/eggcharbase')
  3266. CopyAllHeaders('pandatool/src/egg-optchar')
  3267. CopyAllHeaders('pandatool/src/egg-palettize')
  3268. CopyAllHeaders('pandatool/src/egg-qtess')
  3269. CopyAllHeaders('pandatool/src/eggprogs')
  3270. CopyAllHeaders('pandatool/src/flt')
  3271. CopyAllHeaders('pandatool/src/fltegg')
  3272. CopyAllHeaders('pandatool/src/fltprogs')
  3273. CopyAllHeaders('pandatool/src/imagebase')
  3274. CopyAllHeaders('pandatool/src/imageprogs')
  3275. CopyAllHeaders('pandatool/src/pfmprogs')
  3276. CopyAllHeaders('pandatool/src/lwo')
  3277. CopyAllHeaders('pandatool/src/lwoegg')
  3278. CopyAllHeaders('pandatool/src/lwoprogs')
  3279. CopyAllHeaders('pandatool/src/maya')
  3280. CopyAllHeaders('pandatool/src/mayaegg')
  3281. CopyAllHeaders('pandatool/src/maxegg')
  3282. CopyAllHeaders('pandatool/src/maxprogs')
  3283. CopyAllHeaders('pandatool/src/objegg')
  3284. CopyAllHeaders('pandatool/src/objprogs')
  3285. CopyAllHeaders('pandatool/src/vrml')
  3286. CopyAllHeaders('pandatool/src/vrmlegg')
  3287. CopyAllHeaders('pandatool/src/xfile')
  3288. CopyAllHeaders('pandatool/src/xfileegg')
  3289. CopyAllHeaders('pandatool/src/ptloader')
  3290. CopyAllHeaders('pandatool/src/miscprogs')
  3291. CopyAllHeaders('pandatool/src/pstatserver')
  3292. CopyAllHeaders('pandatool/src/text-stats')
  3293. CopyAllHeaders('pandatool/src/vrmlprogs')
  3294. CopyAllHeaders('pandatool/src/win-stats')
  3295. CopyAllHeaders('pandatool/src/xfileprogs')
  3296. if (PkgSkip("CONTRIB")==0):
  3297. CopyAllHeaders('contrib/src/contribbase')
  3298. CopyAllHeaders('contrib/src/ai')
  3299. ########################################################################
  3300. #
  3301. # These definitions are syntactic shorthand. They make it easy
  3302. # to link with the usual libraries without listing them all.
  3303. #
  3304. ########################################################################
  3305. COMMON_DTOOL_LIBS=[
  3306. 'libp3dtool.dll',
  3307. 'libp3dtoolconfig.dll',
  3308. ]
  3309. COMMON_PANDA_LIBS=[
  3310. 'libpanda.dll',
  3311. 'libpandaexpress.dll'
  3312. ] + COMMON_DTOOL_LIBS
  3313. COMMON_EGG2X_LIBS=[
  3314. 'libp3eggbase.lib',
  3315. 'libp3progbase.lib',
  3316. 'libp3converter.lib',
  3317. 'libp3pandatoolbase.lib',
  3318. 'libpandaegg.dll',
  3319. ] + COMMON_PANDA_LIBS
  3320. ########################################################################
  3321. #
  3322. # This section contains a list of all the files that need to be compiled.
  3323. #
  3324. ########################################################################
  3325. print("Generating dependencies...")
  3326. sys.stdout.flush()
  3327. #
  3328. # Compile Panda icon resource file.
  3329. # We do it first because we need it at
  3330. # the time we compile an executable.
  3331. #
  3332. if GetTarget() == 'windows':
  3333. OPTS=['DIR:panda/src/configfiles']
  3334. TargetAdd('pandaIcon.res', opts=OPTS, input='pandaIcon.rc')
  3335. #
  3336. # DIRECTORY: dtool/src/dtoolbase/
  3337. #
  3338. OPTS=['DIR:dtool/src/dtoolbase', 'BUILDING:DTOOL', 'MIMALLOC']
  3339. TargetAdd('p3dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  3340. TargetAdd('p3dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  3341. TargetAdd('p3dtoolbase_lookup3.obj', opts=OPTS, input='lookup3.c')
  3342. TargetAdd('p3dtoolbase_indent.obj', opts=OPTS, input='indent.cxx')
  3343. #
  3344. # DIRECTORY: dtool/src/dtoolutil/
  3345. #
  3346. OPTS=['DIR:dtool/src/dtoolutil', 'BUILDING:DTOOL']
  3347. TargetAdd('p3dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  3348. TargetAdd('p3dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  3349. if GetTarget() == 'darwin':
  3350. TargetAdd('p3dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  3351. #
  3352. # DIRECTORY: dtool/metalibs/dtool/
  3353. #
  3354. OPTS=['DIR:dtool/metalibs/dtool', 'BUILDING:DTOOL']
  3355. TargetAdd('p3dtool_dtool.obj', opts=OPTS, input='dtool.cxx')
  3356. TargetAdd('libp3dtool.dll', input='p3dtool_dtool.obj')
  3357. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite1.obj')
  3358. TargetAdd('libp3dtool.dll', input='p3dtoolutil_composite2.obj')
  3359. if GetTarget() == 'darwin':
  3360. TargetAdd('libp3dtool.dll', input='p3dtoolutil_filename_assist.obj')
  3361. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite1.obj')
  3362. TargetAdd('libp3dtool.dll', input='p3dtoolbase_composite2.obj')
  3363. TargetAdd('libp3dtool.dll', input='p3dtoolbase_indent.obj')
  3364. TargetAdd('libp3dtool.dll', input='p3dtoolbase_lookup3.obj')
  3365. TargetAdd('libp3dtool.dll', opts=['ADVAPI','WINSHELL','WINKERNEL','MIMALLOC'])
  3366. #
  3367. # DIRECTORY: dtool/src/cppparser/
  3368. #
  3369. if (not RUNTIME):
  3370. OPTS=['DIR:dtool/src/cppparser', 'BISONPREFIX_cppyy']
  3371. CreateFile(GetOutputDir()+"/include/cppBison.h")
  3372. TargetAdd('p3cppParser_cppBison.obj', opts=OPTS, input='cppBison.yxx')
  3373. TargetAdd('cppBison.h', input='p3cppParser_cppBison.obj', opts=['DEPENDENCYONLY'])
  3374. TargetAdd('p3cppParser_composite1.obj', opts=OPTS, input='p3cppParser_composite1.cxx')
  3375. TargetAdd('p3cppParser_composite2.obj', opts=OPTS, input='p3cppParser_composite2.cxx')
  3376. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite1.obj')
  3377. TargetAdd('libp3cppParser.ilb', input='p3cppParser_composite2.obj')
  3378. TargetAdd('libp3cppParser.ilb', input='p3cppParser_cppBison.obj')
  3379. #
  3380. # DIRECTORY: dtool/src/prc/
  3381. #
  3382. OPTS=['DIR:dtool/src/prc', 'BUILDING:DTOOLCONFIG', 'OPENSSL']
  3383. TargetAdd('p3prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  3384. TargetAdd('p3prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  3385. #
  3386. # DIRECTORY: dtool/metalibs/dtoolconfig/
  3387. #
  3388. OPTS=['DIR:dtool/metalibs/dtoolconfig', 'BUILDING:DTOOLCONFIG']
  3389. TargetAdd('p3dtoolconfig_dtoolconfig.obj', opts=OPTS, input='dtoolconfig.cxx')
  3390. TargetAdd('libp3dtoolconfig.dll', input='p3dtoolconfig_dtoolconfig.obj')
  3391. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite1.obj')
  3392. TargetAdd('libp3dtoolconfig.dll', input='p3prc_composite2.obj')
  3393. TargetAdd('libp3dtoolconfig.dll', input='libp3dtool.dll')
  3394. TargetAdd('libp3dtoolconfig.dll', opts=['ADVAPI', 'OPENSSL', 'WINGDI', 'WINUSER'])
  3395. #
  3396. # DIRECTORY: dtool/src/interrogatedb/
  3397. #
  3398. OPTS=['DIR:dtool/src/interrogatedb', 'BUILDING:INTERROGATEDB']
  3399. TargetAdd('p3interrogatedb_composite1.obj', opts=OPTS, input='p3interrogatedb_composite1.cxx')
  3400. TargetAdd('p3interrogatedb_composite2.obj', opts=OPTS, input='p3interrogatedb_composite2.cxx')
  3401. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite1.obj')
  3402. TargetAdd('libp3interrogatedb.dll', input='p3interrogatedb_composite2.obj')
  3403. TargetAdd('libp3interrogatedb.dll', input='libp3dtool.dll')
  3404. TargetAdd('libp3interrogatedb.dll', input='libp3dtoolconfig.dll')
  3405. # This used to be called dtoolconfig.pyd, but it just contains the interrogatedb
  3406. # stuff, so it has been renamed appropriately.
  3407. OPTS=['DIR:dtool/metalibs/dtoolconfig']
  3408. PyTargetAdd('interrogatedb_pydtool.obj', opts=OPTS, input="pydtool.cxx")
  3409. PyTargetAdd('interrogatedb.pyd', input='interrogatedb_pydtool.obj')
  3410. PyTargetAdd('interrogatedb.pyd', input='libp3dtool.dll')
  3411. PyTargetAdd('interrogatedb.pyd', input='libp3dtoolconfig.dll')
  3412. PyTargetAdd('interrogatedb.pyd', input='libp3interrogatedb.dll')
  3413. #
  3414. # DIRECTORY: dtool/src/pystub/
  3415. #
  3416. if not RUNTIME and not RTDIST:
  3417. OPTS=['DIR:dtool/src/pystub']
  3418. TargetAdd('p3pystub_pystub.obj', opts=OPTS, input='pystub.cxx')
  3419. TargetAdd('libp3pystub.lib', input='p3pystub_pystub.obj')
  3420. #TargetAdd('libp3pystub.lib', input='libp3dtool.dll')
  3421. TargetAdd('libp3pystub.lib', opts=['ADVAPI'])
  3422. #
  3423. # DIRECTORY: dtool/src/interrogate/
  3424. #
  3425. if (not RUNTIME):
  3426. OPTS=['DIR:dtool/src/interrogate', 'DIR:dtool/src/cppparser', 'DIR:dtool/src/interrogatedb']
  3427. TargetAdd('interrogate_composite1.obj', opts=OPTS, input='interrogate_composite1.cxx')
  3428. TargetAdd('interrogate_composite2.obj', opts=OPTS, input='interrogate_composite2.cxx')
  3429. TargetAdd('interrogate.exe', input='interrogate_composite1.obj')
  3430. TargetAdd('interrogate.exe', input='interrogate_composite2.obj')
  3431. TargetAdd('interrogate.exe', input='libp3cppParser.ilb')
  3432. TargetAdd('interrogate.exe', input=COMMON_DTOOL_LIBS)
  3433. TargetAdd('interrogate.exe', input='libp3interrogatedb.dll')
  3434. TargetAdd('interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3435. preamble = WriteEmbeddedStringFile('interrogate_preamble_python_native', inputs=[
  3436. 'dtool/src/interrogatedb/py_panda.cxx',
  3437. 'dtool/src/interrogatedb/py_compat.cxx',
  3438. 'dtool/src/interrogatedb/py_wrappers.cxx',
  3439. 'dtool/src/interrogatedb/dtool_super_base.cxx',
  3440. ])
  3441. TargetAdd('interrogate_module_preamble_python_native.obj', opts=OPTS, input=preamble)
  3442. TargetAdd('interrogate_module_interrogate_module.obj', opts=OPTS, input='interrogate_module.cxx')
  3443. TargetAdd('interrogate_module.exe', input='interrogate_module_interrogate_module.obj')
  3444. TargetAdd('interrogate_module.exe', input='interrogate_module_preamble_python_native.obj')
  3445. TargetAdd('interrogate_module.exe', input='libp3cppParser.ilb')
  3446. TargetAdd('interrogate_module.exe', input=COMMON_DTOOL_LIBS)
  3447. TargetAdd('interrogate_module.exe', input='libp3interrogatedb.dll')
  3448. TargetAdd('interrogate_module.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3449. if (not RTDIST):
  3450. TargetAdd('parse_file_parse_file.obj', opts=OPTS, input='parse_file.cxx')
  3451. TargetAdd('parse_file.exe', input='parse_file_parse_file.obj')
  3452. TargetAdd('parse_file.exe', input='libp3cppParser.ilb')
  3453. TargetAdd('parse_file.exe', input=COMMON_DTOOL_LIBS)
  3454. TargetAdd('parse_file.exe', input='libp3interrogatedb.dll')
  3455. TargetAdd('parse_file.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3456. #
  3457. # DIRECTORY: dtool/src/prckeys/
  3458. #
  3459. if (PkgSkip("OPENSSL")==0 and not RUNTIME and not RTDIST):
  3460. OPTS=['DIR:dtool/src/prckeys', 'OPENSSL']
  3461. TargetAdd('make-prc-key_makePrcKey.obj', opts=OPTS, input='makePrcKey.cxx')
  3462. TargetAdd('make-prc-key.exe', input='make-prc-key_makePrcKey.obj')
  3463. TargetAdd('make-prc-key.exe', input=COMMON_DTOOL_LIBS)
  3464. TargetAdd('make-prc-key.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3465. #
  3466. # DIRECTORY: dtool/src/test_interrogate/
  3467. #
  3468. if (not RTDIST and not RUNTIME):
  3469. OPTS=['DIR:dtool/src/test_interrogate']
  3470. TargetAdd('test_interrogate_test_interrogate.obj', opts=OPTS, input='test_interrogate.cxx')
  3471. TargetAdd('test_interrogate.exe', input='test_interrogate_test_interrogate.obj')
  3472. TargetAdd('test_interrogate.exe', input='libp3interrogatedb.dll')
  3473. TargetAdd('test_interrogate.exe', input=COMMON_DTOOL_LIBS)
  3474. TargetAdd('test_interrogate.exe', opts=['ADVAPI', 'WINSHELL', 'WINGDI', 'WINUSER'])
  3475. #
  3476. # DIRECTORY: dtool/src/dtoolbase/
  3477. #
  3478. OPTS=['DIR:dtool/src/dtoolbase']
  3479. IGATEFILES=GetDirectoryContents('dtool/src/dtoolbase', ["*_composite*.cxx"])
  3480. IGATEFILES += [
  3481. "typeHandle.h",
  3482. "typeHandle_ext.h",
  3483. "typeRegistry.h",
  3484. "typedObject.h",
  3485. "neverFreeMemory.h",
  3486. ]
  3487. TargetAdd('libp3dtoolbase.in', opts=OPTS, input=IGATEFILES)
  3488. TargetAdd('libp3dtoolbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolbase', 'SRCDIR:dtool/src/dtoolbase'])
  3489. PyTargetAdd('p3dtoolbase_typeHandle_ext.obj', opts=OPTS, input='typeHandle_ext.cxx')
  3490. #
  3491. # DIRECTORY: dtool/src/dtoolutil/
  3492. #
  3493. OPTS=['DIR:dtool/src/dtoolutil']
  3494. IGATEFILES=GetDirectoryContents('dtool/src/dtoolutil', ["*_composite*.cxx"])
  3495. IGATEFILES += [
  3496. "config_dtoolutil.h",
  3497. "pandaSystem.h",
  3498. "dSearchPath.h",
  3499. "executionEnvironment.h",
  3500. "textEncoder.h",
  3501. "textEncoder_ext.h",
  3502. "filename.h",
  3503. "filename_ext.h",
  3504. "globPattern.h",
  3505. "globPattern_ext.h",
  3506. "pandaFileStream.h",
  3507. "lineStream.h",
  3508. ]
  3509. TargetAdd('libp3dtoolutil.in', opts=OPTS, input=IGATEFILES)
  3510. TargetAdd('libp3dtoolutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dtoolutil', 'SRCDIR:dtool/src/dtoolutil'])
  3511. PyTargetAdd('p3dtoolutil_ext_composite.obj', opts=OPTS, input='p3dtoolutil_ext_composite.cxx')
  3512. #
  3513. # DIRECTORY: dtool/src/prc/
  3514. #
  3515. OPTS=['DIR:dtool/src/prc']
  3516. IGATEFILES=GetDirectoryContents('dtool/src/prc', ["*.h", "*_composite*.cxx"])
  3517. TargetAdd('libp3prc.in', opts=OPTS, input=IGATEFILES)
  3518. TargetAdd('libp3prc.in', opts=['IMOD:panda3d.core', 'ILIB:libp3prc', 'SRCDIR:dtool/src/prc'])
  3519. PyTargetAdd('p3prc_ext_composite.obj', opts=OPTS, input='p3prc_ext_composite.cxx')
  3520. #
  3521. # DIRECTORY: panda/src/pandabase/
  3522. #
  3523. OPTS=['DIR:panda/src/pandabase', 'BUILDING:PANDAEXPRESS']
  3524. TargetAdd('p3pandabase_pandabase.obj', opts=OPTS, input='pandabase.cxx')
  3525. #
  3526. # DIRECTORY: panda/src/express/
  3527. #
  3528. OPTS=['DIR:panda/src/express', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3529. TargetAdd('p3express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  3530. TargetAdd('p3express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  3531. OPTS=['DIR:panda/src/express', 'OPENSSL', 'ZLIB']
  3532. IGATEFILES=GetDirectoryContents('panda/src/express', ["*.h", "*_composite*.cxx"])
  3533. TargetAdd('libp3express.in', opts=OPTS, input=IGATEFILES)
  3534. TargetAdd('libp3express.in', opts=['IMOD:panda3d.core', 'ILIB:libp3express', 'SRCDIR:panda/src/express'])
  3535. PyTargetAdd('p3express_ext_composite.obj', opts=OPTS, input='p3express_ext_composite.cxx')
  3536. #
  3537. # DIRECTORY: panda/src/downloader/
  3538. #
  3539. OPTS=['DIR:panda/src/downloader', 'BUILDING:PANDAEXPRESS', 'OPENSSL', 'ZLIB']
  3540. TargetAdd('p3downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  3541. TargetAdd('p3downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  3542. OPTS=['DIR:panda/src/downloader', 'OPENSSL', 'ZLIB']
  3543. IGATEFILES=GetDirectoryContents('panda/src/downloader', ["*.h", "*_composite*.cxx"])
  3544. TargetAdd('libp3downloader.in', opts=OPTS, input=IGATEFILES)
  3545. TargetAdd('libp3downloader.in', opts=['IMOD:panda3d.core', 'ILIB:libp3downloader', 'SRCDIR:panda/src/downloader'])
  3546. PyTargetAdd('p3downloader_stringStream_ext.obj', opts=OPTS, input='stringStream_ext.cxx')
  3547. #
  3548. # DIRECTORY: panda/metalibs/pandaexpress/
  3549. #
  3550. OPTS=['DIR:panda/metalibs/pandaexpress', 'BUILDING:PANDAEXPRESS', 'ZLIB']
  3551. TargetAdd('pandaexpress_pandaexpress.obj', opts=OPTS, input='pandaexpress.cxx')
  3552. TargetAdd('libpandaexpress.dll', input='pandaexpress_pandaexpress.obj')
  3553. TargetAdd('libpandaexpress.dll', input='p3downloader_composite1.obj')
  3554. TargetAdd('libpandaexpress.dll', input='p3downloader_composite2.obj')
  3555. TargetAdd('libpandaexpress.dll', input='p3express_composite1.obj')
  3556. TargetAdd('libpandaexpress.dll', input='p3express_composite2.obj')
  3557. TargetAdd('libpandaexpress.dll', input='p3pandabase_pandabase.obj')
  3558. TargetAdd('libpandaexpress.dll', input=COMMON_DTOOL_LIBS)
  3559. TargetAdd('libpandaexpress.dll', opts=['ADVAPI', 'WINSOCK2', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'ANDROID'])
  3560. #
  3561. # DIRECTORY: panda/src/pipeline/
  3562. #
  3563. if (not RUNTIME):
  3564. OPTS=['DIR:panda/src/pipeline', 'BUILDING:PANDA']
  3565. TargetAdd('p3pipeline_composite1.obj', opts=OPTS, input='p3pipeline_composite1.cxx')
  3566. TargetAdd('p3pipeline_composite2.obj', opts=OPTS, input='p3pipeline_composite2.cxx')
  3567. TargetAdd('p3pipeline_contextSwitch.obj', opts=OPTS, input='contextSwitch.c')
  3568. OPTS=['DIR:panda/src/pipeline']
  3569. IGATEFILES=GetDirectoryContents('panda/src/pipeline', ["*.h", "*_composite*.cxx"])
  3570. TargetAdd('libp3pipeline.in', opts=OPTS, input=IGATEFILES)
  3571. TargetAdd('libp3pipeline.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pipeline', 'SRCDIR:panda/src/pipeline'])
  3572. PyTargetAdd('p3pipeline_pythonThread.obj', opts=OPTS, input='pythonThread.cxx')
  3573. #
  3574. # DIRECTORY: panda/src/linmath/
  3575. #
  3576. if (not RUNTIME):
  3577. OPTS=['DIR:panda/src/linmath', 'BUILDING:PANDA']
  3578. TargetAdd('p3linmath_composite1.obj', opts=OPTS, input='p3linmath_composite1.cxx')
  3579. TargetAdd('p3linmath_composite2.obj', opts=OPTS, input='p3linmath_composite2.cxx')
  3580. OPTS=['DIR:panda/src/linmath']
  3581. IGATEFILES=GetDirectoryContents('panda/src/linmath', ["*.h", "*_composite*.cxx"])
  3582. for ifile in IGATEFILES[:]:
  3583. if "_src." in ifile:
  3584. IGATEFILES.remove(ifile)
  3585. IGATEFILES.remove('cast_to_double.h')
  3586. IGATEFILES.remove('lmat_ops.h')
  3587. IGATEFILES.remove('cast_to_float.h')
  3588. TargetAdd('libp3linmath.in', opts=OPTS, input=IGATEFILES)
  3589. TargetAdd('libp3linmath.in', opts=['IMOD:panda3d.core', 'ILIB:libp3linmath', 'SRCDIR:panda/src/linmath'])
  3590. #
  3591. # DIRECTORY: panda/src/putil/
  3592. #
  3593. if (not RUNTIME):
  3594. OPTS=['DIR:panda/src/putil', 'BUILDING:PANDA', 'ZLIB']
  3595. TargetAdd('p3putil_composite1.obj', opts=OPTS, input='p3putil_composite1.cxx')
  3596. TargetAdd('p3putil_composite2.obj', opts=OPTS, input='p3putil_composite2.cxx')
  3597. OPTS=['DIR:panda/src/putil', 'ZLIB']
  3598. IGATEFILES=GetDirectoryContents('panda/src/putil', ["*.h", "*_composite*.cxx"])
  3599. IGATEFILES.remove("test_bam.h")
  3600. IGATEFILES.remove("config_util.h")
  3601. TargetAdd('libp3putil.in', opts=OPTS, input=IGATEFILES)
  3602. TargetAdd('libp3putil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3putil', 'SRCDIR:panda/src/putil'])
  3603. PyTargetAdd('p3putil_ext_composite.obj', opts=OPTS, input='p3putil_ext_composite.cxx')
  3604. #
  3605. # DIRECTORY: panda/src/audio/
  3606. #
  3607. if (not RUNTIME):
  3608. OPTS=['DIR:panda/src/audio', 'BUILDING:PANDA']
  3609. TargetAdd('p3audio_composite1.obj', opts=OPTS, input='p3audio_composite1.cxx')
  3610. OPTS=['DIR:panda/src/audio']
  3611. IGATEFILES=["audio.h"]
  3612. TargetAdd('libp3audio.in', opts=OPTS, input=IGATEFILES)
  3613. TargetAdd('libp3audio.in', opts=['IMOD:panda3d.core', 'ILIB:libp3audio', 'SRCDIR:panda/src/audio'])
  3614. #
  3615. # DIRECTORY: panda/src/event/
  3616. #
  3617. if (not RUNTIME):
  3618. OPTS=['DIR:panda/src/event', 'BUILDING:PANDA']
  3619. TargetAdd('p3event_composite1.obj', opts=OPTS, input='p3event_composite1.cxx')
  3620. TargetAdd('p3event_composite2.obj', opts=OPTS, input='p3event_composite2.cxx')
  3621. OPTS=['DIR:panda/src/event']
  3622. PyTargetAdd('p3event_asyncFuture_ext.obj', opts=OPTS, input='asyncFuture_ext.cxx')
  3623. PyTargetAdd('p3event_pythonTask.obj', opts=OPTS, input='pythonTask.cxx')
  3624. IGATEFILES=GetDirectoryContents('panda/src/event', ["*.h", "*_composite*.cxx"])
  3625. TargetAdd('libp3event.in', opts=OPTS, input=IGATEFILES)
  3626. TargetAdd('libp3event.in', opts=['IMOD:panda3d.core', 'ILIB:libp3event', 'SRCDIR:panda/src/event'])
  3627. #
  3628. # DIRECTORY: panda/src/mathutil/
  3629. #
  3630. if (not RUNTIME):
  3631. OPTS=['DIR:panda/src/mathutil', 'BUILDING:PANDA', 'FFTW']
  3632. TargetAdd('p3mathutil_composite1.obj', opts=OPTS, input='p3mathutil_composite1.cxx')
  3633. TargetAdd('p3mathutil_composite2.obj', opts=OPTS, input='p3mathutil_composite2.cxx')
  3634. OPTS=['DIR:panda/src/mathutil', 'FFTW']
  3635. IGATEFILES=GetDirectoryContents('panda/src/mathutil', ["*.h", "*_composite*.cxx"])
  3636. for ifile in IGATEFILES[:]:
  3637. if "_src." in ifile:
  3638. IGATEFILES.remove(ifile)
  3639. TargetAdd('libp3mathutil.in', opts=OPTS, input=IGATEFILES)
  3640. TargetAdd('libp3mathutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3mathutil', 'SRCDIR:panda/src/mathutil'])
  3641. #
  3642. # DIRECTORY: panda/src/gsgbase/
  3643. #
  3644. if (not RUNTIME):
  3645. OPTS=['DIR:panda/src/gsgbase', 'BUILDING:PANDA']
  3646. TargetAdd('p3gsgbase_composite1.obj', opts=OPTS, input='p3gsgbase_composite1.cxx')
  3647. OPTS=['DIR:panda/src/gsgbase']
  3648. IGATEFILES=GetDirectoryContents('panda/src/gsgbase', ["*.h", "*_composite*.cxx"])
  3649. TargetAdd('libp3gsgbase.in', opts=OPTS, input=IGATEFILES)
  3650. TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SRCDIR:panda/src/gsgbase'])
  3651. #
  3652. # DIRECTORY: panda/src/pnmimage/
  3653. #
  3654. if (not RUNTIME):
  3655. OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
  3656. TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
  3657. TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
  3658. TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
  3659. OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
  3660. IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
  3661. TargetAdd('libp3pnmimage.in', opts=OPTS, input=IGATEFILES)
  3662. TargetAdd('libp3pnmimage.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmimage', 'SRCDIR:panda/src/pnmimage'])
  3663. PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
  3664. #
  3665. # DIRECTORY: panda/src/nativenet/
  3666. #
  3667. if (not RUNTIME):
  3668. OPTS=['DIR:panda/src/nativenet', 'OPENSSL', 'BUILDING:PANDA']
  3669. TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
  3670. OPTS=['DIR:panda/src/nativenet', 'OPENSSL']
  3671. IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
  3672. TargetAdd('libp3nativenet.in', opts=OPTS, input=IGATEFILES)
  3673. TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet', 'SRCDIR:panda/src/nativenet'])
  3674. #
  3675. # DIRECTORY: panda/src/net/
  3676. #
  3677. if (not RUNTIME):
  3678. OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
  3679. TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
  3680. TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
  3681. OPTS=['DIR:panda/src/net']
  3682. IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
  3683. IGATEFILES.remove("datagram_ui.h")
  3684. TargetAdd('libp3net.in', opts=OPTS, input=IGATEFILES)
  3685. TargetAdd('libp3net.in', opts=['IMOD:panda3d.core', 'ILIB:libp3net', 'SRCDIR:panda/src/net'])
  3686. #
  3687. # DIRECTORY: panda/src/pstatclient/
  3688. #
  3689. if (not RUNTIME):
  3690. OPTS=['DIR:panda/src/pstatclient', 'BUILDING:PANDA']
  3691. TargetAdd('p3pstatclient_composite1.obj', opts=OPTS, input='p3pstatclient_composite1.cxx')
  3692. TargetAdd('p3pstatclient_composite2.obj', opts=OPTS, input='p3pstatclient_composite2.cxx')
  3693. OPTS=['DIR:panda/src/pstatclient']
  3694. IGATEFILES=GetDirectoryContents('panda/src/pstatclient', ["*.h", "*_composite*.cxx"])
  3695. IGATEFILES.remove("config_pstats.h")
  3696. TargetAdd('libp3pstatclient.in', opts=OPTS, input=IGATEFILES)
  3697. TargetAdd('libp3pstatclient.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pstatclient', 'SRCDIR:panda/src/pstatclient'])
  3698. PyTargetAdd('p3pstatclient_pStatClient_ext.obj', opts=OPTS, input='pStatClient_ext.cxx')
  3699. #
  3700. # DIRECTORY: panda/src/gobj/
  3701. #
  3702. if (not RUNTIME):
  3703. OPTS=['DIR:panda/src/gobj', 'BUILDING:PANDA', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3704. TargetAdd('p3gobj_composite1.obj', opts=OPTS, input='p3gobj_composite1.cxx')
  3705. TargetAdd('p3gobj_composite2.obj', opts=OPTS+['BIGOBJ'], input='p3gobj_composite2.cxx')
  3706. OPTS=['DIR:panda/src/gobj', 'NVIDIACG', 'ZLIB', 'SQUISH']
  3707. IGATEFILES=GetDirectoryContents('panda/src/gobj', ["*.h", "*_composite*.cxx"])
  3708. if ("cgfx_states.h" in IGATEFILES): IGATEFILES.remove("cgfx_states.h")
  3709. TargetAdd('libp3gobj.in', opts=OPTS, input=IGATEFILES)
  3710. TargetAdd('libp3gobj.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gobj', 'SRCDIR:panda/src/gobj'])
  3711. PyTargetAdd('p3gobj_ext_composite.obj', opts=OPTS, input='p3gobj_ext_composite.cxx')
  3712. #
  3713. # DIRECTORY: panda/src/pgraphnodes/
  3714. #
  3715. if (not RUNTIME):
  3716. OPTS=['DIR:panda/src/pgraphnodes', 'BUILDING:PANDA']
  3717. TargetAdd('p3pgraphnodes_composite1.obj', opts=OPTS, input='p3pgraphnodes_composite1.cxx')
  3718. TargetAdd('p3pgraphnodes_composite2.obj', opts=OPTS, input='p3pgraphnodes_composite2.cxx')
  3719. OPTS=['DIR:panda/src/pgraphnodes']
  3720. IGATEFILES=GetDirectoryContents('panda/src/pgraphnodes', ["*.h", "*_composite*.cxx"])
  3721. TargetAdd('libp3pgraphnodes.in', opts=OPTS, input=IGATEFILES)
  3722. TargetAdd('libp3pgraphnodes.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraphnodes', 'SRCDIR:panda/src/pgraphnodes'])
  3723. #
  3724. # DIRECTORY: panda/src/pgraph/
  3725. #
  3726. if (not RUNTIME):
  3727. OPTS=['DIR:panda/src/pgraph', 'BUILDING:PANDA']
  3728. TargetAdd('p3pgraph_nodePath.obj', opts=OPTS, input='nodePath.cxx')
  3729. TargetAdd('p3pgraph_composite1.obj', opts=OPTS, input='p3pgraph_composite1.cxx')
  3730. TargetAdd('p3pgraph_composite2.obj', opts=OPTS, input='p3pgraph_composite2.cxx')
  3731. TargetAdd('p3pgraph_composite3.obj', opts=OPTS, input='p3pgraph_composite3.cxx')
  3732. TargetAdd('p3pgraph_composite4.obj', opts=OPTS, input='p3pgraph_composite4.cxx')
  3733. OPTS=['DIR:panda/src/pgraph']
  3734. IGATEFILES=GetDirectoryContents('panda/src/pgraph', ["*.h", "nodePath.cxx", "*_composite*.cxx"])
  3735. TargetAdd('libp3pgraph.in', opts=OPTS, input=IGATEFILES)
  3736. TargetAdd('libp3pgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgraph', 'SRCDIR:panda/src/pgraph'])
  3737. PyTargetAdd('p3pgraph_ext_composite.obj', opts=OPTS, input='p3pgraph_ext_composite.cxx')
  3738. #
  3739. # DIRECTORY: panda/src/cull/
  3740. #
  3741. if (not RUNTIME):
  3742. OPTS=['DIR:panda/src/cull', 'BUILDING:PANDA']
  3743. TargetAdd('p3cull_composite1.obj', opts=OPTS, input='p3cull_composite1.cxx')
  3744. TargetAdd('p3cull_composite2.obj', opts=OPTS, input='p3cull_composite2.cxx')
  3745. OPTS=['DIR:panda/src/cull']
  3746. IGATEFILES=GetDirectoryContents('panda/src/cull', ["*.h", "*_composite*.cxx"])
  3747. TargetAdd('libp3cull.in', opts=OPTS, input=IGATEFILES)
  3748. TargetAdd('libp3cull.in', opts=['IMOD:panda3d.core', 'ILIB:libp3cull', 'SRCDIR:panda/src/cull'])
  3749. #
  3750. # DIRECTORY: panda/src/dgraph/
  3751. #
  3752. if (not RUNTIME):
  3753. OPTS=['DIR:panda/src/dgraph', 'BUILDING:PANDA']
  3754. TargetAdd('p3dgraph_composite1.obj', opts=OPTS, input='p3dgraph_composite1.cxx')
  3755. TargetAdd('p3dgraph_composite2.obj', opts=OPTS, input='p3dgraph_composite2.cxx')
  3756. OPTS=['DIR:panda/src/dgraph']
  3757. IGATEFILES=GetDirectoryContents('panda/src/dgraph', ["*.h", "*_composite*.cxx"])
  3758. TargetAdd('libp3dgraph.in', opts=OPTS, input=IGATEFILES)
  3759. TargetAdd('libp3dgraph.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dgraph', 'SRCDIR:panda/src/dgraph'])
  3760. #
  3761. # DIRECTORY: panda/src/device/
  3762. #
  3763. if (not RUNTIME):
  3764. OPTS=['DIR:panda/src/device', 'BUILDING:PANDA']
  3765. TargetAdd('p3device_composite1.obj', opts=OPTS, input='p3device_composite1.cxx')
  3766. TargetAdd('p3device_composite2.obj', opts=OPTS, input='p3device_composite2.cxx')
  3767. OPTS=['DIR:panda/src/device']
  3768. IGATEFILES=GetDirectoryContents('panda/src/device', ["*.h", "*_composite*.cxx"])
  3769. TargetAdd('libp3device.in', opts=OPTS, input=IGATEFILES)
  3770. TargetAdd('libp3device.in', opts=['IMOD:panda3d.core', 'ILIB:libp3device', 'SRCDIR:panda/src/device'])
  3771. #
  3772. # DIRECTORY: panda/src/display/
  3773. #
  3774. if (not RUNTIME):
  3775. OPTS=['DIR:panda/src/display', 'BUILDING:PANDA', 'X11']
  3776. TargetAdd('p3display_graphicsStateGuardian.obj', opts=OPTS, input='graphicsStateGuardian.cxx')
  3777. TargetAdd('p3display_composite1.obj', opts=OPTS, input='p3display_composite1.cxx')
  3778. TargetAdd('p3display_composite2.obj', opts=OPTS, input='p3display_composite2.cxx')
  3779. OPTS=['DIR:panda/src/display', 'X11']
  3780. IGATEFILES=GetDirectoryContents('panda/src/display', ["*.h", "*_composite*.cxx"])
  3781. IGATEFILES.remove("renderBuffer.h")
  3782. TargetAdd('libp3display.in', opts=OPTS, input=IGATEFILES)
  3783. TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display'])
  3784. PyTargetAdd('p3display_ext_composite.obj', opts=OPTS, input='p3display_ext_composite.cxx')
  3785. if RTDIST and GetTarget() == 'darwin':
  3786. OPTS=['DIR:panda/src/display']
  3787. TargetAdd('subprocessWindowBuffer.obj', opts=OPTS, input='subprocessWindowBuffer.cxx')
  3788. TargetAdd('libp3subprocbuffer.ilb', input='subprocessWindowBuffer.obj')
  3789. #
  3790. # DIRECTORY: panda/src/chan/
  3791. #
  3792. if (not RUNTIME):
  3793. OPTS=['DIR:panda/src/chan', 'BUILDING:PANDA']
  3794. TargetAdd('p3chan_composite1.obj', opts=OPTS, input='p3chan_composite1.cxx')
  3795. TargetAdd('p3chan_composite2.obj', opts=OPTS, input='p3chan_composite2.cxx')
  3796. OPTS=['DIR:panda/src/chan']
  3797. IGATEFILES=GetDirectoryContents('panda/src/chan', ["*.h", "*_composite*.cxx"])
  3798. IGATEFILES.remove('movingPart.h')
  3799. IGATEFILES.remove('animChannelFixed.h')
  3800. TargetAdd('libp3chan.in', opts=OPTS, input=IGATEFILES)
  3801. TargetAdd('libp3chan.in', opts=['IMOD:panda3d.core', 'ILIB:libp3chan', 'SRCDIR:panda/src/chan'])
  3802. # DIRECTORY: panda/src/char/
  3803. #
  3804. if (not RUNTIME):
  3805. OPTS=['DIR:panda/src/char', 'BUILDING:PANDA']
  3806. TargetAdd('p3char_composite1.obj', opts=OPTS, input='p3char_composite1.cxx')
  3807. TargetAdd('p3char_composite2.obj', opts=OPTS, input='p3char_composite2.cxx')
  3808. OPTS=['DIR:panda/src/char']
  3809. IGATEFILES=GetDirectoryContents('panda/src/char', ["*.h", "*_composite*.cxx"])
  3810. TargetAdd('libp3char.in', opts=OPTS, input=IGATEFILES)
  3811. TargetAdd('libp3char.in', opts=['IMOD:panda3d.core', 'ILIB:libp3char', 'SRCDIR:panda/src/char'])
  3812. #
  3813. # DIRECTORY: panda/src/pnmtext/
  3814. #
  3815. if (PkgSkip("FREETYPE")==0 and not RUNTIME):
  3816. OPTS=['DIR:panda/src/pnmtext', 'BUILDING:PANDA', 'FREETYPE']
  3817. TargetAdd('p3pnmtext_composite1.obj', opts=OPTS, input='p3pnmtext_composite1.cxx')
  3818. OPTS=['DIR:panda/src/pnmtext', 'FREETYPE']
  3819. IGATEFILES=GetDirectoryContents('panda/src/pnmtext', ["*.h", "*_composite*.cxx"])
  3820. TargetAdd('libp3pnmtext.in', opts=OPTS, input=IGATEFILES)
  3821. TargetAdd('libp3pnmtext.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pnmtext', 'SRCDIR:panda/src/pnmtext'])
  3822. #
  3823. # DIRECTORY: panda/src/text/
  3824. #
  3825. if (not RUNTIME):
  3826. if not PkgSkip("HARFBUZZ"):
  3827. DefSymbol("HARFBUZZ", "HAVE_HARFBUZZ")
  3828. OPTS=['DIR:panda/src/text', 'BUILDING:PANDA', 'ZLIB', 'FREETYPE', 'HARFBUZZ']
  3829. TargetAdd('p3text_composite1.obj', opts=OPTS, input='p3text_composite1.cxx')
  3830. TargetAdd('p3text_composite2.obj', opts=OPTS, input='p3text_composite2.cxx')
  3831. OPTS=['DIR:panda/src/text', 'ZLIB', 'FREETYPE']
  3832. IGATEFILES=GetDirectoryContents('panda/src/text', ["*.h", "*_composite*.cxx"])
  3833. TargetAdd('libp3text.in', opts=OPTS, input=IGATEFILES)
  3834. TargetAdd('libp3text.in', opts=['IMOD:panda3d.core', 'ILIB:libp3text', 'SRCDIR:panda/src/text'])
  3835. #
  3836. # DIRECTORY: panda/src/movies/
  3837. #
  3838. if (not RUNTIME):
  3839. OPTS=['DIR:panda/src/movies', 'BUILDING:PANDA', 'VORBIS', 'OPUS']
  3840. TargetAdd('p3movies_composite1.obj', opts=OPTS, input='p3movies_composite1.cxx')
  3841. OPTS=['DIR:panda/src/movies', 'VORBIS', 'OPUS']
  3842. IGATEFILES=GetDirectoryContents('panda/src/movies', ["*.h", "*_composite*.cxx"])
  3843. TargetAdd('libp3movies.in', opts=OPTS, input=IGATEFILES)
  3844. TargetAdd('libp3movies.in', opts=['IMOD:panda3d.core', 'ILIB:libp3movies', 'SRCDIR:panda/src/movies'])
  3845. #
  3846. # DIRECTORY: panda/src/grutil/
  3847. #
  3848. if (not RUNTIME):
  3849. OPTS=['DIR:panda/src/grutil', 'BUILDING:PANDA']
  3850. TargetAdd('p3grutil_multitexReducer.obj', opts=OPTS, input='multitexReducer.cxx')
  3851. TargetAdd('p3grutil_composite1.obj', opts=OPTS, input='p3grutil_composite1.cxx')
  3852. TargetAdd('p3grutil_composite2.obj', opts=OPTS, input='p3grutil_composite2.cxx')
  3853. OPTS=['DIR:panda/src/grutil']
  3854. IGATEFILES=GetDirectoryContents('panda/src/grutil', ["*.h", "*_composite*.cxx"])
  3855. if 'convexHull.h' in IGATEFILES: IGATEFILES.remove('convexHull.h')
  3856. TargetAdd('libp3grutil.in', opts=OPTS, input=IGATEFILES)
  3857. TargetAdd('libp3grutil.in', opts=['IMOD:panda3d.core', 'ILIB:libp3grutil', 'SRCDIR:panda/src/grutil'])
  3858. #
  3859. # DIRECTORY: panda/src/tform/
  3860. #
  3861. if (not RUNTIME):
  3862. OPTS=['DIR:panda/src/tform', 'BUILDING:PANDA']
  3863. TargetAdd('p3tform_composite1.obj', opts=OPTS, input='p3tform_composite1.cxx')
  3864. TargetAdd('p3tform_composite2.obj', opts=OPTS, input='p3tform_composite2.cxx')
  3865. OPTS=['DIR:panda/src/tform']
  3866. IGATEFILES=GetDirectoryContents('panda/src/tform', ["*.h", "*_composite*.cxx"])
  3867. TargetAdd('libp3tform.in', opts=OPTS, input=IGATEFILES)
  3868. TargetAdd('libp3tform.in', opts=['IMOD:panda3d.core', 'ILIB:libp3tform', 'SRCDIR:panda/src/tform'])
  3869. #
  3870. # DIRECTORY: panda/src/collide/
  3871. #
  3872. if (not RUNTIME):
  3873. OPTS=['DIR:panda/src/collide', 'BUILDING:PANDA']
  3874. TargetAdd('p3collide_composite1.obj', opts=OPTS, input='p3collide_composite1.cxx')
  3875. TargetAdd('p3collide_composite2.obj', opts=OPTS, input='p3collide_composite2.cxx')
  3876. OPTS=['DIR:panda/src/collide']
  3877. IGATEFILES=GetDirectoryContents('panda/src/collide', ["*.h", "*_composite*.cxx"])
  3878. TargetAdd('libp3collide.in', opts=OPTS, input=IGATEFILES)
  3879. TargetAdd('libp3collide.in', opts=['IMOD:panda3d.core', 'ILIB:libp3collide', 'SRCDIR:panda/src/collide'])
  3880. PyTargetAdd('p3collide_ext_composite.obj', opts=OPTS, input='p3collide_ext_composite.cxx')
  3881. #
  3882. # DIRECTORY: panda/src/parametrics/
  3883. #
  3884. if (not RUNTIME):
  3885. OPTS=['DIR:panda/src/parametrics', 'BUILDING:PANDA']
  3886. TargetAdd('p3parametrics_composite1.obj', opts=OPTS, input='p3parametrics_composite1.cxx')
  3887. TargetAdd('p3parametrics_composite2.obj', opts=OPTS, input='p3parametrics_composite2.cxx')
  3888. OPTS=['DIR:panda/src/parametrics']
  3889. IGATEFILES=GetDirectoryContents('panda/src/parametrics', ["*.h", "*_composite*.cxx"])
  3890. TargetAdd('libp3parametrics.in', opts=OPTS, input=IGATEFILES)
  3891. TargetAdd('libp3parametrics.in', opts=['IMOD:panda3d.core', 'ILIB:libp3parametrics', 'SRCDIR:panda/src/parametrics'])
  3892. #
  3893. # DIRECTORY: panda/src/pgui/
  3894. #
  3895. if (not RUNTIME):
  3896. OPTS=['DIR:panda/src/pgui', 'BUILDING:PANDA']
  3897. TargetAdd('p3pgui_composite1.obj', opts=OPTS, input='p3pgui_composite1.cxx')
  3898. TargetAdd('p3pgui_composite2.obj', opts=OPTS, input='p3pgui_composite2.cxx')
  3899. OPTS=['DIR:panda/src/pgui']
  3900. IGATEFILES=GetDirectoryContents('panda/src/pgui', ["*.h", "*_composite*.cxx"])
  3901. TargetAdd('libp3pgui.in', opts=OPTS, input=IGATEFILES)
  3902. TargetAdd('libp3pgui.in', opts=['IMOD:panda3d.core', 'ILIB:libp3pgui', 'SRCDIR:panda/src/pgui'])
  3903. #
  3904. # DIRECTORY: panda/src/pnmimagetypes/
  3905. #
  3906. if (not RUNTIME):
  3907. OPTS=['DIR:panda/src/pnmimagetypes', 'DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'PNG', 'ZLIB', 'JPEG', 'TIFF', 'OPENEXR', 'EXCEPTIONS']
  3908. TargetAdd('p3pnmimagetypes_composite1.obj', opts=OPTS, input='p3pnmimagetypes_composite1.cxx')
  3909. TargetAdd('p3pnmimagetypes_composite2.obj', opts=OPTS, input='p3pnmimagetypes_composite2.cxx')
  3910. #
  3911. # DIRECTORY: panda/src/recorder/
  3912. #
  3913. if (not RUNTIME):
  3914. OPTS=['DIR:panda/src/recorder', 'BUILDING:PANDA']
  3915. TargetAdd('p3recorder_composite1.obj', opts=OPTS, input='p3recorder_composite1.cxx')
  3916. TargetAdd('p3recorder_composite2.obj', opts=OPTS, input='p3recorder_composite2.cxx')
  3917. OPTS=['DIR:panda/src/recorder']
  3918. IGATEFILES=GetDirectoryContents('panda/src/recorder', ["*.h", "*_composite*.cxx"])
  3919. TargetAdd('libp3recorder.in', opts=OPTS, input=IGATEFILES)
  3920. TargetAdd('libp3recorder.in', opts=['IMOD:panda3d.core', 'ILIB:libp3recorder', 'SRCDIR:panda/src/recorder'])
  3921. #
  3922. # DIRECTORY: panda/src/dxml/
  3923. #
  3924. DefSymbol("TINYXML", "TIXML_USE_STL", "")
  3925. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3926. TargetAdd('tinyxml_composite1.obj', opts=OPTS, input='tinyxml_composite1.cxx')
  3927. TargetAdd('libp3tinyxml.ilb', input='tinyxml_composite1.obj')
  3928. if (not RUNTIME):
  3929. OPTS=['DIR:panda/src/dxml', 'BUILDING:PANDA', 'TINYXML']
  3930. TargetAdd('p3dxml_composite1.obj', opts=OPTS, input='p3dxml_composite1.cxx')
  3931. OPTS=['DIR:panda/src/dxml', 'TINYXML']
  3932. IGATEFILES=GetDirectoryContents('panda/src/dxml', ["*.h", "p3dxml_composite1.cxx"])
  3933. TargetAdd('libp3dxml.in', opts=OPTS, input=IGATEFILES)
  3934. TargetAdd('libp3dxml.in', opts=['IMOD:panda3d.core', 'ILIB:libp3dxml', 'SRCDIR:panda/src/dxml'])
  3935. #
  3936. # DIRECTORY: panda/metalibs/panda/
  3937. #
  3938. if (not RUNTIME):
  3939. OPTS=['DIR:panda/metalibs/panda', 'BUILDING:PANDA', 'JPEG', 'PNG', 'HARFBUZZ',
  3940. 'TIFF', 'OPENEXR', 'ZLIB', 'OPENSSL', 'FREETYPE', 'FFTW', 'ADVAPI', 'WINSOCK2',
  3941. 'SQUISH', 'NVIDIACG', 'VORBIS', 'OPUS', 'WINUSER', 'WINMM', 'WINGDI', 'IPHLPAPI',
  3942. 'SETUPAPI', 'INOTIFY']
  3943. TargetAdd('panda_panda.obj', opts=OPTS, input='panda.cxx')
  3944. TargetAdd('libpanda.dll', input='panda_panda.obj')
  3945. TargetAdd('libpanda.dll', input='p3recorder_composite1.obj')
  3946. TargetAdd('libpanda.dll', input='p3recorder_composite2.obj')
  3947. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite1.obj')
  3948. TargetAdd('libpanda.dll', input='p3pgraphnodes_composite2.obj')
  3949. TargetAdd('libpanda.dll', input='p3pgraph_nodePath.obj')
  3950. TargetAdd('libpanda.dll', input='p3pgraph_composite1.obj')
  3951. TargetAdd('libpanda.dll', input='p3pgraph_composite2.obj')
  3952. TargetAdd('libpanda.dll', input='p3pgraph_composite3.obj')
  3953. TargetAdd('libpanda.dll', input='p3pgraph_composite4.obj')
  3954. TargetAdd('libpanda.dll', input='p3cull_composite1.obj')
  3955. TargetAdd('libpanda.dll', input='p3cull_composite2.obj')
  3956. TargetAdd('libpanda.dll', input='p3movies_composite1.obj')
  3957. TargetAdd('libpanda.dll', input='p3grutil_multitexReducer.obj')
  3958. TargetAdd('libpanda.dll', input='p3grutil_composite1.obj')
  3959. TargetAdd('libpanda.dll', input='p3grutil_composite2.obj')
  3960. TargetAdd('libpanda.dll', input='p3chan_composite1.obj')
  3961. TargetAdd('libpanda.dll', input='p3chan_composite2.obj')
  3962. TargetAdd('libpanda.dll', input='p3pstatclient_composite1.obj')
  3963. TargetAdd('libpanda.dll', input='p3pstatclient_composite2.obj')
  3964. TargetAdd('libpanda.dll', input='p3char_composite1.obj')
  3965. TargetAdd('libpanda.dll', input='p3char_composite2.obj')
  3966. TargetAdd('libpanda.dll', input='p3collide_composite1.obj')
  3967. TargetAdd('libpanda.dll', input='p3collide_composite2.obj')
  3968. TargetAdd('libpanda.dll', input='p3device_composite1.obj')
  3969. TargetAdd('libpanda.dll', input='p3device_composite2.obj')
  3970. TargetAdd('libpanda.dll', input='p3dgraph_composite1.obj')
  3971. TargetAdd('libpanda.dll', input='p3dgraph_composite2.obj')
  3972. TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian.obj')
  3973. TargetAdd('libpanda.dll', input='p3display_composite1.obj')
  3974. TargetAdd('libpanda.dll', input='p3display_composite2.obj')
  3975. TargetAdd('libpanda.dll', input='p3pipeline_composite1.obj')
  3976. TargetAdd('libpanda.dll', input='p3pipeline_composite2.obj')
  3977. TargetAdd('libpanda.dll', input='p3pipeline_contextSwitch.obj')
  3978. TargetAdd('libpanda.dll', input='p3event_composite1.obj')
  3979. TargetAdd('libpanda.dll', input='p3event_composite2.obj')
  3980. TargetAdd('libpanda.dll', input='p3gobj_composite1.obj')
  3981. TargetAdd('libpanda.dll', input='p3gobj_composite2.obj')
  3982. TargetAdd('libpanda.dll', input='p3gsgbase_composite1.obj')
  3983. TargetAdd('libpanda.dll', input='p3linmath_composite1.obj')
  3984. TargetAdd('libpanda.dll', input='p3linmath_composite2.obj')
  3985. TargetAdd('libpanda.dll', input='p3mathutil_composite1.obj')
  3986. TargetAdd('libpanda.dll', input='p3mathutil_composite2.obj')
  3987. TargetAdd('libpanda.dll', input='p3parametrics_composite1.obj')
  3988. TargetAdd('libpanda.dll', input='p3parametrics_composite2.obj')
  3989. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
  3990. TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
  3991. TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
  3992. TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
  3993. TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
  3994. TargetAdd('libpanda.dll', input='p3text_composite1.obj')
  3995. TargetAdd('libpanda.dll', input='p3text_composite2.obj')
  3996. TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
  3997. TargetAdd('libpanda.dll', input='p3tform_composite2.obj')
  3998. TargetAdd('libpanda.dll', input='p3putil_composite1.obj')
  3999. TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
  4000. TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
  4001. TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
  4002. TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
  4003. TargetAdd('libpanda.dll', input='p3net_composite1.obj')
  4004. TargetAdd('libpanda.dll', input='p3net_composite2.obj')
  4005. TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
  4006. TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
  4007. TargetAdd('libpanda.dll', input='libpandaexpress.dll')
  4008. TargetAdd('libpanda.dll', input='p3dxml_composite1.obj')
  4009. TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
  4010. TargetAdd('libpanda.dll', input='libp3dtool.dll')
  4011. if PkgSkip("FREETYPE")==0:
  4012. TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
  4013. TargetAdd('libpanda.dll', dep='dtool_have_freetype.dat')
  4014. TargetAdd('libpanda.dll', opts=OPTS)
  4015. PyTargetAdd('core_module.obj', input='libp3dtoolbase.in')
  4016. PyTargetAdd('core_module.obj', input='libp3dtoolutil.in')
  4017. PyTargetAdd('core_module.obj', input='libp3prc.in')
  4018. PyTargetAdd('core_module.obj', input='libp3downloader.in')
  4019. PyTargetAdd('core_module.obj', input='libp3express.in')
  4020. PyTargetAdd('core_module.obj', input='libp3recorder.in')
  4021. PyTargetAdd('core_module.obj', input='libp3pgraphnodes.in')
  4022. PyTargetAdd('core_module.obj', input='libp3pgraph.in')
  4023. PyTargetAdd('core_module.obj', input='libp3cull.in')
  4024. PyTargetAdd('core_module.obj', input='libp3grutil.in')
  4025. PyTargetAdd('core_module.obj', input='libp3chan.in')
  4026. PyTargetAdd('core_module.obj', input='libp3pstatclient.in')
  4027. PyTargetAdd('core_module.obj', input='libp3char.in')
  4028. PyTargetAdd('core_module.obj', input='libp3collide.in')
  4029. PyTargetAdd('core_module.obj', input='libp3device.in')
  4030. PyTargetAdd('core_module.obj', input='libp3dgraph.in')
  4031. PyTargetAdd('core_module.obj', input='libp3display.in')
  4032. PyTargetAdd('core_module.obj', input='libp3pipeline.in')
  4033. PyTargetAdd('core_module.obj', input='libp3event.in')
  4034. PyTargetAdd('core_module.obj', input='libp3gobj.in')
  4035. PyTargetAdd('core_module.obj', input='libp3gsgbase.in')
  4036. PyTargetAdd('core_module.obj', input='libp3linmath.in')
  4037. PyTargetAdd('core_module.obj', input='libp3mathutil.in')
  4038. PyTargetAdd('core_module.obj', input='libp3parametrics.in')
  4039. PyTargetAdd('core_module.obj', input='libp3pnmimage.in')
  4040. PyTargetAdd('core_module.obj', input='libp3text.in')
  4041. PyTargetAdd('core_module.obj', input='libp3tform.in')
  4042. PyTargetAdd('core_module.obj', input='libp3putil.in')
  4043. PyTargetAdd('core_module.obj', input='libp3audio.in')
  4044. PyTargetAdd('core_module.obj', input='libp3nativenet.in')
  4045. PyTargetAdd('core_module.obj', input='libp3net.in')
  4046. PyTargetAdd('core_module.obj', input='libp3pgui.in')
  4047. PyTargetAdd('core_module.obj', input='libp3movies.in')
  4048. PyTargetAdd('core_module.obj', input='libp3dxml.in')
  4049. if PkgSkip("FREETYPE")==0:
  4050. PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
  4051. PyTargetAdd('core_module.obj', opts=['IMOD:panda3d.core', 'ILIB:core'])
  4052. PyTargetAdd('core.pyd', input='libp3dtoolbase_igate.obj')
  4053. PyTargetAdd('core.pyd', input='p3dtoolbase_typeHandle_ext.obj')
  4054. PyTargetAdd('core.pyd', input='libp3dtoolutil_igate.obj')
  4055. PyTargetAdd('core.pyd', input='p3dtoolutil_ext_composite.obj')
  4056. PyTargetAdd('core.pyd', input='libp3prc_igate.obj')
  4057. PyTargetAdd('core.pyd', input='p3prc_ext_composite.obj')
  4058. PyTargetAdd('core.pyd', input='libp3downloader_igate.obj')
  4059. PyTargetAdd('core.pyd', input='p3downloader_stringStream_ext.obj')
  4060. PyTargetAdd('core.pyd', input='p3express_ext_composite.obj')
  4061. PyTargetAdd('core.pyd', input='libp3express_igate.obj')
  4062. PyTargetAdd('core.pyd', input='libp3recorder_igate.obj')
  4063. PyTargetAdd('core.pyd', input='libp3pgraphnodes_igate.obj')
  4064. PyTargetAdd('core.pyd', input='libp3pgraph_igate.obj')
  4065. PyTargetAdd('core.pyd', input='libp3movies_igate.obj')
  4066. PyTargetAdd('core.pyd', input='libp3grutil_igate.obj')
  4067. PyTargetAdd('core.pyd', input='libp3chan_igate.obj')
  4068. PyTargetAdd('core.pyd', input='libp3pstatclient_igate.obj')
  4069. PyTargetAdd('core.pyd', input='libp3char_igate.obj')
  4070. PyTargetAdd('core.pyd', input='libp3collide_igate.obj')
  4071. PyTargetAdd('core.pyd', input='libp3device_igate.obj')
  4072. PyTargetAdd('core.pyd', input='libp3dgraph_igate.obj')
  4073. PyTargetAdd('core.pyd', input='libp3display_igate.obj')
  4074. PyTargetAdd('core.pyd', input='libp3pipeline_igate.obj')
  4075. PyTargetAdd('core.pyd', input='libp3event_igate.obj')
  4076. PyTargetAdd('core.pyd', input='libp3gobj_igate.obj')
  4077. PyTargetAdd('core.pyd', input='libp3gsgbase_igate.obj')
  4078. PyTargetAdd('core.pyd', input='libp3linmath_igate.obj')
  4079. PyTargetAdd('core.pyd', input='libp3mathutil_igate.obj')
  4080. PyTargetAdd('core.pyd', input='libp3parametrics_igate.obj')
  4081. PyTargetAdd('core.pyd', input='libp3pnmimage_igate.obj')
  4082. PyTargetAdd('core.pyd', input='libp3text_igate.obj')
  4083. PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
  4084. PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
  4085. PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
  4086. PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
  4087. PyTargetAdd('core.pyd', input='libp3net_igate.obj')
  4088. PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
  4089. PyTargetAdd('core.pyd', input='libp3dxml_igate.obj')
  4090. if PkgSkip("FREETYPE")==0:
  4091. PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
  4092. PyTargetAdd('core.pyd', input='p3collide_ext_composite.obj')
  4093. PyTargetAdd('core.pyd', input='p3pipeline_pythonThread.obj')
  4094. PyTargetAdd('core.pyd', input='p3putil_ext_composite.obj')
  4095. PyTargetAdd('core.pyd', input='p3pnmimage_pfmFile_ext.obj')
  4096. PyTargetAdd('core.pyd', input='p3event_asyncFuture_ext.obj')
  4097. PyTargetAdd('core.pyd', input='p3event_pythonTask.obj')
  4098. PyTargetAdd('core.pyd', input='p3pstatclient_pStatClient_ext.obj')
  4099. PyTargetAdd('core.pyd', input='p3gobj_ext_composite.obj')
  4100. PyTargetAdd('core.pyd', input='p3pgraph_ext_composite.obj')
  4101. PyTargetAdd('core.pyd', input='p3display_ext_composite.obj')
  4102. PyTargetAdd('core.pyd', input='core_module.obj')
  4103. if not GetLinkAllStatic() and GetTarget() != 'emscripten':
  4104. PyTargetAdd('core.pyd', input='libp3tinyxml.ilb')
  4105. PyTargetAdd('core.pyd', input='libp3interrogatedb.dll')
  4106. PyTargetAdd('core.pyd', input=COMMON_PANDA_LIBS)
  4107. PyTargetAdd('core.pyd', opts=['WINSOCK2'])
  4108. #
  4109. # DIRECTORY: panda/src/vision/
  4110. #
  4111. if (PkgSkip("VISION") == 0) and (not RUNTIME):
  4112. # We want to know whether we have ffmpeg so that we can override the .avi association.
  4113. if not PkgSkip("FFMPEG"):
  4114. DefSymbol("OPENCV", "HAVE_FFMPEG")
  4115. if not PkgSkip("OPENCV"):
  4116. DefSymbol("OPENCV", "HAVE_OPENCV")
  4117. if OPENCV_VER_23:
  4118. DefSymbol("OPENCV", "OPENCV_VER_23")
  4119. OPTS=['DIR:panda/src/vision', 'BUILDING:VISION', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4120. TargetAdd('p3vision_composite1.obj', opts=OPTS, input='p3vision_composite1.cxx', dep=[
  4121. 'dtool_have_ffmpeg.dat',
  4122. 'dtool_have_opencv.dat',
  4123. 'dtool_have_directcam.dat',
  4124. ])
  4125. TargetAdd('libp3vision.dll', input='p3vision_composite1.obj')
  4126. TargetAdd('libp3vision.dll', input=COMMON_PANDA_LIBS)
  4127. TargetAdd('libp3vision.dll', opts=OPTS)
  4128. OPTS=['DIR:panda/src/vision', 'ARTOOLKIT', 'OPENCV', 'DX9', 'DIRECTCAM', 'JPEG', 'EXCEPTIONS']
  4129. IGATEFILES=GetDirectoryContents('panda/src/vision', ["*.h", "*_composite*.cxx"])
  4130. TargetAdd('libp3vision.in', opts=OPTS, input=IGATEFILES)
  4131. TargetAdd('libp3vision.in', opts=['IMOD:panda3d.vision', 'ILIB:libp3vision', 'SRCDIR:panda/src/vision'])
  4132. PyTargetAdd('vision_module.obj', input='libp3vision.in')
  4133. PyTargetAdd('vision_module.obj', opts=OPTS)
  4134. PyTargetAdd('vision_module.obj', opts=['IMOD:panda3d.vision', 'ILIB:vision', 'IMPORT:panda3d.core'])
  4135. PyTargetAdd('vision.pyd', input='vision_module.obj')
  4136. PyTargetAdd('vision.pyd', input='libp3vision_igate.obj')
  4137. PyTargetAdd('vision.pyd', input='libp3vision.dll')
  4138. PyTargetAdd('vision.pyd', input='libp3interrogatedb.dll')
  4139. PyTargetAdd('vision.pyd', input=COMMON_PANDA_LIBS)
  4140. #
  4141. # DIRECTORY: panda/src/rocket/
  4142. #
  4143. if (PkgSkip("ROCKET") == 0) and (not RUNTIME):
  4144. OPTS=['DIR:panda/src/rocket', 'BUILDING:ROCKET', 'ROCKET', 'PYTHON', 'NOARCH:ARM64']
  4145. TargetAdd('p3rocket_composite1.obj', opts=OPTS, input='p3rocket_composite1.cxx')
  4146. TargetAdd('libp3rocket.dll', input='p3rocket_composite1.obj')
  4147. TargetAdd('libp3rocket.dll', input=COMMON_PANDA_LIBS)
  4148. TargetAdd('libp3rocket.dll', opts=OPTS)
  4149. OPTS=['DIR:panda/src/rocket', 'ROCKET', 'RTTI', 'EXCEPTIONS', 'NOARCH:ARM64']
  4150. IGATEFILES=GetDirectoryContents('panda/src/rocket', ["rocketInputHandler.h",
  4151. "rocketInputHandler.cxx", "rocketRegion.h", "rocketRegion.cxx", "rocketRegion_ext.h"])
  4152. TargetAdd('libp3rocket.in', opts=OPTS, input=IGATEFILES)
  4153. TargetAdd('libp3rocket.in', opts=['IMOD:panda3d.rocket', 'ILIB:libp3rocket', 'SRCDIR:panda/src/rocket'])
  4154. PyTargetAdd('p3rocket_rocketRegion_ext.obj', opts=OPTS, input='rocketRegion_ext.cxx')
  4155. PyTargetAdd('rocket_module.obj', input='libp3rocket.in')
  4156. PyTargetAdd('rocket_module.obj', opts=OPTS)
  4157. PyTargetAdd('rocket_module.obj', opts=['IMOD:panda3d.rocket', 'ILIB:rocket', 'IMPORT:panda3d.core'])
  4158. PyTargetAdd('rocket.pyd', input='rocket_module.obj')
  4159. PyTargetAdd('rocket.pyd', input='libp3rocket_igate.obj')
  4160. PyTargetAdd('rocket.pyd', input='p3rocket_rocketRegion_ext.obj')
  4161. PyTargetAdd('rocket.pyd', input='libp3rocket.dll')
  4162. PyTargetAdd('rocket.pyd', input='libp3interrogatedb.dll')
  4163. PyTargetAdd('rocket.pyd', input=COMMON_PANDA_LIBS)
  4164. PyTargetAdd('rocket.pyd', opts=['ROCKET', 'NOARCH:ARM64'])
  4165. #
  4166. # DIRECTORY: panda/src/p3skel
  4167. #
  4168. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4169. OPTS=['DIR:panda/src/skel', 'BUILDING:PANDASKEL', 'ADVAPI']
  4170. TargetAdd('p3skel_composite1.obj', opts=OPTS, input='p3skel_composite1.cxx')
  4171. OPTS=['DIR:panda/src/skel', 'ADVAPI']
  4172. IGATEFILES=GetDirectoryContents("panda/src/skel", ["*.h", "*_composite*.cxx"])
  4173. TargetAdd('libp3skel.in', opts=OPTS, input=IGATEFILES)
  4174. TargetAdd('libp3skel.in', opts=['IMOD:panda3d.skel', 'ILIB:libp3skel', 'SRCDIR:panda/src/skel'])
  4175. #
  4176. # DIRECTORY: panda/src/p3skel
  4177. #
  4178. if (PkgSkip('SKEL')==0) and (not RUNTIME):
  4179. OPTS=['BUILDING:PANDASKEL', 'ADVAPI']
  4180. TargetAdd('libpandaskel.dll', input='p3skel_composite1.obj')
  4181. TargetAdd('libpandaskel.dll', input=COMMON_PANDA_LIBS)
  4182. TargetAdd('libpandaskel.dll', opts=OPTS)
  4183. PyTargetAdd('skel_module.obj', input='libp3skel.in')
  4184. PyTargetAdd('skel_module.obj', opts=['IMOD:panda3d.skel', 'ILIB:skel', 'IMPORT:panda3d.core'])
  4185. PyTargetAdd('skel.pyd', input='skel_module.obj')
  4186. PyTargetAdd('skel.pyd', input='libp3skel_igate.obj')
  4187. PyTargetAdd('skel.pyd', input='libpandaskel.dll')
  4188. PyTargetAdd('skel.pyd', input='libp3interrogatedb.dll')
  4189. PyTargetAdd('skel.pyd', input=COMMON_PANDA_LIBS)
  4190. #
  4191. # DIRECTORY: panda/src/distort/
  4192. #
  4193. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4194. OPTS=['DIR:panda/src/distort', 'BUILDING:PANDAFX']
  4195. TargetAdd('p3distort_composite1.obj', opts=OPTS, input='p3distort_composite1.cxx')
  4196. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4197. IGATEFILES=GetDirectoryContents('panda/src/distort', ["*.h", "*_composite*.cxx"])
  4198. TargetAdd('libp3distort.in', opts=OPTS, input=IGATEFILES)
  4199. TargetAdd('libp3distort.in', opts=['IMOD:panda3d.fx', 'ILIB:libp3distort', 'SRCDIR:panda/src/distort'])
  4200. #
  4201. # DIRECTORY: panda/metalibs/pandafx/
  4202. #
  4203. if (PkgSkip('PANDAFX')==0) and (not RUNTIME):
  4204. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'BUILDING:PANDAFX', 'NVIDIACG']
  4205. TargetAdd('pandafx_pandafx.obj', opts=OPTS, input='pandafx.cxx')
  4206. TargetAdd('libpandafx.dll', input='pandafx_pandafx.obj')
  4207. TargetAdd('libpandafx.dll', input='p3distort_composite1.obj')
  4208. TargetAdd('libpandafx.dll', input=COMMON_PANDA_LIBS)
  4209. TargetAdd('libpandafx.dll', opts=['ADVAPI', 'NVIDIACG'])
  4210. OPTS=['DIR:panda/metalibs/pandafx', 'DIR:panda/src/distort', 'NVIDIACG']
  4211. PyTargetAdd('fx_module.obj', input='libp3distort.in')
  4212. PyTargetAdd('fx_module.obj', opts=OPTS)
  4213. PyTargetAdd('fx_module.obj', opts=['IMOD:panda3d.fx', 'ILIB:fx', 'IMPORT:panda3d.core'])
  4214. PyTargetAdd('fx.pyd', input='fx_module.obj')
  4215. PyTargetAdd('fx.pyd', input='libp3distort_igate.obj')
  4216. PyTargetAdd('fx.pyd', input='libpandafx.dll')
  4217. PyTargetAdd('fx.pyd', input='libp3interrogatedb.dll')
  4218. PyTargetAdd('fx.pyd', input=COMMON_PANDA_LIBS)
  4219. #
  4220. # DIRECTORY: panda/src/vrpn/
  4221. #
  4222. if (PkgSkip("VRPN")==0 and not RUNTIME):
  4223. OPTS=['DIR:panda/src/vrpn', 'BUILDING:VRPN', 'VRPN']
  4224. TargetAdd('p3vrpn_composite1.obj', opts=OPTS, input='p3vrpn_composite1.cxx')
  4225. TargetAdd('libp3vrpn.dll', input='p3vrpn_composite1.obj')
  4226. TargetAdd('libp3vrpn.dll', input=COMMON_PANDA_LIBS)
  4227. TargetAdd('libp3vrpn.dll', opts=['VRPN'])
  4228. OPTS=['DIR:panda/src/vrpn', 'VRPN']
  4229. IGATEFILES=GetDirectoryContents('panda/src/vrpn', ["*.h", "*_composite*.cxx"])
  4230. TargetAdd('libp3vrpn.in', opts=OPTS, input=IGATEFILES)
  4231. TargetAdd('libp3vrpn.in', opts=['IMOD:panda3d.vrpn', 'ILIB:libp3vrpn', 'SRCDIR:panda/src/vrpn'])
  4232. PyTargetAdd('vrpn_module.obj', input='libp3vrpn.in')
  4233. PyTargetAdd('vrpn_module.obj', opts=OPTS)
  4234. PyTargetAdd('vrpn_module.obj', opts=['IMOD:panda3d.vrpn', 'ILIB:vrpn', 'IMPORT:panda3d.core'])
  4235. PyTargetAdd('vrpn.pyd', input='vrpn_module.obj')
  4236. PyTargetAdd('vrpn.pyd', input='libp3vrpn_igate.obj')
  4237. PyTargetAdd('vrpn.pyd', input='libp3vrpn.dll')
  4238. PyTargetAdd('vrpn.pyd', input='libp3interrogatedb.dll')
  4239. PyTargetAdd('vrpn.pyd', input=COMMON_PANDA_LIBS)
  4240. #
  4241. # DIRECTORY: panda/src/ffmpeg
  4242. #
  4243. if PkgSkip("FFMPEG") == 0 and not RUNTIME:
  4244. if not PkgSkip("SWSCALE"):
  4245. DefSymbol("FFMPEG", "HAVE_SWSCALE")
  4246. if not PkgSkip("SWRESAMPLE"):
  4247. DefSymbol("FFMPEG", "HAVE_SWRESAMPLE")
  4248. OPTS=['DIR:panda/src/ffmpeg', 'BUILDING:FFMPEG', 'FFMPEG', 'SWSCALE', 'SWRESAMPLE']
  4249. TargetAdd('p3ffmpeg_composite1.obj', opts=OPTS, input='p3ffmpeg_composite1.cxx', dep=[
  4250. 'dtool_have_swscale.dat', 'dtool_have_swresample.dat'])
  4251. TargetAdd('libp3ffmpeg.dll', input='p3ffmpeg_composite1.obj')
  4252. TargetAdd('libp3ffmpeg.dll', input=COMMON_PANDA_LIBS)
  4253. TargetAdd('libp3ffmpeg.dll', opts=OPTS)
  4254. #
  4255. # DIRECTORY: panda/src/audiotraits/
  4256. #
  4257. if PkgSkip("FMODEX") == 0 and not RUNTIME:
  4258. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:FMOD_AUDIO', 'FMODEX']
  4259. TargetAdd('fmod_audio_fmod_audio_composite1.obj', opts=OPTS, input='fmod_audio_composite1.cxx')
  4260. TargetAdd('libp3fmod_audio.dll', input='fmod_audio_fmod_audio_composite1.obj')
  4261. TargetAdd('libp3fmod_audio.dll', input=COMMON_PANDA_LIBS)
  4262. TargetAdd('libp3fmod_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'FMODEX'])
  4263. if PkgSkip("OPENAL") == 0 and not RUNTIME:
  4264. OPTS=['DIR:panda/src/audiotraits', 'BUILDING:OPENAL_AUDIO', 'OPENAL']
  4265. TargetAdd('openal_audio_openal_audio_composite1.obj', opts=OPTS, input='openal_audio_composite1.cxx')
  4266. TargetAdd('libp3openal_audio.dll', input='openal_audio_openal_audio_composite1.obj')
  4267. TargetAdd('libp3openal_audio.dll', input=COMMON_PANDA_LIBS)
  4268. TargetAdd('libp3openal_audio.dll', opts=['MODULE', 'ADVAPI', 'WINUSER', 'WINMM', 'WINSHELL', 'WINOLE', 'OPENAL'])
  4269. #
  4270. # DIRECTORY: panda/src/downloadertools/
  4271. #
  4272. if (PkgSkip("OPENSSL")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4273. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4274. TargetAdd('apply_patch_apply_patch.obj', opts=OPTS, input='apply_patch.cxx')
  4275. TargetAdd('apply_patch.exe', input=['apply_patch_apply_patch.obj'])
  4276. TargetAdd('apply_patch.exe', input=COMMON_PANDA_LIBS)
  4277. TargetAdd('apply_patch.exe', opts=OPTS)
  4278. TargetAdd('build_patch_build_patch.obj', opts=OPTS, input='build_patch.cxx')
  4279. TargetAdd('build_patch.exe', input=['build_patch_build_patch.obj'])
  4280. TargetAdd('build_patch.exe', input=COMMON_PANDA_LIBS)
  4281. TargetAdd('build_patch.exe', opts=OPTS)
  4282. if not PkgSkip("ZLIB"):
  4283. TargetAdd('check_adler_check_adler.obj', opts=OPTS, input='check_adler.cxx')
  4284. TargetAdd('check_adler.exe', input=['check_adler_check_adler.obj'])
  4285. TargetAdd('check_adler.exe', input=COMMON_PANDA_LIBS)
  4286. TargetAdd('check_adler.exe', opts=OPTS)
  4287. TargetAdd('check_crc_check_crc.obj', opts=OPTS, input='check_crc.cxx')
  4288. TargetAdd('check_crc.exe', input=['check_crc_check_crc.obj'])
  4289. TargetAdd('check_crc.exe', input=COMMON_PANDA_LIBS)
  4290. TargetAdd('check_crc.exe', opts=OPTS)
  4291. TargetAdd('check_md5_check_md5.obj', opts=OPTS, input='check_md5.cxx')
  4292. TargetAdd('check_md5.exe', input=['check_md5_check_md5.obj'])
  4293. TargetAdd('check_md5.exe', input=COMMON_PANDA_LIBS)
  4294. TargetAdd('check_md5.exe', opts=OPTS)
  4295. TargetAdd('pdecrypt_pdecrypt.obj', opts=OPTS, input='pdecrypt.cxx')
  4296. TargetAdd('pdecrypt.exe', input=['pdecrypt_pdecrypt.obj'])
  4297. TargetAdd('pdecrypt.exe', input=COMMON_PANDA_LIBS)
  4298. TargetAdd('pdecrypt.exe', opts=OPTS)
  4299. TargetAdd('pencrypt_pencrypt.obj', opts=OPTS, input='pencrypt.cxx')
  4300. TargetAdd('pencrypt.exe', input=['pencrypt_pencrypt.obj'])
  4301. TargetAdd('pencrypt.exe', input=COMMON_PANDA_LIBS)
  4302. TargetAdd('pencrypt.exe', opts=OPTS)
  4303. TargetAdd('show_ddb_show_ddb.obj', opts=OPTS, input='show_ddb.cxx')
  4304. TargetAdd('show_ddb.exe', input=['show_ddb_show_ddb.obj'])
  4305. TargetAdd('show_ddb.exe', input=COMMON_PANDA_LIBS)
  4306. TargetAdd('show_ddb.exe', opts=OPTS)
  4307. #
  4308. # DIRECTORY: panda/src/downloadertools/
  4309. #
  4310. if (PkgSkip("ZLIB")==0 and not RTDIST and not RUNTIME and PkgSkip("DEPLOYTOOLS")==0):
  4311. OPTS=['DIR:panda/src/downloadertools', 'ZLIB', 'ADVAPI', 'WINSOCK2', 'WINSHELL', 'WINGDI', 'WINUSER']
  4312. TargetAdd('multify_multify.obj', opts=OPTS, input='multify.cxx')
  4313. TargetAdd('multify.exe', input=['multify_multify.obj'])
  4314. TargetAdd('multify.exe', input=COMMON_PANDA_LIBS)
  4315. TargetAdd('multify.exe', opts=OPTS)
  4316. TargetAdd('pzip_pzip.obj', opts=OPTS, input='pzip.cxx')
  4317. TargetAdd('pzip.exe', input=['pzip_pzip.obj'])
  4318. TargetAdd('pzip.exe', input=COMMON_PANDA_LIBS)
  4319. TargetAdd('pzip.exe', opts=OPTS)
  4320. TargetAdd('punzip_punzip.obj', opts=OPTS, input='punzip.cxx')
  4321. TargetAdd('punzip.exe', input=['punzip_punzip.obj'])
  4322. TargetAdd('punzip.exe', input=COMMON_PANDA_LIBS)
  4323. TargetAdd('punzip.exe', opts=OPTS)
  4324. #
  4325. # DIRECTORY: panda/src/windisplay/
  4326. #
  4327. if (GetTarget() == 'windows' and not RUNTIME):
  4328. OPTS=['DIR:panda/src/windisplay', 'BUILDING:PANDAWIN']
  4329. TargetAdd('p3windisplay_composite1.obj', opts=OPTS+["BIGOBJ"], input='p3windisplay_composite1.cxx')
  4330. TargetAdd('p3windisplay_windetectdx9.obj', opts=OPTS + ["DX9"], input='winDetectDx9.cxx')
  4331. TargetAdd('libp3windisplay.dll', input='p3windisplay_composite1.obj')
  4332. TargetAdd('libp3windisplay.dll', input='p3windisplay_windetectdx9.obj')
  4333. TargetAdd('libp3windisplay.dll', input=COMMON_PANDA_LIBS)
  4334. TargetAdd('libp3windisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM',"BIGOBJ"])
  4335. #
  4336. # DIRECTORY: panda/metalibs/pandadx9/
  4337. #
  4338. if GetTarget() == 'windows' and PkgSkip("DX9")==0 and not RUNTIME:
  4339. OPTS=['DIR:panda/src/dxgsg9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4340. TargetAdd('p3dxgsg9_dxGraphicsStateGuardian9.obj', opts=OPTS, input='dxGraphicsStateGuardian9.cxx')
  4341. TargetAdd('p3dxgsg9_composite1.obj', opts=OPTS, input='p3dxgsg9_composite1.cxx')
  4342. OPTS=['DIR:panda/metalibs/pandadx9', 'BUILDING:PANDADX', 'DX9', 'NVIDIACG', 'CGDX9']
  4343. TargetAdd('pandadx9_pandadx9.obj', opts=OPTS, input='pandadx9.cxx')
  4344. TargetAdd('libpandadx9.dll', input='pandadx9_pandadx9.obj')
  4345. TargetAdd('libpandadx9.dll', input='p3dxgsg9_dxGraphicsStateGuardian9.obj')
  4346. TargetAdd('libpandadx9.dll', input='p3dxgsg9_composite1.obj')
  4347. TargetAdd('libpandadx9.dll', input='libp3windisplay.dll')
  4348. TargetAdd('libpandadx9.dll', input=COMMON_PANDA_LIBS)
  4349. TargetAdd('libpandadx9.dll', opts=['MODULE', 'ADVAPI', 'WINGDI', 'WINKERNEL', 'WINUSER', 'WINMM', 'DX9', 'NVIDIACG', 'CGDX9'])
  4350. #
  4351. # DIRECTORY: panda/src/egg/
  4352. #
  4353. if not RUNTIME and not PkgSkip("EGG"):
  4354. OPTS=['DIR:panda/src/egg', 'BUILDING:PANDAEGG', 'ZLIB', 'BISONPREFIX_eggyy', 'FLEXDASHI', 'FLEXVERSION:2.5.9']
  4355. CreateFile(GetOutputDir()+"/include/parser.h")
  4356. TargetAdd('p3egg_parser.obj', opts=OPTS, input='parser.yxx')
  4357. TargetAdd('parser.h', input='p3egg_parser.obj', opts=['DEPENDENCYONLY'])
  4358. TargetAdd('p3egg_lexer.obj', opts=OPTS, input='lexer.lxx')
  4359. TargetAdd('p3egg_composite1.obj', opts=OPTS, input='p3egg_composite1.cxx')
  4360. TargetAdd('p3egg_composite2.obj', opts=OPTS, input='p3egg_composite2.cxx')
  4361. OPTS=['DIR:panda/src/egg', 'ZLIB']
  4362. IGATEFILES=GetDirectoryContents('panda/src/egg', ["*.h", "*_composite*.cxx"])
  4363. if "parser.h" in IGATEFILES: IGATEFILES.remove("parser.h")
  4364. TargetAdd('libp3egg.in', opts=OPTS, input=IGATEFILES)
  4365. TargetAdd('libp3egg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg', 'SRCDIR:panda/src/egg'])
  4366. PyTargetAdd('p3egg_ext_composite.obj', opts=OPTS, input='p3egg_ext_composite.cxx')
  4367. #
  4368. # DIRECTORY: panda/src/egg2pg/
  4369. #
  4370. if not RUNTIME and not PkgSkip("EGG"):
  4371. OPTS=['DIR:panda/src/egg2pg', 'BUILDING:PANDAEGG']
  4372. TargetAdd('p3egg2pg_composite1.obj', opts=OPTS, input='p3egg2pg_composite1.cxx')
  4373. TargetAdd('p3egg2pg_composite2.obj', opts=OPTS, input='p3egg2pg_composite2.cxx')
  4374. OPTS=['DIR:panda/src/egg2pg']
  4375. IGATEFILES=['load_egg_file.h', 'save_egg_file.h']
  4376. TargetAdd('libp3egg2pg.in', opts=OPTS, input=IGATEFILES)
  4377. TargetAdd('libp3egg2pg.in', opts=['IMOD:panda3d.egg', 'ILIB:libp3egg2pg', 'SRCDIR:panda/src/egg2pg'])
  4378. #
  4379. # DIRECTORY: panda/src/framework/
  4380. #
  4381. if (not RUNTIME):
  4382. deps = []
  4383. # Framework wants to link in a renderer when building statically, so tell it what is available.
  4384. if GetLinkAllStatic():
  4385. deps = ['dtool_have_gl.dat', 'dtool_have_tinydisplay.dat', 'dtool_have_egg.dat']
  4386. if not PkgSkip("GL"):
  4387. DefSymbol("FRAMEWORK", "HAVE_GL")
  4388. if not PkgSkip("TINYDISPLAY"):
  4389. DefSymbol("FRAMEWORK", "HAVE_TINYDISPLAY")
  4390. if not PkgSkip("EGG"):
  4391. DefSymbol("FRAMEWORK", "HAVE_EGG")
  4392. OPTS=['DIR:panda/src/framework', 'BUILDING:FRAMEWORK', 'FRAMEWORK']
  4393. TargetAdd('p3framework_composite1.obj', opts=OPTS, input='p3framework_composite1.cxx', dep=deps)
  4394. TargetAdd('libp3framework.dll', input='p3framework_composite1.obj')
  4395. TargetAdd('libp3framework.dll', input=COMMON_PANDA_LIBS)
  4396. TargetAdd('libp3framework.dll', opts=['ADVAPI'])
  4397. #
  4398. # DIRECTORY: panda/src/glgsg/
  4399. #
  4400. if (not RUNTIME and PkgSkip("GL")==0):
  4401. OPTS=['DIR:panda/src/glgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG']
  4402. TargetAdd('p3glgsg_config_glgsg.obj', opts=OPTS, input='config_glgsg.cxx')
  4403. TargetAdd('p3glgsg_glgsg.obj', opts=OPTS, input='glgsg.cxx')
  4404. #
  4405. # DIRECTORY: panda/src/glesgsg/
  4406. #
  4407. if (not RUNTIME and PkgSkip("GLES")==0):
  4408. OPTS=['DIR:panda/src/glesgsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES']
  4409. TargetAdd('p3glesgsg_config_glesgsg.obj', opts=OPTS, input='config_glesgsg.cxx')
  4410. TargetAdd('p3glesgsg_glesgsg.obj', opts=OPTS, input='glesgsg.cxx')
  4411. #
  4412. # DIRECTORY: panda/src/gles2gsg/
  4413. #
  4414. if (not RUNTIME and PkgSkip("GLES2")==0):
  4415. OPTS=['DIR:panda/src/gles2gsg', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2']
  4416. TargetAdd('p3gles2gsg_config_gles2gsg.obj', opts=OPTS, input='config_gles2gsg.cxx')
  4417. TargetAdd('p3gles2gsg_gles2gsg.obj', opts=OPTS, input='gles2gsg.cxx')
  4418. #
  4419. # DIRECTORY: panda/metalibs/pandaegg/
  4420. #
  4421. if not RUNTIME and not PkgSkip("EGG"):
  4422. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg', 'BUILDING:PANDAEGG']
  4423. TargetAdd('pandaegg_pandaegg.obj', opts=OPTS, input='pandaegg.cxx')
  4424. TargetAdd('libpandaegg.dll', input='pandaegg_pandaegg.obj')
  4425. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite1.obj')
  4426. TargetAdd('libpandaegg.dll', input='p3egg2pg_composite2.obj')
  4427. TargetAdd('libpandaegg.dll', input='p3egg_composite1.obj')
  4428. TargetAdd('libpandaegg.dll', input='p3egg_composite2.obj')
  4429. TargetAdd('libpandaegg.dll', input='p3egg_parser.obj')
  4430. TargetAdd('libpandaegg.dll', input='p3egg_lexer.obj')
  4431. TargetAdd('libpandaegg.dll', input=COMMON_PANDA_LIBS)
  4432. TargetAdd('libpandaegg.dll', opts=['ADVAPI'])
  4433. OPTS=['DIR:panda/metalibs/pandaegg', 'DIR:panda/src/egg']
  4434. PyTargetAdd('egg_module.obj', input='libp3egg2pg.in')
  4435. PyTargetAdd('egg_module.obj', input='libp3egg.in')
  4436. PyTargetAdd('egg_module.obj', opts=OPTS)
  4437. PyTargetAdd('egg_module.obj', opts=['IMOD:panda3d.egg', 'ILIB:egg', 'IMPORT:panda3d.core'])
  4438. PyTargetAdd('egg.pyd', input='egg_module.obj')
  4439. PyTargetAdd('egg.pyd', input='p3egg_ext_composite.obj')
  4440. PyTargetAdd('egg.pyd', input='libp3egg_igate.obj')
  4441. PyTargetAdd('egg.pyd', input='libp3egg2pg_igate.obj')
  4442. PyTargetAdd('egg.pyd', input='libpandaegg.dll')
  4443. PyTargetAdd('egg.pyd', input='libp3interrogatedb.dll')
  4444. PyTargetAdd('egg.pyd', input=COMMON_PANDA_LIBS)
  4445. #
  4446. # DIRECTORY: panda/src/x11display/
  4447. #
  4448. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("X11")==0 and not RUNTIME):
  4449. OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
  4450. TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
  4451. #
  4452. # DIRECTORY: panda/src/glxdisplay/
  4453. #
  4454. if (GetTarget() not in ['windows', 'darwin'] and PkgSkip("GL")==0 and PkgSkip("X11")==0 and not RUNTIME):
  4455. DefSymbol('GLX', 'HAVE_GLX', '')
  4456. OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4457. TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
  4458. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
  4459. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4460. TargetAdd('libpandagl.dll', input='p3x11display_composite1.obj')
  4461. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4462. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4463. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4464. TargetAdd('libpandagl.dll', input='p3glxdisplay_composite1.obj')
  4465. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4466. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'X11'])
  4467. #
  4468. # DIRECTORY: panda/src/cocoadisplay/
  4469. #
  4470. if (GetTarget() == 'darwin' and PkgSkip("COCOA")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4471. OPTS=['DIR:panda/src/cocoadisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4472. TargetAdd('p3cocoadisplay_composite1.obj', opts=OPTS, input='p3cocoadisplay_composite1.mm')
  4473. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4474. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4475. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4476. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4477. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4478. TargetAdd('libpandagl.dll', input='p3cocoadisplay_composite1.obj')
  4479. if (PkgSkip('PANDAFX')==0):
  4480. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4481. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4482. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'COCOA', 'CARBON'])
  4483. #
  4484. # DIRECTORY: panda/src/osxdisplay/
  4485. #
  4486. elif (GetTarget() == 'darwin' and PkgSkip("CARBON")==0 and PkgSkip("GL")==0 and not RUNTIME):
  4487. OPTS=['DIR:panda/src/osxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4488. TargetAdd('p3osxdisplay_composite1.obj', opts=OPTS, input='p3osxdisplay_composite1.cxx')
  4489. TargetAdd('p3osxdisplay_osxGraphicsWindow.obj', opts=OPTS, input='osxGraphicsWindow.mm')
  4490. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL']
  4491. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4492. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4493. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4494. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4495. TargetAdd('libpandagl.dll', input='p3osxdisplay_composite1.obj')
  4496. TargetAdd('libpandagl.dll', input='p3osxdisplay_osxGraphicsWindow.obj')
  4497. if (PkgSkip('PANDAFX')==0):
  4498. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4499. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4500. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'NVIDIACG', 'CGGL', 'CARBON', 'AGL', 'COCOA'])
  4501. #
  4502. # DIRECTORY: panda/src/wgldisplay/
  4503. #
  4504. if (GetTarget() == 'windows' and PkgSkip("GL")==0 and not RUNTIME):
  4505. OPTS=['DIR:panda/src/wgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4506. TargetAdd('p3wgldisplay_composite1.obj', opts=OPTS, input='p3wgldisplay_composite1.cxx')
  4507. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'NVIDIACG', 'CGGL']
  4508. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4509. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4510. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4511. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4512. TargetAdd('libpandagl.dll', input='p3wgldisplay_composite1.obj')
  4513. TargetAdd('libpandagl.dll', input='libp3windisplay.dll')
  4514. if (PkgSkip('PANDAFX')==0):
  4515. TargetAdd('libpandagl.dll', input='libpandafx.dll')
  4516. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4517. TargetAdd('libpandagl.dll', opts=['MODULE', 'WINGDI', 'GL', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'NVIDIACG', 'CGGL'])
  4518. #
  4519. # DIRECTORY: panda/src/egldisplay/
  4520. #
  4521. # If we're not compiling with any windowing system at all, but we do have EGL,
  4522. # we can use that to create a headless libpandagl instead.
  4523. if not PkgSkip("EGL") and not PkgSkip("GL") and PkgSkip("X11") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4524. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4525. TargetAdd('pandagl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4526. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4527. TargetAdd('pandagl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4528. TargetAdd('libpandagl.dll', input='pandagl_pandagl.obj')
  4529. TargetAdd('libpandagl.dll', input='p3glgsg_config_glgsg.obj')
  4530. TargetAdd('libpandagl.dll', input='p3glgsg_glgsg.obj')
  4531. TargetAdd('libpandagl.dll', input='pandagl_egldisplay_composite1.obj')
  4532. TargetAdd('libpandagl.dll', input=COMMON_PANDA_LIBS)
  4533. TargetAdd('libpandagl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4534. elif not PkgSkip("EGL") and not PkgSkip("GL") and GetTarget() not in ('windows', 'darwin') and not RUNTIME:
  4535. # As a temporary solution for #1086, build this module, which we can use as a
  4536. # fallback to OpenGL for headless systems.
  4537. DefSymbol('EGL', 'HAVE_EGL', '')
  4538. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4539. TargetAdd('p3headlessgl_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4540. OPTS=['DIR:panda/metalibs/pandagl', 'BUILDING:PANDAGL', 'GL', 'EGL']
  4541. TargetAdd('p3headlessgl_pandagl.obj', opts=OPTS, input='pandagl.cxx')
  4542. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_pandagl.obj')
  4543. TargetAdd('libp3headlessgl.dll', input='p3glgsg_config_glgsg.obj')
  4544. TargetAdd('libp3headlessgl.dll', input='p3glgsg_glgsg.obj')
  4545. TargetAdd('libp3headlessgl.dll', input='p3headlessgl_egldisplay_composite1.obj')
  4546. TargetAdd('libp3headlessgl.dll', input=COMMON_PANDA_LIBS)
  4547. TargetAdd('libp3headlessgl.dll', opts=['MODULE', 'GL', 'EGL', 'CGGL'])
  4548. #
  4549. # DIRECTORY: panda/src/egldisplay/
  4550. #
  4551. if (PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4552. DefSymbol('GLES', 'OPENGLES_1', '')
  4553. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL', 'X11']
  4554. TargetAdd('pandagles_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4555. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4556. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4557. if not PkgSkip("X11"):
  4558. TargetAdd('libpandagles.dll', input='p3x11display_composite1.obj')
  4559. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4560. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4561. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4562. TargetAdd('libpandagles.dll', input='pandagles_egldisplay_composite1.obj')
  4563. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4564. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL', 'X11'])
  4565. #
  4566. # DIRECTORY: panda/src/egldisplay/
  4567. #
  4568. if (PkgSkip("EGL")==0 and PkgSkip("GLES2")==0 and not RUNTIME):
  4569. DefSymbol('GLES2', 'OPENGLES_2', '')
  4570. OPTS=['DIR:panda/src/egldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL', 'X11']
  4571. TargetAdd('pandagles2_egldisplay_composite1.obj', opts=OPTS, input='p3egldisplay_composite1.cxx')
  4572. OPTS=['DIR:panda/metalibs/pandagles2', 'BUILDING:PANDAGLES2', 'GLES2', 'EGL']
  4573. TargetAdd('pandagles2_pandagles2.obj', opts=OPTS, input='pandagles2.cxx')
  4574. if not PkgSkip("X11"):
  4575. TargetAdd('libpandagles2.dll', input='p3x11display_composite1.obj')
  4576. TargetAdd('libpandagles2.dll', input='pandagles2_pandagles2.obj')
  4577. TargetAdd('libpandagles2.dll', input='p3gles2gsg_config_gles2gsg.obj')
  4578. TargetAdd('libpandagles2.dll', input='p3gles2gsg_gles2gsg.obj')
  4579. TargetAdd('libpandagles2.dll', input='pandagles2_egldisplay_composite1.obj')
  4580. TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
  4581. TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
  4582. #
  4583. # DIRECTORY: panda/src/ode/
  4584. #
  4585. if (PkgSkip("ODE")==0 and not RUNTIME):
  4586. OPTS=['DIR:panda/src/ode', 'BUILDING:PANDAODE', 'ODE']
  4587. TargetAdd('p3ode_composite1.obj', opts=OPTS, input='p3ode_composite1.cxx')
  4588. TargetAdd('p3ode_composite2.obj', opts=OPTS, input='p3ode_composite2.cxx')
  4589. TargetAdd('p3ode_composite3.obj', opts=OPTS, input='p3ode_composite3.cxx')
  4590. OPTS=['DIR:panda/src/ode', 'ODE']
  4591. IGATEFILES=GetDirectoryContents('panda/src/ode', ["*.h", "*_composite*.cxx"])
  4592. IGATEFILES.remove("odeConvexGeom.h")
  4593. IGATEFILES.remove("odeHelperStructs.h")
  4594. TargetAdd('libpandaode.in', opts=OPTS, input=IGATEFILES)
  4595. TargetAdd('libpandaode.in', opts=['IMOD:panda3d.ode', 'ILIB:libpandaode', 'SRCDIR:panda/src/ode'])
  4596. PyTargetAdd('p3ode_ext_composite.obj', opts=OPTS, input='p3ode_ext_composite.cxx')
  4597. #
  4598. # DIRECTORY: panda/metalibs/pandaode/
  4599. #
  4600. if (PkgSkip("ODE")==0 and not RUNTIME):
  4601. OPTS=['DIR:panda/metalibs/pandaode', 'BUILDING:PANDAODE', 'ODE']
  4602. TargetAdd('pandaode_pandaode.obj', opts=OPTS, input='pandaode.cxx')
  4603. TargetAdd('libpandaode.dll', input='pandaode_pandaode.obj')
  4604. TargetAdd('libpandaode.dll', input='p3ode_composite1.obj')
  4605. TargetAdd('libpandaode.dll', input='p3ode_composite2.obj')
  4606. TargetAdd('libpandaode.dll', input='p3ode_composite3.obj')
  4607. TargetAdd('libpandaode.dll', input=COMMON_PANDA_LIBS)
  4608. TargetAdd('libpandaode.dll', opts=['WINUSER', 'ODE'])
  4609. OPTS=['DIR:panda/metalibs/pandaode', 'ODE']
  4610. PyTargetAdd('ode_module.obj', input='libpandaode.in')
  4611. PyTargetAdd('ode_module.obj', opts=OPTS)
  4612. PyTargetAdd('ode_module.obj', opts=['IMOD:panda3d.ode', 'ILIB:ode', 'IMPORT:panda3d.core'])
  4613. PyTargetAdd('ode.pyd', input='ode_module.obj')
  4614. PyTargetAdd('ode.pyd', input='libpandaode_igate.obj')
  4615. PyTargetAdd('ode.pyd', input='p3ode_ext_composite.obj')
  4616. PyTargetAdd('ode.pyd', input='libpandaode.dll')
  4617. PyTargetAdd('ode.pyd', input='libp3interrogatedb.dll')
  4618. PyTargetAdd('ode.pyd', input=COMMON_PANDA_LIBS)
  4619. PyTargetAdd('ode.pyd', opts=['WINUSER', 'ODE'])
  4620. #
  4621. # DIRECTORY: panda/src/bullet/
  4622. #
  4623. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4624. OPTS=['DIR:panda/src/bullet', 'BUILDING:PANDABULLET', 'BULLET']
  4625. TargetAdd('p3bullet_composite.obj', opts=OPTS, input='p3bullet_composite.cxx')
  4626. OPTS=['DIR:panda/src/bullet', 'BULLET']
  4627. IGATEFILES=GetDirectoryContents('panda/src/bullet', ["*.h", "*_composite*.cxx"])
  4628. TargetAdd('libpandabullet.in', opts=OPTS, input=IGATEFILES)
  4629. TargetAdd('libpandabullet.in', opts=['IMOD:panda3d.bullet', 'ILIB:libpandabullet', 'SRCDIR:panda/src/bullet'])
  4630. #
  4631. # DIRECTORY: panda/metalibs/pandabullet/
  4632. #
  4633. if (PkgSkip("BULLET")==0 and not RUNTIME):
  4634. OPTS=['DIR:panda/metalibs/pandabullet', 'BUILDING:PANDABULLET', 'BULLET']
  4635. TargetAdd('pandabullet_pandabullet.obj', opts=OPTS, input='pandabullet.cxx')
  4636. TargetAdd('libpandabullet.dll', input='pandabullet_pandabullet.obj')
  4637. TargetAdd('libpandabullet.dll', input='p3bullet_composite.obj')
  4638. TargetAdd('libpandabullet.dll', input=COMMON_PANDA_LIBS)
  4639. TargetAdd('libpandabullet.dll', opts=['WINUSER', 'BULLET'])
  4640. OPTS=['DIR:panda/metalibs/pandabullet', 'BULLET']
  4641. PyTargetAdd('bullet_module.obj', input='libpandabullet.in')
  4642. PyTargetAdd('bullet_module.obj', opts=OPTS)
  4643. PyTargetAdd('bullet_module.obj', opts=['IMOD:panda3d.bullet', 'ILIB:bullet', 'IMPORT:panda3d.core'])
  4644. PyTargetAdd('bullet.pyd', input='bullet_module.obj')
  4645. PyTargetAdd('bullet.pyd', input='libpandabullet_igate.obj')
  4646. PyTargetAdd('bullet.pyd', input='libpandabullet.dll')
  4647. PyTargetAdd('bullet.pyd', input='libp3interrogatedb.dll')
  4648. PyTargetAdd('bullet.pyd', input=COMMON_PANDA_LIBS)
  4649. PyTargetAdd('bullet.pyd', opts=['WINUSER', 'BULLET'])
  4650. #
  4651. # DIRECTORY: panda/src/physx/
  4652. #
  4653. if (PkgSkip("PHYSX")==0):
  4654. OPTS=['DIR:panda/src/physx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4655. TargetAdd('p3physx_composite.obj', opts=OPTS, input='p3physx_composite.cxx')
  4656. OPTS=['DIR:panda/src/physx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4657. IGATEFILES=GetDirectoryContents('panda/src/physx', ["*.h", "*_composite*.cxx"])
  4658. TargetAdd('libpandaphysx.in', opts=OPTS, input=IGATEFILES)
  4659. TargetAdd('libpandaphysx.in', opts=['IMOD:panda3d.physx', 'ILIB:libpandaphysx', 'SRCDIR:panda/src/physx'])
  4660. #
  4661. # DIRECTORY: panda/metalibs/pandaphysx/
  4662. #
  4663. if (PkgSkip("PHYSX")==0):
  4664. OPTS=['DIR:panda/metalibs/pandaphysx', 'BUILDING:PANDAPHYSX', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON']
  4665. TargetAdd('pandaphysx_pandaphysx.obj', opts=OPTS, input='pandaphysx.cxx')
  4666. TargetAdd('libpandaphysx.dll', input='pandaphysx_pandaphysx.obj')
  4667. TargetAdd('libpandaphysx.dll', input='p3physx_composite.obj')
  4668. TargetAdd('libpandaphysx.dll', input=COMMON_PANDA_LIBS)
  4669. TargetAdd('libpandaphysx.dll', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64', 'PYTHON'])
  4670. OPTS=['DIR:panda/metalibs/pandaphysx', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64']
  4671. PyTargetAdd('physx_module.obj', input='libpandaphysx.in')
  4672. PyTargetAdd('physx_module.obj', opts=OPTS)
  4673. PyTargetAdd('physx_module.obj', opts=['IMOD:panda3d.physx', 'ILIB:physx', 'IMPORT:panda3d.core'])
  4674. PyTargetAdd('physx.pyd', input='physx_module.obj')
  4675. PyTargetAdd('physx.pyd', input='libpandaphysx_igate.obj')
  4676. PyTargetAdd('physx.pyd', input='libpandaphysx.dll')
  4677. PyTargetAdd('physx.pyd', input='libp3interrogatedb.dll')
  4678. PyTargetAdd('physx.pyd', input=COMMON_PANDA_LIBS)
  4679. PyTargetAdd('physx.pyd', opts=['WINUSER', 'PHYSX', 'NOARCH:PPC', 'NOARCH:ARM64'])
  4680. #
  4681. # DIRECTORY: panda/src/physics/
  4682. #
  4683. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4684. OPTS=['DIR:panda/src/physics', 'BUILDING:PANDAPHYSICS']
  4685. TargetAdd('p3physics_composite1.obj', opts=OPTS, input='p3physics_composite1.cxx')
  4686. TargetAdd('p3physics_composite2.obj', opts=OPTS, input='p3physics_composite2.cxx')
  4687. OPTS=['DIR:panda/src/physics']
  4688. IGATEFILES=GetDirectoryContents('panda/src/physics', ["*.h", "*_composite*.cxx"])
  4689. IGATEFILES.remove("forces.h")
  4690. TargetAdd('libp3physics.in', opts=OPTS, input=IGATEFILES)
  4691. TargetAdd('libp3physics.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3physics', 'SRCDIR:panda/src/physics'])
  4692. #
  4693. # DIRECTORY: panda/src/particlesystem/
  4694. #
  4695. if (PkgSkip("PANDAPHYSICS")==0) and (PkgSkip("PANDAPARTICLESYSTEM")==0) and (not RUNTIME):
  4696. OPTS=['DIR:panda/src/particlesystem', 'BUILDING:PANDAPHYSICS']
  4697. TargetAdd('p3particlesystem_composite1.obj', opts=OPTS, input='p3particlesystem_composite1.cxx')
  4698. TargetAdd('p3particlesystem_composite2.obj', opts=OPTS, input='p3particlesystem_composite2.cxx')
  4699. OPTS=['DIR:panda/src/particlesystem']
  4700. IGATEFILES=GetDirectoryContents('panda/src/particlesystem', ["*.h", "*_composite*.cxx"])
  4701. IGATEFILES.remove('orientedParticle.h')
  4702. IGATEFILES.remove('orientedParticleFactory.h')
  4703. IGATEFILES.remove('particlefactories.h')
  4704. IGATEFILES.remove('emitters.h')
  4705. IGATEFILES.remove('particles.h')
  4706. TargetAdd('libp3particlesystem.in', opts=OPTS, input=IGATEFILES)
  4707. TargetAdd('libp3particlesystem.in', opts=['IMOD:panda3d.physics', 'ILIB:libp3particlesystem', 'SRCDIR:panda/src/particlesystem'])
  4708. #
  4709. # DIRECTORY: panda/metalibs/pandaphysics/
  4710. #
  4711. if (PkgSkip("PANDAPHYSICS")==0) and (not RUNTIME):
  4712. OPTS=['DIR:panda/metalibs/pandaphysics', 'BUILDING:PANDAPHYSICS']
  4713. TargetAdd('pandaphysics_pandaphysics.obj', opts=OPTS, input='pandaphysics.cxx')
  4714. TargetAdd('libpandaphysics.dll', input='pandaphysics_pandaphysics.obj')
  4715. TargetAdd('libpandaphysics.dll', input='p3physics_composite1.obj')
  4716. TargetAdd('libpandaphysics.dll', input='p3physics_composite2.obj')
  4717. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite1.obj')
  4718. TargetAdd('libpandaphysics.dll', input='p3particlesystem_composite2.obj')
  4719. TargetAdd('libpandaphysics.dll', input=COMMON_PANDA_LIBS)
  4720. TargetAdd('libpandaphysics.dll', opts=['ADVAPI'])
  4721. OPTS=['DIR:panda/metalibs/pandaphysics']
  4722. PyTargetAdd('physics_module.obj', input='libp3physics.in')
  4723. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4724. PyTargetAdd('physics_module.obj', input='libp3particlesystem.in')
  4725. PyTargetAdd('physics_module.obj', opts=OPTS)
  4726. PyTargetAdd('physics_module.obj', opts=['IMOD:panda3d.physics', 'ILIB:physics', 'IMPORT:panda3d.core'])
  4727. PyTargetAdd('physics.pyd', input='physics_module.obj')
  4728. PyTargetAdd('physics.pyd', input='libp3physics_igate.obj')
  4729. if (PkgSkip("PANDAPARTICLESYSTEM")==0):
  4730. PyTargetAdd('physics.pyd', input='libp3particlesystem_igate.obj')
  4731. PyTargetAdd('physics.pyd', input='libpandaphysics.dll')
  4732. PyTargetAdd('physics.pyd', input='libp3interrogatedb.dll')
  4733. PyTargetAdd('physics.pyd', input=COMMON_PANDA_LIBS)
  4734. #
  4735. # DIRECTORY: panda/src/speedtree/
  4736. #
  4737. if (PkgSkip("SPEEDTREE")==0):
  4738. OPTS=['DIR:panda/src/speedtree', 'BUILDING:PANDASPEEDTREE', 'SPEEDTREE']
  4739. TargetAdd('pandaspeedtree_composite1.obj', opts=OPTS, input='pandaspeedtree_composite1.cxx')
  4740. IGATEFILES=GetDirectoryContents('panda/src/speedtree', ["*.h", "*_composite*.cxx"])
  4741. TargetAdd('libpandaspeedtree.in', opts=OPTS, input=IGATEFILES)
  4742. TargetAdd('libpandaspeedtree.in', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree', 'SRCDIR:panda/src/speedtree'])
  4743. PyTargetAdd('libpandaspeedtree_module.obj', input='libpandaspeedtree.in')
  4744. PyTargetAdd('libpandaspeedtree_module.obj', opts=OPTS)
  4745. PyTargetAdd('libpandaspeedtree_module.obj', opts=['IMOD:libpandaspeedtree', 'ILIB:libpandaspeedtree'])
  4746. TargetAdd('libpandaspeedtree.dll', input='pandaspeedtree_composite1.obj')
  4747. PyTargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_igate.obj')
  4748. TargetAdd('libpandaspeedtree.dll', input='libpandaspeedtree_module.obj')
  4749. TargetAdd('libpandaspeedtree.dll', input=COMMON_PANDA_LIBS)
  4750. TargetAdd('libpandaspeedtree.dll', opts=['SPEEDTREE'])
  4751. if SDK["SPEEDTREEAPI"] == 'OpenGL':
  4752. TargetAdd('libpandaspeedtree.dll', opts=['GL', 'NVIDIACG', 'CGGL'])
  4753. elif SDK["SPEEDTREEAPI"] == 'DirectX9':
  4754. TargetAdd('libpandaspeedtree.dll', opts=['DX9', 'NVIDIACG', 'CGDX9'])
  4755. #
  4756. # DIRECTORY: panda/src/testbed/
  4757. #
  4758. if (not RTDIST and not RUNTIME and PkgSkip("PVIEW")==0):
  4759. OPTS=['DIR:panda/src/testbed']
  4760. TargetAdd('pview_pview.obj', opts=OPTS, input='pview.cxx')
  4761. TargetAdd('pview.exe', input='pview_pview.obj')
  4762. TargetAdd('pview.exe', input='libp3framework.dll')
  4763. if not PkgSkip("EGG"):
  4764. TargetAdd('pview.exe', input='libpandaegg.dll')
  4765. TargetAdd('pview.exe', input=COMMON_PANDA_LIBS)
  4766. TargetAdd('pview.exe', opts=['ADVAPI', 'WINSOCK2', 'WINSHELL'])
  4767. if GetLinkAllStatic() and not PkgSkip("GL"):
  4768. TargetAdd('pview.exe', input='libpandagl.dll')
  4769. #
  4770. # DIRECTORY: panda/src/android/
  4771. #
  4772. if (not RUNTIME and GetTarget() == 'android'):
  4773. OPTS=['DIR:panda/src/android']
  4774. TargetAdd('org/panda3d/android/NativeIStream.class', opts=OPTS, input='NativeIStream.java')
  4775. TargetAdd('org/panda3d/android/NativeOStream.class', opts=OPTS, input='NativeOStream.java')
  4776. TargetAdd('org/panda3d/android/PandaActivity.class', opts=OPTS, input='PandaActivity.java')
  4777. TargetAdd('org/panda3d/android/PythonActivity.class', opts=OPTS, input='PythonActivity.java')
  4778. TargetAdd('p3android_composite1.obj', opts=OPTS, input='p3android_composite1.cxx')
  4779. TargetAdd('libp3android.dll', input='p3android_composite1.obj')
  4780. TargetAdd('libp3android.dll', input=COMMON_PANDA_LIBS)
  4781. TargetAdd('libp3android.dll', opts=['JNIGRAPHICS'])
  4782. TargetAdd('android_native_app_glue.obj', opts=OPTS + ['NOHIDDEN'], input='android_native_app_glue.c')
  4783. TargetAdd('android_main.obj', opts=OPTS, input='android_main.cxx')
  4784. if (not RTDIST and PkgSkip("PVIEW")==0):
  4785. TargetAdd('libpview_pview.obj', opts=OPTS, input='pview.cxx')
  4786. TargetAdd('libpview.dll', input='android_native_app_glue.obj')
  4787. TargetAdd('libpview.dll', input='android_main.obj')
  4788. TargetAdd('libpview.dll', input='libpview_pview.obj')
  4789. TargetAdd('libpview.dll', input='libp3framework.dll')
  4790. if not PkgSkip("EGG"):
  4791. TargetAdd('libpview.dll', input='libpandaegg.dll')
  4792. TargetAdd('libpview.dll', input='libp3android.dll')
  4793. TargetAdd('libpview.dll', input=COMMON_PANDA_LIBS)
  4794. TargetAdd('libpview.dll', opts=['MODULE', 'ANDROID'])
  4795. if (not RTDIST and PkgSkip("PYTHON")==0):
  4796. OPTS += ['PYTHON']
  4797. TargetAdd('ppython_ppython.obj', opts=OPTS, input='python_main.cxx')
  4798. TargetAdd('libppython.dll', input='android_native_app_glue.obj')
  4799. TargetAdd('libppython.dll', input='android_main.obj')
  4800. TargetAdd('libppython.dll', input='ppython_ppython.obj')
  4801. TargetAdd('libppython.dll', input='libp3framework.dll')
  4802. TargetAdd('libppython.dll', input='libp3android.dll')
  4803. TargetAdd('libppython.dll', input=COMMON_PANDA_LIBS)
  4804. TargetAdd('libppython.dll', opts=['MODULE', 'ANDROID', 'PYTHON'])
  4805. #
  4806. # DIRECTORY: panda/src/androiddisplay/
  4807. #
  4808. if (GetTarget() == 'android' and PkgSkip("EGL")==0 and PkgSkip("GLES")==0 and not RUNTIME):
  4809. DefSymbol('GLES', 'OPENGLES_1', '')
  4810. OPTS=['DIR:panda/src/androiddisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4811. TargetAdd('pandagles_androiddisplay_composite1.obj', opts=OPTS, input='p3androiddisplay_composite1.cxx')
  4812. OPTS=['DIR:panda/metalibs/pandagles', 'BUILDING:PANDAGLES', 'GLES', 'EGL']
  4813. TargetAdd('pandagles_pandagles.obj', opts=OPTS, input='pandagles.cxx')
  4814. TargetAdd('libpandagles.dll', input='pandagles_pandagles.obj')
  4815. TargetAdd('libpandagles.dll', input='p3glesgsg_config_glesgsg.obj')
  4816. TargetAdd('libpandagles.dll', input='p3glesgsg_glesgsg.obj')
  4817. TargetAdd('libpandagles.dll', input='pandagles_androiddisplay_composite1.obj')
  4818. TargetAdd('libpandagles.dll', input='libp3android.dll')
  4819. TargetAdd('libpandagles.dll', input=COMMON_PANDA_LIBS)
  4820. TargetAdd('libpandagles.dll', opts=['MODULE', 'GLES', 'EGL'])
  4821. #
  4822. # DIRECTORY: panda/src/tinydisplay/
  4823. #
  4824. if not RUNTIME and not PkgSkip("TINYDISPLAY"):
  4825. OPTS=['DIR:panda/src/tinydisplay', 'BUILDING:TINYDISPLAY']
  4826. if not PkgSkip("X11"):
  4827. OPTS += ['X11']
  4828. TargetAdd('p3tinydisplay_composite1.obj', opts=OPTS, input='p3tinydisplay_composite1.cxx')
  4829. TargetAdd('p3tinydisplay_composite2.obj', opts=OPTS, input='p3tinydisplay_composite2.cxx')
  4830. TargetAdd('p3tinydisplay_ztriangle_1.obj', opts=OPTS, input='ztriangle_1.cxx')
  4831. TargetAdd('p3tinydisplay_ztriangle_2.obj', opts=OPTS, input='ztriangle_2.cxx')
  4832. TargetAdd('p3tinydisplay_ztriangle_3.obj', opts=OPTS, input='ztriangle_3.cxx')
  4833. TargetAdd('p3tinydisplay_ztriangle_4.obj', opts=OPTS, input='ztriangle_4.cxx')
  4834. TargetAdd('p3tinydisplay_ztriangle_table.obj', opts=OPTS, input='ztriangle_table.cxx')
  4835. if GetTarget() == 'darwin':
  4836. if frozenset(OSX_ARCHS) - frozenset(('x86_64', 'arm64')):
  4837. TargetAdd('p3tinydisplay_tinyOsxGraphicsWindow.obj', opts=OPTS, input='tinyOsxGraphicsWindow.mm')
  4838. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_tinyOsxGraphicsWindow.obj')
  4839. TargetAdd('libp3tinydisplay.dll', opts=['CARBON', 'AGL', 'COCOA'])
  4840. elif GetTarget() == 'windows':
  4841. TargetAdd('libp3tinydisplay.dll', input='libp3windisplay.dll')
  4842. TargetAdd('libp3tinydisplay.dll', opts=['WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM'])
  4843. elif not PkgSkip("X11"):
  4844. TargetAdd('libp3tinydisplay.dll', input='p3x11display_composite1.obj')
  4845. TargetAdd('libp3tinydisplay.dll', opts=['X11'])
  4846. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite1.obj')
  4847. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_composite2.obj')
  4848. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_1.obj')
  4849. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_2.obj')
  4850. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_3.obj')
  4851. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_4.obj')
  4852. TargetAdd('libp3tinydisplay.dll', input='p3tinydisplay_ztriangle_table.obj')
  4853. TargetAdd('libp3tinydisplay.dll', input=COMMON_PANDA_LIBS)
  4854. #
  4855. # DIRECTORY: direct/src/directbase/
  4856. #
  4857. if (PkgSkip("DIRECT")==0):
  4858. OPTS=['DIR:direct/src/directbase']
  4859. TargetAdd('p3directbase_directbase.obj', opts=OPTS+['BUILDING:DIRECT'], input='directbase.cxx')
  4860. #
  4861. # DIRECTORY: direct/src/dcparser/
  4862. #
  4863. if (PkgSkip("DIRECT")==0):
  4864. OPTS=['DIR:direct/src/dcparser', 'BUILDING:DIRECT_DCPARSER', 'WITHINPANDA', 'BISONPREFIX_dcyy']
  4865. CreateFile(GetOutputDir()+"/include/dcParser.h")
  4866. PyTargetAdd('p3dcparser_dcParser.obj', opts=OPTS, input='dcParser.yxx')
  4867. #TargetAdd('dcParser.h', input='p3dcparser_dcParser.obj', opts=['DEPENDENCYONLY'])
  4868. PyTargetAdd('p3dcparser_dcLexer.obj', opts=OPTS, input='dcLexer.lxx', dep='p3dcparser_dcParser.obj')
  4869. PyTargetAdd('p3dcparser_composite1.obj', opts=OPTS, input='p3dcparser_composite1.cxx')
  4870. PyTargetAdd('p3dcparser_composite2.obj', opts=OPTS, input='p3dcparser_composite2.cxx')
  4871. OPTS=['DIR:direct/src/dcparser', 'WITHINPANDA']
  4872. IGATEFILES=GetDirectoryContents('direct/src/dcparser', ["*.h", "*_composite*.cxx"])
  4873. if "dcParser.h" in IGATEFILES: IGATEFILES.remove("dcParser.h")
  4874. if "dcmsgtypes.h" in IGATEFILES: IGATEFILES.remove('dcmsgtypes.h')
  4875. TargetAdd('libp3dcparser.in', opts=OPTS, input=IGATEFILES)
  4876. TargetAdd('libp3dcparser.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3dcparser', 'SRCDIR:direct/src/dcparser'])
  4877. #
  4878. # DIRECTORY: direct/src/deadrec/
  4879. #
  4880. if (PkgSkip("DIRECT")==0):
  4881. OPTS=['DIR:direct/src/deadrec', 'BUILDING:DIRECT']
  4882. TargetAdd('p3deadrec_composite1.obj', opts=OPTS, input='p3deadrec_composite1.cxx')
  4883. OPTS=['DIR:direct/src/deadrec']
  4884. IGATEFILES=GetDirectoryContents('direct/src/deadrec', ["*.h", "*_composite*.cxx"])
  4885. TargetAdd('libp3deadrec.in', opts=OPTS, input=IGATEFILES)
  4886. TargetAdd('libp3deadrec.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3deadrec', 'SRCDIR:direct/src/deadrec'])
  4887. #
  4888. # DIRECTORY: direct/src/distributed/
  4889. #
  4890. if (PkgSkip("DIRECT")==0):
  4891. OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
  4892. TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
  4893. PyTargetAdd('p3distributed_cConnectionRepository.obj', opts=OPTS, input='cConnectionRepository.cxx')
  4894. PyTargetAdd('p3distributed_cDistributedSmoothNodeBase.obj', opts=OPTS, input='cDistributedSmoothNodeBase.cxx')
  4895. OPTS=['DIR:direct/src/distributed', 'WITHINPANDA']
  4896. IGATEFILES=GetDirectoryContents('direct/src/distributed', ["*.h", "*.cxx"])
  4897. TargetAdd('libp3distributed.in', opts=OPTS, input=IGATEFILES)
  4898. TargetAdd('libp3distributed.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3distributed', 'SRCDIR:direct/src/distributed'])
  4899. #
  4900. # DIRECTORY: direct/src/interval/
  4901. #
  4902. if (PkgSkip("DIRECT")==0):
  4903. OPTS=['DIR:direct/src/interval', 'BUILDING:DIRECT']
  4904. TargetAdd('p3interval_composite1.obj', opts=OPTS, input='p3interval_composite1.cxx')
  4905. OPTS=['DIR:direct/src/interval']
  4906. IGATEFILES=GetDirectoryContents('direct/src/interval', ["*.h", "*_composite*.cxx"])
  4907. TargetAdd('libp3interval.in', opts=OPTS, input=IGATEFILES)
  4908. TargetAdd('libp3interval.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3interval', 'SRCDIR:direct/src/interval'])
  4909. PyTargetAdd('p3interval_cInterval_ext.obj', opts=OPTS, input='cInterval_ext.cxx')
  4910. #
  4911. # DIRECTORY: direct/src/showbase/
  4912. #
  4913. if (PkgSkip("DIRECT")==0):
  4914. OPTS=['DIR:direct/src/showbase', 'BUILDING:DIRECT']
  4915. TargetAdd('p3showbase_showBase.obj', opts=OPTS, input='showBase.cxx')
  4916. if GetTarget() == 'darwin':
  4917. TargetAdd('p3showbase_showBase_assist.obj', opts=OPTS, input='showBase_assist.mm')
  4918. OPTS=['DIR:direct/src/showbase']
  4919. IGATEFILES=GetDirectoryContents('direct/src/showbase', ["*.h", "showBase.cxx"])
  4920. TargetAdd('libp3showbase.in', opts=OPTS, input=IGATEFILES)
  4921. TargetAdd('libp3showbase.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3showbase', 'SRCDIR:direct/src/showbase'])
  4922. #
  4923. # DIRECTORY: direct/src/motiontrail/
  4924. #
  4925. if (PkgSkip("DIRECT")==0):
  4926. OPTS=['DIR:direct/src/motiontrail', 'BUILDING:DIRECT']
  4927. TargetAdd('p3motiontrail_cMotionTrail.obj', opts=OPTS, input='cMotionTrail.cxx')
  4928. TargetAdd('p3motiontrail_config_motiontrail.obj', opts=OPTS, input='config_motiontrail.cxx')
  4929. OPTS=['DIR:direct/src/motiontrail']
  4930. IGATEFILES=GetDirectoryContents('direct/src/motiontrail', ["*.h", "cMotionTrail.cxx"])
  4931. TargetAdd('libp3motiontrail.in', opts=OPTS, input=IGATEFILES)
  4932. TargetAdd('libp3motiontrail.in', opts=['IMOD:panda3d.direct', 'ILIB:libp3motiontrail', 'SRCDIR:direct/src/motiontrail'])
  4933. #
  4934. # DIRECTORY: direct/metalibs/direct/
  4935. #
  4936. if (PkgSkip("DIRECT")==0):
  4937. TargetAdd('libp3direct.dll', input='p3directbase_directbase.obj')
  4938. TargetAdd('libp3direct.dll', input='p3showbase_showBase.obj')
  4939. if GetTarget() == 'darwin':
  4940. TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
  4941. TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
  4942. TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
  4943. TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
  4944. TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
  4945. TargetAdd('libp3direct.dll', input=COMMON_PANDA_LIBS)
  4946. TargetAdd('libp3direct.dll', opts=['ADVAPI', 'WINUSER', 'WINGDI'])
  4947. PyTargetAdd('direct_module.obj', input='libp3dcparser.in')
  4948. PyTargetAdd('direct_module.obj', input='libp3showbase.in')
  4949. PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
  4950. PyTargetAdd('direct_module.obj', input='libp3interval.in')
  4951. PyTargetAdd('direct_module.obj', input='libp3distributed.in')
  4952. PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
  4953. PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
  4954. PyTargetAdd('direct.pyd', input='libp3dcparser_igate.obj')
  4955. PyTargetAdd('direct.pyd', input='libp3showbase_igate.obj')
  4956. PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
  4957. PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
  4958. PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
  4959. PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
  4960. PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
  4961. # These are part of direct.pyd, not libp3direct.dll, because they rely on
  4962. # the Python libraries. If a C++ user needs these modules, we can move them
  4963. # back and filter out the Python-specific code.
  4964. PyTargetAdd('direct.pyd', input='p3dcparser_composite1.obj')
  4965. PyTargetAdd('direct.pyd', input='p3dcparser_composite2.obj')
  4966. PyTargetAdd('direct.pyd', input='p3dcparser_dcParser.obj')
  4967. PyTargetAdd('direct.pyd', input='p3dcparser_dcLexer.obj')
  4968. PyTargetAdd('direct.pyd', input='p3distributed_config_distributed.obj')
  4969. PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
  4970. PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
  4971. PyTargetAdd('direct.pyd', input='direct_module.obj')
  4972. PyTargetAdd('direct.pyd', input='libp3direct.dll')
  4973. PyTargetAdd('direct.pyd', input='libp3interrogatedb.dll')
  4974. PyTargetAdd('direct.pyd', input=COMMON_PANDA_LIBS)
  4975. PyTargetAdd('direct.pyd', opts=['WINUSER', 'WINGDI', 'WINSOCK2'])
  4976. #
  4977. # DIRECTORY: direct/src/dcparse/
  4978. #
  4979. if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0 and not RTDIST and not RUNTIME):
  4980. OPTS=['DIR:direct/src/dcparse', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'ADVAPI']
  4981. PyTargetAdd('dcparse_dcparse.obj', opts=OPTS, input='dcparse.cxx')
  4982. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite1.obj')
  4983. PyTargetAdd('p3dcparse.exe', input='p3dcparser_composite2.obj')
  4984. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcParser.obj')
  4985. PyTargetAdd('p3dcparse.exe', input='p3dcparser_dcLexer.obj')
  4986. PyTargetAdd('p3dcparse.exe', input='dcparse_dcparse.obj')
  4987. PyTargetAdd('p3dcparse.exe', input='libp3direct.dll')
  4988. PyTargetAdd('p3dcparse.exe', input=COMMON_PANDA_LIBS)
  4989. #PyTargetAdd('p3dcparse.exe', input='libp3pystub.lib')
  4990. PyTargetAdd('p3dcparse.exe', opts=['ADVAPI'])
  4991. #
  4992. # DIRECTORY: direct/src/plugin/
  4993. #
  4994. if (RTDIST or RUNTIME):
  4995. # Explicitly define this as we don't include dtool_config.h here.
  4996. if GetTarget() not in ('windows', 'darwin'):
  4997. DefSymbol("RUNTIME", "HAVE_X11", "1")
  4998. OPTS=['DIR:direct/src/plugin', 'BUILDING:P3D_PLUGIN', 'RUNTIME', 'OPENSSL']
  4999. TargetAdd('plugin_common.obj', opts=OPTS, input='plugin_common_composite1.cxx')
  5000. OPTS += ['ZLIB', 'MSIMG']
  5001. TargetAdd('plugin_plugin.obj', opts=OPTS, input='p3d_plugin_composite1.cxx')
  5002. TargetAdd('plugin_mkdir_complete.obj', opts=OPTS, input='mkdir_complete.cxx')
  5003. TargetAdd('plugin_wstring_encode.obj', opts=OPTS, input='wstring_encode.cxx')
  5004. TargetAdd('plugin_parse_color.obj', opts=OPTS, input='parse_color.cxx')
  5005. TargetAdd('plugin_get_twirl_data.obj', opts=OPTS, input='get_twirl_data.cxx')
  5006. TargetAdd('plugin_find_root_dir.obj', opts=OPTS, input='find_root_dir.cxx')
  5007. if GetTarget() == 'darwin':
  5008. TargetAdd('plugin_find_root_dir_assist.obj', opts=OPTS, input='find_root_dir_assist.mm')
  5009. TargetAdd('plugin_binaryXml.obj', opts=OPTS, input='binaryXml.cxx')
  5010. TargetAdd('plugin_fileSpec.obj', opts=OPTS, input='fileSpec.cxx')
  5011. TargetAdd('plugin_handleStream.obj', opts=OPTS, input='handleStream.cxx')
  5012. TargetAdd('plugin_handleStreamBuf.obj', opts=OPTS, input='handleStreamBuf.cxx')
  5013. if (RTDIST):
  5014. for fname in ("p3d_plugin.dll", "libp3d_plugin_static.ilb"):
  5015. TargetAdd(fname, input='plugin_plugin.obj')
  5016. TargetAdd(fname, input='plugin_mkdir_complete.obj')
  5017. TargetAdd(fname, input='plugin_wstring_encode.obj')
  5018. TargetAdd(fname, input='plugin_parse_color.obj')
  5019. TargetAdd(fname, input='plugin_find_root_dir.obj')
  5020. if GetTarget() == 'darwin':
  5021. TargetAdd(fname, input='plugin_find_root_dir_assist.obj')
  5022. TargetAdd(fname, input='plugin_fileSpec.obj')
  5023. TargetAdd(fname, input='plugin_binaryXml.obj')
  5024. TargetAdd(fname, input='plugin_handleStream.obj')
  5025. TargetAdd(fname, input='plugin_handleStreamBuf.obj')
  5026. TargetAdd(fname, input='libp3tinyxml.ilb')
  5027. if GetTarget() == 'darwin':
  5028. TargetAdd(fname, input='libp3subprocbuffer.ilb')
  5029. TargetAdd(fname, opts=['OPENSSL', 'ZLIB', 'X11', 'ADVAPI', 'WINUSER', 'WINGDI', 'WINSHELL', 'WINCOMCTL', 'WINOLE', 'MSIMG'])
  5030. TargetAdd("libp3d_plugin_static.ilb", input='plugin_get_twirl_data.obj')
  5031. if (PkgSkip("PYTHON")==0 and RTDIST):
  5032. # Freeze VFSImporter and its dependency modules into p3dpython.
  5033. # Mark panda3d.core as a dependency to make sure to build that first.
  5034. TargetAdd('p3dpython_frozen.obj', input='VFSImporter.py', opts=['DIR:direct/src/showbase', 'FREEZE_STARTUP'])
  5035. TargetAdd('p3dpython_frozen.obj', dep='core.pyd')
  5036. OPTS += ['PYTHON']
  5037. TargetAdd('p3dpython_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5038. TargetAdd('p3dpython_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5039. TargetAdd('p3dpython.exe', input='p3dpython_p3dpython_composite1.obj')
  5040. TargetAdd('p3dpython.exe', input='p3dpython_p3dPythonMain.obj')
  5041. TargetAdd('p3dpython.exe', input='p3dpython_frozen.obj')
  5042. TargetAdd('p3dpython.exe', input=COMMON_PANDA_LIBS)
  5043. TargetAdd('p3dpython.exe', input='libp3tinyxml.ilb')
  5044. TargetAdd('p3dpython.exe', input='libp3interrogatedb.dll')
  5045. TargetAdd('p3dpython.exe', opts=['PYTHON', 'WINUSER'])
  5046. TargetAdd('libp3dpython.dll', input='p3dpython_p3dpython_composite1.obj')
  5047. TargetAdd('libp3dpython.dll', input='p3dpython_frozen.obj')
  5048. TargetAdd('libp3dpython.dll', input=COMMON_PANDA_LIBS)
  5049. TargetAdd('libp3dpython.dll', input='libp3tinyxml.ilb')
  5050. TargetAdd('libp3dpython.dll', input='libp3interrogatedb.dll')
  5051. TargetAdd('libp3dpython.dll', opts=['PYTHON', 'WINUSER'])
  5052. if GetTarget() == 'windows':
  5053. DefSymbol("NON_CONSOLE", "NON_CONSOLE", "")
  5054. OPTS.append("NON_CONSOLE")
  5055. TargetAdd('p3dpythonw_p3dpython_composite1.obj', opts=OPTS, input='p3dpython_composite1.cxx')
  5056. TargetAdd('p3dpythonw_p3dPythonMain.obj', opts=OPTS, input='p3dPythonMain.cxx')
  5057. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dpython_composite1.obj')
  5058. TargetAdd('p3dpythonw.exe', input='p3dpythonw_p3dPythonMain.obj')
  5059. TargetAdd('p3dpythonw.exe', input='p3dpython_frozen.obj')
  5060. TargetAdd('p3dpythonw.exe', input=COMMON_PANDA_LIBS)
  5061. TargetAdd('p3dpythonw.exe', input='libp3tinyxml.ilb')
  5062. TargetAdd('p3dpythonw.exe', input='libp3interrogatedb.dll')
  5063. TargetAdd('p3dpythonw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINUSER'])
  5064. if (PkgSkip("OPENSSL")==0 and RTDIST and False):
  5065. OPTS=['DIR:direct/src/plugin', 'DIR:panda/src/express', 'OPENSSL']
  5066. if GetTarget() == 'darwin':
  5067. OPTS += ['OPT:2']
  5068. if (PkgSkip("FLTK")==0):
  5069. OPTS.append("FLTK")
  5070. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert.cxx')
  5071. TargetAdd('plugin_p3dCert_strings.obj', opts=OPTS, input='p3dCert_strings.cxx')
  5072. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5073. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5074. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5075. TargetAdd('p3dcert.exe', input='plugin_p3dCert_strings.obj')
  5076. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'FLTK', 'X11', 'WINCOMCTL', 'WINSOCK', 'WINGDI', 'WINUSER', 'ADVAPI', 'WINOLE', 'WINSHELL', 'SUBSYSTEM:WINDOWS']
  5077. if GetTarget() == 'darwin':
  5078. OPTS += ['OPT:2']
  5079. TargetAdd('p3dcert.exe', opts=OPTS)
  5080. elif (PkgSkip("WX")==0):
  5081. OPTS += ["WX", "RTTI"]
  5082. TargetAdd('plugin_p3dCert.obj', opts=OPTS, input='p3dCert_wx.cxx')
  5083. TargetAdd('p3dcert.exe', input='plugin_mkdir_complete.obj')
  5084. TargetAdd('p3dcert.exe', input='plugin_wstring_encode.obj')
  5085. TargetAdd('p3dcert.exe', input='plugin_p3dCert.obj')
  5086. OPTS=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'WX', 'CARBON', 'WINOLE', 'WINOLEAUT', 'WINUSER', 'ADVAPI', 'WINSHELL', 'WINCOMCTL', 'WINGDI', 'WINCOMDLG']
  5087. if GetTarget() == "darwin":
  5088. OPTS += ['GL', 'OPT:2']
  5089. TargetAdd('p3dcert.exe', opts=OPTS)
  5090. #
  5091. # DIRECTORY: direct/src/plugin_npapi/
  5092. #
  5093. if RUNTIME:
  5094. OPTS=['DIR:direct/src/plugin_npapi', 'RUNTIME', 'GTK2']
  5095. if GetTarget() == 'windows':
  5096. nppanda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5097. "version" : VERSION,
  5098. "description" : "Runs 3-D games and interactive applets",
  5099. "filename" : "nppanda3d.dll",
  5100. "mimetype" : "application/x-panda3d",
  5101. "extension" : "p3d",
  5102. "filedesc" : "Panda3D applet"}
  5103. TargetAdd('nppanda3d.res', opts=OPTS, winrc=nppanda3d_rc)
  5104. elif GetTarget() == 'darwin':
  5105. TargetAdd('nppanda3d.rsrc', opts=OPTS, input='nppanda3d.r')
  5106. OPTS += ['GTK2']
  5107. TargetAdd('plugin_npapi_nppanda3d_composite1.obj', opts=OPTS, input='nppanda3d_composite1.cxx')
  5108. TargetAdd('nppanda3d.plugin', input='plugin_common.obj')
  5109. TargetAdd('nppanda3d.plugin', input='plugin_parse_color.obj')
  5110. TargetAdd('nppanda3d.plugin', input='plugin_get_twirl_data.obj')
  5111. TargetAdd('nppanda3d.plugin', input='plugin_wstring_encode.obj')
  5112. TargetAdd('nppanda3d.plugin', input='plugin_npapi_nppanda3d_composite1.obj')
  5113. if GetTarget() == 'windows':
  5114. TargetAdd('nppanda3d.plugin', input='nppanda3d.res')
  5115. TargetAdd('nppanda3d.plugin', input='nppanda3d.def', ipath=OPTS)
  5116. elif GetTarget() == 'darwin':
  5117. TargetAdd('nppanda3d.plugin', input='nppanda3d.rsrc')
  5118. TargetAdd('nppanda3d.plugin', input='nppanda3d.plist', ipath=OPTS)
  5119. TargetAdd('nppanda3d.plugin', input='plugin_find_root_dir_assist.obj')
  5120. TargetAdd('nppanda3d.plugin', input='libp3tinyxml.ilb')
  5121. TargetAdd('nppanda3d.plugin', opts=['OPENSSL', 'WINGDI', 'WINUSER', 'WINSHELL', 'WINOLE', 'CARBON'])
  5122. #
  5123. # DIRECTORY: direct/src/plugin_activex/
  5124. #
  5125. if (RUNTIME and GetTarget() == 'windows' and PkgSkip("MFC")==0):
  5126. OPTS=['DIR:direct/src/plugin_activex', 'RUNTIME', 'ACTIVEX', 'MFC']
  5127. DefSymbol('ACTIVEX', '_USRDLL', '')
  5128. DefSymbol('ACTIVEX', '_WINDLL', '')
  5129. DefSymbol('ACTIVEX', '_AFXDLL', '')
  5130. DefSymbol('ACTIVEX', '_MBCS', '')
  5131. TargetAdd('P3DActiveX.tlb', opts=OPTS, input='P3DActiveX.idl')
  5132. TargetAdd('P3DActiveX.res', opts=OPTS, input='P3DActiveX.rc')
  5133. TargetAdd('plugin_activex_p3dactivex_composite1.obj', opts=OPTS, input='p3dactivex_composite1.cxx')
  5134. TargetAdd('p3dactivex.ocx', input='plugin_common.obj')
  5135. TargetAdd('p3dactivex.ocx', input='plugin_parse_color.obj')
  5136. TargetAdd('p3dactivex.ocx', input='plugin_get_twirl_data.obj')
  5137. TargetAdd('p3dactivex.ocx', input='plugin_wstring_encode.obj')
  5138. TargetAdd('p3dactivex.ocx', input='plugin_activex_p3dactivex_composite1.obj')
  5139. TargetAdd('p3dactivex.ocx', input='P3DActiveX.res')
  5140. TargetAdd('p3dactivex.ocx', input='P3DActiveX.def', ipath=OPTS)
  5141. TargetAdd('p3dactivex.ocx', input='libp3tinyxml.ilb')
  5142. TargetAdd('p3dactivex.ocx', opts=['MFC', 'WINSOCK2', 'OPENSSL', 'WINGDI', 'WINUSER'])
  5143. #
  5144. # DIRECTORY: direct/src/plugin_standalone/
  5145. #
  5146. if (RUNTIME):
  5147. OPTS=['DIR:direct/src/plugin_standalone', 'RUNTIME', 'OPENSSL']
  5148. TargetAdd('plugin_standalone_panda3d.obj', opts=OPTS, input='panda3d.cxx')
  5149. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5150. if GetTarget() == 'windows':
  5151. panda3d_rc = {"name" : "Panda3D Game Engine Plug-in",
  5152. "version" : VERSION,
  5153. "description" : "Runs 3-D games and interactive applets",
  5154. "filename" : "panda3d.exe",
  5155. "mimetype" : "application/x-panda3d",
  5156. "extension" : "p3d",
  5157. "filedesc" : "Panda3D applet",
  5158. "icon" : "panda3d.ico"}
  5159. TargetAdd('panda3d.res', opts=OPTS, winrc=panda3d_rc)
  5160. TargetAdd('plugin_standalone_panda3dMain.obj', opts=OPTS, input='panda3dMain.cxx')
  5161. TargetAdd('panda3d.exe', input='plugin_standalone_panda3d.obj')
  5162. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dMain.obj')
  5163. TargetAdd('panda3d.exe', input='plugin_standalone_panda3dBase.obj')
  5164. TargetAdd('panda3d.exe', input='plugin_common.obj')
  5165. TargetAdd('panda3d.exe', input='plugin_wstring_encode.obj')
  5166. if GetTarget() == 'darwin':
  5167. TargetAdd('panda3d.exe', input='plugin_find_root_dir_assist.obj')
  5168. elif GetTarget() == 'windows':
  5169. TargetAdd('panda3d.exe', input='panda3d.res')
  5170. TargetAdd('panda3d.exe', input='libpandaexpress.dll')
  5171. TargetAdd('panda3d.exe', input='libp3dtoolconfig.dll')
  5172. TargetAdd('panda3d.exe', input='libp3dtool.dll')
  5173. #TargetAdd('panda3d.exe', input='libp3pystub.lib')
  5174. TargetAdd('panda3d.exe', input='libp3tinyxml.ilb')
  5175. TargetAdd('panda3d.exe', opts=['NOICON', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5176. if (GetTarget() == 'darwin'):
  5177. TargetAdd('plugin_standalone_panda3dMac.obj', opts=OPTS, input='panda3dMac.cxx')
  5178. TargetAdd('Panda3D.app', input='plugin_standalone_panda3d.obj')
  5179. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dMac.obj')
  5180. TargetAdd('Panda3D.app', input='plugin_standalone_panda3dBase.obj')
  5181. TargetAdd('Panda3D.app', input='plugin_common.obj')
  5182. TargetAdd('Panda3D.app', input='plugin_find_root_dir_assist.obj')
  5183. TargetAdd('Panda3D.app', input='libpandaexpress.dll')
  5184. TargetAdd('Panda3D.app', input='libp3dtoolconfig.dll')
  5185. TargetAdd('Panda3D.app', input='libp3dtool.dll')
  5186. #TargetAdd('Panda3D.app', input='libp3pystub.lib')
  5187. TargetAdd('Panda3D.app', input='libp3tinyxml.ilb')
  5188. TargetAdd('Panda3D.app', input='panda3d_mac.plist', ipath=OPTS)
  5189. TargetAdd('Panda3D.app', input='models/plugin_images/panda3d.icns')
  5190. TargetAdd('Panda3D.app', opts=['OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5191. elif (GetTarget() == 'windows'):
  5192. TargetAdd('plugin_standalone_panda3dWinMain.obj', opts=OPTS, input='panda3dWinMain.cxx')
  5193. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3d.obj')
  5194. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dWinMain.obj')
  5195. TargetAdd('panda3dw.exe', input='plugin_standalone_panda3dBase.obj')
  5196. TargetAdd('panda3dw.exe', input='plugin_wstring_encode.obj')
  5197. TargetAdd('panda3dw.exe', input='plugin_common.obj')
  5198. TargetAdd('panda3dw.exe', input='libpandaexpress.dll')
  5199. TargetAdd('panda3dw.exe', input='libp3dtoolconfig.dll')
  5200. TargetAdd('panda3dw.exe', input='libp3dtool.dll')
  5201. #TargetAdd('panda3dw.exe', input='libp3pystub.lib')
  5202. TargetAdd('panda3dw.exe', input='libp3tinyxml.ilb')
  5203. TargetAdd('panda3dw.exe', opts=['SUBSYSTEM:WINDOWS', 'OPENSSL', 'ZLIB', 'WINGDI', 'WINUSER', 'WINSHELL', 'ADVAPI', 'WINSOCK2', 'WINOLE', 'CARBON'])
  5204. if (RTDIST):
  5205. 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']
  5206. # This is arguably a big fat ugly hack, but doing it otherwise would complicate the build process considerably.
  5207. DefSymbol("P3DEMBED", "LINK_ALL_STATIC", "")
  5208. TargetAdd('plugin_standalone_panda3dBase.obj', opts=OPTS, input='panda3dBase.cxx')
  5209. TargetAdd('plugin_standalone_p3dEmbedMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5210. TargetAdd('plugin_standalone_p3dEmbed.obj', opts=OPTS, input='p3dEmbed.cxx')
  5211. #TargetAdd('plugin_standalone_pystub.obj', opts=OPTS, input='pystub.cxx')
  5212. TargetAdd('plugin_standalone_dtoolbase_composite1.obj', opts=OPTS, input='p3dtoolbase_composite1.cxx')
  5213. TargetAdd('plugin_standalone_dtoolbase_composite2.obj', opts=OPTS, input='p3dtoolbase_composite2.cxx')
  5214. TargetAdd('plugin_standalone_lookup3.obj', opts=OPTS, input='lookup3.c')
  5215. TargetAdd('plugin_standalone_indent.obj', opts=OPTS, input='indent.cxx')
  5216. TargetAdd('plugin_standalone_dtoolutil_composite1.obj', opts=OPTS, input='p3dtoolutil_composite1.cxx')
  5217. TargetAdd('plugin_standalone_dtoolutil_composite2.obj', opts=OPTS, input='p3dtoolutil_composite2.cxx')
  5218. if (GetTarget() == 'darwin'):
  5219. TargetAdd('plugin_standalone_dtoolutil_filename_assist.obj', opts=OPTS, input='filename_assist.mm')
  5220. TargetAdd('plugin_standalone_prc_composite1.obj', opts=OPTS, input='p3prc_composite1.cxx')
  5221. TargetAdd('plugin_standalone_prc_composite2.obj', opts=OPTS, input='p3prc_composite2.cxx')
  5222. TargetAdd('plugin_standalone_express_composite1.obj', opts=OPTS, input='p3express_composite1.cxx')
  5223. TargetAdd('plugin_standalone_express_composite2.obj', opts=OPTS, input='p3express_composite2.cxx')
  5224. TargetAdd('plugin_standalone_downloader_composite1.obj', opts=OPTS, input='p3downloader_composite1.cxx')
  5225. TargetAdd('plugin_standalone_downloader_composite2.obj', opts=OPTS, input='p3downloader_composite2.cxx')
  5226. TargetAdd('p3dembed.exe', input='plugin_standalone_panda3dBase.obj')
  5227. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbedMain.obj')
  5228. TargetAdd('p3dembed.exe', input='plugin_standalone_p3dEmbed.obj')
  5229. #TargetAdd('p3dembed.exe', input='plugin_standalone_pystub.obj')
  5230. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5231. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5232. TargetAdd('p3dembed.exe', input='plugin_standalone_lookup3.obj')
  5233. TargetAdd('p3dembed.exe', input='plugin_standalone_indent.obj')
  5234. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5235. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5236. if GetTarget() == 'darwin':
  5237. TargetAdd('p3dembed.exe', input='plugin_standalone_dtoolutil_filename_assist.obj')
  5238. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite1.obj')
  5239. TargetAdd('p3dembed.exe', input='plugin_standalone_prc_composite2.obj')
  5240. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite1.obj')
  5241. TargetAdd('p3dembed.exe', input='plugin_standalone_express_composite2.obj')
  5242. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite1.obj')
  5243. TargetAdd('p3dembed.exe', input='plugin_standalone_downloader_composite2.obj')
  5244. TargetAdd('p3dembed.exe', input='plugin_common.obj')
  5245. if GetTarget() == 'darwin':
  5246. TargetAdd('p3dembed.exe', input='plugin_find_root_dir_assist.obj')
  5247. TargetAdd('p3dembed.exe', input='libp3subprocbuffer.ilb')
  5248. TargetAdd('p3dembed.exe', input='libp3tinyxml.ilb')
  5249. TargetAdd('p3dembed.exe', input='libp3d_plugin_static.ilb')
  5250. TargetAdd('p3dembed.exe', opts=['NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'CARBON', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL', 'X11'])
  5251. if GetTarget() == 'windows':
  5252. OPTS.append("P3DEMBEDW")
  5253. DefSymbol("P3DEMBEDW", "P3DEMBEDW", "")
  5254. TargetAdd('plugin_standalone_p3dEmbedWinMain.obj', opts=OPTS, input='p3dEmbedMain.cxx')
  5255. TargetAdd('p3dembedw.exe', input='plugin_standalone_panda3dBase.obj')
  5256. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbedWinMain.obj')
  5257. TargetAdd('p3dembedw.exe', input='plugin_standalone_p3dEmbed.obj')
  5258. #TargetAdd('p3dembedw.exe', input='plugin_standalone_pystub.obj')
  5259. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite1.obj')
  5260. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolbase_composite2.obj')
  5261. TargetAdd('p3dembedw.exe', input='plugin_standalone_lookup3.obj')
  5262. TargetAdd('p3dembedw.exe', input='plugin_standalone_indent.obj')
  5263. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite1.obj')
  5264. TargetAdd('p3dembedw.exe', input='plugin_standalone_dtoolutil_composite2.obj')
  5265. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite1.obj')
  5266. TargetAdd('p3dembedw.exe', input='plugin_standalone_prc_composite2.obj')
  5267. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite1.obj')
  5268. TargetAdd('p3dembedw.exe', input='plugin_standalone_express_composite2.obj')
  5269. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite1.obj')
  5270. TargetAdd('p3dembedw.exe', input='plugin_standalone_downloader_composite2.obj')
  5271. TargetAdd('p3dembedw.exe', input='plugin_common.obj')
  5272. TargetAdd('p3dembedw.exe', input='libp3tinyxml.ilb')
  5273. TargetAdd('p3dembedw.exe', input='libp3d_plugin_static.ilb')
  5274. TargetAdd('p3dembedw.exe', opts=['SUBSYSTEM:WINDOWS', 'NOICON', 'WINGDI', 'WINSOCK2', 'ZLIB', 'WINUSER', 'OPENSSL', 'WINOLE', 'MSIMG', 'WINCOMCTL', 'ADVAPI', 'WINSHELL'])
  5275. #
  5276. # DIRECTORY: pandatool/src/pandatoolbase/
  5277. #
  5278. if (PkgSkip("PANDATOOL")==0):
  5279. OPTS=['DIR:pandatool/src/pandatoolbase']
  5280. TargetAdd('p3pandatoolbase_composite1.obj', opts=OPTS, input='p3pandatoolbase_composite1.cxx')
  5281. TargetAdd('libp3pandatoolbase.lib', input='p3pandatoolbase_composite1.obj')
  5282. #
  5283. # DIRECTORY: pandatool/src/converter/
  5284. #
  5285. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5286. OPTS=['DIR:pandatool/src/converter']
  5287. TargetAdd('p3converter_somethingToEggConverter.obj', opts=OPTS, input='somethingToEggConverter.cxx')
  5288. TargetAdd('p3converter_eggToSomethingConverter.obj', opts=OPTS, input='eggToSomethingConverter.cxx')
  5289. TargetAdd('libp3converter.lib', input='p3converter_somethingToEggConverter.obj')
  5290. TargetAdd('libp3converter.lib', input='p3converter_eggToSomethingConverter.obj')
  5291. #
  5292. # DIRECTORY: pandatool/src/progbase/
  5293. #
  5294. if not PkgSkip("PANDATOOL"):
  5295. OPTS=['DIR:pandatool/src/progbase', 'ZLIB']
  5296. TargetAdd('p3progbase_composite1.obj', opts=OPTS, input='p3progbase_composite1.cxx')
  5297. TargetAdd('libp3progbase.lib', input='p3progbase_composite1.obj')
  5298. #
  5299. # DIRECTORY: pandatool/src/eggbase/
  5300. #
  5301. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5302. OPTS=['DIR:pandatool/src/eggbase']
  5303. TargetAdd('p3eggbase_composite1.obj', opts=OPTS, input='p3eggbase_composite1.cxx')
  5304. TargetAdd('libp3eggbase.lib', input='p3eggbase_composite1.obj')
  5305. #
  5306. # DIRECTORY: pandatool/src/bam/
  5307. #
  5308. if not PkgSkip("PANDATOOL"):
  5309. OPTS=['DIR:pandatool/src/bam']
  5310. TargetAdd('bam-info_bamInfo.obj', opts=OPTS, input='bamInfo.cxx')
  5311. TargetAdd('bam-info.exe', input='bam-info_bamInfo.obj')
  5312. TargetAdd('bam-info.exe', input='libp3progbase.lib')
  5313. TargetAdd('bam-info.exe', input='libp3pandatoolbase.lib')
  5314. TargetAdd('bam-info.exe', input=COMMON_PANDA_LIBS)
  5315. TargetAdd('bam-info.exe', opts=['ADVAPI', 'FFTW'])
  5316. if not PkgSkip("EGG"):
  5317. TargetAdd('bam2egg_bamToEgg.obj', opts=OPTS, input='bamToEgg.cxx')
  5318. TargetAdd('bam2egg.exe', input='bam2egg_bamToEgg.obj')
  5319. TargetAdd('bam2egg.exe', input=COMMON_EGG2X_LIBS)
  5320. TargetAdd('bam2egg.exe', opts=['ADVAPI', 'FFTW'])
  5321. TargetAdd('egg2bam_eggToBam.obj', opts=OPTS, input='eggToBam.cxx')
  5322. TargetAdd('egg2bam.exe', input='egg2bam_eggToBam.obj')
  5323. TargetAdd('egg2bam.exe', input=COMMON_EGG2X_LIBS)
  5324. TargetAdd('egg2bam.exe', opts=['ADVAPI', 'FFTW'])
  5325. #
  5326. # DIRECTORY: pandatool/src/cvscopy/
  5327. #
  5328. if not PkgSkip("PANDATOOL"):
  5329. OPTS=['DIR:pandatool/src/cvscopy']
  5330. TargetAdd('p3cvscopy_composite1.obj', opts=OPTS, input='p3cvscopy_composite1.cxx')
  5331. TargetAdd('libp3cvscopy.lib', input='p3cvscopy_composite1.obj')
  5332. #
  5333. # DIRECTORY: pandatool/src/daeegg/
  5334. #
  5335. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5336. OPTS=['DIR:pandatool/src/daeegg', 'FCOLLADA']
  5337. TargetAdd('p3daeegg_composite1.obj', opts=OPTS, input='p3daeegg_composite1.cxx')
  5338. TargetAdd('libp3daeegg.lib', input='p3daeegg_composite1.obj')
  5339. TargetAdd('libp3daeegg.lib', opts=['FCOLLADA', 'CARBON'])
  5340. #
  5341. # DIRECTORY: pandatool/src/assimp
  5342. #
  5343. if not PkgSkip("PANDATOOL") and not PkgSkip("ASSIMP"):
  5344. OPTS=['DIR:pandatool/src/assimp', 'BUILDING:ASSIMP', 'ASSIMP', 'MODULE']
  5345. TargetAdd('p3assimp_composite1.obj', opts=OPTS, input='p3assimp_composite1.cxx')
  5346. TargetAdd('libp3assimp.dll', input='p3assimp_composite1.obj')
  5347. TargetAdd('libp3assimp.dll', input=COMMON_PANDA_LIBS)
  5348. TargetAdd('libp3assimp.dll', opts=OPTS+['ZLIB', 'ADVAPI'])
  5349. #
  5350. # DIRECTORY: pandatool/src/daeprogs/
  5351. #
  5352. if not PkgSkip("PANDATOOL") and not PkgSkip("FCOLLADA") and not PkgSkip("EGG"):
  5353. OPTS=['DIR:pandatool/src/daeprogs', 'FCOLLADA']
  5354. TargetAdd('dae2egg_daeToEgg.obj', opts=OPTS, input='daeToEgg.cxx')
  5355. TargetAdd('dae2egg.exe', input='dae2egg_daeToEgg.obj')
  5356. TargetAdd('dae2egg.exe', input='libp3daeegg.lib')
  5357. TargetAdd('dae2egg.exe', input=COMMON_EGG2X_LIBS)
  5358. TargetAdd('dae2egg.exe', opts=['WINUSER', 'FCOLLADA', 'CARBON'])
  5359. #
  5360. # DIRECTORY: pandatool/src/dxf/
  5361. #
  5362. if not PkgSkip("PANDATOOL"):
  5363. OPTS=['DIR:pandatool/src/dxf']
  5364. TargetAdd('p3dxf_composite1.obj', opts=OPTS, input='p3dxf_composite1.cxx')
  5365. TargetAdd('libp3dxf.lib', input='p3dxf_composite1.obj')
  5366. #
  5367. # DIRECTORY: pandatool/src/dxfegg/
  5368. #
  5369. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5370. OPTS=['DIR:pandatool/src/dxfegg']
  5371. TargetAdd('p3dxfegg_dxfToEggConverter.obj', opts=OPTS, input='dxfToEggConverter.cxx')
  5372. TargetAdd('p3dxfegg_dxfToEggLayer.obj', opts=OPTS, input='dxfToEggLayer.cxx')
  5373. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggConverter.obj')
  5374. TargetAdd('libp3dxfegg.lib', input='p3dxfegg_dxfToEggLayer.obj')
  5375. #
  5376. # DIRECTORY: pandatool/src/dxfprogs/
  5377. #
  5378. if not PkgSkip("PANDATOOL"):
  5379. OPTS=['DIR:pandatool/src/dxfprogs']
  5380. TargetAdd('dxf-points_dxfPoints.obj', opts=OPTS, input='dxfPoints.cxx')
  5381. TargetAdd('dxf-points.exe', input='dxf-points_dxfPoints.obj')
  5382. TargetAdd('dxf-points.exe', input='libp3progbase.lib')
  5383. TargetAdd('dxf-points.exe', input='libp3dxf.lib')
  5384. TargetAdd('dxf-points.exe', input='libp3pandatoolbase.lib')
  5385. TargetAdd('dxf-points.exe', input=COMMON_PANDA_LIBS)
  5386. TargetAdd('dxf-points.exe', opts=['ADVAPI', 'FFTW'])
  5387. if not PkgSkip("EGG"):
  5388. TargetAdd('dxf2egg_dxfToEgg.obj', opts=OPTS, input='dxfToEgg.cxx')
  5389. TargetAdd('dxf2egg.exe', input='dxf2egg_dxfToEgg.obj')
  5390. TargetAdd('dxf2egg.exe', input='libp3dxfegg.lib')
  5391. TargetAdd('dxf2egg.exe', input='libp3dxf.lib')
  5392. TargetAdd('dxf2egg.exe', input=COMMON_EGG2X_LIBS)
  5393. TargetAdd('dxf2egg.exe', opts=['ADVAPI', 'FFTW'])
  5394. TargetAdd('egg2dxf_eggToDXF.obj', opts=OPTS, input='eggToDXF.cxx')
  5395. TargetAdd('egg2dxf_eggToDXFLayer.obj', opts=OPTS, input='eggToDXFLayer.cxx')
  5396. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXF.obj')
  5397. TargetAdd('egg2dxf.exe', input='egg2dxf_eggToDXFLayer.obj')
  5398. TargetAdd('egg2dxf.exe', input='libp3dxf.lib')
  5399. TargetAdd('egg2dxf.exe', input=COMMON_EGG2X_LIBS)
  5400. TargetAdd('egg2dxf.exe', opts=['ADVAPI', 'FFTW'])
  5401. #
  5402. # DIRECTORY: pandatool/src/objegg/
  5403. #
  5404. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5405. OPTS=['DIR:pandatool/src/objegg']
  5406. TargetAdd('p3objegg_objToEggConverter.obj', opts=OPTS, input='objToEggConverter.cxx')
  5407. TargetAdd('p3objegg_eggToObjConverter.obj', opts=OPTS, input='eggToObjConverter.cxx')
  5408. TargetAdd('p3objegg_config_objegg.obj', opts=OPTS, input='config_objegg.cxx')
  5409. TargetAdd('libp3objegg.lib', input='p3objegg_objToEggConverter.obj')
  5410. TargetAdd('libp3objegg.lib', input='p3objegg_eggToObjConverter.obj')
  5411. TargetAdd('libp3objegg.lib', input='p3objegg_config_objegg.obj')
  5412. #
  5413. # DIRECTORY: pandatool/src/objprogs/
  5414. #
  5415. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5416. OPTS=['DIR:pandatool/src/objprogs']
  5417. TargetAdd('obj2egg_objToEgg.obj', opts=OPTS, input='objToEgg.cxx')
  5418. TargetAdd('obj2egg.exe', input='obj2egg_objToEgg.obj')
  5419. TargetAdd('obj2egg.exe', input='libp3objegg.lib')
  5420. TargetAdd('obj2egg.exe', input=COMMON_EGG2X_LIBS)
  5421. TargetAdd('egg2obj_eggToObj.obj', opts=OPTS, input='eggToObj.cxx')
  5422. TargetAdd('egg2obj.exe', input='egg2obj_eggToObj.obj')
  5423. TargetAdd('egg2obj.exe', input='libp3objegg.lib')
  5424. TargetAdd('egg2obj.exe', input=COMMON_EGG2X_LIBS)
  5425. #
  5426. # DIRECTORY: pandatool/src/palettizer/
  5427. #
  5428. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5429. OPTS=['DIR:pandatool/src/palettizer']
  5430. TargetAdd('p3palettizer_composite1.obj', opts=OPTS, input='p3palettizer_composite1.cxx')
  5431. TargetAdd('libp3palettizer.lib', input='p3palettizer_composite1.obj')
  5432. #
  5433. # DIRECTORY: pandatool/src/egg-mkfont/
  5434. #
  5435. if not PkgSkip("FREETYPE") and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5436. OPTS=['DIR:pandatool/src/egg-mkfont', 'DIR:pandatool/src/palettizer', 'FREETYPE']
  5437. TargetAdd('egg-mkfont_eggMakeFont.obj', opts=OPTS, input='eggMakeFont.cxx')
  5438. TargetAdd('egg-mkfont_rangeDescription.obj', opts=OPTS, input='rangeDescription.cxx')
  5439. TargetAdd('egg-mkfont_rangeIterator.obj', opts=OPTS, input='rangeIterator.cxx')
  5440. TargetAdd('egg-mkfont.exe', input='egg-mkfont_eggMakeFont.obj')
  5441. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeDescription.obj')
  5442. TargetAdd('egg-mkfont.exe', input='egg-mkfont_rangeIterator.obj')
  5443. TargetAdd('egg-mkfont.exe', input='libp3palettizer.lib')
  5444. TargetAdd('egg-mkfont.exe', input=COMMON_EGG2X_LIBS)
  5445. TargetAdd('egg-mkfont.exe', opts=['ADVAPI', 'FREETYPE'])
  5446. #
  5447. # DIRECTORY: pandatool/src/eggcharbase/
  5448. #
  5449. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5450. OPTS=['DIR:pandatool/src/eggcharbase', 'ZLIB']
  5451. TargetAdd('p3eggcharbase_composite1.obj', opts=OPTS, input='p3eggcharbase_composite1.cxx')
  5452. TargetAdd('libp3eggcharbase.lib', input='p3eggcharbase_composite1.obj')
  5453. #
  5454. # DIRECTORY: pandatool/src/egg-optchar/
  5455. #
  5456. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5457. OPTS=['DIR:pandatool/src/egg-optchar']
  5458. TargetAdd('egg-optchar_config_egg_optchar.obj', opts=OPTS, input='config_egg_optchar.cxx')
  5459. TargetAdd('egg-optchar_eggOptchar.obj', opts=OPTS, input='eggOptchar.cxx')
  5460. TargetAdd('egg-optchar_eggOptcharUserData.obj', opts=OPTS, input='eggOptcharUserData.cxx')
  5461. TargetAdd('egg-optchar_vertexMembership.obj', opts=OPTS, input='vertexMembership.cxx')
  5462. TargetAdd('egg-optchar.exe', input='egg-optchar_config_egg_optchar.obj')
  5463. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptchar.obj')
  5464. TargetAdd('egg-optchar.exe', input='egg-optchar_eggOptcharUserData.obj')
  5465. TargetAdd('egg-optchar.exe', input='egg-optchar_vertexMembership.obj')
  5466. TargetAdd('egg-optchar.exe', input='libp3eggcharbase.lib')
  5467. TargetAdd('egg-optchar.exe', input=COMMON_EGG2X_LIBS)
  5468. TargetAdd('egg-optchar.exe', opts=['ADVAPI', 'FREETYPE'])
  5469. #
  5470. # DIRECTORY: pandatool/src/egg-palettize/
  5471. #
  5472. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5473. OPTS=['DIR:pandatool/src/egg-palettize', 'DIR:pandatool/src/palettizer']
  5474. TargetAdd('egg-palettize_eggPalettize.obj', opts=OPTS, input='eggPalettize.cxx')
  5475. TargetAdd('egg-palettize.exe', input='egg-palettize_eggPalettize.obj')
  5476. TargetAdd('egg-palettize.exe', input='libp3palettizer.lib')
  5477. TargetAdd('egg-palettize.exe', input=COMMON_EGG2X_LIBS)
  5478. TargetAdd('egg-palettize.exe', opts=['ADVAPI'])
  5479. #
  5480. # DIRECTORY: pandatool/src/egg-qtess/
  5481. #
  5482. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5483. OPTS=['DIR:pandatool/src/egg-qtess']
  5484. TargetAdd('egg-qtess_composite1.obj', opts=OPTS, input='egg-qtess_composite1.cxx')
  5485. TargetAdd('egg-qtess.exe', input='egg-qtess_composite1.obj')
  5486. TargetAdd('egg-qtess.exe', input='libp3eggbase.lib')
  5487. TargetAdd('egg-qtess.exe', input='libp3progbase.lib')
  5488. TargetAdd('egg-qtess.exe', input='libp3converter.lib')
  5489. TargetAdd('egg-qtess.exe', input=COMMON_EGG2X_LIBS)
  5490. TargetAdd('egg-qtess.exe', opts=['ADVAPI'])
  5491. #
  5492. # DIRECTORY: pandatool/src/eggprogs/
  5493. #
  5494. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5495. OPTS=['DIR:pandatool/src/eggprogs']
  5496. TargetAdd('egg-crop_eggCrop.obj', opts=OPTS, input='eggCrop.cxx')
  5497. TargetAdd('egg-crop.exe', input='egg-crop_eggCrop.obj')
  5498. TargetAdd('egg-crop.exe', input=COMMON_EGG2X_LIBS)
  5499. TargetAdd('egg-crop.exe', opts=['ADVAPI'])
  5500. TargetAdd('egg-make-tube_eggMakeTube.obj', opts=OPTS, input='eggMakeTube.cxx')
  5501. TargetAdd('egg-make-tube.exe', input='egg-make-tube_eggMakeTube.obj')
  5502. TargetAdd('egg-make-tube.exe', input=COMMON_EGG2X_LIBS)
  5503. TargetAdd('egg-make-tube.exe', opts=['ADVAPI'])
  5504. TargetAdd('egg-texture-cards_eggTextureCards.obj', opts=OPTS, input='eggTextureCards.cxx')
  5505. TargetAdd('egg-texture-cards.exe', input='egg-texture-cards_eggTextureCards.obj')
  5506. TargetAdd('egg-texture-cards.exe', input=COMMON_EGG2X_LIBS)
  5507. TargetAdd('egg-texture-cards.exe', opts=['ADVAPI'])
  5508. TargetAdd('egg-topstrip_eggTopstrip.obj', opts=OPTS, input='eggTopstrip.cxx')
  5509. TargetAdd('egg-topstrip.exe', input='egg-topstrip_eggTopstrip.obj')
  5510. TargetAdd('egg-topstrip.exe', input='libp3eggcharbase.lib')
  5511. TargetAdd('egg-topstrip.exe', input=COMMON_EGG2X_LIBS)
  5512. TargetAdd('egg-topstrip.exe', opts=['ADVAPI'])
  5513. TargetAdd('egg-trans_eggTrans.obj', opts=OPTS, input='eggTrans.cxx')
  5514. TargetAdd('egg-trans.exe', input='egg-trans_eggTrans.obj')
  5515. TargetAdd('egg-trans.exe', input=COMMON_EGG2X_LIBS)
  5516. TargetAdd('egg-trans.exe', opts=['ADVAPI'])
  5517. TargetAdd('egg2c_eggToC.obj', opts=OPTS, input='eggToC.cxx')
  5518. TargetAdd('egg2c.exe', input='egg2c_eggToC.obj')
  5519. TargetAdd('egg2c.exe', input=COMMON_EGG2X_LIBS)
  5520. TargetAdd('egg2c.exe', opts=['ADVAPI'])
  5521. TargetAdd('egg-rename_eggRename.obj', opts=OPTS, input='eggRename.cxx')
  5522. TargetAdd('egg-rename.exe', input='egg-rename_eggRename.obj')
  5523. TargetAdd('egg-rename.exe', input=COMMON_EGG2X_LIBS)
  5524. TargetAdd('egg-rename.exe', opts=['ADVAPI'])
  5525. TargetAdd('egg-retarget-anim_eggRetargetAnim.obj', opts=OPTS, input='eggRetargetAnim.cxx')
  5526. TargetAdd('egg-retarget-anim.exe', input='egg-retarget-anim_eggRetargetAnim.obj')
  5527. TargetAdd('egg-retarget-anim.exe', input='libp3eggcharbase.lib')
  5528. TargetAdd('egg-retarget-anim.exe', input=COMMON_EGG2X_LIBS)
  5529. TargetAdd('egg-retarget-anim.exe', opts=['ADVAPI'])
  5530. TargetAdd('egg-list-textures_eggListTextures.obj', opts=OPTS, input='eggListTextures.cxx')
  5531. TargetAdd('egg-list-textures.exe', input='egg-list-textures_eggListTextures.obj')
  5532. TargetAdd('egg-list-textures.exe', input=COMMON_EGG2X_LIBS)
  5533. TargetAdd('egg-list-textures.exe', opts=['ADVAPI'])
  5534. #
  5535. # DIRECTORY: pandatool/src/flt/
  5536. #
  5537. if not PkgSkip("PANDATOOL"):
  5538. OPTS=['DIR:pandatool/src/flt', 'ZLIB']
  5539. TargetAdd('p3flt_composite1.obj', opts=OPTS, input='p3flt_composite1.cxx')
  5540. TargetAdd('libp3flt.lib', input=['p3flt_composite1.obj'])
  5541. #
  5542. # DIRECTORY: pandatool/src/fltegg/
  5543. #
  5544. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5545. OPTS=['DIR:pandatool/src/fltegg']
  5546. TargetAdd('p3fltegg_fltToEggConverter.obj', opts=OPTS, input='fltToEggConverter.cxx')
  5547. TargetAdd('p3fltegg_fltToEggLevelState.obj', opts=OPTS, input='fltToEggLevelState.cxx')
  5548. TargetAdd('libp3fltegg.lib', input=['p3fltegg_fltToEggConverter.obj', 'p3fltegg_fltToEggLevelState.obj'])
  5549. #
  5550. # DIRECTORY: pandatool/src/fltprogs/
  5551. #
  5552. if not PkgSkip("PANDATOOL"):
  5553. OPTS=['DIR:pandatool/src/fltprogs', 'DIR:pandatool/src/flt', 'DIR:pandatool/src/cvscopy']
  5554. TargetAdd('flt-info_fltInfo.obj', opts=OPTS, input='fltInfo.cxx')
  5555. TargetAdd('flt-info.exe', input='flt-info_fltInfo.obj')
  5556. TargetAdd('flt-info.exe', input='libp3flt.lib')
  5557. TargetAdd('flt-info.exe', input='libp3progbase.lib')
  5558. TargetAdd('flt-info.exe', input='libp3pandatoolbase.lib')
  5559. TargetAdd('flt-info.exe', input=COMMON_PANDA_LIBS)
  5560. TargetAdd('flt-info.exe', opts=['ADVAPI'])
  5561. TargetAdd('flt-trans_fltTrans.obj', opts=OPTS, input='fltTrans.cxx')
  5562. TargetAdd('flt-trans.exe', input='flt-trans_fltTrans.obj')
  5563. TargetAdd('flt-trans.exe', input='libp3flt.lib')
  5564. TargetAdd('flt-trans.exe', input='libp3progbase.lib')
  5565. TargetAdd('flt-trans.exe', input='libp3pandatoolbase.lib')
  5566. TargetAdd('flt-trans.exe', input=COMMON_PANDA_LIBS)
  5567. TargetAdd('flt-trans.exe', opts=['ADVAPI'])
  5568. TargetAdd('fltcopy_fltCopy.obj', opts=OPTS, input='fltCopy.cxx')
  5569. TargetAdd('fltcopy.exe', input='fltcopy_fltCopy.obj')
  5570. TargetAdd('fltcopy.exe', input='libp3cvscopy.lib')
  5571. TargetAdd('fltcopy.exe', input='libp3flt.lib')
  5572. TargetAdd('fltcopy.exe', input='libp3progbase.lib')
  5573. TargetAdd('fltcopy.exe', input='libp3pandatoolbase.lib')
  5574. TargetAdd('fltcopy.exe', input=COMMON_PANDA_LIBS)
  5575. TargetAdd('fltcopy.exe', opts=['ADVAPI'])
  5576. if not PkgSkip("EGG"):
  5577. TargetAdd('egg2flt_eggToFlt.obj', opts=OPTS, input='eggToFlt.cxx')
  5578. TargetAdd('egg2flt.exe', input='egg2flt_eggToFlt.obj')
  5579. TargetAdd('egg2flt.exe', input='libp3flt.lib')
  5580. TargetAdd('egg2flt.exe', input=COMMON_EGG2X_LIBS)
  5581. TargetAdd('egg2flt.exe', opts=['ADVAPI'])
  5582. TargetAdd('flt2egg_fltToEgg.obj', opts=OPTS, input='fltToEgg.cxx')
  5583. TargetAdd('flt2egg.exe', input='flt2egg_fltToEgg.obj')
  5584. TargetAdd('flt2egg.exe', input='libp3flt.lib')
  5585. TargetAdd('flt2egg.exe', input='libp3fltegg.lib')
  5586. TargetAdd('flt2egg.exe', input=COMMON_EGG2X_LIBS)
  5587. TargetAdd('flt2egg.exe', opts=['ADVAPI'])
  5588. #
  5589. # DIRECTORY: pandatool/src/imagebase/
  5590. #
  5591. if not PkgSkip("PANDATOOL"):
  5592. OPTS=['DIR:pandatool/src/imagebase']
  5593. TargetAdd('p3imagebase_composite1.obj', opts=OPTS, input='p3imagebase_composite1.cxx')
  5594. TargetAdd('libp3imagebase.lib', input='p3imagebase_composite1.obj')
  5595. #
  5596. # DIRECTORY: pandatool/src/imageprogs/
  5597. #
  5598. if not PkgSkip("PANDATOOL"):
  5599. OPTS=['DIR:pandatool/src/imageprogs']
  5600. TargetAdd('image-info_imageInfo.obj', opts=OPTS, input='imageInfo.cxx')
  5601. TargetAdd('image-info.exe', input='image-info_imageInfo.obj')
  5602. TargetAdd('image-info.exe', input='libp3imagebase.lib')
  5603. TargetAdd('image-info.exe', input='libp3progbase.lib')
  5604. TargetAdd('image-info.exe', input='libp3pandatoolbase.lib')
  5605. TargetAdd('image-info.exe', input=COMMON_PANDA_LIBS)
  5606. TargetAdd('image-info.exe', opts=['ADVAPI'])
  5607. TargetAdd('image-resize_imageResize.obj', opts=OPTS, input='imageResize.cxx')
  5608. TargetAdd('image-resize.exe', input='image-resize_imageResize.obj')
  5609. TargetAdd('image-resize.exe', input='libp3imagebase.lib')
  5610. TargetAdd('image-resize.exe', input='libp3progbase.lib')
  5611. TargetAdd('image-resize.exe', input='libp3pandatoolbase.lib')
  5612. TargetAdd('image-resize.exe', input=COMMON_PANDA_LIBS)
  5613. TargetAdd('image-resize.exe', opts=['ADVAPI'])
  5614. TargetAdd('image-trans_imageTrans.obj', opts=OPTS, input='imageTrans.cxx')
  5615. TargetAdd('image-trans.exe', input='image-trans_imageTrans.obj')
  5616. TargetAdd('image-trans.exe', input='libp3imagebase.lib')
  5617. TargetAdd('image-trans.exe', input='libp3progbase.lib')
  5618. TargetAdd('image-trans.exe', input='libp3pandatoolbase.lib')
  5619. TargetAdd('image-trans.exe', input=COMMON_PANDA_LIBS)
  5620. TargetAdd('image-trans.exe', opts=['ADVAPI'])
  5621. #
  5622. # DIRECTORY: pandatool/src/pfmprogs/
  5623. #
  5624. if not PkgSkip("PANDATOOL"):
  5625. OPTS=['DIR:pandatool/src/pfmprogs']
  5626. TargetAdd('pfm-trans_pfmTrans.obj', opts=OPTS, input='pfmTrans.cxx')
  5627. TargetAdd('pfm-trans.exe', input='pfm-trans_pfmTrans.obj')
  5628. TargetAdd('pfm-trans.exe', input='libp3progbase.lib')
  5629. TargetAdd('pfm-trans.exe', input='libp3pandatoolbase.lib')
  5630. TargetAdd('pfm-trans.exe', input=COMMON_PANDA_LIBS)
  5631. TargetAdd('pfm-trans.exe', opts=['ADVAPI'])
  5632. TargetAdd('pfm-bba_pfmBba.obj', opts=OPTS, input='pfmBba.cxx')
  5633. TargetAdd('pfm-bba_config_pfmprogs.obj', opts=OPTS, input='config_pfmprogs.cxx')
  5634. TargetAdd('pfm-bba.exe', input='pfm-bba_pfmBba.obj')
  5635. TargetAdd('pfm-bba.exe', input='pfm-bba_config_pfmprogs.obj')
  5636. TargetAdd('pfm-bba.exe', input='libp3progbase.lib')
  5637. TargetAdd('pfm-bba.exe', input='libp3pandatoolbase.lib')
  5638. TargetAdd('pfm-bba.exe', input=COMMON_PANDA_LIBS)
  5639. TargetAdd('pfm-bba.exe', opts=['ADVAPI'])
  5640. #
  5641. # DIRECTORY: pandatool/src/lwo/
  5642. #
  5643. if not PkgSkip("PANDATOOL"):
  5644. OPTS=['DIR:pandatool/src/lwo']
  5645. TargetAdd('p3lwo_composite1.obj', opts=OPTS, input='p3lwo_composite1.cxx')
  5646. TargetAdd('libp3lwo.lib', input='p3lwo_composite1.obj')
  5647. #
  5648. # DIRECTORY: pandatool/src/lwoegg/
  5649. #
  5650. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5651. OPTS=['DIR:pandatool/src/lwoegg']
  5652. TargetAdd('p3lwoegg_composite1.obj', opts=OPTS, input='p3lwoegg_composite1.cxx')
  5653. TargetAdd('libp3lwoegg.lib', input='p3lwoegg_composite1.obj')
  5654. #
  5655. # DIRECTORY: pandatool/src/lwoprogs/
  5656. #
  5657. if not PkgSkip("PANDATOOL"):
  5658. OPTS=['DIR:pandatool/src/lwoprogs', 'DIR:pandatool/src/lwo']
  5659. TargetAdd('lwo-scan_lwoScan.obj', opts=OPTS, input='lwoScan.cxx')
  5660. TargetAdd('lwo-scan.exe', input='lwo-scan_lwoScan.obj')
  5661. TargetAdd('lwo-scan.exe', input='libp3lwo.lib')
  5662. TargetAdd('lwo-scan.exe', input='libp3progbase.lib')
  5663. TargetAdd('lwo-scan.exe', input='libp3pandatoolbase.lib')
  5664. TargetAdd('lwo-scan.exe', input=COMMON_PANDA_LIBS)
  5665. TargetAdd('lwo-scan.exe', opts=['ADVAPI'])
  5666. if not PkgSkip("EGG"):
  5667. TargetAdd('lwo2egg_lwoToEgg.obj', opts=OPTS, input='lwoToEgg.cxx')
  5668. TargetAdd('lwo2egg.exe', input='lwo2egg_lwoToEgg.obj')
  5669. TargetAdd('lwo2egg.exe', input='libp3lwo.lib')
  5670. TargetAdd('lwo2egg.exe', input='libp3lwoegg.lib')
  5671. TargetAdd('lwo2egg.exe', input=COMMON_EGG2X_LIBS)
  5672. TargetAdd('lwo2egg.exe', opts=['ADVAPI'])
  5673. #
  5674. # DIRECTORY: pandatool/src/maya/
  5675. #
  5676. for VER in MAYAVERSIONS:
  5677. VNUM=VER[4:]
  5678. if not PkgSkip(VER) and not PkgSkip("PANDATOOL"):
  5679. OPTS=['DIR:pandatool/src/maya', VER]
  5680. TargetAdd('maya'+VNUM+'_composite1.obj', opts=OPTS, input='p3maya_composite1.cxx')
  5681. TargetAdd('libmaya'+VNUM+'.lib', input='maya'+VNUM+'_composite1.obj')
  5682. #
  5683. # DIRECTORY: pandatool/src/mayaegg/
  5684. #
  5685. for VER in MAYAVERSIONS:
  5686. VNUM=VER[4:]
  5687. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5688. OPTS=['DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/maya', VER]
  5689. TargetAdd('mayaegg'+VNUM+'_loader.obj', opts=OPTS, input='mayaEggLoader.cxx')
  5690. TargetAdd('mayaegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3mayaegg_composite1.cxx')
  5691. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_loader.obj')
  5692. TargetAdd('libmayaegg'+VNUM+'.lib', input='mayaegg'+VNUM+'_composite1.obj')
  5693. #
  5694. # DIRECTORY: pandatool/src/maxegg/
  5695. #
  5696. for VER in MAXVERSIONS:
  5697. VNUM=VER[3:]
  5698. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5699. OPTS=['DIR:pandatool/src/maxegg', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5700. TargetAdd('maxEgg'+VNUM+'.res', opts=OPTS, input='maxEgg.rc')
  5701. TargetAdd('maxegg'+VNUM+'_loader.obj', opts=OPTS, input='maxEggLoader.cxx')
  5702. TargetAdd('maxegg'+VNUM+'_composite1.obj', opts=OPTS, input='p3maxegg_composite1.cxx')
  5703. TargetAdd('maxegg'+VNUM+'.dlo', input='maxegg'+VNUM+'_composite1.obj')
  5704. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg'+VNUM+'.res')
  5705. TargetAdd('maxegg'+VNUM+'.dlo', input='maxEgg.def', ipath=OPTS)
  5706. TargetAdd('maxegg'+VNUM+'.dlo', input=COMMON_EGG2X_LIBS)
  5707. TargetAdd('maxegg'+VNUM+'.dlo', opts=OPTS)
  5708. #
  5709. # DIRECTORY: pandatool/src/maxprogs/
  5710. #
  5711. for VER in MAXVERSIONS:
  5712. VNUM=VER[3:]
  5713. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5714. OPTS=['DIR:pandatool/src/maxprogs', VER, "WINCOMCTL", "WINCOMDLG", "WINUSER", "MSFORSCOPE", "RTTI"]
  5715. TargetAdd('maxImportRes.res', opts=OPTS, input='maxImportRes.rc')
  5716. TargetAdd('maxprogs'+VNUM+'_maxeggimport.obj', opts=OPTS, input='maxEggImport.cxx')
  5717. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxegg'+VNUM+'_loader.obj')
  5718. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxprogs'+VNUM+'_maxeggimport.obj')
  5719. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaegg.dll')
  5720. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpanda.dll')
  5721. TargetAdd('maxeggimport'+VNUM+'.dle', input='libpandaexpress.dll')
  5722. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxImportRes.res')
  5723. TargetAdd('maxeggimport'+VNUM+'.dle', input='maxEggImport.def', ipath=OPTS)
  5724. TargetAdd('maxeggimport'+VNUM+'.dle', input=COMMON_DTOOL_LIBS)
  5725. TargetAdd('maxeggimport'+VNUM+'.dle', opts=OPTS)
  5726. #
  5727. # DIRECTORY: pandatool/src/vrml/
  5728. #
  5729. if not PkgSkip("PANDATOOL"):
  5730. OPTS=['DIR:pandatool/src/vrml', 'ZLIB', 'BISONPREFIX_vrmlyy']
  5731. CreateFile(GetOutputDir()+"/include/vrmlParser.h")
  5732. TargetAdd('p3vrml_vrmlParser.obj', opts=OPTS, input='vrmlParser.yxx')
  5733. TargetAdd('vrmlParser.h', input='p3vrml_vrmlParser.obj', opts=['DEPENDENCYONLY'])
  5734. TargetAdd('p3vrml_vrmlLexer.obj', opts=OPTS, input='vrmlLexer.lxx')
  5735. TargetAdd('p3vrml_parse_vrml.obj', opts=OPTS, input='parse_vrml.cxx')
  5736. TargetAdd('p3vrml_standard_nodes.obj', opts=OPTS, input='standard_nodes.cxx')
  5737. TargetAdd('p3vrml_vrmlNode.obj', opts=OPTS, input='vrmlNode.cxx')
  5738. TargetAdd('p3vrml_vrmlNodeType.obj', opts=OPTS, input='vrmlNodeType.cxx')
  5739. TargetAdd('libp3vrml.lib', input='p3vrml_parse_vrml.obj')
  5740. TargetAdd('libp3vrml.lib', input='p3vrml_standard_nodes.obj')
  5741. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNode.obj')
  5742. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlNodeType.obj')
  5743. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlParser.obj')
  5744. TargetAdd('libp3vrml.lib', input='p3vrml_vrmlLexer.obj')
  5745. #
  5746. # DIRECTORY: pandatool/src/vrmlegg/
  5747. #
  5748. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5749. OPTS=['DIR:pandatool/src/vrmlegg', 'DIR:pandatool/src/vrml']
  5750. TargetAdd('p3vrmlegg_indexedFaceSet.obj', opts=OPTS, input='indexedFaceSet.cxx')
  5751. TargetAdd('p3vrmlegg_vrmlAppearance.obj', opts=OPTS, input='vrmlAppearance.cxx')
  5752. TargetAdd('p3vrmlegg_vrmlToEggConverter.obj', opts=OPTS, input='vrmlToEggConverter.cxx')
  5753. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_indexedFaceSet.obj')
  5754. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlAppearance.obj')
  5755. TargetAdd('libp3vrmlegg.lib', input='p3vrmlegg_vrmlToEggConverter.obj')
  5756. #
  5757. # DIRECTORY: pandatool/src/xfile/
  5758. #
  5759. if not PkgSkip("PANDATOOL"):
  5760. OPTS=['DIR:pandatool/src/xfile', 'ZLIB', 'BISONPREFIX_xyy', 'FLEXDASHI']
  5761. CreateFile(GetOutputDir()+"/include/xParser.h")
  5762. TargetAdd('p3xfile_xParser.obj', opts=OPTS, input='xParser.yxx')
  5763. TargetAdd('xParser.h', input='p3xfile_xParser.obj', opts=['DEPENDENCYONLY'])
  5764. TargetAdd('p3xfile_xLexer.obj', opts=OPTS, input='xLexer.lxx')
  5765. TargetAdd('p3xfile_composite1.obj', opts=OPTS, input='p3xfile_composite1.cxx')
  5766. TargetAdd('libp3xfile.lib', input='p3xfile_composite1.obj')
  5767. TargetAdd('libp3xfile.lib', input='p3xfile_xParser.obj')
  5768. TargetAdd('libp3xfile.lib', input='p3xfile_xLexer.obj')
  5769. #
  5770. # DIRECTORY: pandatool/src/xfileegg/
  5771. #
  5772. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5773. OPTS=['DIR:pandatool/src/xfileegg', 'DIR:pandatool/src/xfile']
  5774. TargetAdd('p3xfileegg_composite1.obj', opts=OPTS, input='p3xfileegg_composite1.cxx')
  5775. TargetAdd('libp3xfileegg.lib', input='p3xfileegg_composite1.obj')
  5776. #
  5777. # DIRECTORY: pandatool/src/ptloader/
  5778. #
  5779. if not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5780. if not PkgSkip("FCOLLADA"):
  5781. DefSymbol("FCOLLADA", "HAVE_FCOLLADA")
  5782. 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']
  5783. TargetAdd('p3ptloader_config_ptloader.obj', opts=OPTS, input='config_ptloader.cxx', dep='dtool_have_fcollada.dat')
  5784. TargetAdd('p3ptloader_loaderFileTypePandatool.obj', opts=OPTS, input='loaderFileTypePandatool.cxx')
  5785. TargetAdd('libp3ptloader.dll', input='p3ptloader_config_ptloader.obj')
  5786. TargetAdd('libp3ptloader.dll', input='p3ptloader_loaderFileTypePandatool.obj')
  5787. TargetAdd('libp3ptloader.dll', input='libp3fltegg.lib')
  5788. TargetAdd('libp3ptloader.dll', input='libp3flt.lib')
  5789. TargetAdd('libp3ptloader.dll', input='libp3lwoegg.lib')
  5790. TargetAdd('libp3ptloader.dll', input='libp3lwo.lib')
  5791. TargetAdd('libp3ptloader.dll', input='libp3dxfegg.lib')
  5792. TargetAdd('libp3ptloader.dll', input='libp3dxf.lib')
  5793. TargetAdd('libp3ptloader.dll', input='libp3objegg.lib')
  5794. TargetAdd('libp3ptloader.dll', input='libp3vrmlegg.lib')
  5795. TargetAdd('libp3ptloader.dll', input='libp3vrml.lib')
  5796. TargetAdd('libp3ptloader.dll', input='libp3xfileegg.lib')
  5797. TargetAdd('libp3ptloader.dll', input='libp3xfile.lib')
  5798. if (PkgSkip("FCOLLADA")==0): TargetAdd('libp3ptloader.dll', input='libp3daeegg.lib')
  5799. TargetAdd('libp3ptloader.dll', input='libp3eggbase.lib')
  5800. TargetAdd('libp3ptloader.dll', input='libp3progbase.lib')
  5801. TargetAdd('libp3ptloader.dll', input='libp3converter.lib')
  5802. TargetAdd('libp3ptloader.dll', input='libp3pandatoolbase.lib')
  5803. TargetAdd('libp3ptloader.dll', input='libpandaegg.dll')
  5804. TargetAdd('libp3ptloader.dll', input=COMMON_PANDA_LIBS)
  5805. TargetAdd('libp3ptloader.dll', opts=['MODULE', 'ADVAPI', 'FCOLLADA', 'WINUSER'])
  5806. #
  5807. # DIRECTORY: pandatool/src/miscprogs/
  5808. #
  5809. # This is a bit of an esoteric tool, and it causes issues because
  5810. # it conflicts with tools of the same name in different packages.
  5811. #if (PkgSkip("PANDATOOL")==0):
  5812. # OPTS=['DIR:pandatool/src/miscprogs']
  5813. # TargetAdd('bin2c_binToC.obj', opts=OPTS, input='binToC.cxx')
  5814. # TargetAdd('bin2c.exe', input='bin2c_binToC.obj')
  5815. # TargetAdd('bin2c.exe', input='libp3progbase.lib')
  5816. # TargetAdd('bin2c.exe', input='libp3pandatoolbase.lib')
  5817. # TargetAdd('bin2c.exe', input=COMMON_PANDA_LIBS)
  5818. # TargetAdd('bin2c.exe', opts=['ADVAPI'])
  5819. #
  5820. # DIRECTORY: pandatool/src/pstatserver/
  5821. #
  5822. if (PkgSkip("PANDATOOL")==0):
  5823. OPTS=['DIR:pandatool/src/pstatserver']
  5824. TargetAdd('p3pstatserver_composite1.obj', opts=OPTS, input='p3pstatserver_composite1.cxx')
  5825. TargetAdd('libp3pstatserver.lib', input='p3pstatserver_composite1.obj')
  5826. #
  5827. # DIRECTORY: pandatool/src/text-stats/
  5828. #
  5829. if (PkgSkip("PANDATOOL")==0):
  5830. OPTS=['DIR:pandatool/src/text-stats']
  5831. TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
  5832. TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
  5833. TargetAdd('text-stats.exe', input='text-stats_textMonitor.obj')
  5834. TargetAdd('text-stats.exe', input='text-stats_textStats.obj')
  5835. TargetAdd('text-stats.exe', input='libp3progbase.lib')
  5836. TargetAdd('text-stats.exe', input='libp3pstatserver.lib')
  5837. TargetAdd('text-stats.exe', input='libp3pandatoolbase.lib')
  5838. TargetAdd('text-stats.exe', input=COMMON_PANDA_LIBS)
  5839. TargetAdd('text-stats.exe', opts=['ADVAPI'])
  5840. #
  5841. # DIRECTORY: pandatool/src/vrmlprogs/
  5842. #
  5843. if not PkgSkip("PANDATOOL"):
  5844. OPTS=['DIR:pandatool/src/vrmlprogs', 'DIR:pandatool/src/vrml', 'DIR:pandatool/src/vrmlegg']
  5845. TargetAdd('vrml-trans_vrmlTrans.obj', opts=OPTS, input='vrmlTrans.cxx')
  5846. TargetAdd('vrml-trans.exe', input='vrml-trans_vrmlTrans.obj')
  5847. TargetAdd('vrml-trans.exe', input='libp3vrml.lib')
  5848. TargetAdd('vrml-trans.exe', input='libp3progbase.lib')
  5849. TargetAdd('vrml-trans.exe', input='libp3pandatoolbase.lib')
  5850. TargetAdd('vrml-trans.exe', input=COMMON_PANDA_LIBS)
  5851. TargetAdd('vrml-trans.exe', opts=['ADVAPI'])
  5852. if not PkgSkip("EGG"):
  5853. TargetAdd('vrml2egg_vrmlToEgg.obj', opts=OPTS, input='vrmlToEgg.cxx')
  5854. TargetAdd('vrml2egg.exe', input='vrml2egg_vrmlToEgg.obj')
  5855. TargetAdd('vrml2egg.exe', input='libp3vrmlegg.lib')
  5856. TargetAdd('vrml2egg.exe', input='libp3vrml.lib')
  5857. TargetAdd('vrml2egg.exe', input=COMMON_EGG2X_LIBS)
  5858. TargetAdd('vrml2egg.exe', opts=['ADVAPI'])
  5859. #
  5860. # DIRECTORY: pandatool/src/win-stats/
  5861. # DIRECTORY: pandatool/src/gtk-stats/
  5862. #
  5863. if (PkgSkip("PANDATOOL")==0 and (GetTarget() == 'windows' or PkgSkip("GTK2")==0)):
  5864. if GetTarget() == 'windows':
  5865. OPTS=['DIR:pandatool/src/win-stats']
  5866. TargetAdd('pstats_composite1.obj', opts=OPTS, input='winstats_composite1.cxx')
  5867. else:
  5868. OPTS=['DIR:pandatool/src/gtk-stats', 'GTK2']
  5869. TargetAdd('pstats_composite1.obj', opts=OPTS, input='gtkstats_composite1.cxx')
  5870. TargetAdd('pstats.exe', input='pstats_composite1.obj')
  5871. TargetAdd('pstats.exe', input='libp3pstatserver.lib')
  5872. TargetAdd('pstats.exe', input='libp3progbase.lib')
  5873. TargetAdd('pstats.exe', input='libp3pandatoolbase.lib')
  5874. TargetAdd('pstats.exe', input=COMMON_PANDA_LIBS)
  5875. TargetAdd('pstats.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSOCK', 'WINIMM', 'WINGDI', 'WINKERNEL', 'WINOLDNAMES', 'WINUSER', 'WINMM', 'GTK2'])
  5876. #
  5877. # DIRECTORY: pandatool/src/xfileprogs/
  5878. #
  5879. if not PkgSkip("PANDATOOL"):
  5880. OPTS=['DIR:pandatool/src/xfileprogs', 'DIR:pandatool/src/xfile', 'DIR:pandatool/src/xfileegg']
  5881. TargetAdd('x-trans_xFileTrans.obj', opts=OPTS, input='xFileTrans.cxx')
  5882. TargetAdd('x-trans.exe', input='x-trans_xFileTrans.obj')
  5883. TargetAdd('x-trans.exe', input='libp3progbase.lib')
  5884. TargetAdd('x-trans.exe', input='libp3xfile.lib')
  5885. TargetAdd('x-trans.exe', input='libp3pandatoolbase.lib')
  5886. TargetAdd('x-trans.exe', input=COMMON_PANDA_LIBS)
  5887. TargetAdd('x-trans.exe', opts=['ADVAPI'])
  5888. if not PkgSkip("EGG"):
  5889. TargetAdd('egg2x_eggToX.obj', opts=OPTS, input='eggToX.cxx')
  5890. TargetAdd('egg2x.exe', input='egg2x_eggToX.obj')
  5891. TargetAdd('egg2x.exe', input='libp3xfileegg.lib')
  5892. TargetAdd('egg2x.exe', input='libp3xfile.lib')
  5893. TargetAdd('egg2x.exe', input=COMMON_EGG2X_LIBS)
  5894. TargetAdd('egg2x.exe', opts=['ADVAPI'])
  5895. TargetAdd('x2egg_xFileToEgg.obj', opts=OPTS, input='xFileToEgg.cxx')
  5896. TargetAdd('x2egg.exe', input='x2egg_xFileToEgg.obj')
  5897. TargetAdd('x2egg.exe', input='libp3xfileegg.lib')
  5898. TargetAdd('x2egg.exe', input='libp3xfile.lib')
  5899. TargetAdd('x2egg.exe', input=COMMON_EGG2X_LIBS)
  5900. TargetAdd('x2egg.exe', opts=['ADVAPI'])
  5901. #
  5902. # DIRECTORY: pandatool/src/mayaprogs/
  5903. #
  5904. for VER in MAYAVERSIONS:
  5905. VNUM = VER[4:]
  5906. if not PkgSkip(VER) and not PkgSkip("PANDATOOL") and not PkgSkip("EGG"):
  5907. if GetTarget() == 'darwin' and int(VNUM) >= 2012:
  5908. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:I386', 'NOARCH:ARM64']
  5909. if len(OSX_ARCHS) != 0 and 'x86_64' not in OSX_ARCHS:
  5910. continue
  5911. elif GetTarget() == 'darwin' and int(VNUM) >= 2009:
  5912. ARCH_OPTS = ['NOARCH:PPC', 'NOARCH:ARM64']
  5913. elif GetTarget() == 'darwin':
  5914. ARCH_OPTS = ['NOARCH:X86_64', 'NOARCH:ARM64']
  5915. else:
  5916. ARCH_OPTS = []
  5917. OPTS=['DIR:pandatool/src/mayaprogs', 'DIR:pandatool/src/maya', 'DIR:pandatool/src/mayaegg', 'DIR:pandatool/src/cvscopy', 'BUILDING:MISC', VER] + ARCH_OPTS
  5918. TargetAdd('mayaeggimport'+VNUM+'_mayaeggimport.obj', opts=OPTS, input='mayaEggImport.cxx')
  5919. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaegg'+VNUM+'_loader.obj')
  5920. TargetAdd('mayaeggimport'+VNUM+'.mll', input='mayaeggimport'+VNUM+'_mayaeggimport.obj')
  5921. TargetAdd('mayaeggimport'+VNUM+'.mll', input='libpandaegg.dll')
  5922. TargetAdd('mayaeggimport'+VNUM+'.mll', input=COMMON_PANDA_LIBS)
  5923. #if GetTarget() == 'windows':
  5924. # TargetAdd('mayaeggimport'+VNUM+'.mll', input='libp3pystub.lib')
  5925. TargetAdd('mayaeggimport'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5926. TargetAdd('mayaloader'+VNUM+'_config_mayaloader.obj', opts=OPTS, input='config_mayaloader.cxx')
  5927. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='mayaloader'+VNUM+'_config_mayaloader.obj')
  5928. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmayaegg'+VNUM+'.lib')
  5929. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3ptloader.dll')
  5930. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libmaya'+VNUM+'.lib')
  5931. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3fltegg.lib')
  5932. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3flt.lib')
  5933. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwoegg.lib')
  5934. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3lwo.lib')
  5935. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxfegg.lib')
  5936. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3dxf.lib')
  5937. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3objegg.lib')
  5938. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrmlegg.lib')
  5939. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3vrml.lib')
  5940. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfileegg.lib')
  5941. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3xfile.lib')
  5942. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3eggbase.lib')
  5943. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3progbase.lib')
  5944. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3converter.lib')
  5945. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libp3pandatoolbase.lib')
  5946. TargetAdd('libp3mayaloader'+VNUM+'.dll', input='libpandaegg.dll')
  5947. TargetAdd('libp3mayaloader'+VNUM+'.dll', input=COMMON_PANDA_LIBS)
  5948. TargetAdd('libp3mayaloader'+VNUM+'.dll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5949. TargetAdd('mayapview'+VNUM+'_mayaPview.obj', opts=OPTS, input='mayaPview.cxx')
  5950. TargetAdd('libmayapview'+VNUM+'.mll', input='mayapview'+VNUM+'_mayaPview.obj')
  5951. TargetAdd('libmayapview'+VNUM+'.mll', input='libmayaegg'+VNUM+'.lib')
  5952. TargetAdd('libmayapview'+VNUM+'.mll', input='libmaya'+VNUM+'.lib')
  5953. TargetAdd('libmayapview'+VNUM+'.mll', input='libp3framework.dll')
  5954. if GetTarget() == 'windows':
  5955. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5956. else:
  5957. TargetAdd('libmayapview'+VNUM+'.mll', input=COMMON_EGG2X_LIBS)
  5958. TargetAdd('libmayapview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5959. TargetAdd('maya2egg'+VNUM+'_mayaToEgg.obj', opts=OPTS, input='mayaToEgg.cxx')
  5960. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='maya2egg'+VNUM+'_mayaToEgg.obj')
  5961. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5962. TargetAdd('maya2egg'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5963. if GetTarget() == 'windows':
  5964. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5965. else:
  5966. TargetAdd('maya2egg'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5967. TargetAdd('maya2egg'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5968. TargetAdd('egg2maya'+VNUM+'_eggToMaya.obj', opts=OPTS, input='eggToMaya.cxx')
  5969. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='egg2maya'+VNUM+'_eggToMaya.obj')
  5970. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmayaegg'+VNUM+'.lib')
  5971. TargetAdd('egg2maya'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5972. if GetTarget() == 'windows':
  5973. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5974. else:
  5975. TargetAdd('egg2maya'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5976. TargetAdd('egg2maya'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5977. TargetAdd('mayacopy'+VNUM+'_mayaCopy.obj', opts=OPTS, input='mayaCopy.cxx')
  5978. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='mayacopy'+VNUM+'_mayaCopy.obj')
  5979. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libp3cvscopy.lib')
  5980. TargetAdd('mayacopy'+VNUM+'_bin.exe', input='libmaya'+VNUM+'.lib')
  5981. if GetTarget() == 'windows':
  5982. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5983. else:
  5984. TargetAdd('mayacopy'+VNUM+'_bin.exe', input=COMMON_EGG2X_LIBS)
  5985. TargetAdd('mayacopy'+VNUM+'_bin.exe', opts=['ADVAPI', VER]+ARCH_OPTS)
  5986. TargetAdd('mayasavepview'+VNUM+'_mayaSavePview.obj', opts=OPTS, input='mayaSavePview.cxx')
  5987. TargetAdd('libmayasavepview'+VNUM+'.mll', input='mayasavepview'+VNUM+'_mayaSavePview.obj')
  5988. TargetAdd('libmayasavepview'+VNUM+'.mll', opts=['ADVAPI', VER]+ARCH_OPTS)
  5989. TargetAdd('mayapath'+VNUM+'.obj', opts=OPTS, input='mayapath.cxx')
  5990. TargetAdd('maya2egg'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5991. TargetAdd('maya2egg'+VNUM+'.exe', input='libpandaexpress.dll')
  5992. TargetAdd('maya2egg'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5993. TargetAdd('maya2egg'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5994. TargetAdd('egg2maya'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5995. TargetAdd('egg2maya'+VNUM+'.exe', input='libpandaexpress.dll')
  5996. TargetAdd('egg2maya'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  5997. TargetAdd('egg2maya'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  5998. TargetAdd('mayacopy'+VNUM+'.exe', input='mayapath'+VNUM+'.obj')
  5999. TargetAdd('mayacopy'+VNUM+'.exe', input='libpandaexpress.dll')
  6000. TargetAdd('mayacopy'+VNUM+'.exe', input=COMMON_DTOOL_LIBS)
  6001. TargetAdd('mayacopy'+VNUM+'.exe', opts=['ADVAPI']+ARCH_OPTS)
  6002. #
  6003. # DIRECTORY: contrib/src/ai/
  6004. #
  6005. if (PkgSkip("CONTRIB")==0 and not RUNTIME):
  6006. OPTS=['DIR:contrib/src/ai', 'BUILDING:PANDAAI']
  6007. TargetAdd('p3ai_composite1.obj', opts=OPTS, input='p3ai_composite1.cxx')
  6008. TargetAdd('libpandaai.dll', input='p3ai_composite1.obj')
  6009. TargetAdd('libpandaai.dll', input=COMMON_PANDA_LIBS)
  6010. OPTS=['DIR:contrib/src/ai']
  6011. IGATEFILES=GetDirectoryContents('contrib/src/ai', ["*.h", "*_composite*.cxx"])
  6012. TargetAdd('libpandaai.in', opts=OPTS, input=IGATEFILES)
  6013. TargetAdd('libpandaai.in', opts=['IMOD:panda3d.ai', 'ILIB:libpandaai', 'SRCDIR:contrib/src/ai'])
  6014. PyTargetAdd('ai_module.obj', input='libpandaai.in')
  6015. PyTargetAdd('ai_module.obj', opts=OPTS)
  6016. PyTargetAdd('ai_module.obj', opts=['IMOD:panda3d.ai', 'ILIB:ai', 'IMPORT:panda3d.core'])
  6017. PyTargetAdd('ai.pyd', input='ai_module.obj')
  6018. PyTargetAdd('ai.pyd', input='libpandaai_igate.obj')
  6019. PyTargetAdd('ai.pyd', input='libpandaai.dll')
  6020. PyTargetAdd('ai.pyd', input='libp3interrogatedb.dll')
  6021. PyTargetAdd('ai.pyd', input=COMMON_PANDA_LIBS)
  6022. #
  6023. # DIRECTORY: contrib/src/rplight/
  6024. #
  6025. if not PkgSkip("CONTRIB") and not PkgSkip("PYTHON") and not RUNTIME:
  6026. OPTS=['DIR:contrib/src/rplight', 'BUILDING:RPLIGHT']
  6027. TargetAdd('p3rplight_composite1.obj', opts=OPTS, input='p3rplight_composite1.cxx')
  6028. IGATEFILES=GetDirectoryContents('contrib/src/rplight', ["*.h", "*_composite*.cxx"])
  6029. TargetAdd('libp3rplight.in', opts=OPTS, input=IGATEFILES)
  6030. TargetAdd('libp3rplight.in', opts=['IMOD:panda3d._rplight', 'ILIB:libp3rplight', 'SRCDIR:contrib/src/rplight'])
  6031. PyTargetAdd('rplight_module.obj', input='libp3rplight.in')
  6032. PyTargetAdd('rplight_module.obj', opts=OPTS)
  6033. PyTargetAdd('rplight_module.obj', opts=['IMOD:panda3d._rplight', 'ILIB:_rplight', 'IMPORT:panda3d.core'])
  6034. PyTargetAdd('_rplight.pyd', input='rplight_module.obj')
  6035. PyTargetAdd('_rplight.pyd', input='libp3rplight_igate.obj')
  6036. PyTargetAdd('_rplight.pyd', input='p3rplight_composite1.obj')
  6037. PyTargetAdd('_rplight.pyd', input='libp3interrogatedb.dll')
  6038. PyTargetAdd('_rplight.pyd', input=COMMON_PANDA_LIBS)
  6039. #
  6040. # DIRECTORY: pandatool/src/deploy-stub
  6041. #
  6042. if PkgSkip("PYTHON") == 0:
  6043. OPTS=['DIR:pandatool/src/deploy-stub', 'BUILDING:DEPLOYSTUB']
  6044. PyTargetAdd('deploy-stub.obj', opts=OPTS, input='deploy-stub.c')
  6045. if GetTarget() == 'windows':
  6046. PyTargetAdd('frozen_dllmain.obj', opts=OPTS, input='frozen_dllmain.c')
  6047. if GetTarget() == 'linux' or GetTarget() == 'freebsd':
  6048. # Setup rpath so libs can be found in the same directory as the deployed game
  6049. LibName('DEPLOYSTUB', "-Wl,--disable-new-dtags,-rpath,\\$ORIGIN")
  6050. LibName('DEPLOYSTUB', "-Wl,-z,origin")
  6051. LibName('DEPLOYSTUB', "-rdynamic")
  6052. PyTargetAdd('deploy-stub.exe', input='deploy-stub.obj')
  6053. if GetTarget() == 'windows':
  6054. PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
  6055. PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6056. if GetTarget() == 'windows':
  6057. PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
  6058. PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
  6059. PyTargetAdd('deploy-stubw.exe', opts=['SUBSYSTEM:WINDOWS', 'WINSHELL', 'DEPLOYSTUB', 'NOICON'])
  6060. elif GetTarget() == 'darwin':
  6061. DefSymbol('MACOS_APP_BUNDLE', 'MACOS_APP_BUNDLE')
  6062. OPTS = OPTS + ['MACOS_APP_BUNDLE']
  6063. PyTargetAdd('deploy-stubw.obj', opts=OPTS, input='deploy-stub.c')
  6064. PyTargetAdd('deploy-stubw.exe', input='deploy-stubw.obj')
  6065. PyTargetAdd('deploy-stubw.exe', opts=['MACOS_APP_BUNDLE', 'DEPLOYSTUB', 'NOICON'])
  6066. #
  6067. # Generate the models directory and samples directory
  6068. #
  6069. if not PkgSkip("DIRECT") and not RUNTIME and not PkgSkip("EGG"):
  6070. model_extensions = ["*.egg"]
  6071. # Check if we have access to an flt2egg utility, either self-compiled or on the system.
  6072. if ((PkgSkip("PANDATOOL")==0 and GetHost()==GetTarget()) or LocateBinary('flt2egg')):
  6073. model_extensions.append("*.flt")
  6074. for model in GetDirectoryContents("dmodels/src/misc", model_extensions):
  6075. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6076. newname = model[:-4] + ".egg.pz"
  6077. else:
  6078. newname = model[:-4] + ".egg"
  6079. TargetAdd(GetOutputDir()+"/models/misc/"+newname, input="dmodels/src/misc/"+model)
  6080. for model in GetDirectoryContents("dmodels/src/gui", model_extensions):
  6081. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6082. newname = model[:-4] + ".egg.pz"
  6083. else:
  6084. newname = model[:-4] + ".egg"
  6085. TargetAdd(GetOutputDir()+"/models/gui/"+newname, input="dmodels/src/gui/"+model)
  6086. for model in GetDirectoryContents("models", model_extensions):
  6087. if (PkgSkip("ZLIB")==0 and PkgSkip("DEPLOYTOOLS")==0 and not RTDIST):
  6088. newname = model[:-4] + ".egg.pz"
  6089. else:
  6090. newname = model[:-4] + ".egg"
  6091. TargetAdd(GetOutputDir()+"/models/"+newname, input="models/"+model)
  6092. if not PkgSkip("DIRECT") and not RUNTIME:
  6093. CopyAllFiles(GetOutputDir()+"/models/audio/sfx/", "dmodels/src/audio/sfx/", ".wav")
  6094. CopyAllFiles(GetOutputDir()+"/models/icons/", "dmodels/src/icons/", ".gif")
  6095. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".jpg")
  6096. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".png")
  6097. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgb")
  6098. CopyAllFiles(GetOutputDir()+"/models/maps/", "models/maps/", ".rgba")
  6099. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".jpg")
  6100. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".png")
  6101. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgb")
  6102. CopyAllFiles(GetOutputDir()+"/models/maps/", "dmodels/src/maps/", ".rgba")
  6103. #
  6104. # Build the rtdist.
  6105. #
  6106. if (RTDIST):
  6107. OPTS=['DIR:direct/src/p3d']
  6108. TargetAdd('_panda3d', opts=OPTS, input='panda3d.pdef')
  6109. TargetAdd('_coreapi', opts=OPTS, input='coreapi.pdef')
  6110. TargetAdd('_thirdparty', opts=OPTS, input='thirdparty.pdef')
  6111. #
  6112. # If we have a host URL and distributor, we can make .p3d deployment tools.
  6113. #
  6114. if not PkgSkip("DIRECT") and not PkgSkip("DEPLOYTOOLS") and not RUNTIME and not RTDIST and HOST_URL and DISTRIBUTOR:
  6115. OPTS=['DIR:direct/src/p3d']
  6116. TargetAdd('packp3d.p3d', opts=OPTS, input='panda3d.pdef')
  6117. TargetAdd('pdeploy.p3d', opts=OPTS, input='panda3d.pdef')
  6118. TargetAdd('pmerge.p3d', opts=OPTS, input='panda3d.pdef')
  6119. TargetAdd('ppackage.p3d', opts=OPTS, input='panda3d.pdef')
  6120. TargetAdd('ppatcher.p3d', opts=OPTS, input='panda3d.pdef')
  6121. ##########################################################################################
  6122. #
  6123. # Dependency-Based Distributed Build System.
  6124. #
  6125. ##########################################################################################
  6126. DEPENDENCYQUEUE=[]
  6127. for target in TARGET_LIST:
  6128. name = target.name
  6129. inputs = target.inputs
  6130. opts = target.opts
  6131. deps = target.deps
  6132. DEPENDENCYQUEUE.append([CompileAnything, [name, inputs, opts], [name], deps, []])
  6133. def BuildWorker(taskqueue, donequeue):
  6134. while True:
  6135. try:
  6136. task = taskqueue.get(timeout=1)
  6137. except:
  6138. ProgressOutput(None, "Waiting for tasks...")
  6139. task = taskqueue.get()
  6140. sys.stdout.flush()
  6141. if (task == 0): return
  6142. try:
  6143. task[0](*task[1])
  6144. donequeue.put(task)
  6145. except:
  6146. donequeue.put(0)
  6147. def AllSourcesReady(task, pending):
  6148. sources = task[3]
  6149. for x in sources:
  6150. if (x in pending):
  6151. return 0
  6152. sources = task[1][1]
  6153. for x in sources:
  6154. if (x in pending):
  6155. return 0
  6156. altsources = task[4]
  6157. for x in altsources:
  6158. if (x in pending):
  6159. return 0
  6160. return 1
  6161. def ParallelMake(tasklist):
  6162. # Create the communication queues.
  6163. donequeue = queue.Queue()
  6164. taskqueue = queue.Queue()
  6165. # Build up a table listing all the pending targets
  6166. #task = [CompileAnything, [name, inputs, opts], [name], deps, []]
  6167. # task[2] = [name]
  6168. # task[3] = deps
  6169. # The python tool package, in particular fltegg seems to throw parallelmake off
  6170. # A hack for now is to divide the tasklist into two parts, one to be built in parallel
  6171. # and another subpart to be built sequentially. The most time consuming part of the process
  6172. # is the c++ code generation anyways.
  6173. tasklist_seq = []
  6174. i = 0
  6175. while i < len(tasklist):
  6176. if tasklist[i][2][0].endswith('.egg') | tasklist[i][2][0].endswith('.egg.pz'):
  6177. break
  6178. i += 1
  6179. if i < len(tasklist):
  6180. tasklist_seq = tasklist[i:]
  6181. tasklist = tasklist[:i]
  6182. iNumStartingTasks = len(tasklist)
  6183. pending = {}
  6184. for task in tasklist:
  6185. for target in task[2]:
  6186. pending[target] = 1
  6187. # Create the workers
  6188. for slave in range(THREADCOUNT):
  6189. th = threading.Thread(target=BuildWorker, args=[taskqueue, donequeue])
  6190. th.daemon = True
  6191. th.start()
  6192. # Feed tasks to the workers.
  6193. tasksqueued = 0
  6194. while True:
  6195. if (tasksqueued < THREADCOUNT):
  6196. extras = []
  6197. for task in tasklist:
  6198. if (tasksqueued < THREADCOUNT) and (AllSourcesReady(task, pending)):
  6199. if (NeedsBuild(task[2], task[3])):
  6200. tasksqueued += 1
  6201. taskqueue.put(task)
  6202. else:
  6203. for target in task[2]:
  6204. del pending[target]
  6205. else:
  6206. extras.append(task)
  6207. tasklist = extras
  6208. sys.stdout.flush()
  6209. if (tasksqueued == 0): break
  6210. donetask = donequeue.get()
  6211. if (donetask == 0):
  6212. exit("Build process aborting.")
  6213. sys.stdout.flush()
  6214. tasksqueued -= 1
  6215. JustBuilt(donetask[2], donetask[3])
  6216. for target in donetask[2]:
  6217. del pending[target]
  6218. # Kill the workers.
  6219. for slave in range(THREADCOUNT):
  6220. taskqueue.put(0)
  6221. # Make sure there aren't any unsatisfied tasks
  6222. if len(tasklist) > 0:
  6223. exit("Dependency problems: " + str(len(tasklist)) + " tasks not finished. First task unsatisfied: "+str(tasklist[0][2]))
  6224. SequentialMake(tasklist_seq)
  6225. def SequentialMake(tasklist):
  6226. i = 0
  6227. for task in tasklist:
  6228. if (NeedsBuild(task[2], task[3])):
  6229. task[0](*task[1] + [(i * 100.0) / len(tasklist)])
  6230. JustBuilt(task[2], task[3])
  6231. i += 1
  6232. def RunDependencyQueue(tasklist):
  6233. if (THREADCOUNT!=0):
  6234. ParallelMake(tasklist)
  6235. else:
  6236. SequentialMake(tasklist)
  6237. try:
  6238. RunDependencyQueue(DEPENDENCYQUEUE)
  6239. finally:
  6240. SaveDependencyCache()
  6241. # Run the test suite.
  6242. if RUNTESTS:
  6243. cmdstr = BracketNameWithQuotes(SDK["PYTHONEXEC"].replace('\\', '/'))
  6244. if sys.version_info >= (2, 6):
  6245. cmdstr += " -B"
  6246. cmdstr += " -m pytest tests"
  6247. if GetVerbose():
  6248. cmdstr += " --verbose"
  6249. oscmd(cmdstr)
  6250. # Write out information about the Python versions in the built dir.
  6251. python_version_info = GetCurrentPythonVersionInfo()
  6252. UpdatePythonVersionInfoFile(python_version_info)
  6253. ##########################################################################################
  6254. #
  6255. # The Installers
  6256. #
  6257. # Under windows, we can build an 'exe' package using NSIS
  6258. # Under linux, we can build a 'deb' package or an 'rpm' package.
  6259. # Under OSX, we can make a 'dmg' package.
  6260. #
  6261. ##########################################################################################
  6262. if INSTALLER:
  6263. ProgressOutput(100.0, "Building installer")
  6264. from makepackage import MakeInstaller
  6265. # When using the --installer flag, only install for the current version.
  6266. python_versions = []
  6267. if python_version_info:
  6268. python_versions.append(python_version_info)
  6269. MakeInstaller(version=VERSION, outputdir=GetOutputDir(),
  6270. optimize=GetOptimize(), compressor=COMPRESSOR,
  6271. debversion=DEBVERSION, rpmversion=RPMVERSION, rpmrelease=RPMRELEASE,
  6272. runtime=RUNTIME, python_versions=python_versions)
  6273. if WHEEL:
  6274. ProgressOutput(100.0, "Building wheel")
  6275. from makewheel import makewheel
  6276. makewheel(WHLVERSION, GetOutputDir())
  6277. ##########################################################################################
  6278. #
  6279. # Print final status report.
  6280. #
  6281. ##########################################################################################
  6282. WARNINGS.append("Elapsed Time: "+PrettyTime(time.time() - STARTTIME))
  6283. printStatus("Makepanda Final Status Report", WARNINGS)
  6284. print(GetColor("green") + "Build successfully finished, elapsed time: " + PrettyTime(time.time() - STARTTIME) + GetColor())